Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1ifneq ($(host),$(build))2host_toolchain:=$(host)-3endif5default_host_CC = $(host_toolchain)gcc6default_host_CXX = $(host_toolchain)g++7default_host_AR = $(host_toolchain)ar8default_host_RANLIB = $(host_toolchain)ranlib9default_host_STRIP = $(host_toolchain)strip10default_host_NM = $(host_toolchain)nm11default_host_OBJCOPY = $(host_toolchain)objcopy12default_host_OBJDUMP = $(host_toolchain)objdump14define add_host_tool_func15ifneq ($(filter $(origin $1),undefined default),)16# Do not consider the well-known var $1 if it is undefined or is taking a value17# that is predefined by "make" (e.g. the make variable "CC" has a predefined18# value of "cc")19$(host_os)_$1?=$$(default_host_$1)20$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1)21$(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1)22else23$(host_os)_$1=$(or $($1),$($(host_os)_$1),$(default_host_$1))24$(host_arch)_$(host_os)_$1=$(or $($1),$($(host_arch)_$(host_os)_$1),$$($(host_os)_$1))25$(host_arch)_$(host_os)_$(release_type)_$1=$(or $($1),$($(host_arch)_$(host_os)_$(release_type)_$1),$$($(host_os)_$1))26endif27host_$1=$$($(host_arch)_$(host_os)_$1)28endef30define add_host_flags_func31ifeq ($(filter $(origin $1),undefined default),)32$(host_arch)_$(host_os)_$1 = $($1)33$(host_arch)_$(host_os)_$(release_type)_$1 =34else35$(host_arch)_$(host_os)_$1 += $($(host_os)_$1)36$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1)37endif38host_$1 = $$($(host_arch)_$(host_os)_$1)39host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)40endef42$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP,$(eval $(call add_host_tool_func,$(tool))))43$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.