This bug and fix was posted at
https://lists.gnu.org/archive/html/automake/2023-08/msg00003.html.
* lib/Automake/Variable.pm (scan_variable_expansions): rewrite
scan_variable_expansions regex to handle dollar-escaped dollar signs.
* t/dollarvar2.sh: test it.
$text =~ s/#.*$//;
# Record each use of ${stuff} or $(stuff) that does not follow a $.
- while ($text =~ /(?<!\$)\$(?:\{([^\}]*)\}|\(([^\)]*)\))/g)
+ while ($text =~ m{\$(?:\{([^\}]*)\}|\(([^\)]*)\)|(\$))}g)
{
- my $var = $1 || $2;
+ my $var = $1 || $2 || $3;
+ next if $var eq '$';
# The occurrence may look like $(string1[:subst1=[subst2]]) but
# we want only 'string1'.
$var =~ s/:[^:=]*=[^=]*$//;
grep 'var-with-dash' stderr && exit 1
grep 'recursive variable expansion' stderr
+#
+# Ensure that GNU make function calls give a portability warning
+# under a certain condition that older automake missed.
+#
+cat >Makefile.am <<'EOF'
+x = $$$(y z)
+EOF
+AUTOMAKE_fails -Wportability
+
: