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