news: describe recently-fixed bug in vala support
[platform/upstream/automake.git] / tests / instdir-ltlib.test
1 #! /bin/sh
2 # Copyright (C) 2009  Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # If $(libdir) is the empty string, then nothing should be installed there.
18 # This test exercises the libtool code paths.
19
20 required=libtoolize
21 . ./defs || Exit 1
22
23 set -e
24
25 cat >>configure.in <<'END'
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 AC_PROG_LIBTOOL
29 AC_OUTPUT
30 END
31
32 mkdir sub
33
34 cat >Makefile.am <<'END'
35 AUTOMAKE_OPTIONS = subdir-objects
36 bin_PROGRAMS = p
37 nobase_bin_PROGRAMS = np sub/np
38 lib_LTIBRARIES = libfoo.la
39 nobase_lib_LTLIBRARIES = libnfoo.la sub/libnfoo.la
40 END
41
42 cat >p.c <<'END'
43 int main () { return 0; }
44 END
45 cp p.c np.c
46 cp p.c sub/np.c
47 cp p.c libfoo.c
48 cp p.c libnfoo.c
49 cp p.c sub/libnfoo.c
50
51 libtoolize
52 $ACLOCAL
53 $AUTOCONF
54 $AUTOMAKE --add-missing
55
56 instdir=`pwd`/inst
57 destdir=`pwd`/dest
58 mkdir build
59 cd build
60 ../configure --prefix="$instdir"
61 $MAKE
62
63 bindir= libdir=
64 export bindir libdir
65 $MAKE -e install
66 test ! -d "$instdir"
67 $MAKE -e install DESTDIR="$destdir"
68 test ! -d "$instdir"
69 test ! -d "$destdir"
70 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
71 cat stdout
72 grep 'rm -f' stdout && Exit 1
73 $MAKE -e uninstall DESTDIR="$destdir"
74 :