dash/depends
fanquake 2600e4cb10
Merge bitcoin/bitcoin#24613: build: remove unused QMAKE_* VARs
3a463992b981be382200004d5c44c130fc7a509f build: remove unused QMAKE_* VARs (fanquake)

Pull request description:

  As far as I can gather Qts build system doesn't respect either of these
  variables (there is a `QMAKE_LIBTOOL_LIBDIR`).

  Guix Build:
  ```bash
  bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  dd12aaea98cfaa85a7d4b2e0cd8c4c01766ad47cb2d41a516073b7e0304ccab1  guix-build-3a463992b981/output/aarch64-linux-gnu/SHA256SUMS.part
  7107fce198c238c6b88a58574be5cfd77ac2aa8176488738671c4873a21e1efe  guix-build-3a463992b981/output/aarch64-linux-gnu/bitcoin-3a463992b981-aarch64-linux-gnu-debug.tar.gz
  2fe573897994e9dbb4a5123045e86ed3fefbf3381eddb5f17f2034aecb5adb80  guix-build-3a463992b981/output/aarch64-linux-gnu/bitcoin-3a463992b981-aarch64-linux-gnu.tar.gz
  250246aef50a752d56a63a58978cd95555a4e4447b83577615e85cfee30003b6  guix-build-3a463992b981/output/arm-linux-gnueabihf/SHA256SUMS.part
  4e07018fcb47d0674b4dc598c23179f05124e9cf70e8dd229ef74542d3b106a3  guix-build-3a463992b981/output/arm-linux-gnueabihf/bitcoin-3a463992b981-arm-linux-gnueabihf-debug.tar.gz
  649115440ff109d427718aa8468ef65f50ac50edf5722c233dad2fb9e90d4af6  guix-build-3a463992b981/output/arm-linux-gnueabihf/bitcoin-3a463992b981-arm-linux-gnueabihf.tar.gz
  3f5dae095c718854ae2de1dcbc88a91b14cdb13adb9a7bd5e2a08bf006a1bca9  guix-build-3a463992b981/output/arm64-apple-darwin/SHA256SUMS.part
  e8f546db5bc14452a50041d46711160d4f4d4fd7b93092a20cdb96a3549f92d2  guix-build-3a463992b981/output/arm64-apple-darwin/bitcoin-3a463992b981-arm64-apple-darwin-unsigned.dmg
  5f1c9695d1ef286b8b779b8ae76af8dfe45d31ce9b081122d1d5594c21c73de2  guix-build-3a463992b981/output/arm64-apple-darwin/bitcoin-3a463992b981-arm64-apple-darwin-unsigned.tar.gz
  5eccb71d8c0c0b0806bf8858079d7a8b626d23446ba6b09920b0118debea6b88  guix-build-3a463992b981/output/arm64-apple-darwin/bitcoin-3a463992b981-arm64-apple-darwin.tar.gz
  59c52d0190ad6182ffb5ca7124d05e9a18df4472db2662fe4dada7636f0b93c4  guix-build-3a463992b981/output/dist-archive/bitcoin-3a463992b981.tar.gz
  bb5b090610c2200223fbb3ac18bd274f3ac5cbbf0b122b520645b1945f03e7f1  guix-build-3a463992b981/output/powerpc64-linux-gnu/SHA256SUMS.part
  4e76e3e933ac1cad56ef8a970c7dc617a57bbd46d1c13554455f6ed72114d7d3  guix-build-3a463992b981/output/powerpc64-linux-gnu/bitcoin-3a463992b981-powerpc64-linux-gnu-debug.tar.gz
  2039d619824f4678367e71ca1a09c2dcd01ba4fca0151193235e991fec927cf2  guix-build-3a463992b981/output/powerpc64-linux-gnu/bitcoin-3a463992b981-powerpc64-linux-gnu.tar.gz
  9023d223c41a82907b5cea5f011b16b9ac83155d7c152315576339dd78d2ed7b  guix-build-3a463992b981/output/powerpc64le-linux-gnu/SHA256SUMS.part
  35d374257124b4c8bc59f938dbc9428f4c45fd38a45e29f9afa4c31fb129c593  guix-build-3a463992b981/output/powerpc64le-linux-gnu/bitcoin-3a463992b981-powerpc64le-linux-gnu-debug.tar.gz
  aee514d913c905c153ec06a20521fa5698096e94e124f2262a16bba3bf7dc0fb  guix-build-3a463992b981/output/powerpc64le-linux-gnu/bitcoin-3a463992b981-powerpc64le-linux-gnu.tar.gz
  39ca1e06c8ef5086055242286e58c096965494ce050b7780171492fcbc6c78e1  guix-build-3a463992b981/output/riscv64-linux-gnu/SHA256SUMS.part
  f92412fdf3566518dc16a03a24eaa00e82550ad0f7f0ef14e2d4772f69ff8496  guix-build-3a463992b981/output/riscv64-linux-gnu/bitcoin-3a463992b981-riscv64-linux-gnu-debug.tar.gz
  11c0a55d760f422135c3a5c9e3b7acdec4a1e001dde47e4830f9a64e39cea13c  guix-build-3a463992b981/output/riscv64-linux-gnu/bitcoin-3a463992b981-riscv64-linux-gnu.tar.gz
  c0a4bfb7f3b62bbe9b3e0e8dc05395e72d31a151038a5278acf78c5f3abd1b30  guix-build-3a463992b981/output/x86_64-apple-darwin/SHA256SUMS.part
  3c6a8e2b91b66cbdbf811251e95ae2a68604fc0f442695211727b6f740e303f9  guix-build-3a463992b981/output/x86_64-apple-darwin/bitcoin-3a463992b981-x86_64-apple-darwin-unsigned.dmg
  2d0b0b0615d83ef4c876fd99628e2d21b57acef0f1dc2ee175d0c0c3786dc63c  guix-build-3a463992b981/output/x86_64-apple-darwin/bitcoin-3a463992b981-x86_64-apple-darwin-unsigned.tar.gz
  e4c123cc6c848d342154cf6f47518465ab0238e8779f5d253095cf429eb2cafb  guix-build-3a463992b981/output/x86_64-apple-darwin/bitcoin-3a463992b981-x86_64-apple-darwin.tar.gz
  4f6801b93e458f59611e40d725eb910720ef91cb6dc5052f8b314df2b892e5f8  guix-build-3a463992b981/output/x86_64-linux-gnu/SHA256SUMS.part
  5a60dab96f4db45facd0d0f126803f3af864eb0fe6bfdb338deb89a28d22c857  guix-build-3a463992b981/output/x86_64-linux-gnu/bitcoin-3a463992b981-x86_64-linux-gnu-debug.tar.gz
  949185ab779c0f7199a468fb384636de30e8f689173c797dec0ab51eb67e6120  guix-build-3a463992b981/output/x86_64-linux-gnu/bitcoin-3a463992b981-x86_64-linux-gnu.tar.gz
  ffc2e51b928c6f76ee678cbf8291c5dce00a221c5241d88fcd449dbdfc2b0861  guix-build-3a463992b981/output/x86_64-w64-mingw32/SHA256SUMS.part
  2ba59ab5a27249ab06a396401633ff9fb688b02fb364a39edad4d3120e3f02aa  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64-debug.zip
  17378a06f3ae08cd50f840bf8279b4a54ef587da69080ad59a5948799af47eda  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64-setup-unsigned.exe
  89e1929c669e9d62dae804f65a886eae8ff7fdf7fe8ba965c57ba9ebaf84e7ff  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64-unsigned.tar.gz
  7ec3021e84296632182261d3017a9e25c4573013d61fb2a13c9ec46ef35a1e59  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 3a463992b981be382200004d5c44c130fc7a509f

Tree-SHA512: 3b21129e2f30f9ddd977741216876b89dc151fe27a7ae0608bbd6d8f2cbf7f1e93967c34c0674cd01074abe07af6195b11e8b1d7bef2ede8573c5babadf774d4
2024-01-01 17:48:18 -06:00
..
builders Merge bitcoin/bitcoin#23955: build: add support for NetBSD in depends 2023-12-26 22:26:21 -06:00
hosts Merge bitcoin/bitcoin#23955: build: add support for NetBSD in depends 2023-12-26 22:26:21 -06:00
packages Merge bitcoin/bitcoin#24526: build: don't install deprecated libevent headers 2024-01-01 17:48:17 -06:00
patches Merge bitcoin/bitcoin#24613: build: remove unused QMAKE_* VARs 2024-01-01 17:48:18 -06:00
.gitignore Merge #17678: depends: Support for S390X and POWER targets 2023-04-25 23:14:25 +03:00
config.guess Merge bitcoin/bitcoin#22071: depends: latest config.guess and config.sub 2021-09-24 13:32:15 -04:00
config.site.in Merge #17658: depends: add ability to skip building qrencode 2022-05-30 19:09:39 +07:00
config.sub Merge bitcoin/bitcoin#22071: depends: latest config.guess and config.sub 2021-09-24 13:32:15 -04:00
description.md trivial: add some missing dashifications (#4772) 2022-04-19 09:09:42 +03:00
funcs.mk merge bitcoin#23998: support OpenBSD in depends 2023-08-08 06:05:02 -05:00
gen_id Merge bitcoin/bitcoin#21427: depends: Fix id_string invocations 2023-04-14 23:34:14 -05:00
Makefile Merge bitcoin/bitcoin#23955: build: add support for NetBSD in depends 2023-12-26 22:26:21 -06:00
packages.md Merge #16691: doc: improve depends prefix documentation 2023-04-04 12:45:27 -05:00
README.md (partial) Merge #17934: doc: Use CONFIG_SITE variable instead of --prefix option 2023-12-03 20:32:22 -06: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

Dash 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 libcap-dev libz-dev libbz2-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 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

RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken test_dash executable (see https://github.com/bitcoin/bitcoin/pull/13543), this is apparently fixed in gcc-8.1.0.

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
  • 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
  • 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.

If some packages are not built, for example make NO_WALLET=1, the appropriate options will be passed to Dash Core'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

Android

Before proceeding with an Android build one needs to get the Android SDK and use the "SDK Manager" tool to download the NDK and one or more "Platform packages" (these are Android versions and have a corresponding API level). In order to build ANDROID_API_LEVEL (API level corresponding to the Android version targeted, e.g. Android 9.0 Pie is 28 and its "Platform package" needs to be available) and ANDROID_TOOLCHAIN_BIN (path to toolchain binaries depending on the platform the build is being performed on) need to be set.

API levels from 24 to 29 have been tested to work.

If the build includes Qt, environment variables ANDROID_SDK and ANDROID_NDK need to be set as well but can otherwise be omitted. This is an example command for a default build with no disabled dependencies:

ANDROID_SDK=/home/user/Android/Sdk ANDROID_NDK=/home/user/Android/Sdk/ndk-bundle make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin

Other documentation