bitcoin/depends
fanquake a5f95bafcd
Merge bitcoin/bitcoin#25964: build: fix mingw miniupnpc cflags
859644b3c8 build: set D_WIN32_WINNT=0x0601 for mingw miniupnpc (fanquake)
8e2d93ff0f build: fix cflags passing for mingw miniupnpc (fanquake)

Pull request description:

  Pulls in a patch I've upstreamed to miniupnpc so that we properly pass our cflags when building it for mingw. See https://github.com/miniupnp/miniupnp/pull/619. Also set `D_WIN32_WINNT` to `0x0601` to match libevent, configure etc. Previously it was being set to `0X501`.

  Guix Build (x86_64 / arm64):
  ```bash
  39a66c473a45b83ca85500b32ccf8f30d4ae80f965ca064566ee9fd84a51964b  guix-build-859644b3c855/output/aarch64-linux-gnu/SHA256SUMS.part
  7b0515e422f350cb23f4f0b2f87eaa1b30d1c80389da6f1cbe700794902c88e9  guix-build-859644b3c855/output/aarch64-linux-gnu/bitcoin-859644b3c855-aarch64-linux-gnu-debug.tar.gz
  192253fb387a2216b6d63d47a18e34bfa284874488d7ebc6ba656ca76a905519  guix-build-859644b3c855/output/aarch64-linux-gnu/bitcoin-859644b3c855-aarch64-linux-gnu.tar.gz
  0a8b5c77928a46e62dff85cf73ca9e932560533b99ef1ec374be00516f9e1183  guix-build-859644b3c855/output/arm-linux-gnueabihf/SHA256SUMS.part
  d1b01b36d7092d63ab84877e05a973d915d177dbc618fe00eeaff86295032750  guix-build-859644b3c855/output/arm-linux-gnueabihf/bitcoin-859644b3c855-arm-linux-gnueabihf-debug.tar.gz
  50d9cd81a4a37fbd5c22ee8f1b8398a836879bda1b514a9ed3d0bcd6fd3de41f  guix-build-859644b3c855/output/arm-linux-gnueabihf/bitcoin-859644b3c855-arm-linux-gnueabihf.tar.gz
  e590d6dc6687c744b4067af330a7fe44110da4972c46f0262c39ce03e2aa6ac5  guix-build-859644b3c855/output/arm64-apple-darwin/SHA256SUMS.part
  6b9b97a1f6ead6d2b70d706ba39b11f36c2929962afc0d52404f2341d412d4e7  guix-build-859644b3c855/output/arm64-apple-darwin/bitcoin-859644b3c855-arm64-apple-darwin-unsigned.dmg
  de6be985a4e1b11c6450c388b54be4fff3dc3a78e528cb628623ee4a8ea249f4  guix-build-859644b3c855/output/arm64-apple-darwin/bitcoin-859644b3c855-arm64-apple-darwin-unsigned.tar.gz
  940024658b9387040ceb26535dbd1ed7edb3709106f6e25d5d3720ed90bbbb2e  guix-build-859644b3c855/output/arm64-apple-darwin/bitcoin-859644b3c855-arm64-apple-darwin.tar.gz
  67c8fcdd31dca595e5c6b72e597a135718dd50ce1f062cb18d181520c13d3013  guix-build-859644b3c855/output/dist-archive/bitcoin-859644b3c855.tar.gz
  4b1954953913d1387589873a8e9dc9765f0f300c125270046da95a23c43aa069  guix-build-859644b3c855/output/powerpc64-linux-gnu/SHA256SUMS.part
  5b12ab7e3a7fc162912e67e026646ee5d4c92ef804525504f188d9a569af7d67  guix-build-859644b3c855/output/powerpc64-linux-gnu/bitcoin-859644b3c855-powerpc64-linux-gnu-debug.tar.gz
  fa4debb24dbb4c9c515ad3bfa2e5cb9bd686f1062157bd4480d076ef35d7ea9d  guix-build-859644b3c855/output/powerpc64-linux-gnu/bitcoin-859644b3c855-powerpc64-linux-gnu.tar.gz
  bafad2f56aad4edd25e49e4cc658811cf87f32a2a2e013672659d410d7a8cac8  guix-build-859644b3c855/output/powerpc64le-linux-gnu/SHA256SUMS.part
  96318cac800dc7ee86229754a76047dececd62ecd962362e6dbd1d694bc8c17a  guix-build-859644b3c855/output/powerpc64le-linux-gnu/bitcoin-859644b3c855-powerpc64le-linux-gnu-debug.tar.gz
  461415ee7bf67e2c59bfce3a09736b3b0ecdc7c81751ce2bed19369237450154  guix-build-859644b3c855/output/powerpc64le-linux-gnu/bitcoin-859644b3c855-powerpc64le-linux-gnu.tar.gz
  5c9d19f6af5d1fab7de7496bbdcd1cd266abd6c0e2c226b362dab2582c94a33a  guix-build-859644b3c855/output/riscv64-linux-gnu/SHA256SUMS.part
  04492f5ce121ba09672119cc8861ee30ecdb814b34726c9c5d7971c528209a55  guix-build-859644b3c855/output/riscv64-linux-gnu/bitcoin-859644b3c855-riscv64-linux-gnu-debug.tar.gz
  5fb28111b49e73fc53db2805500c275a2e6321c3e180695eb813675629dcd64c  guix-build-859644b3c855/output/riscv64-linux-gnu/bitcoin-859644b3c855-riscv64-linux-gnu.tar.gz
  3f48c1c2ba77d4fda725225f6c9b5ab7f3aae244c8abb354407cc73d6547d983  guix-build-859644b3c855/output/x86_64-apple-darwin/SHA256SUMS.part
  6dcfb5a4af350466fb7f9319e02fd4bcef66e015116c9eda8aff03b3ac53d109  guix-build-859644b3c855/output/x86_64-apple-darwin/bitcoin-859644b3c855-x86_64-apple-darwin-unsigned.dmg
  87112cc5f2d02c16614f6d8df41af6f3ea3c765eb6d196d68d2b514b6bd317bc  guix-build-859644b3c855/output/x86_64-apple-darwin/bitcoin-859644b3c855-x86_64-apple-darwin-unsigned.tar.gz
  b245a4d4881a679f2c91e0c7fd5466d6b93313289e609dbce4e1009b7591332e  guix-build-859644b3c855/output/x86_64-apple-darwin/bitcoin-859644b3c855-x86_64-apple-darwin.tar.gz
  a4c3449aa9d8a8e1c8b0532f6e74845c40f90ad4186f480d5bb2750e184efc10  guix-build-859644b3c855/output/x86_64-linux-gnu/SHA256SUMS.part
  12a32f25d6ef7f60023dd3053b21e31131350b6afa01aeab25e53d1928b1a0f5  guix-build-859644b3c855/output/x86_64-linux-gnu/bitcoin-859644b3c855-x86_64-linux-gnu-debug.tar.gz
  93d603d89c9251e93992e3c0e176b094d981b020ef1d4bbfbff21806e50b962d  guix-build-859644b3c855/output/x86_64-linux-gnu/bitcoin-859644b3c855-x86_64-linux-gnu.tar.gz
  79df55f4ca8f972665fd55b43550b2ab9ffafa8fc8de1335b324f4af047c6788  guix-build-859644b3c855/output/x86_64-w64-mingw32/SHA256SUMS.part
  8d837e96595ab7337736da334d940ffc9d15215141f176804a528fe9e21f490a  guix-build-859644b3c855/output/x86_64-w64-mingw32/bitcoin-859644b3c855-win64-debug.zip
  6c9541524f1d54eceb3265c6e79d62502fdc0c2e5263719a0ca357988d7ed718  guix-build-859644b3c855/output/x86_64-w64-mingw32/bitcoin-859644b3c855-win64-setup-unsigned.exe
  7566ab4ee53092e81c3079db955d85c8d574cbde2be21526d45619076ffcd264  guix-build-859644b3c855/output/x86_64-w64-mingw32/bitcoin-859644b3c855-win64-unsigned.tar.gz
  32164cfa7c06ead63305485653f37d74c6ada82d28b79f58e66faf6e72e130bb  guix-build-859644b3c855/output/x86_64-w64-mingw32/bitcoin-859644b3c855-win64.zip
  ```

