TIVI-153: Adding automake14 as dep for iputils package
[profile/ivi/automake14.git] / tests / cond5.test
1 #! /bin/sh
2
3 # Yet another sources-in-conditional test.  Report from Tim Goodwin.
4
5 . $srcdir/defs || exit 1
6
7 cat > configure.in << 'END'
8 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
9 AC_PROG_CC
10 AM_CONDITIONAL(ONE, true)
11 AM_CONDITIONAL(TWO, false)
12 AC_OUTPUT(Makefile)
13 END
14
15 cat > Makefile.am << 'END'
16 bin_PROGRAMS = targ
17
18 if ONE
19 OPT_SRC = one.c
20 endif
21
22 if TWO
23 OPT_SRC = $(OPT_SRC) two.c
24 endif
25
26 targ_SOURCES = main.c $(OPT_SRC)
27 END
28
29 # The bug is that automake hangs.  So we give it a few seconds and
30 # then kill it.
31 $AUTOMAKE &
32 pid=$!
33
34 sleep 5
35 kill -0 $pid && {
36    kill $pid
37    exit 1
38 }
39 exit 0