2 # Copyright (C) 2011 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 interactions between the `portability-recursive' and
18 # `extra-portability' warning categories.
24 # We want (almost) complete control over automake options.
25 # FIXME: use $original_AUTOMAKE here once we are merged into master.
26 AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
28 cat >>configure.in <<END
36 cat >Makefile.am <<'END'
38 lib_LIBRARIES = libfoo.a
39 libfoo_a_SOURCES = foo.c
42 # 'extra-portability' implies 'portability-recursive'.
43 AUTOMAKE_fails -Wextra-portability
44 grep 'requires.*AM_PROG_AR' stderr
45 grep 'recursive variable expansion' stderr
47 # We can disable 'extra-portability' while leaving
48 # 'portability-recursive' intact.
49 AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
50 grep 'requires.*AM_PROG_AR' stderr && Exit 1
51 grep 'recursive variable expansion' stderr
53 # We can disable 'portability-recursive' while leaving
54 # 'extra-portability' intact.
55 AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
56 grep 'requires.*AM_PROG_AR' stderr
57 grep 'recursive variable expansion' stderr && Exit 1
59 # Disabling 'portability' disables 'portability-recursive' and
60 # 'extra-portability'.
61 $AUTOMAKE -Wextra-portability -Wno-portability