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: |
Colin Cross | e6e48f6 | 2014-03-21 12:29:32 -0700 | [diff] [blame] | 5 | ## my_module_multilib |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 6 | ## LOCAL_MODULE_TARGET_ARCH |
| 7 | ## LOCAL_MODULE_TARGET_ARCH_WARN |
| 8 | ## LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH |
| 9 | ## LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN |
| 10 | ## |
| 11 | ## Inputs from build system: |
| 12 | ## TARGET_IS_64_BIT |
| 13 | ## LOCAL_2ND_ARCH_VAR_PREFIX |
| 14 | ## |
| 15 | ## Outputs: |
| 16 | ## my_module_arch_supported := (true|false) |
| 17 | ########################################################### |
| 18 | |
| 19 | my_module_arch_supported := true |
| 20 | |
Colin Cross | e6e48f6 | 2014-03-21 12:29:32 -0700 | [diff] [blame] | 21 | ifeq ($(my_module_multilib),none) |
| 22 | my_module_arch_supported := false |
| 23 | endif |
| 24 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 25 | ifeq ($(LOCAL_2ND_ARCH_VAR_PREFIX),) |
Colin Cross | e6e48f6 | 2014-03-21 12:29:32 -0700 | [diff] [blame] | 26 | ifeq ($(TARGET_IS_64_BIT)|$(my_module_multilib),true|32) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 27 | my_module_arch_supported := false |
Colin Cross | dc1c95a | 2014-04-10 11:28:04 -0700 | [diff] [blame^] | 28 | else ifeq ($(TARGET_IS_64_BIT)|$(my_module_multilib),|64) |
| 29 | my_module_arch_supported := false |
Colin Cross | 02e31d2 | 2014-01-24 13:38:08 -0800 | [diff] [blame] | 30 | else ifeq ($(call directory_is_64_bit_blacklisted,$(LOCAL_PATH)),true) |
| 31 | my_module_arch_supported := false |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 32 | endif |
| 33 | else # LOCAL_2ND_ARCH_VAR_PREFIX |
Colin Cross | e6e48f6 | 2014-03-21 12:29:32 -0700 | [diff] [blame] | 34 | ifeq ($(my_module_multilib),first) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 35 | my_module_arch_supported := false |
Colin Cross | dc1c95a | 2014-04-10 11:28:04 -0700 | [diff] [blame^] | 36 | else ifeq ($(my_module_multilib),64) |
| 37 | my_module_arch_supported := false |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 38 | endif |
Colin Cross | e6e48f6 | 2014-03-21 12:29:32 -0700 | [diff] [blame] | 39 | endif # LOCAL_2ND_ARCH_VAR_PREFIX |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 40 | |
| 41 | ifneq (,$(LOCAL_MODULE_TARGET_ARCH)) |
| 42 | ifeq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_TARGET_ARCH))) |
| 43 | my_module_arch_supported := false |
| 44 | endif |
| 45 | endif |
| 46 | |
| 47 | ifneq (,$(LOCAL_MODULE_TARGET_ARCH_WARN)) |
| 48 | ifeq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_TARGET_ARCH_WARN))) |
| 49 | my_module_arch_supported := false |
| 50 | $(warning $(LOCAL_MODULE): architecture $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) not supported) |
| 51 | endif |
| 52 | endif |
| 53 | |
| 54 | ifneq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH))) |
| 55 | my_module_arch_supported := false |
| 56 | endif |
| 57 | |
| 58 | ifneq (,$(filter $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN))) |
| 59 | my_module_arch_supported := false |
| 60 | $(warning $(LOCAL_MODULE): architecture $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) unsupported) |
| 61 | endif |