1 # search-path.at -- test sys_lib_search_path_spec -*- Autotest -*-
3 # Copyright (C) 2006, 2008, 2010 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 AT_SETUP([sys_lib_search_path])
25 AT_KEYWORDS([libtool])
26 LDFLAGS="$LDFLAGS -no-undefined"
40 $CC $CPPFLAGS $CFLAGS -c main.c
41 eval `$LIBTOOL --config | $EGREP '^(sys_lib_search_path_spec)='`
42 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
44 for path in $sys_lib_search_path; do
45 if $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main$EXEEXT main.$OBJEXT -L$path -lz
47 AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main$EXEEXT main.$OBJEXT -lz],
48 [], [ignore], [ignore])
54 # If -lz doesn't exist (hello, cross compiler!), we need a dummy test.
62 AT_SETUP([sys_lib_search_path on w32])
63 AT_KEYWORDS([libtool])
65 # Check if libtool knows the path to system libraries. Using
66 # a w32 system library since the test is designed to check if
67 # the libtool handling of the sys_lib_search_path variable is
70 LDFLAGS="$LDFLAGS -no-undefined"
73 [[#include <windows.h>
74 HCURSOR get_cursor (void)
80 eval "`$LIBTOOL --config | grep '^build_libtool_libs='`"
81 AT_CHECK([test "$build_libtool_libs" = yes || exit 77])
83 AT_CHECK([$LIBTOOL --mode=compile --tag=CC \
84 $CC $CPPFLAGS $CFLAGS -o gc.lo -c gc.c || exit 77],
85 [], [ignore], [ignore])
87 # Ok, compile was fine, then it should be possible to link too.
89 AT_CHECK([$LIBTOOL --mode=link --tag=CC --tag=disable-static \
90 $CC $CFLAGS $LDFLAGS -o libgc.la gc.lo -rpath /nowhere -luser32],
91 [], [ignore], [ignore])
93 # If -luser32 was found, then libtool will build a shared library,
94 # otherwise libtool will fall back to creating a static library.
95 AT_CHECK([grep old_library=\'\' libgc.la], [], [ignore])