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
|
### Enable/Disable SDL2
|
||||||
USE_SDL2=0
|
USE_SDL2=0
|
||||||
|
|
||||||
|
### Do we need to link the math library?
|
||||||
|
LINK_M=1
|
||||||
|
|
||||||
### Enable/Disable codecs for streaming music support
|
### Enable/Disable codecs for streaming music support
|
||||||
USE_CODEC_WAVE=1
|
USE_CODEC_WAVE=1
|
||||||
USE_CODEC_FLAC=0
|
USE_CODEC_FLAC=0
|
||||||
|
@ -109,6 +112,8 @@ SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
||||||
|
|
||||||
ifeq ($(HOST_OS),sunos)
|
ifeq ($(HOST_OS),sunos)
|
||||||
NET_LIBS :=-lsocket -lnsl -lresolv
|
NET_LIBS :=-lsocket -lnsl -lresolv
|
||||||
|
else ifdef HAIKU_OS
|
||||||
|
NET_LIBS :=-lnetwork
|
||||||
else
|
else
|
||||||
NET_LIBS :=
|
NET_LIBS :=
|
||||||
endif
|
endif
|
||||||
|
@ -180,7 +185,11 @@ ifeq ($(USE_CODEC_UMX),1)
|
||||||
CFLAGS+= -DUSE_CODEC_UMX
|
CFLAGS+= -DUSE_CODEC_UMX
|
||||||
endif
|
endif
|
||||||
|
|
||||||
COMMON_LIBS:= -lm -lGL
|
COMMON_LIBS:= -lGL
|
||||||
|
|
||||||
|
ifeq ($(LINK_M),1)
|
||||||
|
COMMON_LIBS += -lm
|
||||||
|
endif
|
||||||
|
|
||||||
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
|
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,12 @@
|
||||||
# define PLATFORM_RISCOS 1
|
# define PLATFORM_RISCOS 1
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__HAIKU__)
|
||||||
|
|
||||||
|
# if !defined(PLATFORM_HAIKU)
|
||||||
|
# define PLATFORM_HAIKU 1
|
||||||
|
# endif
|
||||||
|
|
||||||
#else /* here goes the unix platforms */
|
#else /* here goes the unix platforms */
|
||||||
|
|
||||||
#if defined(__unix) || defined(__unix__) || defined(unix) || \
|
#if defined(__unix) || defined(__unix__) || defined(unix) || \
|
||||||
|
@ -159,6 +165,8 @@
|
||||||
# define PLATFORM_STRING "RiscOS"
|
# define PLATFORM_STRING "RiscOS"
|
||||||
#elif defined(__GNU__)
|
#elif defined(__GNU__)
|
||||||
# define PLATFORM_STRING "GNU/Hurd"
|
# define PLATFORM_STRING "GNU/Hurd"
|
||||||
|
#elif defined(PLATFORM_HAIKU)
|
||||||
|
# define PLATFORM_STRING "Haiku"
|
||||||
#elif defined(PLATFORM_UNIX)
|
#elif defined(PLATFORM_UNIX)
|
||||||
# define PLATFORM_STRING "Unix"
|
# define PLATFORM_STRING "Unix"
|
||||||
#else
|
#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) || \
|
#if defined(PLATFORM_BSD) || defined(PLATFORM_OSX) || \
|
||||||
defined(PLATFORM_AMIGA) /* bsdsocket.library */ || \
|
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
|
/* 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
|
* variants and the family member is also an unsigned char instead of an
|
||||||
* unsigned short. This should matter only when PLATFORM_UNIX is defined,
|
* unsigned short. This should matter only when PLATFORM_UNIX is defined,
|
||||||
|
@ -47,7 +48,7 @@
|
||||||
#endif /* BSD, sockaddr */
|
#endif /* BSD, sockaddr */
|
||||||
|
|
||||||
/* unix includes and compatibility macros */
|
/* 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/param.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
Loading…
Reference in a new issue