diff --git a/ChangeLog b/ChangeLog index 91d5f3cf..176c8ff1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-11-02 Akim Demaille + + * tests/tools.at (Tracing M4 builtins): New test. + * autoconh.sh (trace_format): Fix its computation. + 2000-11-02 Akim Demaille * tests/atgeneral.m4 (AT_CHECK): Check stderr first, since if both @@ -9,7 +14,7 @@ * autoconf.sh (task trace) [debug]: Instead of a long pipe, extend trace.m4. - + 2000-11-02 Akim Demaille * autoupdate.sh (m4.txt): Use `dumpdef' and m4 to build it. diff --git a/autoconf.in b/autoconf.in index 7017bd7c..dec6e061 100644 --- a/autoconf.in +++ b/autoconf.in @@ -570,7 +570,14 @@ EOF do # The request may be several lines long, hence sed has to quit. macro_name=`echo "$trace" | sed 's/:.*//;q'` - trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'` + # If for instance TRACE is `define', be sure to have an empty + # TRACE_FORMAT. + case $trace in + $macro_name:* ) + trace_format=`echo "$trace" | sed "1s/^$macro_name:/:/"`;; + * ) + trace_format=;; + esac # GNU M4 1.4's tracing of builtins is buggy. When run on this input: # diff --git a/autoconf.sh b/autoconf.sh index 7017bd7c..dec6e061 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -570,7 +570,14 @@ EOF do # The request may be several lines long, hence sed has to quit. macro_name=`echo "$trace" | sed 's/:.*//;q'` - trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'` + # If for instance TRACE is `define', be sure to have an empty + # TRACE_FORMAT. + case $trace in + $macro_name:* ) + trace_format=`echo "$trace" | sed "1s/^$macro_name:/:/"`;; + * ) + trace_format=;; + esac # GNU M4 1.4's tracing of builtins is buggy. When run on this input: # diff --git a/bin/autoconf.in b/bin/autoconf.in index 7017bd7c..dec6e061 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -570,7 +570,14 @@ EOF do # The request may be several lines long, hence sed has to quit. macro_name=`echo "$trace" | sed 's/:.*//;q'` - trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'` + # If for instance TRACE is `define', be sure to have an empty + # TRACE_FORMAT. + case $trace in + $macro_name:* ) + trace_format=`echo "$trace" | sed "1s/^$macro_name:/:/"`;; + * ) + trace_format=;; + esac # GNU M4 1.4's tracing of builtins is buggy. When run on this input: # diff --git a/tests/tools.at b/tests/tools.at index c83bc785..9ddf2346 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -244,12 +244,15 @@ AT_CLEANUP ## autoconf --trace. ## ## ------------------ ## + +# Tracing user defined macros +# --------------------------- AT_SETUP(autoconf --trace) AT_DATA(configure.in, -[[define(active, ACTIVE) -AC_DEFUN(TRACE1, [TRACE2(m4_shift($@))]) -AC_DEFUN(TRACE2, [[$2], $1]) +[[define([active], [ACTIVE]) +AC_DEFUN([TRACE1], [TRACE2(m4_shift($@))]) +AC_DEFUN([TRACE2], [[$2], $1]) TRACE1(foo, bar, baz) TRACE1(foo, AC_TRACE1(bar, baz)) TRACE1(foo, active, baz) @@ -297,6 +300,31 @@ AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -t TRACE2:'${)===(}@'], 0, AT_CLEANUP +# Tracing builtins +# ---------------- +AT_SETUP(Tracing M4 builtins) + +AT_DATA(configure.in, +[[define([active], [ACTIVE]) +]]) + +AT_CHECK([[autoconf --autoconf-dir .. -l $at_srcdir -t define | + sed -n '$p']], + 0, +[[configure.in:1:define:active:ACTIVE +]]) + +# FIXME: Without `$1' the following test dies. Groumphf, once again to +# dive into obscure feature interaction... +AT_CHECK([[autoconf --autoconf-dir .. -l $at_srcdir -t define:'$1' -i | + sed -n '$p']], + 0, +[[active +]]) + +AT_CLEANUP + + ## ----------------------------------------------- ##