* Re: [bug-gettext] the manual is incomplete about using a compendium PO file
[not found] ` <B270218B-FD48-44EA-AEDC-52A89312146C@lrde.epita.fr>
@ 2019-04-21 17:40 ` Akim Demaille
2019-04-23 16:19 ` Akim Demaille
0 siblings, 1 reply; 3+ messages in thread
From: Akim Demaille @ 2019-04-21 17:40 UTC (permalink / raw)
To: Bruno Haible; +Cc: Benno Schulenberg, Gnulib bugs, bug-gettext
Hi all,
> Le 13 avr. 2019 à 15:28, Akim Demaille <akim@lrde.epita.fr> a écrit :
>
> 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.
>
> 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 += -DDEFAULT_TEXT_DOMAIN=\"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 <akim.demaille@gmail.com>
Date: Sun Apr 21 18:17:14 2019 +0200
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.
diff --git a/ChangeLog b/ChangeLog
index e87ff2389..2da5a7d59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-04-21 Akim Demaille <akim@lrde.epita.fr>
+
+ 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 <akim@lrde.epita.fr>
_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) = @_;
- my $res;
# Some variables are initialized by gnulib.mk, and we don't want
# that. Change '=' to '+='.
@@ -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 =~ /^HAVE_/)
+ {
+ }
elsif ($lhs_and_assign_op =~
/^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES
- |CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS
- |AM_CPPFLAGS|AM_GNU_GETTEXT)\ =/x)
+ |CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES
+ |AM_GNU_GETTEXT)\ =/x)
{
$lhs_and_assign_op =~ s/=/+=/;
}
+ # We don't want things such as AM_CPPFLAGS +=
+ # -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\" to apply to the whole
+ # Makefile.in: scope it to the library: libbison_a_CPPFLAGS =
+ # $(AM_CPPFLAGS) -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\".
+ elsif ($lhs_and_assign_op =~
+ /^(AM_CFLAGS|AM_CPPFLAGS)\ \+?=/x)
+ {
+ $lhs_and_assign_op =~ s/^AM_(\w+)\ \+?=/${lib_name}_$1 =/;
+ $rhs = " \$(AM_$1)$rhs";
+ }
# We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them.
elsif ($lhs_and_assign_op =~ /^AUTOMAKE_OPTIONS =/)
{
$lhs_and_assign_op =~ s/^/# /;
}
+ # Elide any SUFFIXES assignment or concatenation.
elsif ($lhs_and_assign_op =~ /^SUFFIXES /)
{
- # Elide any SUFFIXES assignment or concatenation.
$lhs_and_assign_op =~ s/^/# /;
}
# The words are (probably) paths to files in lib/: prefix them.
@@ -118,11 +131,11 @@ sub prefix_assignment ($$)
$rhs = prefix_words($rhs)
}
- # Variables which name depend on the location: libbison_a_SOURCES =>
+ # Variables whose name depend on the location: libbison_a_SOURCES =>
# lib_libbison_a_SOURCES.
$lhs_and_assign_op =~ s/($lib_name)/lib_$1/g;
- return $lhs_and_assign_op . $rhs;
+ $lhs_and_assign_op . $rhs;
}
# prefix $CONTENTS
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [bug-gettext] the manual is incomplete about using a compendium PO file
2019-04-21 17:40 ` [bug-gettext] the manual is incomplete about using a compendium PO file Akim Demaille
@ 2019-04-23 16:19 ` Akim Demaille
2019-05-26 7:27 ` Akim Demaille
0 siblings, 1 reply; 3+ messages in thread
From: Akim Demaille @ 2019-04-23 16:19 UTC (permalink / raw)
To: Bruno Haible; +Cc: Benno Schulenberg, Gnulib bugs, bug-gettext
> Le 21 avr. 2019 à 19:40, Akim Demaille <akim@lrde.epita.fr> a écrit :
>
> commit 03dad082c4de5a7551374eeb8b58a69ab95f78a9
> Author: Akim Demaille <akim.demaille@gmail.com>
> Date: Sun Apr 21 18:17:14 2019 +0200
>
> 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.
Installed in gnulib.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug-gettext] the manual is incomplete about using a compendium PO file
2019-04-23 16:19 ` Akim Demaille
@ 2019-05-26 7:27 ` Akim Demaille
0 siblings, 0 replies; 3+ messages in thread
From: Akim Demaille @ 2019-05-26 7:27 UTC (permalink / raw)
To: Gnulib bugs
Hi,
> Le 23 avr. 2019 à 18:19, Akim Demaille <akim@lrde.epita.fr> a écrit :
>
>
>> Le 21 avr. 2019 à 19:40, Akim Demaille <akim@lrde.epita.fr> a écrit :
>>
>> commit 03dad082c4de5a7551374eeb8b58a69ab95f78a9
>> Author: Akim Demaille <akim.demaille@gmail.com>
>> Date: Sun Apr 21 18:17:14 2019 +0200
>>
>> 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.
>
> Installed in gnulib.
I'm installing this on top of it. It generated
lib_libbison_CPPFLAGS = $(AM_CPPFLAGS) -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"
instead of
lib_libbison_a_CPPFLAGS = $(AM_CPPFLAGS) -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"
commit 9bfa2644feac79b87cc0d78b11ec9c210b78bba5
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Sat May 25 19:40:10 2019 +0200
prefix-gnulib-mk: Fix CPPFLAGS migration
* build-aux/prefix-gnulib-mk (prefix_assignment): Don't forget the
_a part of the library name.
diff --git a/ChangeLog b/ChangeLog
index 2cd6145c7..3887af14a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-05-26 Akim Demaille <akim@lrde.epita.fr>
+
+ prefix-gnulib-mk: Fix CPPFLAGS migration.
+ * build-aux/prefix-gnulib-mk (prefix_assignment): Don't forget the
+ _a part of the library name.
+
2019-05-24 Paul Eggert <eggert@cs.ucla.edu>
flexmember: update comments again
diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk
index 706b077b8..bef726f6b 100755
--- a/build-aux/prefix-gnulib-mk
+++ b/build-aux/prefix-gnulib-mk
@@ -112,7 +112,7 @@ sub prefix_assignment ($$)
elsif ($lhs_and_assign_op =~
/^(AM_CFLAGS|AM_CPPFLAGS)\ \+?=/x)
{
- $lhs_and_assign_op =~ s/^AM_(\w+)\ \+?=/${lib_name}_$1 =/;
+ $lhs_and_assign_op =~ s/^AM_(\w+)\ \+?=/${lib_name}_a_$1 =/;
$rhs = " \$(AM_$1)$rhs";
}
# We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them.
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-26 7:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <8a6c2fb7-a755-9ce8-cd49-d3094b172ae3@telfort.nl>
[not found] ` <4706766.x2PUGRTUMO@omega>
[not found] ` <B270218B-FD48-44EA-AEDC-52A89312146C@lrde.epita.fr>
2019-04-21 17:40 ` [bug-gettext] the manual is incomplete about using a compendium PO file Akim Demaille
2019-04-23 16:19 ` Akim Demaille
2019-05-26 7:27 ` Akim Demaille
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).