From: Simon McVittie Date: Sat, 24 Jun 2017 19:37:00 +0100 Subject: Treat GNU/kFreeBSD and GNU/Hurd as equivalent to GNU/Linux The GNU family of operating systems use the GNU libc and runtime linker, which is the layer that this engine interacts with directly. The specific kernel used is below the level that this engine is dealing with. This is a combination of ioquake3 commits https://github.com/ioquake/ioq3/commit/fd4cf3b7839ec36789627c27758478cca8f69ffe, https://github.com/ioquake/ioq3/commit/58a8f5ef8bca62ea6bc4a4e0cfff65b5d28d36a0, https://github.com/ioquake/ioq3/commit/d2f8b9f4bb3fda901ffd6f18074d035469832338, https://github.com/ioquake/ioq3/commit/54aa7f25832cfa7a8ac7891a702758ccd88d1ba8 (partial) and https://github.com/ioquake/ioq3/commit/540e4225cceacaf843a9d4741bfbb11ba19fdd7a, variously written by Cyril Brulebois, Thilo Schulz, devhc and Svante Signell. Bug-Debian: https://bugs.debian.org/413617 Bug-Debian: https://bugs.debian.org/679330 Forwarded: https://github.com/OpenArena/gamecode/pull/17 Applied-upstream: https://github.com/OpenArena/gamecode/commit/dbdae40bb755d9897e5e1e9e3b22ce351588b044. Applied-upstream: https://github.com/OpenArena/gamecode/commit/732d32079b6675f8595471af7d252e190c80f006 --- Makefile | 4 ++-- code/qcommon/q_platform.h | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 91fb204..023d390 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # GNU Make required # -COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]') +COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g') COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/i386/) @@ -214,7 +214,7 @@ LIB=lib INSTALL=install MKDIR=mkdir -ifeq ($(PLATFORM),linux) +ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")) ifeq ($(ARCH),alpha) ARCH=axp diff --git a/code/qcommon/q_platform.h b/code/qcommon/q_platform.h index 6490ddb..cfa44b7 100644 --- a/code/qcommon/q_platform.h +++ b/code/qcommon/q_platform.h @@ -147,11 +147,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //================================================================= LINUX === -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__) #include +#if defined(__linux__) #define OS_STRING "linux" +#elif defined(__FreeBSD_kernel__) +#define OS_STRING "kFreeBSD" +#else +#define OS_STRING "GNU" +#endif + #define ID_INLINE inline #define PATH_SEP '/'