Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 36 / 989ff2d8c55e7d9f9755eb7120e41d1958fc3c
1 Return-Path: <bremner@tesseract.cs.unb.ca>\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 arlo.cworth.org (Postfix) with ESMTP id A73186DE099D\r
6  for <notmuch@notmuchmail.org>; Sun,  9 Aug 2015 11:57:39 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.138\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.138 tagged_above=-999 required=5 tests=[AWL=0.128, \r
12  T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id Zu9M-3yOfXOd for <notmuch@notmuchmail.org>;\r
16  Sun,  9 Aug 2015 11:57:37 -0700 (PDT)\r
17 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id ADC826DE0244\r
19  for <notmuch@notmuchmail.org>; Sun,  9 Aug 2015 11:57:36 -0700 (PDT)\r
20 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
21  (envelope-from <bremner@tesseract.cs.unb.ca>)\r
22  id 1ZOVmA-0007eJ-1C; Sun, 09 Aug 2015 18:56:54 +0000\r
23 Received: (nullmailer pid 16891 invoked by uid 1000); Sun, 09 Aug 2015\r
24  18:56:42 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH] build: extract library versions from notmuch.h\r
28 Date: Sun,  9 Aug 2015 20:56:17 +0200\r
29 Message-Id: <1439146577-16676-1-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.1.4\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.18\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35  <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Sun, 09 Aug 2015 18:57:39 -0000\r
44 \r
45 - Make lib/notmuch.h the canonical location for the library versioning\r
46 information.\r
47 \r
48 - Since the release-check should never fail now, remove it to reduce\r
49 complexity.\r
50 \r
51 - Make the version numbers in notmuch.h consistent with the (now\r
52   deleted) ones in lib/Makefile.local\r
53 ---\r
54 \r
55 Not counting turning 20 lines of lib/Makefile.local into a template in\r
56 configure, the main change here is replacing a test in\r
57 release-checks.sh with another piece of code in configure. This isn't\r
58 obviously a good idea, since everyone has to run configure and few run\r
59 release-checks. Personally, I think the test in config is a bit\r
60 cleaner, but the main point is that it is much nicer to have the\r
61 version information only in one place.\r
62 \r
63  configure               | 51 +++++++++++++++++++++++++++++++++++++++++++++++++\r
64  devel/release-checks.sh | 32 -------------------------------\r
65  lib/Makefile.local      | 21 --------------------\r
66  lib/notmuch.h           |  2 +-\r
67  4 files changed, 52 insertions(+), 54 deletions(-)\r
68 \r
69 diff --git a/configure b/configure\r
70 index 20fbed6..17eb243 100755\r
71 --- a/configure\r
72 +++ b/configure\r
73 @@ -324,6 +324,35 @@ EOF\r
74      exit 1\r
75  fi\r
76  \r
77 +printf  "Reading libnotmuch version from source..."\r
78 +cat > _libversion.c <<EOF\r
79 +#include <stdio.h>\r
80 +#include "lib/notmuch.h"\r
81 +int main(void) {\r
82 +    printf("libnotmuch_version_major=%d\n",\r
83 +               LIBNOTMUCH_MAJOR_VERSION);\r
84 +    printf("libnotmuch_version_minor=%d\n",\r
85 +               LIBNOTMUCH_MINOR_VERSION);\r
86 +    printf("libnotmuch_version_release=%d\n",\r
87 +               LIBNOTMUCH_MICRO_VERSION);\r
88 +    return 0;\r
89 +}\r
90 +EOF\r
91 +if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \\r
92 +       ./_libversion > libversion.sh && . ./libversion.sh\r
93 +then\r
94 +    printf  "OK"\r
95 +else\r
96 +    cat <<EOF\r
97 +\r
98 +*** Error: Reading lib/notmuch.h failed.\r
99 +Please try running configure again in a clean environment, and if the\r
100 +problem persists, report a bug.\r
101 +EOF\r
102 +    rm -f _libversion _libversion.c_libversion.sh\r
103 +    exit 1\r
104 +fi\r
105 +\r
106  if pkg-config --version > /dev/null 2>&1; then\r
107      have_pkg_config=1\r
108  else\r
109 @@ -847,6 +876,28 @@ vpath Makefile.% \$(srcdir)\r
110  vpath %.py \$(srcdir)\r
111  vpath %.rst \$(srcdir)\r
112  \r
113 +# Library versions (used to make SONAME)\r
114 +# The major version of the library interface. This will control the soname.\r
115 +# As such, this number must be incremented for any incompatible change to\r
116 +# the library interface, (such as the deletion of an API or a major\r
117 +# semantic change that breaks formerly functioning code).\r
118 +#\r
119 +LIBNOTMUCH_VERSION_MAJOR = ${libnotmuch_version_major}\r
120 +\r
121 +# The minor version of the library interface. This should be incremented at\r
122 +# the time of release for any additions to the library interface,\r
123 +# (and when it is incremented, the release version of the library should\r
124 +#  be reset to 0).\r
125 +LIBNOTMUCH_VERSION_MINOR = ${libnotmuch_version_minor}\r
126 +\r
127 +# The release version the library interface. This should be incremented at\r
128 +# the time of release if there have been no changes to the interface, (but\r
129 +# simply compatible changes to the implementation).\r
130 +LIBNOTMUCH_VERSION_RELEASE = ${libnotmuch_version_release}\r
131 +\r
132 +# These are derived from the VERSION macros in lib/notmuch.h so\r
133 +# if you have to change them, something is wrong.\r
134 +\r
135  # The C compiler to use\r
136  CC = ${CC}\r
137  \r
138 diff --git a/devel/release-checks.sh b/devel/release-checks.sh\r
139 index bf0d68a..8604a9f 100755\r
140 --- a/devel/release-checks.sh\r
141 +++ b/devel/release-checks.sh\r
142 @@ -88,38 +88,6 @@ case $VERSION in\r
143         *)      verfail "'$VERSION' is a single number" ;;\r
144  esac\r
145  \r
146 -echo -n "Checking that LIBNOTMUCH version macros & variables match ... "\r
147 -# lib/notmuch.h\r
148 -LIBNOTMUCH_MAJOR_VERSION=broken\r
149 -LIBNOTMUCH_MINOR_VERSION=broken\r
150 -LIBNOTMUCH_MICRO_VERSION=broken\r
151 -# lib/Makefile.local\r
152 -LIBNOTMUCH_VERSION_MAJOR=borken\r
153 -LIBNOTMUCH_VERSION_MINOR=borken\r
154 -LIBNOTMUCH_VERSION_RELEASE=borken\r
155 -\r
156 -eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^LIBNOTMUCH_[A-Z]+_VERSION$/ \\r
157 -       && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`\r
158 -\r
159 -eval `awk 'NF == 3 && $1 ~ /^LIBNOTMUCH_VERSION_[A-Z]+$/ && $2 == "=" \\r
160 -       && $3 ~ /^[0-9]+$/ { print $1 "=" $3 }' lib/Makefile.local`\r
161 -\r
162 -\r
163 -check_version_component ()\r
164 -{\r
165 -       eval local v1=\$LIBNOTMUCH_$1_VERSION\r
166 -       eval local v2=\$LIBNOTMUCH_VERSION_$2\r
167 -       if [ $v1 != $v2 ]\r
168 -       then    append_emsg "LIBNOTMUCH_$1_VERSION ($v1) does not equal LIBNOTMUCH_VERSION_$2 ($v2)"\r
169 -       fi\r
170 -}\r
171 -\r
172 -old_emsg_count=$emsg_count\r
173 -check_version_component MAJOR MAJOR\r
174 -check_version_component MINOR MINOR\r
175 -check_version_component MICRO RELEASE\r
176 -[ $old_emsg_count = $emsg_count ] && echo Yes. || echo No.\r
177 -\r
178  echo -n "Checking that this is Debian package for notmuch... "\r
179  read deb_notmuch deb_version rest < debian/changelog\r
180  if [ "$deb_notmuch" = 'notmuch' ]\r
181 diff --git a/lib/Makefile.local b/lib/Makefile.local\r
182 index 412d865..3a07090 100644\r
183 --- a/lib/Makefile.local\r
184 +++ b/lib/Makefile.local\r
185 @@ -1,26 +1,5 @@\r
186  # -*- makefile -*-\r
187  \r
188 -# The major version of the library interface. This will control the soname.\r
189 -# As such, this number must be incremented for any incompatible change to\r
190 -# the library interface, (such as the deletion of an API or a major\r
191 -# semantic change that breaks formerly functioning code).\r
192 -#\r
193 -LIBNOTMUCH_VERSION_MAJOR = 4\r
194 -\r
195 -# The minor version of the library interface. This should be incremented at\r
196 -# the time of release for any additions to the library interface,\r
197 -# (and when it is incremented, the release version of the library should\r
198 -#  be reset to 0).\r
199 -LIBNOTMUCH_VERSION_MINOR = 3\r
200 -\r
201 -# The release version the library interface. This should be incremented at\r
202 -# the time of release if there have been no changes to the interface, (but\r
203 -# simply compatible changes to the implementation).\r
204 -LIBNOTMUCH_VERSION_RELEASE = 0\r
205 -\r
206 -# Note: Don't forget to change the VERSION macros in notmuch.h when\r
207 -# any of the above change.\r
208 -\r
209  ifeq ($(PLATFORM),MACOSX)\r
210  LIBRARY_SUFFIX = dylib\r
211  # On OS X, library version numbers go before suffix.\r
212 diff --git a/lib/notmuch.h b/lib/notmuch.h\r
213 index 421c19d..b1f5bfa 100644\r
214 --- a/lib/notmuch.h\r
215 +++ b/lib/notmuch.h\r
216 @@ -56,7 +56,7 @@ NOTMUCH_BEGIN_DECLS\r
217   * version in Makefile.local.\r
218   */\r
219  #define LIBNOTMUCH_MAJOR_VERSION       4\r
220 -#define LIBNOTMUCH_MINOR_VERSION       2\r
221 +#define LIBNOTMUCH_MINOR_VERSION       3\r
222  #define LIBNOTMUCH_MICRO_VERSION       0\r
223  \r
224  #define NOTMUCH_DEPRECATED(major,minor) \\r
225 -- \r
226 2.1.4\r
227 \r