Browse Source

engine: Haiku OS support (#478)

pull/2/head
exstrim401 3 years ago committed by GitHub
parent
commit
b7922368bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      engine/common/build.c
  2. 6
      engine/wscript
  3. 2
      game_launch/game.cpp
  4. 4
      public/build.h

2
engine/common/build.c

@ -93,6 +93,8 @@ const char *Q_buildos( void ) @@ -93,6 +93,8 @@ const char *Q_buildos( void )
osname = "emscripten";
#elif XASH_DOS4GW
osname = "DOS4GW";
#elif XASH_HAIKU
osname = "haiku";
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

6
engine/wscript

@ -62,6 +62,10 @@ def configure(conf): @@ -62,6 +62,10 @@ def configure(conf):
conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated')
conf.define('XASH_SDL', 2)
if conf.env.DEST_OS == 'haiku':
conf.env.LIB_HAIKU = ['network']
conf.env.LIBPATH_HAIKU = ['/boot/system/lib']
if conf.options.USE_SELECT == None:
conf.options.USE_SELECT = conf.options.DEDICATED
@ -112,6 +116,8 @@ def build(bld): @@ -112,6 +116,8 @@ def build(bld):
source += bld.path.ant_glob(['platform/dos/*.c'])
source += bld.path.ant_glob(['platform/stub/s_stub.c'])
if bld.env.DEST_OS == 'haiku':
libs.append('HAIKU')
if bld.get_define('XASH_CUSTOM_SWAP'):
source += bld.path.ant_glob(['platform/misc/kmalloc.c', 'platform/misc/sbrk.c'])

2
game_launch/game.cpp

@ -20,7 +20,7 @@ GNU General Public License for more details. @@ -20,7 +20,7 @@ GNU General Public License for more details.
#include <stdlib.h>
#include <stdarg.h>
#if defined(__APPLE__) || defined(__unix__)
#if defined(__APPLE__) || defined(__unix__) || defined(__HAIKU__)
#define XASHLIB "libxash." OS_LIB_EXT
#elif _WIN32
#if !__MINGW32__ && _MSC_VER >= 1200

4
public/build.h

@ -67,6 +67,7 @@ For more information, please refer to <http://unlicense.org/> @@ -67,6 +67,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_MSVC
#undef XASH_NETBSD
#undef XASH_OPENBSD
#undef XASH_HAIKU
#undef XASH_WIN32
#undef XASH_WIN64
#undef XASH_X86
@ -115,6 +116,9 @@ For more information, please refer to <http://unlicense.org/> @@ -115,6 +116,9 @@ For more information, please refer to <http://unlicense.org/>
#elif defined __WATCOMC__ && defined __DOS__
#define XASH_DOS4GW 1
#define XASH_LITTLE_ENDIAN
#elif defined __HAIKU__
#define XASH_HAIKU 1
#define XASH_POSIX 1
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

Loading…
Cancel
Save