From 1db3e30405415fea59a22adac90a6f8f3754566b Mon Sep 17 00:00:00 2001 From: hubslave <29800872+hubslave@users.noreply.github.com> Date: Sat, 3 Mar 2018 18:09:37 +0200 Subject: [PATCH] Created Building for OpenBSD (markdown) --- Building-for-OpenBSD.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Building-for-OpenBSD.md diff --git a/Building-for-OpenBSD.md b/Building-for-OpenBSD.md new file mode 100644 index 0000000..9e0fedc --- /dev/null +++ b/Building-for-OpenBSD.md @@ -0,0 +1,29 @@ +*OpenBSD is not officially supported. These instructions are not actively updated and represent what happened to work for one user on amd64 in March 2018.* + +Install the required packages: +``` +pkg_add cmake curl sdl2 qtbase +``` +The repository uses submodules, so remember to clone it recursively: +``` +git clone --recursive https://github.com/citra-emu/citra +cd citra +``` +To build, run the following in the repository root directory: +``` +mkdir build && cd build +export Qt5_DIR=/usr/local/lib/qt5/cmake/Qt5 +cmake \ + -DCMAKE_CXX_FLAGS='-I/usr/local/include -O2' \ + -DCMAKE_EXE_LINKER_FLAGS='-z wxneeded' \ + -DUSE_SYSTEM_CURL=1 .. +make +``` +Rationale: ++ Setting `Qt5_DIR` is necessary because OpenBSD installs the Qt5 CMake files under a nonstandard path. ++ `-I/usr/local/include` is needed for the compiler to find `iconv.h`, as the base compiler does not look under `/usr/local/include` by default. ++ `-O2` is needed for playable performance; this needs to be set even if `CMAKE_BUILD_TYPE=Release`, as it does not set optimization flags by default (perhaps because the base amd64 compiler is clang?) ++ Linking with `-z wxneeded` is needed to enable writable-executable memory on OpenBSD. The resulting binary still needs to be run a partition with `wxallowed` set in the mount flags; `/usr/local` is mounted like this by default. ++ `USE_SYSTEM_CURL=1` was copied from the [Linux build instructions][1]. + +[1]: Building-for-Linux \ No newline at end of file