From: Rudolf Polzer Date: Tue, 22 Sep 2015 13:35:44 +0000 (-0400) Subject: Make it compile for PNaCl. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8977e7772c8e5f723ef783a9de4787c9c7f805cc;p=xonotic%2Fdarkplaces.git Make it compile for PNaCl. Sure won't work yet though. --- diff --git a/lhnet.c b/lhnet.c index 20781f82..80fcd945 100644 --- a/lhnet.c +++ b/lhnet.c @@ -27,6 +27,7 @@ #ifndef WIN32 #include #include +#include #include #include #include diff --git a/makefile b/makefile index 970064c5..73d29b68 100644 --- a/makefile +++ b/makefile @@ -114,6 +114,46 @@ ifeq ($(DP_MAKE_TARGET), linux) DP_LINK_CRYPTO_RIJNDAEL?=dlopen endif +# PNaCl configuration +ifeq ($(DP_MAKE_TARGET), pnacl) + DEFAULT_SNDAPI=BRLOGENSHFEGLE + OBJ_CD=BRLOGENSHFEGLE + + OBJ_CL=BRLOGENSHFEGLE + OBJ_ICON= + OBJ_ICON_NEXUIZ= + + LDFLAGS_CL=BRLOGENSHFEGLE + # TODO is there a better way to get this path? + LDFLAGS_SV=$(LDFLAGS_UNIXCOMMON) -L$(HOME)/nacl_sdk/pepper_44/lib/pnacl/Release + # TODO is there a better way to get this path? + LDFLAGS_SDL=$(LDFLAGS_UNIXSDL) -L$(HOME)/nacl_sdk/pepper_44/lib/pnacl/Release + + SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) + SDLCONFIG_LIBS=$(SDLCONFIG_STATICLIBS) + # TODO wtf cycles + SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) -lSDL2 -lppapi_simple -lSDL2main -lSDL2 -lppapi_simple -lnacl_io -lppapi_gles2 -lppapi_cpp -lppapi -lpthread + + EXE_CL=BRLOGENSHFEGLE + EXE_SV=$(EXE_UNIXSV) + EXE_SDL=$(EXE_UNIXSDL) + EXE_CLNEXUIZ=BRLOGENSHFEGLE + EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ) + EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ) + + DP_LINK_ZLIB?=dlopen + DP_LINK_JPEG?=dlopen + DP_LINK_ODE?=dlopen + DP_LINK_CRYPTO?=dlopen + DP_LINK_CRYPTO_RIJNDAEL?=dlopen + + # TODO is there a better way to get this path? + # TODO is net/if.h really missing? + CFLAGS_EXTRA=-I$(HOME)/nacl_sdk/pepper_44/include/pnacl -DNOSUPPORTIPV6 + CFLAGS_SSE= + CFLAGS_SSE2= +endif + # Mac OS X configuration ifeq ($(DP_MAKE_TARGET), macosx) DEFAULT_SNDAPI=COREAUDIO diff --git a/makefile.inc b/makefile.inc index a0afbf23..b506898c 100644 --- a/makefile.inc +++ b/makefile.inc @@ -181,8 +181,8 @@ CFLAGS_RELEASE= CFLAGS_RELEASE_PROFILE=-fbranch-probabilities CFLAGS_SDL=$(SDLCONFIG_CFLAGS) -CFLAGS_SSE=-msse -CFLAGS_SSE2=-msse2 +CFLAGS_SSE?=-msse +CFLAGS_SSE2?=-msse2 OPTIM_DEBUG=$(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing -ffast-math -funroll-loops $(CPUOPTIMIZATIONS) diff --git a/sys_linux.c b/sys_linux.c index ac2ea616..470f5af9 100644 --- a/sys_linux.c +++ b/sys_linux.c @@ -7,7 +7,12 @@ #else #include #include -#include +#include +#include +#endif + +#ifndef FNDELAY +#define FNDELAY O_NDELAY #endif #include diff --git a/sys_sdl.c b/sys_sdl.c index 7bfb041f..5fd4c3af 100644 --- a/sys_sdl.c +++ b/sys_sdl.c @@ -5,16 +5,17 @@ #else #include #include +#include #include #endif #ifdef __ANDROID__ #include +#endif #ifndef FNDELAY #define FNDELAY O_NDELAY #endif -#endif #include diff --git a/sys_shared.c b/sys_shared.c index 03c05985..473b4d70 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -7,7 +7,9 @@ #include "quakedef.h" #include "thread.h" -#define SUPPORTDLL +#ifndef __pnacl__ +# define SUPPORTDLL +#endif #ifdef WIN32 # include