* 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.
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.
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)
#!/bin/sh
# Print a version string.
-scriptversion=2007-11-03.22
+scriptversion=2007-11-11.19
# Copyright (C) 2007 Free Software Foundation
#
# - 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='
'
# 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]*) ;;
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) ;;
# 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])