-
Notifications
You must be signed in to change notification settings - Fork 701
/
Building on BSD - FreeBSD, OpenBSD and NetBSD.txt
129 lines (104 loc) · 3.83 KB
/
Building on BSD - FreeBSD, OpenBSD and NetBSD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# SPDX-FileCopyrightText: 2024 Duncan Greatwood
#
# SPDX-License-Identifier: Apache-2.0
Making Pistache on *BSD
=======================
Pistache has been built and tested on FreeBSD, OpenBSD and NetBSD. As
of July-2024, the versions used for testing were FreeBSD 13.3,
OpenBSD 7.3 and NetBSD 10.0.
You will need to configure BSD with a working compiler.
We would recommend that you also have python installed, including pip
(use "python -m ensure-pip" if needed, and add the directory where pip
is installed to your path). Plus, we recommend installing sudo, if not
preinstalled.
You will need the following Pistache-dependencies installed:
git (and configure as needed)
llvm
meson
doxygen
googletest (*)
openssl
rapidjson (*)
howard-hinnant-date (*)
libevent
brotli libbrotli-dev (presuming you want to include)
zstd libzstd-dev (presuming you want to include)
See BSD-type-specific notes below regarding installing these
dependencies.
Convenience shell scripts are provided to make the build. Once
dependencies are installed, at the terminal, to build do:
bldscripts/mesbuild.sh
To test:
bldscripts/mestest.sh
To install:
bldscripts/mesinstall.sh
FreeBSD
=======
Typically, required packages are installed using:
sudo pkg install <package-name>
For instance:
sudo pkg install meson
Do this for each Pistache dependency, excluding howard-hinnant-date.
OpenBSD
=======
Typically, required packages are installed using:
doas pkg_add <package-name>
For instance:
doas pkg_add meson
Do this for each Pistache dependency, excluding googletest and
rapidjson.
(Note: You may use sudo instead of doas if you have installed the sudo
package and configured sudo; however, doas is often preferred on
OpenBSD.)
NetBSD
======
Typically, required packages are installed using:
sudo pkg_in install <package-name>
For instance:
sudo pkg_in install meson
Do this for each Pistache dependency, excluding howard-hinnant-date.
Regarding NetBSD 9.4. NetBSD 9.4 uses gcc 7.5.0, while Pistache's
build files require C++17 support, and Pistache's code uses
std::filesystem. However, gcc 7.5.0 does not work correctly with
std::filesystem when C++17 is specified. Accordingly, we have tested
with NetBSD 10.0, not 9.4. Nonetheless, it is possible that Pistache
could be made to work on NetBSD 9.* with a different compiler or
different compiler version.
Regarding the test net_test.invalid_address, it may be slow to execute
(about 2 minutes) in NetBSD. The cause is a long time out for the
system function getaddrinfo; it doesn't appear to an issue in
Pistache.
(*) Googletest, Rapidjson and Howard-hinnant-date Packages
==========================================================
These packages are provided as Pistache subprojects, and so do not
have to be installed seperately on the BSD system. Also, note that
there is no howard-hinnant-date package supplied as part of the OS by
FreeBSD 13 nor by NetBSD 10; and no googletest or rapidjson packages
supplied by OpenBSD 7. Nonetheless, if you would like to install
googletest, rapidjson and/or howard-hinnant-date manually on the BSD
system, please proceed as follows:
Googletest:
git clone https://github.com/google/googletest.git
cd googletest
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
Rapidjson:
git clone https://github.com/Tencent/rapidjson/
cd rapidjson/
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
Howard-hinnant-date:
git clone https://github.com/HowardHinnant/date.git
sudo mkdir /usr/local/include/date
sudo cp -p date/include/date/date.h /usr/local/include/date/.
(Note: Typically, use doas instead of sudo on OpenBSD).
How It Works
============
Pistache on BSD works very much as it does on macOS, i.e. by using the
libevent library to provide the core event loop.