From 3234d2b141de4a6062615ef782c9d138e4c316ec Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 5 May 2013 11:28:54 +1000 Subject: [PATCH 1/3] dlopen libopenal.so not libopenal.so.1 on OpenBSD --- code/client/snd_openal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/client/snd_openal.c b/code/client/snd_openal.c index aa96c4ab..8376ecfa 100644 --- a/code/client/snd_openal.c +++ b/code/client/snd_openal.c @@ -2125,6 +2125,8 @@ static cvar_t *s_alCapture; #define ALDRIVER_DEFAULT "OpenAL32.dll" #elif defined(MACOS_X) #define ALDRIVER_DEFAULT "/System/Library/Frameworks/OpenAL.framework/OpenAL" +#elif defined(__OpenBSD__) +#define ALDRIVER_DEFAULT "libopenal.so" #else #define ALDRIVER_DEFAULT "libopenal.so.1" #endif From 258c4782c63cefaba98aba45c261199e331d55a2 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 5 May 2013 11:40:57 +1000 Subject: [PATCH 2/3] correct the linked libs on OpenBSD --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 458eaa42..9b33869a 100644 --- a/Makefile +++ b/Makefile @@ -711,7 +711,7 @@ ifeq ($(PLATFORM),openbsd) SHLIBCFLAGS=-fPIC SHLIBLDFLAGS=-shared $(LDFLAGS) - THREAD_LIBS=-pthread + THREAD_LIBS=-lpthread LIBS=-lm CLIENT_LIBS = @@ -721,7 +721,7 @@ ifeq ($(PLATFORM),openbsd) ifeq ($(USE_OPENAL),1) ifneq ($(USE_OPENAL_DLOPEN),1) - CLIENT_LIBS += $(THREAD_LIBS) -lossaudio -lopenal + CLIENT_LIBS += $(THREAD_LIBS) -lopenal endif endif From a88357b93ca5c45d57893cc81cc9d6653639a1f2 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 5 May 2013 11:56:24 +1000 Subject: [PATCH 3/3] sync the OpenBSD cflags with Linux --- Makefile | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9b33869a..f7ae1159 100644 --- a/Makefile +++ b/Makefile @@ -696,9 +696,47 @@ else # ifeq freebsd ifeq ($(PLATFORM),openbsd) BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ - -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON + -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON CLIENT_CFLAGS += $(SDL_CFLAGS) + OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer + OPTIMIZE = $(OPTIMIZEVM) -ffast-math + + ifeq ($(ARCH),x86_64) + OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops \ + -falign-loops=2 -falign-jumps=2 -falign-functions=2 \ + -fstrength-reduce + OPTIMIZE = $(OPTIMIZEVM) -ffast-math + HAVE_VM_COMPILED = true + else + ifeq ($(ARCH),x86) + OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer \ + -funroll-loops -falign-loops=2 -falign-jumps=2 \ + -falign-functions=2 -fstrength-reduce + OPTIMIZE = $(OPTIMIZEVM) -ffast-math + HAVE_VM_COMPILED=true + else + ifeq ($(ARCH),ppc) + BASE_CFLAGS += -maltivec + HAVE_VM_COMPILED=true + endif + ifeq ($(ARCH),ppc64) + BASE_CFLAGS += -maltivec + HAVE_VM_COMPILED=true + endif + ifeq ($(ARCH),sparc64) + OPTIMIZE += -mtune=ultrasparc3 -mv8plus + OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus + HAVE_VM_COMPILED=true + endif + ifeq ($(ARCH),alpha) + # According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410555 + # -ffast-math will cause the client to die with SIGFPE on Alpha + OPTIMIZE = $(OPTIMIZEVM) + endif + endif + endif + ifeq ($(USE_CURL),1) CLIENT_CFLAGS += $(CURL_CFLAGS) USE_CURL_DLOPEN=0