From: Akim Demaille Date: Fri, 11 Oct 2002 09:29:20 +0000 (+0000) Subject: * bin/autoreconf.in (&autoreconf): Run autopoint before the first X-Git-Tag: AUTOCONF-2.54a~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=035459d652844a0f3d92217954dae8dc900cb06e;p=thirdparty%2Fautoconf.git * 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. --- diff --git a/ChangeLog b/ChangeLog index ddcc3ded1..9a3d80e3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-08 Akim Demaille + + * 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 Work around problems found when POSIXLY_CORRECT=1 is set. diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 515bd8aed..fee529adf 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -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. # # ------------------- # diff --git a/man/autoreconf.1 b/man/autoreconf.1 index 9f196efe3..189d6a055 100644 --- a/man/autoreconf.1 +++ b/man/autoreconf.1 @@ -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 . .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.