aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2010-04-14 12:16:28 -0700
committerRaphael <raphael@google.com>2010-04-14 12:16:28 -0700
commitaea1b87e31b952a733fe6cc6a0be4493a78ea961 (patch)
treea5098d8468ea918a640ab43cb80409f4a2ca276b
parent555d73444f8f053323828e354f446ccee41439d5 (diff)
downloadexternal_qemu-aea1b87e31b952a733fe6cc6a0be4493a78ea961.zip
external_qemu-aea1b87e31b952a733fe6cc6a0be4493a78ea961.tar.gz
external_qemu-aea1b87e31b952a733fe6cc6a0be4493a78ea961.tar.bz2
Changes to build Windows emulator under Linux/MinGW
- Linux being case-sensitve, include "windows.h" instead of "Windows.h" is important. - Use MinGW's windres. - No pthread needed. Change-Id: Ib4ce944bb55a8b1d870e230f269c89cb7df0b3f2
-rw-r--r--Makefile.android17
-rw-r--r--android/utils/mapfile.c2
-rw-r--r--elff/elff-common.h2
3 files changed, 16 insertions, 5 deletions
diff --git a/Makefile.android b/Makefile.android
index 0b719e0..38ad685 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -659,6 +659,8 @@ endif
#
LOCAL_CFLAGS += $(SDL_CFLAGS)
LOCAL_LDLIBS += $(SDL_LDLIBS)
+# Circular dependencies between libSDL and libSDLmain;
+# We repeat the libraries in the final link to work around it.
LOCAL_STATIC_LIBRARIES += libSDL libSDLmain
LOCAL_STATIC_LIBRARIES += libSDL libSDLmain
@@ -671,11 +673,19 @@ LOCAL_LDLIBS += $(ELFF_LDLIBS)
# to use some weird pathnames to make this work...
#
ifeq ($(HOST_OS),windows)
+
+# Locate windres executable
+WINDRES := windres
+ifneq ($(USE_MINGW),)
+ # When building the Windows emulator under Linux, use the MinGW one
+ WINDRES := i586-mingw32msvc-windres
+endif
+
INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true)
ANDROID_ICON_OBJ := android_icon.o
ANDROID_ICON_PATH := $(LOCAL_PATH)/images
$(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc
- windres $< -I $(ANDROID_ICON_PATH) -o $@
+ $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@
# seems to be the only way to add an object file that was not generated from
# a C/C++/Java source file to our build system. and very unfortunately,
@@ -760,11 +770,12 @@ endif
# other flags
LOCAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-LOCAL_LDLIBS += -lm -lpthread
-
+LOCAL_LDLIBS += -lm
ifeq ($(HOST_OS),windows)
LOCAL_LDLIBS += -lwinmm -lws2_32 -liphlpapi
+else
+ LOCAL_LDLIBS += -lpthread
endif
LOCAL_LDLIBS += $(QEMU_AUDIO_LIB)
diff --git a/android/utils/mapfile.c b/android/utils/mapfile.c
index f964d38..c8ba8e5 100644
--- a/android/utils/mapfile.c
+++ b/android/utils/mapfile.c
@@ -19,7 +19,7 @@
#include "sys/types.h"
#include "errno.h"
#ifdef WIN32
-#include "Windows.h"
+#include "windows.h"
#else // WIN32
#include <sys/mman.h>
#endif // WIN32
diff --git a/elff/elff-common.h b/elff/elff-common.h
index 922de10..8729736 100644
--- a/elff/elff-common.h
+++ b/elff/elff-common.h
@@ -23,7 +23,7 @@
#include "memory.h"
#include "errno.h"
#ifdef WIN32
-#include "Windows.h"
+#include "windows.h"
#else // WIN32
#include <sys/mman.h>
#include <sys/stat.h>