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.
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');
}
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# 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
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# 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