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 B2AB0431FAE for ; Wed, 20 Jan 2010 12:35:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.811 X-Spam-Level: X-Spam-Status: No, score=-2.811 tagged_above=-999 required=5 tests=[AWL=-0.212, BAYES_00=-2.599] autolearn=unavailable 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 wgTDxpvo7a7B for ; Wed, 20 Jan 2010 12:35:32 -0800 (PST) Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by olra.theworths.org (Postfix) with ESMTP id 5AB91431FBC for ; Wed, 20 Jan 2010 12:35:32 -0800 (PST) Received: by bwz7 with SMTP id 7so1734929bwz.6 for ; Wed, 20 Jan 2010 12:35:30 -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=+cjhbz8ueXz538umGsqN1MMcwXgiZtjYlx6k9PU+S2E=; b=vUhyBa1glRmTWmUJjLVb3bq5xmHfnA2Xt4sFd0zHWGlNnKTmHg8TXpcB0OJWL+HWQQ Lo2WrywvPufnrn5WgC5PuAThdy0U/MJO22WaheCJt7CdwG53gGLan1FI6eAuaiQlxBMw zhd3accOY8gg6aqPKfZdODlSbWikVn7fZ4wAI= 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=QbHo5RuB9BeEasosj0hdUJ8mdiy0ui9pdZ3l1GUj6WJDInMCBEzwNN+u/K56L51oDE OF4sp4XUPWJbZGfNn3g+FGLL8CbpqQvxxt707JDkBEWUuzXPmyA40SE/f0LjO9SX3cCl kTPQsIILsT5q5xb943/9rJEjEIfoDuJp/78h8= Received: by 10.102.207.40 with SMTP id e40mr225352mug.86.1264019730162; Wed, 20 Jan 2010 12:35:30 -0800 (PST) Received: from localhost.localdomain (umass-959-105.wireless.umass.edu [128.119.77.105]) by mx.google.com with ESMTPS id 12sm1036701muq.18.2010.01.20.12.35.28 (version=SSLv3 cipher=RC4-MD5); Wed, 20 Jan 2010 12:35:29 -0800 (PST) From: Ben Gamari To: notmuch@notmuchmail.org, cworth@cworth.org Date: Wed, 20 Jan 2010 15:35:20 -0500 Message-Id: <1264019720-359-1-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <87hbqgttqz.fsf@convex-new.cs.unb.ca> References: <87hbqgttqz.fsf@convex-new.cs.unb.ca> Subject: [notmuch] [PATCH] 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: Wed, 20 Jan 2010 20:35:32 -0000 How's this look? --- Makefile | 1 + Makefile.local | 6 ++++-- lib/Makefile.local | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 021fdb8..0f56bc6 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 933ff4c..71bd639 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,CXX,$(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