diff options
author | Carl Worth <cworth@cworth.org> | 2010-04-16 11:51:56 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-16 11:51:56 -0700 |
commit | b068f1cc849910045ab11ac84419814b5d1727ee (patch) | |
tree | 1c73c4a628d86872ac89dcbe8aca5db2077fe524 /Makefile.local | |
parent | 533b02945d28f2a31cc25a87d270b8e2a150310d (diff) |
Fix final link of notmuch binary to use C compiler if possible.
On Linux, a C program that depends on a C library which in turn
depends on a C++ can be linked with the C compiler, (avoiding a direct
link from the program to the C++ runtime libraries).
Other platforms with less fancy linkers need to use the C++ compiler
for this linking.
Diffstat (limited to 'Makefile.local')
-rw-r--r-- | Makefile.local | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.local b/Makefile.local index b338d8b2..51a83a8c 100644 --- a/Makefile.local +++ b/Makefile.local @@ -32,8 +32,10 @@ GPG_FILE=$(SHA1_FILE).asc FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch +FINAL_NOTMUCH_LINKER = CC ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS) +FINAL_NOTMUCH_LINKER = CXX endif FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS) @@ -235,7 +237,7 @@ notmuch: $(notmuch_client_modules) lib/libnotmuch.a $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@ notmuch-shared: $(notmuch_client_modules) lib/$(LINKER_NAME) - $(call quiet,CXX $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@ + $(call quiet,$(FINAL_NOTMUCH_LINKER) $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@ notmuch.1.gz: notmuch.1 gzip --stdout $^ > $@ |