Skip to content

Commit

Permalink
Merge #201: cmake, doc: Update build-netbsd.md
Browse files Browse the repository at this point in the history
93b8458 cmake, doc: Update `build-netbsd.md` (Hennadii Stepanov)

Pull request description:

  Also changes from bitcoin#30143 have been included.

ACKs for top commit:
  vasild:
    ACK 93b8458

Tree-SHA512: c8d2bfe3605da2e5d9ec3388e410f904e369380429675d4e632491ca02c20281f9e17a19e550a8bdc984ef4a19adf287f88c21821e46c08728480f0e88e6687e
  • Loading branch information
hebasto committed May 22, 2024
2 parents c66caee + 93b8458 commit 7529967
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
4 changes: 4 additions & 0 deletions depends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ For linux S390X cross compilation:

pkg install bash

### Install the required dependencies: NetBSD

pkgin install bash gmake

### Install the required dependencies: OpenBSD

pkg_add bash gmake gtar
Expand Down
35 changes: 14 additions & 21 deletions doc/build-netbsd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NetBSD Build Guide

Updated for NetBSD [9.2](https://netbsd.org/releases/formal-9/NetBSD-9.2.html).
**Updated for NetBSD [10.0](https://netbsd.org/releases/formal-10/NetBSD-10.0.html)**

This guide describes how to build bitcoind, command-line utilities, and GUI on NetBSD.

Expand All @@ -12,23 +12,22 @@ Install the required dependencies the usual way you [install software on NetBSD]
The example commands below use `pkgin`.

```bash
pkgin install autoconf automake libtool pkg-config git gmake boost libevent

pkgin install git cmake pkg-config boost-headers libevent
```

NetBSD currently ships with an older version of `gcc` than is needed to build. You should upgrade your `gcc` and then pass this new version to the configure script.

For example, grab `gcc9`:
For example, grab `gcc12`:
```
pkgin install gcc9
pkgin install gcc12
```

Then, when configuring, pass the following:
```bash
./configure
cmake -B build
...
CC="/usr/pkg/gcc9/bin/gcc" \
CXX="/usr/pkg/gcc9/bin/g++" \
-DCMAKE_C_COMPILER="/usr/pkg/gcc12/bin/gcc" \
-DCMAKE_CXX_COMPILER="/usr/pkg/gcc12/bin/g++" \
...
```

Expand Down Expand Up @@ -66,10 +65,10 @@ pkgin install db4

#### GUI Dependencies

Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`.
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, Qt 5 is required.

```bash
pkgin install qt5
pkgin install qt5-qtbase qt5-qttools
```

The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`.
Expand All @@ -84,33 +83,27 @@ There is an included test suite that is useful for testing code changes when dev
To run the test suite (recommended), you will need to have Python 3 installed:

```bash
pkgin install python37
pkgin install python39
```

### Building Bitcoin Core

**Note**: Use `gmake` (the non-GNU `make` will exit with an error).


### 1. Configuration

There are many ways to configure Bitcoin Core. Here is an example that
explicitly disables the wallet and GUI:

```bash
./autogen.sh
./configure --without-wallet --with-gui=no \
CPPFLAGS="-I/usr/pkg/include" \
MAKE=gmake
cmake -B build -DENABLE_WALLET=OFF -DBUILD_GUI=OFF
```

For a full list of configuration options, see the output of `./configure --help`
Run `cmake -B build -LH` to see the full list of available options.

### 2. Compile

Build and run the tests:

```bash
gmake # use "-j N" here 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.
```

0 comments on commit 7529967

Please sign in to comment.