From: Akim Demaille Date: Wed, 3 May 2000 11:00:46 +0000 (+0000) Subject: Support of acconfig.h was broken. Fix and test. X-Git-Tag: autoconf-2.50~953 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc07253b22cfa3d87eedd0447715834f4b009b2b;p=thirdparty%2Fautoconf.git 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. --- diff --git a/ChangeLog b/ChangeLog index b65a137b9..9ee831424 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-05-03 Akim Demaille + + 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 Rename the language FORTRAN77 as Fortran 77. diff --git a/autoheader.in b/autoheader.in index 448181256..c16ad7e7f 100644 --- a/autoheader.in +++ b/autoheader.in @@ -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. diff --git a/autoheader.sh b/autoheader.sh index 448181256..c16ad7e7f 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -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. diff --git a/bin/autoheader.in b/bin/autoheader.in index 448181256..c16ad7e7f 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -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. diff --git a/man/autoheader.1 b/man/autoheader.1 index 0050fc7f7..33218d9b9 100644 --- a/man/autoheader.1 +++ b/man/autoheader.1 @@ -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 diff --git a/tests/tools.m4 b/tests/tools.m4 index eca7678c6..ab562be29 100644 --- a/tests/tools.m4 +++ b/tests/tools.m4 @@ -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 -