• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..17-May-2021-

builders/H17-May-2021-4741

hosts/H17-May-2021-10382

packages/H17-May-2021-1,071888

patches/H17-May-2021-567492

.gitignoreH A D17-May-2021108 1514

MakefileH A D17-May-20217.1 KiB208165

README.mdH A D17-May-20215.5 KiB12681

config.guessH A D17-May-202147.2 KiB1,6661,456

config.site.inH A D17-May-20212.3 KiB10788

config.subH A D17-May-202130.9 KiB1,7941,637

description.mdH A D17-May-20212.5 KiB5439

funcs.mkH A D17-May-202111.9 KiB255200

packages.mdH A D17-May-20217 KiB199148

README.md

1### Usage
2
3To build dependencies for the current arch+OS:
4
5    make
6
7To build for another arch/OS:
8
9    make HOST=host-platform-triplet
10
11For example:
12
13    make HOST=x86_64-w64-mingw32 -j4
14
15**Bitcoin Core's configure script by default will ignore the depends output.** In
16order for it to pick up libraries, tools, and settings from the depends build,
17you must point it at the appropriate `--prefix` directory generated by the
18build. In the above example, a prefix dir named x86_64-w64-mingw32 will be
19created. To use it for Bitcoin:
20
21    ./configure --prefix=$PWD/depends/x86_64-w64-mingw32
22
23Common `host-platform-triplets` for cross compilation are:
24
25- `i686-pc-linux-gnu` for Linux 32 bit
26- `x86_64-pc-linux-gnu` for x86 Linux
27- `x86_64-w64-mingw32` for Win64
28- `x86_64-apple-darwin16` for macOS
29- `arm-linux-gnueabihf` for Linux ARM 32 bit
30- `aarch64-linux-gnu` for Linux ARM 64 bit
31- `powerpc64-linux-gnu` for Linux POWER 64-bit (big endian)
32- `powerpc64le-linux-gnu` for Linux POWER 64-bit (little endian)
33- `riscv32-linux-gnu` for Linux RISC-V 32 bit
34- `riscv64-linux-gnu` for Linux RISC-V 64 bit
35- `s390x-linux-gnu` for Linux S390X
36- `armv7a-linux-android` for Android ARM 32 bit
37- `aarch64-linux-android` for Android ARM 64 bit
38- `i686-linux-android` for Android x86 32 bit
39- `x86_64-linux-android` for Android x86 64 bit
40
41The paths are automatically configured and no other options are needed unless targeting [Android](#Android).
42
43### Install the required dependencies: Ubuntu & Debian
44
45#### For macOS cross compilation
46
47    sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools
48
49#### For Win64 cross compilation
50
51- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux)
52
53#### For linux (including i386, ARM) cross compilation
54
55Common linux dependencies:
56
57    sudo apt-get install make automake cmake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch
58
59For linux ARM cross compilation:
60
61    sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
62
63For linux AARCH64 cross compilation:
64
65    sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
66
67For linux POWER 64-bit cross compilation (there are no packages for 32-bit):
68
69    sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu
70
71For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):
72
73    sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
74
75RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_bitcoin` executable (see https://github.com/bitcoin/bitcoin/pull/13543),
76this is apparently fixed in gcc-8.1.0.
77
78For linux S390X cross compilation:
79
80    sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu
81
82### Dependency Options
83The following can be set when running make: make FOO=bar
84
85    SOURCES_PATH: downloaded sources will be placed here
86    BASE_CACHE: built packages will be placed here
87    SDK_PATH: Path where sdk's can be found (used by macOS)
88    FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
89    NO_QT: Don't download/build/cache qt and its dependencies
90    NO_QR: Don't download/build/cache packages needed for enabling qrencode
91    NO_ZMQ: Don't download/build/cache packages needed for enabling zeromq
92    NO_WALLET: Don't download/build/cache libs needed to enable the wallet
93    NO_UPNP: Don't download/build/cache packages needed for enabling upnp
94    DEBUG: disable some optimizations and enable more runtime checking
95    HOST_ID_SALT: Optional salt to use when generating host package ids
96    BUILD_ID_SALT: Optional salt to use when generating build package ids
97
98If some packages are not built, for example `make NO_WALLET=1`, the appropriate
99options will be passed to bitcoin's configure. In this case, `--disable-wallet`.
100
101### Additional targets
102
103    download: run 'make download' to fetch all sources without building them
104    download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
105    download-win: run 'make download-win' to fetch all sources needed for win builds
106    download-linux: run 'make download-linux' to fetch all sources needed for linux builds
107
108
109### Android
110
111Before proceeding with an Android build one needs to get the [Android SDK](https://developer.android.com/studio) 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).
112In 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.
113
114API levels from 24 to 29 have been tested to work.
115
116If the build includes Qt, environment variables `ANDROID_SDK` and `ANDROID_NDK` need to be set as well but can otherwise be omitted.
117This is an example command for a default build with no disabled dependencies:
118
119    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
120
121### Other documentation
122
123- [description.md](description.md): General description of the depends system
124- [packages.md](packages.md): Steps for adding packages
125
126