1 # duplicate_members.at -- duplicate members in archive tests -*- Autotest -*-
3 # Copyright (C) 2005, 2007-2009, 2011-2019, 2021-2024 Free Software
5 # Written by Alexandre Oliva & Peter O'Gorman, 2005
7 # This file is part of GNU Libtool.
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING. If not, a copy
21 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 AT_SETUP([duplicate members in archive tests])
27 AT_KEYWORDS([libtool])
29 # we don't want to use whole_archive_flag_spec, even if available
30 $SED -e 's|^whole_archive_flag_spec=.*|whole_archive_flag_spec=|g' < $LIBTOOL > libtool
36 [[extern int foo1 (), foo2 (), foo3 (), foo4 (), foo5 (), foo6 ();
38 int result = foo1 () + foo2 () + foo3 () + foo4 () + foo5 () + foo6 ();
47 if (bar() == 21) return 0;
56 echo "int foo$a() {return $a;}" > $a/a.c
62 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o $a/a.lo $a/a.c
64 $LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libc0.la 6/a.lo
65 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libconv.la ]dnl
66 [1/a.lo 2/a.lo 3/a.lo 4/a.lo 5/a.lo libc0.la], [], [ignore], [ignore])
68 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o bar.lo bar.c
69 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbar.la ]dnl
70 [ bar.lo libconv.la -rpath /notexist], [], [ignore], [ignore])
72 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o main.lo main.c
73 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main$EXEEXT ]dnl
74 [main.lo ./libbar.la], [], [ignore], [ignore])
76 LT_AT_EXEC_CHECK([./main],[0],[ignore],[ignore])