1 Return-Path: <aaronecay@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 7E29041733B
\r
6 for <notmuch@notmuchmail.org>; Sun, 11 Apr 2010 16:45:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
\r
13 DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id Sd-izVQCil3y for <notmuch@notmuchmail.org>;
\r
18 Sun, 11 Apr 2010 16:45:05 -0700 (PDT)
\r
19 Received: from mail-qy0-f191.google.com (mail-qy0-f191.google.com
\r
21 by olra.theworths.org (Postfix) with ESMTP id 11BD641733A
\r
22 for <notmuch@notmuchmail.org>; Sun, 11 Apr 2010 16:45:05 -0700 (PDT)
\r
23 Received: by qyk29 with SMTP id 29so5262228qyk.2
\r
24 for <notmuch@notmuchmail.org>; Sun, 11 Apr 2010 16:45:04 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=domainkey-signature:received:received:from:to:subject:date
\r
27 :message-id:x-mailer:in-reply-to:references;
\r
28 bh=kCLRfqM4KZefupRpLKqWQRaQh+9Zfe46md9G4otu3H8=;
\r
29 b=Wk54PPA2BDSjwrgXamCIeT/BAmvJ7NxyCwKKaH6H+vSv6wf7JWoQETMzqeAkBcmEDS
\r
30 XHNRh6Bnqzw9874br3wdv6A0uoJXzMBO2hclXvkQWswxYxopee9I9nZx2kUuUNamCLwn
\r
31 yotOtmByixHQ1QCZsNsWQk29y24PxEJoA7JYo=
\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
33 h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;
\r
34 b=Ew4vLampJakBVoz5KjRBJkD+s1r1YeR6BEeygTOjb2iIi9EZ/cJmxd3oMffU0bj2x/
\r
35 c3VB0rwX+yN7ufESkTC0hKYcCgCJN0BO7TIVU+C9YvRjmiJYauiqaZpmVTA6gJlh7/0n
\r
36 sux2bhB8QGYH1B5xIzYWzpo0woE1BElEmoMRU=
\r
37 Received: by 10.224.123.18 with SMTP id n18mr1153146qar.244.1271029504515;
\r
38 Sun, 11 Apr 2010 16:45:04 -0700 (PDT)
\r
39 Received: from localhost.localdomain (vpm120.wireless-resnet.upenn.edu
\r
41 by mx.google.com with ESMTPS id 8sm7425346qwj.50.2010.04.11.16.45.03
\r
42 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
43 Sun, 11 Apr 2010 16:45:04 -0700 (PDT)
\r
44 From: Aaron Ecay <aaronecay@gmail.com>
\r
45 To: notmuch@notmuchmail.org
\r
46 Subject: [PATCH 3/4] Add infrastructure for building shared library on OS X.
\r
47 Date: Sun, 11 Apr 2010 19:44:53 -0400
\r
48 Message-Id: <1271029494-89014-3-git-send-email-aaronecay@gmail.com>
\r
49 X-Mailer: git-send-email 1.7.0.4
\r
50 In-Reply-To: <4bc25ea0.86c3f10a.45a3.ffff80d3@mx.google.com>
\r
51 References: <4bc25ea0.86c3f10a.45a3.ffff80d3@mx.google.com>
\r
52 X-BeenThere: notmuch@notmuchmail.org
\r
53 X-Mailman-Version: 2.1.13
\r
55 List-Id: "Use and development of the notmuch mail system."
\r
56 <notmuch.notmuchmail.org>
\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
60 List-Post: <mailto:notmuch@notmuchmail.org>
\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
64 X-List-Received-Date: Sun, 11 Apr 2010 23:45:06 -0000
\r
66 This patch adds a configure check for OS X (actually Darwin),
\r
67 and sets up the Makefiles to build a proper shared library on
\r
70 Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
\r
73 Makefile.local | 2 +-
\r
74 configure | 13 +++++++++++++
\r
75 lib/Makefile.local | 16 ++++++++++++++--
\r
76 4 files changed, 29 insertions(+), 4 deletions(-)
\r
78 diff --git a/Makefile b/Makefile
\r
79 index faaaec6..86e08fa 100644
\r
82 @@ -18,4 +18,4 @@ extra_cxxflags :=
\r
83 # Finally, include all of the Makefile.local fragments where all the
\r
84 # real work is done.
\r
86 -include $(subdirs:%=%/Makefile.local) Makefile.local
\r
87 +include Makefile.config $(subdirs:%=%/Makefile.local) Makefile.local
\r
88 diff --git a/Makefile.local b/Makefile.local
\r
89 index c04044c..99d5b64 100644
\r
90 --- a/Makefile.local
\r
91 +++ b/Makefile.local
\r
92 @@ -213,7 +213,7 @@ notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
\r
93 notmuch: $(notmuch_client_modules) lib/libnotmuch.a
\r
94 $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@
\r
96 -notmuch-shared: $(notmuch_client_modules) lib/libnotmuch.so
\r
97 +notmuch-shared: $(notmuch_client_modules) lib/$(LINKER_NAME)
\r
98 $(call quiet,CXX $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@
\r
100 notmuch.1.gz: notmuch.1
\r
101 diff --git a/configure b/configure
\r
102 index 5af7852..da45572 100755
\r
105 @@ -234,6 +234,15 @@ else
\r
109 +printf "Checking for Mac OS X (for shared library)... "
\r
110 +if [ `uname` = "Darwin" ] ; then
\r
118 if [ $errors -gt 0 ]; then
\r
121 @@ -384,6 +393,10 @@ zsh_completion_dir = \$(prefix)/share/zsh/functions/Completion/Unix
\r
122 # build its own version)
\r
123 HAVE_GETLINE = ${have_getline}
\r
125 +# Whether we are building on OS X. This will affect how we build the
\r
127 +MAC_OS_X = ${mac_os_x}
\r
129 # Flags needed to compile and link against Xapian
\r
130 XAPIAN_CXXFLAGS = ${xapian_cxxflags}
\r
131 XAPIAN_LDFLAGS = ${xapian_ldflags}
\r
132 diff --git a/lib/Makefile.local b/lib/Makefile.local
\r
133 index 0e3a4d1..7e73810 100644
\r
134 --- a/lib/Makefile.local
\r
135 +++ b/lib/Makefile.local
\r
136 @@ -22,14 +22,26 @@ LIBNOTMUCH_VERSION_MINOR = 0
\r
137 # simply compatible changes to the implementation).
\r
138 LIBNOTMUCH_VERSION_RELEASE = 0
\r
140 -LINKER_NAME = libnotmuch.so
\r
141 +ifeq ($(MAC_OS_X),1)
\r
142 +LIBRARY_SUFFIX = dylib
\r
143 +# On OS X, library version numbers go before suffix.
\r
144 +LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
\r
145 +SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
\r
146 +LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
\r
147 +LIBRARY_LINK_FLAG = -Wl,-dylib_install_name -Wl,$(SONAME)
\r
149 +LIBRARY_SUFFIX = so
\r
150 +LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
\r
151 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
\r
152 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
\r
153 +LIBRARY_LINK_FLAG = -Wl,-soname=$(SONAME)
\r
157 extra_cflags += -I$(dir) -fPIC
\r
159 libnotmuch_c_srcs = \
\r
160 + $(notmuch_compat_srcs) \
\r
162 $(dir)/message-file.c \
\r
163 $(dir)/messages.c \
\r
164 @@ -51,7 +63,7 @@ $(dir)/libnotmuch.a: $(libnotmuch_modules)
\r
165 $(call quiet,AR) rcs $@ $^
\r
167 $(dir)/$(LIBNAME): $(libnotmuch_modules)
\r
168 - $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@
\r
169 + $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -shared $(LIBRARY_LINK_FLAG) -o $@
\r
171 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
\r
172 ln -sf $(LIBNAME) $@
\r