diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2020-10-30 10:28:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 10:28:28 +0100 |
commit | 593e1b6dbc6c979955e503d431d32c0dce1a2e09 (patch) | |
tree | a38bfeef83a57bd3922b65dd23dacc3dd5708ff3 /configure.ac | |
parent | 2e2a855935fce6ad9025e81ed479bdbc883d197d (diff) |
allows use of system libwebsockets instead of bundled one (#9984)
* allows usage of system libwebsockets
* fixes problems that were preventing ACLK to work with LWS `4.1.`
* add LWS info to buildinfo
Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 5f13b4feb0..2d5e84c490 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,15 @@ AC_ARG_ENABLE( , [enable_ebpf="detect"] ) +AC_ARG_WITH( + [bundled-lws], + [AS_HELP_STRING([--with-bundled-lws=DIR], [Use a specific Libwebsockets static library @<:@default use system library@:>@])], + [ + with_bundled_lws="yes" + bundled_lws_dir="${withval}" + ], + [with_bundled_lws="no"] +) # ----------------------------------------------------------------------------- # Enforce building with C99, bail early if we can't. @@ -651,15 +660,27 @@ if test "$enable_cloud" != "no"; then fi AC_MSG_RESULT([${HAVE_libmosquitto_a}]) - AC_MSG_CHECKING([if libwebsockets static lib is present]) - if test -f "externaldeps/libwebsockets/libwebsockets.a"; then - LWS_CFLAGS="-I externaldeps/libwebsockets/include" - HAVE_libwebsockets_a="yes" + if test "${with_bundled_lws}" = "yes"; then + AC_MSG_CHECKING([if libwebsockets static lib is present]) + if test -f "${bundled_lws_dir}/libwebsockets.a"; then + LWS_CFLAGS="-I ${bundled_lws_dir}/include" + OPTIONAL_LWS_LIBS="${bundled_lws_dir}/libwebsockets.a" + AC_MSG_RESULT([yes]) + AC_DEFINE([BUNDLED_LWS], [1], [using statically linked libwebsockets]) + else + AC_DEFINE([ACLK_NO_LWS], [1], [libwebsockets.a was not found during build.]) + # this should be error if installer ever changes default to system + # as currently this is default we prefer building netdata without ACLK + # instead of error fail + AC_MSG_RESULT([no]) + AC_MSG_WARN([You required static libwebsockets to be used but we can't use it. Disabling ACLK]) + fi else - HAVE_libwebsockets_a="no" - AC_DEFINE([ACLK_NO_LWS], [1], [libwebsockets.a was not found during build.]) + AC_CHECK_LIB([websockets], + [lws_get_vhost_by_name], + [OPTIONAL_LWS_LIBS="-lwebsockets"], + [AC_DEFINE([ACLK_NO_LWS], [1], [usable system libwebsockets was not found during build.])]) fi - AC_MSG_RESULT([${HAVE_libwebsockets_a}]) if test "${build_target}" = "linux" -a "${enable_cloud}" != "no"; then if test "${have_libcap}" = "yes" -a "${with_libcap}" = "no"; then @@ -678,7 +699,7 @@ if test "$enable_cloud" != "no"; then AC_MSG_ERROR([You have asked for ACLK to be built but no json-c available. ACLK requires json-c]) AC_MSG_CHECKING([if netdata agent-cloud-link can be enabled]) - if test "${HAVE_libmosquitto_a}" = "yes" -a "${HAVE_libwebsockets_a}" = "yes" -a -n "${SSL_LIBS}" -a "${enable_jsonc}" = "yes"; then + if test "${HAVE_libmosquitto_a}" = "yes" -a -n "${OPTIONAL_LWS_LIBS}" -a -n "${SSL_LIBS}" -a "${enable_jsonc}" = "yes"; then can_enable_aclk="yes" else can_enable_aclk="no" @@ -1452,6 +1473,7 @@ AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS]) AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS]) AC_SUBST([OPTIONAL_MONGOC_CFLAGS]) AC_SUBST([OPTIONAL_MONGOC_LIBS]) +AC_SUBST([OPTIONAL_LWS_LIBS]) # ----------------------------------------------------------------------------- # Check if cmocka is available - needed for unit testing |