# HG changeset patch # User Anthony Liguori # Node ID 157550eed1f5e456a0f43167bd21bc14ad164d51 # Parent bda9c89460daa713765b316ea8ef1bfe7fd79091 A number of fixes to configure while getting cross compiling with mingw32 to work. Remove the --enable-mingw option. It hardcoded a cross-compile prefix and a different prefix is used on the mingw32 tools on some distros. Now: ./configure --cross-prefix=i586-mingw32msvc- ... will do the Right Thing so --enable-mingw is no longer needed. Add a check after $cc includes the cross-compile prefix so we can determine what the target really is (as opposed to using uname). Remove the check for test -e for /usr/include/byteswap.h to a compile check. This breaks cross compiling. Add a check for zlib so that we give a nice error if zlib-devel is missing. Use ${cross_prefix}sdl-config When we exit, make sure to remove TMP files. diff -r bda9c89460da -r 157550eed1f5 configure --- a/configure Sat Jul 22 22:06:44 2006 +0000 +++ b/configure Tue Jul 25 15:13:19 2006 -0500 @@ -213,8 +213,6 @@ for opt do ;; --fmod-inc=*) fmod_inc="$optarg" ;; - --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no" - ;; --disable-slirp) slirp="no" ;; --enable-adlib) adlib="yes" @@ -278,7 +276,6 @@ echo " --install=INSTALL use spe echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" echo " --enable-cocoa enable COCOA (Mac OS X only)" -echo " --enable-mingw32 enable Win32 cross compilation with mingw32" echo " --enable-adlib enable Adlib emulation" echo " --enable-coreaudio enable Coreaudio audio driver" echo " --enable-alsa enable ALSA audio driver" @@ -301,6 +298,23 @@ ar="${cross_prefix}${ar}" ar="${cross_prefix}${ar}" strip="${cross_prefix}${strip}" +# we really ought move the whole archecture check down here +targetos=`$cc -dumpmachine` +case $targetos in + *-mingw32msvc) + mingw32="yes" + oss="no" + user="no" + linux="no" # hack + EXESUF=".exe" + if [ "$cpu" = "i386" ] ; then + kqemu="yes" + fi + ;; + *) + ;; +esac + # check that the C compiler works. cat > $TMPC < $TMPC < +int main(){(void)zlibVersion(); return 0;} +EOF +if $cc -o $TMPE $TMPC -lz 2>/dev/null; then + zlib="yes" +else + zlib="no" +fi + +if test "$zlib" = "no"; then + echo "ERROR: QEMU requires the zlib library. You may have to install" + echo "the development package." + rm -f $TMPO $TMPC $TMPE $TMPS + exit 1; +fi + ########################################## # SDL probe @@ -448,15 +472,10 @@ sdl_too_old=no if test -z "$sdl" ; then -sdl_config="sdl-config" +sdl_config="${cross-prefix}sdl-config" sdl=no sdl_static=no -if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then -# win32 cross compilation case - sdl_config="i386-mingw32msvc-sdl-config" - sdl=yes -else # normal SDL probe cat > $TMPC << EOF #include @@ -489,7 +508,6 @@ fi # static link fi # sdl compile test -fi # cross compilation fi # -z $sdl # Check if tools are available to build documentation. @@ -540,7 +558,6 @@ if test "$sdl" != "no" ; then if test "$sdl" != "no" ; then echo "SDL static link $sdl_static" fi -echo "mingw32 support $mingw32" echo "Adlib support $adlib" echo "CoreAudio support $coreaudio" echo "ALSA support $alsa" @@ -573,6 +590,13 @@ config_h="config-host.h" config_h="config-host.h" #echo "Creating $config_mak and $config_h" + +have_header() { + cat > $TMPC < +EOF + $cc -c -o $TMPO $TMPC 2>/dev/null +} echo "# Automatically generated by configure - do not modify" > $config_mak echo "# Configured with: $0 $@" >> $config_mak @@ -644,7 +668,7 @@ if test "$mingw32" = "yes" ; then if test "$mingw32" = "yes" ; then echo "CONFIG_WIN32=yes" >> $config_mak echo "#define CONFIG_WIN32 1" >> $config_h -elif test -f "/usr/include/byteswap.h" ; then +elif have_header "/usr/include/byteswap.h" ; then echo "#define HAVE_BYTESWAP_H 1" >> $config_h fi if test "$darwin" = "yes" ; then