summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/x11/detect.py7
-rw-r--r--platform/x11/os_x11.cpp5
-rw-r--r--platform/x11/platform_config.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index d879354f74..2faaf51716 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -1,6 +1,7 @@
import os
import sys
+import platform
def is_active():
@@ -118,9 +119,11 @@ 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'])
env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES1_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..
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index b11fd76249..278950ba3a 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -33,6 +33,7 @@
#include "key_mapping_x11.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "print_string.h"
#include "servers/physics/physics_server_sw.h"
@@ -1111,7 +1112,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) {
@@ -1166,7 +1167,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;
diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h
index 21703969cc..c46ef1cf11 100644
--- a/platform/x11/platform_config.h
+++ b/platform/x11/platform_config.h
@@ -29,7 +29,7 @@
#ifdef __linux__
#include <alloca.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <stdlib.h>
#endif