libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] [mingw] fix cross-compile-with-wine case


From: Charles Wilson
Subject: Re: [PATCH] [mingw] fix cross-compile-with-wine case
Date: Sun, 01 Jun 2008 09:36:13 -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

Ralf Wildenhues wrote:
Hi Charles,

* Charles Wilson wrote on Sat, May 31, 2008 at 07:11:58PM CEST:
* libltdl/config/ltmain.m4sh (func_to_host_path)
[host=mingw, build!=mingw|cygwin]: check that winepath
stdout is non-empty and exit code is 0, instead of checking
stderr.
Reported by: Roumen Petrov

OK, thanks!

+               test -n "${func_to_host_path_tmp1}" ; then

You could simplfify these four lines to
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
            if test $? -eq 0 && test -n "${func_to_host_path_tmp1}"; then

if the exit status isn't important to you for debugging purposes.

You're right. As pushed (with email addresses redacted), below. Note that I fixed the date on the the most recent commit (it's June 1, not May 1).

--
Chuck
To: address@hidden
From: Charles Wilson <address@hidden>
Date: Sat, 31 May 2008 13:11:58 -0400
Subject: [PATCH] [mingw] fix cross-compile-with-wine case
Cc: address@hidden

* libltdl/config/ltmain.m4sh (func_to_host_path)
[host=mingw, build!=mingw|cygwin]: check that winepath
stdout is non-empty and exit code is 0, instead of checking
stderr.
Reported by: Roumen Petrov
---
Following the discussion here:
http://lists.gnu.org/archive/html/libtool-patches/2008-05/msg00087.html
and Roumen's tests, this seems like an obvious fix. Test suite 
passes with no regressions on cygwin (not that this patch affects
cygwin, but it confirms that no silly syntax errors crept in).

Ok to push (preferably before any 2.2.6 release)?
Chuck

 libltdl/config/ltmain.m4sh |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 144bc76..44e36de 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2555,17 +2555,21 @@ func_to_host_path ()
             ;;
           * )
             # 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`
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
             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" |\
+               test -n "${func_to_host_path_tmp1}" ; then
+              func_to_host_path_result=`echo "$func_to_host_path_tmp1"|\
                 $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=""
             fi
             ;;
         esac
-- 
1.5.5.1


reply via email to

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