From 3f646808d8ff962babe62a461dd6408aa88a00d9 Mon Sep 17 00:00:00 2001 From: Mikolaj 'lich' Halber Date: Tue, 15 Dec 2015 05:13:14 +0000 Subject: Added Haiku support diff --git a/Makefile b/Makefile index 493fd2c..672078f 100644 --- a/Makefile +++ b/Makefile @@ -820,7 +820,53 @@ ifeq ($(PLATFORM),sunos) CLIENT_LIBS +=$(SDL_LIBS) -lGL -lX11 -lXext -liconv -lm else # ifeq sunos +############################################################################# +# SETUP AND BUILD -- HAIKU +############################################################################# +ifeq ($(PLATFORM),haiku) + + ifeq ($(shell uname -m), BePC) + ARCH=i386 + endif + + SHLIBEXT=so + SHLIBCFLAGS=-fno-PIC + SHLIBLDFLAGS=-shared $(LDFLAGS) + LDFLAGS=-lnetwork + BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -fno-PIC + CLIENT_CFLAGS = + CLIENT_CFLAGS += $(SDL_CFLAGS) + SERVER_CFLAGS = + LIB= + CLIENT_LIBS=$(SDL_LIBS) -lGL + USE_CODEC_VORBIS = 1 + HAVE_VM_COMPILED=true + + BUILD_CLIENT = 1 + BUILD_GAME_QVM = 0 + BASE_CFLAGS+=-D_BSD_SOURCE -DUSE_ICON + ifeq ($(USE_OPENAL),1) + CLIENT_CFLAGS += -DUSE_OPENAL + ifeq ($(USE_OPENAL_DLOPEN),1) + CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN + endif + endif + + ifeq ($(USE_CURL),1) + CLIENT_CFLAGS += -DUSE_CURL + ifeq ($(USE_CURL_DLOPEN),1) + CLIENT_CFLAGS += -DUSE_CURL_DLOPEN + endif + endif + + + ifeq ($(USE_CODEC_VORBIS),1) + CLIENT_CFLAGS += -DUSE_CODEC_VORBIS + CLIENT_LIBS += -lvorbisfile -lvorbis -logg + endif + +else # ifeq haiku ############################################################################# # SETUP AND BUILD -- GENERIC ############################################################################# @@ -839,6 +885,7 @@ endif #OpenBSD endif #NetBSD endif #IRIX endif #SunOS +endif #haiku TARGETS = diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c index ce7a325..c335b43 100644 --- a/code/qcommon/net_ip.c +++ b/code/qcommon/net_ip.c @@ -1298,7 +1298,7 @@ static void NET_AddLocalAddress(char *ifname, struct sockaddr *addr, struct sock } } -#if defined(__linux__) || defined(MACOSX) || defined(__BSD__) +#if defined(__linux__) || defined(MACOSX) || defined(__BSD__) || defined(__HAIKU__) static void NET_GetLocalAddress(void) { struct ifaddrs *ifap, *search; diff --git a/code/qcommon/q_platform.h b/code/qcommon/q_platform.h index 1be979a..eed4064 100644 --- a/code/qcommon/q_platform.h +++ b/code/qcommon/q_platform.h @@ -304,6 +304,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif +//================================================================== HAIKU === + +#ifdef __HAIKU__ + +#include +#define OS_STRING "HAIKU" +#define ID_INLINE inline +#define PATH_SEP '/' + +#define ARCH_STRING "i386" + +#define Q3_LITTLE_ENDIAN // HAIKU's i386 are always little endian + +#define DLL_EXT ".so" + +#endif + //=========================================================================== //catch missing defines in above blocks diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 17015af..16d2f2d 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -732,7 +732,7 @@ void Sys_PlatformInit( void ) signal( SIGHUP, Sys_SigHandler ); signal( SIGQUIT, Sys_SigHandler ); signal( SIGTRAP, Sys_SigHandler ); - signal( SIGIOT, Sys_SigHandler ); + signal( SIGABRT, Sys_SigHandler ); signal( SIGBUS, Sys_SigHandler ); stdinIsATTY = isatty( STDIN_FILENO ) && -- 2.2.2