aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac54
-rw-r--r--src/versioninfo.rc.in8
2 files changed, 35 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac
index 85f9362..b25630e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,21 +19,30 @@
# (Process this file with autoconf to produce a configure script.)
# The following lines are used by ./autogen.sh.
AC_PREREQ(2.59)
-min_automake_version="1.9.6"
-
-# Remember to change the version number immediately *after* a release.
-# Set my_issvn to "yes" for non-released code. Remember to run an
-# "svn up" and "autogen.sh" right before creating a distribution.
-m4_define([my_version], [1.11])
-m4_define([my_issvn], [yes])
-
-m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
- | sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
-m4_define([git_revision],
+min_automake_version="1.11"
+
+# To build a release you need to create a tag with the version number
+# (git tag -s libgpg-error-n.m) and run "./autogen.sh --force".
+# Please bump the version number immediately after the release, do
+# another commit, and a push so that the git magic is able to work.
+# See below for the LT versions.
+m4_define([mym4_version], [1.11])
+
+# 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_revision],
m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
-m4_define([my_full_version], [my_version[]m4_if(my_issvn,[yes],
- [m4_if(git_revision,[],[-svn[]svn_revision],[-git[]git_revision])])])
-AC_INIT([libgpg-error],[my_full_version], [http://bugs.gnupg.org])
+m4_define([mym4_revision_dec],
+ m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
+m4_define([mym4_betastring],
+ m4_esyscmd_s([git describe --match 'libgpg-error-[0-9].*[0-9]' --long|\
+ awk -F- '$4!=0{print"-beta"$4}']))
+m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes]))
+m4_define([mym4_full_version],[mym4_version[]mym4_betastring])
+
+AC_INIT([libgpg-error],[mym4_full_version],[http://bugs.gnupg.org])
# LT Version numbers, remember to change them just *before* a release.
# (Code changed: REVISION++)
# (Interfaces added/removed/changed: CURRENT++, REVISION=0)
@@ -165,16 +174,14 @@ if test "$have_w32_system" = yes; then
changequote(,)dnl
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
changequote([,])dnl
- case "$VERSION" in
- *-svn*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
- *-cvs) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
- *-git*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
- *-rc*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,1" ;;
- *) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,2" ;;
- esac
+ BUILD_FILEVERSION="${BUILD_FILEVERSION}0,mym4_revision_dec"
fi
+BUILD_REVISION="mym4_revision"
AC_SUBST(BUILD_TIMESTAMP)
AC_SUBST(BUILD_FILEVERSION)
+AC_SUBST(BUILD_REVISION)
+AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
+ [GIT commit id used to build this package])
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
@@ -196,8 +203,9 @@ AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
AC_OUTPUT
echo "
- Libgpg-error v${VERSION} has been configured as follows:
+ $PACKAGE_NAME-$PACKAGE_VERSION prepared for make
- Platform: $host
+ Revision: mym4_revision (mym4_revision_dec)
+ Platform: $host
"
diff --git a/src/versioninfo.rc.in b/src/versioninfo.rc.in
index 3384adc..284195b 100644
--- a/src/versioninfo.rc.in
+++ b/src/versioninfo.rc.in
@@ -1,6 +1,6 @@
/* versioninfo.rc.in - for libgpg-error
* Copyright (C) 2005 g10 Code GmbH
- *
+ *
* This file is free software; as a special exception the author gives
* unlimited permission to copy and/or distribute it, with or without
* modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@
* WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
-
+
/* This file is processed by configure to create versioninfo.rc */
#line __LINE__ "versioninfo.rc.in"
@@ -37,9 +37,9 @@ BEGIN
VALUE "Comments", "Provided under the terms of the GNU Lesser General Public License.\0"
VALUE "CompanyName", "g10 Code GmbH\0"
VALUE "FileDescription", "libgpg-error - Common error codes\0"
- VALUE "FileVersion", "@VERSION@\0"
+ VALUE "FileVersion", "@LIBGPG_ERROR_LT_CURRENT@.@LIBGPG_ERROR_LT_AGE@.@LIBGPG_ERROR_LT_REVISION@.@BUILD_REVISION@\0"
VALUE "InternalName", "libgpg-error\0"
- VALUE "LegalCopyright", "Copyright � 2005 g10 Code GmbH\0"
+ VALUE "LegalCopyright", "Copyright � 2012 g10 Code GmbH\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "libgpg-error.dll\0"
VALUE "PrivateBuild", "\0"