[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: check if sys_lib_search_path_spec works on MSVC.
From: |
Peter Rosin |
Subject: |
Re: [PATCH] tests: check if sys_lib_search_path_spec works on MSVC. |
Date: |
Mon, 27 Sep 2010 20:19:46 +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 Ralf,
Den 2010-09-27 19:55 skrev Ralf Wildenhues:
> * Peter Rosin wrote on Mon, Sep 27, 2010 at 04:37:17PM CEST:
>> Ok to push? Passes with MSVC, MinGW/gcc and Cygwin/gcc. If I trivially
>> break the compile step, it skips as designed.
>
> Interesting. If it were late in the release cycle, I'd be a bit wary
> of this patch without a fair amount of system testing, but since we're
> fairly early I think we should try it, with nits below addressed.
Ok.
> Please do merge the test into the tests/search-path.at file though
> (if it helps you you can remove my author tag from it, or add yourself)
> and name it "sys_lib_search_path on w32" or so.
I'll just remove your tag.
> A couple of questions below.
>
> Thanks,
> Ralf
>
>> 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.
>
>
>> +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)])
>
> No need for the subshell for exit 77.
Yes, I saw the inconsistency with the below check after posting, but
didn't know which were correct and hoped for the reviewer to also
notice and give me that answer. Then I wrote about my updated
ChangeLog, but forgot to also ask explicitly. Thanks!
>> +AT_CHECK([$LIBTOOL --mode=compile --tag=CC --tag=disable-static \
>> + $CC $CPPFLAGS $CFLAGS -o gc.lo -c gc.c || exit 77],
>> + [], [ignore], [ignore])
>
> Why the --tag=disable-static here?
Don't know really. I'll remove it.
>> +# 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.
>
> Will creating a static library work if you used --tag=disable-static
> above?
Yes. At least on w32 which is why the below check is needed. I tested
that prior to the first post by s/-luser32/-lnononono/ and I did get a
static library.
>> +AT_CHECK([grep old_library=\'\' libgc.la], [], [ignore])
>> +AT_CLEANUP
Pushed as below, thanks for the review!
Cheers,
Peter
>From c5bce8258136b2766d349a6451b933efae7b885b Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Mon, 27 Sep 2010 20:09:53 +0200
Subject: [PATCH] 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 <address@hidden>
---
ChangeLog | 4 ++++
tests/search-path.at | 41 +++++++++++++++++++++++++++++++++++++++--
2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index daa84fc..a7aa489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-09-27 Peter Rosin <address@hidden>
+ 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 e765724..28df443 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 <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
--
1.7.1