Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / cond21.test
blobfd997c232bea802b7b81fab3b2ccfe431bea0f49
1 #! /bin/sh
2 # Copyright (C) 2002, 2005 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 3, 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 <http://www.gnu.org/licenses/>.
17 # Check for use of = and += in different conditions.
19 . ./defs || Exit 1
21 cat >> configure.in << 'END'
22 AC_PROG_CC
23 AM_CONDITIONAL(COND1, true)
24 AM_CONDITIONAL(COND2, true)
25 AM_CONDITIONAL(COND3, true)
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
31 FOO = foo
32 if COND1
33 FOO += foo1
34 else
35 FOO += foon1
36 endif
37 if COND2
38 FOO += foo2
39 else
40 FOO += foon2
41 endif
42 if COND1
43 FOO += foo1b
44 else
45 FOO += foon1b
46 endif
48 if COND1
49 if COND2
50 BAR = bar12
51 else
52 BAR = bar1n2
53 endif
54 else
55 BAR = barn1
56 endif
58 BAR += bar
60 if COND3
61 BAR += bar3
62 endif
64 test:
65 @echo BAR: $(BAR) :BAR
66 @echo FOO: $(FOO) :FOO
67 END
69 set -e
71 $ACLOCAL
72 $AUTOCONF
73 $AUTOMAKE -a
74 ./configure
75 $MAKE test | $FGREP 'BAR: bar12 bar bar3 :BAR'
76 $MAKE test | $FGREP 'FOO: foo foo1 foo2 foo1b :FOO'