]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/Autom4te/General.pm (@export_vars, @export_subs)
authorAkim Demaille <akim@epita.fr>
Sat, 3 Nov 2001 11:59:48 +0000 (11:59 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 3 Nov 2001 11:59:48 +0000 (11:59 +0000)
(@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.

ChangeLog
bin/autoreconf.in
lib/Autom4te/General.pm

index c6e889f43e5a4cd86d4b11aaa2d2fefb578e220c..c5a83e574788a5586d9a29125ae26b57d5b1c94e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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
index 6aed18a6ff0347053f46aa31ef8f854960fbd9ce..062ab8274f15d5a7bdec41d8d24c7a5dc8eb0596 100644 (file)
@@ -181,8 +181,7 @@ sub parse_args ()
 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";
@@ -196,8 +195,11 @@ sub autoreconf ($)
   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)
     {
@@ -294,7 +296,7 @@ sub autoreconf ($)
 
   # 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)
@@ -302,7 +304,6 @@ sub autoreconf ($)
          if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
            {
              $aclocal_flags = $1;
-             $uses_aclocal = 1;
              last;
            }
        }
@@ -315,7 +316,9 @@ sub autoreconf ($)
   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';
     }
 
   # ------------------ #
index d7959071b38c8975e72c76aba9189dedf64dd11e..6230fe3865e28ca91bb7afd649c9eccae22ab133 100644 (file)
@@ -29,10 +29,22 @@ use strict;
 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