Fix grammaros.
[automake/plouj.git] / tests / cond5.test
blob2f968bf1f52df0f5440ecbaa885fadbdb8676051
1 #! /bin/sh
2 # Copyright (C) 1998, 1999, 2001, 2002 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 # Yet another sources-in-conditional test. Report from Tim Goodwin.
19 . ./defs || exit 1
21 cat > configure.in << 'END'
22 AC_INIT
23 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
24 AC_PROG_CC
25 AM_CONDITIONAL(ONE, true)
26 AM_CONDITIONAL(TWO, false)
27 AC_OUTPUT(Makefile)
28 END
30 cat > Makefile.am << 'END'
31 bin_PROGRAMS = targ
33 if ONE
34 OPT_SRC = one.c
35 endif
37 if TWO
38 OPT_SRC = $(OPT_SRC) two.c
39 endif
41 targ_SOURCES = main.c $(OPT_SRC)
42 END
44 # The bug is that automake hangs. So we give it a few seconds and
45 # then kill it.
46 $ACLOCAL || exit 1
47 $AUTOMAKE &
48 pid=$!
50 sleep 60
51 kill -0 $pid && {
52 kill $pid
53 exit 1
55 exit 0