Le 16 août 09 à 23:36, Bruno Haible a écrit :
Hi Akim and Martin,
Hi Bruno,
This new macro AM_GNU_GETTEXT with option
[need-formatstring-macros] creates tests, that fail in my
environment and make configure reset USE_NLS to no.
This is understandable: If the programmer tells gettext "I need the
support for <inttypes.h> formatstring macros" and the system does not
have this support, i18n gets disabled.
Ha, thanks! I thought it was related to xgettext.
Finally I changed configure.ac:
AM_GNU_GETTEXT([external], [need-formatstring-macros])
reads now
AM_GNU_GETTEXT([external], [need-ngettext])
I think this is safe to do, and will solve the problem.
Thanks for your analysis and cure.
AM_GNU_GETTEXT_VERSION([0.15])
This version has a different meaning: it tells which macros
(intl.m4 etc.) you want to include in your release tarball.
Our bootstrap.conf prevents their distribution (same commit).
# Gettext supplies these files, but we don't need them since
# we don't have an intl subdirectory.
excluded_files='
m4/codeset.m4
m4/glibc2.m4
m4/glibc21.m4
m4/intdiv0.m4
m4/intl.m4
m4/intldir.m4
m4/intmax.m4
m4/inttypes_h.m4
m4/lcmessage.m4
m4/lock.m4
m4/longdouble.m4
m4/printf-posix.m4
m4/signed.m4
m4/size_max.m4
m4/uintmax_t.m4
m4/ulonglong.m4
m4/visibility.m4
m4/xsize.m4
'
Still, a minor problem remains when 'need-ngettext' is used:
When the user has a gettext that supports gettext() but not
ngettext(), with the same logic as above, neither the po/*.gmo
files nor the runtime-po/*.gmo files will be installed. But
the runtime-po/*.gmo files could be useful (used at runtime by
programs that embed bison-generated parsers). To fix this problem,
you would need to have two configure.ac files in the package:
- one that does AM_GNU_GETTEXT([external], [need-ngettext])
and is responsible for most of bison,
- one that does AM_GNU_GETTEXT([external])
and is responsible for only the runtime-po/ directory.
But this solution is probably overkill, because there are not
many systems out there with a gettext() but no ngettext().
Thanks for the additional information!
I installed the following in 2.4.2, 2.5, and master.
From b9e42bb439643b6b193ba44696c370bbb35d2ec0 Mon Sep 17 00:00:00 2001
From: Akim Demaille <[email protected]>
Date: Mon, 17 Aug 2009 09:22:41 +0200
Subject: [PATCH] build: lower gettext requirements.
Bison was uselessly requiring the formatstring macros from
gettext, which resulted in mo files not being installed on systems
that perfectly supported Bison mo files. Lower the requirement.
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
* configure.ac: Require need-ngettext instead of
need-formatstring-macros.
Reported by Martin Jabocs.
Suggested by Bruno Haible.
* INSTALL: Restructure.
(Internationalization): New.
---
ChangeLog | 16 ++++++++++++++++
README | 37 ++++++++++++++++++++++++++-----------
THANKS | 1 +
configure.ac | 2 +-
4 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7a37def..ecc8142 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-08-17 Akim Demaille <[email protected]>
+
+ build: lower gettext requirements.
+
+ Bison was uselessly requiring the formatstring macros from
+ gettext, which resulted in mo files not being installed on systems
+ that perfectly supported Bison mo files. Lower the requirement.
+ http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
+
+ * configure.ac: Require need-ngettext instead of
+ need-formatstring-macros.
+ Reported by Martin Jabocs.
+ Suggested by Bruno Haible.
+ * INSTALL: Restructure.
+ (Internationalization): New.
+
2009-08-14 Joel E. Denny <[email protected]>
maint: fix use of copyright year intervals.
diff --git a/README b/README
index 34a524d..2bf62bf 100644
--- a/README
+++ b/README
@@ -1,27 +1,42 @@
This package contains the GNU Bison parser generator.
-See the file INSTALL for generic compilation and installation instructions.
+* Installation
+** Build
+See the file INSTALL for generic compilation and installation
+instructions.
+Bison requires GNU m4 1.4.6 or later. See:
+
+ ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
+
+** Internationalization
+Bison supports two catalogues: one for Bison itself (i.e., for the
+maintainer-side parser generation), and one for the generated parsers
+(i.e., for the user-side parser execution). The requirements between
+both differ: bison needs ngettext, the generated parsers do not. To
+simplify the build system, neither are installed if ngettext is not
+supported, even if generated parsers could have been localized. See
+http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for
+more details.
+
+* Questions
See the section FAQ in the documentation (doc/bison.info) for
frequently asked questions. The documentation is also available in
PDF and HTML, provided you have a recent version of Texinfo installed:
run "make pdf" or "make html".
-Bison requires GNU m4 1.4.6 or later. See:
-
-ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
-
-Bison can work with pre-1.4.6 distributions of GNU m4 if they are
-sufficiently patched, but if you encounter a bug with an older
-distribution and report a bug we will probably suggest that you
-upgrade to 1.4.6 as the first step in trying to fix it.
+If you have questions about using Bison and the documentation does
+not answer them, please send mail to <[email protected]>.
+* Bug reports
Please send bug reports to <[email protected]>. Please include the
version number from `bison --version', and a complete, self-contained
test case in each bug report.
-If you have questions about using Bison and the documentation does
-not answer them, please send mail to <[email protected]>.
+
+Local Variables:
+mode: outline
+End:
-----
diff --git a/THANKS b/THANKS
index 4c847f5..f7ae63f 100644
--- a/THANKS
+++ b/THANKS
@@ -51,6 +51,7 @@ Keith Browne [email protected]
Laurent Mascherpa [email protected]
Magnus Fromreide [email protected]
Marc Autret [email protected]
+Martin Jacobs [email protected]
Martin Mokrejs [email protected]
Martin Nylin [email protected]
Matt Kraai [email protected]
diff --git a/configure.ac b/configure.ac
index 0954c31..a3e4292 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,7 +116,7 @@ BISON_PREREQ_TIMEVAR
# Gettext.
# We've never tested with gettext versions before 0.15, so play it safe.
-AM_GNU_GETTEXT([external], [need-formatstring-macros])
+AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION([0.15])
BISON_I18N
--
1.6.4