libtool-patches
[Top][All Lists]
Advanced

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

Re: [patch #6448] [MSVC 7/7] Add MSVC Support


From: Peter Rosin
Subject: Re: [patch #6448] [MSVC 7/7] Add MSVC Support
Date: Thu, 07 Aug 2008 14:10:41 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Peter Rosin skrev:
Ralf Wildenhues skrev:
* Peter Rosin wrote on Mon, Aug 04, 2008 at 03:51:29PM CEST:
Ralf Wildenhues skrev:
I've reformatted tests/nocase.at a bit, and sprinkled in more AT_CHECKs
because the test fails for me on a GNU/Linux -> MinGW cross compile
(using i586-mingw32msvc-gcc):

libFOO is found but -lfoo is not rewritten to -lFoo. I don't know if it
should be, but either the test or the implementation needs fixing.
Test works fine on the MSYS/MSVC pair. I suspect if fails bacause the
build system FS is case sensitive? Cross compile is not my top priority.

Well, I certainly don't think we need to put much work in supporting a
cross compile setup where MSVC is the compiler.  However, that is not
what I was writing about: the above is a (quite widely used) GCC cross
that runs on GNU/Linux and produces code for w32, using MSYS stub
libraries and so on.  It's not nice to introduce a new test failure for
this setup.

That being said, I'm open to whether the code or the test should be
fixed, or the test should simply be skipped in this case.  Ideally we
should take into account that Windows shares may be mounted on unixy
systems as well, such that maybe there is some benefit to be had from
nocase support.  (OTOH, I have little experience with such setups;
maybe the testsuite test would actually succeed there?  Then a skip
on a case-sensitive system seems appropriate to me)

Ah, ok. That's bad. The misleading name i586-mingw32msvc-gcc caught
me. Again. What in the world is "msvc" doing in there?

Just to reiterate the underlying reason for this code, MSVC has a bunch
of system libs named e.g. DDRAW.LIB, while MinGW has the corresponding
import library as libddraw.dll.a. So, the libtool user can't use a
single canonical name (-lDDRAW and -lddraw are equally correct). At the
same time libtool has code that needs to find the exact file, this code
needs to be made case insensitive for things to work smoothly.

So, I don't think the benefit is all that great on unixy systems, since
there wouldn't be any question as to whether -lFoo or -lfoo is
correct.

To fix the test failure on the MinGW cross compile, it might be enough
to disable the nocase stuff in libtool.m4 for cross compiles (take the
default branch in the case $host_os statement, near the end of
_LT_CHECK_MAGIC_METHOD). This should cause a skip of the offending
test.

Like this patch. Can you verify if it works for i586-mingw32msvc-gcc?

Cheers,
Peter

2008-08-07  Peter Rosin  <address@hidden>

        * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Disable nocase
        handling for cross compiles.

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 37c0f71..ccd541a 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3237,21 +3237,19 @@ tpf*)
 esac
 ])
 
-case $host_os in
-cygwin* | mingw* | pw32*)
-  if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-    file_magic_glob=
-    want_nocaseglob=yes
-  else
-    file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ 
| $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-    want_nocaseglob=no
-  fi
-  ;;
-*)
-  file_magic_glob=
-  want_nocaseglob=no
-  ;;
-esac
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo 
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e 
"s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
 
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method

reply via email to

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