First post, by aqrit
WineD3D can be built on Windows for Win32
by applying a small patch to the aclocal.m4 file
and using a MSYS2/mingw-w64 toolchain
posting here because there was some interest in a newer build of ddraw.dll from wined3d
( and it took me hours to figure this out 😊 )
see the wine wiki for cross-compiling from Linux http://wiki.winehq.org/WineD3DOnWindows
pre-compiled binaries from someone else are here
wined3d.dll has a dependency on opengl32.dll
but MS/opengl32.dll has a dependency on ddraw.dll ...
so to use wined3d/ddraw.dll
one has to either use a different opengl32.dll
or rename wined3d/ddraw.dll to something else and hex edit the target game to import wined3d/ddraw under its new name.
 or use an ugly hack like the one posted later in this thread [here]
get msys2 and then update the base package
see details: http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
get mingw-w4 using mys2's built-in package manager
pacman --noconfirm --needed -S wget base-devel mingw-w64-i686-toolchain git
then close msys2 and run autorebase.bat from windows explorer (aka not in msys2)
note: if pacman downloads start failing...
uncomment the "XferCommand = /usr/bin/wget [...]" line in /etc/pacman.conf
and try again
get the source
git clone git://source.winehq.org/git/wine.git $HOME/wine-git
apply patch to the wine build system ( using either a text editor or git )
diff --git a/aclocal.m4 b/aclocal.m4
index 3d43721..1f23f83 100644
@@ -496,7 +496,7 @@ $ac_file.cross.a: $srcdir/$ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
- \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.$IMPLIBEXT \$[@]
+ \$(RM) \$[@] && \$(LN_S) dlls/$ac_name/lib$ac_implib.$IMPLIBEXT \$[@]
./configure --without-x --without-freetype CFLAGS="-O2 -DWINE_NOWINSOCK -DUSE_WIN32_OPENGL -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" CC='gcc -static-libgcc -s'
make __tooldeps__ dlls/d3d10 dlls/d3d10core dlls/d3d8 dlls/d3d9 dlls/dxgi dlls/ddraw dlls/wined3d
*note these switches are all optional "-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" CC='gcc -static-libgcc -s'
collect all the dlls into the root of the 'dlls' folder
cp dlls/d3d10/d3d10.dll dlls/d3d10core/d3d10core.dll dlls/d3d8/d3d8.dll dlls/d3d9/d3d9.dll dlls/dxgi/dxgi.dll dlls/ddraw/ddraw.dll dlls/wined3d/wined3d.dll libs/wine/libwine.dll dlls/