2 # Copyright (C) 2008-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 # Ensure an error with inconsistent state of conditionals in configure.ac.
18 # This shouldn't happen with user input, as _AM_COND_* are not documented,
19 # but better to be safe.
23 cat >>configure.ac <<'END'
24 AM_CONDITIONAL([COND], [:])
25 # The next line is needed so that cond-if.m4 is pulled in.
33 sed "$@" < configure.ac >configure.int
34 mv -f configure.int configure.ac
35 rm -rf autom4te*.cache
42 grep '^configure\.ac:8:.* condition stack' stderr
44 edit_configure_in 's/_AM_COND_IF/_AM_COND_ELSE/'
46 grep '^configure\.ac:7:.* else without if' stderr
48 edit_configure_in 's/_AM_COND_ELSE/_AM_COND_ENDIF/'
50 grep '^configure\.ac:7:.* endif without if' stderr
52 edit_configure_in 's/\(_AM_COND_ENDIF\).*/_AM_COND_IF\
55 grep '^configure\.ac:7:.* not enough arguments.* _AM_COND_IF' stderr
56 grep '^configure\.ac:8:.* not enough arguments.* _AM_COND_ENDIF' stderr
57 test 2 = `grep -c 'not enough arguments' stderr`