From 14a920195eee84550cfdd7a161896363d4796a22 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 21 Apr 2019 18:17:14 +0200 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ build-aux/prefix-gnulib-mk | 25 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 916d154ebe..6624ed0c89 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-04-18 Bernhard Voelker di-set: allow free with 'ino_map' being NULL. diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk index 544654f74d..706b077b87 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 -- 2.39.5