]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/Autom4te/General.pm (&update_file): If destination is
authorAkim Demaille <akim@epita.fr>
Sat, 20 Oct 2001 06:56:45 +0000 (06:56 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 20 Oct 2001 06:56:45 +0000 (06:56 +0000)
unchanged, remove the source.
(&up_to_date_p): Don't be verbose, be debug.
* bin/autoreconf.in: No longer support --m4dir.
(&autoreconf): Display the full path of the configure.ac we are
studying.
Trace it only once.
Be sure to honor --force with gettextize.
Always run aclocal.
* doc/autoconf.texi: Adjust.

ChangeLog
NEWS
bin/autoreconf.in
doc/autoconf.texi
lib/Autom4te/General.pm
lib/Autom4te/XFile.pm

index ddec948a0da72380987bcaad73f421555038ca53..f09d24f92822e14f20a477d1abf05e76ded6b123 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-10-20  Akim Demaille  <akim@epita.fr>
+
+       * lib/Autom4te/General.pm (&update_file): If destination is
+       unchanged, remove the source.
+       (&up_to_date_p): Don't be verbose, be debug.
+       * bin/autoreconf.in: No longer support --m4dir.
+       (&autoreconf): Display the full path of the configure.ac we are
+       studying.
+       Trace it only once.
+       Be sure to honor --force with gettextize.
+       Always run aclocal.
+       * doc/autoconf.texi: Adjust.
+
 2001-10-20  Akim Demaille  <akim@epita.fr>
 
        * bin/autoheader.in ($localdir, $m4, $SIMPLE_BACKUP_SUFFIX):
diff --git a/NEWS b/NEWS
index eaac11bc6cb31c281ea01f5efb0e1dd6d7f4809b..a1408b4194598bfa396369be36bbf8041ee5335d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
 * Major changes in Autoconf 2.52e                       -*- outline -*-
 
 ** Requirements
-  Perl 5.005 is required.
+  Perl 5.005 is required: autom4te is written in Perl and is needed by
+  autoconf.  autoheader, autoreconf, ifnames, and autoscan are
+  rewritten in Perl.
 
 ** Documentation
 - AC_INIT
 - --force, -f
   Supported by autom4te, autoconf and autoheader.
 - --include, -I
-  Replaces --autoconf-dir and --localdir in autoconf, autoheader and
-  autoupdate.
+  Replaces --autoconf-dir and --localdir in autoconf, autoheader,
+  autoupdate, and autoreconf.
 - autoreconf
   No longer passes --cygnus, --foreign, --gnits, --gnu, --include-deps:
   automake options are to be given via AUTOMAKE_OPTIONS.
 - autoreconf
   Runs gettextize and libtoolize when appropriate.
+- autoreconf
+  --m4dir is no longer supported.
 
 ** Bug fixes
 - The top level $prefix is propagated to the AC_CONFIG_SUBDIRS configures.
index f3a8ad0e4810cc02fcae449d44b65067176903a2..1c87b2e9c7efa309b809a569e8f179111c95ce5b 100644 (file)
@@ -67,10 +67,6 @@ other tools.
 
 Library directories:
   -I, --include=DIR  look for FILES in DIR (cumulative)
-  -M, --m4dir=M4DIR  this package's Autoconf extensions
-
-Unless specified, heuristics try to compute `M4DIR' from the `Makefile.am',
-or defaults to `m4' if it exists.
 
 The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
 GETTEXTIZE, LIBTOOLIZE are honored.
@@ -100,8 +96,6 @@ my $gettextize = $ENV{'GETTEXTIZE'} || 'gettextize';
 # --install -- as --add-missing in other tools.
 my $install = 0;
 my @include;
-# m4dir -- local Autoconf extensions.  Typically `m4'.
-my $m4dir;
 my $status = 0;
 # symlink -- when --install, use symlinks instead.
 my $symlink = 0;
@@ -120,7 +114,6 @@ sub parse_args ()
   my $srcdir;
 
   getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => \@include,
-         'M|m4dir=s'                                        => \$m4dir,
          'i|install'                                        => \$install,
          's|symlink'                                        => \$symlink);
 
@@ -145,8 +138,8 @@ sub parse_args ()
 
   # Dispatch autoreconf's option to the tools.
   # --include;
-  $autoconf   .= join (' ', map { "--include=$_" } @include);
-  $autoheader .= join (' ', map { "--include=$_" } @include);
+  $autoconf   .= join (' --include=', '', @include);
+  $autoheader .= join (' --include=', '', @include);
 
   # --install and --symlink;
   if ($install)
@@ -181,51 +174,83 @@ sub parse_args ()
 }
 
 
