From: Akim Demaille Date: Mon, 27 Mar 2000 12:19:01 +0000 (+0000) Subject: * autoconf.sh (trace): Let translate_awk do the whole translation X-Git-Tag: autoconf-2.50~992 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a265878287cd83c1a3fae0882b23675739e4954;p=thirdparty%2Fautoconf.git * autoconf.sh (trace): Let translate_awk do the whole translation from `$trace' to the m4 program. --- diff --git a/ChangeLog b/ChangeLog index affb02872..2654655c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-03-27 Akim Demaille + + * autoconf.sh (trace): Let translate_awk do the whole translation + from `$trace' to the m4 program. + 2000-03-27 Akim Demaille * acgeneral.m4 (AC_PACKAGE): Also define AC_PACKAGE_STRING. diff --git a/autoconf.in b/autoconf.in index bc329ff04..8e837e128 100644 --- a/autoconf.in +++ b/autoconf.in @@ -362,6 +362,13 @@ function error (message) } END { + # Chomp. + request = substr (request, 1, length (request) - 1) + # The default request is `$f:$l:$n:$*'. + colon = index (request, ":") + macro = colon ? substr (request, 1, colon - 1) : request + request = colon ? substr (request, colon + 1) : "$f:$l:$n:$*" + res = "" for (cp = request; cp; cp = substr (cp, 2)) @@ -408,7 +415,9 @@ END { else res = res char } - print res + + # Produce the definition of AT_ = the translation of the request. + print "define([AT_" macro "], [[" res "]])" close("cat >&2") } EOF @@ -419,17 +428,7 @@ EOF do # The request may be several lines long, hence sed has to quit. trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'` - case "$trace" in - *:*) - # The `]])' are closing the `define' which is started by sed. - # This is to cope with multiple line requests. - echo "$trace]])" | - sed -e '1s/^\([^:]*\):\(.*\)$/define([AT_\1], [[\2/';; - *) - # Default request. - echo "define([AT_$trace], [[\$f:\$l:\$n:\$*]])";; - esac | - $AWK -f $translate_awk >>$trace_m4 || exit 1 + echo "$trace" | $AWK -f $translate_awk >>$trace_m4 || exit 1 done echo "divert(0)dnl" >>$trace_m4 diff --git a/autoconf.sh b/autoconf.sh index bc329ff04..8e837e128 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -362,6 +362,13 @@ function error (message) } END { + # Chomp. + request = substr (request, 1, length (request) - 1) + # The default request is `$f:$l:$n:$*'. + colon = index (request, ":") + macro = colon ? substr (request, 1, colon - 1) : request + request = colon ? substr (request, colon + 1) : "$f:$l:$n:$*" + res = "" for (cp = request; cp; cp = substr (cp, 2)) @@ -408,7 +415,9 @@ END { else res = res char } - print res + + # Produce the definition of AT_ = the translation of the request. + print "define([AT_" macro "], [[" res "]])" close("cat >&2") } EOF @@ -419,17 +428,7 @@ EOF do # The request may be several lines long, hence sed has to quit. trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'` - case "$trace" in - *:*) - # The `]])' are closing the `define' which is started by sed. - # This is to cope with multiple line requests. - echo "$trace]])" | - sed -e '1s/^\([^:]*\):\(.*\)$/define([AT_\1], [[\2/';; - *) - # Default request. - echo "define([AT_$trace], [[\$f:\$l:\$n:\$*]])";; - esac | - $AWK -f $translate_awk >>$trace_m4 || exit 1 + echo "$trace" | $AWK -f $translate_awk >>$trace_m4 || exit 1 done echo "divert(0)dnl" >>$trace_m4 diff --git a/bin/autoconf.in b/bin/autoconf.in index bc329ff04..8e837e128 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -362,6 +362,13 @@ function error (message) } END { + # Chomp. + request = substr (request, 1, length (request) - 1) + # The default request is `$f:$l:$n:$*'. + colon = index (request, ":") + macro = colon ? substr (request, 1, colon - 1) : request + request = colon ? substr (request, colon + 1) : "$f:$l:$n:$*" + res = "" for (cp = request; cp; cp = substr (cp, 2)) @@ -408,7 +415,9 @@ END { else res = res char } - print res + + # Produce the definition of AT_ = the translation of the request. + print "define([AT_" macro "], [[" res "]])" close("cat >&2") } EOF @@ -419,17 +428,7 @@ EOF do # The request may be several lines long, hence sed has to quit. trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'` - case "$trace" in - *:*) - # The `]])' are closing the `define' which is started by sed. - # This is to cope with multiple line requests. - echo "$trace]])" | - sed -e '1s/^\([^:]*\):\(.*\)$/define([AT_\1], [[\2/';; - *) - # Default request. - echo "define([AT_$trace], [[\$f:\$l:\$n:\$*]])";; - esac | - $AWK -f $translate_awk >>$trace_m4 || exit 1 + echo "$trace" | $AWK -f $translate_awk >>$trace_m4 || exit 1 done echo "divert(0)dnl" >>$trace_m4