forked from openkylin/platform_build
Real "LOCAL_MULTILIB := both" for prebuilts
This uses the fact that unsetting LOCAL_MULTILIB equals "either". It's useful to build for both 32-bit and 64-bit in the same prebuilt module definition. Bug: 13751317 Change-Id: I4f1625a83e13f22f807039afebae73f69ed35918
This commit is contained in:
parent
6374153fbf
commit
34d5f1b27e
|
@ -1,4 +1,4 @@
|
||||||
# Translate LOCAL_32_BIT_ONLY and LOCAL_NO_2ND_ARCH to LOCAL_MULTILIB,
|
# Translate LOCAL_32_BIT_ONLY to LOCAL_MULTILIB,
|
||||||
# and check LOCAL_MULTILIB is a valid value. Returns module's multilib
|
# and check LOCAL_MULTILIB is a valid value. Returns module's multilib
|
||||||
# setting in my_module_multilib, or empty if not set.
|
# setting in my_module_multilib, or empty if not set.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# We don't automatically set up rules to build packages for both
|
# We don't automatically set up rules to build packages for both
|
||||||
# TARGET_ARCH and TARGET_2ND_ARCH.
|
# TARGET_ARCH and TARGET_2ND_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_
|
my_prefix := TARGET_
|
||||||
|
|
|
@ -14,26 +14,36 @@ endif
|
||||||
|
|
||||||
include $(BUILD_SYSTEM)/multilib.mk
|
include $(BUILD_SYSTEM)/multilib.mk
|
||||||
|
|
||||||
ifndef my_module_multilib
|
my_skip_non_preferred_arch :=
|
||||||
# prebuilts default to building for either architecture,
|
|
||||||
# the first if its supported, otherwise the second.
|
|
||||||
my_module_multilib := both
|
|
||||||
endif
|
|
||||||
|
|
||||||
# check if first arch is supported
|
# check if first arch is supported
|
||||||
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)
|
||||||
# first arch is supported
|
# first arch is supported
|
||||||
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
||||||
else ifneq (,$($(my_prefix)2ND_ARCH))
|
ifneq ($(my_module_multilib),both)
|
||||||
|
my_skip_non_preferred_arch := true
|
||||||
|
endif # $(my_module_multilib)
|
||||||
|
endif # $(my_module_arch_supported)
|
||||||
|
|
||||||
|
ifndef my_skip_non_preferred_arch
|
||||||
|
ifneq (,$($(my_prefix)2ND_ARCH))
|
||||||
# check if secondary arch is supported
|
# check if secondary arch is supported
|
||||||
LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)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
|
||||||
|
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)/prebuilt_internal.mk
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
||||||
endif
|
endif # $(my_module_arch_supported)
|
||||||
endif # $(my_prefix)2ND_ARCH
|
endif # $($(my_prefix)2ND_ARCH)
|
||||||
|
endif # $(my_skip_non_preferred_arch) not true
|
||||||
|
|
||||||
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,19 @@ endif
|
||||||
# Not much sense to check build prebuilts
|
# Not much sense to check build prebuilts
|
||||||
LOCAL_DONT_CHECK_MODULE := true
|
LOCAL_DONT_CHECK_MODULE := true
|
||||||
|
|
||||||
|
my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
|
||||||
|
|
||||||
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_$($(my_prefix)$(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_$($(my_prefix)$(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)
|
ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix)
|
||||||
|
my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix))
|
||||||
|
else
|
||||||
|
my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue