]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
[mingw] Improve sys_lib_search_path_spec detection.
authorCharles Wilson <libtool@cwilson.fastmail.fm>
Mon, 29 Jun 2009 01:51:42 +0000 (21:51 -0400)
committerCharles Wilson <libtool@cwilson.fastmail.fm>
Tue, 30 Jun 2009 00:44:57 +0000 (20:44 -0400)
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Fix handling
of dos-style paths when parsing $CC -print-search-dirs output.

ChangeLog
libltdl/m4/libtool.m4

index 2b7ba3ed2406f07479336663a128a6b65da6ab1f..321c0bbeb723bbca39529f85158c35e272c9e8fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
+2009-06-29  Charles Wilson  <libtool@cwilson.fastmail.fm>
+
+       [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  <libtool@cwilson.fastmail.fm>
 
        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.
index 1fe09d27c03141fadd73b27ec9d0ce2f49a3335c..b6862a063f99d07b272352e4e59563ee30b061a0 100644 (file)
@@ -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'