compile fixes for openbsd+freebsd
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5252 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
8c4d39268e
commit
cf899af34a
5 changed files with 47 additions and 25 deletions
|
@ -394,23 +394,23 @@ ifeq ($(FTE_TARGET),) #user didn't specify prefered target
|
|||
FTE_TARGET=win32
|
||||
endif
|
||||
ifeq ($(FTE_TARGET),) #still not set
|
||||
|
||||
ifeq ($(shell uname),Linux)
|
||||
UNAME_SYSTEM:=$(shell uname)
|
||||
ifeq ($(UNAME_SYSTEM),Linux)
|
||||
FTE_TARGET=linux
|
||||
endif
|
||||
ifeq ($(shell uname),Darwin)
|
||||
ifeq ($(UNAME_SYSTEM),Darwin)
|
||||
FTE_TARGET=macosx
|
||||
endif
|
||||
ifeq ($(shell uname),FreeBSD)
|
||||
ifeq ($(UNAME_SYSTEM),FreeBSD)
|
||||
FTE_TARGET=bsd
|
||||
endif
|
||||
ifeq ($(shell uname),NetBSD)
|
||||
ifeq ($(UNAME_SYSTEM),NetBSD)
|
||||
FTE_TARGET=bsd
|
||||
endif
|
||||
ifeq ($(shell uname),OpenBSD)
|
||||
ifeq ($(UNAME_SYSTEM),OpenBSD)
|
||||
FTE_TARGET=bsd
|
||||
endif
|
||||
ifeq ($(shell uname),MorphOS)
|
||||
ifeq ($(UNAME_SYSTEM),MorphOS)
|
||||
FTE_TARGET=morphos
|
||||
endif
|
||||
#else I've no idea what it is you're running
|
||||
|
@ -1247,9 +1247,10 @@ ifeq ($(FTE_TARGET),bsd)
|
|||
#mostly uses the linux stuff.
|
||||
#oss, X, etc.
|
||||
|
||||
SV_DIR=sv_linux
|
||||
SV_LDFLAGS=-lz -ldl
|
||||
SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
|
||||
SV_DIR=sv_bsd
|
||||
SV_EXE_NAME=../$(EXE_NAME)-sv$(BITS)
|
||||
SV_LDFLAGS=
|
||||
SV_CFLAGS=$(SERVER_ONLY_CFLAGS) -DMULTITHREAD
|
||||
|
||||
GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) $(BOTLIB_OBJS) gl_vidlinuxglx.o snd_linux.o cd_null.o sys_linux.o sys_linux_threads.o
|
||||
GL_EXE_NAME=../$(EXE_NAME)-gl
|
||||
|
@ -1263,12 +1264,25 @@ ifeq ($(FTE_TARGET),bsd)
|
|||
M_EXE_NAME=../$(EXE_NAME)
|
||||
MCL_EXE_NAME=../$(EXE_NAME)-cl
|
||||
M_LDFLAGS=$(GLLDFLAGS) $(XLDFLAGS) -lpthread
|
||||
M_CFLAGS=$(VKCFLAGS) $(GLCFLAGS) -I/usr/X11R6/include
|
||||
M_CFLAGS=$(VKCFLAGS) $(GLCFLAGS) -I/usr/X11R6/include -DMULTITHREAD
|
||||
MB_DIR=m_bsd
|
||||
MCL_DIR=mcl_bsd
|
||||
|
||||
MINGL_EXE_NAME=../$(EXE_NAME)-mingl
|
||||
MINGL_DIR=mingl_bsd
|
||||
|
||||
ifeq ($(shell uname -s),OpenBSD)
|
||||
GL_LDFLAGS+= -lossaudio
|
||||
VK_LDFLAGS+= -lossaudio
|
||||
M_LDFLAGS+= -lossaudio
|
||||
endif
|
||||
|
||||
ifeq (,$(findstring NO_ZLIB,$(CFLAGS)))
|
||||
SV_LDFLAGS+= -lz
|
||||
GL_LDFLAGS+= -lz
|
||||
VK_LDFLAGS+= -lz
|
||||
M_LDFLAGS+= -lz
|
||||
endif
|
||||
endif
|
||||
ifneq (,$(findstring linux,$(FTE_TARGET)))
|
||||
SV_DIR=sv_linux$(BITS)
|
||||
|
|
|
@ -826,7 +826,7 @@ qboolean LibPNG_Init(void)
|
|||
char *libnames[] =
|
||||
{
|
||||
#ifdef _WIN32
|
||||
va("libpng%i", PNG_LIBPNG_VER_DLLNUM);
|
||||
va("libpng%i", PNG_LIBPNG_VER_DLLNUM)
|
||||
#else
|
||||
//linux...
|
||||
//lsb uses 'libpng12.so' specifically, so make sure that works.
|
||||
|
|
|
@ -141,13 +141,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <time.h>
|
||||
|
||||
#ifdef USE_MSVCRT_DEBUG
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <crtdbg.h>
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(__DJGPP__)
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#include <alloca.h>
|
||||
#include <malloc.h>
|
||||
#elif !defined(alloca) //alloca.h isn't present on bsd (stdlib.h should define it to __builtin_alloca, and we can check for that here).
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
#include <sys/mman.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/soundcard.h>
|
||||
#if defined(__OpenBSD__)
|
||||
#include <soundcard.h> //OpenBSD emulates this, so its no longer sys/.
|
||||
#else
|
||||
#include <sys/soundcard.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "quakedef.h"
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
//#include "glquake.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define VK_USE_PLATFORM_WIN32_KHR
|
||||
#define VKInstWin32Funcs VKFunc(CreateWin32SurfaceKHR)
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define VK_USE_PLATFORM_WIN32_KHR
|
||||
#define VKInstWin32Funcs VKFunc(CreateWin32SurfaceKHR)
|
||||
#elif defined(ANDROID)
|
||||
#define VK_USE_PLATFORM_ANDROID_KHR
|
||||
#define VKInstXLibFuncs VKFunc(CreateAndroidSurfaceKHR)
|
||||
#elif defined(__linux__)
|
||||
|
@ -18,6 +16,12 @@
|
|||
|
||||
#define VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#define VKInstWaylandFuncs VKFunc(CreateWaylandSurfaceKHR)
|
||||
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#define VK_USE_PLATFORM_XLIB_KHR
|
||||
#define VKInstXLibFuncs VKFunc(CreateXlibSurfaceKHR)
|
||||
|
||||
#define VK_USE_PLATFORM_XCB_KHR
|
||||
#define VKInstXCBFuncs VKFunc(CreateXcbSurfaceKHR)
|
||||
#endif
|
||||
|
||||
#define VK_NO_PROTOTYPES
|
||||
|
|
Loading…
Reference in a new issue