Merge branch 'yacc-quote-fix'
[automake.git] / tests / instdir2.test
blob1c6035739ac1faeb608514d9e9e4cf94ad2b20ec
1 #! /bin/sh
2 # Copyright (C) 2009-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)
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 # If $(foodir) is the empty string, then nothing should be installed there.
18 # This test ensures this also if $(foo_PRIMARY) is nonempty, see
19 # instdir.test.
21 . ./defs || Exit 1
23 cat >>configure.in <<'END'
24 AC_SUBST([foodir], ['${datadir}'/foo])
25 AC_OUTPUT
26 END
28 mkdir sub
30 cat >Makefile.am <<'END'
31 bin_SCRIPTS = s
32 nobase_bin_SCRIPTS = ns sub/ns
33 data_DATA = d
34 nobase_data_DATA = nd sub/nd
35 include_HEADERS = h
36 nobase_include_HEADERS = nh sub/nh
37 foo_DATA = f
38 nobase_foo_DATA = nf sub/nf
39 bardir = $(datadir)/bar
40 bar_DATA = b
41 nobase_bar_DATA = nb sub/nb
42 man1_MANS = m1.1
43 man_MANS = m.2
44 notrans_man1_MANS = nm1.1
45 notrans_man_MANS = nm.2
46 END
48 : >s
49 : >ns
50 : >sub/ns
51 : >d
52 : >nd
53 : >sub/nd
54 : >h
55 : >nh
56 : >sub/nh
57 : >f
58 : >nf
59 : >sub/nf
60 : >b
61 : >nb
62 : >sub/nb
63 : >m1.1
64 : >m.2
65 : >nm1.1
66 : >nm.2
68 $ACLOCAL
69 $AUTOCONF
70 $AUTOMAKE --add-missing
72 instdir=`pwd`/inst
73 destdir=`pwd`/dest
74 mkdir build
75 cd build
76 ../configure --prefix="$instdir"
77 $MAKE
79 bindir= datadir= includedir= foodir= bardir= man1dir= man2dir=
80 export bindir datadir includedir foodir bardir man1dir man2dir
82 $MAKE -e install
83 test ! -d "$instdir"
84 $MAKE -e install DESTDIR="$destdir"
85 test ! -d "$instdir"
86 test ! -d "$destdir"
87 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
88 cat stdout
89 grep 'rm -f' stdout && Exit 1
90 $MAKE -e uninstall DESTDIR="$destdir"