]> git.notmuchmail.org Git - notmuch/commitdiff
Makefile: Fix library linking command for OS X
authorCarl Worth <cworth@cworth.org>
Wed, 14 Apr 2010 23:16:05 +0000 (16:16 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 14 Apr 2010 23:16:05 +0000 (16:16 -0700)
I'm not sure which system Aaron used, but on the machine I have access
to, (Darwin 8.11.0), the -shared and -dylib_install_name options are
not recognized. Instead I use -dynamic_lib and -install_name as
documented here:

http://www.finkproject.org/doc/porting/shared.php

lib/Makefile.local

index f001e75b9a01040490f3d464350f9cbc5c330195..1eb1f4ea3b59ed8c21e56228cfb95f9195b42838 100644 (file)
@@ -28,13 +28,13 @@ LIBRARY_SUFFIX = dylib
 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
 LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
 LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
-LIBRARY_LINK_FLAG = -Wl,-dylib_install_name -Wl,$(SONAME)
+LIBRARY_LINK_FLAG = -dynamiclib -install_name $(SONAME)
 else
 LIBRARY_SUFFIX = so
 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
 else
 LIBRARY_SUFFIX = so
 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
-LIBRARY_LINK_FLAG = -Wl,-soname=$(SONAME)
+LIBRARY_LINK_FLAG = -shared -Wl,-soname=$(SONAME)
 endif
 
 dir := lib
 endif
 
 dir := lib
@@ -63,7 +63,7 @@ $(dir)/libnotmuch.a: $(libnotmuch_modules)
        $(call quiet,AR) rcs $@ $^
 
 $(dir)/$(LIBNAME): $(libnotmuch_modules)
        $(call quiet,AR) rcs $@ $^
 
 $(dir)/$(LIBNAME): $(libnotmuch_modules)
-       $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -shared $(LIBRARY_LINK_FLAG) -o $@
+       $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
 
 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
        ln -sf $(LIBNAME) $@
 
 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
        ln -sf $(LIBNAME) $@