[PATCH] bitmap:improve memory usage using CHAR_BITS and unsigned CHAR
[notmuch-archives.git] / e9 / 2640b764e05cb079fffcf73f25236166af2b17
1 Return-Path: <bgamari.foss@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 94647431FBD\r
6         for <notmuch@notmuchmail.org>; Fri, 15 Jan 2010 20:29:10 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.499\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.499 tagged_above=-999 required=5\r
12         tests=[AWL=-0.500, BAYES_50=0.001] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id e1Q8NdmeG-kY for <notmuch@notmuchmail.org>;\r
16         Fri, 15 Jan 2010 20:29:09 -0800 (PST)\r
17 Received: from mail-qy0-f192.google.com (mail-qy0-f192.google.com\r
18         [209.85.221.192])\r
19         by olra.theworths.org (Postfix) with ESMTP id 45166431FBC\r
20         for <notmuch@notmuchmail.org>; Fri, 15 Jan 2010 20:29:09 -0800 (PST)\r
21 Received: by qyk30 with SMTP id 30so917468qyk.32\r
22         for <notmuch@notmuchmail.org>; Fri, 15 Jan 2010 20:29:08 -0800 (PST)\r
23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
24         h=domainkey-signature:received:received:from:to:cc:subject:date\r
25         :message-id:x-mailer:in-reply-to:references;\r
26         bh=DP8z7wu8zssBl8VRkg/RQlfhsf7PI6r3AbG88q6vWpI=;\r
27         b=jlnmHTLrt6dhwsBANWnrJDoIsl3xB/bYBGBvuKsD9LkpbD8QBfTur2cwBeilPrSfW0\r
28         skiNSJyIIJCQfec97xc+rZY1SAYcI05Tt8FjvVbZer1g1udc/yc4EDr/x1E9hESBl14i\r
29         W7V2MOTJROl7ldv+f7uUyh5eFXDuaPA/yuq6A=\r
30 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
31         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
32         b=PlTn2xaoVaYLJuALR9gJTRQi78a/HT3rC1jBJDY1TAHH7j2Cgn/nbeMfzTt4d3iWQQ\r
33         cubR12Im4ye4ayu7a42WJRyBPsB+ANNw1mQq+muurDJmAUahj0jigr7D4q5IaoNhc6U+\r
34         cqvtXAgQ7hAw4l7lFmyPYVcoHdaOvSXnjCLEw=\r
35 Received: by 10.224.73.39 with SMTP id o39mr2876653qaj.56.1263616148751;\r
36         Fri, 15 Jan 2010 20:29:08 -0800 (PST)\r
37 Received: from localhost.localdomain\r
38         (pool-74-106-64-24.spfdma.east.verizon.net [74.106.64.24])\r
39         by mx.google.com with ESMTPS id 6sm6403685qwk.11.2010.01.15.20.29.05\r
40         (version=SSLv3 cipher=RC4-MD5); Fri, 15 Jan 2010 20:29:07 -0800 (PST)\r
41 From: Ben Gamari <bgamari.foss@gmail.com>\r
42 To: cworth@cworth.org\r
43 Date: Fri, 15 Jan 2010 23:28:55 -0500\r
44 Message-Id: <1263616135-3112-1-git-send-email-bgamari.foss@gmail.com>\r
45 X-Mailer: git-send-email 1.6.3.3\r
46 In-Reply-To: <1263610606-sup-9677@ben-laptop>\r
47 References: <1263610606-sup-9677@ben-laptop>\r
48 Cc: notmuch@notmuchmail.org\r
49 Subject: [notmuch] [PATCH] libtoolize notmuch.\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sat, 16 Jan 2010 04:29:10 -0000\r
63 \r
64 Here is a patch based on  quad's libtool branch rebased on current master. It\r
65 has been tested and verified to work on my machine\r
66 \r
67 ---\r
68  Makefile           |   27 ++++++++++++++++-----------\r
69  Makefile.local     |   12 ++++++++----\r
70  lib/Makefile.local |    8 ++++----\r
71  3 files changed, 28 insertions(+), 19 deletions(-)\r
72 \r
73 diff --git a/Makefile b/Makefile\r
74 index 021fdb8..9022a39 100644\r
75 --- a/Makefile\r
76 +++ b/Makefile\r
77 @@ -3,6 +3,10 @@ WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations\r
78  \r
79  # Additional programs that are used during the compilation process.\r
80  EMACS ?= emacs\r
81 +libtool = libtool\r
82 +# Needed so libtool replaces parameters in a modern fashion.\r
83 +CC = gcc\r
84 +CXX = g++\r
85  # Lowercase to avoid clash with GZIP environment variable for passing\r
86  # arguments to gzip.\r
87  gzip = gzip\r
88 @@ -43,34 +47,35 @@ include Makefile.local\r
89  # user how to enable verbose compiles.\r
90  ifeq ($(V),)\r
91  quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"\r
92 -quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"  $1 $2        $@\n"; $($1)\r
93 +V = 0\r
94  endif\r
95  # The user has explicitly enabled quiet compilation.\r
96  ifeq ($(V),0)\r
97 -quiet = @printf "  $1  $@\n"; $($1)\r
98 +quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"  $1 $2        $@\n"; $($1)\r
99 +libtool += --silent\r
100  endif\r
101  # Otherwise, print the full command line.\r
102  quiet ?= $($1)\r
103  \r
104 -%.o: %.cc $(all_deps)\r
105 -       $(call quiet,CXX,$(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@\r
106 +%.lo: %.cc $(all_deps)\r
107 +       $(call quiet,libtool,$(CXXFLAGS)) --mode=compile $(CXX) -c $(FINAL_CXXFLAGS) $< -o $@\r
108  \r
109 -%.o: %.c $(all_deps)\r
110 -       $(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@\r
111 +%.lo: %.c $(all_deps)\r
112 +       $(call quiet,libtool,$(CFLAGS)) --mode=compile $(CC) -c $(FINAL_CFLAGS) $< -o $@\r
113  \r
114  %.elc: %.el\r
115         $(call quiet,EMACS) -batch -f batch-byte-compile $<\r
116  \r
117  .deps/%.d: %.c $(all_deps)\r
118         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \\r
119 -       $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \\r
120 -       sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \\r
121 +       $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$; \\r
122 +       sed 's,'$$(basename $*)'\.lo[ :]*,$*.lo $@ : ,g' < $@.$$$$ > $@; \\r
123         rm -f $@.$$$$\r
124  \r
125  .deps/%.d: %.cc $(all_deps)\r
126         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \\r
127 -       $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \\r
128 -       sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \\r
129 +       $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$; \\r
130 +       sed 's,'$$(basename $*)'\.lo[ :]*,$*.lo $@ : ,g' < $@.$$$$ > $@; \\r
131         rm -f $@.$$$$\r
132  \r
133  DEPS := $(SRCS:%.c=.deps/%.d)\r
134 @@ -79,4 +84,4 @@ DEPS := $(DEPS:%.cc=.deps/%.d)\r
135  \r
136  .PHONY : clean\r
137  clean:\r
138 -       rm -f $(CLEAN); rm -rf .deps\r
139 +       $(libtool) --mode=clean rm -f $(CLEAN); rm -rf .deps\r
140 diff --git a/Makefile.local b/Makefile.local\r
141 index 933ff4c..ccff76c 100644\r
142 --- a/Makefile.local\r
143 +++ b/Makefile.local\r
144 @@ -20,9 +20,9 @@ notmuch_client_srcs =         \\r
145         query-string.c          \\r
146         show-message.c\r
147  \r
148 -notmuch_client_modules = $(notmuch_client_srcs:.c=.o)\r
149 -notmuch: $(notmuch_client_modules) lib/notmuch.a\r
150 -       $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -o $@\r
151 +notmuch_client_modules = $(notmuch_client_srcs:.c=.lo)\r
152 +notmuch: $(notmuch_client_modules) lib/libnotmuch.la\r
153 +       $(call quiet,libtool,$(LDFLAGS)) --mode=link $(CXX) $^ $(FINAL_LDFLAGS) -o $@\r
154  \r
155  notmuch.1.gz: notmuch.1\r
156         $(call quiet,gzip) --stdout $^ > $@\r
157 @@ -32,8 +32,12 @@ install: all notmuch.1.gz\r
158         do \\r
159                 install -d $$d ; \\r
160         done ;\r
161 -       install notmuch $(DESTDIR)$(prefix)/bin/\r
162 +       $(libtool) --mode=install install -c lib/libnotmuch.la $(DESTDIR)$(prefix)/lib/\r
163 +       $(libtool) --mode=install install -c notmuch $(DESTDIR)$(prefix)/bin/\r
164         install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/\r
165 +       install contrib/notmuch-completion.bash \\r
166 +               $(DESTDIR)$(bash_completion_dir)/notmuch\r
167 +       $(libtool) --mode=finish $(DESTDIR)$(prefix)/lib/\r
168  \r
169  install-emacs: install emacs\r
170         for d in $(DESTDIR)/$(emacs_lispdir) ; \\r
171 diff --git a/lib/Makefile.local b/lib/Makefile.local\r
172 index 70489e1..b03dff6 100644\r
173 --- a/lib/Makefile.local\r
174 +++ b/lib/Makefile.local\r
175 @@ -17,9 +17,9 @@ libnotmuch_cxx_srcs =         \\r
176         $(dir)/query.cc         \\r
177         $(dir)/thread.cc\r
178  \r
179 -libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)\r
180 -$(dir)/notmuch.a: $(libnotmuch_modules)\r
181 -       $(call quiet,AR) rcs $@ $^\r
182 +libnotmuch_modules = $(libnotmuch_c_srcs:.c=.lo) $(libnotmuch_cxx_srcs:.cc=.lo)\r
183 +$(dir)/libnotmuch.la: $(libnotmuch_modules)\r
184 +       $(call quiet,libtool) --mode=link $(CXX) -rpath $(DESTDIR)$(prefix)/lib -o $@ $^\r
185  \r
186  SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)\r
187 -CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a\r
188 +CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.la\r
189 -- \r
190 1.6.3.3\r
191 \r