]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] warnings: remove some obsolete portability warnings
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jan 2012 18:08:08 +0000 (19:08 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jan 2012 19:57:49 +0000 (20:57 +0100)
With this change, we remove some more portability warnings that were
only relevant for non-GNU make implementations.  We also add some
test cases that ensure such warnings stay gone (as improper merges
from master might bring them back), and to ensure the issues they
warned about are actually not present with GNU make.

* automake.in (check_directory): Do not check against directories
named 'obj' (unportable to BSD make).
* tests/objdir.test: New test.
* tests/subdir7.test: Remove as obsolete.
* lib/Automake/Rule.pm (define): Don't warn about ':=' variable
assignments (unportable to e.g., Solaris make).
* tests/vars-assign.test: New test.
* tests/colneq.test: Remove as obsolete.
* tests/colneq3.test: Remove as redundant.
* tests/amopts-variable-expansion.test: Adjust not to assume
occurrences of the obsolete warning anymore.
* tests/warnings-override.test: Likewise.
* tests/warnings-precedence.test: Likewise.
* tests/warnings-strictness-interactions.test: Likewise.
* tests/warnings-win-over-strictness.test: Likewise.
* tests/warning-groups-win-over-strictness.test: Likewise.
* lib/Automake/Rule.pm (define): Don't warn about pattern rules.
Adjust comments.
* tests/percent.test: Remove as obsolete.
* tests/pattern-rules.test: New test.
* tests/percent2.test: Renamed ...
* tests/pattern-rules2.test: ... to this, and adjusted.
* tests/list-of-tests.mk: Adjust.
* NG-NEWS: Update.

18 files changed:
NG-NEWS
automake.in
lib/Automake/Rule.pm
lib/Automake/Variable.pm
tests/amopts-variable-expansion.test
tests/colneq.test [deleted file]
tests/list-of-tests.mk
tests/objdir.test [new file with mode: 0755]
tests/pattern-rules.test [new file with mode: 0755]
tests/pattern-rules2.test [moved from tests/percent2.test with 83% similarity]
tests/percent.test [deleted file]
tests/subdir7.test [deleted file]
tests/vars-assign.test [moved from tests/colneq3.test with 57% similarity]
tests/warning-groups-win-over-strictness.test
tests/warnings-override.test
tests/warnings-precedence.test
tests/warnings-strictness-interactions.test
tests/warnings-win-over-strictness.test

diff --git a/NG-NEWS b/NG-NEWS
index f1b0ec32a964e5cd62b70ad3d2921f26299a91f4..621cd86397e22b01bbcf9cc4041ba6069f813679 100644 (file)
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -44,6 +44,12 @@ Warnings and diagnostic
   - calls to make functions, whether built-in ones like "$(wildcard *.c)"
     or user-defined ones like "$(call my-func, arg1, arg2)".
 
+  - pattern rules in GNU make style ("%.o: %.c").
+
+  - variable definitions with ":=", as in "foo := $(immediate-evaluation)".
+
+  - some issues specific to BSD make.
+
 * The 'portability-recursive' warning category is obsolete, and has been
   removed.
 
index 521d6cf590fd3b2a3efee864b26e74948c10b58b..087c3c00e37e9b2921528154f932ab02e5fa995d 100644 (file)
@@ -3882,26 +3882,6 @@ sub check_directory ($$;$)
   error $where, "required directory $reldir/$dir does not exist"
     unless -d "$reldir/$dir";
 
-  # If an `obj/' directory exists, BSD make will enter it before
-  # reading `Makefile'.  Hence the `Makefile' in the current directory
-  # will not be read.
-  #
-  #  % cat Makefile
-  #  all:
-  #          echo Hello
-  #  % cat obj/Makefile
-  #  all:
-  #          echo World
-  #  % make      # GNU make
-  #  echo Hello
-  #  Hello
-  #  % pmake     # BSD make
-  #  echo World
-  #  World
-  msg ('portability', $where,
-       "naming a subdirectory `obj' causes troubles with BSD make")
-    if $dir eq 'obj';
-
   # `aux' is probably the most important of the following forbidden name,
   # since it's tempting to use it as an AC_CONFIG_AUX_DIR.
   msg ('portability', $where,
index 6d437eda59df5fc4acc37dc2d2943400e783e7b8..f0bfcbbab33cd6caefceb2797394cdf81ae6bca4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2006, 2007, 2010, 2011 Free Software
+# Copyright (C) 2003, 2004, 2006, 2007, 2010, 2011, 2012 Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -625,11 +625,6 @@ sub define ($$$$$)
     }
 
 
-  # A GNU make-style pattern rule has a single "%" in the target name.
-  msg ('portability', $where,
-       "`%'-style pattern rules are a GNU make extension")
-    if $target =~ /^[^%]*%[^%]*$/;
-
   # Diagnose target redefinitions.
   if ($tdef)
     {
@@ -647,8 +642,7 @@ sub define ($$$$$)
          if ($oldowner == RULE_USER)
            {
              # Ignore `%'-style pattern rules.  We'd need the
-             # dependencies to detect duplicates, and they are
-             # already diagnosed as unportable by -Wportability.
+             # dependencies to detect duplicates.
              if ($target !~ /^[^%]*%[^%]*$/)
                {
                  ## FIXME: Presently we can't diagnose duplicate user rules
index beead54ce5cf7301d83cdddb344b47f52e66d3da..f8e8638193827f9825b6be88b87f620ad1ceb91b 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2012 Free
+# Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -804,13 +804,6 @@ sub define ($$$$$$$$)
                               || $pretty == VAR_SILENT
                               || $pretty == VAR_SORTED);
 
-  # `:='-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 ':';
-
   # If there's a comment, make sure it is \n-terminated.
   if ($comment)
     {
index 05fe6c82a3431f30542bfb4bc303aacebd93df95..ade2849d5eb8fb39d4dacf7b759469c245220931 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ AC_CONFIG_FILES([Makefile])
 END
 
 cat > Makefile.am <<'END'
-# The following should expand to `-Wnone -Wno-error foreign -Wportability'.
+# The following should expand to '-Wnone -Wno-error foreign -Wportability'.
 AUTOMAKE_OPTIONS = $(foo) foreign
 AUTOMAKE_OPTIONS += ${bar}
 foo = $(foo1)
@@ -38,14 +38,14 @@ foo2 += $(foo3)
 foo3 = -Wno-error
 bar = -Wportability
 # This will give a warning with `-Wportability'.
-zardoz :=
+.aaa.bbb .ccc.ddd:
 # This would give a warning with `-Woverride'.
 install:
 END
 
 $ACLOCAL
 AUTOMAKE_run
-grep '^Makefile\.am:.*:=.*not portable' stderr
+grep '^Makefile\.am:.*inference rules can have only one target' stderr
 grep README stderr && Exit 1
 $EGREP '(install|override)' stderr && Exit 1
 
diff --git a/tests/colneq.test b/tests/colneq.test
deleted file mode 100755 (executable)
index b60d5c0..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003, 2010, 2011 Free Software
-# Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Test that := definitions produce warnings, but otherwise work.
-
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-ICONS := $(wildcard *.xbm)
-END
-
-$ACLOCAL
-AUTOMAKE_fails
-grep ':=.*not portable' stderr
-
-$AUTOMAKE -Wno-portability
-grep '^ICONS *:= *\$(wildcard \*\.xbm) *$' Makefile.in
-
-:
index 4ee2b365080f8eed7089b658ff38dc8cc25303ce..8f66c26bc44525e9ad546bd4ad67fb03f4569cfc 100644 (file)
@@ -182,9 +182,7 @@ check-concurrency-bug9245.test \
 checkall.test \
 clean.test \
 clean2.test \
-colneq.test \
 colneq2.test \
-colneq3.test \
 colon.test \
 colon2.test \
 colon3.test \
@@ -657,6 +655,7 @@ notrans.test \
 number.test \
 objc.test \
 objc2.test \
+objdir.test \
 objext-pr10128.test \
 obsolete.test \
 oldvars.test \
@@ -679,6 +678,8 @@ override-conditional-1.test \
 override-conditional-2.test \
 override-html.test \
 override-suggest-local.test \
+pattern-rules.test \
+pattern-rules2.test \
 parallel-am.test \
 parallel-am2.test \
 parallel-am3.test \
@@ -753,8 +754,6 @@ test-trs-recover2.test \
 test-extensions.test \
 test-extensions-cond.test \
 parse.test \
-percent.test \
-percent2.test \
 phony.test \
 pluseq.test \
 pluseq2.test \
@@ -948,7 +947,6 @@ subdir3.test \
 subdir4.test \
 subdir5.test \
 subdir6.test \
-subdir7.test \
 subdir8.test \
 subdir9.test \
 subdir10.test \
@@ -1141,6 +1139,7 @@ vala5.test \
 vala-vpath.test \
 vala-mix.test \
 vars.test \
+vars-assign.test \
 vartar.test \
 vartypos.test \
 vartypo2.test \
diff --git a/tests/objdir.test b/tests/objdir.test
new file mode 100755 (executable)
index 0000000..496a425
--- /dev/null
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# A directory named 'obj' could create problems with BSD make, but
+# shouldn't with GNU make; so check that
+#  - the old portability warning diagnosing it is gone, and
+#  - such a directory truly causes no problems with GNU make.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([obj])
+AM_INIT_AUTOMAKE
+AC_REQUIRE_AUX_FILE([Makefile])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+mkdir obj
+cat > obj/Makefile <<'END'
+$(error GNU make should not consider this)
+all:
+       echo "GNU make should not consider this"; exit 1
+END
+
+cat > Makefile.am <<'END'
+check-local:
+       test -f $(srcdir)/obj/Makefile
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+$AUTOCONF
+
+test -f obj/install-sh
+test ! -f install-sh
+
+./configure
+# This first make invocation actually fails with NetBSD make
+# and FreeBSD 8.2 make.
+$MAKE
+$MAKE distcheck
+
+:
diff --git a/tests/pattern-rules.test b/tests/pattern-rules.test
new file mode 100755 (executable)
index 0000000..27c1f53
--- /dev/null
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Automake do not complain about nor messes up pattern rules.
+
+. ./defs || Exit 1
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am <<'END'
+foo/%.out: bar/%.in
+       test -d $(dir $@) || $(MKDIR_P) $(dir $@)
+       cp $< $@
+%.sh: %/z
+       cp $< $@
+%:
+       echo True > $@
+noinst_DATA = foo/one.out
+noinst_SCRIPTS = two.sh mu.py
+END
+
+mkdir bar two
+echo "123456789" > bar/one.in
+echo "#!/bin/sh" > two/z
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+  $srcdir/configure
+  $MAKE
+  diff $srcdir/bar/one.in ./foo/one.out
+  diff $srcdir/two/z ./two.sh
+  test `cat mu.py` = True
+  cd $srcdir
+done
+
+:
similarity index 83%
rename from tests/percent2.test
rename to tests/pattern-rules2.test
index 33cbe9c6d57aecbd742ba853acbc9aae1754e9ce..5b92687e50706366399b8f9999b268d29a221bce 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Another test for -Wportability warning about %-style rules, plus
+# Support for pattern rules:
 # make sure we don't warn about duplicate definition for
 # `${ARCH}/%.$(OBJEXT):'.
 # Report from Ralf Corsepius.
@@ -32,8 +32,4 @@ ${ARCH}/%.$(OBJEXT): %.c
 EOF
 
 $ACLOCAL
-AUTOMAKE_fails
-grep '%.*pattern.*rules' stderr
-
-# No error otherwise.
 $AUTOMAKE -Wno-portability
diff --git a/tests/percent.test b/tests/percent.test
deleted file mode 100755 (executable)
index 492d0e0..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Test to make sure that -Wportability understands %-style pattern
-# rules.
-
-. ./defs || Exit 1
-
-cat >>configure.in <<EOF
-AC_PROG_CC
-EOF
-
-cat >Makefile.am <<EOF
-bin_PROGRAMS = liver
-liver_SOURCES = foo.c
-
-%.o: %.c
-       echo "gnu make extension"
-EOF
-
-$ACLOCAL
-AUTOMAKE_fails -Wportability
-grep 'Makefile.am:4:.*%' stderr
diff --git a/tests/subdir7.test b/tests/subdir7.test
deleted file mode 100755 (executable)
index 28fe024..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002, 2003, 2004, 2010, 2011 Free Software Foundation,
-# Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Naming a subdirectory `obj/' is a bad idea.  Automake should say so.
-
-. ./defs || Exit 1
-
-mkdir obj
-
-cat >>configure.in << 'END'
-AC_CONFIG_FILES([obj/Makefile])
-AC_OUTPUT
-END
-
-: > obj/Makefile.am
-echo 'SUBDIRS = obj' >Makefile.am
-
-$ACLOCAL
-
-AUTOMAKE_fails
-grep 'Makefile.am:1:.*obj.*BSD' stderr
-
-cat >Makefile.am <<'END'
-SUBDIRS = @STH@
-FOO = obj
-DIST_SUBDIRS = $(FOO)
-END
-
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*obj.*BSD' stderr
-
-:
similarity index 57%
rename from tests/colneq3.test
rename to tests/vars-assign.test
index d2f14dd3b42efedd83aecfc1046304c9437adcc1..46bb29ecd56c94a34564da486bb35e96dd5ed652 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test that := definitions work as expected at make time.
+# Automake do not complain about nor messes up GNU make specific
+# variable assignments (":=" and "?=").
 
 . ./defs || Exit 1
 
-cat >> configure.in << 'END'
-AC_OUTPUT
-END
+echo AC_OUTPUT >> configure.in
+
+unset PREFOO FOO BAR BAZ XFOO XBAZ || :
 
-cat > Makefile.am << 'END'
-BAR := $(FOO)
-BAZ = $(FOO)
-FOO := foo
-.PHONY: test
-test:
-       test x'$(FOO)' = x'foo'
-       test x'$(BAZ)' = x'foo'
-       test x'$(BAR)' = x
+cat > Makefile.am <<'END'
+PREFOO = bar
+FOO := foo$(PREFOO)$(XFOO)
+XFOO = fail
+BAR ?= barbar
+
+.PHONY: test1 test2
+test1:
+       test $(FOO) = foobar
+       test $(BAR) = barbar
+test2:
+       test $(FOO) = foobar
+       test $(BAR) = rabrab
 END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
-
+$AUTOMAKE
 ./configure
-$MAKE test
+$MAKE test1
+PREFOO=notseen FOO=notseen BAR=rabrab $MAKE test2
 
 :
index 7e3f526d7a789beebd8376447e7fc7420ed716c5..86728c61a46a2020dbeb7756da621c206e747230 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -39,7 +39,8 @@ END
 
 cat > Makefile.am <<END
 include automake-options.am
-FOO := bar
+.c.o .c.obj:
+       @echo bad
 END
 
 rm -rf autom4te*.cache
@@ -47,7 +48,7 @@ rm -rf autom4te*.cache
 echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4
 $ACLOCAL
 AUTOMAKE_fails -Werror -Wall --foreign
-grep '^Makefile\.am:.*:=.*not portable' stderr
+grep '^Makefile\.am:.*inference rules can have only one target' stderr
 
 rm -rf autom4te*.cache
 : > automake-options.am
index aa7da67c37ef632ba582638131841274c92f6564..73c36a3b327f4677da87382392c5d75397c89d72 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +27,8 @@
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
 
 cat > Makefile.am <<'END'
-FOO := bar
+.c.o .c.obj:
+       @echo bad
 AUTOMAKE_OPTIONS =
 END
 
@@ -49,7 +50,7 @@ ok ()
 ko ()
 {
   AUTOMAKE_fails $*
-  grep '^Makefile\.am:1:.*:=.*not portable' stderr
+  grep '^Makefile\.am:1:.*inference rules can have only one target' stderr
 }
 
 $ACLOCAL
index f191c1a0d7d3f82efe3b00ce15f30aa645451e0c..bd6c2b72d32ac11febbb8e7559b459e94f4b3771 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,7 +24,8 @@
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
 
 cat > Makefile.am <<'END'
-FOO := bar
+.c.o .c.obj:
+       @echo bad
 AUTOMAKE_OPTIONS =
 END
 
@@ -46,7 +47,7 @@ ok ()
 ko ()
 {
   AUTOMAKE_fails $*
-  grep '^Makefile\.am:1:.*:=.*not portable' stderr
+  grep '^Makefile\.am:1:.*inference rules can have only one target' stderr
 }
 
 # Files required in gnu strictness.
index 85669d7c885108bfdae4afc709882e0796ee23a2..1cd557ef568515b0ac9b301251e85f6bc1fb2d9f 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,7 +25,8 @@ AUTOMAKE="$am_original_AUTOMAKE -Werror"
 
 cat > Makefile.am <<END
 AUTOMAKE_OPTIONS =
-FOO := bar
+.c.o .c.obj:
+       @echo bad
 END
 
 set_am_opts ()
@@ -54,6 +55,6 @@ set_am_opts 'gnu' Makefile.am
 
 AUTOMAKE_fails
 $ACLOCAL
-grep '^Makefile\.am:2:.*:=.*not portable' stderr
+grep '^Makefile\.am:2:.*inference rules can have only one target' stderr
 
 :
index a577dfeb10c9b63d08150d3eff788a85c8c2eb78..cf8e6f23dd1dca75a3a958a00cb5fe4a63101891 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ ok ()
 ko ()
 {
   AUTOMAKE_run $*
-  grep '^Makefile\.am:.*:=.*not portable' stderr
+  grep '^Makefile\.am:.*inference rules can have only one target' stderr
   test `wc -l <stderr` -eq 1
 }
 
@@ -50,7 +50,8 @@ touch README INSTALL NEWS AUTHORS ChangeLog COPYING
 
 cat > Makefile.am <<END
 AUTOMAKE_OPTIONS =
-FOO := bar
+.c.o .c.obj:
+       @echo bad
 END
 
 $ACLOCAL