diff --git a/ChangeLog b/ChangeLog index 58b1d84c..e09ca9bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-09-28 Akim Demaille + + * bin/autoscan.in (%c_keywords): Remove. + (&used): Keep only track of the words we might be interested in. + (&output_kind): It is no longer needed to look for non active + checks. + 2002-09-27 Akim Demaille * lib/autoconf/functions.m4 (AC_FUNC_MBRTOWC): New, stolen from diff --git a/bin/autoscan.in b/bin/autoscan.in index 5a64c6ba..4f057cf3 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -37,12 +37,7 @@ use strict; 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); @@ -202,24 +197,35 @@ sub init_tables () } -# 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) = @_; @@ -275,13 +281,11 @@ sub scan_c_file ($) # 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); } } @@ -440,11 +444,6 @@ sub output_kind ($$) 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}}) @@ -626,3 +625,20 @@ if ($configure_ac) # 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: diff --git a/man/autoscan.1 b/man/autoscan.1 index 412882f4..e8e7c276 100644 --- a/man/autoscan.1 +++ b/man/autoscan.1 @@ -1,11 +1,12 @@ -.\" 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 @@ -29,12 +30,6 @@ prepend directory DIR to search path .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 . .SH "SEE ALSO" @@ -60,3 +55,8 @@ programs are properly installed at your site, the command .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.