From ea7af81460ac3322519bf840612e009da0047db6 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 28 Feb 2018 18:08:20 +0100 Subject: Fix lws compilation on FreeBSD, same as OSX This error is actually fixed upstream, waiting for a new release --- thirdparty/README.md | 2 +- thirdparty/lws/mbedtls_wrapper/include/platform/ssl_port.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/thirdparty/README.md b/thirdparty/README.md index ff05f3d084..746422cab4 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -235,7 +235,7 @@ File extracted from upstream source: - From `server/` exclude `access-log.c`, `cgi.c`, `daemonize.c`, `lws-spa.c`, `peer-limits.c`, `rewrite.c` - Also copy `win32helpers/` from `win32port/` -- `mbedtls_wrapper/include/platform/ssl_port.h` has a small change to check for OSX (missing `malloc.h`). +- `mbedtls_wrapper/include/platform/ssl_port.h` has a small change to check for OSX and FreeBSD (missing `malloc.h`). The bug is fixed in upstream master via `LWS_HAVE_MALLOC_H`, but not in the 2.4.1 branch (as the file structure has changed). Important: `lws_config.h` and `lws_config_private.h` contains custom diff --git a/thirdparty/lws/mbedtls_wrapper/include/platform/ssl_port.h b/thirdparty/lws/mbedtls_wrapper/include/platform/ssl_port.h index fd461e9819..2ffd7e7544 100644 --- a/thirdparty/lws/mbedtls_wrapper/include/platform/ssl_port.h +++ b/thirdparty/lws/mbedtls_wrapper/include/platform/ssl_port.h @@ -25,7 +25,7 @@ */ #include "string.h" -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) #include #else #include "malloc.h" -- cgit v1.2.3 From 659c62ee338975eddf1f7e65f68190af65199324 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 28 Feb 2018 19:00:49 +0100 Subject: Use Prepend instead of Append for mbedTLS include Fixes build on FreeBSD when system-wide mbedTLS and/or openSSL are installed --- modules/mbedtls/SCsub | 2 +- modules/websocket/SCsub | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mbedtls/SCsub b/modules/mbedtls/SCsub index b846ae38ad..38198c9105 100755 --- a/modules/mbedtls/SCsub +++ b/modules/mbedtls/SCsub @@ -85,7 +85,7 @@ if env['builtin_mbedtls']: thirdparty_dir = "#thirdparty/mbedtls/library/" thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_mbed_tls.add_source_files(env.modules_sources, thirdparty_sources) - env_mbed_tls.Append(CPPPATH=["#thirdparty/mbedtls/include/"]) + env_mbed_tls.Prepend(CPPPATH=["#thirdparty/mbedtls/include/"]) # Module sources env_mbed_tls.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub index 1a36e05863..8bb83436d9 100644 --- a/modules/websocket/SCsub +++ b/modules/websocket/SCsub @@ -69,11 +69,11 @@ else: env_lws.Append(CPPPATH=[thirdparty_dir]) wrapper_includes = ["#thirdparty/lws/mbedtls_wrapper/include/" + inc for inc in ["internal", "openssl", "platform", ""]] - env_lws.Append(CPPPATH=wrapper_includes) + env_lws.Prepend(CPPPATH=wrapper_includes) if env['builtin_mbedtls']: mbedtls_includes = "#thirdparty/mbedtls/include" - env_lws.Append(CPPPATH=[mbedtls_includes]) + env_lws.Prepend(CPPPATH=[mbedtls_includes]) if env_lws["platform"] == "windows" or env_lws["platform"] == "uwp": env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir]) -- cgit v1.2.3