[Top][All Lists]

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

Re: problem: sys_lib_search_path_spec for MinGW

From: Guido Draheim
Subject: Re: problem: sys_lib_search_path_spec for MinGW
Date: Fri, 21 Dec 2001 10:04:46 +0100

Es schrieb Jon Leichter:
>         Cygwin sets this variable to the global default:
>                 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
>         MinGW executes the following command:
>             sys_lib_search_path_spec=`$CC -print-search-dirs | grep 
> "^libraries:" |
> sed -e "s/^libraries://" -e "s/;/ /g"`
> Here's the problem: Cygwin GCC can be used to produce "cygwin" OR "mingw"
> binaries. It depends on whether or not it was given the -mno-cygwin switch.
> Furthermore, Cygwin GCC will return the same output for
> the -print-search-dirs switch whether or not the -mno-cygwin switch is

for about two months, there is a patch on my disk to solve the 
sys_lib_search_path_spec problemarea once and for all. But I did
see that it needs some extra communications and I did not just
have the time to do it.  (and I do not really have now...)

As a hint: the idea came from the various discussions to support to
crosscompile dlls from linux to mingw32. A couple of problems about
the pathseperator arised, and it was noted that we can make a 
generic guess from the existance of ";" in the searchpaths. Then
another problem occured where we wanted to crosscompile from one
linux-system to another variant, and the linker did find the wrong
libraries. Checking into the thing, and it became obvious that it
would help here again to use the "gcc -print-search-dirs" output
as the sys_lib_search_path instead of some hardcoded path that there
is all around in libtool. When you follow this idea, you will notice
that it would be a good idea to use the "gcc -print-search-dirs" for
all gcc-based compilejobs, or atleast for all crosscompiling builds.

Therefore, just move the "-print-search-dirs" stuff out of mingw-case 
to just below the big case-statement, and have a check for $GCC, and
to be safe, for crosscompiling. Note that the task to use a cygwin
toolchain to make a mingw target happens to be a crosscompilie setup,
just as it is with a linux system crosscompiling for a different
linux flavour. To use a "print-search-dirs" with all gcc/cross
combinations should be fine idea - for cross-linux builds, I am 
almost sure it is without problems, but you say whether it is also
safe for the cygwin->mingw case. Does the configure-test say that
it is a crosscompile setup or does it not? (I did not run a cygwin
toolchain for quite a time...)

-- guido                          
GCS/E/S/P C++$++++ ULHS L++w- N++@ d(+-) s+a- r+@>+++ y++ 5++X- (geekcode)

reply via email to

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