diff --git a/docpages/building/freebsd.md b/docpages/building/freebsd.md index 53788acf3c..f8ca1a87e1 100644 --- a/docpages/building/freebsd.md +++ b/docpages/building/freebsd.md @@ -1,46 +1,74 @@ \page buildfreebsd Building on FreeBSD +\note This page assumes you are the root user. If you are not, start the package install commands with `sudo`, along with `make install`. You will need `sudo` installed if you are not the root user. + ## 1. Toolchain -This project uses CMake. Install it with `pkg install cmake` -## 2. Install External Dependencies -Your FreeBSD base system should have all the required dependencies installed by default. +Since the project uses `CMake`, you'll need to install it! If you don't have it, you can do the following: + +```bash +pkg install cmake +``` + +## 2. Install Voice Dependencies (Optional) + +If you wish to use voice support, you'll need to install opus and libsodium: + +First, you need to install opus. +```bash +cd /usr/ports/audio/opus +make && make install +``` -For voice support, additional dependencies are required +Then, you need to install libsodium. - pkg install libsodium opus pkgconf +```bash +cd /usr/ports/security/libsodium +make && make install +``` ## 3. Build Source Code - cmake -B ./build - cmake --build ./build -j8 +```bash +cmake -B ./build +cmake --build ./build -j8 +``` Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library. -## 4. Install globally +## 4. Install Globally - cd build; make install +```bash +cd build +make install +``` -## 5. Installation to a different directory +## 5. Installation to a Different Directory (Optional) If you want to install the library, its dependencies and header files to a different directory, specify this directory when running `cmake`: - cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install +```bash +cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install +``` -Then once the build is complete, run `make install` to install to the location you specified. +Then once the build is complete, run `sudo make install` to install to the location you specified. -## 6. Using the library +## 6. Using the Library Once installed, you can make use of the library in standalone programs simply by including it and linking to it: - clang++ -std=c++17 -ldpp mydppbot.cpp -o dppbot +```bash +clang++ -std=c++17 -L/usr/local/lib -I/usr/local/include -ldpp bot.cpp -o dppbot +``` The important flags in this command-line are: - * `-std=c++17` - Required to compile the headers - * `-ldpp` - Link to libdpp.dylib - * `mydppbot.cpp` - Your source code - * `dppbot` - The name of the executable to make +* `-std=c++17` - Required to compile the headers +* `-L/usr/local/lib` - Required to tell the linker where libdpp is located. +* `-I/usr/local/include` - Required to tell the linker where dpp headers are located. +* `-ldpp` - Link to `libdpp.so`. +* `bot.cpp` - Your source code. +* `-o dppbot` - The name of the executable to make. \include{doc} install_prebuilt_footer.dox diff --git a/docpages/building/openbsd.md b/docpages/building/openbsd.md index 02d954949e..a289d75f13 100644 --- a/docpages/building/openbsd.md +++ b/docpages/building/openbsd.md @@ -1,6 +1,9 @@ \page buildopenbsd Building on OpenBSD +\note This page assumes you are the root user. If you are not, start the package install commands with `doas`, along with `make install`. + ## 1. Toolchain + Since the project uses `CMake`, you'll need to install it! If you don't have it, you can do the following: ```bash @@ -8,6 +11,7 @@ pkg_add cmake ``` ## 2. Install Voice Dependencies (Optional) + If you wish to use voice support, you'll need to do the following: ```bash @@ -23,13 +27,13 @@ cmake --build ./build -j8 Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library. -## 2. Install globally +## 4. Install Globally ```bash -cd build; sudo make install +cd build; make install ``` -## 3. Installation to a different directory +## 5. Installation to a Different Directory If you want to install the library, its dependencies and header files to a different directory, specify this directory when running `cmake`: @@ -39,21 +43,8 @@ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install Then once the build is complete, run `make install` to install to the location you specified. -## 4. Using the library - -Once installed to the `/usr/local` directory, you can make use of the library in standalone programs simply by including it and linking to it: - -```bash -clang++ -std=c++17 mydppbot.cpp -o dppbot -ldpp -``` - -The important flags in this command-line are: - - * `-std=c++17` - Required to compile the headers - * `-ldpp` - Link to libdpp.dylib - * `mydppbot.cpp` - Your source code - * `dppbot` - The name of the executable to make +## 6. Using the Library -\include{doc} install_prebuilt_footer.dox +Once installed to the `/usr/local` directory, you can make use of the library in CMake, without linking to a folder! You can't use this with `clang++`, nor `g++`, as OpenBSD seems to be broken on this end, so your only option from here is to use CMake. This isn't a bad thing, as we recommend people to use CMake anyways! **Have fun!**