use vars qw(@cfiles @makefiles @shfiles %printed);
-# The list of C keywords.
-my %c_keywords = map { $_ => 1}
- qw (int char float double struct union long short unsigned
- auto extern register typedef static goto return sizeof break
- continue if else for do while switch case default);
-
+# The kind of the words we are looking for.
my @kinds = qw (functions headers identifiers programs
makevars libraries);
}
-# used($KIND, $WORD, [$WHERE])
-# ----------------------------
+# used ($KIND, $WORD, [$WHERE])
+# -----------------------------
# $WORD is used as a $KIND.
sub used ($$;$)
{
my ($kind, $word, $where) = @_;
$where ||= "$File::Find::name:$.";
- push (@{$used{$kind}{$word}}, $where);
+ if (
+ # Check for all the libraries. But `-links' is certainly a
+ # `find' argument, and `-le', a `test' argument.
+ ($kind eq 'libraries' && $word !~ /^e|inks$/)
+ # Other than libraries are to be checked only if listed in
+ # the Autoscan library files.
+ || defined $macro{$kind}{$word}
+ )
+ {
+ push (@{$used{$kind}{$word}}, $where);
+ }
}
+
## ----------------------- ##
## Scanning source files. ##
## ----------------------- ##
-# scan_c_file($FILENAME)
-# ----------------------
+# scan_c_file ($FILENAME)
+# -----------------------
sub scan_c_file ($)
{
my ($filename) = @_;
# Maybe we should ignore function definitions (in column 0)?
while (s/\b([a-zA-Z_]\w*)\s*\(/ /)
{
- used ('functions', $1)
- if !$c_keywords{$1};
+ used ('functions', $1);
}
while (s/\b([a-zA-Z_]\w*)\b/ /)
{
- used ('identifiers', $1)
- if !$c_keywords{$1};
+ used ('identifiers', $1);
}
}
if exists $kind_comment{$kind};
foreach my $word (sort keys %{$used{$kind}})
{
- # Words that were caught, but not to be checked according to the
- # autoscan library files.
- next
- if ! exists $macro{$kind}{$word};
-
# Output the needed macro invocations in $configure_scan if not
# already printed, and remember these macros are needed.
foreach my $macro (@{$macro{$kind}{$word}})
# at END. It results in a truncated file.
$log->close;
exit 0;
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.29.
-.TH AUTOSCAN "1" "September 2002" "autoscan 2.54a" "User Commands"
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013.
+.TH AUTOSCAN "1" "September 2002" "GNU Autoconf 2.54a" FSF
.SH NAME
-autoscan \- Generate a preliminary configure.in
+autoscan \- manual page for autoscan 2.54a
.SH SYNOPSIS
.B autoscan
[\fIOPTION\fR] ... [\fISRCDIR\fR]
.SH DESCRIPTION
+.PP
Examine source files in the directory tree rooted at SRCDIR, or the
current directory if none is given. Search the source files for
common portability problems, check for incompleteness of
.TP
\fB\-I\fR, \fB\-\-include\fR=\fIDIR\fR
append directory DIR to search path
-.SH AUTHOR
-Written by David J. MacKenzie and Akim Demaille.
-.PP
-Copyright 2002 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "REPORTING BUGS"
Report bugs to <bug-autoconf@gnu.org>.
.SH "SEE ALSO"
.B info autoscan
.PP
should give you access to the complete manual.
+.PP
+Copyright 2002 Free Software Foundation, Inc.
+.br
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.