+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * bin/autoscan.in (&scan_c_file, &scan_sh_file, &scan_makefile):
+ Remove $filepath, useless.
+ (&scan_makefile): Don't remove the $(FOO), ${FOO} and @FOO@
+ variables, they are really part of the tokens.
+ Split the input line on spaces and then look for tokens.
+ Now autoscan ceases to ask for AC_PROG_LEX for the package Bison
+ because of `lex$U.$(OBJEXT)'.
+ (&scan_files): Use "@list" instead of join.
+ * doc/Makefile.am (CLEANFILES): Add *.fns.
+
+
2001-11-26 Akim Demaille <akim@epita.fr>
* tests/autoreconf.in, tests/autom4te.in, tests/autoupdate.in:
sub scan_c_file ($)
{
my ($filename) = @_;
- my $filepath = $File::Find::name;
- push (@cfiles, $filepath);
+ push @cfiles, $File::Find::name;
# Nonzero if in a multiline comment.
my $in_comment = 0;
sub scan_makefile ($)
{
my ($filename) = @_;
- my $filepath = $File::Find::name;
- push (@makefiles, $filepath);
+ push @makefiles, $File::Find::name;
my $file = new Autom4te::XFile "<$filename";
while ($_ = $file->getline)
{
- # Strip out comments and variable references.
+ # Strip out comments.
s/#.*//;
- s/\$\([^\)]*\)//g;
- s/\${[^\}]*}//g;
- s/@[^@]*@//g;
# Variable assignments.
while (s/\b([a-zA-Z_]\w*)\s*=/ /)
{
used ('makevars', $1);
}
- # Libraries.
- while (s/\B-l([a-zA-Z_]\w*)\b/ /)
- {
- used ('libraries', $1);
- }
- # Tokens in the code.
- while (s/(?<![-\w.])([a-zA-Z_][\w+.-]+)/ /)
+ # Be sure to catch a whole word. For instance `lex$U.$(OBJEXT)'
+ # is a single token. Otherwise we might believe `lex' is needed.
+ foreach my $word (split (/\s+/))
{
- used ('programs', $1);
+ # Libraries.
+ if ($word =~ /^-l([a-zA-Z_]\w*)$/)
+ {
+ used ('libraries', $1);
+ }
+ # Tokens in the code.
+ # We allow some additional characters, e.g., `+', since
+ # autoscan/programs includes `c++'.
+ if ($word =~ /^[a-zA-Z_][\w+]*$/)
+ {
+ used ('programs', $word);
+ }
}
}
sub scan_sh_file ($)
{
my ($filename) = @_;
- my $filepath = $File::Find::name;
- push (@shfiles, $filepath);
+ push @shfiles, $File::Find::name;
my $file = new Autom4te::XFile "<$filename";
if ($verbose)
{
- print "cfiles:", join(" ", @cfiles), "\n";
- print "makefiles:", join(" ", @makefiles), "\n";
- print "shfiles:", join(" ", @shfiles), "\n";
+ print "cfiles: @cfiles\n";
+ print "makefiles: @makefiles\n";
+ print "shfiles: @shfiles\n";
foreach my $kind (@kinds)
{
{
check_configure_ac ($configure_ac);
}
-
+# This close is really needed. For some reason, probably best named
+# a bug, it seems that the dtor of $LOG is not called automatically
+# at END. It results in a truncated file.
$log->close;
-
exit 0;