]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autoreconf: drop support for old (< 1.8) aclocal versions
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 21 Sep 2012 07:51:33 +0000 (09:51 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 21 Sep 2012 19:42:15 +0000 (21:42 +0200)
The minimal automake and aclocal version required by the "most"
conservative important real world-projects (like Gnulib and Libvirt)
is 1.9 anyway (which is the version installed on old but still
supported installations of stable Distros like RHEL 5), so this
change should be safe and justified by now.

* bin/autoreconf.in (parse_args): Simplify by just assuming the aclocal
options '--force' and '--no-force' are supported and works correctly.
($aclocal_supports_force): Delete, no longer needed.
(run_aclocal): Heavily simplify by assuming that aclocal properly creates
'aclocal.m4' as lazily as possible.
* NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NEWS
bin/autoreconf.in

diff --git a/NEWS b/NEWS
index bea8911b8106646b38a9804f1190a79b658bb9d8..ec877c31fc4612acef6289673b045f14936bc305 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ GNU Autoconf NEWS - User visible changes.
 ** The use of the long-deprecated name 'configure.in' for the autoconf
    input file now elicits a warning in the 'obsolete' category.
 
+** Older versions of aclocal (< 1.8) are no longer supported by autoreconf.
+
 ** Macros
 
 - AC_PROG_CC now prefers C11 if available, falling back on C99 and
index 7259666fa0407bdd222287583a0b4d51073f3cd8..d395639da3c9f7710ac960a3e5f16a1384490b75 100644 (file)
@@ -119,8 +119,6 @@ my $make       = $ENV{'MAKE'}       || 'make';
 my $install = 0;
 # symlink -- when --install, use symlinks instead.
 my $symlink = 0;
-# Does aclocal support --force?
-my $aclocal_supports_force = 0;
 # Does aclocal support -Wfoo?
 my $aclocal_supports_warnings = 0;
 # Does automake support --force-missing?
@@ -187,7 +185,6 @@ sub parse_args ()
 
   my $aclocal_help = `$aclocal --help 2>/dev/null`;
   my $automake_help = `$automake --help 2>/dev/null`;
-  $aclocal_supports_force = $aclocal_help =~ /--force/;
   $aclocal_supports_warnings = $aclocal_help =~ /--warnings/;
   $automake_supports_force_missing = $automake_help =~ /--force-missing/;
   $automake_supports_warnings = $automake_help =~ /--warnings/;
@@ -210,8 +207,7 @@ sub parse_args ()
   # --force;
   if ($force)
     {
-      $aclocal    .= ' --force'
-       if $aclocal_supports_force;
+      $aclocal    .= ' --force';
       $autoconf   .= ' --force';
       $autoheader .= ' --force';
       $automake   .= ' --force-missing'
@@ -221,12 +217,7 @@ sub parse_args ()
     }
   else
     {
-      # The implementation of --no-force is bogus in all implementations
-      # of Automake up to 1.8, so we avoid it in these cases.  (Automake
-      # 1.8 is the first version where aclocal supports force, hence
-      # the condition.)
-      $automake .= ' --no-force'
-       if $aclocal_supports_force;
+      $automake .= ' --no-force';
     }
   # --verbose --verbose or --debug;
   if ($verbose > 1 || $debug)
@@ -258,63 +249,12 @@ sub parse_args ()
 
 # &run_aclocal ($ACLOCAL, $FLAGS)
 # -------------------------------
-# Update aclocal.m4 as lazily as possible, as aclocal pre-1.8 always
-# overwrites aclocal.m4, hence triggers autoconf, autoheader, automake
-# etc. uselessly.  aclocal 1.8+ does not need this.
+# Update aclocal.m4 as lazily as possible.
 sub run_aclocal ($$)
 {
   my ($aclocal, $flags) = @_;
 
-  # aclocal 1.8+ does all this for free.  It can be recognized by its
-  # --force support.
-  if ($aclocal_supports_force)
-    {
-      xsystem ("$aclocal $flags");
-    }
-  else
-    {
-      xsystem ("$aclocal $flags --output=aclocal.m4t");
-      # aclocal may produce no output.
-      if (-f 'aclocal.m4t')
-       {
-         update_file ('aclocal.m4t', 'aclocal.m4');
-         # Make sure that the local m4 files are older than
-         # aclocal.m4.
-         #
-         # Why is not always the case?  Because we already run
-         # aclocal at first (before tracing), which, for instance,
-         # can find Gettext's macros in .../share/aclocal, so we may
-         # have had the right aclocal.m4 already.  Then autopoint is
-         # run, and installs locally these M4 files.  Then
-         # autoreconf, via update_file, sees it is the _same_
-         # aclocal.m4, and doesn't change its timestamp.  But later,
-         # Automake's Makefile expresses that aclocal.m4 depends on
-         # these local files, which are newer, so it triggers aclocal
-         # again.
-         #
-         # To make sure aclocal.m4 is no older, we change the
-         # modification times of the local M4 files to be not newer
-         # than it.
-         #
-         # First, where are the local files?
-         my $aclocal_local_dir = '.';
-         if ($flags =~ /-I\s+(\S+)/)
-           {
-             $aclocal_local_dir = $1;
-           }
-         # All the local files newer than aclocal.m4 are to be
-         # made not newer than it.
-         my $aclocal_m4_mtime = mtime ('aclocal.m4');
-         for my $file (glob ("$aclocal_local_dir/*.m4"), 'acinclude.m4')
-           {
-             if ($aclocal_m4_mtime < mtime ($file))
-               {
-                 debug "aging $file to be not newer than aclocal.m4";
-                 utime $aclocal_m4_mtime, $aclocal_m4_mtime, $file;
-               }
-           }
-       }
-    }
+  xsystem ("$aclocal $flags");
 }
 
 # &autoreconf_current_directory