From 765556c1f159ae0a29137c935c7cbf4106569e7e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 9 Aug 2015 16:25:41 +0200 Subject: [PATCH] build: extract library versions from notmuch.h - Make lib/notmuch.h the canonical location for the library versioning information. - Since the release-check should never fail now, remove it to reduce complexity. - Make the version numbers in notmuch.h consistent with the (now deleted) ones in lib/Makefile.local --- configure | 53 ++++++++++++++++++++++++++++++++++++++++- devel/release-checks.sh | 32 ------------------------- lib/Makefile.local | 21 ---------------- lib/notmuch.h | 2 +- 4 files changed, 53 insertions(+), 55 deletions(-) diff --git a/configure b/configure index 20fbed62..d1bcc20e 100755 --- a/configure +++ b/configure @@ -324,6 +324,35 @@ EOF exit 1 fi +printf "Reading libnotmuch version from source..." +cat > _libversion.c < +#include "lib/notmuch.h" +int main(void) { + printf("libnotmuch_version_major=%d\n", + LIBNOTMUCH_MAJOR_VERSION); + printf("libnotmuch_version_minor=%d\n", + LIBNOTMUCH_MINOR_VERSION); + printf("libnotmuch_version_release=%d\n", + LIBNOTMUCH_MICRO_VERSION); + return 0; +} +EOF +if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \ + ./_libversion > _libversion.sh && . ./_libversion.sh +then + printf "OK" +else + cat < /dev/null 2>&1; then have_pkg_config=1 else @@ -809,7 +838,7 @@ for flag in -Wmissing-declarations; do done printf "\n\t${WARN_CFLAGS}\n" -rm -f minimal minimal.c +rm -f minimal minimal.c _libversion.c _libversion _libversion.sh # construct the Makefile.config cat > Makefile.config <