From: Akim Demaille Date: Fri, 3 Nov 2000 15:08:28 +0000 (+0000) Subject: * tests/tools.at (unexpanded macros): Strengthen. X-Git-Tag: autoconf-2.50~465 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1ba26c218978f95ce7f3adc63e4e83836e26d41;p=thirdparty%2Fautoconf.git * tests/tools.at (unexpanded macros): Strengthen. * autoconf.sh (finalize.awk): Use `sub' instead of `index' + `substr'. More comments. --- diff --git a/ChangeLog b/ChangeLog index 001793ca4..ba8c22d55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-11-03 Akim Demaille + + * tests/tools.at (unexpanded macros): Strengthen. + * autoconf.sh (finalize.awk): Use `sub' instead of `index' + + `substr'. + More comments. + 2000-11-03 Akim Demaille * Makefile.am (.m4.m4f): Check that processing produces only diff --git a/autoconf.in b/autoconf.in index 04a5eb947..fe51ab853 100644 --- a/autoconf.in +++ b/autoconf.in @@ -346,9 +346,11 @@ case $task in continue # Dubious feature: we tolerate macro names when commented. code_part = \$0 - comment_start = index (code_part, "#") - if (comment_start) - code_part = substr (\$0, 0, comment_start) + sub (/#.*/, "", code_part) + + # We don't \`if ... else if ...' because a single line may contain + # several unexpanded names. That's also why the last two \`match' + # are not grouped together. if (match (code_part, /[^$WORDCHAR](A[$ALPHABET]|m4)_[$WORDCHAR]*/)) { macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline diff --git a/autoconf.sh b/autoconf.sh index 04a5eb947..fe51ab853 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -346,9 +346,11 @@ case $task in continue # Dubious feature: we tolerate macro names when commented. code_part = \$0 - comment_start = index (code_part, "#") - if (comment_start) - code_part = substr (\$0, 0, comment_start) + sub (/#.*/, "", code_part) + + # We don't \`if ... else if ...' because a single line may contain + # several unexpanded names. That's also why the last two \`match' + # are not grouped together. if (match (code_part, /[^$WORDCHAR](A[$ALPHABET]|m4)_[$WORDCHAR]*/)) { macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline diff --git a/bin/autoconf.in b/bin/autoconf.in index 04a5eb947..fe51ab853 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -346,9 +346,11 @@ case $task in continue # Dubious feature: we tolerate macro names when commented. code_part = \$0 - comment_start = index (code_part, "#") - if (comment_start) - code_part = substr (\$0, 0, comment_start) + sub (/#.*/, "", code_part) + + # We don't \`if ... else if ...' because a single line may contain + # several unexpanded names. That's also why the last two \`match' + # are not grouped together. if (match (code_part, /[^$WORDCHAR](A[$ALPHABET]|m4)_[$WORDCHAR]*/)) { macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline diff --git a/tests/tools.at b/tests/tools.at index 84615e9ad..d346f4dda 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -336,14 +336,20 @@ AT_SETUP(unexpanded macros) AT_DATA([configure.in], [[AC_PLAIN_SCRIPT()dnl -AC_THIS_IS_PROBABLY_NOT_DEFINED +AB_THIS_IS_PROBABLY_NOT_DEFINED +AND_AZ_THAT_EITHER +and_AZ_that_too +# This is legal, also there is `AC_DEFINE' in there. +BAC_DEFINE # AC_THIS_IS_A_COMMENT so just shut up. It would be very bad if Autoconf forgot to expand [AC_]OUTPUT! ]]) AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 1, [], -[[configure.in:2: error: undefined macro: AC_THIS_IS_PROBABLY_NOT_DEFINED -configure:3: error: undefined macro: AC_OUTPUT +[[configure.in:2: error: undefined macro: AB_THIS_IS_PROBABLY_NOT_DEFINED +configure.in:3: error: undefined macro: AND_AZ_THAT_EITHER +configure.in:4: error: undefined macro: and_AZ_that_too +configure:7: error: undefined macro: AC_OUTPUT ]]) AT_CLEANUP(configure)