2 # Copyright (C) 2002, 2010 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 \
42 ||
{ cat stderr
>&2; Exit
1; }
45 # Lines number are printed in error message.
46 # Use them to make sure errors are diagnosed against the right lines.
48 # No error expected for these lines.
50 grep 2: stderr
&& Exit
1
51 grep 3: stderr
&& Exit
1
54 grep 6: stderr
&& Exit
1
58 grep 10: stderr
&& Exit
1
59 grep 11: stderr
&& Exit
1
60 grep 12: stderr
&& Exit
1
62 # Now check some individual values.
63 grep 'shell echo' stderr
64 grep 'nextvariableisbad' stderr
&& Exit
1
65 grep 'addsuffix' stderr
67 grep 'ok' stderr
&& Exit
1
68 grep 'three errors' stderr
70 grep 'long line' stderr
72 grep 'wildcard' stderr
73 grep 'another error' stderr
74 grep 'thisis' stderr
&& Exit
1
75 grep 'here' stderr
&& Exit
1
77 # None of these errors be diagnosed with -Wno-portability
78 $AUTOMAKE -Wno-portability
80 # Likewise if we add this in the Makefile.am
81 # (although this makes some difference internally: AUTOMAKE_OPTIONS is
82 # processed far later).
83 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am