1 # dmacks.at -- test for dmacks bug -*- Autotest -*-
3 # Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc.
4 # Written by Peter O'Gorman, 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.
26 AT_SETUP([static library contains static library])
27 AT_KEYWORDS([libtool])
29 # This test passes with MS lib.
30 AT_XFAIL_IF([case $AR in ar-lib\ * | *[[/\\]]ar-lib\ *) false;; *) :;; esac])
34 int foo() { return 1;}
39 int bar() { return 1;}
43 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o foo.lo foo.c
44 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o bar.lo bar.c
45 $LIBTOOL --mode=link --tag=CC --tag=disable-shared $CC $CFLAGS $LDFLAGS \
46 -o libfoo.la foo.lo -version-info 1:0:0 -rpath $thisdir
47 $LIBTOOL --mode=install cp libfoo.la $thisdir
48 eval `$EGREP '^(old_library)=' < libfoo.la`
50 AT_CHECK([$LIBTOOL --mode=link --tag=CC --tag=disable-shared $CC $CFLAGS $LDFLAGS \
51 -o libbar.la bar.lo $libfoo -version-info 1:0:0 -rpath $thisdir],
52 [], [ignore], [ignore])
53 AT_CHECK([$LIBTOOL --mode=install cp libbar.la $thisdir], [], [ignore], [ignore])
54 eval `$EGREP '^(old_library)=' < libbar.la`
56 AT_CHECK([$AR -t $libbar | grep $libfoo],[1],[ignore],[ignore])
57 AT_CHECK([$AR -t $libbar | grep foo.$OBJEXT],[],[ignore],[ignore])
58 AT_CHECK([$AR -t $libbar | grep bar.$OBJEXT],[],[ignore],[ignore])