[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Better matching of unexpanded macros
From: |
Pavel Roskin |
Subject: |
Better matching of unexpanded macros |
Date: |
Sun, 29 Oct 2000 12:41:12 -0500 (EST) |
Hello!
This patch fixes problems with names like JAVAC_FLAGS and PAM_MSG and also
extends the pattern from A[CHM]_ to A?_
Shorter solutions and portability fixes will be appreciated.
ChangeLog:
* autoconf.sh: When scanning for unexpanded macros match only
macros beginning with "A?_" and "m4_" or containing "_A?_".
Strip the comments before the matching.
Regards,
Pavel Roskin
______________________________
Index: autoconf.sh
--- autoconf.sh Fri Oct 27 21:04:48 2000
+++ autoconf.sh Sun Oct 29 12:27:25 2000
@@ -303,10 +303,6 @@
$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 +342,23 @@
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, /[^_A-Za-z0-9](A.|m4)_[_A-Za-z0-9]*/))
+ {
+ macros [substr (code_part, RSTART + 1, RLENGTH - 1)] = oline
+ some_macros_were_not_expanded = 1
+ }
+ if (match (code_part, /^(A.|m4)_[_A-Za-z0-9]*/))
+ {
+ macros [substr (code_part, RSTART, RLENGTH)] = oline
+ some_macros_were_not_expanded = 1
+ }
+ if (match (code_part, /[_A-Za-z0-9]*_A._[_A-Za-z0-9]*/))
{
- 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
______________________________
- Better matching of unexpanded macros,
Pavel Roskin <=