# HG changeset patch
# User Juuso Lapinlampi <wubthecaptain@gmail.com>
# Date 1538906467 0
#      Sun Oct 07 10:01:07 2018 +0000
# Node ID 406f490aabbfc71e25340b33b5af3a4fbe7b3aeb
# Parent  657feabd0feb968f3ac330ac9009921c8dab3608
COMPILE.txt: Document OpenBSD build instructions

Add Clang to list of supported compilers. This is a prerequisite,
because it's the default C/C++ compiler since OpenBSD 6.4 I believe.

Includes a foreword warning about major issue with Qt5 on OpenBSD, to
save users possible major frustration and time waste debugging a known
issue. This may be removed once #3494 is solved.

Building on OpenBSD is not as straightforward as on GNU/Linux, due to
OpenBSD's habits. I found myself going to the bug tracker many times to
remind myself: "How do I compile on OpenBSD, again?"

See: #3494
Fixes: #3496

diff -r 657feabd0feb -r 406f490aabbf COMPILE.txt
--- a/COMPILE.txt	Sat Oct 06 20:43:12 2018 +0200
+++ b/COMPILE.txt	Sun Oct 07 10:01:07 2018 +0000
@@ -8,7 +8,7 @@
 * Optionally zlib and libbz2
 
 You will also need CMake to generate the Makefile and/or project files.
-Supported compilers are GCC and, on Windows, MSVC. For compiling on
+Supported compilers are GCC, clang and, on Windows, MSVC. For compiling on
 Windows see COMPILE.Windows.txt.
 
 On Ubuntu the Qt packages required are qtbase5-dev, qtmultimedia5-dev, and qttools5-dev.
@@ -22,6 +22,42 @@
 make
 sudo make install
 
+OpenBSD
+-------
+
+Foreword: There is a known major issue (#3494) with Doomseeker and Qt5 on
+OpenBSD. This issue may cause problems with master server queries for server
+listing; we're not aware of the issue on Qt4 builds on OpenBSD. Apologies.
+
+OpenBSD's base operating system comes with zlib and libbz2. Install the
+required ports (depending on your OpenBSD operating system version):
+
+    pkg_add qt5 cmake  # OpenBSD >= 5.7
+    pkg_add qt4 cmake  # OpenBSD >= 4.0 (>= 3.8 for qt4)
+
+Note that Qt4 and Qt5's installation on OpenBSD conforms to OpenBSD's habits,
+not Trolltech or Qt Project/The Qt Company's recommendations.
+
+Depending on Qt version installed, setting `Qt4_DIR` or `Qt5_DIR` is necessary
+for CMake to know to look for it.
+
+    export Qt4_DIR=/usr/local/lib/qt4/cmake/Qt4
+    export Qt5_DIR=/usr/local/lib/qt5/cmake/Qt5
+
+To build, run the following in the root of source directory:
+
+    mkdir build && cd build
+    CXXFLAGS="-I /usr/local/include" cmake ..
+    make
+
+`-I /usr/local/include` is required to find `bzlib.h` (system bzip2 library).
+
+Doomseeker has been tested at least on OpenBSD 6.4-current with CMake 3.10.2
+and Clang 6.0.0 toolchains, as of October 2018.
+
+g++ 4.2.1 from OpenBSD system is unsupported by CMake 3.10. g++ 4.9.4 from
+OpenBSD ports may be unsupported at runtime at this time.
+
 ----------------------------------------
 
 Quick Build for Redistribution
