(@export_forward_subs): New.
Add basename, dirname, and fileparse.
(@EXPORT): Adjust.
* bin/autoreconf.in (&autoreconf): Fix call to fileparse.
Don't look for aclocal flags if we already know aclocal is not
used.
Move aclocal.m4t only if it exists.
Reported by Ezra Peisach.
+2001-11-03 Akim Demaille <akim@epita.fr>
+
+ * lib/Autom4te/General.pm (@export_vars, @export_subs)
+ (@export_forward_subs): New.
+ Add basename, dirname, and fileparse.
+ (@EXPORT): Adjust.
+ * bin/autoreconf.in (&autoreconf): Fix call to fileparse.
+ Don't look for aclocal flags if we already know aclocal is not
+ used.
+ Move aclocal.m4t only if it exists.
+ Reported by Ezra Peisach.
+
+
2001-11-03 Akim Demaille <akim@epita.fr>
* bin/autoreconf.in (&parse_args): Work only on the configure.ac
sub autoreconf ($)
{
my ($configure_ac_path) = @_;
- my ($subdir, $configure_ac) = fileparse ($configure_ac_path);
-
+ my ($configure_ac, $subdir) = fileparse ($configure_ac_path);
verbose "working in $subdir, on $configure_ac";
chdir $subdir
or die "$me: cannot chdir to $subdir: $!\n";
my $configure_ac_file = new Autom4te::XFile $configure_ac;
while ($_ = $configure_ac_file->getline)
{
- $uses_autoconf = 1
- if /AC_INIT/;
+ if (/AC_INIT/)
+ {
+ $uses_autoconf = 1;
+ last;
+ }
}
if (!$uses_autoconf)
{
# If there are flags for aclocal in Makefile.am, use them.
my $aclocal_flags = '';
- if (-f 'Makefile.am')
+ if ($uses_aclocal && -f 'Makefile.am')
{
my $makefile = new Autom4te::XFile 'Makefile.am';
while ($_ = $makefile->getline)
if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
{
$aclocal_flags = $1;
- $uses_aclocal = 1;
last;
}
}
else
{
xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
- update_file ('aclocal.m4t', 'aclocal.m4');
+ # aclocal may produce no output.
+ update_file ('aclocal.m4t', 'aclocal.m4')
+ if -f 'aclocal.m4t';
}
# ------------------ #
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
-@EXPORT = qw (&backname &debug &find_configure_ac &find_file
- &getopt &mktmpdir &mtime
- &uniq &update_file &up_to_date_p &verbose &xsystem
- $debug $force $help $me $tmp $verbose $version);
+
+# Variables we define and export.
+my @export_vars =
+ qw ($debug $force $help $me $tmp $verbose $version);
+
+# Functions we define and export.
+my @export_subs =
+ qw (&backname &debug &find_configure_ac &find_file
+ &getopt &mktmpdir &mtime
+ &uniq &update_file &up_to_date_p &verbose &xsystem);
+
+# Functions we forward (coming from modules we use).
+my @export_forward_subs =
+ qw (&basename &dirname &fileparse);
+
+@EXPORT = (@export_vars, @export_subs, @export_forward_subs);
# Variable we share with the main package. Be sure to have a single
# copy of them: using `my' together with multiple inclusion of this