Implement conditional AC_CONFIG_FILES: AM_COND_IF.
[automake/ericb.git] / tests / transform.test
blob68c5bed5adab785b4fd625b8b58656b4c1435ba4
1 #! /bin/sh
2 # Copyright (C) 2002, 2003, 2004, 2007 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 3, 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 # Make sure that --program-transform works.
19 required=gcc
20 . ./defs || exit 1
22 set -e
24 cat >>configure.in <<'END'
25 AC_PROG_CC
26 AC_OUTPUT
27 END
29 cat >Makefile.am <<'EOF'
30 bin_PROGRAMS = h
31 bin_SCRIPTS = h.sh
32 man_MANS = h.1
34 test-install: install
35 test -f inst/bin/gnu-h$(EXEEXT)
36 test -f inst/bin/gnu-h.sh
37 test -f inst/man/man1/gnu-h.1
38 EOF
40 cat >h.c <<'EOF'
41 int
42 main ()
44 return 0;
46 EOF
48 : > h.sh
49 : > h.1
51 $ACLOCAL
52 $AUTOCONF
53 $AUTOMAKE
55 ./configure --program-prefix=gnu- --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
56 $MAKE
57 $MAKE test-install
58 $MAKE uninstall
59 test `find inst/foo -type f -print | wc -l` = 0
61 # Opportunistically test for installdirs.
62 rm -rf inst
63 $MAKE installdirs
64 test -d inst/bin
65 test -d inst/man/man1