]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix for PR automake/381:
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 11 Feb 2003 19:32:36 +0000 (19:32 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 11 Feb 2003 19:32:36 +0000 (19:32 +0000)
* 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.

ChangeLog
THANKS
automake.in
tests/gettext.test
tests/gettext2.test

index 0f2592e37e7e38cbca0adf813a4da5db4dfb3ee1..e1a79908ce45f9b19e27c0775fd8ea8e1aa83690 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2003-02-11  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       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 a144115421cd56b1c132af7f9f5158d9dfc5ab6c..e5588feafdbd937d09a2a59bbd976b3efe4a9ec6 100644 (file)
--- 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
index 0d9c30e4bfe591ea99b0ee7773669f79fc2f1deb..840b643c046799cbe078587facf00961302ff24d 100755 (executable)
@@ -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');
 }
index 2864a9503b337ca378cef54865fa1dc3e6558ea6..a4d2e68609b6da0f2051f510a0a59eb678ae6a6b 100755 (executable)
@@ -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
index a074788e7b1f9f9c53f0a074b3278b111ee97040..f72da9e21603e2398584f5056c347ed44015141a 100755 (executable)
@@ -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