| 1 | default_host_CC = $(host_toolchain)gcc |
| 2 | default_host_CXX = $(host_toolchain)g++ |
| 3 | default_host_AR = $(host_toolchain)ar |
| 4 | default_host_RANLIB = $(host_toolchain)ranlib |
| 5 | default_host_STRIP = $(host_toolchain)strip |
| 6 | default_host_LIBTOOL = $(host_toolchain)libtool |
| 7 | default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool |
| 8 | default_host_OTOOL = $(host_toolchain)otool |
| 9 | default_host_NM = $(host_toolchain)nm |
| 10 | |
| 11 | define add_host_tool_func |
| 12 | $(host_os)_$1?=$$(default_host_$1) |
| 13 | $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) |
| 14 | $(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) |
| 15 | host_$1=$$($(host_arch)_$(host_os)_$1) |
| 16 | endef |
| 17 | |
| 18 | define add_host_flags_func |
| 19 | $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) |
| 20 | $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) |
| 21 | host_$1 = $$($(host_arch)_$(host_os)_$1) |
| 22 | host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) |
| 23 | endef |
| 24 | |
| 25 | $(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) |
| 26 | $(foreach flags,CFLAGS CXXFLAGS ARFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) |