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

..28-Jan-2021-

builders/H28-Jan-2021-4842

hosts/H28-Jan-2021-150100

packages/H28-Jan-2021-1,102912

patches/H28-Jan-2021-944805

.gitignoreH A D28-Jan-2021108 1514

MakefileH A D28-Jan-20218.6 KiB254185

README.mdH A D28-Jan-20216.3 KiB154109

config.guessH A D28-Jan-202147.2 KiB1,6661,456

config.site.inH A D28-Jan-20212.3 KiB10586

config.subH A D28-Jan-202130.9 KiB1,7941,637

description.mdH A D28-Jan-20212.5 KiB5439

funcs.mkH A D28-Jan-202112.6 KiB269214

packages.mdH A D28-Jan-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 libtinfo5
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<dl>
86<dt>SOURCES_PATH</dt>
87<dd>downloaded sources will be placed here</dd>
88<dt>BASE_CACHE</dt>
89<dd>built packages will be placed here</dd>
90<dt>SDK_PATH</dt>
91<dd>Path where sdk's can be found (used by macOS)</dd>
92<dt>FALLBACK_DOWNLOAD_PATH</dt>
93<dd>If a source file can't be fetched, try here before giving up</dd>
94<dt>NO_QT</dt>
95<dd>Don't download/build/cache qt and its dependencies</dd>
96<dt>NO_QR</dt>
97<dd>Don't download/build/cache packages needed for enabling qrencode</dd>
98<dt>NO_ZMQ</dt>
99<dd>Don't download/build/cache packages needed for enabling zeromq</dd>
100<dt>NO_WALLET</dt>
101<dd>Don't download/build/cache libs needed to enable the wallet</dd>
102<dt>NO_BDB</dt>
103<dd>Don't download/build/cache BerkeleyDB</dd>
104<dt>NO_SQLITE</dt>
105<dd>Don't download/build/cache SQLite</dd>
106<dt>NO_UPNP</dt>
107<dd>Don't download/build/cache packages needed for enabling upnp</dd>
108<dt>ALLOW_HOST_PACKAGES</dt>
109<dd>Packages that are missed in dependencies (due to `NO_*` option or
110build script logic) are searched for among the host system packages using
111`pkg-config`. It allows building with packages of other (newer) versions</dd>
112<dt>MULTIPROCESS</dt>
113<dd>build libmultiprocess (experimental, requires cmake)</dd>
114<dt>DEBUG</dt>
115<dd>disable some optimizations and enable more runtime checking</dd>
116<dt>HOST_ID_SALT</dt>
117<dd>Optional salt to use when generating host package ids</dd>
118<dt>BUILD_ID_SALT</dt>
119<dd>Optional salt to use when generating build package ids</dd>
120<dt>FORCE_USE_SYSTEM_CLANG</dt>
121<dd>(EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the
122system's <code>$PATH</code> rather than the default prebuilt release of Clang
123from llvm.org. Clang 8 or later is required.</dd>
124</dl>
125
126If some packages are not built, for example `make NO_WALLET=1`, the appropriate
127options will be passed to bitcoin's configure. In this case, `--disable-wallet`.
128
129### Additional targets
130
131    download: run 'make download' to fetch all sources without building them
132    download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
133    download-win: run 'make download-win' to fetch all sources needed for win builds
134    download-linux: run 'make download-linux' to fetch all sources needed for linux builds
135
136
137### Android
138
139Before 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).
140In 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.
141
142API levels from 24 to 29 have been tested to work.
143
144If the build includes Qt, environment variables `ANDROID_SDK` and `ANDROID_NDK` need to be set as well but can otherwise be omitted.
145This is an example command for a default build with no disabled dependencies:
146
147    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
148
149### Other documentation
150
151- [description.md](description.md): General description of the depends system
152- [packages.md](packages.md): Steps for adding packages
153
154