Skip to content

Commit 229943b

Browse files
committed
Merge bitcoin/bitcoin#32086: Shuffle depends instructions and recommend modern make for macOS
22cff32 doc: recommend gmake for FreeBSD (Sjors Provoost) b645c52 doc: recommend modern make for macOS depends (Sjors Provoost) 99e6490 doc: shuffle depends instructions (Sjors Provoost) Pull request description: macOS ships with GNU Make 3.81 from 2006. This has caused difficult to debug issues, e.g. #32070 and #30978. Tell users / developers who use the depends system to install a modern version of `make`. This PR does not change the non-depends build. Although Homebrew allows overriding the system `make`, we instead just instruct users to build with `gmake`. This way there should be no impact on other projects they wish to compile. To increase the likeliness of anyone actually seeing and following this instruction, the first commit moves things around in `depends/README.md`. It now starts with instructions for a local build and moves cross-compilation to the end. For each platform it shows what to install (`apt install`, `brew install`, etc) and what command to run (`make` or `gmake`). There previously was no macOS specific section, so this is added. It points to the general `build-osx.md` for how to install the Xcode Command Line Tools and Homebrew Package Manager. I didn't test on an empty system. Preview: https://github.com/Sjors/bitcoin/tree/2025/03/mc-make/depends#depends-build ACKs for top commit: maflcko: review ACK 22cff32 🏣 hebasto: re-ACK 22cff32. willcl-ark: ACK 22cff32 Tree-SHA512: 11648ae73f3b70bc2df771e4eddca37221cd88b88bea4139a183e3f67f24a4c3e5aadf61a713ed73f3fc206511dfcf8670e4c4143c49dd4e56e501030be9c7ba
2 parents baa848b + 22cff32 commit 229943b

File tree

1 file changed

+90
-67
lines changed

1 file changed

+90
-67
lines changed

depends/README.md

Lines changed: 90 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,107 @@
1-
### Usage
1+
# Depends build
2+
3+
This is a system of building and caching dependencies necessary for building
4+
Bitcoin Core. It supports cross-compilation. For more details see [description.md](description.md),
5+
as well as [packages.md](packages.md) for how to add packages.
6+
7+
## Usage
8+
9+
### Ubuntu & Debian
10+
11+
apt install cmake curl make patch
12+
13+
Skip the following packages if you don't intend to use the GUI and will build with [`NO_QT=1`](#dependency-options):
14+
15+
apt install bison g++ ninja-build pkgconf python3 xz-utils
216

317
To build dependencies for the current arch+OS:
418

519
make
620

7-
To build for another arch/OS:
21+
### macOS
822

9-
make HOST=host-platform-triplet
23+
Install Xcode Command Line Tools and Homebrew Package Manager,
24+
see [build-osx.md](../doc/build-osx.md).
1025

11-
For example:
26+
brew install cmake make ninja
1227

13-
make HOST=x86_64-w64-mingw32 -j4
28+
To build dependencies for the current arch+OS:
29+
30+
gmake
31+
32+
### FreeBSD
33+
34+
pkg install bash
35+
36+
To build dependencies for the current arch+OS:
37+
38+
gmake
39+
40+
### NetBSD
41+
42+
pkgin install bash gmake
43+
44+
To build dependencies for the current arch+OS:
45+
46+
gmake
47+
48+
### OpenBSD
49+
50+
pkg_add bash gmake gtar
51+
52+
To build dependencies for the current arch+OS:
53+
54+
gmake
55+
56+
## Configuring Bitcoin Core
1457

1558
**When configuring Bitcoin Core, CMake by default will ignore the depends output.** In
1659
order for it to pick up libraries, tools, and settings from the depends build,
1760
you must specify the toolchain file.
18-
In the above example, a file named `depends/x86_64-w64-mingw32/toolchain.cmake` will be
61+
In the above example for Ubuntu, a file named `depends/x86_64-pc-linux-gnu/toolchain.cmake` will be
1962
created. To use it during configuring Bitcoin Core:
2063

