| 1 | Apply patch where build fails if the system has a libutil: |
| 2 | https://notmuchmail.org/pipermail/notmuch/2017/024295.html |
| 3 | Already applied upstream so we'll remove this at the next update. |
| 4 | |
| 5 | Apparently some systems (MacOS?) have a system library called libutil |
| 6 | and the name conflict causes problems. Since this library is quite |
| 7 | notmuch specific, rename it to something less generic. |
| 8 | --- |
| 9 | Makefile.global | 2 +- |
| 10 | Makefile.local | 2 +- |
| 11 | lib/Makefile.local | 4 ++-- |
| 12 | test/Makefile.local | 6 +++--- |
| 13 | util/Makefile.local | 10 +++++----- |
| 14 | 5 files changed, 12 insertions(+), 12 deletions(-) |
| 15 | |
| 16 | diff --git a/Makefile.global b/Makefile.global |
| 17 | index 7a78e9b5..cae4c7d1 100644 |
| 18 | --- a/Makefile.global |
| 19 | +++ b/Makefile.global |
| 20 | @@ -52,7 +52,7 @@ PV_FILE=bindings/python/notmuch/version.py |
| 21 | STD_CFLAGS := -std=gnu99 |
| 22 | FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(STD_CFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS) |
| 23 | FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) $(CONFIGURE_CXXFLAGS) |
| 24 | -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch |
| 25 | +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lnotmuch_util -Llib -lnotmuch |
| 26 | ifeq ($(LIBDIR_IN_LDCONFIG),0) |
| 27 | FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS) |
| 28 | endif |
| 29 | diff --git a/Makefile.local b/Makefile.local |
| 30 | index e75b6eae..03eafaaa 100644 |
| 31 | --- a/Makefile.local |
| 32 | +++ b/Makefile.local |
| 33 | @@ -241,7 +241,7 @@ notmuch_client_modules = $(notmuch_client_srcs:.c=.o) |
| 34 | |
| 35 | notmuch.o: version.stamp |
| 36 | |
| 37 | -notmuch: $(notmuch_client_modules) lib/libnotmuch.a util/libutil.a parse-time-string/libparse-time-string.a |
| 38 | +notmuch: $(notmuch_client_modules) lib/libnotmuch.a util/libnotmuch_util.a parse-time-string/libparse-time-string.a |
| 39 | $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@ |
| 40 | |
| 41 | notmuch-shared: $(notmuch_client_modules) lib/$(LINKER_NAME) |
| 42 | diff --git a/lib/Makefile.local b/lib/Makefile.local |
| 43 | index cd92fc79..d36fd5a0 100644 |
| 44 | --- a/lib/Makefile.local |
| 45 | +++ b/lib/Makefile.local |
| 46 | @@ -60,8 +60,8 @@ libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o) |
| 47 | $(dir)/libnotmuch.a: $(libnotmuch_modules) |
| 48 | $(call quiet,AR) rcs $@ $^ |
| 49 | |
| 50 | -$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym util/libutil.a parse-time-string/libparse-time-string.a |
| 51 | - $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ util/libutil.a parse-time-string/libparse-time-string.a |
| 52 | +$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym util/libnotmuch_util.a parse-time-string/libparse-time-string.a |
| 53 | + $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ util/libnotmuch_util.a parse-time-string/libparse-time-string.a |
| 54 | |
| 55 | notmuch.sym: $(srcdir)/$(dir)/notmuch.h $(libnotmuch_modules) |
| 56 | sh $(srcdir)/$(lib)/gen-version-script.sh $< $(libnotmuch_modules) > $@ |
| 57 | diff --git a/test/Makefile.local b/test/Makefile.local |
| 58 | index 46805972..0df72c92 100644 |
| 59 | --- a/test/Makefile.local |
| 60 | +++ b/test/Makefile.local |
| 61 | @@ -12,15 +12,15 @@ smtp_dummy_srcs = \ |
| 62 | |
| 63 | smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o) |
| 64 | |
| 65 | -$(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libutil.a |
| 66 | +$(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libnotmuch_util.a |
| 67 | $(call quiet,CC) $^ -o $@ $(LDFLAGS) |
| 68 | |
| 69 | -$(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libutil.a |
| 70 | +$(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libnotmuch_util.a |
| 71 | $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS) |
| 72 | |
| 73 | random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \ |
| 74 | notmuch-config.o status.o command-line-arguments.o \ |
| 75 | - lib/libnotmuch.a util/libutil.a \ |
| 76 | + lib/libnotmuch.a util/libnotmuch_util.a \ |
| 77 | parse-time-string/libparse-time-string.a |
| 78 | |
| 79 | $(dir)/random-corpus: $(random_corpus_deps) |
| 80 | diff --git a/util/Makefile.local b/util/Makefile.local |
| 81 | index 905f2376..a6962d49 100644 |
| 82 | --- a/util/Makefile.local |
| 83 | +++ b/util/Makefile.local |
| 84 | @@ -3,14 +3,14 @@ |
| 85 | dir := util |
| 86 | extra_cflags += -I$(srcdir)/$(dir) |
| 87 | |
| 88 | -libutil_c_srcs := $(dir)/xutil.c $(dir)/error_util.c $(dir)/hex-escape.c \ |
| 89 | +libnotmuch_util_c_srcs := $(dir)/xutil.c $(dir)/error_util.c $(dir)/hex-escape.c \ |
| 90 | $(dir)/string-util.c $(dir)/talloc-extra.c $(dir)/zlib-extra.c \ |
| 91 | $(dir)/util.c |
| 92 | |
| 93 | -libutil_modules := $(libutil_c_srcs:.c=.o) |
| 94 | +libnotmuch_util_modules := $(libnotmuch_util_c_srcs:.c=.o) |
| 95 | |
| 96 | -$(dir)/libutil.a: $(libutil_modules) |
| 97 | +$(dir)/libnotmuch_util.a: $(libnotmuch_util_modules) |
| 98 | $(call quiet,AR) rcs $@ $^ |
| 99 | |
| 100 | -SRCS := $(SRCS) $(libutil_c_srcs) |
| 101 | -CLEAN := $(CLEAN) $(libutil_modules) $(dir)/libutil.a |
| 102 | +SRCS := $(SRCS) $(libnotmuch_util_c_srcs) |
| 103 | +CLEAN := $(CLEAN) $(libnotmuch_util_modules) $(dir)/libnotmuch_util.a |
| 104 | -- |
| 105 | 2.11.0 |