autoconf-patches
[Top][All Lists]
Advanced

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

Re: autoreconf 2.52e failure if aclocal need not be run...


From: Akim Demaille
Subject: Re: autoreconf 2.52e failure if aclocal need not be run...
Date: 02 Nov 2001 17:28:22 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

>>>>> "Ezra" == Ezra Peisach <address@hidden> writes:

Ezra> Another possibility: If aclocal.m4 exists, but does not contain
Ezra> a line "generated automatically by aclocal" as the first line -
Ezra> do not run aclocal.  This of course could be prone to errors as
Ezra> well - but would give a performance boost.

I chose this one, since that's actually what aclocal itself does.

Thanks for the report.  Here is the patch I'm checking in.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * bin/autoreconf.in (&autoreconf): Set `$aclocal_flags' to ''.
        Don't run aclocal when aclocal.m4 is not from aclocal.
        From Ezra Peisach.
        Don't run libtoolize and gettextize if --install is not given.


Index: bin/autoreconf.in
===================================================================
RCS file: /cvs/autoconf/bin/autoreconf.in,v
retrieving revision 1.81
diff -u -u -r1.81 autoreconf.in
--- bin/autoreconf.in 2001/10/20 06:56:45 1.81
+++ bin/autoreconf.in 2001/11/02 16:27:12
@@ -212,6 +212,7 @@
   my $uses_gettext;
   my $uses_libtool;
   my $uses_autoheader;
+  my $uses_aclocal;
   while ($_ = $configure_ac_file->getline)
      {
        $uses_autoconf = 1
@@ -254,10 +255,14 @@
     {
       verbose "$configure_ac: not running gettextize: `intl' is already 
present";
     }
-  else
+  elsif ($install)
     {
       xsystem ($gettextize);
     }
+  else
+    {
+      verbose "$configure_ac: not running gettextize: --install not given";
+    }
 
 
   # -------------------- #
@@ -268,37 +273,61 @@
     {
       verbose "$configure_ac: not using Libtool";
     }
-  else
+  elsif ($install)
     {
       xsystem ($libtoolize);
     }
+  else
+    {
+      verbose "$configure_ac: not running libtoolize: --install not given";
+    }
 
 
   # ----------------- #
   # Running aclocal.  #
   # ----------------- #
 
-  # Always run aclocal.  Tracking its sources for up-to-dateness
-  # is too complex and too error prone.  The best we can do is
-  # avoiding nuking the time stamp.
+  # Always run aclocal.  Tracking its sources for up-to-dateness is
+  # too complex and too error prone.  The best we can do is avoiding
+  # nuking the time stamp.
+  $uses_aclocal = 1;
+
+  # Nevertheless, if aclocal.m4 exists and is not made by aclocal,
+  # don't run aclocal.
+
+  if (-f 'aclocal.m4')
+    {
+      my $aclocal_m4 = new Autom4te::XFile 'aclocal.m4';
+      $_ = $aclocal_m4->getline;
+      $uses_aclocal = 0
+       unless /generated.*by aclocal/;
+    }
 
   # If there are flags for aclocal in Makefile.am, use them.
-  my $aclocal_flags;
+  my $aclocal_flags = '';
   if (-f 'Makefile.am')
     {
-      my $aclocal_m4 = new Autom4te::XFile 'Makefile.am';
-      while ($_ = $aclocal_m4->getline)
+      my $makefile = new Autom4te::XFile 'Makefile.am';
+      while ($_ = $makefile->getline)
        {
          if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
            {
              $aclocal_flags = $1;
+             $uses_aclocal = 1;
              last;
            }
        }
     }
 
-  xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
-  update_file ('aclocal.m4t', 'aclocal.m4');
+  if (!$uses_aclocal)
+    {
+      verbose "$configure_ac: not using aclocal";
+    }
+  else
+    {
+      xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
+      update_file ('aclocal.m4t', 'aclocal.m4');
+    }
 
   # ------------------ #
   # Running automake.  #
Index: man/autoreconf.1
===================================================================
RCS file: /cvs/autoconf/man/autoreconf.1,v
retrieving revision 1.49
diff -u -u -r1.49 autoreconf.1
--- man/autoreconf.1 2001/10/20 06:57:21 1.49
+++ man/autoreconf.1 2001/11/02 16:27:12
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.24.
-.TH AUTORECONF "1" "October 2001" "GNU Autoconf 2.52e" FSF
+.TH AUTORECONF "1" "November 2001" "GNU Autoconf 2.52e" FSF
 .SH NAME
 autoreconf \- Update generated configuration files
 .SH SYNOPSIS



reply via email to

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