1 # deplibs-mingw.at -- -*- Autotest -*-
3 # Copyright (C) 2010-2019, 2021-2024 Free Software Foundation, Inc.
5 # This file is part of GNU Libtool.
7 # GNU Libtool is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of
10 # the License, or (at your option) any later version.
12 # GNU Libtool is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Libtool; see the file COPYING. If not, a copy
19 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
20 # or obtained by writing to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 # Check that deplibs are detected correctly even if there is no 'file'
27 AT_SETUP([deplibs without file command])
28 AT_KEYWORDS([libtool])
35 LDFLAGS="$LDFLAGS -no-undefined"
37 mkdir inst inst/bin inst/lib
40 [[int a () { return 0; }
44 int b () { return a (); }
47 for file in a.c b.c; do
48 $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file
50 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo -rpath $libdir],
51 [], [ignore], [ignore])
52 AT_CHECK([library_names= && . ./liba.la && if test -z "$library_names"; then exit 77; fi ],
53 [], [ignore], [ignore])
54 AT_CHECK([$LIBTOOL --mode=install cp liba.la $libdir], [], [ignore], [ignore])
55 AT_CHECK([$LIBTOOL --mode=clean rm -f liba.la], [], [ignore], [ignore])
58 # check once with 'file' (if present) and once without, if on MinGW.
59 for try in with-file without-file; do
60 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libb.la b.lo -rpath $libdir ]dnl
62 [], [ignore], [ignore])
63 AT_CHECK([library_names= && . ./libb.la && if test -z "$library_names"; then exit 99; fi ],
64 [], [ignore], [ignore])
76 PATH=`pwd`/bin${PATH_SEPARATOR-:}$PATH
78 # configure might fail due to in-tree build of toplevel, or
79 # missing configure flags and other reasons.
81 LT_AT_CONFIGURE([|| exit 77], ["$abs_top_srcdir"/configure])
82 LDFLAGS="$LDFLAGS -no-undefined"
84 LIBTOOL=new-libtool/libtool
86 # Check whether the generated script is usable; otherwise, skip.
87 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libunrelated.la a.lo -rpath $libdir] dnl
88 [|| exit 77], [], [ignore], [ignore])