-# &autoreconf ()
-# --------------
-# Reconf the current directory.
-sub autoreconf ()
+# &maybe_autoreconf ()
+# --------------------
+# If the current file ($_) is configure.ac, then there is work to perform
+# there.  Otherwise return.  The main point is preserving $_.
+sub maybe_autoreconf ()
 {
   # If there it's not `configure.ac' or `configure.in', we are not
   # interested in the directory.
   return
     if !/^configure\.(ac|in)$/;
 
-  my $configure_ac = $_;
-  verbose "working on $File::Find::dir/$configure_ac";
+  # Save $_ as Find::File requires it to be preserved.
+  my $underscore = $_;
+  autoreconf ($_);
+  $_ = $underscore;
+}
+
+
+# &autoreconf ($CONFIGURE_AC)
+# ---------------------------
+# Reconf the current directory.
+sub autoreconf ($)
+{
+  my ($configure_ac) = @_;
+  verbose "working on $File::Find::name";
+
+  # ------------------------------- #
+  # See what tools will be needed.  #
+  # ------------------------------- #
 
-  # If there is no AC_INIT, then we are not interested: it looks like
-  # a Cygnus thingy.
+  # Perform a single trace reading to avoid --force forcing a rerun
+  # between two --trace, that's useless.  If there is no AC_INIT, then
+  # we are not interested: it looks like a Cygnus thingy.
   my $configure_ac_file = new Autom4te::XFile $configure_ac;
   my $uses_autoconf;
+  my $uses_gettext;
+  my $uses_libtool;
+  my $uses_autoheader;
   while ($_ = $configure_ac_file->getline)
      {
        $uses_autoconf = 1
         if /AC_INIT/;
      }
+
+  my $traces = new Autom4te::XFile
+    ("$autoconf"
+     . join (' --trace=', '',
+            'AC_INIT', 'AM_GNU_GETTEXT', 'AM_PROG_LIBTOOL',
+            'AC_CONFIG_HEADERS')
+     . " |");
+  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/;
+    }
+
+  # ------------------ #
+  # Running autoconf.  #
+  # ------------------ #
+
   if (!$uses_autoconf)
     {
       verbose "$configure_ac: not using Autoconf";
       return;
     }
 
-
   # -------------------- #
   # Running gettexitze.  #
   # -------------------- #
 
-  my $uses_gettext = 0;
-  my $traces = new Autom4te::XFile "$autoconf --trace=AM_GNU_GETTEXT |";
-  while ($_ = $traces->getline)
-    {
-      $uses_gettext = 1
-       if /AM_GNU_GETTEXT/;
-    }
   if (!$uses_gettext)
     {
       verbose "$configure_ac: not using Gettext";
     }
-  elsif (-d 'intl')
+  elsif (-d 'intl' && !$force)
     {
       verbose "$configure_ac: not running gettextize: `intl' is already present";
     }
@@ -239,13 +264,6 @@ sub autoreconf ()
   # Running libtoolize.  #
   # -------------------- #
 
