]> Savannah Git Hosting - gnulib.git/commitdiff
prefix-gnulib-mk: fix the support for gnulib-po
authorAkim Demaille <akim.demaille@gmail.com>
Sun, 21 Apr 2019 16:17:14 +0000 (18:17 +0200)
committerAkim Demaille <akim.demaille@gmail.com>
Tue, 23 Apr 2019 16:15:40 +0000 (18:15 +0200)
* 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
build-aux/prefix-gnulib-mk

index 916d154ebee0351229c9eea53c10998f042797f5..6624ed0c89979ffeb83c2aaec9891259d0d555f3 100644 (file)
--- 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-04-18  Bernhard Voelker  <mail@bernhard-voelker.de>
 
        di-set: allow free with 'ino_map' being NULL.
index 544654f74da25c421d1c276c4b607f3588b5ab13..706b077b8748afffbb821a9d5577649757cad277 100755 (executable)
@@ -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