aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.android
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-05-18 17:02:33 -0700
committerDavid 'Digit' Turner <digit@android.com>2010-05-18 17:02:33 -0700
commit34d165185730eac6ddc4e7a23d192d22aa3d4dfb (patch)
tree8f65fdba4ae95ef1f4e96e5492943d581637cbce /Makefile.android
parent54808b6e68ab5be7d2a10b772f1ae4f569d542a1 (diff)
downloadexternal_qemu-34d165185730eac6ddc4e7a23d192d22aa3d4dfb.zip
external_qemu-34d165185730eac6ddc4e7a23d192d22aa3d4dfb.tar.gz
external_qemu-34d165185730eac6ddc4e7a23d192d22aa3d4dfb.tar.bz2
Build SDL from sources directly.
This removes the requirement to build the SDL library before the rest of the emulator. The prebuilt SDL library and installation is now optional and is only kept for the full Android build on Linux (mainly to avoid having to install many dev libraries on build servers). This patch affects both the Android and standalone build systems. The script android-configure.sh will not use a prebuilt SDL installation unless you explicitely use --sdl-config=<script>. Tested for linux-x86 / darwin-x86 / cygwin / linux-mingw builds. Change-Id: If973b2ad199f06aeeff43aec387d1ac629487529
Diffstat (limited to 'Makefile.android')
-rw-r--r--Makefile.android50
1 files changed, 43 insertions, 7 deletions
diff --git a/Makefile.android b/Makefile.android
index 87da191..5519896 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -1,11 +1,21 @@
ifeq ($(TARGET_ARCH),arm)
LOCAL_PATH:= $(call my-dir)
+# determine the host tag to use
+QEMU_HOST_TAG := $(HOST_PREBUILT_TAG)
+ifneq ($(USE_MINGW),)
+ QEMU_HOST_TAG := windows
+endif
+
# determine the location of platform-specific directories
#
CONFIG_DIRS := \
$(LOCAL_PATH)/android/config \
- $(LOCAL_PATH)/android/config/$(HOST_PREBUILT_TAG)
+ $(LOCAL_PATH)/android/config/$(QEMU_HOST_TAG)
+
+ifeq ($(BUILD_STANDALONE_EMULATOR),true)
+ CONFIG_DIRS := $(LOCAL_PATH)/objs $(CONFIG_DIRS)
+endif
CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%)
@@ -307,7 +317,20 @@ include $(BUILD_HOST_STATIC_LIBRARY)
# SDL-related definitions
#
-SDL_CONFIG ?= prebuilt/$(HOST_PREBUILT_TAG)/sdl/bin/sdl-config
+# Build SDL from sources except on linux-x86, to avoid installing all
+# the X11 development packages on our build servers.
+#
+BUILD_SDL_FROM_SOURCES := true
+ifeq ($(QEMU_HOST_TAG),linux-x86)
+ BUILD_SDL_FROM_SOURCES := false
+endif
+ifneq ($(SDL_CONFIG),)
+ BUILD_SDL_FROM_SOURCES := false
+endif
+
+ifneq ($(BUILD_SDL_FROM_SOURCES),true)
+
+SDL_CONFIG ?= prebuilt/$(QEMU_HOST_TAG)/sdl/bin/sdl-config
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
# We need to filter out the _GNU_SOURCE variable because it breaks recent
@@ -316,6 +339,16 @@ SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS))
SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs))
+# Circular dependencies between libSDL and libSDLmain;
+# We repeat the libraries in the final link to work around it.
+SDL_STATIC_LIBRARIES := libSDL libSDLmain libSDL libSDLmain
+
+else # !BUILD_STANDALONE_EMULATOR
+
+SDL_DIR := distrib/sdl-1.2.12
+include $(LOCAL_PATH)/$(SDL_DIR)/sources.make
+
+endif # !BUILD_STANDALONE_EMULATOR
##############################################################################
# determine audio sources, build the prebuilt audio-library if needed
@@ -386,7 +419,7 @@ QEMU_AUDIO_LIB :=
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
QEMU_AUDIO_LIB := $(wildcard \
- prebuilt/$(HOST_PREBUILT_TAG)/emulator/libqemu-audio.a)
+ prebuilt/$(QEMU_HOST_TAG)/emulator/libqemu-audio.a)
endif
ifeq ($(BUILD_QEMU_AUDIO_LIB),true)
@@ -463,6 +496,12 @@ LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR)
LOCAL_SRC_FILES += $(LIBPNG_SOURCES)
LOCAL_CFLAGS += $(LIBPNG_CFLAGS) -I$(LOCAL_PATH)/$(LIBPNG_DIR)
+# include the SDL sources
+#
+LOCAL_SRC_FILES += $(SDL_SOURCES) $(SDLMAIN_SOURCES)
+LOCAL_CFLAGS += $(SDL_CFLAGS) -I$(LOCAL_PATH)/$(SDL_DIR)/include
+
+#
LOCAL_CFLAGS += -I$(LOCAL_PATH)/ \
-I$(LOCAL_PATH)/target-arm \
-I$(LOCAL_PATH)/fpu \
@@ -671,10 +710,7 @@ 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
+LOCAL_STATIC_LIBRARIES += $(SDL_STATIC_LIBRARIES)
# add ELFF-specific flags
#