automake-patches
[Top][All Lists]
Advanced

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

FYI: Fix for _AC_AM_CONFIG_HEADER_HOOK (CONFIG_HEADER stamp file creatio


From: Alexandre Duret-Lutz
Subject: FYI: Fix for _AC_AM_CONFIG_HEADER_HOOK (CONFIG_HEADER stamp file creation) bug
Date: Tue, 04 Feb 2003 20:59:58 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

>>> "Sander" == Sander Niemeijer <address@hidden> writes:

 Sander> This replacement for the _AC_AM_CONFIG_HEADER_HOOK macro (located in
 Sander> m4/init.m4) fixes an incorrect naming issue of stamp-h* files when
 Sander> only specific headers are recreated through config.status.

Thanks a lot!  I'm installing the following on HEAD and branch-1-7.
This also handles header.h:top.in:middle.in:bottom.in style arguments.

[...]

 Sander> P.S. A better replacement would be to have the
 Sander> $config_headers list passed along as variable to the
 Sander> _AC_AM_HEADER_HOOK macro.

We can discuss this later when the Autoconf maintainer is back.

[...]

2003-02-04  Alexandre Duret-Lutz  <address@hidden>

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

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.186.2.17
diff -u -r1.186.2.17 THANKS
--- THANKS      2 Feb 2003 10:45:41 -0000       1.186.2.17
+++ THANKS      4 Feb 2003 19:54:32 -0000
@@ -184,6 +184,7 @@
 Rusty Ballinger                address@hidden
 Ryan T. Sammartino     address@hidden
 Sam Hocevar            address@hidden
+Sander Niemeijer       address@hidden
 Sergey Vlasov          address@hidden
 Seth Alves             address@hidden
 Shuhei Amakawa         address@hidden
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.50.2.2
diff -u -r1.50.2.2 init.m4
--- m4/init.m4  13 Jan 2003 14:06:04 -0000      1.50.2.2
+++ m4/init.m4  4 Feb 2003 19:54:32 -0000
@@ -118,5 +118,14 @@
 # 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: tests/stamph2.test
===================================================================
RCS file: /cvs/automake/automake/tests/stamph2.test,v
retrieving revision 1.7
diff -u -r1.7 stamph2.test
--- tests/stamph2.test  8 Sep 2002 13:07:56 -0000       1.7
+++ tests/stamph2.test  4 Feb 2003 19:54:32 -0000
@@ -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 @@
 : > 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

-- 
Alexandre Duret-Lutz





reply via email to

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