summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAndrew Moss <1043609+amoss@users.noreply.github.com>2020-05-11 08:34:29 +0200
committerJames Mills <prologic@shortcircuit.net.au>2020-05-11 16:37:27 +1000
commitaa3ec552c896aebafd03b9d2c1864272dcb34749 (patch)
tree02f7cd95ed84d888c27fb4bfb55df2b251b97b7b /configure.ac
parentfd05e1d87751ecaa45ebd3aed2499435b1627cea (diff)
Enable support for Netdata Cloud.
This PR merges the feature-branch to make the cloud live. It contains the following work: Co-authored-by: Andrew Moss <1043609+amoss@users.noreply.github.com(opens in new tab)> Co-authored-by: Jacek Kolasa <jacek.kolasa@gmail.com(opens in new tab)> Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud(opens in new tab)> Co-authored-by: James Mills <prologic@shortcircuit.net.au(opens in new tab)> Co-authored-by: Markos Fountoulakis <44345837+mfundul@users.noreply.github.com(opens in new tab)> Co-authored-by: Timotej S <6674623+underhood@users.noreply.github.com(opens in new tab)> Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com(opens in new tab)> * dashboard with new navbars, v1.0-alpha.9: PR #8478 * dashboard v1.0.11: netdata/dashboard#76 Co-authored-by: Jacek Kolasa <jacek.kolasa@gmail.com(opens in new tab)> * Added installer code to bundle JSON-c if it's not present. PR #8836 Co-authored-by: James Mills <prologic@shortcircuit.net.au(opens in new tab)> * Fix claiming config PR #8843 * Adds JSON-c as hard dep. for ACLK PR #8838 * Fix SSL renegotiation errors in old versions of openssl. PR #8840. Also - we have a transient problem with opensuse CI so this PR disables them with a commit from @prologic. Co-authored-by: James Mills <prologic@shortcircuit.net.au(opens in new tab)> * Fix claiming error handling PR #8850 * Added CI to verify JSON-C bundling code in installer PR #8853 * Make cloud-enabled flag in web/api/v1/info be independent of ACLK build success PR #8866 * Reduce ACLK_STABLE_TIMEOUT from 10 to 3 seconds PR #8871 * remove old-cloud related UI from old dashboard (accessible now via /old suffix) PR #8858 * dashboard v1.0.13 PR #8870 * dashboard v1.0.14 PR #8904 * Provide feedback on proxy setting changes PR #8895 * Change the name of the connect message to update during an ongoing session PR #8927 * Fetch active alarms from alarm_log PR #8944
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac52
1 files changed, 45 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 463a70cbbc..28781c8f49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,7 +173,6 @@ AC_ARG_ENABLE(
[ enable_cloud="detect" ]
)
-aclk_required="${enable_cloud}"
if test "${enable_cloud}" = "no"; then
AC_DEFINE([DISABLE_CLOUD], [1], [disable netdata cloud functionality])
fi
@@ -435,6 +434,35 @@ AM_CONDITIONAL([ENABLE_HTTPS], [test "${enable_https}" = "yes"])
# -----------------------------------------------------------------------------
# JSON-C
+
+if test "${enable_jsonc}" != "no" -a -z "${JSONC_LIBS}"; then
+ # Try and detect manual static build presence (from netdata-installer.sh)
+ AC_MSG_CHECKING([if statically built json-c is present])
+ HAVE_libjson_c_a="no"
+ if test -f "externaldeps/jsonc/libjson-c.a"; then
+ LIBS_BKP="${LIBS}"
+ LIBS="externaldeps/jsonc/libjson-c.a"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/jsonc/json-c/json.h"
+ int main (int argc, char **argv) {
+ struct json_object *jobj;
+ char *str = "{ \"msg-type\": \"random\" }";
+ jobj = json_tokener_parse(str);
+ json_object_get_type(jobj);
+ }]])],
+ [HAVE_libjson_c_a="yes"],
+ [HAVE_libjson_c_a="no"])
+ LIBS="${LIBS_BKP}"
+ fi
+
+ if test "${HAVE_libjson_c_a}" = "yes"; then
+ AC_DEFINE([LINK_STATIC_JSONC], [1], [static json-c should be used])
+ JSONC_LIBS="static"
+ OPTIONAL_JSONC_STATIC_CFLAGS="-I externaldeps/jsonc"
+ fi
+ AC_MSG_RESULT([${HAVE_libjson_c_a}])
+fi
+AM_CONDITIONAL([LINK_STATIC_JSONC], [test "${JSONC_LIBS}" = "static"])
+
test "${enable_jsonc}" = "yes" -a -z "${JSONC_LIBS}" && \
AC_MSG_ERROR([JSON-C required but not found. Try installing 'libjson-c-dev' or 'json-c'.])
@@ -577,7 +605,7 @@ if test "$enable_cloud" != "no"; then
fi
AC_MSG_RESULT([${HAVE_libwebsockets_a}])
- if test "${build_target}" = "linux" -a "${aclk_required}" != "no"; then
+ if test "${build_target}" = "linux" -a "${enable_cloud}" != "no"; then
if test "${have_libcap}" = "yes" -a "${with_libcap}" = "no"; then
AC_MSG_ERROR([agent-cloud-link can't be built without libcap. Disable it by --disable-cloud or enable libcap])
fi
@@ -586,23 +614,31 @@ if test "$enable_cloud" != "no"; then
fi
fi
+ # next 2 lines are just to have info for ACLK dependencies in common place
+ AC_MSG_CHECKING([if json-c available for ACLK])
+ AC_MSG_RESULT([${enable_jsonc}])
+
+ test "${enable_cloud}" = "yes" -a "${enable_jsonc}" = "no" && \
+ 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}"; then
+ if test "${HAVE_libmosquitto_a}" = "yes" -a "${HAVE_libwebsockets_a}" = "yes" -a -n "${SSL_LIBS}" -a "${enable_jsonc}" = "yes"; then
can_enable_aclk="yes"
else
can_enable_aclk="no"
fi
AC_MSG_RESULT([${can_enable_aclk}])
- test "${aclk_required}" = "yes" -a "${can_enable_aclk}" = "no" && \
+ test "${enable_cloud}" = "yes" -a "${can_enable_aclk}" = "no" && \
AC_MSG_ERROR([User required agent-cloud-link but it can't be built!])
AC_MSG_CHECKING([if netdata agent-cloud-link should/will be enabled])
- if test "${aclk_required}" = "detect"; then
+ if test "${enable_cloud}" = "detect"; then
enable_aclk=$can_enable_aclk
else
- enable_aclk=$aclk_required
+ enable_aclk=$enable_cloud
fi
+ AC_SUBST([can_enable_aclk])
if test "${enable_aclk}" = "yes"; then
AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK])
@@ -610,6 +646,7 @@ if test "$enable_cloud" != "no"; then
AC_MSG_RESULT([${enable_aclk}])
fi
+AC_SUBST([enable_cloud])
AM_CONDITIONAL([ENABLE_ACLK], [test "${enable_aclk}" = "yes"])
# -----------------------------------------------------------------------------
@@ -1216,7 +1253,8 @@ AC_SUBST([webdir])
CFLAGS="${CFLAGS} ${OPTIONAL_MATH_CFLAGS} ${OPTIONAL_NFACCT_CFLAGS} ${OPTIONAL_ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} \
${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CFLAGS} ${OPTIONAL_XENSTAT_FLAGS} \
- ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS}"
+ ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} \
+ ${OPTIONAL_JSONC_STATIC_CFLAGS}"
CXXFLAGS="${CFLAGS} ${CXX11FLAG}"