From: Ralf Wildenhues Date: Sat, 14 Oct 2006 17:02:13 +0000 (+0000) Subject: * automake.in ($seen_gettext_intl): New variable. X-Git-Tag: Release-1-10~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85cb0d4d6ca85c8d8261fd71338f0eb3ed982fd9;p=thirdparty%2Fautomake.git * automake.in ($seen_gettext_intl): New variable. (handle_gettext): Consider it. (scan_autoconf_traces): Add AM_GNU_GETTEXT_INTL_SUBDIR to the list. Set $seen_gettext_intl when it is seen. * doc/automake.texi (gettext, Optional): Update. * tests/gettext3.test: New test. * tests/Makefile.am: Update. --- diff --git a/ChangeLog b/ChangeLog index ee2eeace4..6040559b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-10-14 Bruno Haible + Ralf Wildenhues + + * automake.in ($seen_gettext_intl): New variable. + (handle_gettext): Consider it. + (scan_autoconf_traces): Add AM_GNU_GETTEXT_INTL_SUBDIR to the list. + Set $seen_gettext_intl when it is seen. + * doc/automake.texi (gettext, Optional): Update. + * tests/gettext3.test: New test. + * tests/Makefile.am: Update. + 2006-10-14 Paul Eggert * lib/install-sh (posix_mkdir): Reject FreeBSD 6.1 mkdir -p -m, diff --git a/automake.in b/automake.in index edf14f31d..939361556 100755 --- a/automake.in +++ b/automake.in @@ -349,6 +349,8 @@ my $seen_gettext = 0; my $seen_gettext_external = 0; # Where AM_GNU_GETTEXT appears. my $ac_gettext_location; +# Whether AM_GNU_GETTEXT_INTL_SUBDIR has been seen. +my $seen_gettext_intl = 0; # Lists of tags supported by Libtool. my %libtool_tags = (); @@ -4234,18 +4236,20 @@ sub handle_gettext "AM_GNU_GETTEXT used but `po' not in SUBDIRS") if ! grep ($_ eq 'po', @subdirs); - # intl/ is not required when AM_GNU_GETTEXT is called with - # the `external' option. + # intl/ is not required when AM_GNU_GETTEXT is called with the + # `external' option and AM_GNU_GETTEXT_INTL_SUBDIR is not called. msg_var ('syntax', $subdirs, "AM_GNU_GETTEXT used but `intl' not in SUBDIRS") - if (! $seen_gettext_external + if (! ($seen_gettext_external && ! $seen_gettext_intl) && ! grep ($_ eq 'intl', @subdirs)); - # intl/ should not be used with AM_GNU_GETTEXT([external]) + # intl/ should not be used with AM_GNU_GETTEXT([external]), except + # if AM_GNU_GETTEXT_INTL_SUBDIR is called. msg_var ('syntax', $subdirs, "`intl' should not be in SUBDIRS when " . "AM_GNU_GETTEXT([external]) is used") - if ($seen_gettext_external && grep ($_ eq 'intl', @subdirs)); + if ($seen_gettext_external && ! $seen_gettext_intl + && grep ($_ eq 'intl', @subdirs)); } require_file ($ac_gettext_location, GNU, 'ABOUT-NLS'); @@ -4785,6 +4789,7 @@ sub scan_autoconf_traces ($) AM_CONDITIONAL => 2, AM_ENABLE_MULTILIB => 0, AM_GNU_GETTEXT => 0, + AM_GNU_GETTEXT_INTL_SUBDIR => 0, AM_INIT_AUTOMAKE => 0, AM_MAINTAINER_MODE => 0, AM_PROG_CC_C_O => 0, @@ -4940,6 +4945,10 @@ sub scan_autoconf_traces ($) $ac_gettext_location = $where; $seen_gettext_external = grep ($_ eq 'external', @args); } + elsif ($macro eq 'AM_GNU_GETTEXT_INTL_SUBDIR') + { + $seen_gettext_intl = $where; + } elsif ($macro eq 'AM_INIT_AUTOMAKE') { $seen_init_automake = $where; diff --git a/doc/automake.texi b/doc/automake.texi index 64906dc7e..d1df2eca3 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2939,6 +2939,11 @@ This macro is required for packages that use GNU gettext this macro it ensures that the package meets some of gettext's requirements. +@item AM_GNU_GETTEXT_INTL_SUBDIR +This macro specifies that the @file{intl/} subdirectory is to be built, +even if the @code{AM_GNU_GETTEXT} macro was invoked with a first argument +of @samp{external}. + @item AM_MAINTAINER_MODE @opindex --enable-maintainer-mode This macro adds a @option{--enable-maintainer-mode} option to @@ -7247,9 +7252,11 @@ turns on support for GNU gettext, a message catalog system for internationalization (@pxref{GNU Gettext, , , gettext, GNU gettext utilities}). -The @code{gettext} support in Automake requires the addition of two -subdirectories to the package, @file{intl} and @file{po}. Automake -insures that these directories exist and are mentioned in +The @code{gettext} support in Automake requires the addition of one or +two subdirectories to the package, @file{po} and possibly also @file{intl}. +The latter is needed if @code{AM_GNU_GETTEXT} is not invoked with the +@samp{external} argument, or if @code{AM_GNU_GETTEXT_INTL_SUBDIR} is used. +Automake ensures that these directories exist and are mentioned in @code{SUBDIRS}. @node Libtool diff --git a/doc/stamp-vti b/doc/stamp-vti index 560ec26bc..d72766d93 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 28 August 2006 -@set UPDATED-MONTH August 2006 +@set UPDATED 14 October 2006 +@set UPDATED-MONTH October 2006 @set EDITION 1.9c @set VERSION 1.9c diff --git a/doc/version.texi b/doc/version.texi index 560ec26bc..d72766d93 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 28 August 2006 -@set UPDATED-MONTH August 2006 +@set UPDATED 14 October 2006 +@set UPDATED-MONTH October 2006 @set EDITION 1.9c @set VERSION 1.9c diff --git a/tests/Makefile.am b/tests/Makefile.am index addff01bc..46bec2c4b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -257,6 +257,7 @@ gcj5.test \ getopt.test \ gettext.test \ gettext2.test \ +gettext3.test \ gnumake.test \ gnuwarn.test \ gnuwarn2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index a3d55279c..9d3c3a20e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -389,6 +389,7 @@ gcj5.test \ getopt.test \ gettext.test \ gettext2.test \ +gettext3.test \ gnumake.test \ gnuwarn.test \ gnuwarn2.test \ diff --git a/tests/gettext3.test b/tests/gettext3.test new file mode 100755 index 000000000..e1d79ffa6 --- /dev/null +++ b/tests/gettext3.test @@ -0,0 +1,53 @@ +#! /bin/sh +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +# Check gettext `AM_GNU_GETTEXT_INTL_SUBDIR' support. + +required='gettext' +. ./defs || exit 1 + +set -e + +cat >>configure.in <Makefile.am +mkdir po + +# if aclocal fails, assume the gettext macros are too old and do not +# define AM_GNU_GETTEXT_INTL_SUBDIR. +$ACLOCAL || exit 77 + +# config.rpath is required. +: >config.rpath + +# intl/ is required. +AUTOMAKE_fails --add-missing +grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr + +mkdir intl +AUTOMAKE_fails --add-missing +grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr + +echo 'SUBDIRS = po intl' > Makefile.am +$AUTOMAKE --add-missing