[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: open MinGW failure
From: |
Simon Josefsson |
Subject: |
Re: open MinGW failure |
Date: |
Tue, 12 Jan 2010 12:16:22 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Removing the mingw* case in the 'case' statement is wrong, because the * case
> executes an AC_CACHE_CHECK which would yield 'no' when cross-compiling to
> mingw
> or natively compiling to mingw via wine but yield 'yes' when natively
> compiling
> to mingw via Cygwin. In other words: The AC_CACHE_CHECK test would yield
> different results depending on the compilation environment, therefore it
> must be bypassed through a 'mingw*' case clause.
>
> pw* should be treated like mingw*, because there's no difference regarding
> target executable format. Both can be executed under Wine.
Thanks -- here is an improved patch I will be using in my projects while
we wait for Wine bugfixing. It may not be perfect, but it works for me.
/Simon
diff --git a/m4/open.m4 b/m4/open.m4
index d705b3a..63ab918 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -9,7 +9,9 @@ AC_DEFUN([gl_FUNC_OPEN],
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
mingw* | pw*)
- gl_REPLACE_OPEN
+ # The misbehaviour is only under Wine, see
+ # http://bugs.winehq.org/show_bug.cgi?id=21292
+ gl_cv_func_open_slash=no
;;
*)
dnl open("foo/") should not create a file when the file name has a
@@ -46,13 +48,13 @@ changequote([,])dnl
])
rm -f conftest.sl conftest.tmp conftest.lnk
])
- case "$gl_cv_func_open_slash" in
- *no)
- AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
- [Define to 1 if open() fails to recognize a trailing slash.])
- gl_REPLACE_OPEN
- ;;
- esac
+ ;;
+ esac
+ case "$gl_cv_func_open_slash" in
+ *no)
+ AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if open() fails to recognize a trailing slash.])
+ gl_REPLACE_OPEN
;;
esac
])