-  my $uses_libtool = 0;
-  $traces = new Autom4te::XFile "$autoconf --trace=AM_PROG_LIBTOOL |";
-  while ($_ = $traces->getline)
-    {
-      $uses_libtool = 1
-       if /AM_PROG_LIBTOOL/;
-    }
   if (!$uses_libtool)
     {
       verbose "$configure_ac: not using Libtool";
@@ -260,34 +278,27 @@ sub autoreconf ()
   # Running aclocal.  #
   # ----------------- #
 
-  if (-f 'aclocal.m4' &&
-      !up_to_date_p ('aclocal.m4', 'acinclude.m4'))
+  # 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.
+
+  # If there are flags for aclocal in Makefile.am, use them.
+  my $aclocal_flags;
+  if (-f 'Makefile.am')
     {
-      # If there are flags for aclocal in Makefile.am, use them.
-      my $aclocal_flags;
-      if (-f 'Makefile.am')
+      my $aclocal_m4 = new Autom4te::XFile 'Makefile.am';
+      while ($_ = $aclocal_m4->getline)
        {
-         my $aclocal_m4 = new Autom4te::XFile 'Makefile.am';
-         while ($_ = $aclocal_m4->getline)
+         if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
            {
-             if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
-               {
-                 $aclocal_flags = $1;
-                 last;
-               }
+             $aclocal_flags = $1;
+             last;
            }
        }
-
-      # If m4dir is not specified and these flags do not specify the
-      # location of the local Autoconf extensions, default to `m4'.
-      if (!$aclocal_flags)
-       {
-         $aclocal_flags = '-I ' . ($m4dir || 'm4');
-       }
-      xsystem ("$aclocal $aclocal_flags")
     }
 
-
+  xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
+  update_file ('aclocal.m4t', 'aclocal.m4');
 
   # ------------------ #
   # Running automake.  #
@@ -323,13 +334,6 @@ sub autoreconf ()
   # We now consider that if AC_CONFIG_HEADERS is used, then autoheader
   # is used too.
   # Just as for autoconf, up to date ness is performed by the tool itself.
-  my $uses_autoheader = 0;
-  $traces = new Autom4te::XFile "$autoconf --trace=AC_CONFIG_HEADERS |";
-  while ($_ = $traces->getline)
-    {
-      $uses_autoheader = 1
-       if /AC_CONFIG_HEADERS/;
-    }
   if (!$uses_autoheader)
     {
       verbose "$configure_ac: not using Autoheader";
index 7366f3185236a09b50f983dd5f1f16358a400b19..042306b66e870bec7ef206ce325d17d78e959133 100644 (file)
@@ -1077,7 +1077,7 @@ symbols it finds in them.  This output can be voluminous.
 @item --include=@var{dir}
 @itemx -I @var{dir}
 Also look for input files in @var{dir}.  Multiple invocations
-accumulate.  Latest directories are looking in first.
+accumulate.  Directories are browsed from last to first.
 @end table
 
 @node ifnames Invocation
@@ -1162,7 +1162,7 @@ Remake @file{configure} even if newer than its input files.
 @item --include=@var{dir}
 @itemx -I @var{dir}
 Also look for input files in @var{dir}.  Multiple invocations
-accumulate.  Latest directories are looking in first.
+accumulate.  Directories are browsed from last to first.
 
 @item --output=@var{file}
 @itemx -o @var{file}
@@ -1443,26 +1443,10 @@ Copy missing auxiliary files.  This option is similar to the option
 @itemx -s
 Instead of copying missing auxiliary files, install symbolic links.
 
-@item --localdir=@var{dir}
-@itemx -l @var{dir}
-Have @code{autoconf} and @code{autoheader} look for the package files
-@file{aclocal.m4} and (@code{autoheader} only) @file{acconfig.h} (but
-not @file{@var{file}.top} and @file{@var{file}.bot}) in directory
-@var{dir} instead of in the directory containing each @file{configure.ac}.
-
-@item --autoconf-dir=@var{dir}
-@itemx -A @var{dir}
-@evindex AC_MACRODIR
-Override the location where the installed Autoconf data files are looked
-for.  You can also set the @code{AC_MACRODIR} environment variable to a
-directory; this option overrides the environment variable.
-
-This option is rarely needed and dangerous; it is only used when one
-plays with different versions of Autoconf simultaneously.
-
-@item --m4dir=@var{dir}
-@itemx -M @var{dir}
-Specify location of additional macro files (@file{m4} by default).
+@item --include=@var{dir}
+@itemx -I @var{dir}
+Also look for input files in @var{dir}.  Multiple invocations
+accumulate.  Directories are browsed from last to first.
 @end table
 
 
@@ -2533,7 +2517,7 @@ Remake the template file even if newer than its input files.
 @item --include=@var{dir}
 @itemx -I @var{dir}
 Also look for input files in @var{dir}.  Multiple invocations accumulate.
-Latest directories are looking in first.
+Directories are browsed from last to first.
 
 @item --warnings=@var{category}
 @itemx -W @var{category}
@@ -10258,7 +10242,7 @@ Force the update even if the file has not changed.  Disregard the cache.
 @item --include=@var{dir}
 @itemx -I @var{dir}
 Also look for input files in @var{dir}.  Multiple invocations accumulate.
-Latest directories are looking in first.
+Directories are browsed from last to first.
 @end table
 
 @node Obsolete Macros
index d59fa843df5390b31785b2e2852725b0ad3a21fa..993b1c494df67f9061abbdc4887a491e000a945e 100644 (file)
@@ -280,12 +280,12 @@ sub up_to_date_p ($@)
     {
       if ($mtime < mtime ($dep))
        {
-         verbose "up_to_date ($file): outdated: $dep";
+         debug "up_to_date ($file): outdated: $dep";
          return 0;
        }
     }
 
-  verbose "up_to_date ($file): up to date";
+  debug "up_to_date ($file): up to date";
   return 1;
 }
 
@@ -293,7 +293,7 @@ sub up_to_date_p ($@)
 # &update_file ($FROM, $TO)
 # -------------------------
 # Rename $FROM as $TO, preserving $TO timestamp if it has not changed.
-# Recognize `$TO = -' standing for stdin.
+# Recognize `$TO = -' standing for stdin.  $FROM is always removed/renamed.
 sub update_file ($$)
 {
   my ($from, $to) = @_;
@@ -319,6 +319,8 @@ sub update_file ($$)
     {
       # File didn't change, so don't update its mod time.
       print STDERR "$me: `$to' is unchanged\n";
+      unlink ($from)
+       or die "$me: cannot not remove $from: $!\n";
       return
     }
 
index faf849558a593c89777a612369a544d446b35290..58162995e3854165e4b17bb3d63618f247e76eda 100644 (file)
@@ -135,6 +135,11 @@ sub open
       my $me = basename ($0);
       croak "$me: cannot open $file: $!\n";
     }
+
+  # In case we're running under MSWindows, don't write with CRLF.
+  # (This circumvents a bug in at least Cygwin bash where the shell
+  # parsing fails on lines ending with the continuation character '\'
+  # and CRLF).
   binmode $fh if $file =~ /^\s*>/;
 }