news: describe recently-fixed bug in vala support
[platform/upstream/automake.git] / tests / nobase-libtool.test
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008  Free Software
3 # Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Make sure nobase_* works for libtool libraries and programs as well.
19 # This is just the libtool equivalent of nobase.test, split
20 # up for greater exposure of nobase.test.
21
22 required='libtoolize gcc'
23 . ./defs || Exit 1
24
25 set -e
26
27 cat >> configure.in <<'EOF'
28 AC_PROG_CC
29 AC_PROG_LIBTOOL
30 AC_OUTPUT
31 EOF
32
33 cat > Makefile.am << 'EOF'
34 fooexecdir = $(prefix)/foo
35 fooexec_LTLIBRARIES = sub/libbase.la
36 nobase_fooexec_LTLIBRARIES = sub/libnobase.la
37 fooexec_PROGRAMS = sub/base
38 nobase_fooexec_PROGRAMS = sub/nobase
39 sub_libbase_la_SOURCES = source2.c
40 sub_libnobase_la_SOURCES = source2.c
41 sub_base_SOURCES = source.c
42 sub_nobase_SOURCES = source.c
43
44 test-install-data: install-data
45         test ! -f inst/foo/sub/libnobase.la
46         test ! -f inst/foo/libbase.la
47
48 test-install-exec: install-exec
49         test   -f inst/foo/sub/libnobase.la
50         test ! -f inst/foo/libnobase.la
51         test   -f inst/foo/libbase.la
52 EOF
53
54 mkdir sub
55
56 cat >source.c <<'EOF'
57 int
58 main (int argc, char *argv[])
59 {
60   return 0;
61 }
62 EOF
63 cp source.c source2.c
64
65 rm -f install-sh
66
67 libtoolize
68 $ACLOCAL
69 $AUTOCONF
70 $AUTOMAKE -a --copy
71 ./configure --prefix "`pwd`/inst" --program-prefix=p
72
73 $MAKE
74 $MAKE test-install-data
75 $MAKE test-install-exec
76 $MAKE uninstall
77
78 test `find inst/foo -type f -print | wc -l` = 0
79
80 $MAKE install-strip
81
82 # Likewise, in a VPATH build.
83
84 $MAKE uninstall
85 $MAKE distclean
86 mkdir build
87 cd build
88 ../configure --prefix "`pwd`/inst" --program-prefix=p
89 $MAKE
90 $MAKE test-install-data
91 $MAKE test-install-exec
92 $MAKE uninstall
93 test `find inst/foo -type f -print | wc -l` = 0