]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Make it compile for PNaCl.
authorRudolf Polzer <divVerent@xonotic.org>
Tue, 22 Sep 2015 13:35:44 +0000 (09:35 -0400)
committerRudolf Polzer <divVerent@xonotic.org>
Tue, 22 Sep 2015 13:35:44 +0000 (09:35 -0400)
Sure won't work yet though.

lhnet.c
makefile
makefile.inc
sys_linux.c
sys_sdl.c
sys_shared.c

diff --git a/lhnet.c b/lhnet.c
index 20781f820af82ef0c2b83eaf0da8cf32e8c8ac76..80fcd945fa9f71748d1b1cc21adca0034b6deca1 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -27,6 +27,7 @@
 #ifndef WIN32
 #include <unistd.h>
 #include <sys/types.h>
+#include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <errno.h>
index 970064c57f266fca1945e6e3a8f26993b6d30aa6..73d29b68682eb7ed202400dc457264bc7c2a2abd 100644 (file)
--- 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
index a0afbf23e0b07b1969574fed064d40e1190ee109..b506898c5a2d90658e2f357bca227870219e8051 100644 (file)
@@ -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)
index ac2ea61636c7087eb6d6c59be09c039bc9eeebba..470f5af977806920fe8712571b32e74af186105a 100644 (file)
@@ -7,7 +7,12 @@
 #else
 #include <unistd.h>
 #include <fcntl.h>
-#include <time.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#endif
+
+#ifndef FNDELAY
+#define FNDELAY                O_NDELAY
 #endif
 
 #include <signal.h>
index 7bfb041f6c7345cf919d649cfbe3eb0a4b374bc3..5fd4c3af55ccdd4ad238b76619daefdc055c9de1 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -5,16 +5,17 @@
 #else
 #include <unistd.h>
 #include <fcntl.h>
+#include <sys/select.h>
 #include <sys/time.h>
 #endif
 
 #ifdef __ANDROID__
 #include <android/log.h>
+#endif
 
 #ifndef FNDELAY
 #define FNDELAY                O_NDELAY
 #endif
-#endif
 
 #include <signal.h>
 
index 03c059850eaf8183e6a192656adf0df0080d3af5..473b4d7078b75ddb519e7beefc65e493c1b9e504 100644 (file)
@@ -7,7 +7,9 @@
 #include "quakedef.h"
 #include "thread.h"
 
-#define SUPPORTDLL
+#ifndef __pnacl__
+# define SUPPORTDLL
+#endif
 
 #ifdef WIN32
 # include <windows.h>