Inside Bitcoin
Opening the selected file…
Inside Bitcoin
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.
1#!/usr/bin/env bash2# Copyright (c) The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or https://opensource.org/license/mit.5export LC_ALL=C.UTF-86set -o errexit -o pipefail8# shellcheck source=setup.sh9source "$(dirname "${BASH_SOURCE[0]}")/setup.sh"11# setup gcc toolchain12gcc_toolchain14BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/GUI"16# Build the depends tree17make -C depends --jobs="$JOBS" HOST="$HOST" \18${V:+V=1} \19${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \20${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \21${build_CC+build_CC="$build_CC"} \22${build_CXX+build_CXX="$build_CXX"}24# CFLAGS25HOST_CFLAGS="-O2 -g"26HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)27HOST_CFLAGS+=" -fdebug-prefix-map=${DISTSRC}/src=."29# CXXFLAGS30HOST_CXXFLAGS="$HOST_CFLAGS"32case "$HOST" in33arm-linux-gnueabihf) HOST_CXXFLAGS="${HOST_CXXFLAGS} -Wno-psabi" ;;34esac36# LDFLAGS37HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$(glibc_dynamic_linker "$HOST") -Wl,-O2"39mkdir -p "$DISTSRC"40(41cd "$DISTSRC"43# Extract the source tarball44tar --strip-components=1 -xf "${GIT_ARCHIVE}"46# Configure this DISTSRC for $HOST47env CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \48cmake -S . -B build \49--toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \50-DBUILD_BENCH=OFF \51-DBUILD_BITCOIN_BIN=OFF \52-DBUILD_CLI=OFF \53-DBUILD_DAEMON=OFF \54-DBUILD_FUZZ_BINARY=OFF \55-DBUILD_GUI_TESTS=OFF \56-DBUILD_TESTS=OFF \57-DBUILD_TX=OFF \58-DBUILD_UTIL=OFF \59-DBUILD_WALLET_TOOL=OFF \60-DCMAKE_EXE_LINKER_FLAGS="${HOST_LDFLAGS} -static-libstdc++ -static-libgcc" \61-DCMAKE_INSTALL_PREFIX="${INSTALLPATH}" \62-DCMAKE_SKIP_RPATH=TRUE \63-DREDUCE_EXPORTS=ON \64-DWITH_CCACHE=OFF \65-Werror=dev67# Build Bitcoin Core68cmake --build build -j "$JOBS" --target bitcoin-gui bitcoin-qt70# Install built Bitcoin Core71cmake --install build --component bitcoin-gui72cmake --install build --component bitcoin-qt73) # $DISTSRC75# shellcheck source=package.sh76source "$(dirname "${BASH_SOURCE[0]}")/package.sh"
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.