From: David Bremner Date: Sun, 9 Aug 2015 14:25:41 +0000 (+0200) Subject: build: extract library versions from notmuch.h X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=765556c1f159ae0a29137c935c7cbf4106569e7e;p=notmuch.git 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 --- 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 <