mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-10 03:51:41 +00:00
add Haiku OS cross-compile support
x86 and x86_64 both tested and working.
This commit is contained in:
parent
00d36583e7
commit
c1e8a1e692
5 changed files with 54 additions and 3 deletions
|
@ -10,6 +10,9 @@ DO_USERDIRS=0
|
|||
### Enable/Disable SDL2
|
||||
USE_SDL2=0
|
||||
|
||||
### Do we need to link the math library?
|
||||
LINK_M=1
|
||||
|
||||
### Enable/Disable codecs for streaming music support
|
||||
USE_CODEC_WAVE=1
|
||||
USE_CODEC_FLAC=0
|
||||
|
@ -109,6 +112,8 @@ SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
|||
|
||||
ifeq ($(HOST_OS),sunos)
|
||||
NET_LIBS :=-lsocket -lnsl -lresolv
|
||||
else ifdef HAIKU_OS
|
||||
NET_LIBS :=-lnetwork
|
||||
else
|
||||
NET_LIBS :=
|
||||
endif
|
||||
|
@ -180,7 +185,11 @@ ifeq ($(USE_CODEC_UMX),1)
|
|||
CFLAGS+= -DUSE_CODEC_UMX
|
||||
endif
|
||||
|
||||
COMMON_LIBS:= -lm -lGL
|
||||
COMMON_LIBS:= -lGL
|
||||
|
||||
ifeq ($(LINK_M),1)
|
||||
COMMON_LIBS += -lm
|
||||
endif
|
||||
|
||||
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
|
||||
|
||||
|
|
|
@ -72,6 +72,12 @@
|
|||
# define PLATFORM_RISCOS 1
|
||||
# endif
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
|
||||
# if !defined(PLATFORM_HAIKU)
|
||||
# define PLATFORM_HAIKU 1
|
||||
# endif
|
||||
|
||||
#else /* here goes the unix platforms */
|
||||
|
||||
#if defined(__unix) || defined(__unix__) || defined(unix) || \
|
||||
|
@ -159,6 +165,8 @@
|
|||
# define PLATFORM_STRING "RiscOS"
|
||||
#elif defined(__GNU__)
|
||||
# define PLATFORM_STRING "GNU/Hurd"
|
||||
#elif defined(PLATFORM_HAIKU)
|
||||
# define PLATFORM_STRING "Haiku"
|
||||
#elif defined(PLATFORM_UNIX)
|
||||
# define PLATFORM_STRING "Unix"
|
||||
#else
|
||||
|
|
17
Quake/build_cross_haiku32-sdl2.sh
Executable file
17
Quake/build_cross_haiku32-sdl2.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Change this script to meet your needs and/or environment.
|
||||
|
||||
TARGET=i586-pc-haiku
|
||||
|
||||
MAKE_CMD=make
|
||||
|
||||
CC="$TARGET-gcc"
|
||||
AS="$TARGET-as"
|
||||
RANLIB="$TARGET-ranlib"
|
||||
AR="$TARGET-ar"
|
||||
STRIP="$TARGET-strip"
|
||||
LDFLAGS=-L/usr/lib32 # hack
|
||||
export CC AS AR RANLIB STRIP LDFLAGS
|
||||
|
||||
exec $MAKE_CMD HAIKU_OS=1 LINK_M=0 USE_SDL2=1 LDFLAGS=$LDFLAGS CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*
|
16
Quake/build_cross_haiku64-sdl2.sh
Executable file
16
Quake/build_cross_haiku64-sdl2.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Change this script to meet your needs and/or environment.
|
||||
|
||||
TARGET=x86_64-unknown-haiku
|
||||
|
||||
MAKE_CMD=make
|
||||
|
||||
CC="$TARGET-gcc"
|
||||
AS="$TARGET-as"
|
||||
RANLIB="$TARGET-ranlib"
|
||||
AR="$TARGET-ar"
|
||||
STRIP="$TARGET-strip"
|
||||
export CC AS AR RANLIB STRIP
|
||||
|
||||
exec $MAKE_CMD HAIKU_OS=1 LINK_M=0 USE_SDL2=1 CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
#if defined(PLATFORM_BSD) || defined(PLATFORM_OSX) || \
|
||||
defined(PLATFORM_AMIGA) /* bsdsocket.library */ || \
|
||||
defined(__GNU__) /* GNU/Hurd */ || defined(__riscos__)
|
||||
defined(__GNU__) /* GNU/Hurd */ || defined(__riscos__) || \
|
||||
defined(PLATFORM_HAIKU) /* Haiku OS */
|
||||
/* struct sockaddr has unsigned char sa_len as the first member in BSD
|
||||
* variants and the family member is also an unsigned char instead of an
|
||||
* unsigned short. This should matter only when PLATFORM_UNIX is defined,
|
||||
|
@ -47,7 +48,7 @@
|
|||
#endif /* BSD, sockaddr */
|
||||
|
||||
/* unix includes and compatibility macros */
|
||||
#if defined(PLATFORM_UNIX) || defined(PLATFORM_RISCOS)
|
||||
#if defined(PLATFORM_UNIX) || defined(PLATFORM_RISCOS) || defined(PLATFORM_HAIKU)
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
|
Loading…
Reference in a new issue