From: Ben Gamari Date: Sun, 24 Jan 2010 21:23:35 +0000 (+1900) Subject: [notmuch] [PATCH 2/2] Build and link against notmuch shared library X-Git-Url: http://git.tremily.us/?p=notmuch-archives.git;a=commitdiff_plain;h=5b2e97badaabafeed511fa530ef1f3b9db6c4e9b [notmuch] [PATCH 2/2] Build and link against notmuch shared library --- diff --git a/d0/564e263b1c534ee01e25365dd1d324a2434e5c b/d0/564e263b1c534ee01e25365dd1d324a2434e5c new file mode 100644 index 000000000..4706712ef --- /dev/null +++ b/d0/564e263b1c534ee01e25365dd1d324a2434e5c @@ -0,0 +1,132 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 09AA4431FC9 + for ; Sun, 24 Jan 2010 13:23:54 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.819 +X-Spam-Level: +X-Spam-Status: No, score=-1.819 tagged_above=-999 required=5 tests=[AWL=0.780, + BAYES_00=-2.599] autolearn=ham +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id PgzW+EfFAzpy for ; + Sun, 24 Jan 2010 13:23:52 -0800 (PST) +Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com + [209.85.221.172]) + by olra.theworths.org (Postfix) with ESMTP id 13ECA431FC0 + for ; Sun, 24 Jan 2010 13:23:52 -0800 (PST) +Received: by mail-qy0-f172.google.com with SMTP id 2so1454613qyk.6 + for ; Sun, 24 Jan 2010 13:23:51 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; + h=domainkey-signature:received:received:from:to:cc:subject:date + :message-id:x-mailer:in-reply-to:references; + bh=2REmTz3dNITQCO8FgMdhpWGbC8kJNZsoJmyHL7LuMNo=; + b=xtxKq51viZS47tam1cn0fczl7r4sK+6gCQ8Znrgm4481mmYEpQDXCWVNYx3IMECyTZ + gD2FyXNzhxzMhL/6L+ZralarDfFp7nH1OrDN+BxOhrQc4R9YpTvfd9zfAlWYv/qGRBuW + gosjR/w2l/SWcJ0/HeBurWza2HNCPBGbvitL8= +DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + b=BTGbRFimTWUhUu19blljzcNLu6U3WggTiJsS2pyd/EmTxirQ3QRLkj1clGyNEsT3Ue + ApJDDjwoEvI6y4bir7B+DXZd8UjaCj1kxo9m6xnz9Nub0yyb84aID5Wvpb8NhbgR3/Va + bY+UNwKZG/h82by/GU6MMGoweJpqQwh1brSYw= +Received: by 10.224.87.228 with SMTP id x36mr3589999qal.232.1264368231754; + Sun, 24 Jan 2010 13:23:51 -0800 (PST) +Received: from localhost.localdomain + (pool-72-70-241-97.spfdma.east.verizon.net [72.70.241.97]) + by mx.google.com with ESMTPS id 6sm10145914qwk.41.2010.01.24.13.23.49 + (version=SSLv3 cipher=RC4-MD5); Sun, 24 Jan 2010 13:23:50 -0800 (PST) +From: Ben Gamari +To: notmuch@notmuchmail.org, + cworth@cworth.org +Date: Sun, 24 Jan 2010 16:23:35 -0500 +Message-Id: <1264368215-7101-3-git-send-email-bgamari.foss@gmail.com> +X-Mailer: git-send-email 1.6.3.3 +In-Reply-To: <1264368215-7101-2-git-send-email-bgamari.foss@gmail.com> +References: <1264272821-sup-5331@ben-laptop> + <1264368215-7101-1-git-send-email-bgamari.foss@gmail.com> + <1264368215-7101-2-git-send-email-bgamari.foss@gmail.com> +Subject: [notmuch] [PATCH 2/2] Build and link against notmuch shared library +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 24 Jan 2010 21:23:54 -0000 + +--- + Makefile | 1 + + Makefile.local | 6 ++++-- + lib/Makefile.local | 10 ++++++---- + 3 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index 64b9d4a..6f296bb 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,3 +1,4 @@ ++SONAME = libnotmuch.so.1 + WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum + WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations + +diff --git a/Makefile.local b/Makefile.local +index d579242..a61eb67 100644 +--- a/Makefile.local ++++ b/Makefile.local +@@ -21,8 +21,8 @@ notmuch_client_srcs = \ + show-message.c + + notmuch_client_modules = $(notmuch_client_srcs:.c=.o) +-notmuch: $(notmuch_client_modules) lib/notmuch.a +- $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -o $@ ++notmuch: $(notmuch_client_modules) lib/libnotmuch.so ++ $(call quiet,CC,$(LDFLAGS)) -lnotmuch $(filter-out lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@ + + notmuch.1.gz: notmuch.1 + $(call quiet,gzip) --stdout $^ > $@ +@@ -33,6 +33,8 @@ install: all notmuch.1.gz + install -d $$d ; \ + done ; + install notmuch $(DESTDIR)$(prefix)/bin/ ++ install lib/$(SONAME) $(DESTDIR)$(prefix)/lib/ ++ ln -sf $(DESTDIR)$(prefix)/lib/$(SONAME) $(DESTDIR)$(prefix)/lib/libnotmuch.so + install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ + + install-emacs: install emacs +diff --git a/lib/Makefile.local b/lib/Makefile.local +index 70489e1..cfefc9b 100644 +--- a/lib/Makefile.local ++++ b/lib/Makefile.local +@@ -1,5 +1,5 @@ + dir=lib +-extra_cflags += -I$(dir) ++extra_cflags += -I$(dir) -fPIC + + libnotmuch_c_srcs = \ + $(dir)/libsha1.c \ +@@ -18,8 +18,10 @@ libnotmuch_cxx_srcs = \ + $(dir)/thread.cc + + libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o) +-$(dir)/notmuch.a: $(libnotmuch_modules) +- $(call quiet,AR) rcs $@ $^ ++$(dir)/$(SONAME): $(libnotmuch_modules) ++ $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -Wl,-soname=$(SONAME) -shared -o $@ ++$(dir)/libnotmuch.so: $(dir)/$(SONAME) ++ ln -sf $(dir)/$(SONAME) $(dir)/libnotmuch.so + + SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs) +-CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a ++CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/libnotmuch.so $(dir)/$(SONAME) +-- +1.6.3.3 +