From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 94647431FBD for ; Fri, 15 Jan 2010 20:29:10 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.499 X-Spam-Level: X-Spam-Status: No, score=-0.499 tagged_above=-999 required=5 tests=[AWL=-0.500, BAYES_50=0.001] 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 e1Q8NdmeG-kY for ; Fri, 15 Jan 2010 20:29:09 -0800 (PST) Received: from mail-qy0-f192.google.com (mail-qy0-f192.google.com [209.85.221.192]) by olra.theworths.org (Postfix) with ESMTP id 45166431FBC for ; Fri, 15 Jan 2010 20:29:09 -0800 (PST) Received: by qyk30 with SMTP id 30so917468qyk.32 for ; Fri, 15 Jan 2010 20:29:08 -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=DP8z7wu8zssBl8VRkg/RQlfhsf7PI6r3AbG88q6vWpI=; b=jlnmHTLrt6dhwsBANWnrJDoIsl3xB/bYBGBvuKsD9LkpbD8QBfTur2cwBeilPrSfW0 skiNSJyIIJCQfec97xc+rZY1SAYcI05Tt8FjvVbZer1g1udc/yc4EDr/x1E9hESBl14i W7V2MOTJROl7ldv+f7uUyh5eFXDuaPA/yuq6A= 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=PlTn2xaoVaYLJuALR9gJTRQi78a/HT3rC1jBJDY1TAHH7j2Cgn/nbeMfzTt4d3iWQQ cubR12Im4ye4ayu7a42WJRyBPsB+ANNw1mQq+muurDJmAUahj0jigr7D4q5IaoNhc6U+ cqvtXAgQ7hAw4l7lFmyPYVcoHdaOvSXnjCLEw= Received: by 10.224.73.39 with SMTP id o39mr2876653qaj.56.1263616148751; Fri, 15 Jan 2010 20:29:08 -0800 (PST) Received: from localhost.localdomain (pool-74-106-64-24.spfdma.east.verizon.net [74.106.64.24]) by mx.google.com with ESMTPS id 6sm6403685qwk.11.2010.01.15.20.29.05 (version=SSLv3 cipher=RC4-MD5); Fri, 15 Jan 2010 20:29:07 -0800 (PST) From: Ben Gamari To: cworth@cworth.org Date: Fri, 15 Jan 2010 23:28:55 -0500 Message-Id: <1263616135-3112-1-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1263610606-sup-9677@ben-laptop> References: <1263610606-sup-9677@ben-laptop> Cc: notmuch@notmuchmail.org Subject: [PATCH] libtoolize notmuch. 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: Sat, 16 Jan 2010 04:29:10 -0000 Here is a patch based on quad's libtool branch rebased on current master. It has been tested and verified to work on my machine --- Makefile | 27 ++++++++++++++++----------- Makefile.local | 12 ++++++++---- lib/Makefile.local | 8 ++++---- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 021fdb8..9022a39 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,10 @@ WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations # Additional programs that are used during the compilation process. EMACS ?= emacs +libtool = libtool +# Needed so libtool replaces parameters in a modern fashion. +CC = gcc +CXX = g++ # Lowercase to avoid clash with GZIP environment variable for passing # arguments to gzip. gzip = gzip @@ -43,34 +47,35 @@ include Makefile.local # user how to enable verbose compiles. ifeq ($(V),) quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n" -quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)" $1 $2 $@\n"; $($1) +V = 0 endif # The user has explicitly enabled quiet compilation. ifeq ($(V),0) -quiet = @printf " $1 $@\n"; $($1) +quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)" $1 $2 $@\n"; $($1) +libtool += --silent endif # Otherwise, print the full command line. quiet ?= $($1) -%.o: %.cc $(all_deps) - $(call quiet,CXX,$(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ +%.lo: %.cc $(all_deps) + $(call quiet,libtool,$(CXXFLAGS)) --mode=compile $(CXX) -c $(FINAL_CXXFLAGS) $< -o $@ -%.o: %.c $(all_deps) - $(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ +%.lo: %.c $(all_deps) + $(call quiet,libtool,$(CFLAGS)) --mode=compile $(CC) -c $(FINAL_CFLAGS) $< -o $@ %.elc: %.el $(call quiet,EMACS) -batch -f batch-byte-compile $< .deps/%.d: %.c $(all_deps) @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ - $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \ - sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \ + $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$; \ + sed 's,'$$(basename $*)'\.lo[ :]*,$*.lo $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ .deps/%.d: %.cc $(all_deps) @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ - $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \ - sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \ + $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$; \ + sed 's,'$$(basename $*)'\.lo[ :]*,$*.lo $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ DEPS := $(SRCS:%.c=.deps/%.d) @@ -79,4 +84,4 @@ DEPS := $(DEPS:%.cc=.deps/%.d) .PHONY : clean clean: - rm -f $(CLEAN); rm -rf .deps + $(libtool) --mode=clean rm -f $(CLEAN); rm -rf .deps diff --git a/Makefile.local b/Makefile.local index 933ff4c..ccff76c 100644 --- a/Makefile.local +++ b/Makefile.local @@ -20,9 +20,9 @@ notmuch_client_srcs = \ query-string.c \ 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_client_modules = $(notmuch_client_srcs:.c=.lo) +notmuch: $(notmuch_client_modules) lib/libnotmuch.la + $(call quiet,libtool,$(LDFLAGS)) --mode=link $(CXX) $^ $(FINAL_LDFLAGS) -o $@ notmuch.1.gz: notmuch.1 $(call quiet,gzip) --stdout $^ > $@ @@ -32,8 +32,12 @@ install: all notmuch.1.gz do \ install -d $$d ; \ done ; - install notmuch $(DESTDIR)$(prefix)/bin/ + $(libtool) --mode=install install -c lib/libnotmuch.la $(DESTDIR)$(prefix)/lib/ + $(libtool) --mode=install install -c notmuch $(DESTDIR)$(prefix)/bin/ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ + install contrib/notmuch-completion.bash \ + $(DESTDIR)$(bash_completion_dir)/notmuch + $(libtool) --mode=finish $(DESTDIR)$(prefix)/lib/ install-emacs: install emacs for d in $(DESTDIR)/$(emacs_lispdir) ; \ diff --git a/lib/Makefile.local b/lib/Makefile.local index 70489e1..b03dff6 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -17,9 +17,9 @@ libnotmuch_cxx_srcs = \ $(dir)/query.cc \ $(dir)/thread.cc -libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o) -$(dir)/notmuch.a: $(libnotmuch_modules) - $(call quiet,AR) rcs $@ $^ +libnotmuch_modules = $(libnotmuch_c_srcs:.c=.lo) $(libnotmuch_cxx_srcs:.cc=.lo) +$(dir)/libnotmuch.la: $(libnotmuch_modules) + $(call quiet,libtool) --mode=link $(CXX) -rpath $(DESTDIR)$(prefix)/lib -o $@ $^ SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs) -CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a +CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.la -- 1.6.3.3