* configure.in: Bump version to 1.5b.
[automake.git] / tests / cond3.test
blob053e779765f1a9c6bd230b877fe937fa5517b1fc
1 #! /bin/sh
3 # Test sources listed in conditional.
4 # Report from Rob Savoye <rob@cygnus.com>, and Lars J. Aas.
6 . $srcdir/defs || exit 1
8 cat > configure.in << 'END'
9 AC_INIT
10 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
11 AC_PROG_CC
12 AM_CONDITIONAL(ONE, true)
13 AM_CONDITIONAL(TWO, false)
14 AM_CONDITIONAL(THREE, maybe)
15 AC_OUTPUT(Makefile)
16 END
18 cat > Makefile.am << 'END'
19 bin_PROGRAMS = targ
21 if ONE
22 SONE = one.c
23 else
24 SONE =
25 endif
27 if TWO
28 STWO = two.c
29 else
30 STWO =
31 endif
33 if THREE
34 STHREE = three.c
35 else
36 STHREE =
37 endif
39 targ_SOURCES = $(SONE) $(STWO) $(STHREE)
40 END
42 $ACLOCAL || exit 1
43 $AUTOMAKE || exit 1
45 # `b top' so that
46 sed -n '
47 /[oO][bB][jJ][eE][cC][tT].* =/ {
48 : loop
49 /\\$/ {
52 b loop
55 }' Makefile.in >produced
57 cat >expected << 'EOF'
58 @ONE_TRUE@am__objects_1 = one.$(OBJEXT)
59 @ONE_FALSE@am__objects_1 =
60 @TWO_TRUE@am__objects_2 = two.$(OBJEXT)
61 @TWO_FALSE@am__objects_2 =
62 @THREE_TRUE@am__objects_3 = three.$(OBJEXT)
63 @THREE_FALSE@am__objects_3 =
64 am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3)
65 targ_OBJECTS = $(am_targ_OBJECTS)
66 EOF
68 diff expected produced || exit 1