From: Bogdan Date: Sat, 1 Jul 2023 15:34:55 +0000 (-0700) Subject: automake: do not warn that POSIX variables are non-POSIX. X-Git-Tag: v1.16i~44 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4bd4640e03670e267d9763d377f107c09b4f2202;p=thirdparty%2Fautomake.git automake: do not warn that POSIX variables are non-POSIX. This change fixes https://bugs.gnu.org/9587. * lib/Automake/Variable.pm (_VARIABLE_PATTERN_EXTRA_POSIX): new variable for $(*D) and the like. (_VARIABLE_PATTERN): use it. * t/vars3.sh: update test. * NEWS: mention this. POSIX spec (currently): https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html --- diff --git a/NEWS b/NEWS index b73c92569..61d631ba0 100644 --- a/NEWS +++ b/NEWS @@ -37,6 +37,12 @@ New in 1.17: - Emacs Lisp compilations respects silent make output. + - Automake no longer incorrectly warns that the POSIX make variables + $(*D) and the like are non-POSIX. Unfortunately, the make + implementations which do not correctly implement all the POSIX + variables are not detected, but this seems to have little impact + in practice. (bug#9587) + - distcleancheck ignores "silly rename" files (.nfs* .smb* .__afs*) that can show up on network file systems. diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 2c118314e..8bafc8e3a 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -132,7 +132,9 @@ non-object). =cut my $_VARIABLE_CHARACTERS = '[.A-Za-z0-9_@]+'; -my $_VARIABLE_PATTERN = '^' . $_VARIABLE_CHARACTERS . "\$"; +my $_VARIABLE_PATTERN_EXTRA_POSIX = '[*?<%][DF]?'; +my $_VARIABLE_PATTERN = '^(' . $_VARIABLE_CHARACTERS + . '|' . $_VARIABLE_PATTERN_EXTRA_POSIX . ")\$"; my $_VARIABLE_RECURSIVE_PATTERN = '^([.A-Za-z0-9_@]|\$[({]' . $_VARIABLE_CHARACTERS . '[})]?)+' . "\$"; diff --git a/t/vars3.sh b/t/vars3.sh index ae89a6869..cbba47e68 100644 --- a/t/vars3.sh +++ b/t/vars3.sh @@ -15,7 +15,8 @@ # along with this program. If not, see . # Check that Automake warns about variables containing spaces -# and other non-POSIX characters. +# and other non-POSIX characters, but not about real POSIX +# variables (see bug#9587). . test-init.sh @@ -32,6 +33,10 @@ L08$(o u c h): $(wildcard *.c) echo $${ok-this is} L11: $(thisis) $(ok) ${here} +just_a_test: + echo "$(@F) $(%F) $(?F) $( $@ + echo "$(%) $(?) $(<) $(*)" > $@ + echo "$% $? $< $*" > $@ EOF $ACLOCAL @@ -59,6 +64,20 @@ grep ':8:.*wildcard' stderr grep ':9:.*another Error' stderr $EGREP 'ok|thisis|here' stderr && exit 1 +grep '@F' stderr && exit 1 +grep '%F' stderr && exit 1 +grep '?F' stderr && exit 1 +grep '