]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Accommodate non-srcdir build-from-checkout.
authorJim Meyering <meyering@redhat.com>
Sun, 11 Nov 2007 19:05:08 +0000 (20:05 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 12 Nov 2007 23:10:48 +0000 (00:10 +0100)
* build-aux/git-version-gen: Require an additional parameter: $srcdir.
Use git's --git-dir=$srcdir/.git option.
Add quotes, in case tarball_version_file contains shell meta-characters.
* GNUmakefile (_curr-ver): Pass $(srcdir) to git-version-gen.
* configure.ac: Pass "." to git-version-gen.

ChangeLog
GNUmakefile
build-aux/git-version-gen
configure.ac

index e590dc40600bc0b22a43dacaa0e0f7f93b331bf4..7bca91328057dab71bbdf854fc74e7a01c590aa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-11-12  Jim Meyering  <meyering@redhat.com>
 
+       Accommodate non-srcdir build-from-checkout.
+       * build-aux/git-version-gen: Require an additional parameter: $srcdir.
+       Use git's --git-dir=$srcdir/.git option.
+       Add quotes, in case tarball_version_file contains shell meta-characters.
+       * GNUmakefile (_curr-ver): Pass $(srcdir) to git-version-gen.
+       * configure.ac: Pass "." to git-version-gen.
+
        Avoid spurious test failures due to version skew.
        * GNUmakefile (dummy): Run $(MAKE) clean after autoreconf -i.
 
index cace1601b2aa13231ce780a8be3ca2c67ebfcdcb..cec6444a2856899048b435dfb5e613e4106cb3df 100644 (file)
@@ -50,7 +50,7 @@ include Makefile
 ifeq (0,$(MAKELEVEL))
   _is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
   ifneq (,$(_is-dist-target))
-    _curr-ver := $(shell build-aux/git-version-gen .version)
+    _curr-ver := $(shell build-aux/git-version-gen $(srcdir) .version)
     ifneq ($(_curr-ver),$(VERSION))
       $(info INFO: running autoreconf for new version string: $(_curr-ver))
       dummy := $(shell rm -rf autom4te.cache; autoreconf -i && $(MAKE) clean)
index 5f866258a158f83d3a5a6826dbe5d7738015eadc..20c759e7e2e4a5f51b0917e0d7ccd56117474343 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2007-11-03.22
+scriptversion=2007-11-11.19
 
 # Copyright (C) 2007 Free Software Foundation
 #
@@ -24,14 +24,15 @@ scriptversion=2007-11-03.22
 # - from a git repository in which the git-describe command below
 #   produces useful output (thus requiring at least one signed tag)
 # - from a non-git-repo directory containing a .version file, which
-#   presumes this script is invoked like "./git-version-gen .version".
+#   presumes this script is invoked like "./git-version-gen $srcdir .version".
 
 case $# in
-    1) ;;
-    *) echo 1>&2 "Usage: $0 \$srcdir/.version"; exit 1;;
+    2) ;;
+    *) echo 1>&2 "Usage: $0 \$srcdir .version"; exit 1;;
 esac
 
-tarball_version_file=$1
+srcdir=$1
+tarball_version_file=$srcdir/$2
 nl='
 '
 
@@ -39,7 +40,7 @@ nl='
 # then try git-describe, then default.
 if test -f $tarball_version_file
 then
-    v=`cat $tarball_version_file` || exit 1
+    v=`cat "$tarball_version_file"` || exit 1
     case $v in
        *$nl*) v= ;; # reject multi-line output
        [0-9]*) ;;
@@ -52,8 +53,8 @@ fi
 if test -n "$v"
 then
     : # use $v
-elif test -d .git \
-    && v=`git describe --abbrev=4 HEAD 2>/dev/null` \
+elif test -d "$srcdir/.git" \
+    && v=`git --git-dir="$srcdir/.git" describe --abbrev=4 HEAD 2>/dev/null` \
     && case $v in
         v[0-9]*) ;;
         *) (exit 1) ;;
index 3a7931064b093dcacb09c0dd1e6680cd6b9c6747..9adafa1be0523cfce191b8c96e27c7594d9974e4 100644 (file)
@@ -20,7 +20,7 @@
 # We need AC_CONFIG_TESTDIR, AC_PROG_SED, AC_PROG_GREP.
 AC_PREREQ([2.60])
 
-AC_INIT([GNU Autoconf], m4_esyscmd([build-aux/git-version-gen .version]),
+AC_INIT([GNU Autoconf], m4_esyscmd([build-aux/git-version-gen . .version]),
        [bug-autoconf@gnu.org])
 AC_SUBST([PACKAGE_NAME])dnl
 AC_CONFIG_SRCDIR([ChangeLog])