summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac167
1 files changed, 133 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac
index 8c001322..3c4a75ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -234,6 +234,55 @@ if test "${enable_cloud}" = "no"; then
fi
# -----------------------------------------------------------------------------
+# C++ version check
+
+# Check for C++17 support (optional)
+# AX_CXX_COMPILE_STDCXX(17, noext, optional)
+
+if test "x$HAVE_CXX17" != "x1"; then
+ # Check for C++11 support (optional)
+ AX_CXX_COMPILE_STDCXX(11, noext, optional)
+fi
+
+AC_MSG_CHECKING([c++ standard to use])
+if test "x$HAVE_CXX17" = "x1"; then
+ have_cxx17="yes"
+ have_cxx11="yes"
+ CPP_STD_FLAG="-std=c++17"
+ cpp_std_to_use="c++17"
+ AM_CONDITIONAL([HAVE_CXX17], [true])
+ AM_CONDITIONAL([HAVE_CXX11], [true])
+elif test "x$HAVE_CXX11" = "x1"; then
+ have_cxx17="no"
+ have_cxx11="yes"
+ CPP_STD_FLAG="-std=c++11"
+ cpp_std_to_use="c++11"
+ AM_CONDITIONAL([HAVE_CXX17], [false])
+ AM_CONDITIONAL([HAVE_CXX11], [true])
+else
+ have_cxx17="no"
+ have_cxx11="no"
+ CPP_STD_FLAG=""
+ cpp_std_to_use="no c++"
+ AM_CONDITIONAL([HAVE_CXX17], [false])
+ AM_CONDITIONAL([HAVE_CXX11], [false])
+fi
+
+# PPC64LE needs -std=gnu++11 in order to build dlib. However, the rest of
+# the agent's components use and have been tested only with -std=c++11.
+# Skip ML compilation on that CPU until we reorganize and test the C++ flags.
+if test "${host_cpu}" = "powerpc64le"; then
+ have_cxx17="no"
+ have_cxx11="no"
+ CPP_STD_FLAG=""
+ cpp_std_to_use="no c++ on powerpc64le"
+ AM_CONDITIONAL([HAVE_CXX17], [false])
+ AM_CONDITIONAL([HAVE_CXX11], [false])
+fi
+
+AC_MSG_RESULT([${cpp_std_to_use}])
+
+# -----------------------------------------------------------------------------
# netdata required checks
# fails on centos6
@@ -347,6 +396,17 @@ AC_CHECK_LIB(
[AC_DEFINE([HAVE_PTHREAD_GETNAME_NP], [1], [Is set if pthread_getname_np is available])]
)
+# -----------------------------------------------------------------------------
+# libdatachannel
+
+AC_CHECK_LIB([datachannel], [rtcCreatePeerConnection],
+ [LIBDATACHANNEL_FOUND=yes],
+ [LIBDATACHANNEL_FOUND=no])
+
+if test "x$LIBDATACHANNEL_FOUND" = "xyes"; then
+ AC_DEFINE([HAVE_LIBDATACHANNEL], [1], [libdatachannel usability])
+ OPTIONAL_DATACHANNEL_LIBS="-ldatachannel"
+fi
# -----------------------------------------------------------------------------
# libm
@@ -482,6 +542,17 @@ PKG_CHECK_MODULES([JSON],[json-c],AC_CHECK_LIB(
OPTIONAL_JSONC_LIBS="${JSONC_LIBS}"
# -----------------------------------------------------------------------------
+# YAML library
+
+AC_CHECK_LIB(
+ [yaml],
+ [yaml_parser_initialize],
+ [YAML_LIBS="-lyaml"]
+)
+
+OPTIONAL_YAML_LIBS="${YAML_LIBS}"
+
+# -----------------------------------------------------------------------------
# DB engine and HTTPS
test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \
AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.])
@@ -611,6 +682,38 @@ AC_MSG_RESULT([${enable_jsonc}])
AM_CONDITIONAL([ENABLE_JSONC], [test "${enable_jsonc}" = "yes"])
# -----------------------------------------------------------------------------
+# YAML
+
+if test -z "${YAML_LIBS}"; then
+ # Try and detect manual static build presence (from netdata-installer.sh)
+ AC_MSG_CHECKING([if statically built libyaml is present])
+ HAVE_libyaml_a="no"
+ if test -f "externaldeps/libyaml/libyaml.a"; then
+ LIBS_BKP="${LIBS}"
+ LIBS="externaldeps/libyaml/libyaml.a"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/libyaml/yaml.h"
+ int main (int argc, char **argv) {
+ yaml_parser_t parser;
+ yaml_parser_initialize(&parser);
+ }]])],
+ [HAVE_libyaml_a="yes"],
+ [HAVE_libyaml_a="no"])
+ LIBS="${LIBS_BKP}"
+ fi
+
+ if test "${HAVE_libyaml_a}" = "yes"; then
+ AC_DEFINE([LINK_STATIC_YAML], [1], [static yaml should be used])
+ YAML_LIBS="static"
+ OPTIONAL_YAML_STATIC_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/libyaml"
+ fi
+ AC_MSG_RESULT([${HAVE_libyaml_a}])
+fi
+AM_CONDITIONAL([LINK_STATIC_YAML], [test "${YAML_LIBS}" = "static"])
+
+test -z "${YAML_LIBS}" && \
+ AC_MSG_ERROR([LIBYAML required but not found. Try installing 'libyaml-dev'.])
+
+# -----------------------------------------------------------------------------
# compiler options
AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE])
@@ -815,7 +918,6 @@ if test "$enable_cloud" != "no"; then
AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK])
OPTIONAL_ACLK_CFLAGS="-I \$(abs_top_srcdir)/mqtt_websockets/src/include -I \$(abs_top_srcdir)/mqtt_websockets/c-rbuf/include -I \$(abs_top_srcdir)/aclk/aclk-schemas"
OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}"
- CXX11FLAG="-std=c++11"
OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}"
fi
fi
@@ -952,17 +1054,8 @@ AC_CHECK_HEADER(
[have_nfnetlink_conntrack=no]
)
-PKG_CHECK_MODULES(
- [NFACCT],
- [libnetfilter_acct],
- [AC_CHECK_LIB(
- [netfilter_acct],
- [nfacct_alloc],
- [have_libnetfilter_acct=yes],
- [have_libnetfilter_acct=no]
- )],
- [have_libnetfilter_acct=no]
-)
+LIBS_BAK="${LIBS}"
+LIBS="${LIBS} -lmnl"
PKG_CHECK_MODULES(
[LIBMNL],
@@ -976,6 +1069,24 @@ PKG_CHECK_MODULES(
[have_libmnl=no]
)
+
+LIBS="${LIBS}"
+
+PKG_CHECK_MODULES(
+ [NFACCT],
+ [libnetfilter_acct],
+ AC_SEARCH_LIBS(
+ [nfacct_alloc],
+ [netfilter_acct libnetfilter_acct],
+ [have_libnetfilter_acct=yes],
+ [have_libnetfilter_acct=no],
+ [${LIBS} -L/libnetfilter-acct-static/lib/libnetfilter_acct.a]
+ )],
+ [have_libnetfilter_acct=no]
+)
+
+LIBS="${LIBS_BAK}"
+
test "${enable_plugin_nfacct}" = "yes" -a "${have_nfnetlink_conntrack}" != "yes" && \
AC_MSG_ERROR([nfnetlink_conntrack.h required but not found or too old])
@@ -1131,7 +1242,7 @@ fi
# Check if submodules have not been fetched. Fail if ML was explicitly requested.
AC_MSG_CHECKING([if git submodules are present for machine learning functionality])
-if test -f "ml/dlib/dlib/all/source.cpp" -a -f "ml/json/single_include/nlohmann/json.hpp"; then
+if test -f "ml/dlib/dlib/all/source.cpp"; then
AC_MSG_RESULT([yes])
have_ml_submodules="yes"
else
@@ -1143,22 +1254,8 @@ if test "${enable_ml}" = "yes" -a "${have_ml_submodules}" = "no"; then
AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but it cannot be built because the required git submodules are missing.])
fi
-# Check if C++ toolchain does not support C++11. Fail if ML was explicitly requested.
-AC_LANG_PUSH([C++])
-AX_CHECK_COMPILE_FLAG([-std=c++11], [have_cxx11=yes], [have_cxx11=no])
-AC_LANG_POP([C++])
-
-# PPC64LE needs -std=gnu++11 in order to build dlib. However, the rest of
-# the agent's components use and have been tested only with -std=c++11.
-# Skip ML compilation on that CPU until we reorganize and test the C++ flags.
-if test "${host_cpu}" = "powerpc64le"; then
- have_cxx11="no"
-fi
-
if test "${enable_ml}" = "yes" -a "${have_cxx11}" = "no"; then
AC_MSG_ERROR([You have explicitly requested --enable-ml functionality but it cannot be built without a C++11 toolchain.])
-else
- CXX11FLAG="$CXX11FLAG -std=c++11"
fi
# Decide if we should build ML
@@ -1308,7 +1405,7 @@ if test "${enable_exporting_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}
enable_exporting_kinesis="yes"
AC_DEFINE([HAVE_KINESIS], [1], [libaws-cpp-sdk-kinesis usability])
OPTIONAL_KINESIS_CFLAGS="${LIBCRYPTO_CFLAGS} ${LIBSSL_CFLAGS} ${LIBCURL_CFLAGS}"
- CXX11FLAG="${AWS_CPP_SDK_KINESIS_CFLAGS} ${AWS_CPP_SDK_CORE_CFLAGS}"
+ OPTIONAL_KINESIS_CXXFLAGS="${AWS_CPP_SDK_KINESIS_CFLAGS} ${AWS_CPP_SDK_CORE_CFLAGS}"
OPTIONAL_KINESIS_LIBS="${AWS_CPP_SDK_KINESIS_LIBS} ${AWS_CPP_SDK_CORE_LIBS} \
${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}"
else
@@ -1359,7 +1456,6 @@ if test "${enable_exporting_pubsub}" != "no" -a "${have_pubsub_protos}" = "yes"
enable_exporting_pubsub="yes"
AC_DEFINE([ENABLE_EXPORTING_PUBSUB], [1], [Pub/Sub API usability])
OPTIONAL_PUBSUB_CFLAGS="${GRPC_CFLAGS} ${PUBSUB_CFLAGS}"
- CXX11FLAG="-std=c++11"
OPTIONAL_PUBSUB_LIBS="${GRPC_LIBS} ${PUBSUB_LIBS}"
else
enable_pubsub="no"
@@ -1379,7 +1475,7 @@ AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy])
save_LIBS="${LIBS}"
LIBS="-lsnappy"
save_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${CXXFLAGS} -std=c++11"
+ CXXFLAGS="${CXXFLAGS} ${CPP_STD_FLAG}"
AC_TRY_LINK(
[
@@ -1425,7 +1521,6 @@ if test "${enable_exporting_prometheus_remote_write}" != "no" -a "${have_libprot
enable_exporting_prometheus_remote_write="yes"
AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${SNAPPY_CFLAGS} -I \$(abs_top_srcdir)/exporting/prometheus/remote_write"
- CXX11FLAG="-std=c++11"
OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${SNAPPY_LIBS}"
OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}"
OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}"
@@ -1593,10 +1688,10 @@ CFLAGS="${originalCFLAGS} ${OPTIONAL_LTO_CFLAGS} ${OPTIONAL_PROTOBUF_CFLAGS} ${O
${OPTIONAL_ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} \
${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CFLAGS} ${OPTIONAL_XENSTAT_FLAGS} \
${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PUBSUB_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} \
- ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${JUDY_CFLAGS} \
+ ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_YAML_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${JUDY_CFLAGS} \
${OPTIONAL_ACLK_CFLAGS} ${OPTIONAL_ML_CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS}"
-CXXFLAGS="${CFLAGS} ${CXX11FLAG}"
+CXXFLAGS="${CFLAGS} ${OPTIONAL_KINESIS_CXXFLAGS} ${CPP_STD_FLAG}"
CPPFLAGS="\
-DVARLIB_DIR=\"\\\"${varlibdir}\\\"\" \
@@ -1611,10 +1706,12 @@ CPPFLAGS="\
AC_SUBST([OPTIONAL_MATH_CFLAGS])
AC_SUBST([OPTIONAL_MATH_LIBS])
+AC_SUBST([OPTIONAL_DATACHANNEL_LIBS])
AC_SUBST([OPTIONAL_UV_LIBS])
AC_SUBST([OPTIONAL_LZ4_LIBS])
AC_SUBST([OPTIONAL_SSL_LIBS])
AC_SUBST([OPTIONAL_JSONC_LIBS])
+AC_SUBST([OPTIONAL_YAML_LIBS])
AC_SUBST([OPTIONAL_NFACCT_CFLAGS])
AC_SUBST([OPTIONAL_NFACCT_LIBS])
AC_SUBST([OPTIONAL_ZLIB_CFLAGS])
@@ -1711,6 +1808,7 @@ AC_CONFIG_FILES([
collectors/perf.plugin/Makefile
daemon/Makefile
database/Makefile
+ database/contexts/Makefile
database/engine/Makefile
database/ram/Makefile
database/sqlite/Makefile
@@ -1743,6 +1841,7 @@ AC_CONFIG_FILES([
libnetdata/locks/Makefile
libnetdata/log/Makefile
libnetdata/onewayalloc/Makefile
+ libnetdata/parser/Makefile
libnetdata/popen/Makefile
libnetdata/procfile/Makefile
libnetdata/simple_pattern/Makefile
@@ -1787,11 +1886,11 @@ AC_CONFIG_FILES([
web/api/health/Makefile
web/gui/Makefile
web/gui/dashboard/Makefile
+ web/rtc/Makefile
web/server/Makefile
web/server/static/Makefile
claim/Makefile
spawn/Makefile
- parser/Makefile
])
AC_OUTPUT