From: Akim Demaille Date: Tue, 3 Jul 2001 14:10:41 +0000 (+0000) Subject: * autoscan.in: Formatting changes, matching the invocation order. X-Git-Tag: AUTOCONF-2.50c~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41551282214ea2b73f79a24f7de07357bd4876ed;p=thirdparty%2Fautoconf.git * autoscan.in: Formatting changes, matching the invocation order. (File::Find): Use it instead of Perl 4's `find.pl'. (&wanted): Rename as... (&find_file): this. --- diff --git a/ChangeLog b/ChangeLog index fae5fd064..13d8cae15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-07-02 Akim Demaille + + * autoscan.in: Formatting changes, matching the invocation order. + (File::Find): Use it instead of Perl 4's `find.pl'. + (&wanted): Rename as... + (&find_file): this. + 2001-06-29 Pavel Roskin * aclang.m4 (AC_F77_DUMMY_MAIN): Remove conftest* after using diff --git a/autoscan.in b/autoscan.in index 9493b4a0f..ea9651c18 100644 --- a/autoscan.in +++ b/autoscan.in @@ -21,12 +21,12 @@ # Written by David MacKenzie . use 5.005; -require "find.pl"; use File::Basename; +use File::Find; use Getopt::Long; use strict; -use vars qw($autoconf $datadir $initfile $name +use vars qw($initfile @cfiles @makefiles @shfiles %c_keywords %printed); my $me = basename ($0); @@ -64,6 +64,9 @@ my %kind_comment = my $configure_scan = 'configure.scan'; +# Autoconf and lib files. +my $autoconf; +my $datadir = $ENV{"AC_MACRODIR"} || "@datadir@"; # Exit nonzero whenever closing STDOUT fails. sub END @@ -75,51 +78,6 @@ sub END or (warn "$me: closing standard output: $!\n"), _exit (1); } -# find_autoconf -# ------------- -# Find the lib files and autoconf. -sub find_autoconf -{ - $datadir = $ENV{"AC_MACRODIR"} || "@datadir@"; - my $dir = dirname ($0); - $autoconf = ''; - # We test "$dir/autoconf" in case we are in the build tree, in which case - # the names are not transformed yet. - foreach my $file ($ENV{"AUTOCONF"} || '', - "$dir/@autoconf-name@", - "$dir/autoconf", - "@bindir@/@autoconf-name@") - { - if (-x $file) - { - $autoconf = $file; - last; - } - } -} - - -# $CONFIGURE_AC -# &find_configure_ac () -# --------------------- -sub find_configure_ac () -{ - if (-f 'configure.ac') - { - if (-f 'configure.in') - { - warn "warning: `configure.ac' and `configure.in' both present.\n"; - warn "warning: proceeding with `configure.ac'.\n"; - } - return 'configure.ac'; - } - elsif (-f 'configure.in') - { - return 'configure.in'; - } - return; -} - # print_usage () # -------------- @@ -186,6 +144,50 @@ Try `$me --help' for more information.\n" } +# find_autoconf +# ------------- +# Find the lib files and autoconf. +sub find_autoconf +{ + my $dir = dirname ($0); + # We test "$dir/autoconf" in case we are in the build tree, in which case + # the names are not transformed yet. + foreach my $file ($ENV{"AUTOCONF"} || '', + "$dir/@autoconf-name@", + "$dir/autoconf", + "@bindir@/@autoconf-name@") + { + if (-x $file) + { + $autoconf = $file; + last; + } + } +} + + +# $CONFIGURE_AC +# &find_configure_ac () +# --------------------- +sub find_configure_ac () +{ + if (-f 'configure.ac') + { + if (-f 'configure.in') + { + warn "warning: `configure.ac' and `configure.in' both present.\n"; + warn "warning: proceeding with `configure.ac'.\n"; + } + return 'configure.ac'; + } + elsif (-f 'configure.in') + { + return 'configure.in'; + } + return; +} + + # init_tables () # -------------- # Put values in the tables of what to do with each token. @@ -246,34 +248,34 @@ sub init_tables () } -# wanted () -# --------- +# find_files () +# ------------- # Collect names of various kinds of files in the package. # Called by &find on each file. -sub wanted () +sub find_files () { # Strip a useless leading `./'. - $name =~ s,^\./,,; + $File::Find::name =~ s,^\./,,; if (/^.*\.[chlymC]$/ || /^.*\.cc$/) { - push (@cfiles, $name); + push (@cfiles, $File::Find::name); } elsif (/^[Mm]akefile$/ || /^GNUmakefile$/) { # Wanted only if there is no corresponding Makefile.in. # Using Find, $_ contains the current filename with the current # directory of the walk through. - push (@makefiles, $name) + push (@makefiles, $File::Find::name) if ! -f "$_.in"; } elsif (/^[Mm]akefile\.in$/) { - push (@makefiles, $name); + push (@makefiles, $File::Find::name); } elsif (/^.*\.sh$/) { - push (@shfiles, $name); + push (@shfiles, $File::Find::name); } } @@ -602,12 +604,12 @@ sub check_configure_ac ($) ## Main program. ## ## -------------- ## +parse_args; # Find the lib files and autoconf. find_autoconf; my $configure_ac = find_configure_ac; -parse_args; init_tables; -find ('.'); +find (\&find_files, '.'); scan_files; output ('configure.scan'); if ($configure_ac) diff --git a/bin/autoscan.in b/bin/autoscan.in index 9493b4a0f..ea9651c18 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -21,12 +21,12 @@ # Written by David MacKenzie . use 5.005; -require "find.pl"; use File::Basename; +use File::Find; use Getopt::Long; use strict; -use vars qw($autoconf $datadir $initfile $name +use vars qw($initfile @cfiles @makefiles @shfiles %c_keywords %printed); my $me = basename ($0); @@ -64,6 +64,9 @@ my %kind_comment = my $configure_scan = 'configure.scan'; +# Autoconf and lib files. +my $autoconf; +my $datadir = $ENV{"AC_MACRODIR"} || "@datadir@"; # Exit nonzero whenever closing STDOUT fails. sub END @@ -75,51 +78,6 @@ sub END or (warn "$me: closing standard output: $!\n"), _exit (1); } -# find_autoconf -# ------------- -# Find the lib files and autoconf. -sub find_autoconf -{ - $datadir = $ENV{"AC_MACRODIR"} || "@datadir@"; - my $dir = dirname ($0); - $autoconf = ''; - # We test "$dir/autoconf" in case we are in the build tree, in which case - # the names are not transformed yet. - foreach my $file ($ENV{"AUTOCONF"} || '', - "$dir/@autoconf-name@", - "$dir/autoconf", - "@bindir@/@autoconf-name@") - { - if (-x $file) - { - $autoconf = $file; - last; - } - } -} - - -# $CONFIGURE_AC -# &find_configure_ac () -# --------------------- -sub find_configure_ac () -{ - if (-f 'configure.ac') - { - if (-f 'configure.in') - { - warn "warning: `configure.ac' and `configure.in' both present.\n"; - warn "warning: proceeding with `configure.ac'.\n"; - } - return 'configure.ac'; - } - elsif (-f 'configure.in') - { - return 'configure.in'; - } - return; -} - # print_usage () # -------------- @@ -186,6 +144,50 @@ Try `$me --help' for more information.\n" } +# find_autoconf +# ------------- +# Find the lib files and autoconf. +sub find_autoconf +{ + my $dir = dirname ($0); + # We test "$dir/autoconf" in case we are in the build tree, in which case + # the names are not transformed yet. + foreach my $file ($ENV{"AUTOCONF"} || '', + "$dir/@autoconf-name@", + "$dir/autoconf", + "@bindir@/@autoconf-name@") + { + if (-x $file) + { + $autoconf = $file; + last; + } + } +} + + +# $CONFIGURE_AC +# &find_configure_ac () +# --------------------- +sub find_configure_ac () +{ + if (-f 'configure.ac') + { + if (-f 'configure.in') + { + warn "warning: `configure.ac' and `configure.in' both present.\n"; + warn "warning: proceeding with `configure.ac'.\n"; + } + return 'configure.ac'; + } + elsif (-f 'configure.in') + { + return 'configure.in'; + } + return; +} + + # init_tables () # -------------- # Put values in the tables of what to do with each token. @@ -246,34 +248,34 @@ sub init_tables () } -# wanted () -# --------- +# find_files () +# ------------- # Collect names of various kinds of files in the package. # Called by &find on each file. -sub wanted () +sub find_files () { # Strip a useless leading `./'. - $name =~ s,^\./,,; + $File::Find::name =~ s,^\./,,; if (/^.*\.[chlymC]$/ || /^.*\.cc$/) { - push (@cfiles, $name); + push (@cfiles, $File::Find::name); } elsif (/^[Mm]akefile$/ || /^GNUmakefile$/) { # Wanted only if there is no corresponding Makefile.in. # Using Find, $_ contains the current filename with the current # directory of the walk through. - push (@makefiles, $name) + push (@makefiles, $File::Find::name) if ! -f "$_.in"; } elsif (/^[Mm]akefile\.in$/) { - push (@makefiles, $name); + push (@makefiles, $File::Find::name); } elsif (/^.*\.sh$/) { - push (@shfiles, $name); + push (@shfiles, $File::Find::name); } } @@ -602,12 +604,12 @@ sub check_configure_ac ($) ## Main program. ## ## -------------- ## +parse_args; # Find the lib files and autoconf. find_autoconf; my $configure_ac = find_configure_ac; -parse_args; init_tables; -find ('.'); +find (\&find_files, '.'); scan_files; output ('configure.scan'); if ($configure_ac) diff --git a/man/autoscan.1 b/man/autoscan.1 index 2537ff125..c4a1e17c9 100644 --- a/man/autoscan.1 +++ b/man/autoscan.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24. -.TH AUTOSCAN "1" "June 2001" "GNU Autoconf 2.50c" FSF +.TH AUTOSCAN "1" "July 2001" "GNU Autoconf 2.50c" FSF .SH NAME autoscan \- Generate a preliminary configure.in .SH SYNOPSIS