tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / amopts-variable-expansion.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Check that AUTOMAKE_OPTIONS support variable expansion.
18
19 . test-init.sh
20
21 # We want complete control over automake options.
22 AUTOMAKE=$am_original_AUTOMAKE
23
24 cat > configure.ac <<END
25 AC_INIT([$me], [1.0])
26 AM_INIT_AUTOMAKE([-Wall -Werror gnu])
27 AC_CONFIG_FILES([Makefile])
28 END
29
30 cat > Makefile.am <<'END'
31 # The following should expand to '-Wnone -Wno-error foreign -Wportability'.
32 AUTOMAKE_OPTIONS = $(foo) foreign
33 AUTOMAKE_OPTIONS += ${bar}
34 foo = $(foo1)
35 foo1 = ${foo2}
36 foo2 = -Wnone
37 foo2 += $(foo3)
38 foo3 = -Wno-error
39 bar = -Wportability
40 # This will give a warning with '-Wportability'.
41 zardoz :=
42 # This would give a warning with '-Woverride'.
43 install:
44 END
45
46 $ACLOCAL
47 AUTOMAKE_run
48 grep '^Makefile\.am:.*:=.*not portable' stderr
49 grep README stderr && exit 1
50 $EGREP '(install|override)' stderr && exit 1
51
52 :