+2021-12-15 Bruno Haible <bruno@clisp.org>
+
+ automake-subdir support: Support arbitrary --source-base value.
+ Reported by Marc Nieper-Wißkirchen in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00066.html>.
+ * build-aux/prefix-gnulib-mk ($canon_prefix): New variable.
+ (prefix): Initialize it.
+ (prefix_assignment): Use it.
+
2021-12-15 Bruno Haible <bruno@clisp.org>
automake-subdir support: Look for 'subdir-objects' also in configure.ac.
(my $ME = $0) =~ s|.*/||;
my $prefix;
+my $canon_prefix;
my $lib_name;
sub usage ($)
# Variables whose name depend on the location: libbison_a_SOURCES =>
# lib_libbison_a_SOURCES.
- $lhs_and_assign_op =~ s/($lib_name)/lib_$1/g;
+ $lhs_and_assign_op =~ s/($lib_name)/$canon_prefix$1/g;
$lhs_and_assign_op . $rhs;
}
# Work on $_.
local ($_) = @_;
+ # $canon_prefix is derived from $prefix in the same way as Automake
+ # derives %canon_reldir% from %reldir%. See
+ # <https://www.gnu.org/software/automake/manual/html_node/Include.html>.
+ $canon_prefix = $prefix;
+ $canon_prefix =~ s/[^a-zA-Z0-9_]/_/g;
+
# Prefix all the occurrence of files in rules. If there is nothing
# after in the :, it's probably a phony target, or a suffix rule.
# Don't touch it.