Home | History | Annotate | Download | only in core
      1 LOCAL_IS_HOST_MODULE := true
      2 my_prefix := HOST_
      3 LOCAL_HOST_PREFIX :=
      4 include $(BUILD_SYSTEM)/multilib.mk
      5 
      6 ifndef LOCAL_MODULE_HOST_ARCH
      7 ifndef my_module_multilib
      8 ifeq ($(HOST_PREFER_32_BIT),true)
      9 my_module_multilib := 32
     10 else
     11 # By default we only build host module for the first arch.
     12 my_module_multilib := first
     13 endif
     14 endif
     15 endif
     16 
     17 ifeq ($(LOCAL_NO_FPIE),)
     18 LOCAL_LDFLAGS += $(HOST_FPIE_FLAGS)
     19 endif
     20 
     21 ifeq ($(my_module_multilib),both)
     22 ifeq ($(LOCAL_MODULE_PATH_32)$(LOCAL_MODULE_STEM_32),)
     23 $(error $(LOCAL_PATH): LOCAL_MODULE_STEM_32 or LOCAL_MODULE_PATH_32 is required for LOCAL_MULTILIB := both for module $(LOCAL_MODULE))
     24 endif
     25 ifeq ($(LOCAL_MODULE_PATH_64)$(LOCAL_MODULE_STEM_64),)
     26 $(error $(LOCAL_PATH): LOCAL_MODULE_STEM_64 or LOCAL_MODULE_PATH_64 is required for LOCAL_MULTILIB := both for module $(LOCAL_MODULE))
     27 endif
     28 else #!LOCAL_MULTILIB == both
     29 LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true
     30 endif
     31 
     32 LOCAL_2ND_ARCH_VAR_PREFIX :=
     33 include $(BUILD_SYSTEM)/module_arch_supported.mk
     34 
     35 ifeq ($(my_module_arch_supported),true)
     36 include $(BUILD_SYSTEM)/host_executable_internal.mk
     37 endif
     38 
     39 ifdef HOST_2ND_ARCH
     40 LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
     41 include $(BUILD_SYSTEM)/module_arch_supported.mk
     42 ifeq ($(my_module_arch_supported),true)
     43 # Build for HOST_2ND_ARCH
     44 OVERRIDE_BUILT_MODULE_PATH :=
     45 LOCAL_BUILT_MODULE :=
     46 LOCAL_INSTALLED_MODULE :=
     47 LOCAL_INTERMEDIATE_TARGETS :=
     48 
     49 include $(BUILD_SYSTEM)/host_executable_internal.mk
     50 endif
     51 LOCAL_2ND_ARCH_VAR_PREFIX :=
     52 endif  # HOST_2ND_ARCH
     53 
     54 ifdef HOST_CROSS_OS
     55 my_prefix := HOST_CROSS_
     56 LOCAL_HOST_PREFIX := $(my_prefix)
     57 include $(BUILD_SYSTEM)/module_arch_supported.mk
     58 ifeq ($(my_module_arch_supported),true)
     59 # Build for Windows
     60 OVERRIDE_BUILT_MODULE_PATH :=
     61 # we don't want others using the cross compiled version
     62 saved_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
     63 saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
     64 saved_LOCAL_LDFLAGS := $(LOCAL_LDFLAGS)
     65 LOCAL_BUILT_MODULE :=
     66 LOCAL_INSTALLED_MODULE :=
     67 LOCAL_INTERMEDIATE_TARGETS :=
     68 
     69 ifeq ($(LOCAL_NO_FPIE),)
     70 LOCAL_LDFLAGS += $(HOST_CROSS_FPIE_FLAGS)
     71 endif
     72 
     73 include $(BUILD_SYSTEM)/host_executable_internal.mk
     74 LOCAL_LDFLAGS := $(saved_LOCAL_LDFLAGS)
     75 LOCAL_BUILT_MODULE := $(saved_LOCAL_BUILT_MODULE)
     76 LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE)
     77 endif
     78 
     79 ifdef HOST_CROSS_2ND_ARCH
     80 LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
     81 include $(BUILD_SYSTEM)/module_arch_supported.mk
     82 ifeq ($(my_module_arch_supported),true)
     83 OVERRIDE_BUILT_MODULE_PATH :=
     84 # we don't want others using the cross compiled version
     85 saved_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
     86 saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
     87 saved_LOCAL_LDFLAGS := $(LOCAL_LDFLAGS)
     88 LOCAL_BUILT_MODULE :=
     89 LOCAL_INSTALLED_MODULE :=
     90 LOCAL_INTERMEDIATE_TARGETS :=
     91 
     92 ifeq ($(LOCAL_NO_FPIE),)
     93 LOCAL_LDFLAGS += $(HOST_CROSS_FPIE_FLAGS)
     94 endif
     95 
     96 include $(BUILD_SYSTEM)/host_executable_internal.mk
     97 LOCAL_LDFLAGS := $(saved_LOCAL_LDFLAGS)
     98 LOCAL_BUILT_MODULE := $(saved_LOCAL_BUILT_MODULE)
     99 LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE)
    100 endif
    101 LOCAL_2ND_ARCH_VAR_PREFIX :=
    102 endif
    103 LOCAL_HOST_PREFIX :=
    104 endif
    105 
    106 LOCAL_NO_2ND_ARCH_MODULE_SUFFIX :=
    107 my_module_arch_supported :=
    108