From 62cdb8a9e6749a7be285a2305dbb555058c18104 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 20 Jul 2013 03:36:54 +0000 Subject: [PATCH] Patch from johnnyonflame to fix the GCW and Dingoo build process. git-svn-id: https://svn.eduke32.com/eduke32@3972 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.common | 30 +++++++++++++++++++------- polymer/eduke32/build/Makefile.shared | 9 ++++++++ polymer/eduke32/build/include/compat.h | 5 +++++ polymer/eduke32/build/src/sdlayer.c | 3 ++- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index b60b6e460..9dde19a18 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -8,13 +8,14 @@ MAKEFILE_COMMON:=$(lastword $(MAKEFILE_LIST)) PRETTY_OUTPUT ?= 1 # Tools -CC=gcc -CXX=g++ -AS=nasm -AR=ar -RC=windres -RANLIB=ranlib -STRIP=strip +CROSS= +CC=$(CROSS)gcc +CXX=$(CROSS)g++ +AS=$(CROSS)nasm +AR=$(CROSS)ar +RC=$(CROSS)windres +RANLIB=$(CROSS)ranlib +STRIP=$(CROSS)strip L_CC=$(CC) L_CXX=$(CXX) @@ -102,9 +103,11 @@ ifndef SUBPLATFORM endif ifeq ($(PLATFORM),DINGOO) SUBPLATFORM=LINUX + CROSS=mipsel-linux- endif ifeq ($(PLATFORM),GCW) SUBPLATFORM=LINUX + CROSS=mipsel-linux- endif ifeq ($(PLATFORM),CAANOO) SUBPLATFORM=LINUX @@ -144,7 +147,6 @@ ifeq (0,$(USE_OPENGL)) USE_LIBVPX = 0 endif - # Debugging/Build options # CPLUSPLUS - 1 = enable C++ building # RELEASE - 1 = no debugging @@ -304,6 +306,12 @@ endif ifeq ($(PLATFORM),WII) override USE_LIBVPX = 0 endif +ifeq ($(PLATFORM),GCW) + override USE_LIBVPX = 0 +endif +ifeq ($(PLATFORM),DINGOO) + override USE_LIBVPX = 0 +endif BASELIBS=-lm BASELIBDIRS= @@ -428,6 +436,12 @@ ifeq ($(PLATFORM),DARWIN) BASECOMMONFLAGS+= -I$(abspath $(dir $(MAKEFILE_COMMON))platform/Apple/include) \ -I/opt/local/include -I/sw/include -I/usr/local/include endif +ifeq ($(PLATFORM),GCW) + BASECOMMONFLAGS += -D__OPENDINGUX__ +endif +ifeq ($(PLATFORM),DINGOO) + BASECOMMONFLAGS += -D__OPENDINGUX__ +endif #### Lunatic development # LuaJIT standalone interpreter executable: diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index c2f5605e3..9d0fa0363 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -70,6 +70,15 @@ ifeq ($(SUBPLATFORM),LINUX) # presumably take care for us. STDCPPLIB:= + ifeq ($(PLATFORM),GCW) + override USE_OPENGL=0 + override NOASM=1 + endif + ifeq ($(PLATFORM),DINGOO) + override USE_OPENGL=0 + override NOASM=1 + endif + ifeq ($(findstring x86_64,$(SYSARCH)),x86_64) ifeq (1,$(BUILD32_ON_64)) # On my 64bit Gentoo these are the 32bit emulation libs diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index 96e0a6e4a..f119060ee 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -150,6 +150,11 @@ static inline float nearbyintf(float x) # define longlong(x) x##ll #endif +#if defined __OPENDINGUX__ +//ugly hack +#define nearbyintf rintf +#endif + #ifndef NULL # define NULL ((void *)0) #endif diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index c75171378..833280047 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -263,8 +263,9 @@ void setvsync(int32_t sync) static void attach_debugger_here(void) {} + /* XXX: libexecinfo could be used on systems without gnu libc. */ -#if !defined _WIN32 && defined __GNUC__ && !defined __OpenBSD__ && !(defined __APPLE__ && defined __BIG_ENDIAN__) && !defined(GEKKO) && !defined(__ANDROID__) +#if !defined _WIN32 && defined __GNUC__ && !defined __OpenBSD__ && !(defined __APPLE__ && defined __BIG_ENDIAN__) && !defined(GEKKO) && !defined(__ANDROID__) && !defined __OPENDINGUX__ # define PRINTSTACKONSEGV 1 # include #endif