From d2f8b9f4bb3fda901ffd6f18074d035469832338 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Fri, 4 Feb 2011 17:31:12 +0000 Subject: [PATCH] Support GNU/kFreeBSD, patch by Cyril Brulebois. Thanks. --- Makefile | 4 ++-- code/qcommon/q_platform.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 42d7b985..9bd03a7a 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/) @@ -239,7 +239,7 @@ LIB=lib INSTALL=install MKDIR=mkdir -ifeq ($(PLATFORM),linux) +ifneq (,findstring($(PLATFORM),linux gnu_kfreebsd kfreebsd-gnu)) ifeq ($(ARCH),alpha) ARCH=axp diff --git a/code/qcommon/q_platform.h b/code/qcommon/q_platform.h index 46758ed4..1be979ad 100644 --- a/code/qcommon/q_platform.h +++ b/code/qcommon/q_platform.h @@ -154,11 +154,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //================================================================= LINUX === -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD_kernel__) #include +#if defined(__linux__) #define OS_STRING "linux" +#else +#define OS_STRING "kFreeBSD" +#endif + #define ID_INLINE inline #define PATH_SEP '/'