From: Alexandre Duret-Lutz Date: Tue, 11 Feb 2003 19:32:36 +0000 (+0000) Subject: Fix for PR automake/381: X-Git-Tag: Release-1-7-2b~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6894ebe2ae57f41d8fa96dcffedf4df7d0a956e;p=thirdparty%2Fautomake.git Fix for PR automake/381: * automake.in (handle_gettext): Do not print diagnostics about po/ and intl/ missing from SUBDIRS if po/ does not exist. Warn if `SUBDIRS = intl' is used although libintl is 'external'. * tests/gettext.test: Make sure diagnostics are not output when po/ does not exist. * tests/gettext2.test: Test for unwanted intl/. PR from Alexander Turbov, fix suggested by Bruno Haible. --- diff --git a/ChangeLog b/ChangeLog index 0f2592e37..e1a79908c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2003-02-11 Alexandre Duret-Lutz + Fix for PR automake/381: + * automake.in (handle_gettext): Do not print diagnostics + about po/ and intl/ missing from SUBDIRS if po/ does not + exist. Warn if `SUBDIRS = intl' is used although libintl + is 'external'. + * tests/gettext.test: Make sure diagnostics are not output + when po/ does not exist. + * tests/gettext2.test: Test for unwanted intl/. + PR from Alexander Turbov, fix suggested by Bruno Haible. + * m4/depend.m4: Grep depcomp's stderr for icc warnings about ignored options. * lib/depcomp (icc): New mode. diff --git a/THANKS b/THANKS index a14411542..e5588feaf 100644 --- a/THANKS +++ b/THANKS @@ -9,6 +9,7 @@ Alan Modra amodra@bigpond.net.au Alex Hornby alex@anvil.co.uk Alexander Mai st002279@hrzpub.tu-darmstadt.de Alexander V. Lukyanov lav@yars.free.net +Alexander Turbov zaufi@sendmail.ru Alexandre Duret-Lutz duret_g@epita.fr Alexey Mahotkin alexm@hsys.msk.ru Andreas Buening andreas.buening@nexgo.de diff --git a/automake.in b/automake.in index 0d9c30e4b..840b643c0 100755 --- a/automake.in +++ b/automake.in @@ -4723,14 +4723,44 @@ sub handle_gettext return; } - my @subdirs = &variable_value_as_list_recursive ('SUBDIRS', 'all'); - msg_var 'syntax', 'SUBDIRS', "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. - msg_var 'syntax', 'SUBDIRS', "AM_GNU_GETTEXT used but `intl' not in SUBDIRS" - if (! $seen_gettext_external - && ! grep ($_ eq 'intl', @subdirs)); + # Perform some sanity checks to help users get the right setup. + # We disable these tests when po/ doesn't exist in order not to disallow + # unusual gettext setups. + # + # Bruno Haible: + # | The idea is: + # | + # | 1) If a package doesn't have a directory po/ at top level, it + # | will likely have multiple po/ directories in subpackages. + # | + # | 2) It is useful to warn for the absence of intl/ if AM_GNU_GETTEXT + # | is used without 'external'. It is also useful to warn for the + # | presence of intl/ if AM_GNU_GETTEXT([external]) is used. Both + # | warnings apply only to the usual layout of packages, therefore + # | they should both be disabled if no po/ directory is found at + # | top level. + + if (-d 'po') + { + my @subdirs = &variable_value_as_list_recursive ('SUBDIRS', 'all'); + + msg_var ('syntax', 'SUBDIRS', + "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. + msg_var ('syntax', 'SUBDIRS', + "AM_GNU_GETTEXT used but `intl' not in SUBDIRS") + if (! $seen_gettext_external + && ! grep ($_ eq 'intl', @subdirs)); + + # intl/ should not be used with AM_GNU_GETTEXT([external]) + 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)); + } require_file ($ac_gettext_location, GNU, 'ABOUT-NLS'); } diff --git a/tests/gettext.test b/tests/gettext.test index 2864a9503..a4d2e6860 100755 --- a/tests/gettext.test +++ b/tests/gettext.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -58,3 +58,18 @@ $AUTOMAKE --add-missing # Make sure distcheck runs ./configure --with-included-gettext grep 'with-included-gettext' Makefile.in + +# `SUBDIRS = po intl' isn't required if po/ doesn't exist. +# PR/381. + +rmdir po +mkdir sub +echo 'SUBDIRS = sub' >Makefile.am +$AUTOMAKE + +# Still, SUBDIRS must be defined. + +: >Makefile.am +$AUTOMAKE --add-missing 2>stderr && exit 1 +cat stderr +grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr diff --git a/tests/gettext2.test b/tests/gettext2.test index a074788e7..f72da9e21 100755 --- a/tests/gettext2.test +++ b/tests/gettext2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -56,3 +56,11 @@ $AUTOMAKE --add-missing # user is using AM_GNU_GETTEXT([external]). grep 'with-included-gettext' Makefile.in && exit 1 : + +# intl/ isn't wanted with AM_GNU_GETTEXT([external]). + +mkdir intl +echo 'SUBDIRS = po intl' >Makefile.am +$AUTOMAKE --add-missing 2>stderr && exit 1 +cat stderr +grep 'intl.*AM_GNU_GETTEXT' stderr