Hello Bruno, Thanks for the test suggestion and patches. Below is a combined patch, with the documentation completed and reformulated a bit. OK to install?
Cheers, Ralf 2006-10-10 Bruno Haible <[EMAIL PROTECTED]> Ralf Wildenhues <[EMAIL PROTECTED]> * 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. Index: automake.in =================================================================== RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.1632 diff -u -r1.1632 automake.in --- automake.in 10 Oct 2006 21:34:11 -0000 1.1632 +++ automake.in 10 Oct 2006 21:46:46 -0000 @@ -349,6 +349,8 @@ 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 @@ "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 @@ 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 @@ $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; Index: doc/automake.texi =================================================================== RCS file: /cvs/automake/automake/doc/automake.texi,v retrieving revision 1.150 diff -u -r1.150 automake.texi --- doc/automake.texi 28 Aug 2006 16:04:24 -0000 1.150 +++ doc/automake.texi 10 Oct 2006 21:46:52 -0000 @@ -2939,6 +2939,11 @@ this macro it ensures that the package meets some of gettext's requirements. [EMAIL PROTECTED] 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 @@ 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 [EMAIL PROTECTED] 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 Index: tests/Makefile.am =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.am,v retrieving revision 1.609 diff -u -r1.609 Makefile.am --- tests/Makefile.am 30 Aug 2006 20:35:56 -0000 1.609 +++ tests/Makefile.am 10 Oct 2006 21:46:52 -0000 @@ -257,6 +257,7 @@ getopt.test \ gettext.test \ gettext2.test \ +gettext3.test \ gnumake.test \ gnuwarn.test \ gnuwarn2.test \ --- /dev/null 2006-10-09 01:10:44.864355000 +0200 +++ tests/gettext3.test 2006-10-10 23:44:55.000000000 +0200 @@ -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 <<END +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_INTL_SUBDIR +AC_OUTPUT +END + +echo 'SUBDIRS = po' >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 + +# po/ is required, but intl/ isn't. +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