source: trunk/essentials/sys-devel/automake-1.8/tests/cond29.test

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

automake 1.8.5

File size: 1.7 KB
Line 
1#!/bin/sh
2# Copyright (C) 2003 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 Automake; 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# Check that many conditions do not lead to combinatorial explosion.
22# (This is related to PR/352.)
23#
24# On this test, Automake 1.7.x would compute all 2**22 = 4194304
25# possible combinations of conditionals (it would do this five times,
26# to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
27# a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
28# or cpu time it can found. Although this test won't print `FAIL' if
29# it fails, it will take long enough so it can't go unnoticed.
30
31. ./defs
32
33set -e
34
35echo AC_PROG_CC >>configure.in
36
37cat >Makefile.am <<EOF
38bin_PROGRAMS = a
39a02_LDADD =
40a03_SOURCES =
41EOF
42
43for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22; do
44cat >>Makefile.am <<EOF
45if C$i
46bin_PROGRAMS += a$i
47a01_LDADD = foo${i}.o
48a02_LDADD += bar${i}.o
49a03_SOURCES += baz${i}.c
50a04_SOURCES = quux${i}.c
51endif C$i
52EOF
53echo "AM_CONDITIONAL([C$i], [:])" >>configure.in
54done
55
56$ACLOCAL
57$AUTOMAKE
Note: See TracBrowser for help on using the repository browser.