|
| 1 | +### Usage |
| 2 | + |
| 3 | +To build dependencies for the current arch+OS: |
| 4 | + |
| 5 | + make |
| 6 | + |
| 7 | +To build for another arch/OS: |
| 8 | + |
| 9 | + make HOST=host-platform-triplet |
| 10 | + |
| 11 | +For example: |
| 12 | + |
| 13 | + make HOST=x86_64-w64-mingw32 -j4 |
| 14 | + |
| 15 | +**BGL Core's `configure` script by default will ignore the depends output.** In |
| 16 | +order for it to pick up libraries, tools, and settings from the depends build, |
| 17 | +you must set the `CONFIG_SITE` environment variable to point to a `config.site` settings file. |
| 18 | +Make sure that `CONFIG_SITE` is an absolute path. |
| 19 | +In the above example, a file named `depends/x86_64-w64-mingw32/share/config.site` will be |
| 20 | +created. To use it during compilation: |
| 21 | + |
| 22 | + CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure |
| 23 | + |
| 24 | +The default install prefix when using `config.site` is `--prefix=depends/<host-platform-triplet>`, |
| 25 | +so depends build outputs will be installed in that location. |
| 26 | + |
| 27 | +Common `host-platform-triplet`s for cross compilation are: |
| 28 | + |
| 29 | +- `i686-pc-linux-gnu` for Linux 32 bit |
| 30 | +- `x86_64-pc-linux-gnu` for x86 Linux |
| 31 | +- `x86_64-w64-mingw32` for Win64 |
| 32 | +- `x86_64-apple-darwin` for macOS |
| 33 | +- `arm64-apple-darwin` for ARM macOS |
| 34 | +- `arm-linux-gnueabihf` for Linux ARM 32 bit |
| 35 | +- `aarch64-linux-gnu` for Linux ARM 64 bit |
| 36 | +- `powerpc64-linux-gnu` for Linux POWER 64-bit (big endian) |
| 37 | +- `powerpc64le-linux-gnu` for Linux POWER 64-bit (little endian) |
| 38 | +- `riscv32-linux-gnu` for Linux RISC-V 32 bit |
| 39 | +- `riscv64-linux-gnu` for Linux RISC-V 64 bit |
| 40 | +- `s390x-linux-gnu` for Linux S390X |
| 41 | +- `armv7a-linux-android` for Android ARM 32 bit |
| 42 | +- `aarch64-linux-android` for Android ARM 64 bit |
| 43 | +- `x86_64-linux-android` for Android x86 64 bit |
| 44 | + |
| 45 | +The paths are automatically configured and no other options are needed unless targeting [Android](../doc/build-android.md). |
| 46 | + |
| 47 | +### Install the required dependencies: Ubuntu & Debian |
| 48 | + |
| 49 | +#### For macOS cross compilation |
| 50 | + |
| 51 | + sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools xorriso |
| 52 | + |
| 53 | +Note: You must obtain the macOS SDK before proceeding with a cross-compile. |
| 54 | +Under the depends directory, create a subdirectory named `SDKs`. |
| 55 | +Then, place the extracted SDK under this new directory. |
| 56 | +For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-extraction). |
| 57 | + |
| 58 | +#### For Win64 cross compilation |
| 59 | + |
| 60 | +- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux) |
| 61 | + |
| 62 | +#### For linux (including i386, ARM) cross compilation |
| 63 | + |
| 64 | +Common linux dependencies: |
| 65 | + |
| 66 | + sudo apt-get install make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison |
| 67 | + |
| 68 | +For linux ARM cross compilation: |
| 69 | + |
| 70 | + sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf |
| 71 | + |
| 72 | +For linux AARCH64 cross compilation: |
| 73 | + |
| 74 | + sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu |
| 75 | + |
| 76 | +For linux POWER 64-bit cross compilation (there are no packages for 32-bit): |
| 77 | + |
| 78 | + sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu |
| 79 | + |
| 80 | +For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit): |
| 81 | + |
| 82 | + sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu |
| 83 | + |
| 84 | +For linux S390X cross compilation: |
| 85 | + |
| 86 | + sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu |
| 87 | + |
| 88 | +### Install the required dependencies: OpenBSD |
| 89 | + |
| 90 | + pkg_add bash gtar |
| 91 | + |
| 92 | +### Dependency Options |
| 93 | + |
| 94 | +The following can be set when running make: `make FOO=bar` |
| 95 | + |
| 96 | +- `SOURCES_PATH`: Downloaded sources will be placed here |
| 97 | +- `BASE_CACHE`: Built packages will be placed here |
| 98 | +- `SDK_PATH`: Path where SDKs can be found (used by macOS) |
| 99 | +- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up |
| 100 | +- `C_STANDARD`: Set the C standard version used. Defaults to `c11`. |
| 101 | +- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`. |
| 102 | +- `NO_BOOST`: Don't download/build/cache Boost |
| 103 | +- `NO_LIBEVENT`: Don't download/build/cache Libevent |
| 104 | +- `NO_QT`: Don't download/build/cache Qt and its dependencies |
| 105 | +- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode |
| 106 | +- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ |
| 107 | +- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet |
| 108 | +- `NO_BDB`: Don't download/build/cache BerkeleyDB |
| 109 | +- `NO_SQLITE`: Don't download/build/cache SQLite |
| 110 | +- `NO_UPNP`: Don't download/build/cache packages needed for enabling UPnP |
| 111 | +- `NO_NATPMP`: Don't download/build/cache packages needed for enabling NAT-PMP |
| 112 | +- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints |
| 113 | +- `ALLOW_HOST_PACKAGES`: Packages that are missed in dependencies (due to `NO_*` option or |
| 114 | + build script logic) are searched for among the host system packages using |
| 115 | + `pkg-config`. It allows building with packages of other (newer) versions |
| 116 | +- `MULTIPROCESS`: Build libmultiprocess (experimental, requires CMake) |
| 117 | +- `DEBUG`: Disable some optimizations and enable more runtime checking |
| 118 | +- `HOST_ID_SALT`: Optional salt to use when generating host package ids |
| 119 | +- `BUILD_ID_SALT`: Optional salt to use when generating build package ids |
| 120 | +- `FORCE_USE_SYSTEM_CLANG`: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the |
| 121 | + system's `$PATH` rather than the default prebuilt release of Clang |
| 122 | + from llvm.org. Clang 8 or later is required |
| 123 | +- `LOG`: Use file-based logging for individual packages. During a package build its log file |
| 124 | + resides in the `depends` directory, and the log file is printed out automatically in case |
| 125 | + of build error. After successful build log files are moved along with package archives |
| 126 | +- `LTO`: Use LTO when building packages. |
| 127 | +- `NO_HARDEN=1`: Don't use hardening options when building packages |
| 128 | + |
| 129 | +If some packages are not built, for example `make NO_WALLET=1`, the appropriate |
| 130 | +options will be passed to BGL's configure. In this case, `--disable-wallet`. |
| 131 | + |
| 132 | +### Additional targets |
| 133 | + |
| 134 | + download: run 'make download' to fetch all sources without building them |
| 135 | + download-osx: run 'make download-osx' to fetch all sources needed for macOS builds |
| 136 | + download-win: run 'make download-win' to fetch all sources needed for win builds |
| 137 | + download-linux: run 'make download-linux' to fetch all sources needed for linux builds |
| 138 | + |
| 139 | + |
| 140 | +### Other documentation |
| 141 | + |
| 142 | +- [description.md](description.md): General description of the depends system |
| 143 | +- [packages.md](packages.md): Steps for adding packages |
0 commit comments