Skip to content

Commit

Permalink
Fix library install name and plugin type on macOS
Browse files Browse the repository at this point in the history
macOS requires an absolute path in the install name. Also, use `-bundle`
for plugins which is preferred for loadable modules.
  • Loading branch information
mohd-akram committed May 17, 2024
1 parent d94c794 commit 92aa034
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/libpe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ else ifeq ($(PLATFORM_OS), GNU/kFreeBSD)
$(LINK) -shared -Wl,-soname,$(LIBNAME).so.1 $(LDFLAGS) -o $(LIBNAME).so $^ $(LIBS)
else ifeq ($(PLATFORM_OS), Darwin)
$(LINK) -headerpad_max_install_names -dynamiclib \
-flat_namespace -install_name $(LIBNAME).$(VERSION).dylib \
-flat_namespace -install_name $(libdir)/$(LIBNAME).$(VERSION).dylib \
-current_version $(VERSION) -compatibility_version $(VERSION) \
$(LDFLAGS) -o $(LIBNAME).dylib $^ $(LIBS)
else ifeq ($(PLATFORM_OS), CYGWIN)
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ else ifeq ($(PLATFORM_OS), GNU)
else ifeq ($(PLATFORM_OS), GNU/kFreeBSD)
$(LINK) -shared -Wl,-soname,$(LIBNAME).so.1 $(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).so $^
else ifeq ($(PLATFORM_OS), Darwin)
$(LINK) -headerpad_max_install_names -dynamiclib \
$(LINK) -headerpad_max_install_names -bundle \
-undefined dynamic_lookup -fno-common \
-install_name $(LIBNAME).$(VERSION).dylib \
-current_version $(VERSION) -compatibility_version $(VERSION) \
$(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).dylib $^
else ifeq ($(PLATFORM_OS), CYGWIN)
$(LINK) -shared $(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).dll $^
Expand Down

0 comments on commit 92aa034

Please sign in to comment.