From f8994d142f2a3e43642d50234dbd213a7b8acdd0 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:32:26 +0100 Subject: [PATCH] cmake, doc: Update `build-openbsd.md` --- depends/README.md | 2 +- doc/build-openbsd.md | 46 ++++++++++++++++++-------------------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/depends/README.md b/depends/README.md index a8dfc83e3bb54..37b2547ea7560 100644 --- a/depends/README.md +++ b/depends/README.md @@ -87,7 +87,7 @@ For linux S390X cross compilation: ### Install the required dependencies: OpenBSD - pkg_add bash gtar + pkg_add bash gmake gtar ### Dependency Options diff --git a/doc/build-openbsd.md b/doc/build-openbsd.md index 7ed83853a8673..463d4101194c5 100644 --- a/doc/build-openbsd.md +++ b/doc/build-openbsd.md @@ -1,6 +1,6 @@ # OpenBSD Build Guide -**Updated for OpenBSD [7.4](https://www.openbsd.org/74.html)** +**Updated for OpenBSD [7.5](https://www.openbsd.org/75.html)** This guide describes how to build bitcoind, command-line utilities, and GUI on OpenBSD. @@ -10,9 +10,7 @@ This guide describes how to build bitcoind, command-line utilities, and GUI on O Run the following as root to install the base dependencies for building. ```bash -pkg_add bash git gmake libevent libtool boost -# Select the newest version of the following packages: -pkg_add autoconf automake python +pkg_add git cmake boost libevent ``` See [dependencies.md](dependencies.md) for a complete overview. @@ -31,7 +29,7 @@ It is not necessary to build wallet functionality to run either `bitcoind` or `b ###### Descriptor Wallet Support -`sqlite3` is required to support [descriptor wallets](descriptors.md). +SQLite is required to support [descriptor wallets](descriptors.md). ``` bash pkg_add sqlite3 @@ -48,13 +46,13 @@ Refer to [depends/README.md](/depends/README.md) for detailed instructions. ```bash gmake -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 ... -to: /path/to/bitcoin/depends/x86_64-unknown-openbsd +to: /path/to/bitcoin/depends/*-unknown-openbsd* ``` Then set `BDB_PREFIX`: ```bash -export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-unknown-openbsd" +export BDB_PREFIX="[path displayed above]" ``` #### GUI Dependencies @@ -63,50 +61,44 @@ export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-unknown-openbsd" Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, Qt 5 is required. ```bash -pkg_add qt5 +pkg_add qtbase qttools ``` -## Building Bitcoin Core - -**Important**: Use `gmake` (the non-GNU `make` will exit with an error). +#### Test Suite Dependencies +There is an included test suite that is useful for testing code changes when developing. +To run the test suite (recommended), you will need to have Python 3 installed: -Preparation: ```bash - -# Adapt the following for the version you installed (major.minor only): -export AUTOCONF_VERSION=2.71 -export AUTOMAKE_VERSION=1.16 - -./autogen.sh +pkg_add install python # Select the newest version of the package. ``` +## Building Bitcoin Core + ### 1. Configuration There are many ways to configure Bitcoin Core, here are a few common examples: ##### Descriptor Wallet and GUI: -This enables the GUI and descriptor wallet support, assuming `sqlite` and `qt5` are installed. +This enables the GUI and descriptor wallet support, assuming SQLite and Qt 5 are installed. ```bash -./configure MAKE=gmake +cmake -B build -DWITH_SQLITE=ON -DWITH_GUI=Qt5 ``` +Run `cmake -B build -LH` to see the full list of available options. + ##### Descriptor & Legacy Wallet. No GUI: This enables support for both wallet types and disables the GUI: ```bash -./configure --with-gui=no \ - BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \ - BDB_CFLAGS="-I${BDB_PREFIX}/include" \ - MAKE=gmake +cmake -B build -DWITH_GUI=OFF -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include" ``` ### 2. Compile -**Important**: Use `gmake` (the non-GNU `make` will exit with an error). ```bash -gmake # use "-j N" for N parallel jobs -gmake check # Run tests if Python 3 is available +cmake --build build # Use "-j N" for N parallel jobs. +ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. ``` ## Resource limits