Browse Source

engine: Haiku OS support (#478)

pull/2/head
exstrim401 4 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 )
osname = "emscripten"; osname = "emscripten";
#elif XASH_DOS4GW #elif XASH_DOS4GW
osname = "DOS4GW"; osname = "DOS4GW";
#elif XASH_HAIKU
osname = "haiku";
#else #else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" #error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif #endif

6
engine/wscript

@ -62,6 +62,10 @@ def configure(conf):
conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated') conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated')
conf.define('XASH_SDL', 2) 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: if conf.options.USE_SELECT == None:
conf.options.USE_SELECT = conf.options.DEDICATED conf.options.USE_SELECT = conf.options.DEDICATED
@ -112,6 +116,8 @@ def build(bld):
source += bld.path.ant_glob(['platform/dos/*.c']) source += bld.path.ant_glob(['platform/dos/*.c'])
source += bld.path.ant_glob(['platform/stub/s_stub.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'): if bld.get_define('XASH_CUSTOM_SWAP'):
source += bld.path.ant_glob(['platform/misc/kmalloc.c', 'platform/misc/sbrk.c']) 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.
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#if defined(__APPLE__) || defined(__unix__) #if defined(__APPLE__) || defined(__unix__) || defined(__HAIKU__)
#define XASHLIB "libxash." OS_LIB_EXT #define XASHLIB "libxash." OS_LIB_EXT
#elif _WIN32 #elif _WIN32
#if !__MINGW32__ && _MSC_VER >= 1200 #if !__MINGW32__ && _MSC_VER >= 1200

4
public/build.h

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

Loading…
Cancel
Save