From d8d75d9f629e686f45bb7b7a5fac24017e681d6b Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 19 Dec 2009 20:25:34 +0200 Subject: [PATCH 2/2] Automatic version generation Signed-off-by: Felipe Contreras --- Makefile.am | 3 +++ build-aux/git-version-gen | 10 ++++++++++ configure.ac | 24 ++++-------------------- 3 files changed, 17 insertions(+), 20 deletions(-) create mode 100755 build-aux/git-version-gen diff --git a/Makefile.am b/Makefile.am index 3997cc3..04d7b36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,3 +6,6 @@ EXTRA_DIST = autogen.sh include tools/lcov.am include tools/telepathy.am + +dist-hook: + echo $(VERSION) > $(distdir)/.version diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen new file mode 100755 index 0000000..0472f86 --- /dev/null +++ b/build-aux/git-version-gen @@ -0,0 +1,10 @@ +#!/bin/sh + +if test -f .version; then + v=`cat .version` +else + v=`git describe --tags | sed 's/^telepathy-haze-//'` +fi + +# for m4_esyscmd +echo "$v" | tr -d '\012' diff --git a/configure.ac b/configure.ac index c751e5f..99ab5b7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,24 +1,8 @@ AC_PREREQ([2.59]) -# Making releases: -# set the new version number -# set nano_version to 0 -# make the release, tag it -# set nano_version to 1 - -m4_define([haze_major_version], [0]) -m4_define([haze_minor_version], [5]) -m4_define([haze_micro_version], [0]) -m4_define([haze_nano_version], [1]) - -m4_define([haze_base_version], - [haze_major_version.haze_minor_version.haze_micro_version]) -m4_define([haze_version], - [m4_if(haze_nano_version, 0, - [haze_base_version], - [haze_base_version].[haze_nano_version])]) - -AC_INIT([telepathy-haze], [haze_version], +m4_define([haze_version], m4_esyscmd([build-aux/git-version-gen])) +m4_define([haze_version_extra], m4_bregexp(haze_version, [-g[0-9a-f]+$])) +AC_INIT([telepathy-haze], [haze_version]), [https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=haze]) AC_CONFIG_MACRO_DIR([m4]) @@ -47,7 +31,7 @@ COMPILER_OPTIMISATIONS COMPILER_COVERAGE LINKER_OPTIMISATIONS -ifelse(haze_nano_version, 0, [release=yes], [release=no]) +ifelse(haze_version_extra, -1, [release=yes], [release=no]) TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test x$release = xno], [all \ extra \ -- 1.7.6.3