1 ########################################################### 2 ## Determine if a module can be built for an arch 3 ## 4 ## Inputs from module makefile: 5 ## my_prefix TARGET_ or HOST_ 6 ## my_module_multilib 7 ## LOCAL_MODULE_$(my_prefix)ARCH 8 ## LOCAL_MODULE_$(my_prefix)ARCH_WARN 9 ## LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH 10 ## LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH_WARN 11 ## LOCAL_IS_HOST_MODULE 12 ## LOCAL_MODULE_HOST_OS 13 ## 14 ## Inputs from build system: 15 ## $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT 16 ## LOCAL_2ND_ARCH_VAR_PREFIX 17 ## 18 ## Outputs: 19 ## my_module_arch_supported := (true|false) 20 ########################################################### 21 22 my_module_arch_supported := true 23 24 ifeq ($(my_module_multilib),none) 25 my_module_arch_supported := false 26 endif 27 28 ifeq ($($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT)|$(my_module_multilib),true|32) 29 my_module_arch_supported := false 30 endif 31 ifeq ($($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT)|$(my_module_multilib),|64) 32 my_module_arch_supported := false 33 endif 34 35 ifneq ($(LOCAL_2ND_ARCH_VAR_PREFIX),) 36 ifeq ($(my_module_multilib),first) 37 my_module_arch_supported := false 38 endif 39 endif 40 41 ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH)) 42 ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH))) 43 my_module_arch_supported := false 44 endif 45 endif 46 47 ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH_WARN)) 48 ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH_WARN))) 49 my_module_arch_supported := false 50 $(warning $(LOCAL_MODULE): architecture $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) not supported) 51 endif 52 endif 53 54 ifneq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH))) 55 my_module_arch_supported := false 56 endif 57 58 ifneq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH_WARN))) 59 my_module_arch_supported := false 60 $(warning $(LOCAL_MODULE): architecture $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) unsupported) 61 endif 62 63 ifdef LOCAL_IS_HOST_MODULE 64 ifneq (,$(LOCAL_MODULE_HOST_OS)) 65 ifeq (,$(filter $($(my_prefix)OS),$(LOCAL_MODULE_HOST_OS))) 66 my_module_arch_supported := false 67 endif 68 else ifeq ($($(my_prefix)OS),windows) 69 # If LOCAL_MODULE_HOST_OS is empty, only linux and darwin are supported 70 my_module_arch_supported := false 71 endif 72 endif 73