--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 921926DE099D\r
+ for <notmuch@notmuchmail.org>; Sun, 9 Aug 2015 15:11:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.248\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.248 tagged_above=-999 required=5 tests=[AWL=-0.148,\r
+ SPF_NEUTRAL=0.652, URIBL_SBL=0.644, URIBL_SBL_A=0.1] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id TSvOoL32x9Re for <notmuch@notmuchmail.org>;\r
+ Sun, 9 Aug 2015 15:11:34 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 869456DE0244\r
+ for <notmuch@notmuchmail.org>; Sun, 9 Aug 2015 15:11:33 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 1AFDB1000CE;\r
+ Mon, 10 Aug 2015 01:11:20 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] build: extract library versions from notmuch.h\r
+In-Reply-To: <1439146577-16676-1-git-send-email-david@tethera.net>\r
+References: <1439146577-16676-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.20.2+58~ge9cd033 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 10 Aug 2015 01:11:19 +0300\r
+Message-ID: <m2y4hkjens.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 09 Aug 2015 22:11:37 -0000\r
+\r
+On Sun, Aug 09 2015, David Bremner <david@tethera.net> wrote:\r
+\r
+> - Make lib/notmuch.h the canonical location for the library versioning\r
+> information.\r
+>\r
+> - Since the release-check should never fail now, remove it to reduce\r
+> complexity.\r
+>\r
+> - Make the version numbers in notmuch.h consistent with the (now\r
+> deleted) ones in lib/Makefile.local\r
+> ---\r
+>\r
+> Not counting turning 20 lines of lib/Makefile.local into a template in\r
+> configure, the main change here is replacing a test in\r
+> release-checks.sh with another piece of code in configure. This isn't\r
+> obviously a good idea, since everyone has to run configure and few run\r
+> release-checks. Personally, I think the test in config is a bit\r
+> cleaner, but the main point is that it is much nicer to have the\r
+> version information only in one place.\r
+\r
+Good idea. see below for 2 things.\r
+\r
+>\r
+> configure | 51 +++++++++++++++++++++++++++++++++++++++++++++++++\r
+> devel/release-checks.sh | 32 -------------------------------\r
+> lib/Makefile.local | 21 --------------------\r
+> lib/notmuch.h | 2 +-\r
+> 4 files changed, 52 insertions(+), 54 deletions(-)\r
+>\r
+> diff --git a/configure b/configure\r
+> index 20fbed6..17eb243 100755\r
+> --- a/configure\r
+> +++ b/configure\r
+> @@ -324,6 +324,35 @@ EOF\r
+> exit 1\r
+> fi\r
+> \r
+> +printf "Reading libnotmuch version from source..."\r
+\r
+Just one ^ space\r
+\r
+> +cat > _libversion.c <<EOF\r
+> +#include <stdio.h>\r
+> +#include "lib/notmuch.h"\r
+> +int main(void) {\r
+> + printf("libnotmuch_version_major=%d\n",\r
+> + LIBNOTMUCH_MAJOR_VERSION);\r
+> + printf("libnotmuch_version_minor=%d\n",\r
+> + LIBNOTMUCH_MINOR_VERSION);\r
+> + printf("libnotmuch_version_release=%d\n",\r
+> + LIBNOTMUCH_MICRO_VERSION);\r
+> + return 0;\r
+> +}\r
+> +EOF\r
+> +if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \\r
+> + ./_libversion > libversion.sh && . ./libversion.sh\r
+> +then\r
+> + printf "OK"\r
+> +else\r
+> + cat <<EOF\r
+> +\r
+> +*** Error: Reading lib/notmuch.h failed.\r
+> +Please try running configure again in a clean environment, and if the\r
+> +problem persists, report a bug.\r
+> +EOF\r
+> + rm -f _libversion _libversion.c_libversion.sh\r
+\r
+Above should be _libversion.c libversion.sh\r
+\r
+> + exit 1\r
+> +fi\r
+> +\r
+> if pkg-config --version > /dev/null 2>&1; then\r
+> have_pkg_config=1\r
+> else\r
+> @@ -847,6 +876,28 @@ vpath Makefile.% \$(srcdir)\r
+> vpath %.py \$(srcdir)\r
+> vpath %.rst \$(srcdir)\r
+> \r
+> +# Library versions (used to make SONAME)\r
+> +# The major version of the library interface. This will control the soname.\r
+> +# As such, this number must be incremented for any incompatible change to\r
+> +# the library interface, (such as the deletion of an API or a major\r
+> +# semantic change that breaks formerly functioning code).\r
+> +#\r
+> +LIBNOTMUCH_VERSION_MAJOR = ${libnotmuch_version_major}\r
+> +\r
+> +# The minor version of the library interface. This should be incremented at\r
+> +# the time of release for any additions to the library interface,\r
+> +# (and when it is incremented, the release version of the library should\r
+> +# be reset to 0).\r
+> +LIBNOTMUCH_VERSION_MINOR = ${libnotmuch_version_minor}\r
+> +\r
+> +# The release version the library interface. This should be incremented at\r
+> +# the time of release if there have been no changes to the interface, (but\r
+> +# simply compatible changes to the implementation).\r
+> +LIBNOTMUCH_VERSION_RELEASE = ${libnotmuch_version_release}\r
+> +\r
+> +# These are derived from the VERSION macros in lib/notmuch.h so\r
+> +# if you have to change them, something is wrong.\r
+> +\r
+> # The C compiler to use\r
+> CC = ${CC}\r
+> \r
+> diff --git a/devel/release-checks.sh b/devel/release-checks.sh\r
+> index bf0d68a..8604a9f 100755\r
+> --- a/devel/release-checks.sh\r
+> +++ b/devel/release-checks.sh\r
+> @@ -88,38 +88,6 @@ case $VERSION in\r
+> *) verfail "'$VERSION' is a single number" ;;\r
+> esac\r
+> \r
+> -echo -n "Checking that LIBNOTMUCH version macros & variables match ... "\r
+> -# lib/notmuch.h\r
+> -LIBNOTMUCH_MAJOR_VERSION=broken\r
+> -LIBNOTMUCH_MINOR_VERSION=broken\r
+> -LIBNOTMUCH_MICRO_VERSION=broken\r
+> -# lib/Makefile.local\r
+> -LIBNOTMUCH_VERSION_MAJOR=borken\r
+> -LIBNOTMUCH_VERSION_MINOR=borken\r
+> -LIBNOTMUCH_VERSION_RELEASE=borken\r
+> -\r
+> -eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^LIBNOTMUCH_[A-Z]+_VERSION$/ \\r
+> - && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`\r
+> -\r
+> -eval `awk 'NF == 3 && $1 ~ /^LIBNOTMUCH_VERSION_[A-Z]+$/ && $2 == "=" \\r
+> - && $3 ~ /^[0-9]+$/ { print $1 "=" $3 }' lib/Makefile.local`\r
+> -\r
+> -\r
+> -check_version_component ()\r
+> -{\r
+> - eval local v1=\$LIBNOTMUCH_$1_VERSION\r
+> - eval local v2=\$LIBNOTMUCH_VERSION_$2\r
+> - if [ $v1 != $v2 ]\r
+> - then append_emsg "LIBNOTMUCH_$1_VERSION ($v1) does not equal LIBNOTMUCH_VERSION_$2 ($v2)"\r
+> - fi\r
+> -}\r
+> -\r
+> -old_emsg_count=$emsg_count\r
+> -check_version_component MAJOR MAJOR\r
+> -check_version_component MINOR MINOR\r
+> -check_version_component MICRO RELEASE\r
+> -[ $old_emsg_count = $emsg_count ] && echo Yes. || echo No.\r
+> -\r
+> echo -n "Checking that this is Debian package for notmuch... "\r
+> read deb_notmuch deb_version rest < debian/changelog\r
+> if [ "$deb_notmuch" = 'notmuch' ]\r
+> diff --git a/lib/Makefile.local b/lib/Makefile.local\r
+> index 412d865..3a07090 100644\r
+> --- a/lib/Makefile.local\r
+> +++ b/lib/Makefile.local\r
+> @@ -1,26 +1,5 @@\r
+> # -*- makefile -*-\r
+> \r
+> -# The major version of the library interface. This will control the soname.\r
+> -# As such, this number must be incremented for any incompatible change to\r
+> -# the library interface, (such as the deletion of an API or a major\r
+> -# semantic change that breaks formerly functioning code).\r
+> -#\r
+> -LIBNOTMUCH_VERSION_MAJOR = 4\r
+> -\r
+> -# The minor version of the library interface. This should be incremented at\r
+> -# the time of release for any additions to the library interface,\r
+> -# (and when it is incremented, the release version of the library should\r
+> -# be reset to 0).\r
+> -LIBNOTMUCH_VERSION_MINOR = 3\r
+> -\r
+> -# The release version the library interface. This should be incremented at\r
+> -# the time of release if there have been no changes to the interface, (but\r
+> -# simply compatible changes to the implementation).\r
+> -LIBNOTMUCH_VERSION_RELEASE = 0\r
+> -\r
+> -# Note: Don't forget to change the VERSION macros in notmuch.h when\r
+> -# any of the above change.\r
+> -\r
+> ifeq ($(PLATFORM),MACOSX)\r
+> LIBRARY_SUFFIX = dylib\r
+> # On OS X, library version numbers go before suffix.\r
+> diff --git a/lib/notmuch.h b/lib/notmuch.h\r
+> index 421c19d..b1f5bfa 100644\r
+> --- a/lib/notmuch.h\r
+> +++ b/lib/notmuch.h\r
+> @@ -56,7 +56,7 @@ NOTMUCH_BEGIN_DECLS\r
+> * version in Makefile.local.\r
+> */\r
+> #define LIBNOTMUCH_MAJOR_VERSION 4\r
+> -#define LIBNOTMUCH_MINOR_VERSION 2\r
+> +#define LIBNOTMUCH_MINOR_VERSION 3\r
+> #define LIBNOTMUCH_MICRO_VERSION 0\r
+> \r
+> #define NOTMUCH_DEPRECATED(major,minor) \\r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r