tests: avoid two spurious failures on FreeBSD
[automake.git] / t / instdir2.sh
blob638e25a2b31d9211fe5d3afbc68587f2d0fb7e9e
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.sh'.
21 . ./defs || exit 1
23 cat >>configure.ac <<'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 cwd=$(pwd) || fatal_ "getting current working directory"
73 instdir=$cwd/inst
74 destdir=$cwd/dest
75 mkdir build
76 cd build
77 ../configure --prefix="$instdir"
78 $MAKE
80 bindir= datadir= includedir= foodir= bardir= man1dir= man2dir=
81 export bindir datadir includedir foodir bardir man1dir man2dir
83 $MAKE -e install
84 test ! -e "$instdir"
85 $MAKE -e install DESTDIR="$destdir"
86 test ! -e "$instdir"
87 test ! -e "$destdir"
88 $MAKE -e uninstall > stdout || { cat stdout; exit 1; }
89 cat stdout
90 grep 'rm -f' stdout && exit 1
91 $MAKE -e uninstall DESTDIR="$destdir"