2 # Copyright (C) 2003-2012 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 2, or (at your option)
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 # Check that many conditions do not lead to combinatorial explosion.
18 # (This is related to PR/352.)
22 echo AC_PROG_CC
>>configure.
in
24 cat >Makefile.am
<<EOF
30 # On this test, Automake 1.7.x would compute all 2**24 = 16777216
31 # possible combinations of conditionals (it would do this five times,
32 # to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
33 # a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
34 # or cpu time it can found.
35 # Limit memory available to spawned processes to ~ 150 MB. Considering
36 # that 70 MB is enough for x86_64 Fedora 16, that gives tools and
37 # libraries plenty of room to grow. Suggested by Jim Meyering in
39 (ulimit -v 1; sh
-c ":") && skip_
"no adequate 'ulimit' builtin found"
40 (ulimit -v 150000; sh
-c ":") || skip_
"no adequate 'ulimit' builtin found"
44 01 02 03 04 05 06 07 08 09 10 \
45 11 12 13 14 15 16 17 18 19 20 \
48 unindent
>>Makefile.am
<<EOF
52 a02_LDADD += bar${i}.o
53 a03_SOURCES += baz${i}.c
54 a04_SOURCES = quux${i}.c
57 echo "AM_CONDITIONAL([C$i], [:])" >>configure.
in