From abb703a0c09917bd22650a99fb0b327d8f1ef63f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 8 Sep 2002 19:28:44 +0000 Subject: [PATCH] * automake.in (macro_define): Warn about `:=' assignments. * tests/colneq.test: Check for this warning. --- ChangeLog | 3 +++ automake.in | 7 +++++++ tests/colneq.test | 13 ++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e80295c..83987eb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2002-09-08 Alexandre Duret-Lutz + * automake.in (macro_define): Warn about `:=' assignments. + * tests/colneq.test: Check for this warning. + * automake.texi (Include): Fragments are always distributed. * NEWS: Likewise. diff --git a/automake.in b/automake.in index 4b8f147e..2cbfbad9 100755 --- a/automake.in +++ b/automake.in @@ -6176,6 +6176,13 @@ sub macro_define ($$$$$$) "$var: variable names starting with `_' are not portable") if $var =~ /^_/; + # `:='-style assignments are not acknowledged by POSIX. Moreover it + # has multiple meanings. In GNU make or BSD make it means "assign + # with immediate expansion", while in OSF make it is used for + # conditional assignments. + msg ('portability', $where, "`:='-style assignments are not portable") + if $type eq ':'; + check_variable_expansions ($value, $where); $cond ||= 'TRUE'; diff --git a/tests/colneq.test b/tests/colneq.test index db1d151f..cf4aea9c 100755 --- a/tests/colneq.test +++ b/tests/colneq.test @@ -18,15 +18,22 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -# Test that := definitions work. +# Test that := definitions produce warnings, but otherwise work. . ./defs || exit 1 +set -e + cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = -Wno-portability ICONS := $(wildcard *.xbm) data_DATA = $(ICONS) END -$ACLOCAL || exit 1 +$ACLOCAL +$AUTOMAKE 2> stderr && exit 1 +cat stderr +grep ':=.*not portable' stderr + +echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am $AUTOMAKE +grep 'ICONS :=' Makefile.in -- 2.43.5