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_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true) 11 # packages default to building for either architecture, 12 # the preferred if its supported, otherwise the non-preferred. 13else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true) 14 # only 64-bit apps supported 15 ifeq ($(filter $(my_module_multilib),64 both first),$(my_module_multilib)) 16 # if my_module_multilib was 64, both, first, or unset, build for 64-bit 17 my_module_multilib := 64 18 else 19 # otherwise don't build this app 20 my_module_multilib := none 21 endif 22else 23 # only 32-bit apps supported 24 ifeq ($(filter $(my_module_multilib),32 both),$(my_module_multilib)) 25 # if my_module_multilib was 32, both, or unset, build for 32-bit 26 my_module_multilib := 32 27 else ifeq ($(my_module_multilib),first) 28 ifndef TARGET_IS_64_BIT 29 # if my_module_multilib was first and this is a 32-bit build, build for 30 # 32-bit 31 my_module_multilib := 32 32 else 33 # if my_module_multilib was first and this is a 64-bit build, don't build 34 # this app 35 my_module_multilib := none 36 endif 37 else 38 # my_module_mulitlib was 64 or none, don't build this app 39 my_module_multilib := none 40 endif 41endif 42 43LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true 44LOCAL_2ND_ARCH_VAR_PREFIX := 45 46# check if preferred arch is supported 47include $(BUILD_SYSTEM)/module_arch_supported.mk 48ifeq ($(my_module_arch_supported),true) 49# first arch is supported 50include $(BUILD_SYSTEM)/package_internal.mk 51else ifneq (,$(TARGET_2ND_ARCH)) 52LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) 53# check if non-preferred arch is supported 54include $(BUILD_SYSTEM)/module_arch_supported.mk 55ifeq ($(my_module_arch_supported),true) 56# secondary arch is supported 57include $(BUILD_SYSTEM)/package_internal.mk 58endif 59endif # TARGET_2ND_ARCH 60 61LOCAL_2ND_ARCH_VAR_PREFIX := 62LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := 63 64my_module_arch_supported := 65