From: Pavel Roskin Date: Mon, 30 Oct 2000 03:20:00 +0000 (+0000) Subject: * autoconf.sh: When scanning for unexpanded macros match only X-Git-Tag: autoconf-2.50~508 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80f8404bec1b5a17fff686dcfe6a6b7de89ba9e7;p=thirdparty%2Fautoconf.git * autoconf.sh: When scanning for unexpanded macros match only words beginning with "A?_" and "m4_" or containing "_A?_". Strip the comments before the matching. Don't use character ranges. --- diff --git a/ChangeLog b/ChangeLog index a33b45389..b06b6dc82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-10-29 Pavel Roskin + + * autoconf.sh: When scanning for unexpanded macros match only + words beginning with "A?_" and "m4_" or containing "_A?_". + Strip the comments before the matching. Don't use character + ranges. + 2000-10-29 Pavel Roskin * acgeneral.m4 (_AC_INIT_PREPARE): Don't use a newline before diff --git a/autoconf.in b/autoconf.in index cb9298bcf..237075f36 100644 --- a/autoconf.in +++ b/autoconf.in @@ -223,6 +223,9 @@ done # Set them in the order expected by the M4 macros: the converse. alphabet='abcdefghijklmnopqrstuvwxyz' ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +NUMBERS='0123456789' +WORDCHAR=_$alphabet$ALPHABET$NUMBERS + _ac_warnings= for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr $ALPHABET $alphabet` @@ -303,10 +306,6 @@ case $task in $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || { (exit 1); exit; } - # You can add your own prefixes to pattern if you want to check for - # them too. - pattern="_?A[CHM]_|m4_" - if test "x$outfile" != x-; then chmod +x $outfile fi @@ -346,10 +345,23 @@ case $task in while (sub (/@%:@/, "#")) continue # Dubious feature: we tolerate macro names when commented. - if (/^[^#]*($pattern)/) + code_part = \$0 + comment_start = index (code_part, "#") + if (comment_start) + code_part = substr (\$0, 0, comment_start) + if (match (code_part, /[^$WORDCHAR](A[$ALPHABET]|m4)_[$WORDCHAR]*/)) + { + macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline + some_macros_were_not_expanded = 1 + } + if (match (code_part, /^(A[$ALPHABET]|m4)_[$WORDCHAR]*/)) + { + macros [substr (code_part, RSTART, RLENGTH)] = oline + some_macros_were_not_expanded = 1 + } + if (match (code_part, /[$WORDCHAR]*_A[$ALPHABET]_[$WORDCHAR]*/)) { - match (\$0, /([_A-Za-z0-9]*($pattern)[_A-Za-z0-9]*)/) - macros [substr (\$0, RSTART, RLENGTH)] = oline + macros [substr (code_part, RSTART, RLENGTH)] = oline some_macros_were_not_expanded = 1 } print diff --git a/autoconf.sh b/autoconf.sh index cb9298bcf..237075f36 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -223,6 +223,9 @@ done # Set them in the order expected by the M4 macros: the converse. alphabet='abcdefghijklmnopqrstuvwxyz' ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +NUMBERS='0123456789' +WORDCHAR=_$alphabet$ALPHABET$NUMBERS + _ac_warnings= for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr $ALPHABET $alphabet` @@ -303,10 +306,6 @@ case $task in $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || { (exit 1); exit; } - # You can add your own prefixes to pattern if you want to check for - # them too. - pattern="_?A[CHM]_|m4_" - if test "x$outfile" != x-; then chmod +x $outfile fi @@ -346,10 +345,23 @@ case $task in while (sub (/@%:@/, "#")) continue # Dubious feature: we tolerate macro names when commented. - if (/^[^#]*($pattern)/) + code_part = \$0 + comment_start = index (code_part, "#") + if (comment_start) + code_part = substr (\$0, 0, comment_start) + if (match (code_part, /[^$WORDCHAR](A[$ALPHABET]|m4)_[$WORDCHAR]*/)) + { + macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline + some_macros_were_not_expanded = 1 + } + if (match (code_part, /^(A[$ALPHABET]|m4)_[$WORDCHAR]*/)) + { + macros [substr (code_part, RSTART, RLENGTH)] = oline + some_macros_were_not_expanded = 1 + } + if (match (code_part, /[$WORDCHAR]*_A[$ALPHABET]_[$WORDCHAR]*/)) { - match (\$0, /([_A-Za-z0-9]*($pattern)[_A-Za-z0-9]*)/) - macros [substr (\$0, RSTART, RLENGTH)] = oline + macros [substr (code_part, RSTART, RLENGTH)] = oline some_macros_were_not_expanded = 1 } print diff --git a/bin/autoconf.in b/bin/autoconf.in index cb9298bcf..237075f36 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -223,6 +223,9 @@ done # Set them in the order expected by the M4 macros: the converse. alphabet='abcdefghijklmnopqrstuvwxyz' ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +NUMBERS='0123456789' +WORDCHAR=_$alphabet$ALPHABET$NUMBERS + _ac_warnings= for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr $ALPHABET $alphabet` @@ -303,10 +306,6 @@ case $task in $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || { (exit 1); exit; } - # You can add your own prefixes to pattern if you want to check for - # them too. - pattern="_?A[CHM]_|m4_" - if test "x$outfile" != x-; then chmod +x $outfile fi @@ -346,10 +345,23 @@ case $task in while (sub (/@%:@/, "#")) continue # Dubious feature: we tolerate macro names when commented. - if (/^[^#]*($pattern)/) + code_part = \$0 + comment_start = index (code_part, "#") + if (comment_start) + code_part = substr (\$0, 0, comment_start) + if (match (code_part, /[^$WORDCHAR](A[$ALPHABET]|m4)_[$WORDCHAR]*/)) + { + macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline + some_macros_were_not_expanded = 1 + } + if (match (code_part, /^(A[$ALPHABET]|m4)_[$WORDCHAR]*/)) + { + macros [substr (code_part, RSTART, RLENGTH)] = oline + some_macros_were_not_expanded = 1 + } + if (match (code_part, /[$WORDCHAR]*_A[$ALPHABET]_[$WORDCHAR]*/)) { - match (\$0, /([_A-Za-z0-9]*($pattern)[_A-Za-z0-9]*)/) - macros [substr (\$0, RSTART, RLENGTH)] = oline + macros [substr (code_part, RSTART, RLENGTH)] = oline some_macros_were_not_expanded = 1 } print