From 90f9a5e65e8dab3fad0a60530d3ffc582f1b1a93 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sun, 11 May 2014 21:22:25 -0500 Subject: [PATCH] build: fix order of rpath In my system `pkg-config --libs talloc` returns 'Wl,-rpath,/usr/lib -ltalloc' (probably wrongly) which causes the final LDFLAGS to be something like '-Wl,-rpath,/usr/lib -Wl,-rpath,/opt/notmuch/lib', which causes the RUNPATH to be '/usr/lib:/opt/notmuch/lib', so basically defeating the whole purpose of RUNPATH. I noticed this when my /opt/notmuch/bin/notmuch (0.17) started updating the database after I updated the system (which updated the system's notmuch). This shouldn't happen. Let's move the RUNPATH flags before other external flags have a chance of screwing the build. Signed-off-by: Felipe Contreras --- Makefile.local | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.local b/Makefile.local index 086b5a11..4f8f4640 100644 --- a/Makefile.local +++ b/Makefile.local @@ -46,15 +46,16 @@ PV_FILE=bindings/python/notmuch/version.py # Smash together user's values with our extra values FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS) FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) $(CONFIGURE_CXXFLAGS) -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS) +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch +ifeq ($(LIBDIR_IN_LDCONFIG),0) +FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS) +endif +FINAL_NOTMUCH_LDFLAGS += $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS) FINAL_NOTMUCH_LINKER = CC ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS) FINAL_NOTMUCH_LINKER = CXX endif -ifeq ($(LIBDIR_IN_LDCONFIG),0) -FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS) -endif FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(CONFIGURE_LDFLAGS) .PHONY: all -- 2.43.0