(File::Find): Use it instead of Perl 4's `find.pl'.
(&wanted): Rename as...
(&find_file): this.
+2001-07-02 Akim Demaille <akim@epita.fr>
+
+ * 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 <proski@gnu.org>
* aclang.m4 (AC_F77_DUMMY_MAIN): Remove conftest* after using
# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
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);
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
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 ()
# --------------
}
+# 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.
}
-# 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);
}
}
## 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)
# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
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);
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
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 ()
# --------------
}
+# 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.
}
-# 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);
}
}
## 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)
.\" 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