From 0931eed7be854ee6e0d0473b715dda2b6f2839e2 Mon Sep 17 00:00:00 2001 From: Anton Yabchinskiy Date: Thu, 20 Nov 2014 00:09:39 +0300 Subject: [PATCH 1/4] Enable ALSA only for Linux --- platform/x11/detect.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 9a52a7c92b1..5ec7eb1afc7 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -1,6 +1,7 @@ import os import sys +import platform def is_active(): @@ -145,7 +146,9 @@ def configure(env): env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) - env.Append(CPPFLAGS=["-DALSA_ENABLED"]) + if platform.platform() == 'Linux': + env.Append(CPPFLAGS=["-DALSA_ENABLED"]) + env.Append(LIBS=['asound']) if (env["pulseaudio"]=="yes"): if not os.system("pkg-config --exists libpulse-simple"): @@ -156,7 +159,7 @@ def configure(env): print("PulseAudio development libraries not found, disabling driver") env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL']) - env.Append(LIBS=['GL', 'GLU', 'pthread','asound','z']) #TODO detect linux/BSD! + env.Append(LIBS=['GL', 'GLU', 'pthread', 'z']) #env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) #host compiler is default.. From 52f1bab6d5dffe163bb20886bc725530495dc8c2 Mon Sep 17 00:00:00 2001 From: Anton Yabchinskiy Date: Thu, 20 Nov 2014 00:12:01 +0300 Subject: [PATCH 2/4] Include stdlib.h for alloca() on OpenBSD --- platform/x11/platform_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h index c01d0aa3802..1556b560586 100644 --- a/platform/x11/platform_config.h +++ b/platform/x11/platform_config.h @@ -29,7 +29,7 @@ #ifdef __linux__ #include #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__OpenBSD__) #include #endif From 523e64d30bdb68a904a9f1aebe2ff6b7985f8b86 Mon Sep 17 00:00:00 2001 From: Anton Yabchinskiy Date: Thu, 20 Nov 2014 00:16:00 +0300 Subject: [PATCH 3/4] Include string.h for memset() on OpenBSD --- platform/x11/os_x11.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 74ebad748a2..189f0f3acb7 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -32,6 +32,7 @@ #include "key_mapping_x11.h" #include #include +#include #include "print_string.h" #include "servers/physics/physics_server_sw.h" #include "errno.h" From b14c90801f99fe97cb445a56036eefeedfe720db Mon Sep 17 00:00:00 2001 From: Anton Yabchinskiy Date: Thu, 20 Nov 2014 00:20:27 +0300 Subject: [PATCH 4/4] Disable X11 joystick functions also for OpenBSD --- platform/x11/os_x11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 189f0f3acb7..4f1b475d062 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1673,7 +1673,7 @@ void OS_X11::close_joystick(int p_id) { }; void OS_X11::probe_joystick(int p_id) { - #ifndef __FreeBSD__ + #if !defined(__FreeBSD__) && !defined(__OpenBSD__) if (p_id == -1) { @@ -1728,7 +1728,7 @@ void OS_X11::move_window_to_foreground() { } void OS_X11::process_joysticks() { - #ifndef __FreeBSD__ + #if !defined(__FreeBSD__) && !defined(__OpenBSD__) int bytes; js_event events[32]; InputEvent ievent;