am a74ade94
: Merge "Support host multilib build"
* commit 'a74ade945776e80f99f3b05d06a131cfd353c3f6': Support host multilib build
This commit is contained in:
commit
40b49d3043
38 changed files with 774 additions and 344 deletions
|
@ -98,16 +98,10 @@ ifneq ($(words $(LOCAL_MODULE_CLASS)),1)
|
||||||
$(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)")
|
$(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef LOCAL_IS_HOST_MODULE
|
my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
|
||||||
my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_IS_64_BIT),64,32)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
||||||
ifndef LOCAL_IS_HOST_MODULE
|
|
||||||
my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix)))
|
my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix)))
|
||||||
else
|
|
||||||
my_multilib_module_path :=
|
|
||||||
endif
|
|
||||||
ifdef my_multilib_module_path
|
ifdef my_multilib_module_path
|
||||||
my_module_path := $(my_multilib_module_path)
|
my_module_path := $(my_multilib_module_path)
|
||||||
else
|
else
|
||||||
|
@ -148,7 +142,7 @@ endif
|
||||||
my_register_name := $(LOCAL_MODULE)
|
my_register_name := $(LOCAL_MODULE)
|
||||||
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
||||||
ifndef LOCAL_NO_2ND_ARCH_MODULE_SUFFIX
|
ifndef LOCAL_NO_2ND_ARCH_MODULE_SUFFIX
|
||||||
my_register_name := $(LOCAL_MODULE)$(TARGET_2ND_ARCH_MODULE_SUFFIX)
|
my_register_name := $(LOCAL_MODULE)$($(my_prefix)2ND_ARCH_MODULE_SUFFIX)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
# Make sure that this IS_HOST/CLASS/MODULE combination is unique.
|
# Make sure that this IS_HOST/CLASS/MODULE combination is unique.
|
||||||
|
@ -516,6 +510,8 @@ $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_HOST:= $(my_host)
|
||||||
|
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_INTERMEDIATES_DIR:= $(intermediates)
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_INTERMEDIATES_DIR:= $(intermediates)
|
||||||
|
|
||||||
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
||||||
|
|
||||||
# Tell the module and all of its sub-modules who it is.
|
# Tell the module and all of its sub-modules who it is.
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name)
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name)
|
||||||
|
|
||||||
|
|
|
@ -113,22 +113,20 @@ my_cxx := $(LOCAL_CXX)
|
||||||
my_c_includes := $(LOCAL_C_INCLUDES)
|
my_c_includes := $(LOCAL_C_INCLUDES)
|
||||||
my_generated_sources := $(LOCAL_GENERATED_SOURCES)
|
my_generated_sources := $(LOCAL_GENERATED_SOURCES)
|
||||||
|
|
||||||
ifndef LOCAL_IS_HOST_MODULE
|
my_src_files += $(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SRC_FILES_$(my_32_64_bit_suffix))
|
||||||
my_src_files += $(LOCAL_SRC_FILES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SRC_FILES_$(my_32_64_bit_suffix))
|
my_shared_libraries += $(LOCAL_SHARED_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SHARED_LIBRARIES_$(my_32_64_bit_suffix))
|
||||||
my_shared_libraries += $(LOCAL_SHARED_LIBRARIES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SHARED_LIBRARIES_$(my_32_64_bit_suffix))
|
my_cflags += $(LOCAL_CFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CFLAGS_$(my_32_64_bit_suffix))
|
||||||
my_cflags += $(LOCAL_CFLAGS_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CFLAGS_$(my_32_64_bit_suffix))
|
my_cppflags += $(LOCAL_CPPFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CPPFLAGS_$(my_32_64_bit_suffix))
|
||||||
my_cppflags += $(LOCAL_CPPFLAGS_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CPPFLAGS_$(my_32_64_bit_suffix))
|
my_ldflags += $(LOCAL_LDFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_LDFLAGS_$(my_32_64_bit_suffix))
|
||||||
my_ldflags += $(LOCAL_LDFLAGS_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_LDFLAGS_$(my_32_64_bit_suffix))
|
my_asflags += $(LOCAL_ASFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_ASFLAGS_$(my_32_64_bit_suffix))
|
||||||
my_asflags += $(LOCAL_ASFLAGS_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_ASFLAGS_$(my_32_64_bit_suffix))
|
my_c_includes += $(LOCAL_C_INCLUDES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_C_INCLUDES_$(my_32_64_bit_suffix))
|
||||||
my_c_includes += $(LOCAL_C_INCLUDES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_C_INCLUDES_$(my_32_64_bit_suffix))
|
my_generated_sources += $(LOCAL_GENERATED_SOURCES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_GENERATED_SOURCES_$(my_32_64_bit_suffix))
|
||||||
my_generated_sources += $(LOCAL_GENERATED_SOURCES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_GENERATED_SOURCES_$(my_32_64_bit_suffix))
|
|
||||||
|
|
||||||
# arch-specific static libraries go first so that generic ones can depend on them
|
# arch-specific static libraries go first so that generic ones can depend on them
|
||||||
my_static_libraries := $(LOCAL_STATIC_LIBRARIES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_static_libraries)
|
my_static_libraries := $(LOCAL_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_static_libraries)
|
||||||
my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_WHOLE_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_whole_static_libraries)
|
my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_WHOLE_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_whole_static_libraries)
|
||||||
|
|
||||||
my_cflags := $(filter-out $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_UNSUPPORTED_CFLAGS),$(my_cflags))
|
my_cflags := $(filter-out $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)GLOBAL_UNSUPPORTED_CFLAGS),$(my_cflags))
|
||||||
endif
|
|
||||||
|
|
||||||
# Add static HAL libraries
|
# Add static HAL libraries
|
||||||
ifdef LOCAL_HAL_STATIC_LIBRARIES
|
ifdef LOCAL_HAL_STATIC_LIBRARIES
|
||||||
|
@ -234,15 +232,15 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_glob
|
||||||
else # LOCAL_IS_HOST_MODULE
|
else # LOCAL_IS_HOST_MODULE
|
||||||
|
|
||||||
ifeq ($(LOCAL_CLANG),true)
|
ifeq ($(LOCAL_CLANG),true)
|
||||||
my_host_global_cflags := $(CLANG_HOST_GLOBAL_CFLAGS)
|
my_host_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_HOST_GLOBAL_CFLAGS)
|
||||||
my_host_global_cppflags := $(CLANG_HOST_GLOBAL_CPPFLAGS)
|
my_host_global_cppflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_HOST_GLOBAL_CPPFLAGS)
|
||||||
my_host_global_ldflags := $(CLANG_HOST_GLOBAL_LDFLAGS)
|
my_host_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_HOST_GLOBAL_LDFLAGS)
|
||||||
my_host_c_includes := $(HOST_C_INCLUDES) $(CLANG_CONFIG_EXTRA_HOST_C_INCLUDES)
|
my_host_c_includes := $($(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_C_INCLUDES) $(CLANG_CONFIG_EXTRA_HOST_C_INCLUDES)
|
||||||
else
|
else
|
||||||
my_host_global_cflags := $(HOST_GLOBAL_CFLAGS)
|
my_host_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CFLAGS)
|
||||||
my_host_global_cppflags := $(HOST_GLOBAL_CPPFLAGS)
|
my_host_global_cppflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CPPFLAGS)
|
||||||
my_host_global_ldflags := $(HOST_GLOBAL_LDFLAGS)
|
my_host_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LDFLAGS)
|
||||||
my_host_c_includes := $(HOST_C_INCLUDES)
|
my_host_c_includes := $($(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_C_INCLUDES)
|
||||||
endif # LOCAL_CLANG
|
endif # LOCAL_CLANG
|
||||||
|
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HOST_C_INCLUDES := $(my_host_c_includes)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HOST_C_INCLUDES := $(my_host_c_includes)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/clang/x86.mk
|
include $(BUILD_SYSTEM)/clang/x86.mk
|
||||||
include $(BUILD_SYSTEM)/clang/x86_common.mk
|
include $(BUILD_SYSTEM)/clang/HOST_x86_common.mk
|
||||||
|
|
||||||
ifeq ($(HOST_OS),linux)
|
ifeq ($(HOST_OS),linux)
|
||||||
CLANG_CONFIG_x86_HOST_TRIPLE := i686-linux-gnu
|
CLANG_CONFIG_x86_HOST_TRIPLE := i686-linux-gnu
|
||||||
|
@ -44,21 +44,21 @@ CLANG_CONFIG_x86_HOST_EXTRA_LDFLAGS := \
|
||||||
$(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS) \
|
$(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS) \
|
||||||
-target $(CLANG_CONFIG_x86_HOST_TRIPLE)
|
-target $(CLANG_CONFIG_x86_HOST_TRIPLE)
|
||||||
|
|
||||||
define convert-to-host-clang-flags
|
define $(clang_2nd_arch_prefix)convert-to-host-clang-flags
|
||||||
$(strip \
|
$(strip \
|
||||||
$(call subst-clang-incompatible-x86-flags,\
|
$(call subst-clang-incompatible-x86-flags,\
|
||||||
$(filter-out $(CLANG_CONFIG_x86_UNKNOWN_CFLAGS),\
|
$(filter-out $(CLANG_CONFIG_x86_UNKNOWN_CFLAGS),\
|
||||||
$(1))))
|
$(1))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
CLANG_HOST_GLOBAL_CFLAGS := \
|
$(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_CFLAGS := \
|
||||||
$(call convert-to-host-clang-flags,$(HOST_GLOBAL_CFLAGS)) \
|
$(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_CFLAGS)) \
|
||||||
$(CLANG_CONFIG_x86_HOST_EXTRA_CFLAGS)
|
$(CLANG_CONFIG_x86_HOST_EXTRA_CFLAGS)
|
||||||
|
|
||||||
CLANG_HOST_GLOBAL_CPPFLAGS := \
|
$(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_CPPFLAGS := \
|
||||||
$(call convert-to-host-clang-flags,$(HOST_GLOBAL_CPPFLAGS)) \
|
$(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_CPPFLAGS)) \
|
||||||
$(CLANG_CONFIG_x86_HOST_EXTRA_CPPFLAGS)
|
$(CLANG_CONFIG_x86_HOST_EXTRA_CPPFLAGS)
|
||||||
|
|
||||||
CLANG_HOST_GLOBAL_LDFLAGS := \
|
$(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_LDFLAGS := \
|
||||||
$(call convert-to-host-clang-flags,$(HOST_GLOBAL_LDFLAGS)) \
|
$(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS)) \
|
||||||
$(CLANG_CONFIG_x86_HOST_EXTRA_LDFLAGS)
|
$(CLANG_CONFIG_x86_HOST_EXTRA_LDFLAGS)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/clang/x86_64.mk
|
include $(BUILD_SYSTEM)/clang/x86_64.mk
|
||||||
include $(BUILD_SYSTEM)/clang/x86_common.mk
|
include $(BUILD_SYSTEM)/clang/HOST_x86_common.mk
|
||||||
|
|
||||||
ifeq ($(HOST_OS),linux)
|
ifeq ($(HOST_OS),linux)
|
||||||
CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-linux-gnu
|
CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-linux-gnu
|
||||||
|
|
56
core/clang/HOST_x86_common.mk
Normal file
56
core/clang/HOST_x86_common.mk
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
# Shared by HOST_x86.mk and HOST_x86_64.mk.
|
||||||
|
|
||||||
|
ifeq ($(HOST_OS),darwin)
|
||||||
|
# nothing required here yet
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HOST_OS),linux)
|
||||||
|
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS := \
|
||||||
|
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
|
||||||
|
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
|
||||||
|
-no-integrated-as
|
||||||
|
|
||||||
|
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS := \
|
||||||
|
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
|
||||||
|
-no-integrated-as
|
||||||
|
|
||||||
|
ifneq ($(strip $($(clang_2nd_arch_prefix)HOST_IS_64_BIT)),)
|
||||||
|
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \
|
||||||
|
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
|
||||||
|
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
|
||||||
|
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6 \
|
||||||
|
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/x86_64-linux \
|
||||||
|
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/backward \
|
||||||
|
-no-integrated-as
|
||||||
|
|
||||||
|
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
|
||||||
|
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
|
||||||
|
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
|
||||||
|
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \
|
||||||
|
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6 \
|
||||||
|
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6 \
|
||||||
|
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib64/ \
|
||||||
|
-no-integrated-as
|
||||||
|
else
|
||||||
|
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \
|
||||||
|
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
|
||||||
|
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
|
||||||
|
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6 \
|
||||||
|
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/x86_64-linux/32 \
|
||||||
|
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/backward \
|
||||||
|
-no-integrated-as
|
||||||
|
|
||||||
|
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
|
||||||
|
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
|
||||||
|
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
|
||||||
|
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \
|
||||||
|
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6/32 \
|
||||||
|
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6/32 \
|
||||||
|
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib32/ \
|
||||||
|
-no-integrated-as
|
||||||
|
endif
|
||||||
|
endif # Linux
|
||||||
|
|
||||||
|
ifeq ($(HOST_OS),windows)
|
||||||
|
# nothing required here yet
|
||||||
|
endif
|
|
@ -47,10 +47,13 @@ CLANG_CONFIG_TARGET_EXTRA_CPPFLAGS := -nostdlibinc
|
||||||
CLANG_CONFIG_TARGET_EXTRA_LDFLAGS :=
|
CLANG_CONFIG_TARGET_EXTRA_LDFLAGS :=
|
||||||
|
|
||||||
# HOST config
|
# HOST config
|
||||||
ifneq ($(strip $(BUILD_HOST_64bit)),)
|
clang_2nd_arch_prefix :=
|
||||||
include $(BUILD_SYSTEM)/clang/HOST_x86_64.mk
|
|
||||||
else
|
|
||||||
include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk
|
include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk
|
||||||
|
|
||||||
|
# HOST_2ND_ARCH config
|
||||||
|
ifdef HOST_2ND_ARCH
|
||||||
|
clang_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX)
|
||||||
|
include $(BUILD_SYSTEM)/clang/HOST_$(HOST_2ND_ARCH).mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# TARGET config
|
# TARGET config
|
||||||
|
|
|
@ -149,6 +149,10 @@ LOCAL_MODULE_TARGET_ARCH:=
|
||||||
LOCAL_MODULE_TARGET_ARCH_WARN:=
|
LOCAL_MODULE_TARGET_ARCH_WARN:=
|
||||||
LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH:=
|
LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH:=
|
||||||
LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN:=
|
LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN:=
|
||||||
|
LOCAL_MODULE_HOST_ARCH:=
|
||||||
|
LOCAL_MODULE_HOST_ARCH_WARN:=
|
||||||
|
LOCAL_MODULE_UNSUPPORTED_HOST_ARCH:=
|
||||||
|
LOCAL_MODULE_UNSUPPORTED_HOST_ARCH_WARN:=
|
||||||
|
|
||||||
# arch specific variables
|
# arch specific variables
|
||||||
LOCAL_SRC_FILES_$(TARGET_ARCH):=
|
LOCAL_SRC_FILES_$(TARGET_ARCH):=
|
||||||
|
@ -177,6 +181,32 @@ LOCAL_WHOLE_STATIC_LIBRARIES_$(TARGET_2ND_ARCH):=
|
||||||
LOCAL_GENERATED_SOURCES_$(TARGET_2ND_ARCH):=
|
LOCAL_GENERATED_SOURCES_$(TARGET_2ND_ARCH):=
|
||||||
LOCAL_REQUIRED_MODULES_$(TARGET_2ND_ARCH):=
|
LOCAL_REQUIRED_MODULES_$(TARGET_2ND_ARCH):=
|
||||||
endif
|
endif
|
||||||
|
LOCAL_SRC_FILES_$(HOST_ARCH):=
|
||||||
|
LOCAL_CFLAGS_$(HOST_ARCH):=
|
||||||
|
LOCAL_CPPFLAGS_$(HOST_ARCH):=
|
||||||
|
LOCAL_C_INCLUDES_$(HOST_ARCH):=
|
||||||
|
LOCAL_ASFLAGS_$(HOST_ARCH):=
|
||||||
|
LOCAL_NO_CRT_$(HOST_ARCH):=
|
||||||
|
LOCAL_LDFLAGS_$(HOST_ARCH):=
|
||||||
|
LOCAL_SHARED_LIBRARIES_$(HOST_ARCH):=
|
||||||
|
LOCAL_STATIC_LIBRARIES_$(HOST_ARCH):=
|
||||||
|
LOCAL_WHOLE_STATIC_LIBRARIES_$(HOST_ARCH):=
|
||||||
|
LOCAL_GENERATED_SOURCES_$(HOST_ARCH):=
|
||||||
|
LOCAL_REQUIRED_MODULES_$(HOST_ARCH):=
|
||||||
|
ifdef HOST_2ND_ARCH
|
||||||
|
LOCAL_SRC_FILES_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_CFLAGS_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_CPPFLAGS_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_C_INCLUDES_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_ASFLAGS_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_NO_CRT_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_LDFLAGS_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_SHARED_LIBRARIES_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_STATIC_LIBRARIES_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_WHOLE_STATIC_LIBRARIES_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_GENERATED_SOURCES_$(HOST_2ND_ARCH):=
|
||||||
|
LOCAL_REQUIRED_MODULES_$(HOST_2ND_ARCH):=
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_SRC_FILES_32:=
|
LOCAL_SRC_FILES_32:=
|
||||||
LOCAL_SRC_FILES_64:=
|
LOCAL_SRC_FILES_64:=
|
||||||
|
|
|
@ -17,112 +17,72 @@
|
||||||
# Configuration for Darwin (Mac OS X) on x86.
|
# Configuration for Darwin (Mac OS X) on x86.
|
||||||
# Included by combo/select.mk
|
# Included by combo/select.mk
|
||||||
|
|
||||||
ifneq ($(strip $(BUILD_HOST_64bit)),)
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -m32
|
||||||
# By default we build everything in 32-bit, because it gives us
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32
|
||||||
# more consistency between the host tools and the target.
|
|
||||||
# BUILD_HOST_64bit=1 overrides it for tool like emulator
|
|
||||||
# which can benefit from 64-bit host arch.
|
|
||||||
HOST_GLOBAL_CFLAGS += -m64
|
|
||||||
HOST_GLOBAL_LDFLAGS += -m64
|
|
||||||
else
|
|
||||||
HOST_GLOBAL_CFLAGS += -m32
|
|
||||||
HOST_GLOBAL_LDFLAGS += -m32
|
|
||||||
endif # BUILD_HOST_64bit
|
|
||||||
|
|
||||||
ifneq ($(strip $(BUILD_HOST_static)),)
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
||||||
# Statically-linked binaries are desirable for sandboxed environment
|
# Statically-linked binaries are desirable for sandboxed environment
|
||||||
HOST_GLOBAL_LDFLAGS += -static
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
|
||||||
endif # BUILD_HOST_static
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
# Workaround differences in inttypes.h between host and target.
|
# Workaround differences in inttypes.h between host and target.
|
||||||
# See bug 12708004.
|
# See bug 12708004.
|
||||||
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
||||||
|
|
||||||
build_mac_version := $(shell sw_vers -productVersion)
|
include $(BUILD_COMBOS)/mac_version.mk
|
||||||
|
|
||||||
mac_sdk_versions_supported := 10.6 10.7 10.8
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1
|
||||||
ifneq ($(strip $(MAC_SDK_VERSION)),)
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version)
|
||||||
mac_sdk_version := $(MAC_SDK_VERSION)
|
|
||||||
ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),)
|
|
||||||
$(warning ****************************************************************)
|
|
||||||
$(warning * MAC_SDK_VERSION $(MAC_SDK_VERSION) isn't one of the supported $(mac_sdk_versions_supported))
|
|
||||||
$(warning ****************************************************************)
|
|
||||||
$(error Stop.)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
mac_sdk_versions_installed := $(shell xcodebuild -showsdks | grep macosx | sort | sed -e "s/.*macosx//g")
|
|
||||||
mac_sdk_version := $(firstword $(filter $(mac_sdk_versions_installed), $(mac_sdk_versions_supported)))
|
|
||||||
ifeq ($(mac_sdk_version),)
|
|
||||||
mac_sdk_version := $(firstword $(mac_sdk_versions_supported))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
mac_sdk_path := $(shell xcode-select -print-path)
|
|
||||||
# try /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk
|
|
||||||
# or /Volume/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk
|
|
||||||
mac_sdk_root := $(mac_sdk_path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(mac_sdk_version).sdk
|
|
||||||
ifeq ($(wildcard $(mac_sdk_root)),)
|
|
||||||
# try legacy /Developer/SDKs/MacOSX10.?.sdk
|
|
||||||
mac_sdk_root := /Developer/SDKs/MacOSX$(mac_sdk_version).sdk
|
|
||||||
endif
|
|
||||||
ifeq ($(wildcard $(mac_sdk_root)),)
|
|
||||||
$(warning *****************************************************)
|
|
||||||
$(warning * Can not find SDK $(mac_sdk_version) at $(mac_sdk_root))
|
|
||||||
$(warning *****************************************************)
|
|
||||||
$(error Stop.)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(mac_sdk_version),10.6)
|
|
||||||
gcc_darwin_version := 10
|
|
||||||
else
|
|
||||||
gcc_darwin_version := 11
|
|
||||||
endif
|
|
||||||
|
|
||||||
HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1
|
|
||||||
HOST_TOOLCHAIN_PREFIX := $(HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version)
|
|
||||||
# Don't do anything if the toolchain is not there
|
# Don't do anything if the toolchain is not there
|
||||||
ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)-gcc)))
|
ifneq (,$(strip $(wildcard $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-gcc)))
|
||||||
HOST_CC := $(HOST_TOOLCHAIN_PREFIX)-gcc
|
$(combo_2nd_arch_prefix)HOST_CC := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-gcc
|
||||||
HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)-g++
|
$(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-g++
|
||||||
ifeq ($(mac_sdk_version),10.8)
|
ifeq ($(mac_sdk_version),10.8)
|
||||||
# Mac SDK 10.8 no longer has stdarg.h, etc
|
# Mac SDK 10.8 no longer has stdarg.h, etc
|
||||||
host_toolchain_header := $(HOST_TOOLCHAIN_ROOT)/lib/gcc/i686-apple-darwin$(gcc_darwin_version)/4.2.1/include
|
host_toolchain_header := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT)/lib/gcc/i686-apple-darwin$(gcc_darwin_version)/4.2.1/include
|
||||||
HOST_GLOBAL_CFLAGS += -isystem $(host_toolchain_header)
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -isystem $(host_toolchain_header)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
HOST_CC := gcc
|
$(combo_2nd_arch_prefix)HOST_CC := gcc
|
||||||
HOST_CXX := g++
|
$(combo_2nd_arch_prefix)HOST_CXX := g++
|
||||||
endif # $(HOST_TOOLCHAIN_PREFIX)-gcc exists
|
endif # $(HOST_TOOLCHAIN_PREFIX)-gcc exists
|
||||||
HOST_AR := $(AR)
|
|
||||||
HOST_STRIP := $(STRIP)
|
|
||||||
HOST_STRIP_COMMAND = $(HOST_STRIP) --strip-all $< -o $@
|
|
||||||
|
|
||||||
HOST_GLOBAL_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version)
|
# gcc location for clang; to be updated when clang is updated
|
||||||
HOST_GLOBAL_LDFLAGS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)
|
# HOST_TOOLCHAIN_ROOT is a Darwin-specific define
|
||||||
|
HOST_TOOLCHAIN_FOR_CLANG := $(HOST_TOOLCHAIN_ROOT)
|
||||||
|
|
||||||
HOST_GLOBAL_CFLAGS += -fPIC -funwind-tables
|
$(combo_2nd_arch_prefix)HOST_AR := $(AR)
|
||||||
HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
|
|
||||||
|
|
||||||
HOST_SHLIB_SUFFIX := .dylib
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version)
|
||||||
HOST_JNILIB_SUFFIX := .jnilib
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)
|
||||||
|
|
||||||
HOST_GLOBAL_CFLAGS += \
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC -funwind-tables
|
||||||
|
$(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
|
||||||
|
|
||||||
|
$(combo_2nd_arch_prefix)HOST_SHLIB_SUFFIX := .dylib
|
||||||
|
$(combo_2nd_arch_prefix)HOST_JNILIB_SUFFIX := .jnilib
|
||||||
|
|
||||||
|
# TODO: add AndroidConfig.h for darwin-x86_64
|
||||||
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
|
||||||
-include $(call select-android-config-h,darwin-x86)
|
-include $(call select-android-config-h,darwin-x86)
|
||||||
|
|
||||||
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
|
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
|
||||||
HOST_RUN_RANLIB_AFTER_COPYING := false
|
$(combo_2nd_arch_prefix)HOST_RUN_RANLIB_AFTER_COPYING := false
|
||||||
else
|
else
|
||||||
HOST_RUN_RANLIB_AFTER_COPYING := true
|
$(combo_2nd_arch_prefix)HOST_RUN_RANLIB_AFTER_COPYING := true
|
||||||
PRE_LION_DYNAMIC_LINKER_OPTIONS := -Wl,-dynamic
|
PRE_LION_DYNAMIC_LINKER_OPTIONS := -Wl,-dynamic
|
||||||
endif
|
endif
|
||||||
HOST_GLOBAL_ARFLAGS := cqs
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_ARFLAGS := cqs
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
## Macros after this line are shared by the 64-bit config.
|
||||||
|
|
||||||
HOST_CUSTOM_LD_COMMAND := true
|
HOST_CUSTOM_LD_COMMAND := true
|
||||||
|
|
||||||
define transform-host-o-to-shared-lib-inner
|
define transform-host-o-to-shared-lib-inner
|
||||||
$(hide) $(PRIVATE_CXX) \
|
$(hide) $(PRIVATE_CXX) \
|
||||||
-dynamiclib -single_module -read_only_relocs suppress \
|
-dynamiclib -single_module -read_only_relocs suppress \
|
||||||
$(HOST_GLOBAL_LD_DIRS) \
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \
|
||||||
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
||||||
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
||||||
) \
|
) \
|
||||||
|
@ -133,17 +93,16 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
$(PRIVATE_LDLIBS) \
|
$(PRIVATE_LDLIBS) \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
-install_name @rpath/$(notdir $@) \
|
-install_name @rpath/$(notdir $@) \
|
||||||
-Wl,-rpath,@loader_path/../lib \
|
-Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
|
||||||
$(PRIVATE_LDFLAGS) \
|
$(PRIVATE_LDFLAGS)
|
||||||
$(HOST_LIBGCC)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define transform-host-o-to-executable-inner
|
define transform-host-o-to-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) \
|
$(hide) $(PRIVATE_CXX) \
|
||||||
-Wl,-rpath,@loader_path/../lib \
|
-Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
$(PRE_LION_DYNAMIC_LINKER_OPTIONS) -Wl,-headerpad_max_install_names \
|
$(PRE_LION_DYNAMIC_LINKER_OPTIONS) -Wl,-headerpad_max_install_names \
|
||||||
$(HOST_GLOBAL_LD_DIRS) \
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \
|
||||||
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
||||||
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
||||||
) \
|
) \
|
||||||
|
@ -152,15 +111,10 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
|
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
|
||||||
$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
|
$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
|
||||||
$(PRIVATE_LDFLAGS) \
|
$(PRIVATE_LDFLAGS) \
|
||||||
$(PRIVATE_LDLIBS) \
|
$(PRIVATE_LDLIBS)
|
||||||
$(HOST_LIBGCC)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# $(1): The file to check
|
# $(1): The file to check
|
||||||
define get-file-size
|
define get-file-size
|
||||||
stat -f "%z" $(1)
|
stat -f "%z" $(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# gcc location for clang; to be updated when clang is updated
|
|
||||||
# HOST_TOOLCHAIN_ROOT is a Darwin-specific define
|
|
||||||
HOST_TOOLCHAIN_FOR_CLANG := $(HOST_TOOLCHAIN_ROOT)
|
|
80
core/combo/HOST_darwin-x86_64.mk
Normal file
80
core/combo/HOST_darwin-x86_64.mk
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2006 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Configuration for Darwin (Mac OS X) on x86_64.
|
||||||
|
# Included by combo/select.mk
|
||||||
|
|
||||||
|
HOST_IS_64_BIT := true
|
||||||
|
|
||||||
|
HOST_GLOBAL_CFLAGS += -m64
|
||||||
|
HOST_GLOBAL_LDFLAGS += -m64
|
||||||
|
|
||||||
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
||||||
|
# Statically-linked binaries are desirable for sandboxed environment
|
||||||
|
HOST_GLOBAL_LDFLAGS += -static
|
||||||
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
|
# Workaround differences in inttypes.h between host and target.
|
||||||
|
# See bug 12708004.
|
||||||
|
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
||||||
|
|
||||||
|
include $(BUILD_COMBOS)/mac_version.mk
|
||||||
|
|
||||||
|
HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1
|
||||||
|
HOST_TOOLCHAIN_PREFIX := $(HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version)
|
||||||
|
# Don't do anything if the toolchain is not there
|
||||||
|
ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)-gcc)))
|
||||||
|
HOST_CC := $(HOST_TOOLCHAIN_PREFIX)-gcc
|
||||||
|
HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)-g++
|
||||||
|
ifeq ($(mac_sdk_version),10.8)
|
||||||
|
# Mac SDK 10.8 no longer has stdarg.h, etc
|
||||||
|
host_toolchain_header := $(HOST_TOOLCHAIN_ROOT)/lib/gcc/i686-apple-darwin$(gcc_darwin_version)/4.2.1/include
|
||||||
|
HOST_GLOBAL_CFLAGS += -isystem $(host_toolchain_header)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
HOST_CC := gcc
|
||||||
|
HOST_CXX := g++
|
||||||
|
endif # $(HOST_TOOLCHAIN_PREFIX)-gcc exists
|
||||||
|
|
||||||
|
# gcc location for clang; to be updated when clang is updated
|
||||||
|
# HOST_TOOLCHAIN_ROOT is a Darwin-specific define
|
||||||
|
HOST_TOOLCHAIN_FOR_CLANG := $(HOST_TOOLCHAIN_ROOT)
|
||||||
|
|
||||||
|
HOST_AR := $(AR)
|
||||||
|
|
||||||
|
HOST_GLOBAL_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version)
|
||||||
|
HOST_GLOBAL_LDFLAGS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)
|
||||||
|
|
||||||
|
HOST_GLOBAL_CFLAGS += -fPIC -funwind-tables
|
||||||
|
HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
|
||||||
|
|
||||||
|
HOST_SHLIB_SUFFIX := .dylib
|
||||||
|
HOST_JNILIB_SUFFIX := .jnilib
|
||||||
|
|
||||||
|
HOST_GLOBAL_CFLAGS += \
|
||||||
|
-include $(call select-android-config-h,darwin-x86)
|
||||||
|
|
||||||
|
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
|
||||||
|
HOST_RUN_RANLIB_AFTER_COPYING := false
|
||||||
|
else
|
||||||
|
HOST_RUN_RANLIB_AFTER_COPYING := true
|
||||||
|
endif
|
||||||
|
HOST_GLOBAL_ARFLAGS := cqs
|
||||||
|
|
||||||
|
# We Reuse the following functions with the same name from HOST_darwin-x86.mk:
|
||||||
|
# transform-host-o-to-shared-lib-inner
|
||||||
|
# transform-host-o-to-executable-inner
|
||||||
|
# get-file-size
|
|
@ -17,49 +17,46 @@
|
||||||
# Configuration for builds hosted on linux-x86.
|
# Configuration for builds hosted on linux-x86.
|
||||||
# Included by combo/select.mk
|
# Included by combo/select.mk
|
||||||
|
|
||||||
# $(1): The file to check
|
ifeq ($(strip $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)),)
|
||||||
define get-file-size
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
|
||||||
stat --format "%s" "$(1)" | tr -d '\n'
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
|
|
||||||
HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
|
|
||||||
endif
|
endif
|
||||||
# Don't do anything if the toolchain is not there
|
# Don't do anything if the toolchain is not there
|
||||||
ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)gcc)))
|
ifneq (,$(strip $(wildcard $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc)))
|
||||||
HOST_CC := $(HOST_TOOLCHAIN_PREFIX)gcc
|
$(combo_2nd_arch_prefix)HOST_CC := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc
|
||||||
HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)g++
|
$(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)g++
|
||||||
HOST_AR := $(HOST_TOOLCHAIN_PREFIX)ar
|
$(combo_2nd_arch_prefix)HOST_AR := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)ar
|
||||||
endif # $(HOST_TOOLCHAIN_PREFIX)gcc exists
|
endif # $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc exists
|
||||||
|
|
||||||
|
# gcc location for clang; to be updated when clang is updated
|
||||||
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
|
||||||
|
|
||||||
HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
|
|
||||||
ifneq ($(strip $(BUILD_HOST_64bit)),)
|
|
||||||
# By default we build everything in 32-bit, because it gives us
|
|
||||||
# more consistency between the host tools and the target.
|
|
||||||
# BUILD_HOST_64bit=1 overrides it for tool like emulator
|
|
||||||
# which can benefit from 64-bit host arch.
|
|
||||||
HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack
|
|
||||||
HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack
|
|
||||||
else
|
|
||||||
# We expect SSE3 floating point math.
|
# We expect SSE3 floating point math.
|
||||||
HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack
|
||||||
HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack
|
||||||
endif # BUILD_HOST_64bit
|
|
||||||
|
|
||||||
ifneq ($(strip $(BUILD_HOST_static)),)
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
||||||
# Statically-linked binaries are desirable for sandboxed environment
|
# Statically-linked binaries are desirable for sandboxed environment
|
||||||
HOST_GLOBAL_LDFLAGS += -static
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
|
||||||
endif # BUILD_HOST_static
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
HOST_GLOBAL_CFLAGS += -fPIC \
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC \
|
||||||
-no-canonical-prefixes \
|
-no-canonical-prefixes \
|
||||||
-include $(call select-android-config-h,linux-x86)
|
-include $(call select-android-config-h,linux-x86)
|
||||||
|
|
||||||
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
|
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
|
||||||
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
||||||
|
|
||||||
# Workaround differences in inttypes.h between host and target.
|
# Workaround differences in inttypes.h between host and target.
|
||||||
# See bug 12708004.
|
# See bug 12708004.
|
||||||
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
||||||
|
|
||||||
HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
|
$(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
|
||||||
|
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
## Macros after this line are shared by the 64-bit config.
|
||||||
|
|
||||||
|
# $(1): The file to check
|
||||||
|
define get-file-size
|
||||||
|
stat --format "%s" "$(1)" | tr -d '\n'
|
||||||
|
endef
|
||||||
|
|
55
core/combo/HOST_linux-x86_64.mk
Normal file
55
core/combo/HOST_linux-x86_64.mk
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2006 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Configuration for builds hosted on linux-x86_64.
|
||||||
|
# Included by combo/select.mk
|
||||||
|
|
||||||
|
HOST_IS_64_BIT := true
|
||||||
|
|
||||||
|
ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
|
||||||
|
HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
|
||||||
|
endif
|
||||||
|
# Don't do anything if the toolchain is not there
|
||||||
|
ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)gcc)))
|
||||||
|
HOST_CC := $(HOST_TOOLCHAIN_PREFIX)gcc
|
||||||
|
HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)g++
|
||||||
|
HOST_AR := $(HOST_TOOLCHAIN_PREFIX)ar
|
||||||
|
endif # $(HOST_TOOLCHAIN_PREFIX)gcc exists
|
||||||
|
|
||||||
|
# gcc location for clang; to be updated when clang is updated
|
||||||
|
HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
|
||||||
|
|
||||||
|
HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack
|
||||||
|
HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack
|
||||||
|
|
||||||
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
||||||
|
# Statically-linked binaries are desirable for sandboxed environment
|
||||||
|
HOST_GLOBAL_LDFLAGS += -static
|
||||||
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
|
# TODO: Add AndroidConfig.h for linux-x86_64
|
||||||
|
HOST_GLOBAL_CFLAGS += -fPIC \
|
||||||
|
-no-canonical-prefixes \
|
||||||
|
-include $(call select-android-config-h,linux-x86)
|
||||||
|
|
||||||
|
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
|
||||||
|
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
||||||
|
|
||||||
|
# Workaround differences in inttypes.h between host and target.
|
||||||
|
# See bug 12708004.
|
||||||
|
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
||||||
|
|
||||||
|
HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
|
|
@ -27,32 +27,29 @@ ifneq ($(findstring Linux,$(UNAME)),)
|
||||||
ifneq ($(strip $(USE_MINGW)),)
|
ifneq ($(strip $(USE_MINGW)),)
|
||||||
HOST_ACP_UNAVAILABLE := true
|
HOST_ACP_UNAVAILABLE := true
|
||||||
TOOLS_EXE_SUFFIX :=
|
TOOLS_EXE_SUFFIX :=
|
||||||
HOST_GLOBAL_CFLAGS += -DUSE_MINGW
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW
|
||||||
ifneq ($(strip $(BUILD_HOST_64bit)),)
|
|
||||||
TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc-
|
|
||||||
HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include
|
|
||||||
HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib
|
|
||||||
else
|
|
||||||
TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-
|
TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-
|
||||||
HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include
|
$(combo_2nd_arch_prefix)HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include
|
||||||
HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib
|
||||||
endif # BUILD_HOST_64bit
|
|
||||||
endif # USE_MINGW
|
endif # USE_MINGW
|
||||||
endif # Linux
|
endif # Linux
|
||||||
|
|
||||||
# Workaround differences in inttypes.h between host and target.
|
# Workaround differences in inttypes.h between host and target.
|
||||||
# See bug 12708004.
|
# See bug 12708004.
|
||||||
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
|
||||||
|
|
||||||
HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
|
$(combo_2nd_arch_prefix)HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
|
||||||
HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
|
$(combo_2nd_arch_prefix)HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
|
||||||
HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
|
$(combo_2nd_arch_prefix)HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
|
||||||
|
|
||||||
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
|
||||||
|
-include $(call select-android-config-h,windows)
|
||||||
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += \
|
||||||
|
--enable-stdcall-fixup
|
||||||
|
|
||||||
HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows)
|
|
||||||
HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup
|
|
||||||
ifneq ($(strip $(BUILD_HOST_static)),)
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
||||||
# Statically-linked binaries are desirable for sandboxed environment
|
# Statically-linked binaries are desirable for sandboxed environment
|
||||||
HOST_GLOBAL_LDFLAGS += -static
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
|
||||||
endif # BUILD_HOST_static
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
# when building under Cygwin, ensure that we use Mingw compilation by default.
|
# when building under Cygwin, ensure that we use Mingw compilation by default.
|
||||||
|
@ -66,11 +63,14 @@ endif # BUILD_HOST_static
|
||||||
#
|
#
|
||||||
ifneq ($(findstring CYGWIN,$(UNAME)),)
|
ifneq ($(findstring CYGWIN,$(UNAME)),)
|
||||||
ifeq ($(strip $(USE_CYGWIN)),)
|
ifeq ($(strip $(USE_CYGWIN)),)
|
||||||
HOST_GLOBAL_CFLAGS += -mno-cygwin
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mno-cygwin
|
||||||
HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
## Macros after this line are shared by the 64-bit config.
|
||||||
|
|
||||||
HOST_SHLIB_SUFFIX := .dll
|
HOST_SHLIB_SUFFIX := .dll
|
||||||
HOST_EXECUTABLE_SUFFIX := .exe
|
HOST_EXECUTABLE_SUFFIX := .exe
|
||||||
|
|
||||||
|
|
68
core/combo/HOST_windows-x86_64.mk
Normal file
68
core/combo/HOST_windows-x86_64.mk
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2006 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Configuration for Windows on x86_64.
|
||||||
|
# Included by combo/select.make
|
||||||
|
|
||||||
|
# right now we get these from the environment, but we should
|
||||||
|
# pick them from the tree somewhere
|
||||||
|
TOOLS_PREFIX := #prebuilt/windows/host/bin/
|
||||||
|
TOOLS_EXE_SUFFIX := .exe
|
||||||
|
|
||||||
|
HOST_IS_64_BIT := true
|
||||||
|
|
||||||
|
# Settings to use MinGW has a cross-compiler under Linux
|
||||||
|
ifneq ($(findstring Linux,$(UNAME)),)
|
||||||
|
ifneq ($(strip $(USE_MINGW)),)
|
||||||
|
HOST_ACP_UNAVAILABLE := true
|
||||||
|
TOOLS_EXE_SUFFIX :=
|
||||||
|
HOST_GLOBAL_CFLAGS += -DUSE_MINGW
|
||||||
|
TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc-
|
||||||
|
HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include
|
||||||
|
HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib
|
||||||
|
endif # USE_MINGW
|
||||||
|
endif # Linux
|
||||||
|
|
||||||
|
# Workaround differences in inttypes.h between host and target.
|
||||||
|
# See bug 12708004.
|
||||||
|
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
|
||||||
|
|
||||||
|
HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
|
||||||
|
HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
|
||||||
|
HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
|
||||||
|
|
||||||
|
HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows)
|
||||||
|
HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup
|
||||||
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
||||||
|
# Statically-linked binaries are desirable for sandboxed environment
|
||||||
|
HOST_GLOBAL_LDFLAGS += -static
|
||||||
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
|
# when building under Cygwin, ensure that we use Mingw compilation by default.
|
||||||
|
# you can disable this (i.e. to generate Cygwin executables) by defining the
|
||||||
|
# USE_CYGWIN variable in your environment, e.g.:
|
||||||
|
#
|
||||||
|
# export USE_CYGWIN=1
|
||||||
|
#
|
||||||
|
# note that the -mno-cygwin flags are not needed when cross-compiling the
|
||||||
|
# Windows host tools on Linux
|
||||||
|
#
|
||||||
|
ifneq ($(findstring CYGWIN,$(UNAME)),)
|
||||||
|
ifeq ($(strip $(USE_CYGWIN)),)
|
||||||
|
HOST_GLOBAL_CFLAGS += -mno-cygwin
|
||||||
|
HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
|
||||||
|
endif
|
||||||
|
endif
|
50
core/combo/mac_version.mk
Normal file
50
core/combo/mac_version.mk
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# Detect Mac OS X and SDK versions.
|
||||||
|
# Output variables:
|
||||||
|
# build_mac_version
|
||||||
|
# mac_sdk_version
|
||||||
|
# mac_sdk_root
|
||||||
|
# gcc_darwin_version
|
||||||
|
|
||||||
|
ifndef build_mac_version
|
||||||
|
|
||||||
|
build_mac_version := $(shell sw_vers -productVersion)
|
||||||
|
|
||||||
|
mac_sdk_versions_supported := 10.6 10.7 10.8
|
||||||
|
ifneq ($(strip $(MAC_SDK_VERSION)),)
|
||||||
|
mac_sdk_version := $(MAC_SDK_VERSION)
|
||||||
|
ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),)
|
||||||
|
$(warning ****************************************************************)
|
||||||
|
$(warning * MAC_SDK_VERSION $(MAC_SDK_VERSION) isn't one of the supported $(mac_sdk_versions_supported))
|
||||||
|
$(warning ****************************************************************)
|
||||||
|
$(error Stop.)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
mac_sdk_versions_installed := $(shell xcodebuild -showsdks | grep macosx | sort | sed -e "s/.*macosx//g")
|
||||||
|
mac_sdk_version := $(firstword $(filter $(mac_sdk_versions_installed), $(mac_sdk_versions_supported)))
|
||||||
|
ifeq ($(mac_sdk_version),)
|
||||||
|
mac_sdk_version := $(firstword $(mac_sdk_versions_supported))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
mac_sdk_path := $(shell xcode-select -print-path)
|
||||||
|
# try /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk
|
||||||
|
# or /Volume/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk
|
||||||
|
mac_sdk_root := $(mac_sdk_path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(mac_sdk_version).sdk
|
||||||
|
ifeq ($(wildcard $(mac_sdk_root)),)
|
||||||
|
# try legacy /Developer/SDKs/MacOSX10.?.sdk
|
||||||
|
mac_sdk_root := /Developer/SDKs/MacOSX$(mac_sdk_version).sdk
|
||||||
|
endif
|
||||||
|
ifeq ($(wildcard $(mac_sdk_root)),)
|
||||||
|
$(warning *****************************************************)
|
||||||
|
$(warning * Can not find SDK $(mac_sdk_version) at $(mac_sdk_root))
|
||||||
|
$(warning *****************************************************)
|
||||||
|
$(error Stop.)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(mac_sdk_version),10.6)
|
||||||
|
gcc_darwin_version := 10
|
||||||
|
else
|
||||||
|
gcc_darwin_version := 11
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif # ifndef build_mac_version
|
|
@ -18,15 +18,11 @@
|
||||||
#
|
#
|
||||||
# Inputs:
|
# Inputs:
|
||||||
# combo_target -- prefix for final variables (HOST_ or TARGET_)
|
# combo_target -- prefix for final variables (HOST_ or TARGET_)
|
||||||
# combo_2nd_arch_prefix -- it's defined if this is loaded for TARGET_2ND_ARCH.
|
# combo_2nd_arch_prefix -- it's defined if this is loaded for the 2nd arch.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Build a target string like "linux-arm" or "darwin-x86".
|
# Build a target string like "linux-arm" or "darwin-x86".
|
||||||
ifdef combo_2nd_arch_prefix
|
combo_os_arch := $($(combo_target)OS)-$($(combo_target)$(combo_2nd_arch_prefix)ARCH)
|
||||||
combo_os_arch := $($(combo_target)OS)-$(TARGET_2ND_ARCH)
|
|
||||||
else
|
|
||||||
combo_os_arch := $($(combo_target)OS)-$($(combo_target)ARCH)
|
|
||||||
endif
|
|
||||||
|
|
||||||
combo_var_prefix := $(combo_2nd_arch_prefix)$(combo_target)
|
combo_var_prefix := $(combo_2nd_arch_prefix)$(combo_target)
|
||||||
|
|
||||||
|
@ -90,7 +86,7 @@ ifneq ($(USE_CCACHE),)
|
||||||
# If we are cross-compiling Windows binaries on Linux
|
# If we are cross-compiling Windows binaries on Linux
|
||||||
# then use the linux ccache binary instead.
|
# then use the linux ccache binary instead.
|
||||||
ifeq ($(HOST_OS)-$(BUILD_OS),windows-linux)
|
ifeq ($(HOST_OS)-$(BUILD_OS),windows-linux)
|
||||||
CCACHE_HOST_TAG := linux-$(BUILD_ARCH)
|
CCACHE_HOST_TAG := linux-$(HOST_PREBUILT_ARCH)
|
||||||
endif
|
endif
|
||||||
ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache
|
ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache
|
||||||
# Check that the executable is here.
|
# Check that the executable is here.
|
||||||
|
|
|
@ -217,6 +217,13 @@ combo_target := HOST_
|
||||||
combo_2nd_arch_prefix :=
|
combo_2nd_arch_prefix :=
|
||||||
include $(BUILD_SYSTEM)/combo/select.mk
|
include $(BUILD_SYSTEM)/combo/select.mk
|
||||||
|
|
||||||
|
# Load the 2nd host arch if it's needed.
|
||||||
|
ifdef HOST_2ND_ARCH
|
||||||
|
combo_target := HOST_
|
||||||
|
combo_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX)
|
||||||
|
include $(BUILD_SYSTEM)/combo/select.mk
|
||||||
|
endif
|
||||||
|
|
||||||
# on windows, the tools have .exe at the end, and we depend on the
|
# on windows, the tools have .exe at the end, and we depend on the
|
||||||
# host config stuff being done first
|
# host config stuff being done first
|
||||||
|
|
||||||
|
@ -357,7 +364,7 @@ LEX := prebuilts/misc/$(BUILD_OS)-$(BUILD_ARCH)/flex/flex-2.5.39
|
||||||
# To run bison from elsewhere you need to set up enviromental variable
|
# To run bison from elsewhere you need to set up enviromental variable
|
||||||
# BISON_PKGDATADIR.
|
# BISON_PKGDATADIR.
|
||||||
BISON_PKGDATADIR := $(PWD)/external/bison/data
|
BISON_PKGDATADIR := $(PWD)/external/bison/data
|
||||||
BISON := prebuilts/misc/$(BUILD_OS)-$(BUILD_ARCH)/bison/bison
|
BISON := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/bison/bison
|
||||||
YACC := $(BISON) -d
|
YACC := $(BISON) -d
|
||||||
|
|
||||||
DOXYGEN:= doxygen
|
DOXYGEN:= doxygen
|
||||||
|
@ -501,6 +508,17 @@ $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS += $($(TARGET_2ND_ARCH_VAR_PRE
|
||||||
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS += $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CPPFLAGS)
|
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS += $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CPPFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef HOST_2ND_ARCH
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS += -L$($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_PROJECT_INCLUDES := $(HOST_PROJECT_INCLUDES)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CFLAGS += $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CFLAGS)
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CPPFLAGS += $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CPPFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
# allow overriding default Java libraries on a per-target basis
|
# allow overriding default Java libraries on a per-target basis
|
||||||
ifeq ($(TARGET_DEFAULT_JAVA_LIBRARIES),)
|
ifeq ($(TARGET_DEFAULT_JAVA_LIBRARIES),)
|
||||||
TARGET_DEFAULT_JAVA_LIBRARIES := core core-junit ext framework framework2
|
TARGET_DEFAULT_JAVA_LIBRARIES := core core-junit ext framework framework2
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
my_multilib_stem := $(LOCAL_MODULE_STEM_$(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_IS_64_BIT),64,32))
|
my_multilib_stem := $(LOCAL_MODULE_STEM_$(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32))
|
||||||
ifdef my_multilib_stem
|
ifdef my_multilib_stem
|
||||||
LOCAL_MODULE_STEM := $(my_multilib_stem)
|
LOCAL_MODULE_STEM := $(my_multilib_stem)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -426,7 +426,7 @@ $(strip \
|
||||||
$(eval _idf2ndArchPrefix := $(if $(call directory_is_64_bit_blacklisted,$(LOCAL_PATH))$(strip $(5)),$(TARGET_2ND_ARCH_VAR_PREFIX))) \
|
$(eval _idf2ndArchPrefix := $(if $(call directory_is_64_bit_blacklisted,$(LOCAL_PATH))$(strip $(5)),$(TARGET_2ND_ARCH_VAR_PREFIX))) \
|
||||||
$(if $(filter $(_idfPrefix)-$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \
|
$(if $(filter $(_idfPrefix)-$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \
|
||||||
$(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_INTERMEDIATES)) \
|
$(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_INTERMEDIATES)) \
|
||||||
,$(if $(filter $(_idfPrefix)-$(_idfClass),TARGET-SHARED_LIBRARIES TARGET-STATIC_LIBRARIES TARGET-EXECUTABLES TARGET-GYP),\
|
,$(if $(filter $(_idfClass),SHARED_LIBRARIES STATIC_LIBRARIES EXECUTABLES GYP),\
|
||||||
$(eval _idfIntBase := $($(_idf2ndArchPrefix)$(_idfPrefix)_OUT_INTERMEDIATES)) \
|
$(eval _idfIntBase := $($(_idf2ndArchPrefix)$(_idfPrefix)_OUT_INTERMEDIATES)) \
|
||||||
,$(eval _idfIntBase := $($(_idfPrefix)_OUT_INTERMEDIATES)) \
|
,$(eval _idfIntBase := $($(_idfPrefix)_OUT_INTERMEDIATES)) \
|
||||||
) \
|
) \
|
||||||
|
@ -1170,7 +1170,7 @@ $(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs;
|
||||||
rm -rf $$ldir; \
|
rm -rf $$ldir; \
|
||||||
mkdir -p $$ldir; \
|
mkdir -p $$ldir; \
|
||||||
filelist=; \
|
filelist=; \
|
||||||
for f in `$(TARGET_AR) t $(1)`; do \
|
for f in `$($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_AR) t $(1)`; do \
|
||||||
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_AR) p $(1) $$f > $$ldir/$$f; \
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_AR) p $(1) $$f > $$ldir/$$f; \
|
||||||
filelist="$$filelist $$ldir/$$f"; \
|
filelist="$$filelist $$ldir/$$f"; \
|
||||||
done ; \
|
done ; \
|
||||||
|
@ -1191,7 +1191,8 @@ define transform-o-to-static-lib
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(extract-and-include-target-whole-static-libs)
|
$(extract-and-include-target-whole-static-libs)
|
||||||
@echo "target StaticLib: $(PRIVATE_MODULE) ($@)"
|
@echo "target StaticLib: $(PRIVATE_MODULE) ($@)"
|
||||||
$(call split-long-arguments,$($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_AR) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_ARFLAGS) \
|
$(call split-long-arguments,$($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_AR) \
|
||||||
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_ARFLAGS) \
|
||||||
$(PRIVATE_ARFLAGS) $@,$(filter %.o, $^))
|
$(PRIVATE_ARFLAGS) $@,$(filter %.o, $^))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -1206,11 +1207,12 @@ $(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs;
|
||||||
rm -rf $$ldir; \
|
rm -rf $$ldir; \
|
||||||
mkdir -p $$ldir; \
|
mkdir -p $$ldir; \
|
||||||
filelist=; \
|
filelist=; \
|
||||||
for f in `$(HOST_AR) t $(1) | \grep '\.o$$'`; do \
|
for f in `$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_AR) t $(1) | \grep '\.o$$'`; do \
|
||||||
$(HOST_AR) p $(1) $$f > $$ldir/$$f; \
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_AR) p $(1) $$f > $$ldir/$$f; \
|
||||||
filelist="$$filelist $$ldir/$$f"; \
|
filelist="$$filelist $$ldir/$$f"; \
|
||||||
done ; \
|
done ; \
|
||||||
$(HOST_AR) $(HOST_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $$filelist
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_AR) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_ARFLAGS) \
|
||||||
|
$(PRIVATE_ARFLAGS) $@ $$filelist
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -1226,7 +1228,9 @@ define transform-host-o-to-static-lib
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(extract-and-include-host-whole-static-libs)
|
$(extract-and-include-host-whole-static-libs)
|
||||||
@echo "host StaticLib: $(PRIVATE_MODULE) ($@)"
|
@echo "host StaticLib: $(PRIVATE_MODULE) ($@)"
|
||||||
$(call split-long-arguments,$(HOST_AR) $(HOST_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@,$(filter %.o, $^))
|
$(call split-long-arguments,$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_AR) \
|
||||||
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_ARFLAGS) \
|
||||||
|
$(PRIVATE_ARFLAGS) $@,$(filter %.o, $^))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
@ -1239,10 +1243,10 @@ endef
|
||||||
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
|
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
|
||||||
define transform-host-o-to-shared-lib-inner
|
define transform-host-o-to-shared-lib-inner
|
||||||
$(hide) $(PRIVATE_CXX) \
|
$(hide) $(PRIVATE_CXX) \
|
||||||
-Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \
|
-Wl,-rpath-link=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES) \
|
||||||
-Wl,-rpath,\$$ORIGIN/../lib \
|
-Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
|
||||||
-shared -Wl,-soname,$(notdir $@) \
|
-shared -Wl,-soname,$(notdir $@) \
|
||||||
$(HOST_GLOBAL_LD_DIRS) \
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \
|
||||||
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
||||||
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
||||||
) \
|
) \
|
||||||
|
@ -1412,9 +1416,9 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
|
$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
|
||||||
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
|
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
|
||||||
$(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
|
$(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
|
||||||
-Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \
|
-Wl,-rpath-link=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES) \
|
||||||
-Wl,-rpath,\$$ORIGIN/../lib \
|
-Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
|
||||||
$(HOST_GLOBAL_LD_DIRS) \
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \
|
||||||
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
||||||
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
||||||
$(HOST_FPIE_FLAGS) \
|
$(HOST_FPIE_FLAGS) \
|
||||||
|
|
|
@ -41,8 +41,6 @@ LOCAL_INTERMEDIATE_TARGETS := $(linked_module)
|
||||||
include $(BUILD_SYSTEM)/binary.mk
|
include $(BUILD_SYSTEM)/binary.mk
|
||||||
###################################
|
###################################
|
||||||
|
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
|
||||||
|
|
||||||
# Make sure that our guess at the value of intermediates was correct.
|
# Make sure that our guess at the value of intermediates was correct.
|
||||||
ifneq ($(intermediates),$(guessed_intermediates))
|
ifneq ($(intermediates),$(guessed_intermediates))
|
||||||
$(error Internal error: guessed path '$(guessed_intermediates)' doesn't match '$(intermediates))
|
$(error Internal error: guessed path '$(guessed_intermediates)' doesn't match '$(intermediates))
|
||||||
|
|
|
@ -69,15 +69,24 @@ endif
|
||||||
|
|
||||||
|
|
||||||
# HOST_ARCH
|
# HOST_ARCH
|
||||||
ifneq (,$(findstring 86,$(UNAME)))
|
ifneq (,$(findstring x86_64,$(UNAME)))
|
||||||
|
# TODO: Replace BUILD_HOST_64bit with a flag that forces 32-bit build,
|
||||||
|
# after we default to 64-bit host build.
|
||||||
|
ifeq (,$(BUILD_HOST_64bit))
|
||||||
HOST_ARCH := x86
|
HOST_ARCH := x86
|
||||||
|
HOST_2ND_ARCH :=
|
||||||
|
else
|
||||||
|
HOST_ARCH := x86_64
|
||||||
|
HOST_2ND_ARCH := x86
|
||||||
endif
|
endif
|
||||||
|
else ifneq (,$(findstring 86,$(UNAME)))
|
||||||
ifneq (,$(findstring Power,$(UNAME)))
|
# It's not officially supported!
|
||||||
HOST_ARCH := ppc
|
HOST_ARCH := x86
|
||||||
|
HOST_2ND_ARCH :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BUILD_ARCH := $(HOST_ARCH)
|
BUILD_ARCH := $(HOST_ARCH)
|
||||||
|
BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
|
||||||
|
|
||||||
ifeq ($(HOST_ARCH),)
|
ifeq ($(HOST_ARCH),)
|
||||||
$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
|
$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
|
||||||
|
@ -94,12 +103,14 @@ $(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
|
||||||
|
HOST_PREBUILT_ARCH := x86
|
||||||
# This is the standard way to name a directory containing prebuilt host
|
# This is the standard way to name a directory containing prebuilt host
|
||||||
# objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
|
# objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
|
||||||
ifeq ($(HOST_OS),windows)
|
ifeq ($(HOST_OS),windows)
|
||||||
HOST_PREBUILT_TAG := windows
|
HOST_PREBUILT_TAG := windows
|
||||||
else
|
else
|
||||||
HOST_PREBUILT_TAG := $(HOST_OS)-$(HOST_ARCH)
|
HOST_PREBUILT_TAG := $(HOST_OS)-$(HOST_PREBUILT_ARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# TARGET_COPY_OUT_* are all relative to the staging directory, ie PRODUCT_OUT.
|
# TARGET_COPY_OUT_* are all relative to the staging directory, ie PRODUCT_OUT.
|
||||||
|
@ -180,11 +191,12 @@ HOST_OUT_ROOT_release := $(OUT_DIR)/host
|
||||||
HOST_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/host
|
HOST_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/host
|
||||||
HOST_OUT_ROOT := $(HOST_OUT_ROOT_$(HOST_BUILD_TYPE))
|
HOST_OUT_ROOT := $(HOST_OUT_ROOT_$(HOST_BUILD_TYPE))
|
||||||
|
|
||||||
HOST_OUT_release := $(HOST_OUT_ROOT_release)/$(HOST_OS)-$(HOST_ARCH)
|
# We want to avoid two host bin directories in multilib build.
|
||||||
HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_ARCH)
|
HOST_OUT_release := $(HOST_OUT_ROOT_release)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
|
||||||
|
HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
|
||||||
HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
|
HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
|
||||||
|
|
||||||
BUILD_OUT := $(OUT_DIR)/host/$(BUILD_OS)-$(BUILD_ARCH)
|
BUILD_OUT := $(OUT_DIR)/host/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)
|
||||||
|
|
||||||
TARGET_PRODUCT_OUT_ROOT := $(TARGET_OUT_ROOT)/product
|
TARGET_PRODUCT_OUT_ROOT := $(TARGET_OUT_ROOT)/product
|
||||||
|
|
||||||
|
@ -211,6 +223,15 @@ HOST_OUT_COMMON_INTERMEDIATES := $(HOST_COMMON_OUT_ROOT)/obj
|
||||||
HOST_OUT_GEN := $(HOST_OUT)/gen
|
HOST_OUT_GEN := $(HOST_OUT)/gen
|
||||||
HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
|
HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
|
||||||
|
|
||||||
|
# Out for HOST_2ND_ARCH
|
||||||
|
HOST_2ND_ARCH_VAR_PREFIX := 2ND_
|
||||||
|
HOST_2ND_ARCH_MODULE_SUFFIX := _32
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj32
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES := $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES)/lib
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib32
|
||||||
|
$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES)
|
||||||
|
|
||||||
|
|
||||||
TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj
|
TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj
|
||||||
TARGET_OUT_HEADERS := $(TARGET_OUT_INTERMEDIATES)/include
|
TARGET_OUT_HEADERS := $(TARGET_OUT_INTERMEDIATES)/include
|
||||||
TARGET_OUT_INTERMEDIATE_LIBRARIES := $(TARGET_OUT_INTERMEDIATES)/lib
|
TARGET_OUT_INTERMEDIATE_LIBRARIES := $(TARGET_OUT_INTERMEDIATES)/lib
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
# LOCAL_MODULE_PATH_32 and LOCAL_MODULE_PATH_64 or LOCAL_MODULE_STEM_32 and
|
# LOCAL_MODULE_PATH_32 and LOCAL_MODULE_PATH_64 or LOCAL_MODULE_STEM_32 and
|
||||||
# LOCAL_MODULE_STEM_64
|
# LOCAL_MODULE_STEM_64
|
||||||
|
|
||||||
|
my_prefix := TARGET_
|
||||||
include $(BUILD_SYSTEM)/multilib.mk
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
|
|
||||||
ifeq ($(my_module_multilib),both)
|
ifeq ($(my_module_multilib),both)
|
||||||
|
|
|
@ -1,33 +1,47 @@
|
||||||
###########################################################
|
|
||||||
## Standard rules for building an executable file.
|
|
||||||
##
|
|
||||||
## Additional inputs from base_rules.make:
|
|
||||||
## None.
|
|
||||||
###########################################################
|
|
||||||
|
|
||||||
LOCAL_IS_HOST_MODULE := true
|
my_prefix := HOST_
|
||||||
ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
LOCAL_MODULE_CLASS := EXECUTABLES
|
|
||||||
endif
|
ifndef my_module_multilib
|
||||||
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
|
# By default we only build host module for the first arch.
|
||||||
LOCAL_MODULE_SUFFIX := $(HOST_EXECUTABLE_SUFFIX)
|
my_module_multilib := first
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(call host-executable-hook)
|
ifeq ($(my_module_multilib),both)
|
||||||
|
ifeq ($(LOCAL_MODULE_PATH_32)$(LOCAL_MODULE_STEM_32),)
|
||||||
skip_build_from_source :=
|
$(error $(LOCAL_PATH): LOCAL_MODULE_STEM_32 or LOCAL_MODULE_PATH_32 is required for LOCAL_MULTILIB := both for module $(LOCAL_MODULE))
|
||||||
ifdef LOCAL_PREBUILT_MODULE_FILE
|
|
||||||
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
|
|
||||||
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
|
||||||
skip_build_from_source := true
|
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(LOCAL_MODULE_PATH_64)$(LOCAL_MODULE_STEM_64),)
|
||||||
|
$(error $(LOCAL_PATH): LOCAL_MODULE_STEM_64 or LOCAL_MODULE_PATH_64 is required for LOCAL_MULTILIB := both for module $(LOCAL_MODULE))
|
||||||
|
endif
|
||||||
|
else #!LOCAL_MULTILIB == both
|
||||||
|
LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef skip_build_from_source
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/binary.mk
|
ifeq ($(my_module_arch_supported),true)
|
||||||
|
include $(BUILD_SYSTEM)/host_executable_internal.mk
|
||||||
|
endif
|
||||||
|
|
||||||
$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries)
|
ifdef HOST_2ND_ARCH
|
||||||
$(transform-host-o-to-executable)
|
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
|
||||||
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
|
ifeq ($(my_module_arch_supported),true)
|
||||||
|
# Build for HOST_2ND_ARCH
|
||||||
|
OVERRIDE_BUILT_MODULE_PATH :=
|
||||||
|
LOCAL_BUILT_MODULE :=
|
||||||
|
LOCAL_INSTALLED_MODULE :=
|
||||||
|
LOCAL_MODULE_STEM :=
|
||||||
|
LOCAL_BUILT_MODULE_STEM :=
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM :=
|
||||||
|
LOCAL_INTERMEDIATE_TARGETS :=
|
||||||
|
|
||||||
endif # skip_build_from_source
|
include $(BUILD_SYSTEM)/host_executable_internal.mk
|
||||||
|
endif
|
||||||
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
endif # HOST_2ND_ARCH
|
||||||
|
|
||||||
|
LOCAL_NO_2ND_ARCH_MODULE_SUFFIX :=
|
||||||
|
my_module_arch_supported :=
|
||||||
|
|
33
core/host_executable_internal.mk
Normal file
33
core/host_executable_internal.mk
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
###########################################################
|
||||||
|
## Standard rules for building an executable file.
|
||||||
|
##
|
||||||
|
## Additional inputs from base_rules.make:
|
||||||
|
## None.
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
LOCAL_IS_HOST_MODULE := true
|
||||||
|
ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
|
||||||
|
LOCAL_MODULE_CLASS := EXECUTABLES
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
|
||||||
|
LOCAL_MODULE_SUFFIX := $(HOST_EXECUTABLE_SUFFIX)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(call host-executable-hook)
|
||||||
|
|
||||||
|
skip_build_from_source :=
|
||||||
|
ifdef LOCAL_PREBUILT_MODULE_FILE
|
||||||
|
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
|
||||||
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
||||||
|
skip_build_from_source := true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef skip_build_from_source
|
||||||
|
|
||||||
|
include $(BUILD_SYSTEM)/binary.mk
|
||||||
|
|
||||||
|
$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries)
|
||||||
|
$(transform-host-o-to-executable)
|
||||||
|
|
||||||
|
endif # skip_build_from_source
|
|
@ -1,49 +1,37 @@
|
||||||
###########################################################
|
my_prefix := HOST_
|
||||||
## Standard rules for building a normal shared library.
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
##
|
|
||||||
## Additional inputs from base_rules.make:
|
|
||||||
## None.
|
|
||||||
##
|
|
||||||
## LOCAL_MODULE_SUFFIX will be set for you.
|
|
||||||
###########################################################
|
|
||||||
|
|
||||||
LOCAL_IS_HOST_MODULE := true
|
ifndef my_module_multilib
|
||||||
|
# By default we only build host module for the first arch.
|
||||||
ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
|
my_module_multilib := first
|
||||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
|
||||||
endif
|
|
||||||
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
|
|
||||||
LOCAL_MODULE_SUFFIX := $(HOST_SHLIB_SUFFIX)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(OVERRIDE_BUILT_MODULE_PATH)),)
|
|
||||||
$(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
|
|
||||||
$(error $(LOCAL_PATH): Cannot set module stem for a library)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(call host-shared-library-hook)
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
|
|
||||||
skip_build_from_source :=
|
ifeq ($(my_module_arch_supported),true)
|
||||||
ifdef LOCAL_PREBUILT_MODULE_FILE
|
include $(BUILD_SYSTEM)/host_shared_library_internal.mk
|
||||||
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
|
|
||||||
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
|
||||||
skip_build_from_source := true
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef skip_build_from_source
|
ifdef HOST_2ND_ARCH
|
||||||
|
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
|
||||||
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
|
ifeq ($(my_module_arch_supported),true)
|
||||||
|
# Build for HOST_2ND_ARCH
|
||||||
|
OVERRIDE_BUILT_MODULE_PATH :=
|
||||||
|
LOCAL_BUILT_MODULE :=
|
||||||
|
LOCAL_INSTALLED_MODULE :=
|
||||||
|
LOCAL_MODULE_STEM :=
|
||||||
|
LOCAL_BUILT_MODULE_STEM :=
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM :=
|
||||||
|
LOCAL_INTERMEDIATE_TARGETS :=
|
||||||
|
|
||||||
# Put the built modules of all shared libraries in a common directory
|
include $(BUILD_SYSTEM)/host_shared_library_internal.mk
|
||||||
# to simplify the link line.
|
endif
|
||||||
OVERRIDE_BUILT_MODULE_PATH := $(HOST_OUT_INTERMEDIATE_LIBRARIES)
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
endif # HOST_2ND_ARCH
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/binary.mk
|
my_module_arch_supported :=
|
||||||
|
|
||||||
$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries) $(LOCAL_ADDITIONAL_DEPENDENCIES)
|
|
||||||
$(transform-host-o-to-shared-lib)
|
|
||||||
|
|
||||||
endif # skip_build_from_source
|
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## Copy headers to the install tree
|
## Copy headers to the install tree
|
||||||
|
|
46
core/host_shared_library_internal.mk
Normal file
46
core/host_shared_library_internal.mk
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
###########################################################
|
||||||
|
## Standard rules for building a normal shared library.
|
||||||
|
##
|
||||||
|
## Additional inputs from base_rules.make:
|
||||||
|
## None.
|
||||||
|
##
|
||||||
|
## LOCAL_MODULE_SUFFIX will be set for you.
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
LOCAL_IS_HOST_MODULE := true
|
||||||
|
|
||||||
|
ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
|
||||||
|
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
|
||||||
|
LOCAL_MODULE_SUFFIX := $(HOST_SHLIB_SUFFIX)
|
||||||
|
endif
|
||||||
|
ifneq ($(strip $(OVERRIDE_BUILT_MODULE_PATH)),)
|
||||||
|
$(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH)
|
||||||
|
endif
|
||||||
|
ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
|
||||||
|
$(error $(LOCAL_PATH): Cannot set module stem for a library)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(call host-shared-library-hook)
|
||||||
|
|
||||||
|
skip_build_from_source :=
|
||||||
|
ifdef LOCAL_PREBUILT_MODULE_FILE
|
||||||
|
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
|
||||||
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
||||||
|
skip_build_from_source := true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef skip_build_from_source
|
||||||
|
|
||||||
|
# Put the built modules of all shared libraries in a common directory
|
||||||
|
# to simplify the link line.
|
||||||
|
OVERRIDE_BUILT_MODULE_PATH := $($(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)
|
||||||
|
|
||||||
|
include $(BUILD_SYSTEM)/binary.mk
|
||||||
|
|
||||||
|
$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries) $(LOCAL_ADDITIONAL_DEPENDENCIES)
|
||||||
|
$(transform-host-o-to-shared-lib)
|
||||||
|
|
||||||
|
endif # skip_build_from_source
|
|
@ -1,30 +1,37 @@
|
||||||
###########################################################
|
my_prefix := HOST_
|
||||||
## Standard rules for building a static library for the host.
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
##
|
|
||||||
## Additional inputs from base_rules.make:
|
|
||||||
## None.
|
|
||||||
##
|
|
||||||
## LOCAL_MODULE_SUFFIX will be set for you.
|
|
||||||
###########################################################
|
|
||||||
|
|
||||||
ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
|
ifndef my_module_multilib
|
||||||
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
# By default we only build host module for the first arch.
|
||||||
|
my_module_multilib := first
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
|
|
||||||
LOCAL_MODULE_SUFFIX := .a
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
|
|
||||||
|
ifeq ($(my_module_arch_supported),true)
|
||||||
|
include $(BUILD_SYSTEM)/host_static_library_internal.mk
|
||||||
endif
|
endif
|
||||||
ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
|
|
||||||
$(error $(LOCAL_PATH): Cannot set module stem for a library)
|
ifdef HOST_2ND_ARCH
|
||||||
|
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
|
||||||
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
|
ifeq ($(my_module_arch_supported),true)
|
||||||
|
# Build for HOST_2ND_ARCH
|
||||||
|
OVERRIDE_BUILT_MODULE_PATH :=
|
||||||
|
LOCAL_BUILT_MODULE :=
|
||||||
|
LOCAL_INSTALLED_MODULE :=
|
||||||
|
LOCAL_MODULE_STEM :=
|
||||||
|
LOCAL_BUILT_MODULE_STEM :=
|
||||||
|
LOCAL_INSTALLED_MODULE_STEM :=
|
||||||
|
LOCAL_INTERMEDIATE_TARGETS :=
|
||||||
|
|
||||||
|
include $(BUILD_SYSTEM)/host_static_library_internal.mk
|
||||||
endif
|
endif
|
||||||
LOCAL_UNINSTALLABLE_MODULE := true
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
endif # HOST_2ND_ARCH
|
||||||
|
|
||||||
LOCAL_IS_HOST_MODULE := true
|
my_module_arch_supported :=
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/binary.mk
|
|
||||||
|
|
||||||
$(LOCAL_BUILT_MODULE): $(built_whole_libraries)
|
|
||||||
$(LOCAL_BUILT_MODULE): $(all_objects)
|
|
||||||
$(transform-host-o-to-static-lib)
|
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## Copy headers to the install tree
|
## Copy headers to the install tree
|
||||||
|
|
27
core/host_static_library_internal.mk
Normal file
27
core/host_static_library_internal.mk
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
###########################################################
|
||||||
|
## Standard rules for building a static library for the host.
|
||||||
|
##
|
||||||
|
## Additional inputs from base_rules.make:
|
||||||
|
## None.
|
||||||
|
##
|
||||||
|
## LOCAL_MODULE_SUFFIX will be set for you.
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
|
||||||
|
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
|
||||||
|
LOCAL_MODULE_SUFFIX := .a
|
||||||
|
endif
|
||||||
|
ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
|
||||||
|
$(error $(LOCAL_PATH): Cannot set module stem for a library)
|
||||||
|
endif
|
||||||
|
LOCAL_UNINSTALLABLE_MODULE := true
|
||||||
|
|
||||||
|
LOCAL_IS_HOST_MODULE := true
|
||||||
|
|
||||||
|
include $(BUILD_SYSTEM)/binary.mk
|
||||||
|
|
||||||
|
$(LOCAL_BUILT_MODULE): $(built_whole_libraries)
|
||||||
|
$(LOCAL_BUILT_MODULE): $(all_objects)
|
||||||
|
$(transform-host-o-to-static-lib)
|
|
@ -110,7 +110,6 @@ ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))
|
||||||
$(info Checking build tools versions...)
|
$(info Checking build tools versions...)
|
||||||
|
|
||||||
ifneq ($(HOST_OS),windows)
|
ifneq ($(HOST_OS),windows)
|
||||||
ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
|
|
||||||
# check for a case sensitive file system
|
# check for a case sensitive file system
|
||||||
ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \
|
ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \
|
||||||
echo a > $(OUT_DIR)/casecheck.txt; \
|
echo a > $(OUT_DIR)/casecheck.txt; \
|
||||||
|
@ -123,7 +122,6 @@ $(warning ************************************************************)
|
||||||
$(error Case-insensitive filesystems not supported)
|
$(error Case-insensitive filesystems not supported)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Make sure that there are no spaces in the absolute path; the
|
# Make sure that there are no spaces in the absolute path; the
|
||||||
# build system can't deal with them.
|
# build system can't deal with them.
|
||||||
|
@ -450,12 +448,6 @@ $(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Bring in all modules that need to be built.
|
# Bring in all modules that need to be built.
|
||||||
ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
|
|
||||||
SDK_ONLY := true
|
|
||||||
$(info Building the SDK under darwin-ppc is actually obsolete and unsupported.)
|
|
||||||
$(error stop)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(HOST_OS),windows)
|
ifeq ($(HOST_OS),windows)
|
||||||
SDK_ONLY := true
|
SDK_ONLY := true
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -2,14 +2,15 @@
|
||||||
## Determine if a module can be built for an arch
|
## Determine if a module can be built for an arch
|
||||||
##
|
##
|
||||||
## Inputs from module makefile:
|
## Inputs from module makefile:
|
||||||
|
## my_prefix TARGET_ or HOST_
|
||||||
## my_module_multilib
|
## my_module_multilib
|
||||||
## LOCAL_MODULE_TARGET_ARCH
|
## LOCAL_MODULE_$(my_prefix)ARCH
|
||||||
## LOCAL_MODULE_TARGET_ARCH_WARN
|
## LOCAL_MODULE_$(my_prefix)ARCH_WARN
|
||||||
## LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH
|
## LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH
|
||||||
## LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN
|
## LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH_WARN
|
||||||
##
|
##
|
||||||
## Inputs from build system:
|
## Inputs from build system:
|
||||||
## TARGET_IS_64_BIT
|
## $(my_prefix)IS_64_BIT
|
||||||
## LOCAL_2ND_ARCH_VAR_PREFIX
|
## LOCAL_2ND_ARCH_VAR_PREFIX
|
||||||
##
|
##
|
||||||
## Outputs:
|
## Outputs:
|
||||||
|
@ -23,9 +24,9 @@ my_module_arch_supported := false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(LOCAL_2ND_ARCH_VAR_PREFIX),)
|
ifeq ($(LOCAL_2ND_ARCH_VAR_PREFIX),)
|
||||||
ifeq ($(TARGET_IS_64_BIT)|$(my_module_multilib),true|32)
|
ifeq ($($(my_prefix)IS_64_BIT)|$(my_module_multilib),true|32)
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
else ifeq ($(TARGET_IS_64_BIT)|$(my_module_multilib),|64)
|
else ifeq ($($(my_prefix)IS_64_BIT)|$(my_module_multilib),|64)
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
else ifeq ($(call directory_is_64_bit_blacklisted,$(LOCAL_PATH)),true)
|
else ifeq ($(call directory_is_64_bit_blacklisted,$(LOCAL_PATH)),true)
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
|
@ -38,24 +39,24 @@ my_module_arch_supported := false
|
||||||
endif
|
endif
|
||||||
endif # LOCAL_2ND_ARCH_VAR_PREFIX
|
endif # LOCAL_2ND_ARCH_VAR_PREFIX
|
||||||
|
|
||||||
ifneq (,$(LOCAL_MODULE_TARGET_ARCH))
|
ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH))
|
||||||
ifeq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_TARGET_ARCH)))
|
ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH)))
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(LOCAL_MODULE_TARGET_ARCH_WARN))
|
ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH_WARN))
|
||||||
ifeq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_TARGET_ARCH_WARN)))
|
ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH_WARN)))
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
$(warning $(LOCAL_MODULE): architecture $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) not supported)
|
$(warning $(LOCAL_MODULE): architecture $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) not supported)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH)))
|
ifneq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH)))
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN)))
|
ifneq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH_WARN)))
|
||||||
my_module_arch_supported := false
|
my_module_arch_supported := false
|
||||||
$(warning $(LOCAL_MODULE): architecture $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) unsupported)
|
$(warning $(LOCAL_MODULE): architecture $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) unsupported)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
# By default, an package is built for TARGET_ARCH.
|
# By default, an package is built for TARGET_ARCH.
|
||||||
# To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32".
|
# To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32".
|
||||||
|
|
||||||
|
my_prefix := TARGET_
|
||||||
include $(BUILD_SYSTEM)/multilib.mk
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
|
|
||||||
ifeq ($(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true)
|
ifeq ($(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true)
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
ifdef LOCAL_IS_HOST_MODULE
|
ifdef LOCAL_IS_HOST_MODULE
|
||||||
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
my_prefix := HOST_
|
||||||
else #!LOCAL_IS_HOST_MODULE
|
else
|
||||||
|
my_prefix := TARGET_
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/multilib.mk
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
|
|
||||||
|
@ -23,16 +25,15 @@ include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
ifeq ($(my_module_arch_supported),true)
|
ifeq ($(my_module_arch_supported),true)
|
||||||
# first arch is supported
|
# first arch is supported
|
||||||
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
||||||
else ifneq (,$(TARGET_2ND_ARCH))
|
else ifneq (,$($(my_prefix)2ND_ARCH))
|
||||||
# check if secondary arch is supported
|
# check if secondary arch is supported
|
||||||
LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX)
|
||||||
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
||||||
ifeq ($(my_module_arch_supported),true)
|
ifeq ($(my_module_arch_supported),true)
|
||||||
# secondary arch is supported
|
# secondary arch is supported
|
||||||
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
||||||
endif
|
endif
|
||||||
endif # TARGET_2ND_ARCH
|
endif # $(my_prefix)2ND_ARCH
|
||||||
endif # !LOCAL_IS_HOST_MODULE
|
|
||||||
|
|
||||||
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
|
||||||
|
|
|
@ -22,18 +22,13 @@ LOCAL_DONT_CHECK_MODULE := true
|
||||||
ifdef LOCAL_PREBUILT_MODULE_FILE
|
ifdef LOCAL_PREBUILT_MODULE_FILE
|
||||||
my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE)
|
my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE)
|
||||||
else
|
else
|
||||||
ifdef LOCAL_SRC_FILES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
|
ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
|
||||||
my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
|
my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
|
||||||
else
|
else
|
||||||
my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
|
my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef LOCAL_IS_HOST_MODULE
|
|
||||||
my_prefix := HOST_
|
|
||||||
else
|
|
||||||
my_prefix := TARGET_
|
|
||||||
endif
|
|
||||||
ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS))
|
ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS))
|
||||||
# Put the built targets of all shared libraries in a common directory
|
# Put the built targets of all shared libraries in a common directory
|
||||||
# to simplify the link line.
|
# to simplify the link line.
|
||||||
|
|
|
@ -164,7 +164,7 @@ endif # unbundled_goals
|
||||||
|
|
||||||
# Default to building dalvikvm on hosts that support it...
|
# Default to building dalvikvm on hosts that support it...
|
||||||
ifeq ($(HOST_OS),linux)
|
ifeq ($(HOST_OS),linux)
|
||||||
ifeq ($(BUILD_HOST_64bit),)
|
ifneq ($(HOST_ARCH),x86_64)
|
||||||
# ... or if the if the option is already set
|
# ... or if the if the option is already set
|
||||||
ifeq ($(WITH_HOST_DALVIK),)
|
ifeq ($(WITH_HOST_DALVIK),)
|
||||||
WITH_HOST_DALVIK := true
|
WITH_HOST_DALVIK := true
|
||||||
|
|
|
@ -10,6 +10,7 @@ $(warning $(LOCAL_MODULE): LOCAL_UNSTRIPPED_PATH for shared libraries is unsuppo
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
my_prefix := TARGET_
|
||||||
include $(BUILD_SYSTEM)/multilib.mk
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
|
|
||||||
ifndef my_module_multilib
|
ifndef my_module_multilib
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
my_prefix := TARGET_
|
||||||
include $(BUILD_SYSTEM)/multilib.mk
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
|
|
||||||
ifndef my_module_multilib
|
ifndef my_module_multilib
|
||||||
|
|
|
@ -28,7 +28,6 @@ $(all_objects) : PRIVATE_TARGET_GLOBAL_CFLAGS :=
|
||||||
$(all_objects) : PRIVATE_TARGET_GLOBAL_CPPFLAGS :=
|
$(all_objects) : PRIVATE_TARGET_GLOBAL_CPPFLAGS :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(LOCAL_BUILT_MODULE): PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
|
||||||
$(LOCAL_BUILT_MODULE) : $(built_whole_libraries)
|
$(LOCAL_BUILT_MODULE) : $(built_whole_libraries)
|
||||||
$(LOCAL_BUILT_MODULE) : $(all_objects)
|
$(LOCAL_BUILT_MODULE) : $(all_objects)
|
||||||
$(transform-o-to-static-lib)
|
$(transform-o-to-static-lib)
|
||||||
|
|
|
@ -23,4 +23,3 @@ LOCAL_MODULE := acp
|
||||||
LOCAL_ACP_UNAVAILABLE := true
|
LOCAL_ACP_UNAVAILABLE := true
|
||||||
|
|
||||||
include $(BUILD_HOST_EXECUTABLE)
|
include $(BUILD_HOST_EXECUTABLE)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue