news: describe recently-fixed bug in vala support
[platform/upstream/automake.git] / tests / instfail-libtool.test
1 #! /bin/sh
2 # Copyright (C) 2008  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 # The install rule should honor failures of the install program.
18 # Some of these are already caught by instmany.test.
19
20 # This is the libtool sister test of instfail.test
21
22 required='libtool libtoolize'
23 . ./defs || Exit 1
24
25 set -e
26
27 cat >>configure.in <<END
28 AC_PROG_LIBTOOL
29 AC_OUTPUT
30 END
31
32 cat >Makefile.am <<'END'
33 bin_PROGRAMS = prog1 prog2 prog3
34 nobase_bin_PROGRAMS = progn1 progn2 progn3
35 lib_LTLIBRARIES = liblt1.la liblt2.la liblt3.la
36 nobase_lib_LTLIBRARIES = libltn1.la libltn2.la libltn3.la
37 unreadable-prog:
38         chmod a-r prog1$(EXEEXT)
39 readable-prog:
40         chmod a+r prog1$(EXEEXT)
41 unreadable-progn:
42         chmod a-r progn1$(EXEEXT)
43 readable-progn:
44         chmod a+r progn1$(EXEEXT)
45 END
46
47 for n in 1 2 3; do
48   echo "int main () { return 0; }" > prog$n.c
49   echo "int main () { return 0; }" > progn$n.c
50   echo "int foolt$n () { return 0; }" > liblt$n.c
51   echo "int fooltn$n () { return 0; }" > libltn$n.c
52 done
53
54 libtoolize
55 $ACLOCAL
56 $AUTOCONF
57 $AUTOMAKE --add-missing
58
59 instdir=`pwd`/inst
60 ./configure --prefix="$instdir"
61 $MAKE
62
63 $MAKE install
64 $MAKE uninstall
65
66 for file in liblt1.la libltn1.la
67 do
68   chmod a-r $file
69   test ! -r $file || Exit 77
70   $MAKE install-exec && Exit 1
71   chmod u+r $file
72 done
73
74 $MAKE unreadable-prog
75 $MAKE install-exec && Exit 1
76 $MAKE readable-prog
77
78 $MAKE unreadable-progn
79 $MAKE install-exec && Exit 1
80 $MAKE readable-progn
81
82 :