libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] [mingw] Add cross-compile support to cwrapper


From: Charles Wilson
Subject: Re: [PATCH] [mingw] Add cross-compile support to cwrapper
Date: Sun, 25 May 2008 16:50:32 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666

Roumen Petrov wrote:
Charles Wilson wrote:
By this do you mean 'push to the git repo'?

yes (push/commit/put/add in head/trunk/origin/master/main branch)

Attached see additional patch that implements the workaround for winepath's shortcomings. This patch should be applied on top of the existing patch that started this thread.

However, it's just here for historical interest. I'm planning to push the entire revised and rebased patch as soon as my computer finishes running the testsuite. I'll post the full, as-pushed, version of the patch at that time.

--
Chuck
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 197920c..b47389a 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2513,7 +2513,7 @@ func_emit_wrapper ()
 
 # func_to_host_path arg
 #
-# Convert paths to build format when used with build tools.
+# Convert paths to host format when used with build tools.
 # Intended for use with "native" mingw (where libtool itself
 # is running under the msys shell), or in the following cross-
 # build environments:
@@ -2554,7 +2554,15 @@ func_to_host_path ()
               $SED -e "$lt_sed_naive_backslashify"`
             ;;
           * )
-            if winepath -h >/dev/null 2>&1 ; then
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check stderr for an
+            # error message. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127. So we
+            # must check for both, which explains the odd construction:
+            func_to_host_path_winepath_stderr=`winepath -w "$1" >/dev/null 
2>&1`
+            func_to_host_path_winepath_exitcode=$?
+            if test "$func_to_host_path_winepath_exitcode" -eq 0 &&\
+               test -z "${func_to_host_path_winepath_stderr}" ; then
               func_to_host_path_tmp1=`winepath -w "$1"`
               func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
                 $SED -e "$lt_sed_naive_backslashify"`
@@ -2565,6 +2573,8 @@ func_to_host_path ()
           func_error "Could not determine host path corresponding to"
           func_error "  '$1'"
           func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
         fi
         ;;
     esac
@@ -2574,7 +2584,7 @@ func_to_host_path ()
 
 # func_to_host_pathlist arg
 #
-# Convert pathlists to build format when used with build tools.
+# Convert pathlists to host format when used with build tools.
 # See func_to_host_path(), above. This function supports the
 # following $build/$host combinations (but does no harm for
 # combinations not listed here):
@@ -2602,6 +2612,8 @@ func_to_host_pathlist ()
         # ARG. msys behavior is inconsistent here, cygpath turns them
         # into '.;' and ';.', and winepath ignores them completely.
         func_to_host_pathlist_tmp2="$1"
+        # Once set for this call, this variable should not be
+        # reassigned. It is used in tha fallback case.
         func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
           $SED -e 's|^:*||' -e 's|:*$||'`
         case $build in
@@ -2644,6 +2656,14 @@ func_to_host_pathlist ()
           func_error "Could not determine the host path(s) corresponding to"
           func_error "  '$1'"
           func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
         fi
         # Now, add the leading and trailing path separators back
         case "$1" in

reply via email to

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