Merge branch 'minor'
[automake.git] / t / instdir.sh
blobe29167d6100dd5c9210a7a39f426c3939c11934f
1 #! /bin/sh
2 # Copyright (C) 2009-2017 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 <https://www.gnu.org/licenses/>.
17 # If $(foodir) is the empty string, then nothing should be installed there.
18 # This test only ensures this if $(foo_PRIMARY) is also empty, see
19 # 'instdir2.sh' and siblings 'instdir-*.sh' for nonempty contents.
21 . test-init.sh
23 cat >>configure.ac <<'END'
24 AC_SUBST([foodir], ['${datadir}'/foo])
25 AC_OUTPUT
26 END
28 cat >Makefile.am <<'END'
29 bin_SCRIPTS =
30 nobase_bin_SCRIPTS =
31 data_DATA =
32 nobase_data_DATA =
33 include_HEADERS =
34 nobase_include_HEADERS =
35 foo_DATA =
36 nobase_foo_DATA =
37 bardir = $(datadir)/bar
38 bar_DATA =
39 nobase_bar_DATA =
40 man1_MANS =
41 man_MANS =
42 notrans_man1_MANS =
43 notrans_man_MANS =
44 END
46 $ACLOCAL
47 $AUTOCONF
48 $AUTOMAKE --add-missing
50 cwd=$(pwd) || fatal_ "getting current working directory"
51 instdir=$cwd/inst
52 destdir=$cwd/dest
53 mkdir build
54 cd build
55 ../configure --prefix="$instdir"
56 $MAKE
58 nulldirs='bindir= datadir= includedir= foodir= bardir= man1dir= man2dir='
59 null_install