1# We don't automatically set up rules to build packages for both 2# TARGET_ARCH and TARGET_2ND_ARCH. 3# To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32". 4 5$(call record-module-type,PACKAGE) 6 7my_prefix := TARGET_ 8include $(BUILD_SYSTEM)/multilib.mk 9 10ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) 11 ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true) 12 my_module_multilib := first 13 else ifneq ($(my_module_multilib),64) 14 my_module_multilib := first 15 endif 16endif 17 18ifeq ($(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true) 19 # packages default to building for either architecture, 20 # the preferred if its supported, otherwise the non-preferred. 21else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true) 22 # only 64-bit apps supported 23 ifeq ($(filter $(my_module_multilib),64 both first),$(my_module_multilib)) 24 # if my_module_multilib was 64, both, first, or unset, build for 64-bit 25 my_module_multilib := 64 26 else 27 # otherwise don't build this app 28 my_module_multilib := none 29 endif 30else 31 # only 32-bit apps supported 32 ifeq ($(filter $(my_module_multilib),32 both),$(my_module_multilib)) 33 # if my_module_multilib was 32, both, or unset, build for 32-bit 34 my_module_multilib := 32 35 else ifeq ($(my_module_multilib),first) 36 ifndef TARGET_IS_64_BIT 37 # if my_module_multilib was first and this is a 32-bit build, build for 38 # 32-bit 39 my_module_multilib := 32 40 else 41 # if my_module_multilib was first and this is a 64-bit build, don't build 42 # this app 43 my_module_multilib := none 44 endif 45 else 46 # my_module_mulitlib was 64 or none, don't build this app 47 my_module_multilib := none 48 endif 49endif 50 51LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true 52 53# if TARGET_PREFER_32_BIT_APPS is set, try to build 32-bit first 54ifdef TARGET_2ND_ARCH 55ifeq ($(TARGET_PREFER_32_BIT_APPS),true) 56LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) 57else 58LOCAL_2ND_ARCH_VAR_PREFIX := 59endif 60endif 61 62# check if preferred arch is supported 63include $(BUILD_SYSTEM)/module_arch_supported.mk 64ifeq ($(my_module_arch_supported),true) 65# first arch is supported 66include $(BUILD_SYSTEM)/package_internal.mk 67else ifneq (,$(TARGET_2ND_ARCH)) 68# check if the non-preferred arch is the primary or secondary 69ifeq ($(TARGET_PREFER_32_BIT_APPS),true) 70LOCAL_2ND_ARCH_VAR_PREFIX := 71else 72LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) 73endif 74 75# check if non-preferred arch is supported 76include $(BUILD_SYSTEM)/module_arch_supported.mk 77ifeq ($(my_module_arch_supported),true) 78# secondary arch is supported 79include $(BUILD_SYSTEM)/package_internal.mk 80endif 81endif # TARGET_2ND_ARCH 82 83LOCAL_2ND_ARCH_VAR_PREFIX := 84LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := 85 86my_module_arch_supported := 87