autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accommodate non-srcdir build-from-checkout.


From: Jim Meyering
Subject: Accommodate non-srcdir build-from-checkout.
Date: Sun, 11 Nov 2007 20:10:53 +0100

This is for you, Ralf :-)
I'll push tomorrow.

        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.

---
 ChangeLog                 |    7 +++++++
 GNUmakefile               |    2 +-
 build-aux/git-version-gen |   17 +++++++++--------
 configure.ac              |    2 +-
 4 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f9aacad..b5c04b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-11-11  Jim Meyering  <address@hidden>

+       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.

diff --git a/GNUmakefile b/GNUmakefile
index cace160..cec6444 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -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)
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 5f86625..20c759e 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -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) ;;
diff --git a/configure.ac b/configure.ac
index 3a79310..9adafa1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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]),
        address@hidden)
 AC_SUBST([PACKAGE_NAME])dnl
 AC_CONFIG_SRCDIR([ChangeLog])
--
1.5.3.5.622.g6fd7a




reply via email to

[Prev in Thread] Current Thread [Next in Thread]