source: trunk/essentials/sys-devel/automake-1.7/tests/cond21.test

Last change on this file was 3120, checked in by bird, 18 years ago

automake 1.7.9

File size: 1.7 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
6# GNU Automake is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# GNU Automake is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with autoconf; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20
21# Check for use of = and += in different conditions.
22
23. ./defs || exit 1
24
25cat >> configure.in << 'END'
26AC_PROG_CC
27AM_CONDITIONAL(COND1, true)
28AM_CONDITIONAL(COND2, true)
29AM_CONDITIONAL(COND3, true)
30AC_OUTPUT
31END
32
33cat > Makefile.am << 'END'
34
35FOO = foo
36if COND1
37 FOO += foo1
38else
39 FOO += foon1
40endif
41if COND2
42 FOO += foo2
43else
44 FOO += foon2
45endif
46## Note that we add `foo1b' after `foo2'; however because it is appended in
47## the same condition as `foo1', it should use the same helper variable
48## and thus appear right after `foo1' in the output.
49if COND1
50 FOO += foo1b
51else
52 FOO += foon1b
53endif
54
55if COND1
56if COND2
57 BAR = bar12
58else
59 BAR = bar1n2
60endif
61else
62 BAR = barn1
63endif
64
65BAR += bar
66
67if COND3
68 BAR += bar3
69endif
70
71test:
72 @echo BAR: $(BAR) :BAR
73 @echo FOO: $(FOO) :FOO
74END
75
76set -e
77
78$ACLOCAL
79$AUTOCONF
80$AUTOMAKE -a
81./configure
82$MAKE test | $FGREP 'BAR: bar12 bar bar3 :BAR'
83$MAKE test | $FGREP 'FOO: foo foo1 foo1b foo2 :FOO'
Note: See TracBrowser for help on using the repository browser.