1 # runpath-in-lalib.at -- -*- Autotest -*-
3 # Copyright (C) 2007, 2008 Free Software Foundation, Inc.
4 # Written by Ralf Wildenhues, 2007
6 # This file is part of GNU Libtool.
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.
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.
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.
25 AT_SETUP([Runpath in libtool library files])
26 AT_KEYWORDS([libtool])
29 [[int a () { return 0; }
33 int b () { return a (); }
37 int main () { return b (); }
43 addrunpath=`pwd`/foobar
45 mkdir $instdir $libdir $bindir
47 for file in a.c b.c; do
48 $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file
50 $CC $CPPFLAGS $CFLAGS -c m.c
51 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo -rpath $libdir -R$addrunpath],
52 [], [ignore], [ignore])
53 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libb.la b.lo -rpath $libdir liba.la],
54 [], [ignore], [ignore])
55 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o m$EXEEXT m.$OBJEXT libb.la],
56 [], [ignore], [ignore])
57 AT_CHECK([$LIBTOOL --mode=install cp liba.la $libdir/liba.la], [], [ignore], [ignore])
58 AT_CHECK([$LIBTOOL --mode=install cp libb.la $libdir/libb.la], [], [ignore], [ignore])
59 AT_CHECK([$LIBTOOL --mode=install cp m$EXEEXT $bindir/m$EXEEXT], [], [ignore], [ignore])
61 AT_CHECK([grep /foobar $libdir/liba.la], [], [ignore])
62 AT_CHECK([grep /foobar $libdir/libb.la], [], [ignore])
64 # TODO: check that m gets -R, too.