ACKs for top commit:
  jarolrod:
    re-ACK 859644b
  hebasto:
    ACK 859644b3c8, I've verified introduced changes in compiler flags, including the case with `DEBUG=1`.

Tree-SHA512: 6e181ced7e474a80aa191663b08dc594179a0593b8e2d1e4b7c8683794fd7de8d37faedb9a36997645ce6a2a6151e1461678b4db95170fc9b1fcadd6e1bddbe5
2022-10-13 13:13:17 +08:00
..
builders build: Let the depends build system define a path to dsymutil tool 2022-04-21 10:08:46 +02:00
hosts build: Add objcopy host tool 2022-08-13 14:08:12 +01:00
packages Merge bitcoin/bitcoin#25964: build: fix mingw miniupnpc cflags 2022-10-13 13:13:17 +08:00
patches build: fix cflags passing for mingw miniupnpc 2022-09-22 14:24:52 +01:00
.gitignore depends: Support for S390X targets 2019-12-05 12:12:46 -05:00
config.guess depends: latest config.guess (2021-05-24) 2021-05-26 13:28:47 +08:00
config.site.in build: Do not export PKG_CONFIG_{PATH|LIBDIR} variables 2022-07-27 10:07:34 +01:00
config.sub depends: latest config.sub (2021-04-30) 2021-05-26 13:30:18 +08:00
description.md doc: Fix whitespace errs in .md files, bitcoin.conf, Info.plist.in, and find_bdb48.m4 2019-09-17 03:21:22 -04:00
funcs.mk build: Fix libmultiprocess cross-compiling to Linux hosts 2022-05-01 10:41:32 +02:00
gen_id build: add *_STANDARD vars to depends gen_id 2022-06-17 14:44:49 +01:00
Makefile build: add *_STANDARD vars to depends gen_id 2022-06-17 14:44:49 +01:00
packages.md doc: Fix typos in packages.md 2021-11-28 18:13:52 +02:00
README.md build: add and use CXX_STANDARD in depends 2022-06-16 17:01:05 +01:00

