From 377eb2c7c762db6e28fa273ac7e4747a7c9e037e Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 20 May 2010 15:16:28 -0700 Subject: Enable --mingw option in android-configure.sh This should ease testing of the Windows build during development. Change-Id: I45cc9e396a0e82d764cf7a27fd40ad7c5367c51a --- android-configure.sh | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'android-configure.sh') diff --git a/android-configure.sh b/android-configure.sh index 1cf5008..50119db 100755 --- a/android-configure.sh +++ b/android-configure.sh @@ -24,6 +24,7 @@ OPTION_TRY_64=no OPTION_HELP=no OPTION_DEBUG=no OPTION_STATIC=no +OPTION_MINGW=no if [ -z "$CC" ] ; then CC=gcc @@ -47,6 +48,8 @@ for opt do ;; --sdl-config=*) SDL_CONFIG=$optarg ;; + --mingw) OPTION_MINGW=yes + ;; --cc=*) CC="$optarg" ; HOSTCC=$CC ;; --no-strip) OPTION_NO_STRIP=yes @@ -85,6 +88,7 @@ EOF echo " --ignore-audio ignore audio messages (may build sound-less emulator)" echo " --no-prebuilts do not use prebuilt libraries and compiler" echo " --try-64 try to build a 64-bit executable (may crash)" + echo " --mingw build Windows executable on Linux" echo " --static build a completely static executable" echo " --verbose verbose configuration" echo " --debug build debug version of the emulator" @@ -100,6 +104,14 @@ if [ "$OPTION_TRY_64" != "yes" ] ; then force_32bit_binaries fi +TARGET_OS=$OS +if [ "$OPTION_MINGW" == "yes" ] ; then + enable_linux_mingw + TARGET_OS=windows +else + enable_cygwin +fi + # Are we running in the Android build system ? check_android_build @@ -248,7 +260,7 @@ PROBE_OSS=no PROBE_ESD=no PROBE_WINAUDIO=no -case "$OS" in +case "$TARGET_OS" in darwin*) PROBE_COREAUDIO=yes; ;; linux-*) PROBE_ALSA=yes; PROBE_OSS=yes; PROBE_ESD=yes; @@ -324,6 +336,7 @@ rm -f $TMPC # check host endianess # HOST_BIGENDIAN=no +if [ "$TARGET_OS" = "$OS" ] ; then cat > $TMPC << EOF #include int main(int argc, char ** argv){ @@ -332,14 +345,18 @@ int main(int argc, char ** argv){ } EOF feature_run_exec HOST_BIGENDIAN +fi # check size of host long bits +HOST_LONGBITS=32 +if [ "$TARGET_OS" = "$OS" ] ; then cat > $TMPC << EOF int main(void) { return sizeof(void*)*8; } EOF feature_run_exec HOST_LONGBITS +fi # check whether we have # @@ -349,10 +366,12 @@ feature_check_header HAVE_BYTESWAP_H "" # create_config_mk -add_android_config_mk +echo "" >> $config_mk +echo "TARGET_ARCH := arm" >> $config_mk +echo "HOST_PREBUILT_TAG := $TARGET_OS" >> $config_mk +echo "PREBUILT := $ANDROID_PREBUILT" >> $config_mk PWD=`pwd` -echo "TARGET_ARCH := arm" >> $config_mk echo "SRC_PATH := $PWD" >> $config_mk if [ -n "$SDL_CONFIG" ] ; then echo "SDL_CONFIG := $SDL_CONFIG" >> $config_mk @@ -374,6 +393,12 @@ if [ -n "$ANDROID_SDK_TOOLS_REVISION" ] ; then echo "ANDROID_SDK_TOOLS_REVISION := $ANDROID_SDK_TOOLS_REVISION" >> $config_mk fi +if [ "$OPTION_MINGW" = "yes" ] ; then + echo "" >> $config_mk + echo "USE_MINGW := 1" >> $config_mk + echo "HOST_OS := windows" >> $config_mk +fi + # Build the config-host.h file # config_h=objs/config-host.h @@ -389,14 +414,14 @@ echo "#define CONFIG_SKINS 1" >> $config_h echo "#define CONFIG_TRACE 1" >> $config_h # only Linux has fdatasync() -case "$OS" in +case "$TARGET_OS" in linux-*) echo "#define CONFIG_FDATASYNC 1" >> $config_h ;; esac # the -nand-limits options can only work on non-windows systems -if [ "$OS" != "windows" ] ; then +if [ "$TARGET_OS" != "windows" ] ; then echo "#define CONFIG_NAND_LIMITS 1" >> $config_h fi echo "#define QEMU_VERSION \"0.10.50\"" >> $config_h @@ -413,7 +438,7 @@ case "$CPU" in esac echo "#define HOST_$CONFIG_CPU 1" >> $config_h BSD=0 -case "$OS" in +case "$TARGET_OS" in linux-*) CONFIG_OS=LINUX ;; darwin-*) CONFIG_OS=DARWIN @@ -432,7 +457,7 @@ if [ "$OPTION_STATIC" = "yes" ] ; then echo "#define CONFIG_STATIC_EXECUTABLE 1" >> $config_h fi -case $OS in +case $TARGET_OS in linux-*|darwin-*) echo "#define CONFIG_IOVEC 1" >> $config_h ;; -- cgit v1.1