aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.common
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common195
1 files changed, 142 insertions, 53 deletions
diff --git a/Makefile.common b/Makefile.common
index 8b98df8..4382bd2 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -54,7 +54,8 @@ gen-hw-config-defs = \
### THESE ARE POTENTIALLY USED BY ALL COMPONENTS
###
-$(call start-emulator-library, emulator-common)
+common_LOCAL_CFLAGS =
+common_LOCAL_SRC_FILES =
EMULATOR_COMMON_CFLAGS :=
@@ -90,12 +91,12 @@ ZLIB_DIR := distrib/zlib-1.2.3
include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make
EMULATOR_COMMON_CFLAGS += -I$(LOCAL_PATH)/$(ZLIB_DIR)
-LOCAL_SRC_FILES += $(ZLIB_SOURCES)
+common_LOCAL_SRC_FILES += $(ZLIB_SOURCES)
###########################################################
# Android utility functions
#
-LOCAL_SRC_FILES += \
+common_LOCAL_SRC_FILES += \
sockets.c \
iolooper-select.c \
android/async-console.c \
@@ -127,12 +128,31 @@ LOCAL_SRC_FILES += \
android/utils/tempfile.c \
android/utils/vector.c \
-$(call gen-hw-config-defs)
+common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
-LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
+## one for 32-bit
+$(call start-emulator-library, emulator-common)
+LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
+LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+$(call gen-hw-config-defs)
$(call end-emulator-library)
+## another for 64-bit
+# NOTE: only linux in non-standalone mode is supported, because
+# 1) For Windows: amd64-mingw32msvc-gcc doesn't work, see http://b/issue?id=5949152.
+# 2) For MacOSX: 64-bit libSDL*.a 1.2.x depends on NSQuickDrawView doesn't exist
+# 3) Standalone has --try-64
+ifeq ($(HOST_OS),linux)
+ ifneq ($(BUILD_STANDALONE_EMULATOR),true)
+ $(call start-emulator-library, emulator64-common)
+ LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
+ LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+ $(call gen-hw-config-defs)
+ $(call end-emulator-library)
+ endif # BUILD_STANDALONE_EMULATOR == nil
+endif # HOST_OS == linux
+
##############################################################################
##############################################################################
###
@@ -141,11 +161,14 @@ $(call end-emulator-library)
### THESE ARE USED BY 'emulator-ui' AND THE STANDALONE PROGRAMS
###
-$(call start-emulator-library, emulator-libui)
+common_LOCAL_CFLAGS =
+common_LOCAL_SRC_FILES =
-EMULATOR_LIBUI_CFLAGS :=
+ifneq ($(QEMU_OPENGLES_INCLUDE),)
+ EMULATOR_LIBUI_CFLAGS := -I$(QEMU_OPENGLES_INCLUDE)
+endif
-LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
+common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
###########################################################
# Libpng configuration
@@ -157,7 +180,7 @@ EMULATOR_LIBUI_CFLAGS += \
$(LIBPNG_CFLAGS) \
-I$(LOCAL_PATH)/$(LIBPNG_DIR)
-LOCAL_SRC_FILES += $(LIBPNG_SOURCES) loadpng.c
+common_LOCAL_SRC_FILES += $(LIBPNG_SOURCES) loadpng.c
##############################################################################
# SDL-related definitions
@@ -199,7 +222,7 @@ endif
ifneq ($(BUILD_SDL_FROM_SOURCES),true)
- SDL_CONFIG ?= prebuilt/$(QEMU_HOST_TAG)/sdl/bin/sdl-config
+ SDL_CONFIG ?= prebuilts/tools/$(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
@@ -211,12 +234,13 @@ ifneq ($(BUILD_SDL_FROM_SOURCES),true)
# 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
+ SDL_STATIC_LIBRARIES_64 := lib64SDL lib64SDLmain lib64SDL lib64SDLmain
else # BUILD_SDL_FROM_SOURCES
SDL_DIR := distrib/sdl-1.2.12
include $(LOCAL_PATH)/$(SDL_DIR)/sources.make
- LOCAL_SRC_FILES += $(SDL_SOURCES)
+ common_LOCAL_SRC_FILES += $(SDL_SOURCES)
EMULATOR_LIBUI_CFLAGS += \
-I$(LOCAL_PATH)/$(SDL_DIR)/include
@@ -247,25 +271,42 @@ SKIN_SOURCES := rect.c \
composer.c \
surface.c \
-LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%)
+common_LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%)
-LOCAL_SRC_FILES += \
+common_LOCAL_SRC_FILES += \
android/user-config.c \
android/resource.c \
android/qemulator.c \
android/keycode.c \
-$(call gen-hw-config-defs)
-
# enable MMX code for our skin scaler
ifeq ($(HOST_ARCH),x86)
-LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx
+common_LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx
endif
-LOCAL_CFLAGS += $(EMULATOR_LIBUI_CFLAGS)
+common_LOCAL_CFLAGS += $(EMULATOR_LIBUI_CFLAGS)
+
+## one for 32-bit
+$(call start-emulator-library, emulator-libui)
+LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
+LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+$(call gen-hw-config-defs)
$(call end-emulator-library)
+
+## another for 64-bit, see note in emulator64-common
+ifeq ($(HOST_OS),linux)
+ ifneq ($(BUILD_STANDALONE_EMULATOR),true)
+ $(call start-emulator-library, emulator64-libui)
+ LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
+ LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+ $(call gen-hw-config-defs)
+ $(call end-emulator-library)
+ endif # BUILD_STANDALONE_EMULATOR == nil
+endif # HOST_OS == linux
+
+
##############################################################################
##############################################################################
###
@@ -274,11 +315,13 @@ $(call end-emulator-library)
### THESE ARE USED BY EVERYTHING EXCEPT 'emulator-ui'
###
-$(call start-emulator-library, emulator-libqemu)
+common_LOCAL_CFLAGS =
+common_LOCAL_SRC_FILES =
+
EMULATOR_LIBQEMU_CFLAGS :=
-LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
+common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
###########################################################
# Jpeg configuration
@@ -290,13 +333,13 @@ EMULATOR_LIBQEMU_CFLAGS += \
$(LIBJPEG_CFLAGS) \
-I$(LOCAL_PATH)/$(LIBJPEG_DIR)
-LOCAL_SRC_FILES += $(LIBJPEG_SOURCES)
+common_LOCAL_SRC_FILES += $(LIBJPEG_SOURCES)
AUDIO_SOURCES := noaudio.c wavaudio.c wavcapture.c mixeng.c
AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO
AUDIO_LDLIBS :=
-LOCAL_CFLAGS += -Wall -Wno-missing-field-initializers
+common_LOCAL_CFLAGS += -Wall -Wno-missing-field-initializers
ifeq ($(HOST_OS),darwin)
CONFIG_COREAUDIO ?= yes
@@ -351,17 +394,17 @@ endif
AUDIO_SOURCES := $(call sort,$(AUDIO_SOURCES:%=audio/%))
-LOCAL_CFLAGS += -Wno-sign-compare \
+common_LOCAL_CFLAGS += -Wno-sign-compare \
-fno-strict-aliasing -W -Wall -Wno-unused-parameter \
# this is very important, otherwise the generated binaries may
# not link properly on our build servers
ifeq ($(HOST_OS),linux)
-LOCAL_CFLAGS += -fno-stack-protector
+common_LOCAL_CFLAGS += -fno-stack-protector
endif
-LOCAL_SRC_FILES += $(AUDIO_SOURCES)
-LOCAL_SRC_FILES += \
+common_LOCAL_SRC_FILES += $(AUDIO_SOURCES)
+common_LOCAL_SRC_FILES += \
android/audio-test.c
# other flags
@@ -374,14 +417,14 @@ endif
EMULATOR_LIBQEMU_CFLAGS += $(AUDIO_CFLAGS)
EMULATOR_LIBQEMU_LDLIBS += $(AUDIO_LDLIBS)
-LOCAL_CFLAGS += -Wno-missing-field-initializers
+common_LOCAL_CFLAGS += -Wno-missing-field-initializers
# migration sources
#
ifeq ($(HOST_OS),windows)
- LOCAL_SRC_FILES += migration-dummy-android.c
+ common_LOCAL_SRC_FILES += migration-dummy-android.c
else
- LOCAL_SRC_FILES += migration.c \
+ common_LOCAL_SRC_FILES += migration.c \
migration-exec.c \
migration-tcp-android.c
endif
@@ -435,16 +478,19 @@ CORE_MISC_SOURCES = \
android/hw-pipe-net.c \
android/qemu-setup.c \
android/snapshot.c \
- android/android-device.c \
+ android/async-socket-connector.c \
+ android/async-socket.c \
+ android/sdk-controller-socket.c \
android/sensors-port.c \
android/utils/timezone.c \
android/camera/camera-format-converters.c \
android/camera/camera-service.c \
android/adb-server.c \
android/adb-qemud.c \
- android/snaphost-android.c
-
-$(call gen-hw-config-defs)
+ android/snaphost-android.c \
+ android/multitouch-screen.c \
+ android/multitouch-port.c \
+ android/utils/jpeg-compress.c
ifeq ($(HOST_ARCH),x86)
CORE_MISC_SOURCES += i386-dis.c
@@ -477,10 +523,10 @@ ifeq ($(HOST_OS),darwin)
CORE_MISC_SOURCES += android/camera/camera-capture-mac.m
endif
-LOCAL_SRC_FILES += $(CORE_MISC_SOURCES)
+common_LOCAL_SRC_FILES += $(CORE_MISC_SOURCES)
# Required
-LOCAL_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+common_LOCAL_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
SLIRP_SOURCES := \
bootp.c \
@@ -502,7 +548,7 @@ SLIRP_SOURCES := \
tftp.c \
udp.c
-LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%)
+common_LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%)
EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/slirp-android
# socket proxy support
@@ -513,7 +559,7 @@ PROXY_SOURCES := \
proxy_http_connector.c \
proxy_http_rewriter.c \
-LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%)
+common_LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%)
EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/proxy
# include telephony stuff
@@ -527,13 +573,13 @@ TELEPHONY_SOURCES := \
sms.c \
remote_call.c
-LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%)
+common_LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%)
EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/telephony
# sources inherited from upstream, but not fully
# integrated into android emulator
#
-LOCAL_SRC_FILES += \
+common_LOCAL_SRC_FILES += \
json-lexer.c \
json-parser.c \
json-streamer.c \
@@ -545,31 +591,57 @@ LOCAL_SRC_FILES += \
qlist.c \
qstring.c \
-# gdbstub-xml.c contains C-compilable arrays corresponding to the content
-# of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script.
-#
-intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,$(LOCAL_MODULE),true)
-
ifeq ($(QEMU_TARGET_XML_SOURCES),)
QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3
QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml)
endif
-QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c
+common_LOCAL_CFLAGS += $(EMULATOR_LIBQEMU_CFLAGS)
+
+
+## one for 32-bit
+$(call start-emulator-library, emulator-libqemu)
+# gdbstub-xml.c contains C-compilable arrays corresponding to the content
+# of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script.
+#
+intermediates = $(call intermediates-dir-for,STATIC_LIBRARIES,$(LOCAL_MODULE),true)
+QEMU_GDBSTUB_XML_C = $(intermediates)/gdbstub-xml.c
$(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH)
$(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES)
$(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES)
$(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh
$(hide) rm -f $@
$(transform-generated-source)
-
LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C)
+LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -I$(intermediates)
+LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+$(call gen-hw-config-defs)
+$(call end-emulator-library)
-EMULATOR_LIBQEMU_CFLAGS += -I$(intermediates)
-LOCAL_CFLAGS += $(EMULATOR_LIBQEMU_CFLAGS)
+## another for 64-bit, see note in emulator64-common
+ifeq ($(HOST_OS),linux)
+ ifneq ($(BUILD_STANDALONE_EMULATOR),true)
+ $(call start-emulator-library, emulator64-libqemu)
+ # gdbstub-xml.c contains C-compilable arrays corresponding to the content
+ # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script.
+ #
+ intermediates = $(call intermediates-dir-for,STATIC_LIBRARIES,$(LOCAL_MODULE),true)
+ QEMU_GDBSTUB_XML_C = $(intermediates)/gdbstub-xml.c
+ $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH)
+ $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES)
+ $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES)
+ $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh
+ $(hide) rm -f $@
+ $(transform-generated-source)
+ LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C)
+ LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -I$(intermediates) -m64
+ LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+ $(call gen-hw-config-defs)
+ $(call end-emulator-library)
+ endif # BUILD_STANDALONE_EMULATOR == nil
+endif # HOST_OS == linux
-$(call end-emulator-library)
# Block sources, we must compile them with each executable because they
# are only referenced by the rest of the code using constructor functions.
@@ -611,9 +683,8 @@ BLOCK_CFLAGS += -DCONFIG_BDRV_WHITELIST=""
### THEM IN emulator-libqemu SINCE THE SOURCES ARE C++
###
-$(call start-emulator-library, emulator-libelff)
-
-LOCAL_CPP_EXTENSION := .cc
+common_LOCAL_CFLAGS =
+common_LOCAL_SRC_FILES =
ELFF_CFLAGS := -I$(LOCAL_PATH)/elff
ELFF_LDLIBS := -lstdc++
@@ -627,15 +698,33 @@ ELFF_SOURCES := \
elf_mapped_section.cc \
elff_api.cc \
-LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%)
+common_LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%)
-LOCAL_CFLAGS += \
+common_LOCAL_CFLAGS += \
-fno-exceptions \
$(ELFF_CFLAGS) \
+
+## one for 32-bit
+$(call start-emulator-library, emulator-libelff)
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
+LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
$(call end-emulator-library)
+## another for 64-bit, see note in emulator64-common
+ifeq ($(HOST_OS),linux)
+ ifneq ($(BUILD_STANDALONE_EMULATOR),true)
+ $(call start-emulator-library, emulator64-libelff)
+ LOCAL_CPP_EXTENSION := .cc
+ LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
+ LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+ $(call end-emulator-library)
+ endif # BUILD_STANDALONE_EMULATOR == nil
+endif # HOST_OS == linux
+
+
##############################################################################
##############################################################################
###