From: Peter Rosin Date: Mon, 27 Sep 2010 18:09:53 +0000 (+0200) Subject: tests: check if sys_lib_search_path_spec works on MSVC. X-Git-Tag: v2.4.2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5bce8258136b2766d349a6451b933efae7b885b;p=thirdparty%2Flibtool.git tests: check if sys_lib_search_path_spec works on MSVC. * tests/sys-lib.at: New test, making sure v2.2.10-207-g09142ea doesn't regress. * Makefile.am (TESTSUITE_AT): Update. Signed-off-by: Peter Rosin --- diff --git a/ChangeLog b/ChangeLog index daa84fc0e..a7aa48943 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-09-27 Peter Rosin + tests: check if sys_lib_search_path_spec works on MSVC. + * tests/search-path.at (sys_lib_search_path on w32): New test, + making sure v2.2.10-207-g09142ea doesn't regress. + Skip need_lib_prefix.at on systems without lib prefix on libraries. * tests/need_lib_prefix.at [MSVC, OS/2]: Skip this test on systems that do not have libraries prefixed with lib. diff --git a/tests/search-path.at b/tests/search-path.at index e765724d4..28df443a3 100644 --- a/tests/search-path.at +++ b/tests/search-path.at @@ -1,7 +1,6 @@ # search-path.at -- test sys_lib_search_path_spec -*- Autotest -*- # -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. -# Written by Ralf Wildenhues, 2006 +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is part of GNU Libtool. # @@ -58,3 +57,41 @@ if $no_libz; then fi AT_CLEANUP + + +AT_SETUP([sys_lib_search_path on w32]) +AT_KEYWORDS([libtool]) + +# Check if libtool knows the path to system libraries. Using +# a w32 system library since the test is designed to check if +# the libtool handling of the sys_lib_search_path variable is +# correct for MSVC. + +LDFLAGS="$LDFLAGS -no-undefined" + +AT_DATA([gc.c], +[[#include +HCURSOR get_cursor (void) +{ + return GetCursor (); +} +]]) + +eval "`$LIBTOOL --config | grep '^build_libtool_libs='`" +AT_CHECK([test "$build_libtool_libs" = yes || exit 77]) + +AT_CHECK([$LIBTOOL --mode=compile --tag=CC \ + $CC $CPPFLAGS $CFLAGS -o gc.lo -c gc.c || exit 77], + [], [ignore], [ignore]) + +# Ok, compile was fine, then it should be possible to link too. + +AT_CHECK([$LIBTOOL --mode=link --tag=CC --tag=disable-static \ + $CC $CFLAGS $LDFLAGS -o libgc.la gc.lo -rpath /nowhere -luser32], + [], [ignore], [ignore]) + +# If -luser32 was found, then libtool will build a shared library, +# otherwise libtool will fall back to creating a static library. +AT_CHECK([grep old_library=\'\' libgc.la], [], [ignore]) + +AT_CLEANUP