]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
tests: check if sys_lib_search_path_spec works on MSVC.
authorPeter Rosin <peda@lysator.liu.se>
Mon, 27 Sep 2010 18:09:53 +0000 (20:09 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Mon, 27 Sep 2010 18:09:53 +0000 (20:09 +0200)
* 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 <peda@lysator.liu.se>
ChangeLog
tests/search-path.at

index daa84fc0ed5e0876b699c54e568c3c77ba66aee2..a7aa4894387dfa06b18738690ca4f64ffd35ea28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-09-27  Peter Rosin  <peda@lysator.liu.se>
 
+       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.
index e765724d45d2dd2245609802003f3ee92d856d8c..28df443a3a32acf121218648d83053ef9ea77926 100644 (file)
@@ -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 <windows.h>
+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