[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] [mingw] Improve sys_lib_search_path_spec detection.
From: |
Charles Wilson |
Subject: |
[PATCH] [mingw] Improve sys_lib_search_path_spec detection. |
Date: |
Sun, 28 Jun 2009 21:51:42 -0400 |
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Fix handling
of dos-style paths when parsing $CC -print-search-dirs output.
---
It appears that this particular behavior has been broken for quite some time.
Currently, libtool mangles $CC -print-search-dirs badly on mingw:
sys_lib_search_path_spec=" =c /mingw/bin/../lib/gcc/mingw32/4.4.0-dw2/;c
/mingw/bin/../lib/gcc/;/usr/lib/gcc/mingw32/4.4.0-dw2/;c
/mingw/bin/../lib/gcc/mingw32/4.4.0-dw2/../../../../mingw32/lib/mingw32/4.4.0-dw2/;c
/mingw/bin/../lib/gcc/mingw32/4.4.0-dw2/../../../../mingw32/lib/;c
/mingw/bin/../lib/gcc/mingw32/4.4.0-dw2/../../../mingw32/4.4.0-dw2/;c
/mingw/bin/../lib/gcc/mingw32/4.4.0-dw2/../../../;/mingw/lib/mingw32/4.4.0-dw2/;/mingw/lib/"
with the attached patch:
sys_lib_search_path_spec="c:/mingw/lib/gcc/mingw32/4.4.0-dw2 c:/mingw/lib/gcc
c:/mingw/mingw32/lib c:/mingw/lib /mingw/lib "
Furthermore, as the old code destroyed the earlier (multilib-capable) version of
sys_lib_search_path_spec and replaced it with the broken version (line 2181
below),
by moving the special handling for dos-style paths up the the multilib-handling
area, we may -- MAY -- see some benefits with regards to mingw64/mingw32
multilib
behavior. That's just a guess, tho.
Currently running regression tests on MSYS-1.0.12 + mingw-4.4.0-dw2 (TDM
version).
OK to push, if no regressions from earlier behavior on mingw?
--
Chuck
libltdl/m4/libtool.m4 | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 1fe09d2..b6862a0 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1986,7 +1986,11 @@ if test "$GCC" = yes; then
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e
"s/^libraries://" -e "s,=/,/,g"`
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e
"s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
*\;*)
# if the path contains ";" then we assume it to be the separator
@@ -2031,6 +2035,12 @@ BEGIN {RS=" "; FS="/|\n";} {
if (lt_foo != "") { lt_freq[[lt_foo]]++; }
if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
@@ -2178,21 +2188,6 @@ m4_if([$1], [],[
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e
's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | $SED
'/^libraries:/!d; s///; s,=/,/,g'`
- case $sys_lib_search_path_spec in
- *\;[c-zC-Z]:*)
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e
's/;/ /g'`
- ;;
- *)
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e
"s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
--
1.6.1.2
- [PATCH] [mingw] Improve sys_lib_search_path_spec detection.,
Charles Wilson <=