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

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

automake 1.7.9

File size: 1.9 KB
Line 
1#! /bin/sh
2# Copyright (C) 1997, 1998, 1999, 2001, 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# Test sources listed in conditional.
22# Report from Rob Savoye <rob@cygnus.com>, and Lars J. Aas.
23
24. ./defs || exit 1
25
26cat > configure.in << 'END'
27AC_INIT
28AM_INIT_AUTOMAKE(nonesuch, nonesuch)
29AC_PROG_CC
30AM_CONDITIONAL(ONE, true)
31AM_CONDITIONAL(TWO, false)
32AM_CONDITIONAL(THREE, maybe)
33AC_OUTPUT(Makefile)
34END
35
36cat > Makefile.am << 'END'
37bin_PROGRAMS = targ
38
39if ONE
40SONE = one.c
41else
42SONE =
43endif
44
45if TWO
46STWO = two.c
47else
48STWO =
49endif
50
51if THREE
52STHREE = three.c
53else
54STHREE =
55endif
56
57targ_SOURCES = $(SONE) $(STWO) $(STHREE)
58END
59
60$ACLOCAL || exit 1
61$AUTOMAKE || exit 1
62
63# `b top' so that
64sed -n '
65/[oO][bB][jJ][eE][cC][tT].* =/ {
66 : loop
67 /\\$/ {
68 p
69 n
70 b loop
71 }
72 p
73}' Makefile.in >produced
74
75cat >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 =
82am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3)
83targ_OBJECTS = $(am_targ_OBJECTS)
84EOF
85
86diff expected produced || exit 1
Note: See TracBrowser for help on using the repository browser.