1 # duplicate_members.at -- duplicate members in archive tests -*- Autotest -*-
3 # Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
4 # Written by Alexandre Oliva & Peter O'Gorman, 2005
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([duplicate members in archive tests])
26 AT_KEYWORDS([libtool])
28 # we don't want to use whole_archive_flag_spec, even if available
29 sed -e 's|^whole_archive_flag_spec=.*|whole_archive_flag_spec=|g' < $LIBTOOL > libtool
35 [[extern int foo1 (), foo2 (), foo3 (), foo4 (), foo5 (), foo6 ();
37 int result = foo1 () + foo2 () + foo3 () + foo4 () + foo5 () + foo6 ();
46 if (bar() == 21) return 0;
55 echo "int foo$a() {return $a;}" > $a/a.c
61 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o $a/a.lo $a/a.c
63 $LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libc0.la 6/a.lo
64 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libconv.la ]dnl
65 [1/a.lo 2/a.lo 3/a.lo 4/a.lo 5/a.lo libc0.la], [], [ignore], [ignore])
67 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o bar.lo bar.c
68 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbar.la ]dnl
69 [ bar.lo libconv.la -rpath /notexist], [], [ignore], [ignore])
71 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o main.lo main.c
72 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main$EXEEXT ]dnl
73 [main.lo ./libbar.la], [], [ignore], [ignore])
75 LT_AT_EXEC_CHECK([./main],[0],[ignore],[ignore])