]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Support of acconfig.h was broken. Fix and test.
authorAkim Demaille <akim@epita.fr>
Wed, 3 May 2000 11:00:46 +0000 (11:00 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 3 May 2000 11:00:46 +0000 (11:00 +0000)
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.

ChangeLog
autoheader.in
autoheader.sh
bin/autoheader.in
man/autoheader.1
tests/tools.m4

index b65a137b95b3356a5b21f3c9981fac950ec48916..9ee831424ee9bc95a87bb161a0e0bee8109e2b69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
index 448181256f8920ae9a4e14a23753759ca0781bd1..c16ad7e7ffd78336f60199247ea71bc442ed0c24 100644 (file)
@@ -162,20 +162,29 @@ config_h=
 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.
index 448181256f8920ae9a4e14a23753759ca0781bd1..c16ad7e7ffd78336f60199247ea71bc442ed0c24 100644 (file)
@@ -162,20 +162,29 @@ config_h=
 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.
index 448181256f8920ae9a4e14a23753759ca0781bd1..c16ad7e7ffd78336f60199247ea71bc442ed0c24 100644 (file)
@@ -162,20 +162,29 @@ config_h=
 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.
index 0050fc7f758526b2f4db8bbff03b6b414475f579..33218d9b9674db205dc988b1a8bf160ae8a336c2 100644 (file)
@@ -1,5 +1,5 @@
 .\" 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
index eca7678c64c309dbc3e0de3e098d5f1e88adffdc..ab562be29260919ccfa8c743250c2f02139f8ec5 100644 (file)
@@ -68,6 +68,49 @@ AT_CLEANUP
 
 
 
+## ------------ ##
+## 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.  ##
 ## ------------ ##
@@ -97,6 +140,8 @@ AC_OUTPUT
 AT_CLEANUP
 
 
+
+
 ## ------------------ ##
 ## autoconf --trace.  ##
 ## ------------------ ##