• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
22my_module_arch_supported := true
23
24ifeq ($(my_module_multilib),none)
25my_module_arch_supported := false
26endif
27
28ifeq ($($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT)|$(my_module_multilib),true|32)
29my_module_arch_supported := false
30endif
31ifeq ($($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT)|$(my_module_multilib),|64)
32my_module_arch_supported := false
33endif
34
35ifneq ($(LOCAL_2ND_ARCH_VAR_PREFIX),)
36ifeq ($(my_module_multilib),first)
37my_module_arch_supported := false
38endif
39endif
40
41ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH))
42ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH)))
43my_module_arch_supported := false
44endif
45endif
46
47ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH_WARN))
48ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH_WARN)))
49my_module_arch_supported := false
50$(warning $(LOCAL_MODULE): architecture $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) not supported)
51endif
52endif
53
54ifneq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH)))
55my_module_arch_supported := false
56endif
57
58ifneq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_UNSUPPORTED_$(my_prefix)ARCH_WARN)))
59my_module_arch_supported := false
60$(warning $(LOCAL_MODULE): architecture $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) unsupported)
61endif
62
63ifdef LOCAL_IS_HOST_MODULE
64ifneq (,$(LOCAL_MODULE_HOST_OS))
65  ifeq (,$(filter $($(my_prefix)OS),$(LOCAL_MODULE_HOST_OS)))
66    my_module_arch_supported := false
67  endif
68else 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
71endif
72endif
73