Just for the record, I cross-compile all my binaries using mingw64 from Linux, it works nicely, and I produce both win32 and win64 binaries this way with success.
In the hope that these scripts are useful, these are my main scripts for using mingw64 on Linux, installed to /opt/i686-w64-mingw32, these scripts may or may not be well designed and certainly were
not designed with Windows in mind, make what you will of it, but they work for me on Linux.
I’m not sure how to adapt these to .bat files or how to run them through bash on msys, so your mileage may vary, also the PREFIX obviously needs adjusting for wherever you installed mingw64, the
mingw32-opt-configure.sh script in particular may not even be needed (and if it is needed, the --build= part is probably quite wrong).
mingw32-opt-configure.sh: (use instead of ./configure)
#!/bin/sh
TARGET=i686-w64-mingw32
PREFIX=/opt/$TARGET
#PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
#export PATH
cache=mingw64-config.cache
sh configure --cache-file="$cache"
–target=$TARGET --host=$TARGET --build=i386-linux
$*
status=$?
rm -f "$cache"
exit $status
mingw32-opt-make.sh: (use instead of make, note this hacks a few things to make it work with some packages that use only makefiles without configure, generally harmless)
#!/bin/sh
TARGET=i686-w64-mingw32
PREFIX=/opt/$TARGET
prefix=/opt/$TARGET
#PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export prefix
export PREFIX
export TARGET
#export PATH
exec make CC=$TARGET-gcc CXX=$TARGET-g++ SDL_CONFIG=$PREFIX/bin/$TARGET-sdl-config WINDRES=$TARGET-windres $*On 09/07/2011 11:06 PM, Ryan C. Gordon wrote:
I’m trying to compile SDL from source in a cygwin bash shell, but I
notice that nothing is found and the ./configure fails with the last
messages :
[snip]
configure: error:
*** Your compiler (gcc) does not produce Win32 executables!
Do I miss something?
Cygwin’s gcc no longer supports the -mno-cygwin flag, which we use to avoid the dependency on Cygwin’s runtime.
These are the options, as far as I can tell:
- I suppose if you get desperate, you could remove the -mno-cygwin stuff from configure.in, and re-run autogen.sh. This should leave you with a configure script that gets past that error, but I can’t
say if you’ll make it through the build after that.
- (re)run Cygwin’s setup.exe, and install the gcc 3.x packages (instead of gcc4, or maybe along side of it?), as these supposedly still support the -mno-cygwin flag.
- Install the mingw64-i686-* packages (this is currently gcc 4.5.3), which can definitely live along side the gcc4 packages. Note that there are several things called “mingw” in the package manager,
so be careful what you install. mingw64, despite the name, handles 32-bit Windows if you install the i686 packages (there are also x86_64 packages for Win64 in there, but I haven’t tried these). The
i686 compiler, at least, runs on win32…it’s possible the x86_64 does too and only outputs win64 binaries. You’ll have to run the configure script something like this…
CC=i686-w64-mingw32-gcc ./configure
…and then run “make” like you always would.
I don’t have much experience with this, so assume all this information is wrong until you’ve verified it yourself.
–ryan.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier