Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / install.at
1 # install.at -- install mode tests             -*- Autotest -*-
2 #
3 #   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
4 #   Written by Ralf Wildenhues, 2008
5 #
6 #   This file is part of GNU Libtool.
7 #
8 # GNU Libtool is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
12 #
13 # GNU Libtool is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Libtool; see the file COPYING.  If not, a copy
20 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 # or obtained by writing to the Free Software Foundation, Inc.,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ####
24
25 AT_SETUP([Install tests])
26 AT_KEYWORDS([libtool])
27
28 # Ensure that install_override_mode overrides the mode of the shared
29 # library (and only the shared library).
30
31 AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
32          [], [ignore])
33 sed 's,^\(install_override_mode\)=.*,\1=755,' < $LIBTOOL > ./libtool
34 LIBTOOL=./libtool
35 chmod a+rx $LIBTOOL
36
37 inst=`pwd`/inst
38 mkdir inst
39
40 echo 'int a () { return 0; }' > a.c
41 $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c
42 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo ]dnl
43          [-rpath $inst -no-undefined], [], [ignore], [ignore])
44 AT_CHECK([$LIBTOOL --mode=install $lt_INSTALL liba.la $inst],
45          [], [stdout], [ignore])
46 AT_CHECK([grep ' -m 755' stdout], [], [ignore])
47 AT_CHECK([$LIBTOOL --mode=install $lt_INSTALL -m 644 liba.la $inst],
48          [], [stdout], [ignore])
49 AT_CHECK([grep ' -m 755' stdout], [], [ignore])
50 AT_CHECK([grep ' -m 644.*liba.la' stdout], [], [ignore])
51
52 AT_CLEANUP