]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* m4/init.m4 (_AC_AM_CONFIG_HEADER_HOOK): Recompute
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 4 Feb 2003 20:00:12 +0000 (20:00 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 4 Feb 2003 20:00:12 +0000 (20:00 +0000)
indexes of header files so we create stamp files with
the right numbers when config.status is run on some headers.
* tests/stamph2.test: Check for this.
Reported by Sander Niemeijer.

ChangeLog
THANKS
m4/init.m4
tests/stamph2.test

index abb688e87d2799eb22ae6b2d490c6c7d422aebbe..2182af941bd63ce3f269552435d10f0fdf9e4de7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-02-04  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * m4/init.m4 (_AC_AM_CONFIG_HEADER_HOOK): Recompute
+       indexes of header files so we create stamp files with
+       the right numbers when config.status is run on some headers.
+       * tests/stamph2.test: Check for this.
+       Reported by Sander Niemeijer.
+
 2003-02-02  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * automake.in (vars_scanned): Move near traverse_variable_recursively.
diff --git a/THANKS b/THANKS
index 5eae3680ca3cad29f0ca8b07e462c859bad67c67..d599bce23ae6c3996e9401bdd2981d4411ee140d 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -184,6 +184,7 @@ Ronald Landheer             ronald@landheer.com
 Rusty Ballinger                rusty@rlyeh.engr.sgi.com
 Ryan T. Sammartino     ryants@shaw.ca
 Sam Hocevar            sam@zoy.org
+Sander Niemeijer       niemeijer@science-and-technology.nl
 Sergey Vlasov          vsu@mivlgu.murom.ru
 Seth Alves             alves@hungry.com
 Shuhei Amakawa         sa264@cam.ac.uk
index 47c94729ef16c5906288eec6259fa157fd82d231..4c24f7571d6ca9afc716a289670e8d693cb2f146 100644 (file)
@@ -118,5 +118,14 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
 # loop where config.status creates the headers, so we can generate
 # our stamp files there.
 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
index 6df3b5ea39879e1690c8fd70d7b791e569d8d14b..34b80fa0f91f1c9d157283900b58f5e153f91033 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -21,6 +21,8 @@
 # Make sure stamp-h* files are created where we expect
 . ./defs || exit 1
 
+set -e
+
 cat >> configure.in << END
 AM_CONFIG_HEADER(1.h
                  2.h:config.hin
@@ -42,17 +44,32 @@ mkdir sdir2
 : > sdir1/config1.hin
 : > sdir2/config2.hin
 
-$ACLOCAL || exit 1
-$AUTOCONF || exit 1
-$AUTOMAKE || exit 1
-./configure || exit 1
-
-test -f stamp-h1 || exit 1
-test -f stamp-h2 || exit 1
-test -f stamp-h3 || exit 1
-test -f sdir1/stamp-h4 || exit 1
-test -f sdir1/stamp-h5 || exit 1
-test -f sdir1/stamp-h6 || exit 1
-test -f sdir1/stamp-h7 || exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+test -f stamp-h1
+test -f stamp-h2
+test -f stamp-h3
+test -f sdir1/stamp-h4
+test -f sdir1/stamp-h5
+test -f sdir1/stamp-h6
+test -f sdir1/stamp-h7
+
+# Make sure `./config.status foo' creates the right stamp file.
+# Report from Sander Niemeijer.
+
+rm -f stamp-h*
+rm -f sdir1/stamp-h*
+
+./config.status sdir1/7.h 2.h sdir1/4.h
+test ! -f stamp-h1
+test -f stamp-h2
+test ! -f stamp-h3
+test -f sdir1/stamp-h4
+test ! -f sdir1/stamp-h5
+test ! -f sdir1/stamp-h6
+test -f sdir1/stamp-h7
 
 exit 0