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., 51 Franklin Street, Fifth Floor,
|
---|
19 | # Boston, MA 02110-1301, 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 |
|
---|
33 | set -e
|
---|
34 |
|
---|
35 | echo AC_PROG_CC >>configure.in
|
---|
36 |
|
---|
37 | cat >Makefile.am <<EOF
|
---|
38 | bin_PROGRAMS = a
|
---|
39 | a02_LDADD =
|
---|
40 | a03_SOURCES =
|
---|
41 | EOF
|
---|
42 |
|
---|
43 | for 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
|
---|
44 | cat >>Makefile.am <<EOF
|
---|
45 | if C$i
|
---|
46 | bin_PROGRAMS += a$i
|
---|
47 | a01_LDADD = foo${i}.o
|
---|
48 | a02_LDADD += bar${i}.o
|
---|
49 | a03_SOURCES += baz${i}.c
|
---|
50 | a04_SOURCES = quux${i}.c
|
---|
51 | endif C$i
|
---|
52 | EOF
|
---|
53 | echo "AM_CONDITIONAL([C$i], [:])" >>configure.in
|
---|
54 | done
|
---|
55 |
|
---|
56 | $ACLOCAL
|
---|
57 | $AUTOMAKE
|
---|