Usage

To build dependencies for the current arch+OS:

make

To build for another arch/OS:

make HOST=host-platform-triplet

For example:

make HOST=x86_64-w64-mingw32 -j4

Bitcoin Core's configure script by default will ignore the depends output. In order for it to pick up libraries, tools, and settings from the depends build, you must set the CONFIG_SITE environment variable to point to a config.site settings file. In the above example, a file named depends/x86_64-w64-mingw32/share/config.site will be created. To use it during compilation:

CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure

The default install prefix when using config.site is --prefix=depends/<host-platform-triplet>, so depends build outputs will be installed in that location.

Common host-platform-triplets for cross compilation are:

  • i686-pc-linux-gnu for Linux 32 bit
  • x86_64-pc-linux-gnu for x86 Linux
  • x86_64-w64-mingw32 for Win64
  • x86_64-apple-darwin for macOS
  • arm64-apple-darwin for ARM macOS
  • arm-linux-gnueabihf for Linux ARM 32 bit
  • aarch64-linux-gnu for Linux ARM 64 bit
  • powerpc64-linux-gnu for Linux POWER 64-bit (big endian)
  • powerpc64le-linux-gnu for Linux POWER 64-bit (little endian)
  • riscv32-linux-gnu for Linux RISC-V 32 bit
  • riscv64-linux-gnu for Linux RISC-V 64 bit
  • s390x-linux-gnu for Linux S390X
  • armv7a-linux-android for Android ARM 32 bit
  • aarch64-linux-android for Android ARM 64 bit
  • x86_64-linux-android for Android x86 64 bit

The paths are automatically configured and no other options are needed unless targeting Android.

Install the required dependencies: Ubuntu & Debian

For macOS cross compilation

sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso

Note: You must obtain the macOS SDK before proceeding with a cross-compile. Under the depends directory, create a subdirectory named SDKs. Then, place the extracted SDK under this new directory. For more information, see SDK Extraction.

For Win64 cross compilation

For linux (including i386, ARM) cross compilation

Common linux dependencies:

sudo apt-get install make automake cmake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison

For linux ARM cross compilation:

sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf

For linux AARCH64 cross compilation:

sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu

For linux POWER 64-bit cross compilation (there are no packages for 32-bit):

sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu

For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):

sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu

For linux S390X cross compilation:

sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu

Install the required dependencies: OpenBSD

pkg_add bash gtar

Dependency Options

The following can be set when running make: make FOO=bar

  • SOURCES_PATH: Downloaded sources will be placed here
  • BASE_CACHE: Built packages will be placed here
  • SDK_PATH: Path where SDKs can be found (used by macOS)
  • FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
  • C_STANDARD: Set the C standard version used. Defaults to c11.
  • CXX_STANDARD: Set the C++ standard version used. Defaults to c++17.
  • NO_QT: Don't download/build/cache Qt and its dependencies
  • NO_QR: Don't download/build/cache packages needed for enabling qrencode
  • NO_ZMQ: Don't download/build/cache packages needed for enabling ZeroMQ
  • NO_WALLET: Don't download/build/cache libs needed to enable the wallet
  • NO_BDB: Don't download/build/cache BerkeleyDB
  • NO_SQLITE: Don't download/build/cache SQLite
  • NO_UPNP: Don't download/build/cache packages needed for enabling UPnP
  • NO_NATPMP: Don't download/build/cache packages needed for enabling NAT-PMP
  • ALLOW_HOST_PACKAGES: Packages that are missed in dependencies (due to NO_* option or build script logic) are searched for among the host system packages using pkg-config. It allows building with packages of other (newer) versions
  • MULTIPROCESS: Build libmultiprocess (experimental, requires CMake)
  • DEBUG: Disable some optimizations and enable more runtime checking
  • HOST_ID_SALT: Optional salt to use when generating host package ids
  • BUILD_ID_SALT: Optional salt to use when generating build package ids
  • FORCE_USE_SYSTEM_CLANG: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the system's $PATH rather than the default prebuilt release of Clang from llvm.org. Clang 8 or later is required
  • LOG: Use file-based logging for individual packages. During a package build its log file resides in the depends directory, and the log file is printed out automatically in case of build error. After successful build log files are moved along with package archives
  • LTO: Use LTO when building packages.

If some packages are not built, for example make NO_WALLET=1, the appropriate options will be passed to bitcoin's configure. In this case, --disable-wallet.

Additional targets

download: run 'make download' to fetch all sources without building them
download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
download-win: run 'make download-win' to fetch all sources needed for win builds
download-linux: run 'make download-linux' to fetch all sources needed for linux builds

Other documentation