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 777AF4196F3 for ; Sat, 27 Mar 2010 19:44:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] 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 9inHw0GMxrNe for ; Sat, 27 Mar 2010 19:44:29 -0700 (PDT) Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.148]) by olra.theworths.org (Postfix) with ESMTP id 347FD4196F2 for ; Sat, 27 Mar 2010 19:44:29 -0700 (PDT) Received: by qw-out-1920.google.com with SMTP id 5so1367412qwf.32 for ; Sat, 27 Mar 2010 19:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:subject :to:cc:in-reply-to:references; bh=wF9yo7dBia0l7CcMlzxvtmOQeLA1nPu1lx7tXm1rRfs=; b=ChPKupIMcno6ZR9IHqTTBOfklabGaF5ylKk5lOM1Z8Wyi61LCrzwdyLEnT9GLUf2HU ypBduBoXnSq1IRmlzpMbu9B6lV9+u6P+uOoIZZZJmdvYUwKmimnCtYdd8QdU4E9bzqhe lQw4toKe8xvxsm/YpPiPDvzW9QkzjqjYlG5zE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:to:cc:in-reply-to:references; b=I6AyI3vQe+zl4Zs3AGOE3zlBT+2eEg31FpPxkWWTVk5N604XRn5aeE9hwzL1qwKo1I 2CqMCKOE2jHmWQ2Jdn+AGINa4Nivj9G7+lxGcO/UxmreVFaXRVODf8ZbgKXeI1ohZ3SJ ZMSbeSO702DxoMZntrhglSVbKcC5dqK6Mn3QQ= Received: by 10.224.72.34 with SMTP id k34mr1124540qaj.283.1269744268622; Sat, 27 Mar 2010 19:44:28 -0700 (PDT) Received: from localhost (pool-96-236-124-222.spfdma.east.verizon.net [96.236.124.222]) by mx.google.com with ESMTPS id 7sm7289613qwf.34.2010.03.27.19.44.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 27 Mar 2010 19:44:27 -0700 (PDT) Message-ID: <4baec28b.47c2f10a.3633.1551@mx.google.com> Date: Sat, 27 Mar 2010 19:44:27 -0700 (PDT) From: Ben Gamari To: Ingmar Vanhassel , notmuch@notmuchmail.org In-Reply-To: <1268401656-12827-2-git-send-email-ingmar@exherbo.org> References: <1268347072-2050-1-git-send-email-bgamari.foss@gmail.com> <1268401656-12827-2-git-send-email-ingmar@exherbo.org> Subject: Re: [notmuch] [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h 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, 28 Mar 2010 02:44:30 -0000 Does anyone have this queued up to be merged upstream? I think we're beginning to see the need for a library at this point and as far as I can see, this is an excellent patch for it. - Ben Signed-off-by: Ben Gamari On Fri, 12 Mar 2010 14:47:34 +0100, Ingmar Vanhassel wrote: > From: Ben Gamari > > Signed-off-by: Ingmar Vanhassel > --- > .gitignore | 1 + > Makefile | 1 + > Makefile.local | 10 +++++++--- > lib/Makefile.local | 9 +++++---- > 4 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/.gitignore b/.gitignore > index efa98fb..daf8094 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -5,6 +5,7 @@ tags > .deps > notmuch > notmuch.1.gz > +libnotmuch.so* > *.[ao] > *~ > .*.swp > diff --git a/Makefile b/Makefile > index 46f001c..80eedd0 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 3c2a629..31ab534 100644 > --- a/Makefile.local > +++ b/Makefile.local > @@ -20,18 +20,22 @@ notmuch_client_srcs = \ > json.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)) -Llib -lnotmuch $(filter-out lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@ > > notmuch.1.gz: notmuch.1 > $(call quiet,gzip) --stdout $^ > $@ > > install: all notmuch.1.gz > - for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 ; \ > + for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/lib/ \ > + $(DESTDIR)$(prefix)/include/ $(DESTDIR)$(prefix)/share/man/man1 ; \ > do \ > install -d $$d ; \ > done ; > install notmuch $(DESTDIR)$(prefix)/bin/ > + install lib/$(SONAME) $(DESTDIR)$(prefix)/lib/ > + install lib/notmuch.h $(DESTDIR)$(prefix)/include/ > + ln -sf $(SONAME) $(DESTDIR)$(prefix)/lib/libnotmuch.so > install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ > ifeq ($(MAKECMDGOALS), install) > @echo "" > diff --git a/lib/Makefile.local b/lib/Makefile.local > index 495b27e..f848946 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,9 @@ 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)/libnotmuch.so : $(libnotmuch_modules) > + $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@ > + ln -sf $(SONAME) $@ > > SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs) > -CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a > +CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/libnotmuch.so *.so > -- > 1.7.0.2