configuring wine under mingw

David Fraser davidf at
Fri Oct 11 08:56:05 CDT 2002

When running configure on wine under mingw, I had problems creating 
secure temporary directories...
The configure code has two options for creating a secure temporary 
If the first method fails the second is used.
The difficulty with the first one is that mktemp returns a Windows-style 
("C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cscP2080") instead of a Unix-style 
one (/tmp/cscP2080)
Since the backslashes are not escaped this then causes problems later 
when the temporary path is passed to sed
as it cannot find C:DOCUME~1ADMINI~1LOCALS~1TempcscP2080/subs.sed
This is actually because mingw/msys converts the unix-style path passed 
in to mktemp to a Windows-style one
in the first place.

Actually mingw does not have mktemp and the reason it was finding mktemp 
is that the cygwin directory
was in my path. Removing the cygwin path fixes this problem, but then I 
don't have access to bison and yacc,
so configure fails

As an alternate solution, If I disallow the first of the two options on 
cygwin, then the tmp variable is set to
/tmp/cs* and so it proceeds fine

--- configure   10 Oct 2002 17:54:27 -0000      1.349
+++ configure   11 Oct 2002 13:55:36 -0000
@@ -14315,9 +14315,17 @@

 # Create a (secure) tmp directory for tmp files.
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+# disallow mktemp on mingw
+case $MSYSTEM in
+  MINGW32*)
+    allowmktemp= ;;
+  *)
+    allowmktemp=yes ;;
 : ${TMPDIR=/tmp}
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  [ $allowmktemp ] && tmp=`(umask 077 && mktemp -d -q 
"$TMPDIR/csXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||

I thought the logical thing to check was $host_os to see if we were 
running mingw.
But when I tried it didn't seem to work :-)
Not sure if this configure is autogenerated or if this patch is 
applicable, but
thought others trying the same thing might find this helpful...

David Fraser

More information about the wine-devel mailing list