From: Charles Wilson Date: Mon, 29 Jun 2009 01:51:42 +0000 (-0400) Subject: [mingw] Improve sys_lib_search_path_spec detection. X-Git-Tag: v2.2.7b~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0f99955cb283ead0817744921621d66c049709f;p=thirdparty%2Flibtool.git [mingw] Improve sys_lib_search_path_spec detection. * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Fix handling of dos-style paths when parsing $CC -print-search-dirs output. --- diff --git a/ChangeLog b/ChangeLog index 2b7ba3ed2..321c0bbeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +2009-06-29 Charles Wilson + + [mingw] Improve sys_lib_search_path_spec detection. + * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Fix handling + of dos-style paths when parsing $CC -print-search-dirs output. + 2009-06-28 Charles Wilson Finish adding alias for obsoleted AC_LIBTOOL_RC macro. - * libltdl/m4/libtool.m4: Add reminder comment concerning aclocal-1.4 backwards compatibility. * libltdl/m4/lt~obsolete.m4: Remove unnecessary AC_DEFUN. diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 1fe09d27c..b6862a063 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'