Merge pull request #2849 from a12n/compobsd2

Compile on OpenBSD
This commit is contained in:
Juan Linietsky 2015-12-08 17:16:45 -03:00
commit ac414c5581
3 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,7 @@
import os
import sys
import platform
def is_active():
@ -147,7 +148,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"):
@ -158,7 +161,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..

View File

@ -32,6 +32,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"
#include "errno.h"
@ -1672,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) {
@ -1727,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;

View File

@ -29,7 +29,7 @@
#ifdef __linux__
#include <alloca.h>
#endif
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <stdlib.h>
#endif