This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use gcc-internal-format instead of c-format or nothing in gcc.pot where needed
- From: Bruno Haible <bruno at clisp dot org>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Zack Weinberg <zack at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jun 2005 17:22:10 +0200
- Subject: Re: [PATCH] Use gcc-internal-format instead of c-format or nothing in gcc.pot where needed
- References: <20050517113757.GD4930@devserv.devel.redhat.com> <200506011541.55746.bruno@clisp.org> <Pine.LNX.4.61.0506011359450.21490@digraph.polyomino.org.uk>
Joseph S. Myers wrote:
> We need to avoid two possible causes of build breakage:
>
> (a) People building from CVS with an old version of msgfmt must not have
> their builds fail because of new features in the .pot and .po files. If
> builds with old msgfmt would fail then we need configure checks to disable
> msgfmt in such cases.
Something like the appended patch might do it. (Untested.)
> (b) People building from CVS with current msgfmt must not have their
> builds fail because of inconsistencies between the .po and .pot files.
> The normal procedure for updating .po files is that we only ever take new
> .po files from the TP site; we update the .pot file in CVS, submit a
> release or snapshot to the TP, then download the automerged files from
> there. Do I understand this would cause build failures between when the
> new gcc.pot goes in CVS and when the new .po files do, and if so we need
> to get the .po files fixed in CVS first (i.e. get all the relevant
> translation teams to submit to the TP files with the problem translations
> fixed or marked as fuzzy)?
It would not cause build failures, but the .po files would still contain
the bugs that we are seeking to eliminate and that can cause gcc core dumps
in certain locales. What I recommend here is step 5 of the list from the
other mail:
3) The GCC i18n maintainer ensures that gettext >= 0.14.5 is used for
constructing the gcc.pot file.
4) The GCC i18n maintainer regenerates the gcc.pot file (it should
contain many "#, gcc-internal-format" annotations this time), and
submits it to the TP.
5) The GCC i18n maintainer does an 'msgmerge' of this new gcc.pot file
with the original .po files, using gettext >= 0.14.5. This will
automatically mark those messages as fuzzy that are not valid, matching
format strings. This step obsoletes Jakub's gcc41-po-fixes.patch.
6) The GCC i18n maintainer receives through the TP the updated translations
from the translators.
This step 5 eliminates the danger of gcc core dumps without needing to wait
for updated PO files from the Translation Project. If you have a
po/Makefile.in.in, it's done through a simple "make update-po". If not,
it's a shell command like this:
for f in *.po ; do
msgmerge --update --verbose $f gcc.pot
done
Bruno
*** gcc-4.0.0/config/po.m4.bak 2004-09-23 01:53:46.000000000 +0200
--- gcc-4.0.0/config/po.m4 2005-06-01 17:09:45.000000000 +0200
***************
*** 1,5 ****
! # po.m4 serial 1 (gettext-0.12)
! dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
--- 1,5 ----
! # po.m4 serial 1a (gcc-4.1)
! dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
***************
*** 86,91 ****
--- 86,124 ----
rm -f messages.po
fi
+ dnl Test whether we found GNU msgfmt version >= 0.14.5.
+ if test "$GMSGFMT" != ":"; then
+ case `$GMSGFMT --version | sed -e 1q | sed -e 's/^\([^0-9]*\)//'` in
+ 0.14.[5-9]* | 0.14.[1-9][0-9]* | 0.1[5-9]* | 0.[2-9][0-9]* | [1-9].*) : ;;
+ *)
+ AC_MSG_RESULT([found msgfmt program is too old; ignore it])
+ GMSGFMT=":"
+ ;;
+ esac
+ fi
+
+ dnl Test whether we found GNU xgettext version >= 0.14.5.
+ if test "$XGETTEXT" != ":"; then
+ case `$XGETTEXT --version | sed -e 1q | sed -e 's/^\([^0-9]*\)//'` in
+ 0.14.[5-9]* | 0.14.[1-9][0-9]* | 0.1[5-9]* | 0.[2-9][0-9]* | [1-9].*) : ;;
+ *)
+ AC_MSG_RESULT([found xgettext program is too old; ignore it])
+ XGETTEXT=":"
+ ;;
+ esac
+ fi
+
+ dnl Test whether we found GNU msgmerge version >= 0.14.5.
+ if test "$MSGMERGE" != ":"; then
+ case `$MSGMERGE --version | sed -e 1q | sed -e 's/^\([^0-9]*\)//'` in
+ 0.14.[5-9]* | 0.14.[1-9][0-9]* | 0.1[5-9]* | 0.[2-9][0-9]* | [1-9].*) : ;;
+ *)
+ AC_MSG_RESULT([found msgmerge program is too old; ignore it])
+ MSGMERGE=":"
+ ;;
+ esac
+ fi
+
AC_OUTPUT_COMMANDS([
for ac_file in $CONFIG_FILES; do
# Support "outfile[:infile[:infile...]]"