[PATCH 2/2] build: only link to what we really use

Felipe Contreras felipe.contreras at gmail.com
Fri Oct 29 16:16:47 PDT 2010


At least linux has the -Wl,--as-needed option.

Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
---
 Makefile.local |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 9fed725..70c395a 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -33,7 +33,9 @@ FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CC
-ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
+ifeq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
+FINAL_NOTMUCH_LDFLAGS += -Wl,--as-needed
+else
 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CXX
 endif
-- 
1.7.3.2.2.g0dc5c



More information about the notmuch mailing list