From db10a69bf4f8440b783147d3b3fac8bcaec57e5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 30 May 2010 00:14:02 +0200 Subject: [PATCH] Use Gnulib's `git-version-gen'. * GUILE-VERSION (GUILE_VERSION): Remove. * Makefile.am (dist-hook): Depend on `gen-tarball-version'. (BUILT_SOURCES): New variable. ($(top_srcdir)/.version, gen-tarball-version): New targets. * cfg.mk (git-version-gen-tag-sed-script): New variable. * configure.ac: Use `build-aux/git-version-gen' to generate the VERSION argument of `AC_INIT'. Initialize Automake without `check-news'. Define $GUILE_VERSION as an alias for $PACKAGE_VERSION. --- GUILE-VERSION | 3 ++- Makefile.am | 8 +++++++- cfg.mk | 2 ++ configure.ac | 13 +++++-------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/GUILE-VERSION b/GUILE-VERSION index 250ebede0..28039b718 100644 --- a/GUILE-VERSION +++ b/GUILE-VERSION @@ -1,11 +1,12 @@ # -*-shell-script-*- +# Note: `GUILE_VERSION' is defined in `configure.ac' using `git-version-gen'. GUILE_MAJOR_VERSION=1 GUILE_MINOR_VERSION=9 GUILE_MICRO_VERSION=10 GUILE_EFFECTIVE_VERSION=2.0 -GUILE_VERSION=${GUILE_MAJOR_VERSION}.${GUILE_MINOR_VERSION}.${GUILE_MICRO_VERSION} + # All of the shared lib versioning info. Right now, for this to work # properly, you'll also need to add AC_SUBST calls to the right place diff --git a/Makefile.am b/Makefile.am index 9ece841c6..663f45e78 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,7 +43,7 @@ DISTCLEANFILES = check-guile.log DISTCHECK_CONFIGURE_FLAGS = --enable-error-on-warning -dist-hook: gen-ChangeLog +dist-hook: gen-ChangeLog gen-tarball-version clean-local: rm -rf cache/ @@ -60,4 +60,10 @@ gen-ChangeLog: mv $(distdir)/cl-t $(distdir)/ChangeLog; \ fi +BUILT_SOURCES = $(top_srcdir)/.version +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +gen-tarball-version: + echo $(VERSION) > $(distdir)/.tarball-version + # Makefile.am ends here diff --git a/cfg.mk b/cfg.mk index dba616c23..4b24711d0 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1 +1,3 @@ old_NEWS_hash = d41d8cd98f00b204e9800998ecf8427e +git-version-gen-tag-sed-script := \ + 's/^release_\([0-9]\+\)-\([0-9]\+\)-\([0-9]\+\)-/v\1.\2\.\3-/g' diff --git a/configure.ac b/configure.ac index 31ebad3c4..35f4a6913 100644 --- a/configure.ac +++ b/configure.ac @@ -27,25 +27,22 @@ Floor, Boston, MA 02110-1301, USA. AC_PREREQ(2.61) -dnl `patsubst' here deletes the newline which "echo" prints. We can't use -dnl "echo -n" since -n is not portable (see autoconf manual "Limitations of -dnl Builtins"), in particular on solaris it results in a literal "-n" in -dnl the output. -dnl AC_INIT([GNU Guile], - patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${GUILE_VERSION}),[ -]), + m4_esyscmd([build-aux/git-version-gen \ + .tarball-version \ + 's/^release_\([0-9]\+\)-\([0-9]\+\)-\([0-9]\+\)-/v\1.\2\.\3-/g']), [bug-guile@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(GUILE-VERSION) -AM_INIT_AUTOMAKE([gnu no-define check-news -Wall -Wno-override]) +AM_INIT_AUTOMAKE([gnu no-define -Wall -Wno-override]) AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT) AC_CONFIG_SRCDIR([GUILE-VERSION]) . $srcdir/GUILE-VERSION +GUILE_VERSION="$PACKAGE_VERSION" AC_CONFIG_HEADERS([config.h]) AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/) -- 2.20.1