From: Akim Demaille Date: Wed, 6 Dec 2000 10:53:58 +0000 (+0000) Subject: * autoconf.sh (task trace): s/m4/$M4/. X-Git-Tag: autoconf-2.50~345 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83e4065f15a065a9d373b228aeada28a6cda7a97;p=thirdparty%2Fautoconf.git * autoconf.sh (task trace): s/m4/$M4/. * autoheader.sh: When loading trace.sh, catch errors and exit with a decent error message. * tests/tools.at: Be sure to test autoconf --trace before autoheader. --- diff --git a/ChangeLog b/ChangeLog index 5d1428dba..a689e5f5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-12-06 Akim Demaille + + * autoconf.sh (task trace): s/m4/$M4/. + * autoheader.sh: When loading trace.sh, catch errors and exit with + a decent error message. + * tests/tools.at: Be sure to test autoconf --trace before + autoheader. + 2000-12-06 Akim Demaille * tests/atgeneral.m4 (AT_CHECK): Fix the m4_ifval invocation. diff --git a/autoconf.in b/autoconf.in index feca9b813..e5817e713 100644 --- a/autoconf.in +++ b/autoconf.in @@ -668,7 +668,7 @@ EOF # sometimes and `m4_BUILTIN' at others. We should render a unique name, # the one specified by the user. base_name=`echo "$macro_name" | sed 's/^m4_//'` - if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then + if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | $M4; then # BASE_NAME is a builtin. trace_opt="$trace_opt -t $base_name -t m4_$base_name" echo "$base_name$trace_format" | diff --git a/autoconf.sh b/autoconf.sh index feca9b813..e5817e713 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -668,7 +668,7 @@ EOF # sometimes and `m4_BUILTIN' at others. We should render a unique name, # the one specified by the user. base_name=`echo "$macro_name" | sed 's/^m4_//'` - if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then + if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | $M4; then # BASE_NAME is a builtin. trace_opt="$trace_opt -t $base_name -t m4_$base_name" echo "$base_name$trace_format" | diff --git a/autoheader.in b/autoheader.in index 274a2c1fd..e5ae2a08d 100644 --- a/autoheader.in +++ b/autoheader.in @@ -256,7 +256,13 @@ $2"' \ $infile >$tmp/traces.sh || { (exit 1); exit; } $verbose $me: sourcing $tmp/traces.sh >&2 -. $tmp/traces.sh +if (set -e && . $tmp/traces.sh) >/dev/null 2>&1; then + . $tmp/traces.sh +else + echo "$me: error: shell error while sourcing $tmp/trace.sh" >&2 + (exit 1); exit +fi + # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") diff --git a/autoheader.sh b/autoheader.sh index 274a2c1fd..e5ae2a08d 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -256,7 +256,13 @@ $2"' \ $infile >$tmp/traces.sh || { (exit 1); exit; } $verbose $me: sourcing $tmp/traces.sh >&2 -. $tmp/traces.sh +if (set -e && . $tmp/traces.sh) >/dev/null 2>&1; then + . $tmp/traces.sh +else + echo "$me: error: shell error while sourcing $tmp/trace.sh" >&2 + (exit 1); exit +fi + # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") diff --git a/bin/autoconf.in b/bin/autoconf.in index feca9b813..e5817e713 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -668,7 +668,7 @@ EOF # sometimes and `m4_BUILTIN' at others. We should render a unique name, # the one specified by the user. base_name=`echo "$macro_name" | sed 's/^m4_//'` - if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then + if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | $M4; then # BASE_NAME is a builtin. trace_opt="$trace_opt -t $base_name -t m4_$base_name" echo "$base_name$trace_format" | diff --git a/bin/autoheader.in b/bin/autoheader.in index 274a2c1fd..e5ae2a08d 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -256,7 +256,13 @@ $2"' \ $infile >$tmp/traces.sh || { (exit 1); exit; } $verbose $me: sourcing $tmp/traces.sh >&2 -. $tmp/traces.sh +if (set -e && . $tmp/traces.sh) >/dev/null 2>&1; then + . $tmp/traces.sh +else + echo "$me: error: shell error while sourcing $tmp/trace.sh" >&2 + (exit 1); exit +fi + # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") diff --git a/man/autoheader.1 b/man/autoheader.1 index 8e592eb1c..609ede74d 100644 --- a/man/autoheader.1 +++ b/man/autoheader.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH AUTOHEADER "1" "November 2000" "GNU autoconf 2.49b" FSF +.TH AUTOHEADER "1" "December 2000" "GNU autoconf 2.49b" FSF .SH NAME autoheader \- Create a template header for configure .SH SYNOPSIS diff --git a/tests/tools.at b/tests/tools.at index 4aa932155..cf12babbd 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -68,184 +68,31 @@ AT_CLEANUP +## ----------------- ## +## AWK portability. ## +## ----------------- ## -## ------------ ## -## 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 --autoconf-dir .. -expout </dev/null 2>&1; then + # Generation of the script. + AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir], 0, + [], []) + # Tracing. + AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir -t AC_INIT], 0, + ignore, []) + # Syntax correctness of ifnames. + AT_CHECK([AWK='gawk --posix' ifnames empty], 0, + [], []) +fi -AT_CHECK([echo "AC_PREREQ($at_version)" | - autoupdate --autoconf-dir $top_srcdir -], - 0, [expout], []) +AT_CLEANUP(configure) -AT_CHECK([echo "AC_PREREQ(999.99)" | - autoupdate --autoconf-dir $top_srcdir -], - 1, [], [ignore]) -AT_CLEANUP @@ -255,9 +102,9 @@ AT_CLEANUP ## ------------------ ## -# Tracing user defined macros -# --------------------------- -AT_SETUP([autoconf --trace]) +# autoconf --trace: user macros +# ----------------------------- +AT_SETUP([autoconf --trace: user macros]) AT_DATA(configure.in, [[define([active], [ACTIVE]) @@ -310,9 +157,9 @@ AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -t TRACE2:'${)===(}@'], 0, AT_CLEANUP -# Tracing builtins -# ---------------- -AT_SETUP([Tracing M4 builtins]) +# autoconf --trace: builtins +# -------------------------- +AT_SETUP([autoconf --trace: builtins]) AT_DATA(configure.in, [[define([active], [ACTIVE]) @@ -381,34 +228,6 @@ AT_CLEANUP(configure) -## ---------------------------- ## -## autoconf's AWK portability. ## -## ---------------------------- ## - -AT_SETUP([AWK portability]) - -AT_DATA([configure.in], -[[AC_INIT -]]) - -if (gawk --version) >/dev/null 2>&1; then - # Generation of the script. - AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir], 0, - [], []) - # Tracing. - AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir -t AC_INIT], 0, - ignore, []) - # Syntax correctness of ifnames. - AT_CHECK([AWK='gawk --posix' ifnames empty], 0, - [], []) -fi - -AT_CLEANUP(configure) - - - - - ## --------- ## ## ifnames. ## ## --------- ## @@ -450,3 +269,184 @@ VAL4 iftest1.c ], []) AT_CLEANUP(configure) + + + +## ------------ ## +## autoheader. ## +## ------------ ## + +# autoheader is intensively used in its modern form throught this +# test suite. But we also have to check that acconfig.h still works. +# autoheader uses autoconf --trace, so traces first. + +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 --autoconf-dir .. -expout <