2 # Copyright (C) 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 # -Werror and local -Werror settings should be flagged for the user.
23 cat >>configure.in <<\END
24 AC_CONFIG_FILES([sub/Makefile])
29 cat >sub/Makefile.am <<\END
30 AUTOMAKE_OPTIONS = -Werror
34 cat >Makefile.am <<\END
35 AUTOMAKE_OPTIONS = -Werror
42 AUTOMAKE_fails -Wno-error
43 grep 'VAR multiply defined' stderr
44 grep 'SUB multiply defined' stderr
45 test `grep -c 'warnings are treated as errors' stderr` -eq 1
47 sed '/AUTOMAKE_OPTIONS/d' sub/Makefile.am > t
48 mv -f t sub/Makefile.am
50 AUTOMAKE_fails -Wno-error
51 grep 'VAR multiply defined' stderr
52 grep 'SUB multiply defined' stderr
53 test `grep -c 'warnings are treated as errors' stderr` -eq 1
55 sed '/AUTOMAKE_OPTIONS/d' Makefile.am > t
58 AUTOMAKE_fails -Werror
59 grep 'VAR multiply defined' stderr
60 grep 'SUB multiply defined' stderr
61 test `grep -c 'warnings are treated as errors' stderr` -eq 1
63 AUTOMAKE_run 0 -Wno-error
64 grep 'VAR multiply defined' stderr
65 grep 'SUB multiply defined' stderr
66 grep 'warnings are treated as errors' stderr && Exit 1