Add BSD build notes and dependencies

Also makes a couple minor compatibility fixes:

 - OpenBSD's thread name in Loguru

 - Update headers for the BSDs
This commit is contained in:
kcgen 2023-03-13 15:10:26 -07:00 committed by kcgen
parent ef86642de3
commit 685eb22d67
10 changed files with 242 additions and 16 deletions

53
docs/build-freebsd.md Normal file
View file

@ -0,0 +1,53 @@
# Building on FreeBSD
FreeBSD builds can be created with Clang using the Meson build system.
Before getting started, you should know that FreeBSD isn't fully supported or
used by the current maintainers. It's been lightly tested on a big-endian
PowerPC system.
## Pre-requisites
### Setup your `bin` path
In order to run Python PIP-installed programs, we link `~/.local/bin` to
`~/bin`, which is in FreeBSD's default user `PATH`:
``` shell
ln -s .local/bin ~/bin
```
## Build instructions
Clone and enter the repository:
``` shell
git clone https://github.com/dosbox-staging/dosbox-staging.git
cd dosbox-staging
```
Install dependencies:
``` shell
$ su (enter root password)
# pkg install `cat packages/freebsd.txt`
# exit (back to your user account)
$ pip install meson
```
Build:
``` shell
meson setup build
ninja -C build
```
To learn more about Meson's build options, see [BUILD.md](/BUILD.md).
## Run
Your binary is `build/dosbox`, which you can link into your `~/bin/` path:
```shell
ln -s $PWD/build/dosbox ~/bin/dosbox-staging
```

97
docs/build-openbsd.md Normal file
View file

@ -0,0 +1,97 @@
# Building on OpenBSD
OpenBSD builds can be created with Clang using the Meson build system.
Before getting started, you should know that OpenBSD isn't fully supported or
used by the current maintainers. It's been lightly tested on a big-endian
PowerPC system.
## Pre-requisites
### Expand the systems' memory limits
The LLVM link process will map more virtual memory than OpenBSD normally grants
to user processes, so it's recommended to open up these limits by editing
`/etc/login.conf` with your root account:
Change the two default `datasize-` fields to `infinity`, as follows:
```
default:\
...
:datasize-max=infinity:\
:datasize-cur=infinity:\
...
```
This change allowed the link process to successfully run on an Apple Powerbook
G4 with only 2 GB of physical RAM.
### Setup your `bin` path
In order to run Python PIP-installed programs, we link `~/.local/bin` to
`~/bin`, which is in OpenBSD's default user `PATH`:
``` shell
ln -s .local/bin ~/bin
```
### Consider a `wxallowed` mount-point on slow hardware
If your platform is old or slow (such as 32-bit PowerPC, MIPS, or
32-bit ARM SBC), then you might benefit by disabling per-page W^X
permission flagging.
If so:
1) Read the about the per-page W^X permission build option in the
`meson_options.txt`, and consider comparing builds.
2) If you do make a build without per-page W^X (`-Dper_page_w_or_x=disabled`)
your binary needs to reside within a filesystem mounted with the
`wxallowed` flag. This is OpenBSD-specific, where as the other BSDs
don't have this requirement.
The good news is that OpenBSD mounts `/usr/local` with the `wxallowed`
flag by default, so the easiest option is to simply place your
build tree under there, for example: `/usr/local/src/dosbox-staging`.
Alternatively, you can edit `/etc/fstab` and add the `wxallowed`
mount flag the filesystem where your build tree resides.
If you're on a fast 64-bit platform or _are_ using per-page W^X, then
your binary will run anywhere and you can skip this.
## Build instructions
Clone and enter the repository:
``` shell
git clone https://github.com/dosbox-staging/dosbox-staging.git
cd dosbox-staging
```
Install dependencies:
``` shell
pkg_add $(cat packages/openbsd.txt)
pip install meson
```
Build:
``` shell
meson setup build
ninja -C build
```
To learn more about Meson's build options, see [BUILD.md](/BUILD.md).
## Run
Your binary is `build/dosbox`, which you can link into your `~/bin/` path:
```shell
ln -s $PWD/build/dosbox ~/bin/dosbox-staging
```