* [PATCH] Fix compilation on Mac OS X 10.6.8
@ 2015-06-30 21:29 Nate Eagleson
2015-06-30 21:29 ` [PATCH] build: Support " Nate Eagleson
0 siblings, 1 reply; 5+ messages in thread
From: Nate Eagleson @ 2015-06-30 21:29 UTC (permalink / raw)
To: notmuch
Here's a fix for compilation failures on Mac OS X 10.6.8.
As a newbie to the codebase, and one with not much Makefile experience in general,
I'm more than happy to make any requested changes, or to take an entirely
different approach if necessary.
See previous discussion for more context:
http://notmuchmail.org/pipermail/notmuch/2015/020601.html
Nate Eagleson (1):
build: Support Mac OS X 10.6.8
Makefile.local | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--
1.8.1.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] build: Support Mac OS X 10.6.8
2015-06-30 21:29 [PATCH] Fix compilation on Mac OS X 10.6.8 Nate Eagleson
@ 2015-06-30 21:29 ` Nate Eagleson
2015-07-01 6:07 ` David Bremner
2015-07-01 15:29 ` J. Lewis Muir
0 siblings, 2 replies; 5+ messages in thread
From: Nate Eagleson @ 2015-06-30 21:29 UTC (permalink / raw)
To: notmuch
OS X 10.6.8 has a built-in library named libutil.dylib and a version
of ld that picks that up instead of util/libutil.a.
We now use an absolute path to util/libutil.a, so that notmuch can be
built successfully on 10.6.8.
---
Makefile.local | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile.local b/Makefile.local
index 61a9c4c..c82b43a 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -43,10 +43,16 @@ GPG_FILE=$(SHA1_FILE).asc
PV_FILE=bindings/python/notmuch/version.py
+# Mac OS X 10.6 has a built-in libutil.dylib that prevents ld from
+# picking up notmuch's libutil.a. The best way to prefer our local
+# libutil.a is to specify it via absolute path, which should work on
+# all supported OSes.
+LIBUTIL_PATH=${srcdir}/util/libutil.a
+
# 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
+FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) $(LIBUTIL_PATH) -Llib -lnotmuch -Wl,-t
ifeq ($(LIBDIR_IN_LDCONFIG),0)
FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS)
endif
--
1.8.1.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] build: Support Mac OS X 10.6.8
2015-06-30 21:29 ` [PATCH] build: Support " Nate Eagleson
@ 2015-07-01 6:07 ` David Bremner
2015-07-01 15:29 ` J. Lewis Muir
1 sibling, 0 replies; 5+ messages in thread
From: David Bremner @ 2015-07-01 6:07 UTC (permalink / raw)
To: Nate Eagleson, notmuch
Nate Eagleson <nate@nateeag.com> writes:
> OS X 10.6.8 has a built-in library named libutil.dylib and a version
> of ld that picks that up instead of util/libutil.a.
>
> We now use an absolute path to util/libutil.a, so that notmuch can be
> built successfully on 10.6.8.
I'd like a one line subject that mentions libutil.a and perhaps
"absolute path"
>
> +# Mac OS X 10.6 has a built-in libutil.dylib that prevents ld from
> +# picking up notmuch's libutil.a. The best way to prefer our local
> +# libutil.a is to specify it via absolute path, which should work on
> +# all supported OSes.
> +LIBUTIL_PATH=${srcdir}/util/libutil.a
> +
This needs to be relative to ${dir}, not ${srcdir} in order not to break
out of tree builds. You can test with
% mkdir -p /tmp/foo-build
% cd /tmp/foo-build
% ~/projects/notmuch/configure && make
Also, one Makefile gotcha is that anything using $(dir) should use :=
rather than = to force immediate expansion.
Cheers,
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] build: Support Mac OS X 10.6.8
2015-06-30 21:29 ` [PATCH] build: Support " Nate Eagleson
2015-07-01 6:07 ` David Bremner
@ 2015-07-01 15:29 ` J. Lewis Muir
2015-07-02 12:05 ` Nate Eagleson
1 sibling, 1 reply; 5+ messages in thread
From: J. Lewis Muir @ 2015-07-01 15:29 UTC (permalink / raw)
To: Nate Eagleson, notmuch
On 6/30/15 4:29 PM, Nate Eagleson wrote:
> +# Mac OS X 10.6 has a built-in libutil.dylib that prevents ld from
> +# picking up notmuch's libutil.a. The best way to prefer our local
> +# libutil.a is to specify it via absolute path, which should work on
> +# all supported OSes.
> +LIBUTIL_PATH=${srcdir}/util/libutil.a
Hi, Nate.
I think it would be better to make the above comment not specific to OS
X, but instead just refer to "systems that have a built-in util library"
or similar. For example, NetBSD has a built-in util library [1]. I
don't have access to a FreeBSD system, but it looks like FreeBSD might
have a built-in util library too [2].
Similarly for the one-line commit summary since this change is not
specific to OS X.
Regards,
Lewis
[1] http://netbsd.gw.com/cgi-bin/man-cgi?libutil++NetBSD-current
[2] http://svnweb.freebsd.org/base/head/lib/libutil/Makefile?view=markup
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] build: Support Mac OS X 10.6.8
2015-07-01 15:29 ` J. Lewis Muir
@ 2015-07-02 12:05 ` Nate Eagleson
0 siblings, 0 replies; 5+ messages in thread
From: Nate Eagleson @ 2015-07-02 12:05 UTC (permalink / raw)
To: J. Lewis Muir, notmuch
"J. Lewis Muir" <jlmuir@imca-cat.org> writes:
> On 6/30/15 4:29 PM, Nate Eagleson wrote:
>> +# Mac OS X 10.6 has a built-in libutil.dylib that prevents ld from
>> +# picking up notmuch's libutil.a. The best way to prefer our local
>> +# libutil.a is to specify it via absolute path, which should work on
>> +# all supported OSes.
>> +LIBUTIL_PATH=${srcdir}/util/libutil.a
>
> Hi, Nate.
>
> I think it would be better to make the above comment not specific to OS
> X, but instead just refer to "systems that have a built-in util library"
> or similar. For example, NetBSD has a built-in util library [1]. I
> don't have access to a FreeBSD system, but it looks like FreeBSD might
> have a built-in util library too [2].
>
> Similarly for the one-line commit summary since this change is not
> specific to OS X.
>
> Regards,
>
> Lewis
>
> [1] http://netbsd.gw.com/cgi-bin/man-cgi?libutil++NetBSD-current
> [2] http://svnweb.freebsd.org/base/head/lib/libutil/Makefile?view=markup
Good point. I'll update that.
-Nate
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-02 12:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 21:29 [PATCH] Fix compilation on Mac OS X 10.6.8 Nate Eagleson
2015-06-30 21:29 ` [PATCH] build: Support " Nate Eagleson
2015-07-01 6:07 ` David Bremner
2015-07-01 15:29 ` J. Lewis Muir
2015-07-02 12:05 ` Nate Eagleson
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).