[prev in list] [next in list] [prev in thread] [next in thread] 

List:       autoconf-bug
Subject:    Re: autoreconf vs. libtool
From:       Akim Demaille <akim () epita ! fr>
Date:       2001-11-08 17:18:20
Message-ID: mv4zo5xw59f.fsf () nostromo ! lrde ! epita ! fr
[Download RAW message or body]

>>>>> "Akim" == Akim Demaille <akim@epita.fr> writes:

Ralf> The more I think about it, I am inclined to think tracing can't
Ralf> work for libtoolize and gettextize unless aclocal has been run
Ralf> once before them

Akim> Very much agreed.  This is what I plan to do: move aclocal's
Akim> invocation upwards.

Here is the patch I'm applying.  Could you please confirm it behaves
as expected?

Index: ChangeLog
from  Akim Demaille  <akim@epita.fr>

	* bin/autoreconf.in (&autoreconf): Run aclocal before tracing, so
	that we can trace macros from aclocal.m4.
	Trace AC_PROG_LIBTOOL, not AM_PROG_LIBTOOL, since the latter is
	obsoleted, and redirect to the former anyway.

Index: bin/autoreconf.in
===================================================================
RCS file: /cvs/autoconf/bin/autoreconf.in,v
retrieving revision 1.87
diff -u -u -r1.87 autoreconf.in
--- bin/autoreconf.in 2001/11/08 16:15:20 1.87
+++ bin/autoreconf.in 2001/11/08 17:19:01
@@ -215,6 +215,59 @@
     }
 
 
+  # ----------------- #
+  # Running aclocal.  #
+  # ----------------- #
+
+  # Run it first: it might discover new macros to add, e.g.,
+  # AC_PROG_LIBTOOL, which we will trace later to see if Libtool is
+  # used.
+  #
+  # Always run it.  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.
+  my $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 = '';
+  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;
+	      last;
+	    }
+	}
+    }
+
+  if (!$uses_aclocal)
+    {
+      verbose "$configure_ac: not using aclocal";
+    }
+  else
+    {
+      xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
+      # aclocal may produce no output.
+      update_file ('aclocal.m4t', 'aclocal.m4')
+	if -f 'aclocal.m4t';
+    }
+
+
+
   # ------------------------------- #
   # See what tools will be needed.  #
   # ------------------------------- #
@@ -225,21 +278,20 @@
   my $uses_gettext;
   my $uses_libtool;
   my $uses_autoheader;
-  my $uses_aclocal;
   my @subdir;
   my $traces = new Autom4te::XFile
     ("$autoconf"
      . join (' --trace=', '',
-	     'AC_INIT', 'AM_GNU_GETTEXT', 'AM_PROG_LIBTOOL',
+	     'AC_INIT', 'AM_GNU_GETTEXT', 'AC_PROG_LIBTOOL',
 	     'AC_CONFIG_HEADERS',
 	     'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1')
      . ' |');
   while ($_ = $traces->getline)
     {
-      $uses_autoconf = 1          if /AC_INIT/;
-      $uses_gettext = 1           if /AM_GNU_GETTEXT/;
-      $uses_libtool = 1           if /AM_PROG_LIBTOOL/;
-      $uses_autoheader = 1        if /AC_CONFIG_HEADERS/;
+      $uses_autoconf = 1            if /AC_INIT/;
+      $uses_gettext = 1             if /AM_GNU_GETTEXT/;
+      $uses_libtool = 1             if /AC_PROG_LIBTOOL/;
+      $uses_autoheader = 1          if /AC_CONFIG_HEADERS/;
       push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
     }
 
@@ -257,6 +309,8 @@
 	}
     }
 
+
+
   # -------------------- #
   # Running gettexitze.  #
   # -------------------- #
@@ -296,53 +350,6 @@
       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.
-  $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 = '';
-  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;
-	      last;
-	    }
-	}
-    }
-
-  if (!$uses_aclocal)
-    {
-      verbose "$configure_ac: not using aclocal";
-    }
-  else
-    {
-      xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
-      # aclocal may produce no output.
-      update_file ('aclocal.m4t', 'aclocal.m4')
-	if -f 'aclocal.m4t';
-    }
 
   # ------------------ #
   # Running automake.  #



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic