tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / extra-portability3.sh
blob621a12ee904ea4342ce21c9110c564f1620337b6
1 #! /bin/sh
2 # Copyright (C) 2011-2018 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Check interactions between the 'portability-recursive' and
18 # 'extra-portability' warning categories.
20 . test-init.sh
22 # We want (almost) complete control over automake options.
23 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
25 cat >>configure.ac <<END
26 AC_PROG_CC
27 AC_PROG_RANLIB
28 AC_OUTPUT
29 END
31 $ACLOCAL
33 cat >Makefile.am <<'END'
34 baz = $(foo$(bar))
35 lib_LIBRARIES = libfoo.a
36 libfoo_a_SOURCES = foo.c
37 END
39 # 'extra-portability' implies 'portability-recursive'.
40 AUTOMAKE_fails -Wextra-portability
41 grep 'requires.*AM_PROG_AR' stderr
42 grep 'recursive variable expansion' stderr
44 # We can disable 'extra-portability' while leaving
45 # 'portability-recursive' intact.
46 AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
47 grep 'requires.*AM_PROG_AR' stderr && exit 1
48 grep 'recursive variable expansion' stderr
50 # We can disable 'portability-recursive' while leaving
51 # 'extra-portability' intact.
52 AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
53 grep 'requires.*AM_PROG_AR' stderr
54 grep 'recursive variable expansion' stderr && exit 1
56 # Disabling 'portability' disables 'portability-recursive' and
57 # 'extra-portability'.
58 $AUTOMAKE -Wextra-portability -Wno-portability