widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #07890
[Merge] lp:~hjd/widelands/openbsd into lp:widelands
Hans Joachim Desserud has proposed merging lp:~hjd/widelands/openbsd into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~hjd/widelands/openbsd/+merge/300590
In my neverending quest to build Widelands everywhere, I've reached OpenBSD. :)
I've tried with older releases before, but they had some problems with the SDL2 packages. These are now resolved, so installing dependencies was fairly straight-forward on OpenBSD 5.9:
`pkg_add boost bzr cmake gcc g++ gettext-tools glew icu4c libexecinfo png sdl2-image sdl2-mixer sdl2-net sdl2-ttf`
Note that the default version of GCC is too old to build Widelands, so I had to install gcc packages and run cmake/make manually. Don't think that is avoidable:
`cmake .. -DCMAKE_C_COMPILER=egcc -DCMAKE_CXX_COMPILER=eg++`
When compiling, I got an error message stating it failed to find and include GL/glu.h. (I don't think WL includes it directly, but the glew headers do.) After some investigation, I found it was located in /usr/X11R6/include along with presumably other X11-related header files.
When finding and including this directory, Widelands built successfully. I have to admit I'm not sure if this is the best solution, but it works and that's at least a starting point for a discussion.
I tried to add the extra include directory only for modules with USES_OPENGL, since one would think the header file is only needed for these. This seemed to work, as graphics_gl_utils where I initially ran into problems now built successfully. Unfortunately, reverse dependencies such as wui (src/wui/actionconfirm.cc) require it later and fails because of the missing include. Could potentially be solved by marking all the reverse dependencies of opengl-modules as USES_OPENGL too, but that would need to be done manually and I don't know whether they should be tagged USES_* when they have no direct usage.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~hjd/widelands/openbsd into lp:widelands.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-06-26 10:10:16 +0000
+++ CMakeLists.txt 2016-07-20 12:52:30 +0000
@@ -190,6 +190,12 @@
if (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
find_library(EXECINFO_LIBRARY NAMES execinfo)
endif (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
+
+ #OpenBSD needs the X11 include directory in order to find GL/glu.h
+ if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ find_package(X11 REQUIRED)
+ include_directories(${X11_INCLUDE_DIR})
+ endif ()
endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
if (NOT DEFINED WL_VERSION)
Follow ups