Merge pull request #17135 from Faless/server_bsd_fix

Fix server build on FreeBSD
This commit is contained in:
Rémi Verschelde 2018-03-01 12:05:34 +01:00 committed by GitHub
commit bc3bf793a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import os
import platform
import sys
@ -132,7 +133,12 @@ def configure(env):
env.Append(CPPPATH=['#platform/server'])
env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED'])
env.Append(LIBS=['pthread'])
env.Append(LIBS=['dl'])
if (platform.system() == "Linux"):
env.Append(LIBS=['dl'])
if (platform.system().find("BSD") >= 0):
env.Append(LIBS=['execinfo'])
# Link those statically for portability
if env['use_static_cpp']:

View File

@ -28,4 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifdef __linux__
#include <alloca.h>
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <stdlib.h>
#define PTHREAD_BSD_SET_NAME
#endif

View File

@ -32,8 +32,9 @@
#define CRASH_HANDLER_ENABLED 1
#endif
#include "crash_handler_x11.h"
#include "main/main.h"
#include "os_x11.h"
#include "os/os.h"
#include "project_settings.h"
#ifdef CRASH_HANDLER_ENABLED