diff options
Diffstat (limited to 'Makefile.android')
-rw-r--r-- | Makefile.android | 50 |
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 # |