Reported by Jim Meyering.
* autoheader.sh: Trace AC_DEFINE and AC_DEFINE_UNQUOTED to build
the list of $syms which are defined.
* tests/tools.m4 (autoheader): New test.
+2000-05-03 Akim Demaille <akim@epita.fr>
+
+ Support of acconfig.h was broken. Fix and test.
+ Reported by Jim Meyering.
+
+ * autoheader.sh: Trace AC_DEFINE and AC_DEFINE_UNQUOTED to build
+ the list of $syms which are defined.
+ * tests/tools.m4 (autoheader): New test.
+
2000-05-03 Akim Demaille <akim@epita.fr>
Rename the language FORTRAN77 as Fortran 77.
syms=
# Source what the traces are trying to tell us.
-autoconf=`echo "$0" | sed -e 's/autoheader$/autoconf/'`
+autoconf=`echo "$0" | sed -e 's,[^/]*$,autoconf,'`
test -n "$localdir" && autoconf="$autoconf -l $localdir"
export AC_MACRODIR
-$autoconf --trace AC_CONFIG_HEADERS:'config_h="$1"' \
- --trace AH_OUTPUT:'ac_verbatim_$1="\
+$autoconf \
+ --trace AC_CONFIG_HEADERS:'config_h="$1"' \
+ --trace AH_OUTPUT:'ac_verbatim_$1="\
$2"' \
- $infile >$tmp/traces.sh
+ --trace AC_DEFINE:'syms="$$syms $1"' \
+ --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \
+ $infile >$tmp/traces.sh || exit 1
. $tmp/traces.sh
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
# to reduce the possibility of mistakenly matching another symbol that
# is a substring of it.
-syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`
+# Beware that some of the symbols might actually be macro with arguments:
+# keep only their name.
+syms=`for sym in $syms; do echo $sym; done |
+ sed -e 's/(.*//' |
+ sort |
+ uniq |
+ sed -e 's@^@ @'`
# We template only the first CONFIG_HEADER.
syms=
# Source what the traces are trying to tell us.
-autoconf=`echo "$0" | sed -e 's/autoheader$/autoconf/'`
+autoconf=`echo "$0" | sed -e 's,[^/]*$,autoconf,'`
test -n "$localdir" && autoconf="$autoconf -l $localdir"
export AC_MACRODIR
-$autoconf --trace AC_CONFIG_HEADERS:'config_h="$1"' \
- --trace AH_OUTPUT:'ac_verbatim_$1="\
+$autoconf \
+ --trace AC_CONFIG_HEADERS:'config_h="$1"' \
+ --trace AH_OUTPUT:'ac_verbatim_$1="\
$2"' \
- $infile >$tmp/traces.sh
+ --trace AC_DEFINE:'syms="$$syms $1"' \
+ --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \
+ $infile >$tmp/traces.sh || exit 1
. $tmp/traces.sh
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
# to reduce the possibility of mistakenly matching another symbol that
# is a substring of it.
-syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`
+# Beware that some of the symbols might actually be macro with arguments:
+# keep only their name.
+syms=`for sym in $syms; do echo $sym; done |
+ sed -e 's/(.*//' |
+ sort |
+ uniq |
+ sed -e 's@^@ @'`
# We template only the first CONFIG_HEADER.
syms=
# Source what the traces are trying to tell us.
-autoconf=`echo "$0" | sed -e 's/autoheader$/autoconf/'`
+autoconf=`echo "$0" | sed -e 's,[^/]*$,autoconf,'`
test -n "$localdir" && autoconf="$autoconf -l $localdir"
export AC_MACRODIR
-$autoconf --trace AC_CONFIG_HEADERS:'config_h="$1"' \
- --trace AH_OUTPUT:'ac_verbatim_$1="\
+$autoconf \
+ --trace AC_CONFIG_HEADERS:'config_h="$1"' \
+ --trace AH_OUTPUT:'ac_verbatim_$1="\
$2"' \
- $infile >$tmp/traces.sh
+ --trace AC_DEFINE:'syms="$$syms $1"' \
+ --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \
+ $infile >$tmp/traces.sh || exit 1
. $tmp/traces.sh
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
# to reduce the possibility of mistakenly matching another symbol that
# is a substring of it.
-syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`
+# Beware that some of the symbols might actually be macro with arguments:
+# keep only their name.
+syms=`for sym in $syms; do echo $sym; done |
+ sed -e 's/(.*//' |
+ sort |
+ uniq |
+ sed -e 's@^@ @'`
# We template only the first CONFIG_HEADER.
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
-.TH AUTOHEADER "1" "April 2000" "GNU autoconf 2.14a" FSF
+.TH AUTOHEADER "1" "May 2000" "GNU autoconf 2.14a" FSF
.SH NAME
autoheader \- Create a template header for configure
.SH SYNOPSIS
+## ------------ ##
+## autoheader. ##
+## ------------ ##
+
+# autoheader is intensively used in its modern form throught this
+# test suite. But we also have to check that acconfig.h still works.
+
+AT_SETUP(autoheader)
+
+AT_DATA(acconfig.h,
+[[/* Define this to whatever you want. */
+#undef this
+]])
+
+# 1. Check that `acconfig.h' is still honored.
+AT_DATA(configure.in,
+[[AC_INIT
+AC_CONFIG_HEADERS(config.h)
+AC_DEFINE(this, "whatever you want.")
+]])
+
+
+AT_CHECK([../autoheader -m .. -l $at_srcdir -<configure.in], 0,
+[[/* config.h.in. Generated automatically from - by autoheader. */
+
+/* Define this to whatever you want. */
+#undef this
+]], ignore)
+
+# 2. Check that missing templates are a fatal error.
+AT_DATA(configure.in,
+[[AC_INIT
+AC_CONFIG_HEADERS(config.h)
+AC_DEFINE(that, "whatever you want.")
+]])
+
+AT_CHECK([../autoheader -m .. -l $at_srcdir -<configure.in], 1, ignore, ignore)
+
+AT_CLEANUP
+
+
+
+
## ------------ ##
## autoupdate. ##
## ------------ ##
AT_CLEANUP
+
+
## ------------------ ##
## autoconf --trace. ##
## ------------------ ##