[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: flag missing po/ and intl/ as warnings, not errors (PR/381)
From: |
Alexandre Duret-Lutz |
Subject: |
Re: FYI: flag missing po/ and intl/ as warnings, not errors (PR/381) |
Date: |
Tue, 11 Feb 2003 20:31:58 +0100 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) |
>>> "Bruno" == Bruno Haible <address@hidden> writes:
[...]
Bruno> In http://mail.gnu.org/archive/html/bug-automake/2003-01/msg00014.html
Sorry I missed this mail :(
Bruno> I suggested to omit the error message if there is no po/ directory at
Bruno> top level. The idea is:
Bruno> 1) If a package doesn't have a directory po/ at top level, it
Bruno> will likely have multiple po/ directories in subpackages.
Bruno> 2) It is useful to warn for the absence of intl/ if AM_GNU_GETTEXT
Bruno> is used without 'external'. It is also useful to warn for the
Bruno> presence of intl/ if AM_GNU_GETTEXT([external]) is used. Both
Bruno> warnings apply only to the usual layout of packages, therefore
Bruno> they should both be disabled if no po/ directory is found at
Bruno> top level.
This sounds great! Thank you!
I'm installing the following on HEAD and branch-1-7, and closing the PR.
2003-02-11 Alexandre Duret-Lutz <address@hidden>
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.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.198.2.23
diff -u -r1.198.2.23 NEWS
--- NEWS 11 Feb 2003 18:21:12 -0000 1.198.2.23
+++ NEWS 11 Feb 2003 19:16:35 -0000
@@ -19,7 +19,10 @@
is troublesome with gcc and Solaris compilers. (PR/385)
- makedepend mode: work with Libtool. (PR/385 too)
- support for ICC.
-* Flag missing po/ and intl/ directories as warnings, not errors. (PR/381)
+* better support for unusual gettext setups, such as multiple po/ directories
+ (PR/381):
+ - Flag missing po/ and intl/ directories as warnings, not errors.
+ - Disable these warnings if po/ does not exist.
* Noteworthy manual updates:
- New FAQ chapter.
- Document how AC_CONFIG_AUX_DIR interacts with missing files.
Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.186.2.19
diff -u -r1.186.2.19 THANKS
--- THANKS 10 Feb 2003 22:16:50 -0000 1.186.2.19
+++ THANKS 11 Feb 2003 19:16:35 -0000
@@ -9,6 +9,7 @@
Alex Hornby address@hidden
Alexander Mai address@hidden
Alexander V. Lukyanov address@hidden
+Alexander Turbov address@hidden
Alexandre Duret-Lutz address@hidden
Alexey Mahotkin address@hidden
Andreas Buening address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1365.2.33
diff -u -r1.1365.2.33 automake.in
--- automake.in 11 Feb 2003 13:30:45 -0000 1.1365.2.33
+++ automake.in 11 Feb 2003 19:16:41 -0000
@@ -4713,14 +4713,44 @@
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: tests/gettext.test
===================================================================
RCS file: /cvs/automake/automake/tests/gettext.test,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 gettext.test
--- tests/gettext.test 5 Dec 2002 11:06:24 -0000 1.2.2.1
+++ tests/gettext.test 11 Feb 2003 19:16:41 -0000
@@ -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 @@
# 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: tests/gettext2.test
===================================================================
RCS file: /cvs/automake/automake/tests/gettext2.test,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 gettext2.test
--- tests/gettext2.test 5 Dec 2002 11:06:24 -0000 1.2.2.1
+++ tests/gettext2.test 11 Feb 2003 19:16:41 -0000
@@ -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 @@
# 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
--
Alexandre Duret-Lutz