]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autoreconf.in (&autoreconf): Run autopoint before the first
authorAkim Demaille <akim@epita.fr>
Fri, 11 Oct 2002 09:29:20 +0000 (09:29 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 11 Oct 2002 09:29:20 +0000 (09:29 +0000)
aclocal invocation, as Gettext macros might not be visible to
aclocal.
Instead of blindly running autopoint, scan configure.ac (not the
traces) for AM_GNU_GETTEXT_VERSION uses, as autopoint does.
Reported by Paul D. Smith.

ChangeLog
bin/autoreconf.in
man/autoreconf.1

index ddcc3ded1a3a9aa1b7b8bcdd9d6b951ea5ad0f5a..9a3d80e3dd2a2160d62cc9a608ad369cff46c523 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-08  Akim Demaille  <akim@epita.fr>
+
+       * bin/autoreconf.in (&autoreconf): Run autopoint before the first
+       aclocal invocation, as Gettext macros might not be visible to
+       aclocal.
+       Instead of blindly running autopoint, scan configure.ac (not the
+       traces) for AM_GNU_GETTEXT_VERSION uses, as autopoint does.
+       Reported by Paul D. Smith.
+
 2002-10-08  Paul Eggert  <eggert@twinsun.com>
 
        Work around problems found when POSIXLY_CORRECT=1 is set.
index 515bd8aed84fbc15066fa4bb3f58ced2936161dd..fee529adf5f6febcce00bd040070575a1049bca8 100644 (file)
@@ -205,15 +205,17 @@ sub autoreconf ($)
   # ---------------------- #
 
   my $uses_autoconf;
+  my $uses_gettext;
   my $configure_ac_file = new Autom4te::XFile $configure_ac;
   while ($_ = $configure_ac_file->getline)
      {
-       if (/AC_INIT/)
-        {
-          $uses_autoconf = 1;
-          last;
-        }
+       s/#.*//;
+       s/dnl.*//;
+       $uses_autoconf = 1 if /AC_INIT/;
+       # See below for why we look for gettext here.
+       $uses_gettext = 1  if /^AM_GNU_GETTEXT_VERSION/;
      }
+
   if (!$uses_autoconf)
     {
       verbose "$configure_ac: not using Autoconf";
@@ -221,6 +223,40 @@ sub autoreconf ($)
     }
 
 
+  # ------------------- #
+  # Running autopoint.  #
+  # ------------------- #
+
+  # Gettext is a bit of a problem: its macros are not necessarily
+  # visible to aclocal, so if we start with a completely striped down
+  # package (think of a fresh CVS checkout), running `aclocal' first
+  # will fail: the Gettext macros are missing.
+  #
+  # Therefore, we can't use the traces to decide if we use Gettext or
+  # not.  I guess that once Gettext move to 2.5x we will be able to,
+  # but in the meanwhile forget it.
+  #
+  # We can only grep for AM_GNU_GETTEXT_VERSION in configure.ac.  You
+  # might think this approach is naive, and indeed it is, as it
+  # prevents one to embed AM_GNU_GETTEXT_VERSION in another *.m4, but
+  # anyway we don't limit the generality, since... that's what
+  # autopoint does.  Actually, it is even more restrictive, as it
+  # greps for `^AM_GNU_GETTEXT_VERSION('.  We did this above, while
+  # scanning configure.ac.
+  if (!$uses_gettext)
+    {
+      verbose "$configure_ac: not using Gettext";
+    }
+  elsif (!$install)
+    {
+      verbose "$configure_ac: not running autopoint: --install not given";
+    }
+  else
+    {
+      xsystem "$autopoint";
+    }
+
+
   # ----------------- #
   # Running aclocal.  #
   # ----------------- #
@@ -282,11 +318,12 @@ sub autoreconf ($)
        if -f 'aclocal.m4t';
     }
 
-  # We might have to rerun aclocal if Libtool or Gettext import new
+  # We might have to rerun aclocal if Libtool (or others) imports new
   # macros.
   my $rerun_aclocal = 0;
 
 
+
   # ------------------------------- #
   # See what tools will be needed.  #
   # ------------------------------- #
@@ -294,7 +331,7 @@ sub autoreconf ($)
   # 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 $uses_gettext;
+  my $uses_gettext_via_traces;
   my $uses_libtool;
   my $uses_autoheader;
   my @subdir;
@@ -310,7 +347,7 @@ sub autoreconf ($)
   while ($_ = $traces->getline)
     {
       $uses_autoconf = 1            if /AC_INIT/;
-      $uses_gettext = 1             if /AM_GNU_GETTEXT/;
+      $uses_gettext_via_traces = 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:(.*)/;
@@ -330,25 +367,11 @@ sub autoreconf ($)
        }
     }
 
-
-
-  # ------------------- #
-  # Running autopoint.  #
-  # ------------------- #
-
-  if (!$uses_gettext)
-    {
-      verbose "$configure_ac: not using Gettext";
-    }
-  elsif (!$install)
-    {
-      verbose "$configure_ac: not running autopoint: --install not given";
-    }
-  else
-    {
-      xsystem "$autopoint";
-      $rerun_aclocal = 1;
-    }
+  # Gettext consistency checks...
+  error "$configure_ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION"
+    if $uses_gettext_via_traces && ! $uses_gettext;
+  error "$configure_ac: AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT"
+    if $uses_gettext && ! $uses_gettext_via_traces;
 
 
   # -------------------- #
@@ -370,6 +393,7 @@ sub autoreconf ($)
     }
 
 
+
   # ------------------- #
   # Rerunning aclocal.  #
   # ------------------- #
index 9f196efe35c496d6426d05f7ced8a43f96dd32a0..189d6a055d0c95478e26467a630bf9d92e6ceb09 100644 (file)
@@ -1,12 +1,11 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.013.
-.TH AUTORECONF "1" "September 2002" "GNU Autoconf 2.54a" FSF
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.29.
+.TH AUTORECONF "1" "October 2002" "autoreconf 2.54a" "User Commands"
 .SH NAME
-autoreconf \- manual page for autoreconf 2.54a
+autoreconf \- Update generated configuration files
 .SH SYNOPSIS
 .B autoreconf
 [\fIOPTION\fR] ... [\fICONFIGURE-AC or DIRECTORY\fR] ...
 .SH DESCRIPTION
-.PP
 Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint'
 (formerly `gettextize'), and `libtoolize' where appropriate)
 repeatedly to remake the GNU Build System files in the DIRECTORIES or
@@ -48,6 +47,12 @@ append directory DIR to search path
 .PP
 The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
 AUTOPOINT, LIBTOOLIZE are honored.
+.SH AUTHOR
+Written by David J. MacKenzie and Akim Demaille.
+.PP
+Copyright 2002 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 .SH "REPORTING BUGS"
 Report bugs to <bug-autoconf@gnu.org>.
 .SH "SEE ALSO"
@@ -73,8 +78,3 @@ programs are properly installed at your site, the command
 .B info autoreconf
 .PP
 should give you access to the complete manual.
-.PP
-Copyright 2002 Free Software Foundation, Inc.
-.br
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.