From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id F3B8220248 for ; Sun, 21 Apr 2019 17:41:23 +0000 (UTC) Received: from localhost ([127.0.0.1]:55508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIGSs-0002gy-FW for normalperson@yhbt.net; Sun, 21 Apr 2019 13:41:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIGSn-0002gs-46 for bug-gnulib@gnu.org; Sun, 21 Apr 2019 13:41:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIGSf-0001tE-LM for bug-gnulib@gnu.org; Sun, 21 Apr 2019 13:41:09 -0400 Received: from smtp.lrde.epita.fr ([163.5.55.2]:35360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIGSN-0001Ry-OW; Sun, 21 Apr 2019 13:40:52 -0400 Received: from [192.168.2.101] (p5B3D8F1B.dip0.t-ipconnect.de [91.61.143.27]) by smtp.lrde.epita.fr (Postfix) with ESMTPSA id 3F03F4141B; Sun, 21 Apr 2019 19:40:35 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: [bug-gettext] the manual is incomplete about using a compendium PO file From: Akim Demaille In-Reply-To: Date: Sun, 21 Apr 2019 19:40:33 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <8a6c2fb7-a755-9ce8-cd49-d3094b172ae3@telfort.nl> <4706766.x2PUGRTUMO@omega> To: Bruno Haible X-Mailer: Apple Mail (2.3445.104.8) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 163.5.55.2 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Benno Schulenberg , Gnulib bugs , bug-gettext@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi all, > Le 13 avr. 2019 =C3=A0 15:28, Akim Demaille a = =C3=A9crit : >=20 > So far Bison is still hosting the translation of > gnulib's file, because I failed to have the gnulib-po module > work properly with Bison. >=20 > Maybe I do something wrong, but after bootstrap, compile, install, > Bison is no longer internationalized: nothing is translated (not > gnulib's messages, nor Bison's ones). I have found the problem: gnulib.mk contains AM_CPPFLAGS +=3D -DDEFAULT_TEXT_DOMAIN=3D\"bison-gnulib\" and Bison's build system uses a single Makefile.in. As a consequence Bison's textdomain() call is useless, and translations are lost. Actually it seems that prefix-gnulib-mk has not been updated since quite a while, I spotted another issue that needed to be addressed. With the following commit, Bison happily works with gnulib's po, and translators' time will be saved! Cheers! commit 03dad082c4de5a7551374eeb8b58a69ab95f78a9 Author: Akim Demaille Date: Sun Apr 21 18:17:14 2019 +0200 prefix-gnulib-mk: fix the support for gnulib-po =20 * build-aux/prefix-gnulib-mk (prefix_assignment): Remove useless = $res. Don't touch HAVE_* variables. Map AM_CPPFLAGS and AM_CPPFLAGS to the library's corresponding = variables. diff --git a/ChangeLog b/ChangeLog index e87ff2389..2da5a7d59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2019-04-21 Akim Demaille + + prefix-gnulib-mk: fix the support for gnulib-po + * build-aux/prefix-gnulib-mk (prefix_assignment): Remove useless = $res. + Don't touch HAVE_* variables. + Map AM_CPPFLAGS and AM_CPPFLAGS to the library's corresponding = variables. + 2019-03-22 Akim Demaille =20 _Noreturn: beware of C's _Noreturn in C++ pre C++11. diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk index 544654f74..706b077b8 100755 --- a/build-aux/prefix-gnulib-mk +++ b/build-aux/prefix-gnulib-mk @@ -87,7 +87,6 @@ sub prefix_words ($) sub prefix_assignment ($$) { my ($lhs_and_assign_op, $rhs) =3D @_; - my $res; =20 # Some variables are initialized by gnulib.mk, and we don't want # that. Change '=3D' to '+=3D'. @@ -95,21 +94,35 @@ sub prefix_assignment ($$) { # Do not change the RHS, which specifies the GPERF program. } + # Don't change variables such as HAVE_INCLUDE_NEXT. + elsif ($lhs_and_assign_op =3D~ /^HAVE_/) + { + } elsif ($lhs_and_assign_op =3D~ /^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES - |CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS - |AM_CPPFLAGS|AM_GNU_GETTEXT)\ =3D/x) + |CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES + |AM_GNU_GETTEXT)\ =3D/x) { $lhs_and_assign_op =3D~ s/=3D/+=3D/; } + # We don't want things such as AM_CPPFLAGS +=3D + # -DDEFAULT_TEXT_DOMAIN=3D\"bison-gnulib\" to apply to the whole + # Makefile.in: scope it to the library: libbison_a_CPPFLAGS =3D + # $(AM_CPPFLAGS) -DDEFAULT_TEXT_DOMAIN=3D\"bison-gnulib\". + elsif ($lhs_and_assign_op =3D~ + /^(AM_CFLAGS|AM_CPPFLAGS)\ \+?=3D/x) + { + $lhs_and_assign_op =3D~ s/^AM_(\w+)\ \+?=3D/${lib_name}_$1 =3D/; + $rhs =3D " \$(AM_$1)$rhs"; + } # We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them. elsif ($lhs_and_assign_op =3D~ /^AUTOMAKE_OPTIONS =3D/) { $lhs_and_assign_op =3D~ s/^/# /; } + # Elide any SUFFIXES assignment or concatenation. elsif ($lhs_and_assign_op =3D~ /^SUFFIXES /) { - # Elide any SUFFIXES assignment or concatenation. $lhs_and_assign_op =3D~ s/^/# /; } # The words are (probably) paths to files in lib/: prefix them. @@ -118,11 +131,11 @@ sub prefix_assignment ($$) $rhs =3D prefix_words($rhs) } =20 - # Variables which name depend on the location: libbison_a_SOURCES =3D> + # Variables whose name depend on the location: libbison_a_SOURCES =3D> # lib_libbison_a_SOURCES. $lhs_and_assign_op =3D~ s/($lib_name)/lib_$1/g; =20 - return $lhs_and_assign_op . $rhs; + $lhs_and_assign_op . $rhs; } =20 # prefix $CONTENTS