diff options
author | Werner Koch <wk@gnupg.org> | 2013-03-18 15:31:34 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-03-20 15:55:23 +0100 |
commit | 1eaad0a8c4cab227685a6a8768e539df2f1f4dac (patch) | |
tree | 56ffd1f96b896fbb4c585cac13e9a03d6ae21bb8 /configure.ac | |
parent | de07974d807b703a2554d6ba885ea249e648bd44 (diff) | |
download | libgcrypt-1eaad0a8c4cab227685a6a8768e539df2f1f4dac.tar.gz |
Provide GCRYPT_VERSION_NUMBER macro, add build info to the binary.
* src/gcrypt.h.in (GCRYPT_VERSION_NUMBER): New.
* configure.ac (VERSION_NUMBER): New ac_subst.
* src/global.c (_gcry_vcontrol): Move call to above function ...
(gcry_check_version): .. here.
* configure.ac (BUILD_REVISION, BUILD_FILEVERSION)
(BUILD_TIMESTAMP): Define on all platforms.
* compat/compat.c (_gcry_compat_identification): Include revision and
timestamp.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 7afd83d1..7504d76c 100644 --- a/configure.ac +++ b/configure.ac @@ -28,12 +28,16 @@ min_automake_version="1.10" # bump the version number immediately after the release and do another # commit and push so that the git magic is able to work. See below # for the LT versions. -m4_define(mym4_version, [1.6.0]) +m4_define(mym4_version_major, [1]) +m4_define(mym4_version_minor, [6]) +m4_define(mym4_version_micro, [0]) # Below is m4 magic to extract and compute the revision number, the # decimalized short revision number, a beta version string, and a flag # indicating a development version (mym4_isgit). Note that the m4 # processing is done by autoconf and not during the configure run. +m4_define(mym4_version, + [mym4_version_major.mym4_version_minor.mym4_version_micro]) m4_define([mym4_revision], m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r'])) m4_define([mym4_revision_dec], @@ -125,6 +129,9 @@ AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) +VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \ + mym4_version_minor mym4_version_micro) +AC_SUBST(VERSION_NUMBER) ###################### @@ -1341,21 +1348,24 @@ esac AC_SUBST([GCRYPT_HWF_MODULES]) -# Generate extended version information for W32. -if test "$have_w32_system" = yes; then - BUILD_TIMESTAMP=`date --iso-8601=minutes` - changequote(,)dnl - BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` - changequote([,])dnl - BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec" -fi +# +# Provide information about the build. +# BUILD_REVISION="mym4_revision" AC_SUBST(BUILD_REVISION) -AC_SUBST(BUILD_TIMESTAMP) -AC_SUBST(BUILD_FILEVERSION) AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION", [GIT commit id revision used to build this package]) +changequote(,)dnl +BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` +changequote([,])dnl +BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec" +AC_SUBST(BUILD_FILEVERSION) + +BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` +AC_SUBST(BUILD_TIMESTAMP) +AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP", + [The time this package was configured for a build]) # And create the files. |