"Derek R. Price" wrote:
> Inspired by Akim Demaille's use of ifdef, I wrote a third edition of
> this patch which increases functionality when used with a current
> Autoconf.
I just wanted to let you all know that.
...
Ok, fine, here's the patch. :)
Derek
--
Derek Price CVS Solutions Architect ( http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
99. Daddy, why doesn't this magnet pick up this floppy disk?
? automake-stamph3.diff
? automake-1.4c-stamph3.diff
? tests/automake-1.4c-stamph3.diff
Index: ChangeLog
===
RCS file: /cvs/automake/ChangeLog,v
retrieving revision 1.997
diff -u -r1.997 ChangeLog
--- ChangeLog 2001/02/06 10:25:21 1.997
+++ ChangeLog 2001/02/06 18:07:37
@@ -77,6 +77,10 @@
about libtool, and maintainer-clean.
* clean.am, libtool.am: Handle these.
+2001-02-05 Derek Price <[EMAIL PROTECTED]>
+
+ * m4/header.m4 (AM_CONFIG_HEADER): create stamp-h files in the correct
+ locations.
2001-02-05 Akim Demaille <[EMAIL PROTECTED]>
Index: m4/header.m4
===
RCS file: /cvs/automake/m4/header.m4,v
retrieving revision 1.7
diff -u -r1.7 header.m4
--- m4/header.m42000/08/06 12:36:53 1.7
+++ m4/header.m42001/02/06 18:07:39
@@ -10,19 +10,57 @@
AC_PREREQ([2.12])
AC_DEFUN([AM_CONFIG_HEADER],
+[ifdef([AC_FOREACH],dnl
+[dnl init our file count if it isn't already
+m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index],
+[0]))
+dnl prepare to store our destination file list for use in config.status
+AC_FOREACH([_AM_File], [$1],
+ [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
+ m4_define([_AM_Config_Header_Index],
+m4_incr(_AM_Config_Header_Index))
+ dnl and add it to the list of files AC keeps track of, along
+ dnl with our hook
+ AC_CONFIG_HEADERS(_AM_File,
+dnl COMMANDS, [, INIT-CMDS]
+[# update the timestamp
+echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
+][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
+ m4_popdef([_AM_Dest])])],dnl
[AC_CONFIG_HEADER([$1])
AC_OUTPUT_COMMANDS(
ifelse(patsubst([$1], [[^ ]], []),
[],
[test -z "$CONFIG_HEADERS" || echo timestamp >dnl
- patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
- [am_indx=1
- for am_file in $1; do
-case " $CONFIG_HEADERS " in
-*" $am_file "*)
- echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
- ;;
-esac
-am_indx=\`expr \$am_indx + 1\`
- done])
-])
+ patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
+[am_indx=1
+for am_file in $1; do
+ case " \$CONFIG_HEADERS " in
+ *" \$am_file "*)
+am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
+if test -n "\$am_dir"; then
+ am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
+ for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
+am_tmpdir=\$am_tmpdir\$am_subdir/
+if test ! -d \$am_tmpdir; then
+ mkdir \$am_tmpdir
+fi
+ done
+fi
+echo timestamp > "\$am_dir"stamp-h\$am_indx
+;;
+ esac
+ am_indx=\`expr \$am_indx + 1\`
+done])
+])]) # AM_CONFIG_HEADER
+
+# _AM_DIRNAME(PATH)
+# -
+# Like AS_DIRNAME, only do it during macro expansion
+AC_DEFUN([_AM_DIRNAME],
+ [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
+ m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
+ m4_if(m4_regexp([$1], [^/.*]), -1,
+ [.],
+ m4_patsubst([$1], [^\(/\).*], [\1])),
+ m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
+ m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
+]) # _AM_DIRNAME
Index: tests/Makefile.am
===
RCS file: /cvs/automake/tests/Makefile.am,v
retrieving revision 1.248
diff -u -r1.248 Makefile.am
--- tests/Makefile.am 2001/02/04 03:18:01 1.248
+++ tests/Makefile.am 2001/02/06 18:07:39
@@ -88,6 +88,7 @@
depacl2.test \
depend.test \
depend3.test \
+dirname.test \
discover.test \
distdir.test \
double.test \
@@ -226,6 +227,7 @@
spell3.test \
spelling.test \
stamph.test \
+stamph2.test \
stdlib.test \
subdir.test \
subdir2.test \
Index: tests/dirname.test
===
RCS file: tests/dirname.test
diff -N tests/dirname.test
--- /dev/null Tue Aug 29 07:25:14 2000
+++ tests/dirname.test Tue Feb 6 10:07:39 2001
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+# Test the operation of the _AM_DIRNAME macro from m4/header.m4
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_PLAIN_SCRIPT
+echo "1 /a/path/to/a/file = _AM_D