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

..08-Sep-2021-

builders/H08-Sep-2021-4842

hosts/H08-Sep-2021-221125

packages/H08-Sep-2021-1,065862

patches/H08-Sep-2021-853736

.gitignoreH A D08-Sep-2021108 1514

MakefileH A D08-Sep-202110.5 KiB288173

README.mdH A D08-Sep-20216.8 KiB152102

config.guessH A D08-Sep-202148.4 KiB1,7031,490

config.site.inH A D08-Sep-20213.2 KiB131106

config.subH A D08-Sep-202133.8 KiB1,8651,687

description.mdH A D08-Sep-20212.5 KiB5439

funcs.mkH A D08-Sep-202113.1 KiB283222

gen_idH A D08-Sep-20212.4 KiB7535

packages.mdH A D08-Sep-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 set the `CONFIG_SITE` environment variable to point to a `config.site` settings file.
18In the above example, a file named `depends/x86_64-w64-mingw32/share/config.site` will be
19created. To use it during compilation:
20
21    CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure
22
23The default install prefix when using `config.site` is `--prefix=depends/<host-platform-triplet>`,
24so depends build outputs will be installed in that location.
25
26Common `host-platform-triplet`s for cross compilation are:
27
28- `i686-pc-linux-gnu` for Linux 32 bit
29- `x86_64-pc-linux-gnu` for x86 Linux
30- `x86_64-w64-mingw32` for Win64
31- `x86_64-apple-darwin18` for macOS
32- `arm-linux-gnueabihf` for Linux ARM 32 bit
33- `aarch64-linux-gnu` for Linux ARM 64 bit
34- `powerpc64-linux-gnu` for Linux POWER 64-bit (big endian)
35- `powerpc64le-linux-gnu` for Linux POWER 64-bit (little endian)
36- `riscv32-linux-gnu` for Linux RISC-V 32 bit
37- `riscv64-linux-gnu` for Linux RISC-V 64 bit
38- `s390x-linux-gnu` for Linux S390X
39- `armv7a-linux-android` for Android ARM 32 bit
40- `aarch64-linux-android` for Android ARM 64 bit
41- `i686-linux-android` for Android x86 32 bit
42- `x86_64-linux-android` for Android x86 64 bit
43
44The paths are automatically configured and no other options are needed unless targeting [Android](#Android).
45
46### Install the required dependencies: Ubuntu & Debian
47
48#### For macOS cross compilation
49
50    sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libz-dev python3-setuptools libtinfo5 xorriso
51
52Note: You must obtain the macOS SDK before proceeding with a cross-compile.
53Under the depends directory, create a subdirectory named `SDKs`.
54Then, place the extracted SDK under this new directory.
55For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-extraction).
56
57#### For Win64 cross compilation
58
59- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux)
60
61#### For linux (including i386, ARM) cross compilation
62
63Common linux dependencies:
64
65    sudo apt-get install make automake cmake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison
66
67For linux ARM cross compilation:
68
69    sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
70
71For linux AARCH64 cross compilation:
72
73    sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
74
75For linux POWER 64-bit cross compilation (there are no packages for 32-bit):
76
77    sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu
78
79For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):
80
81    sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
82
83RISC-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),
84this is apparently fixed in gcc-8.1.0.
85
86For linux S390X cross compilation:
87
88    sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu
89
90### Install the required dependencies: M1-based macOS
91
92To be able to build the `qt` package, ensure that Rosetta 2 is installed:
93
94```
95softwareupdate --install-rosetta
96```
97
98### Dependency Options
99
100The following can be set when running make: `make FOO=bar`
101
102- `SOURCES_PATH`: Downloaded sources will be placed here
103- `BASE_CACHE`: Built packages will be placed here
104- `SDK_PATH`: Path where SDKs can be found (used by macOS)
105- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
106- `NO_QT`: Don't download/build/cache Qt and its dependencies
107- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
108- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ
109- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet
110- `NO_BDB`: Don't download/build/cache BerkeleyDB
111- `NO_SQLITE`: Don't download/build/cache SQLite
112- `NO_UPNP`: Don't download/build/cache packages needed for enabling UPnP
113- `NO_NATPMP`: Don't download/build/cache packages needed for enabling NAT-PMP</dd>
114- `ALLOW_HOST_PACKAGES`: Packages that are missed in dependencies (due to `NO_*` option or
115  build script logic) are searched for among the host system packages using
116  `pkg-config`. It allows building with packages of other (newer) versions
117- `MULTIPROCESS`: Build libmultiprocess (experimental, requires CMake)
118- `DEBUG`: Disable some optimizations and enable more runtime checking
119- `HOST_ID_SALT`: Optional salt to use when generating host package ids
120- `BUILD_ID_SALT`: Optional salt to use when generating build package ids
121- `FORCE_USE_SYSTEM_CLANG`: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the
122  system's `$PATH` rather than the default prebuilt release of Clang
123  from llvm.org. Clang 8 or later is required.
124
125If some packages are not built, for example `make NO_WALLET=1`, the appropriate
126options will be passed to bitcoin's configure. In this case, `--disable-wallet`.
127
128### Additional targets
129
130    download: run 'make download' to fetch all sources without building them
131    download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
132    download-win: run 'make download-win' to fetch all sources needed for win builds
133    download-linux: run 'make download-linux' to fetch all sources needed for linux builds
134
135
136### Android
137
138Before 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).
139In 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.
140
141API levels from 24 to 29 have been tested to work.
142
143If the build includes Qt, environment variables `ANDROID_SDK` and `ANDROID_NDK` need to be set as well but can otherwise be omitted.
144This is an example command for a default build with no disabled dependencies:
145
146    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
147
148### Other documentation
149
150- [description.md](description.md): General description of the depends system
151- [packages.md](packages.md): Steps for adding packages
152