2 # Copyright (C) 2002 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check that Automake warns about variables containing spaces
18 # and other non-POSIX characters.
24 cat >Makefile.am
<<'EOF'
26 L02 = $$(not an error)
27 L03 = $$(this is)$${ok too}
28 L04 = $(nextvariableisbad)$(addsuffix .a, $(A))
31 L07 = ${three errors}${on this} $(long line)
32 L08$(o u c h): $(wildcard *.c)
40 # Make sure this warning is print in the `portability' category.
41 $AUTOMAKE --warnings=no-error
,none
,portability
2>stderr
44 # Lines number are printed in error message.
45 # Use them to make sure errors are diagnosed against the right lines.
47 # No error expected for these lines.
49 grep 2: stderr
&& Exit
1
50 grep 3: stderr
&& Exit
1
53 grep 6: stderr
&& Exit
1
57 grep 10: stderr
&& Exit
1
58 grep 11: stderr
&& Exit
1
59 grep 12: stderr
&& Exit
1
61 # Now check some individual values.
62 grep 'shell echo' stderr
63 grep 'nextvariableisbad' stderr
&& Exit
1
64 grep 'addsuffix' stderr
66 grep 'ok' stderr
&& Exit
1
67 grep 'three errors' stderr
69 grep 'long line' stderr
71 grep 'wildcard' stderr
72 grep 'another error' stderr
73 grep 'thisis' stderr
&& Exit
1
74 grep 'here' stderr
&& Exit
1
76 # None of these errors be diagnosed with -Wno-portability
77 $AUTOMAKE -Wno-portability
79 # Likewise if we add this in the Makefile.am
80 # (although this makes some difference internally: AUTOMAKE_OPTIONS is
81 # processed far later).
82 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am