21-
cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
64+
cmake -B build --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake
65+
66+
## Dependency Options
67+
68+
The following can be set when running make: `make FOO=bar`
69+
70+
- `SOURCES_PATH`: Downloaded sources will be placed here
71+
- `BASE_CACHE`: Built packages will be placed here
72+
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
73+
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
74+
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
75+
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++20`.
76+
- `NO_BOOST`: Don't download/build/cache Boost
77+
- `NO_LIBEVENT`: Don't download/build/cache Libevent
78+
- `NO_QT`: Don't download/build/cache Qt and its dependencies
79+
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
80+
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ
81+
- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet (SQLite)
82+
- `NO_BDB`: Don't download/build/cache BerkeleyDB
83+
- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints
84+
- `MULTIPROCESS`: Build libmultiprocess (experimental)
85+
- `DEBUG`: Disable some optimizations and enable more runtime checking
86+
- `HOST_ID_SALT`: Optional salt to use when generating host package ids
87+
- `BUILD_ID_SALT`: Optional salt to use when generating build package ids
88+
- `LOG`: Use file-based logging for individual packages. During a package build its log file
89+
resides in the `depends` directory, and the log file is printed out automatically in case
90+
of build error. After successful build log files are moved along with package archives
91+
- `LTO`: Enable options needed for LTO. Does not add `-flto` related options to *FLAGS.
92+
93+
If some packages are not built, for example `make NO_WALLET=1`, the appropriate CMake cache
94+
variables will be set when generating the Bitcoin Core buildsystem. In this case, `-DENABLE_WALLET=OFF`.
95+
96+
## Cross compilation
97+
98+
To build for another arch/OS:
99+
100+
make HOST=host-platform-triplet
101+
102+
For example:
103+
104+
make HOST=x86_64-w64-mingw32 -j4
22105

23106
Common `host-platform-triplet`s for cross compilation are:
24107

@@ -37,18 +120,6 @@ Common `host-platform-triplet`s for cross compilation are:
37120

38121
The paths are automatically configured and no other options are needed.
39122

40-
### Install the required dependencies: Ubuntu & Debian
41-
42-
#### Common
43-
44-
apt install cmake curl make patch
45-
46-
#### GUI
47-
48-
Skip the following packages if you don't intend to use the GUI and will build with [`NO_QT=1`](#dependency-options):
49-
50-
apt install bison g++ ninja-build pkgconf python3 xz-utils
51-
52123
#### For macOS cross compilation
53124

54125
apt install clang lld llvm zip
@@ -88,57 +159,9 @@ For linux S390X cross compilation:
88159

89160
sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu
90161

91-
### Install the required dependencies: FreeBSD
92-
93-
pkg install bash
94-
95-
### Install the required dependencies: NetBSD
96-
97-
pkgin install bash gmake
98-
99-
### Install the required dependencies: OpenBSD
100-
101-
pkg_add bash gmake gtar
102-
103-
### Dependency Options
104-
105-
The following can be set when running make: `make FOO=bar`
106-
107-
- `SOURCES_PATH`: Downloaded sources will be placed here
108-
- `BASE_CACHE`: Built packages will be placed here
109-
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
110-
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
111-
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
112-
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++20`.
113-
- `NO_BOOST`: Don't download/build/cache Boost
114-
- `NO_LIBEVENT`: Don't download/build/cache Libevent
115-
- `NO_QT`: Don't download/build/cache Qt and its dependencies
116-
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
117-
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ
118-
- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet (SQLite)
119-
- `NO_BDB`: Don't download/build/cache BerkeleyDB
120-
- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints
121-
- `MULTIPROCESS`: Build libmultiprocess (experimental)
122-
- `DEBUG`: Disable some optimizations and enable more runtime checking
123-
- `HOST_ID_SALT`: Optional salt to use when generating host package ids
124-
- `BUILD_ID_SALT`: Optional salt to use when generating build package ids
125-
- `LOG`: Use file-based logging for individual packages. During a package build its log file
126-
resides in the `depends` directory, and the log file is printed out automatically in case
127-
of build error. After successful build log files are moved along with package archives
128-
- `LTO`: Enable options needed for LTO. Does not add `-flto` related options to *FLAGS.
129-
130-
If some packages are not built, for example `make NO_WALLET=1`, the appropriate CMake cache
131-
variables will be set when generating the Bitcoin Core buildsystem. In this case, `-DENABLE_WALLET=OFF`.
132-
133162
### Additional targets
134163

135164
download: run 'make download' to fetch all sources without building them
136165
download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
137166
download-win: run 'make download-win' to fetch all sources needed for win builds
138167
download-linux: run 'make download-linux' to fetch all sources needed for linux builds
139-
140-
141-
### Other documentation
142-
143-
- [description.md](description.md): General description of the depends system
144-
- [packages.md](packages.md): Steps for adding packages

0 commit comments

Comments
 (0)