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 <proski@gnu.org>
+
+ * 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 <proski@gnu.org>
* acgeneral.m4 (_AC_INIT_PREPARE): Don't use a newline before
# 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`
$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
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
# 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`
$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
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
# 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`
$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
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