libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: check if sys_lib_search_path_spec works on MSVC.


From: Peter Rosin
Subject: [PATCH] tests: check if sys_lib_search_path_spec works on MSVC.
Date: Mon, 27 Sep 2010 16:37:17 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

Hi!

Ok to push? Passes with MSVC, MinGW/gcc and Cygwin/gcc. If I trivially
break the compile step, it skips as designed.

Cheers,
Peter

>From 7a3874ef05fcdb58c23b563c80c2dc63a64c0e2f Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Mon, 27 Sep 2010 16:33:14 +0200
Subject: [PATCH] tests: check if sys_lib_search_path_spec works on MSVC.

* tests/sys-lib.at: New test, catching regressions in
v2.2.10-207-g09142ea.
* Makefile.am (TESTSUITE_AT): Update.

Signed-off-by: Peter Rosin <address@hidden>
---
 ChangeLog        |    5 ++++
 Makefile.am      |    1 +
 tests/sys-lib.at |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100755 tests/sys-lib.at

diff --git a/ChangeLog b/ChangeLog
index daa84fc..269c6d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-09-27  Peter Rosin  <address@hidden>
 
+       tests: check if sys_lib_search_path_spec works on MSVC.
+       * tests/sys-lib.at: New test, catching regressions in
+       v2.2.10-207-g09142ea.
+       * Makefile.am (TESTSUITE_AT): Update.
+
        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/Makefile.am b/Makefile.am
index 6e29a29..6ad1912 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -460,6 +460,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/static.at \
                  tests/export.at \
                  tests/search-path.at \
+                 tests/sys-lib.at \
                  tests/indirect_deps.at \
                  tests/archive-in-archive.at \
                  tests/exeext.at \
diff --git a/tests/sys-lib.at b/tests/sys-lib.at
new file mode 100755
index 0000000..d976354
--- /dev/null
+++ b/tests/sys-lib.at
@@ -0,0 +1,58 @@
+# sys-lib.at -- test if libtool finds system libraries        -*- Autotest -*-
+#
+#   Copyright (C) 2010 Free Software Foundation, Inc.
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+# 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.
+
+AT_SETUP([sys_lib])
+AT_KEYWORDS([libtool])
+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 --tag=disable-static \
+         $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
-- 
1.7.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]