* automake.in (scan_aclocal_m4): Define ACLOCAL_M4 even in
[automake.git] / tests / cond3.test
blobfed0d0dcb9f9f1f924c898fce94acc972a6bc480
1 #! /bin/sh
2 # Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
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.
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.
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.
21 # Test sources listed in conditional.
22 # Report from Rob Savoye <rob@cygnus.com>, and Lars J. Aas.
24 . ./defs || exit 1
26 cat > configure.in << 'END'
27 AC_INIT
28 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
29 AC_PROG_CC
30 AM_CONDITIONAL(ONE, true)
31 AM_CONDITIONAL(TWO, false)
32 AM_CONDITIONAL(THREE, maybe)
33 AC_OUTPUT(Makefile)
34 END
36 cat > Makefile.am << 'END'
37 bin_PROGRAMS = targ
39 if ONE
40 SONE = one.c
41 else
42 SONE =
43 endif
45 if TWO
46 STWO = two.c
47 else
48 STWO =
49 endif
51 if THREE
52 STHREE = three.c
53 else
54 STHREE =
55 endif
57 targ_SOURCES = $(SONE) $(STWO) $(STHREE)
58 END
60 $ACLOCAL || exit 1
61 $AUTOMAKE || exit 1
63 # `b top' so that
64 sed -n '
65 /[oO][bB][jJ][eE][cC][tT].* =/ {
66 : loop
67 /\\$/ {
70 b loop
73 }' Makefile.in >produced
75 cat >expected << 'EOF'
76 @ONE_TRUE@am__objects_1 = one.$(OBJEXT)
77 @ONE_FALSE@am__objects_1 =
78 @TWO_TRUE@am__objects_2 = two.$(OBJEXT)
79 @TWO_FALSE@am__objects_2 =
80 @THREE_TRUE@am__objects_3 = three.$(OBJEXT)
81 @THREE_FALSE@am__objects_3 =
82 am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3)
83 targ_OBJECTS = $(am_targ_OBJECTS)
84 EOF
86 diff expected produced || exit 1