# HG changeset patch
# User Juuso Lapinlampi <wubthecaptain@gmail.com>
# Date 1538856369 0
#      Sat Oct 06 20:06:09 2018 +0000
# Node ID 649798d8c481f6e035aa885209758f7bdfead7e1
# Parent  657feabd0feb968f3ac330ac9009921c8dab3608
COMPILE.txt: Document OpenBSD build instructions

Add Clang to list of supported compilers. This is a prerequisite, since
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 649798d8c481 COMPILE.txt
--- a/COMPILE.txt	Sat Oct 06 20:43:12 2018 +0200
+++ b/COMPILE.txt	Sat Oct 06 20:06:09 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,39 @@
 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:
+
+    pkg_add qtbase cmake # OpenBSD >= 6.2, latest Qt version (Qt5)
+    pkg_add qt5 cmake    # OpenBSD >= 5.7
+    pkg_add qt4 cmake    # OpenBSD >= 4.0 (>= 3.8 for qt4)
+
+To build, run the following in the root of source directory:
+
+    export Qt4_DIR=/usr/local/lib/qt4/cmake/Qt4
+    export Qt5_DIR=/usr/local/lib/qt5/cmake/Qt5
+    mkdir build && cd build
+    cmake \
+    	-DCMAKE_CXX_FLAGS="-I /usr/local/include" \
+	..
+    make
+
+Note that Qt4 and Qt5's installation on OpenBSD conforms to OpenBSD's habits,
+not Trolltech or Qt Project/The Qt Company's recommendations. Setting Qt5_DIR
+is necessary for CMake to know to look for it.
+
+`-I /usr/local/include` is required to find bzlib.h (system bzip2 library).
+
+Doomseeker has been tested on OpenBSD 6.4-current with both GCC 4.2.1 and Clang
+6.0.0 toolchains, as of October 2018.
+
 ----------------------------------------
 
 Quick Build for Redistribution
