Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 1 | ########################################################### |
| 2 | ## Determine if a module can be built for an arch |
| 3 | ## |
| 4 | ## Inputs from module makefile: |
| 5 | ## LOCAL_32_BIT_ONLY |
| 6 | ## LOCAL_NO_2ND_ARCH |
| 7 | ## LOCAL_MODULE_TARGET_ARCH |
| 8 | ## LOCAL_MODULE_TARGET_ARCH_WARN |
| 9 | ## LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH |
| 10 | ## LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN |
| 11 | ## |
| 12 | ## Inputs from build system: |
| 13 | ## TARGET_IS_64_BIT |
| 14 | ## LOCAL_2ND_ARCH_VAR_PREFIX |
| 15 | ## |
| 16 | ## Outputs: |
| 17 | ## my_module_arch_supported := (true|false) |
| 18 | ########################################################### |
| 19 | |
| 20 | my_module_arch_supported := true |
| 21 | |
| 22 | ifeq ($(LOCAL_2ND_ARCH_VAR_PREFIX),) |
| 23 | ifeq ($(TARGET_IS_64_BIT)|$(LOCAL_32_BIT_ONLY),true|true) |
| 24 | my_module_arch_supported := false |
Colin Cross | 02e31d2 | 2014-01-24 13:38:08 -0800 | [diff] [blame] | 25 | else ifeq ($(call directory_is_64_bit_blacklisted,$(LOCAL_PATH)),true) |
| 26 | my_module_arch_supported := false |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 27 | endif |
| 28 | else # LOCAL_2ND_ARCH_VAR_PREFIX |
| 29 | ifeq ($(LOCAL_NO_2ND_ARCH),true) |
| 30 | my_module_arch_supported := false |
| 31 | endif |
| 32 | endif # !LOCAL_2ND_ARCH_VAR_PREFIX |
| 33 | |
| 34 | ifneq (,$(LOCAL_MODULE_TARGET_ARCH)) |
| 35 | ifeq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_TARGET_ARCH))) |
| 36 | my_module_arch_supported := false |
| 37 | endif |
| 38 | endif |
| 39 | |
| 40 | ifneq (,$(LOCAL_MODULE_TARGET_ARCH_WARN)) |
| 41 | ifeq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_TARGET_ARCH_WARN))) |
| 42 | my_module_arch_supported := false |
| 43 | $(warning $(LOCAL_MODULE): architecture $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) not supported) |
| 44 | endif |
| 45 | endif |
| 46 | |
| 47 | ifneq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH))) |
| 48 | my_module_arch_supported := false |
| 49 | endif |
| 50 | |
| 51 | ifneq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN))) |
| 52 | my_module_arch_supported := false |
| 53 | $(warning $(LOCAL_MODULE): architecture $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) unsupported) |
| 54 | endif |