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