]> sourceware.org Git - automake.git/commitdiff
* automake.in (macro_define): Warn about `:=' assignments.
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 8 Sep 2002 19:28:44 +0000 (19:28 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 8 Sep 2002 19:28:44 +0000 (19:28 +0000)
* tests/colneq.test: Check for this warning.

ChangeLog
automake.in
tests/colneq.test

index 5e80295c7efa7f1e56be513708236beadd7a3ade..83987eb0cd88202ed54fe0ef4f2fc672e3207a6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2002-09-08  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
+       * automake.in (macro_define): Warn about `:=' assignments.
+       * tests/colneq.test: Check for this warning.
+
        * automake.texi (Include): Fragments are always distributed.
        * NEWS: Likewise.
 
index 4b8f147e131ac6f9ac031707abcefddd6854f7fb..2cbfbad9cdd044d8080008aa33569bd7161a7584 100755 (executable)
@@ -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';
index db1d151fe8cebff91ac28700a2e5d26eba8157dd..cf4aea9c0eab465cda4ef487aa2dff6ed369e484 100755 (executable)
 # 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
This page took 0.042898 seconds and 5 git commands to generate.