autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

41-fyi-autoreconf-fileparse.patch


From: Akim Demaille
Subject: 41-fyi-autoreconf-fileparse.patch
Date: Sat, 03 Nov 2001 12:58:42 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * 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.
        
        
Index: bin/autoreconf.in
--- bin/autoreconf.in Sat, 03 Nov 2001 11:16:55 +0100 akim
+++ bin/autoreconf.in Sat, 03 Nov 2001 11:26:20 +0100 akim
@@ -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: lib/Autom4te/General.pm
--- lib/Autom4te/General.pm Fri, 02 Nov 2001 19:26:39 +0100 akim
+++ lib/Autom4te/General.pm Sat, 03 Nov 2001 11:25:17 +0100 akim
@@ -29,10 +29,22 @@
 use vars qw (@ISA @EXPORT);
 
 @ISA = qw (Exporter);
address@hidden = 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);
+
address@hidden = (@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]