/polymer/eduke32/Makefile |
---|
288,13 → 288,9 |
endif |
ifeq ($(SUBPLATFORM),LINUX) |
LIBS += -lFLAC -lvorbisfile -lvorbis -logg |
LIBS += -lFLAC -lvorbisfile -lvorbis -logg |
endif |
ifeq ($(PLATFORM),BSD) |
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo |
endif |
ifeq ($(PLATFORM),DARWIN) |
# LIBDIRS += -L$(AUDIOLIB_ROOT)/third-party/Apple/lib |
/polymer/eduke32/Makefile.common |
---|
102,39 → 102,39 |
# the outside world. This allows cross-compilation by overriding |
# CC and giving us PLATFORM specifically. |
# |
ifndef HOSTPLATFORM |
ifndef HOST |
uname:=$(strip $(shell uname -s)) |
HOSTPLATFORM=UNKNOWN |
HOST=UNKNOWN |
ifeq ($(findstring Linux,$(uname)),Linux) |
HOSTPLATFORM=LINUX |
HOST=LINUX |
endif |
ifeq ($(findstring BSD,$(uname)),BSD) |
HOSTPLATFORM=BSD |
HOST=BSD |
endif |
ifeq ($(findstring MINGW,$(uname)),MINGW) |
HOSTPLATFORM=WINDOWS |
HOST=WINDOWS |
endif |
ifeq ($(findstring Darwin,$(uname)),Darwin) |
HOSTPLATFORM=DARWIN |
HOST=DARWIN |
endif |
ifeq ($(findstring BeOS,$(uname)),BeOS) |
HOSTPLATFORM=BEOS |
HOST=BEOS |
endif |
ifeq ($(findstring skyos,$(uname)),skyos) |
HOSTPLATFORM=SKYOS |
HOST=SKYOS |
endif |
ifeq ($(findstring QNX,$(uname)),QNX) |
HOSTPLATFORM=QNX |
HOST=QNX |
endif |
ifeq ($(findstring SunOS,$(uname)),SunOS) |
HOSTPLATFORM=SUNOS |
HOST=SUNOS |
endif |
ifeq ($(findstring syllable,$(uname)),syllable) |
HOSTPLATFORM=SYLLABLE |
HOST=SYLLABLE |
endif |
endif |
ifndef PLATFORM |
PLATFORM=$(HOSTPLATFORM) |
PLATFORM=$(HOST) |
endif |
ifndef SUBPLATFORM |
205,7 → 205,7 |
# KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system |
# MEMMAP - 1 = produce .memmap file when linking |
# EFENCE - 1 = compile with Electric Fence for malloc() debugging |
# OPTLEVEL - 0..3 = GCC optimization strategy |
# OPTLEVEL - 0..3 = GCC optimization strategy |
# LTO - 1 = enable link-time optimization, for GCC 4.5 and up |
# |
CPLUSPLUS?=1 |
298,11 → 298,11 |
W_STRICT_OVERFLOW := -Wno-strict-overflow |
endif |
ifeq ($(HOSTPLATFORM),WINDOWS) |
ifeq ($(HOST),WINDOWS) |
# MSYS2 lets you create files named NUL but has a /dev/null. Go figure. |
ifeq (,$(wildcard /dev/null)) |
DONT_PRINT = > NUL 2>&1 |
endif |
endif |
endif |
ifeq ($(PLATFORM),WINDOWS) |
334,8 → 334,8 |
DARWINVERSION:=$(strip $(shell uname -r | cut -d . -f 1)) |
endif |
DARWIN9 ?= 0 |
DARWIN10 ?= 0 |
DARWIN9 ?= 0 |
DARWIN10 ?= 0 |
ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10))) |
override DARWIN9 := 1 |
endif |
683,7 → 683,7 |
LIBS+= -lrt |
ifeq (0,$(CLANG)) |
COMMONFLAGS += -fno-pic |
COMMONFLAGS += -fno-pic |
endif |
endif |
ifeq ($(PLATFORM),DARWIN) |
742,7 → 742,7 |
endif |
ifeq (0,$(CLANG)) |
COMMONFLAGS += -fno-pic |
COMMONFLAGS += -fno-pic |
endif |
endif |
ifeq ($(PLATFORM),WINDOWS) |
786,7 → 786,7 |
COMMONFLAGS += -fno-pic |
endif |
ifeq ($(PLATFORM),BSD) |
COMPILERFLAGS+= -I/usr/local/include |
COMPILERFLAGS+= -I/usr/X11R6/include |
RENDERTYPE=SDL |
MIXERTYPE=SDL |
995,9 → 995,7 |
ifneq ($(PLATFORM),WINDOWS) |
ifneq ($(PLATFORM),WII) |
ifneq ($(PLATFORM),BSD) |
LIBS+= -ldl |
endif |
LIBS+= -ldl |
ifneq ($(PLATFORM),DARWIN) |
LIBS+= -pthread |
endif |
/polymer/eduke32/build/include/a.h |
---|
28,7 → 28,7 |
#if !defined(NOASM) && (defined(_MSC_VER) || (defined(__GNUC__) && defined(__i386__))) |
#if defined __linux || defined __APPLE__ || defined EDUKE32_BSD || defined __SYLLABLE__ |
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SYLLABLE__) |
#define __cdecl |
#endif |
/polymer/eduke32/build/include/compat.h |
---|
69,7 → 69,7 |
#define max(x,y) ((x) > (y) ? (x) : (y)) |
#endif |
#if !defined __APPLE__ && (!defined EDUKE32_BSD || !__STDC__) |
#ifndef __APPLE__ |
# include <malloc.h> |
#endif |
91,10 → 91,6 |
# endif |
#endif |
#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__ |
# define EDUKE32_BSD |
#endif |
#if defined __ANDROID__ || defined EDUKE32_IOS |
# define EDUKE32_TOUCH_DEVICES |
# define EDUKE32_GLES |
268,7 → 264,7 |
# define B_SWAP32(x) __swap32(x) |
# define B_SWAP16(x) __swap16(x) |
#elif defined EDUKE32_BSD |
#elif defined(__FreeBSD__) || defined(__NetBSD__) |
# include <sys/endian.h> |
# if _BYTE_ORDER == _LITTLE_ENDIAN |
# define B_LITTLE_ENDIAN 1 |
864,7 → 860,7 |
{ |
#ifdef _WIN32 |
void *ptr = _aligned_malloc(size, alignment); |
#elif defined __APPLE__ || defined EDUKE32_BSD |
#elif defined __APPLE__ |
void *ptr = NULL; |
posix_memalign(&ptr, alignment, size); |
#else |
/polymer/eduke32/build/src/baselayer.c |
---|
156,7 → 156,7 |
#if defined _WIN32 |
# define WIN32_LEAN_AND_MEAN |
# include <windows.h> |
#elif defined __linux || defined EDUKE32_BSD || defined __APPLE__ |
#elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __APPLE__ |
# include <sys/mman.h> |
#endif |
181,7 → 181,7 |
initprintf("VirtualProtect() error! Crashing in 3... 2... 1...\n"); |
return 1; |
} |
# elif defined __linux || defined EDUKE32_BSD || defined __APPLE__ |
# elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __APPLE__ |
int32_t pagesize; |
size_t dep_begin_page; |
pagesize = sysconf(_SC_PAGE_SIZE); |
/polymer/eduke32/build/src/compat.c |
---|
27,11 → 27,10 |
# include <dirent.h> |
#endif |
#if defined __linux || defined EDUKE32_BSD |
#if defined(__linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) |
# include <libgen.h> // for dirname() |
#endif |
#if defined __FreeBSD__ |
# include <limits.h> // for PATH_MAX |
#if defined(__FreeBSD__) |
# include <sys/sysctl.h> // for sysctl() to get path to executable |
#endif |
305,20 → 304,8 |
#elif defined EDUKE32_OSX |
dir = osx_getappdir(); |
#elif defined __FreeBSD__ |
// the sysctl should also work when /proc/ is not mounted (which seems to |
// be common on FreeBSD), so use it.. |
#elif defined(__linux) || defined(__NetBSD__) || defined(__OpenBSD__) |
char buf[PATH_MAX] = {0}; |
int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; |
size_t len = sizeof(buf)-1; |
int ret = sysctl(name, sizeof(name)/sizeof(name[0]), buf, &len, NULL, 0); |
if(ret == 0 && buf[0] != '\0') { |
// again, remove executable name with dirname() |
// on FreeBSD dirname() seems to use some internal buffer |
dir = strdup(dirname(buf)); |
} |
#elif defined __linux || defined EDUKE32_BSD |
char buf[PATH_MAX] = {0}; |
char buf2[PATH_MAX] = {0}; |
# ifdef __linux |
Bsnprintf(buf, sizeof(buf), "/proc/%d/exe", getpid()); |
332,6 → 319,18 |
// on FreeBSD it seems to use some internal buffer instead.. anyway, just strdup() |
dir = Bstrdup(dirname(buf2)); |
} |
#elif defined(__FreeBSD__) |
// the sysctl should also work when /proc/ is not mounted (which seems to |
// be common on FreeBSD), so use it.. |
char buf[PATH_MAX] = {0}; |
int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; |
size_t len = sizeof(buf)-1; |
int ret = sysctl(name, sizeof(name)/sizeof(name[0]), buf, &len, NULL, 0); |
if(ret == 0 && buf[0] != '\0') { |
// again, remove executable name with dirname() |
// on FreeBSD dirname() seems to use some internal buffer |
dir = strdup(dirname(buf)); |
} |
#endif |
return dir; |
/polymer/eduke32/build/src/crc32.c |
---|
99,4 → 99,4 |
crc32table[7][i] = (crc32table[6][i] >> 8) ^ crc32table[0][crc32table[6][i] & 0xFF]; |
#endif |
} |
} |
} |
/polymer/eduke32/source/common.c |
---|
599,7 → 599,7 |
} |
} |
#if defined EDUKE32_OSX || defined __linux__ || defined EDUKE32_BSD |
#if defined EDUKE32_OSX || defined __linux__ || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ |
static void G_AddSteamPaths(const char *basepath) |
{ |
char buf[BMAX_PATH]; |
803,7 → 803,7 |
void G_AddSearchPaths(void) |
{ |
#if defined __linux__ || defined EDUKE32_BSD |
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) |
char buf[BMAX_PATH]; |
char *homepath = Bgethomedir(); |