tests: make 'lzip.test' executable
[automake.git] / tests / cond37.test
bloba4ae07875b9dd2774c0f7d84067ee0016af91b7a
1 #!/bin/sh
2 # Copyright (C) 2004 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)
7 # any later version.
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 conditional local rules.
18 # Report from Simon Josefsson.
20 . ./defs || Exit 1
22 set -e
24 cat >>configure.in <<'EOF'
25 AM_CONDITIONAL([CASE_A], test -n "$case_A")
26 AC_OUTPUT
27 EOF
29 cat >>Makefile.am <<'EOF'
30 if CASE_A
31 check-local:
32 @echo GrepMe1
33 else
34 install-data-local:
35 @echo GrepMe2
36 endif
37 EOF
39 $ACLOCAL
40 $AUTOCONF
41 $AUTOMAKE
43 ./configure
44 $MAKE check >stdout
45 cat stdout
46 grep GrepMe1 stdout && Exit 1
47 $MAKE install >stdout
48 cat stdout
49 grep GrepMe2 stdout
51 ./configure case_A=1
52 $MAKE check >stdout
53 cat stdout
54 grep GrepMe1 stdout
55 $MAKE install >stdout
56 cat stdout
57 grep GrepMe2 stdout && Exit 1