diff options
Diffstat (limited to '')
-rw-r--r-- | configure.ac | 473 |
1 files changed, 414 insertions, 59 deletions
diff --git a/configure.ac b/configure.ac index 35147b0e9..252cd3dd3 100644 --- a/configure.ac +++ b/configure.ac @@ -36,13 +36,13 @@ m4_ifdef([AM_SILENT_RULES], [ ]) AC_CANONICAL_HOST AC_PROG_CC +AC_PROG_CC_C99 AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_INSTALL PKG_PROG_PKG_CONFIG AC_USE_SYSTEM_EXTENSIONS - # ----------------------------------------------------------------------------- # configurable options @@ -77,6 +77,12 @@ AC_ARG_ENABLE( [enable_backend_kinesis="detect"] ) AC_ARG_ENABLE( + [exporting-pubsub], + [AS_HELP_STRING([--enable-exporting-pubsub], [enable pubsub exporting connector @<:@default autodetect@:>@])], + , + [enable_exporting_pubsub="detect"] +) +AC_ARG_ENABLE( [backend-prometheus-remote-write], [AS_HELP_STRING([--enable-backend-prometheus-remote-write], [enable prometheus remote write backend @<:@default autodetect@:>@])], , @@ -160,6 +166,40 @@ AC_ARG_ENABLE( , [enable_jsonc="detect"] ) +AC_ARG_ENABLE( + [ebpf], + [AS_HELP_STRING([--disable-ebpf], [Disable eBPF support @<:@default autodetect@:>@])], + , + [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. +test "${ac_cv_prog_cc_c99}" = "no" && AC_MSG_ERROR([Netdata rquires a compiler that supports C99 to build]) + +# ----------------------------------------------------------------------------- +# Check if cloud is enabled and if the functionality is available + +AC_ARG_ENABLE( + [cloud], + [AS_HELP_STRING([--disable-cloud], + [Disables all cloud functionality])], + [ enable_cloud="$enableval" ], + [ enable_cloud="detect" ] +) + +if test "${enable_cloud}" = "no"; then + AC_DEFINE([DISABLE_CLOUD], [1], [disable netdata cloud functionality]) +fi # ----------------------------------------------------------------------------- # netdata required checks @@ -243,6 +283,12 @@ LIBS="${PTHREAD_LIBS} ${LIBS}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" CC="${PTHREAD_CC}" +AC_CHECK_LIB( +[pthread], +[pthread_getname_np], +[AC_DEFINE([HAVE_PTHREAD_GETNAME_NP], [1], [Is set if pthread_getname_np is available])] +) + # ----------------------------------------------------------------------------- # libm @@ -279,6 +325,10 @@ AC_CHECK_LIB( [uv_fs_scandir_next], [UV_LIBS="-luv"] ) +test -z "${UV_LIBS}" && \ + AC_MSG_ERROR([libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.]) +OPTIONAL_UV_CFLAGS="${UV_CFLAGS}" +OPTIONAL_UV_LIBS="${UV_LIBS}" # ----------------------------------------------------------------------------- @@ -292,16 +342,6 @@ AC_CHECK_LIB( # ----------------------------------------------------------------------------- -# Judy General purpose dynamic array - -AC_CHECK_LIB( - [Judy], - [JudyLIns], - [JUDY_LIBS="-lJudy"] -) - - -# ----------------------------------------------------------------------------- # zlib PKG_CHECK_MODULES( @@ -337,7 +377,6 @@ AC_DEFINE([NETDATA_WITH_UUID], [1], [uuid usability]) OPTIONAL_UUID_CFLAGS="${UUID_CFLAGS}" OPTIONAL_UUID_LIBS="${UUID_LIBS}" - # ----------------------------------------------------------------------------- # OpenSSL Cryptography and SSL/TLS Toolkit @@ -347,6 +386,23 @@ AC_CHECK_LIB( [SSL_LIBS="-lcrypto -lssl"] ) +AC_CHECK_LIB( + [crypto], + [X509_VERIFY_PARAM_set1_host], + [ssl_host_validation="yes"], + [ssl_host_validation="no"] +) + +test -z "${SSL_LIBS}" || \ + AC_DEFINE([HAVE_CRYPTO], [1], [libcrypto availability]) + +if test "${ssl_host_validation}" = "no"; then + AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [0], [ssl host validation]) + AC_MSG_WARN([DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.]) +else + AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [1], [ssl host validation]) +fi + # ----------------------------------------------------------------------------- # JSON-C library @@ -363,12 +419,47 @@ OPTIONAL_JSONC_LIBS="${JSONC_LIBS}" # ----------------------------------------------------------------------------- # DB engine and HTTPS -test "${enable_dbengine}" = "yes" -a -z "${UV_LIBS}" && \ - AC_MSG_ERROR([libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.]) - test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \ AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.]) + +AC_ARG_WITH([libJudy], + [AS_HELP_STRING([--with-libJudy=PREFIX],[Use a specific Judy library (default is system-library)])], + [ + libJudy_dir="$withval" + AC_MSG_CHECKING(for libJudy in $withval) + if test -f "${libJudy_dir}/libJudy.a" -a -f "${libJudy_dir}/Judy.h"; then + LIBS_BACKUP="${LIBS}" + LIBS="${libJudy_dir}/libJudy.a" + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "${libJudy_dir}/Judy.h" + int main (int argc, char **argv) { + Pvoid_t PJLArray = (Pvoid_t) NULL; + Word_t * PValue; + Word_t Index; + JLI(PValue, PJLArray, Index); + }]])], + [HAVE_libJudy_a="yes"], + [HAVE_libJudy_a="no"]) + LIBS="${LIBS_BACKUP}" + JUDY_LIBS="${libJudy_dir}/libJudy.a" + JUDY_CFLAGS="-I${libJudy_dir}" + AC_MSG_RESULT([$HAVE_libJudy_a]) + else + libjudy_dir="" + HAVE_libJudy_a="no" + AC_MSG_RESULT([$HAVE_libJudy_a]) + fi + ], + [HAVE_libJudy_a="no"]) + +if test "${HAVE_libJudy_a}" = "no"; then + AC_CHECK_LIB( + [Judy], + [JudyLIns], + [JUDY_LIBS="-lJudy"] + ) +fi + test "${enable_dbengine}" = "yes" -a -z "${JUDY_LIBS}" && \ AC_MSG_ERROR([libJudy required but not found. Try installing 'libjudy-dev' or 'Judy-devel'.]) @@ -382,8 +473,6 @@ AC_MSG_CHECKING([if netdata dbengine should be used]) if test "${enable_dbengine}" != "no" -a "${UV_LIBS}" -a "${LZ4_LIBS}" -a "${JUDY_LIBS}" -a "${SSL_LIBS}"; then enable_dbengine="yes" AC_DEFINE([ENABLE_DBENGINE], [1], [netdata dbengine usability]) - OPTIONAL_UV_CFLAGS="${UV_CFLAGS}" - OPTIONAL_UV_LIBS="${UV_LIBS}" OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}" OPTIONAL_LZ4_LIBS="${LZ4_LIBS}" OPTIONAL_JUDY_CFLAGS="${JUDY_CFLAGS}" @@ -410,6 +499,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'.]) @@ -509,12 +627,111 @@ fi AC_MSG_RESULT([${with_libcap}]) AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"]) +# ----------------------------------------------------------------------------- +# ACLK + +AC_MSG_CHECKING([if cloud functionality should be enabled]) +AC_MSG_RESULT([${enable_cloud}]) +if test "$enable_cloud" != "no"; then + # just to have all messages that can fail ACLK build in one place + # so it is easier to see why it can't be built + if test -n "${SSL_LIBS}"; then + OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}" + OPTIONAL_SSL_LIBS="${SSL_LIBS}" + else + AC_MSG_WARN([OpenSSL required for agent-cloud-link but not found. Try installing 'libssl-dev' or 'openssl-devel'.]) + fi + + AC_MSG_CHECKING([if libmosquitto static lib is present (and builds)]) + if test -f "externaldeps/mosquitto/libmosquitto.a"; then + LIBS_BKP="${LIBS}" + LIBS="externaldeps/mosquitto/libmosquitto.a ${OPTIONAL_SSL_LIBS} ${LIBS_BKP}" + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/mosquitto/mosquitto.h" + int main (int argc, char **argv) { + int m,mm,r; + mosquitto_lib_version(&m, &mm, &r); + }]])], + [HAVE_libmosquitto_a="yes"], + [HAVE_libmosquitto_a="no"]) + LIBS="${LIBS_BKP}" + else + HAVE_libmosquitto_a="no" + AC_DEFINE([ACLK_NO_LIBMOSQ], [1], [Libmosquitto.a was not found during build.]) + fi + AC_MSG_RESULT([${HAVE_libmosquitto_a}]) + + 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 + 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 + + 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 + if test "${with_libcap}" = "yes"; then + LWS_CFLAGS+=" ${LIBCAP_CFLAGS}" + 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 -n "${OPTIONAL_LWS_LIBS}" -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 "${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 "${enable_cloud}" = "detect"; then + enable_aclk=$can_enable_aclk + else + enable_aclk=$enable_cloud + fi + AC_SUBST([can_enable_aclk]) + + if test "${enable_aclk}" = "yes"; then + AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK]) + fi + + AC_MSG_RESULT([${enable_aclk}]) +fi +AC_SUBST([enable_cloud]) +AM_CONDITIONAL([ENABLE_ACLK], [test "${enable_aclk}" = "yes"]) # ----------------------------------------------------------------------------- # apps.plugin AC_MSG_CHECKING([if apps.plugin should be enabled]) if test "${build_target}" != "macos"; then + AC_DEFINE([ENABLE_APPS_PLUGIN], [1], [apps.plugin]) enable_plugin_apps="yes" else enable_plugin_apps="no" @@ -673,6 +890,7 @@ if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" enable_plugin_nfacct="yes" AC_DEFINE([HAVE_LIBMNL], [1], [libmnl usability]) AC_DEFINE([HAVE_LIBNETFILTER_ACCT], [1], [libnetfilter_acct usability]) + AC_DEFINE([HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H], [1], [libnetfilter_nfnetlink_conntrack header usability]) OPTIONAL_NFACCT_CFLAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}" OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}" else @@ -781,6 +999,7 @@ AC_CHECK_HEADER( AC_MSG_CHECKING([if perf.plugin should be enabled]) if test "${build_target}" == "linux" -a "${have_perf_event}" = "yes"; then + AC_DEFINE([ENABLE_PERF_PLUGIN], [1], [perf.plugin]) enable_plugin_perf="yes" else enable_plugin_perf="no" @@ -788,12 +1007,53 @@ fi AC_MSG_RESULT([${enable_plugin_perf}]) AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"]) +# ----------------------------------------------------------------------------- +# ebpf.plugin + +if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then + PKG_CHECK_MODULES( + [LIBELF], + [libelf], + [have_libelf=yes], + [have_libelf=no] + ) + + AC_CHECK_TYPE( + [struct bpf_prog_info], + [have_bpf=yes], + [have_bpf=no], + [#include <linux/bpf.h>] + ) + + AC_CHECK_FILE( + externaldeps/libbpf/libbpf.a, + [have_libbpf=yes], + [have_libbpf=no] + ) + + AC_MSG_CHECKING([if ebpf.plugin should be enabled]) + if test "${have_libelf}" = "yes" -a \ + "${have_bpf}" = "yes" -a \ + "${have_libbpf}" = "yes"; then + OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include" + OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}" + AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability]) + enable_ebpf="yes" + else + enable_ebpf="no" + fi +else + enable_ebpf="no" +fi +AC_MSG_RESULT([${enable_ebpf}]) +AM_CONDITIONAL([ENABLE_PLUGIN_EBPF], [test "${enable_ebpf}" = "yes"]) # ----------------------------------------------------------------------------- # slabinfo.plugin AC_MSG_CHECKING([if slabinfo.plugin should be enabled]) if test "${build_target}" == "linux"; then + AC_DEFINE([ENABLE_SLABINFO], [1], [slabinfo plugin]) enable_plugin_slabinfo="yes" else enable_plugin_slabinfo="no" @@ -841,46 +1101,45 @@ PKG_CHECK_MODULES( [have_libcurl=no] ) -AC_CHECK_LIB( +PKG_CHECK_MODULES( + [AWS_CPP_SDK_CORE], [aws-cpp-sdk-core], - [cJSON_free], - [have_libaws_cpp_sdk_core=yes], - [have_libaws_cpp_sdk_core=no], - [${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}] + [AC_CHECK_LIB( + [aws-cpp-sdk-core], + [cJSON_free], + [have_libaws_cpp_sdk_core=yes], + [have_libaws_cpp_sdk_core=no] + )], + [have_libaws_cpp_sdk_core=no] ) -AC_MSG_CHECKING([for Aws::Kinesis::Model::PutRecordRequest in -laws-cpp-sdk-kinesis]) - -if test "${have_libaws_cpp_sdk_core}" = "yes" -a "${have_libcrypto}" = "yes" -a "${have_libssl}" = "yes" -a "${have_libcurl}" = "yes"; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - save_LIBS="${LIBS}" - LIBS="-laws-cpp-sdk-kinesis -laws-cpp-sdk-core ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}" - save_CXXFLAGS="${CXXFLAGS}" - CXXFLAGS="${CXXFLAGS} -std=c++11" +PKG_CHECK_MODULES( + [AWS_CPP_SDK_KINESIS], + [aws-cpp-sdk-kinesis], + [have_libaws_cpp_sdk_kinesis=yes], + [have_libaws_cpp_sdk_kinesis=no] +) - AC_TRY_LINK( - [ - #include <aws/core/Aws.h> - #include <aws/core/client/ClientConfiguration.h> - #include <aws/core/auth/AWSCredentials.h> - #include <aws/core/utils/Outcome.h> - #include <aws/kinesis/KinesisClient.h> - #include <aws/kinesis/model/PutRecordRequest.h> - ], - [Aws::Kinesis::Model::PutRecordRequest request;], - [have_libaws_cpp_sdk_kinesis=yes], - [have_libaws_cpp_sdk_kinesis=no] - ) +AC_CHECK_LIB( + [aws-checksums], + [aws_checksums_crc32], + [have_libaws_checksums=yes], + [have_libaws_checksums=no] +) - LIBS="${save_LIBS}" - CXXFLAGS="${save_CXXFLAGS}" - AC_LANG_RESTORE -else - have_libaws_cpp_sdk_kinesis=no -fi +AC_CHECK_LIB( + [aws-c-common], + [aws_default_allocator], + [have_libaws_c_common=yes], + [have_libaws_c_common=no] +) -AC_MSG_RESULT([${have_libaws_cpp_sdk_kinesis}]) +AC_CHECK_LIB( + [aws-c-event-stream], + [aws_event_stream_library_init], + [have_libaws_c_event_stream=yes], + [have_libaws_c_event_stream=no] +) test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_kinesis}" != "yes" && \ AC_MSG_ERROR([libaws-cpp-sdk-kinesis required but not found. try installing AWS C++ SDK]) @@ -897,14 +1156,26 @@ test "${enable_backend_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \ test "${enable_backend_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \ AC_MSG_ERROR([libcrypto required but not found]) +test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_checksums}" != "yes" \ + -a "${have_libaws_c_common}" != "yes" \ + -a "${have_libaws_c_event_stream}" != "yes" && \ + AC_MSG_ERROR([AWS SKD third party dependencies required but not found]) + AC_MSG_CHECKING([if kinesis backend should be enabled]) -if test "${enable_backend_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" = "yes" \ - -a "${have_libcurl}" = "yes" -a "${have_libssl}" = "yes" -a "${have_libcrypto}" = "yes"; then +if test "${enable_backend_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}" = "yes" \ + -a "${have_libaws_cpp_sdk_core}" = "yes" \ + -a "${have_libaws_checksums}" = "yes" \ + -a "${have_libaws_c_common}" = "yes" \ + -a "${have_libaws_c_event_stream}" = "yes" \ + -a "${have_libcurl}" = "yes" \ + -a "${have_libssl}" = "yes" \ + -a "${have_libcrypto}" = "yes"; then enable_backend_kinesis="yes" AC_DEFINE([HAVE_KINESIS], [1], [libaws-cpp-sdk-kinesis usability]) OPTIONAL_KINESIS_CFLAGS="${LIBCRYPTO_CFLAGS} ${LIBSSL_CFLAGS} ${LIBCURL_CFLAGS}" - CXX11FLAG="-std=c++11" - OPTIONAL_KINESIS_LIBS="-laws-cpp-sdk-kinesis -laws-cpp-sdk-core ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}" + CXX11FLAG="${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 enable_backend_kinesis="no" fi @@ -914,6 +1185,54 @@ AM_CONDITIONAL([ENABLE_BACKEND_KINESIS], [test "${enable_backend_kinesis}" = "ye # ----------------------------------------------------------------------------- +# Pub/Sub exporting connector - googleapis + +PKG_CHECK_MODULES( + [GRPC], + [grpc], + [have_libgrpc=yes], + [have_libgrpc=no] +) + +PKG_CHECK_MODULES( + [PUBSUB], + [googleapis_cpp_pubsub_protos], + [have_pubsub_protos=yes], + [have_pubsub_protos=no] +) + +AC_PATH_PROG([CXX_BINARY], [${CXX}], [no]) +AS_IF( + [test x"${CXX_BINARY}" == x"no"], + [have_CXX_compiler=no], + [have_CXX_compiler=yes] +) + +test "${enable_pubsub}" = "yes" -a "${have_grpc}" != "yes" && \ + AC_MSG_ERROR([libgrpc required but not found. try installing grpc]) + +test "${enable_pubsub}" = "yes" -a "${have_pubsub_protos}" != "yes" && \ + AC_MSG_ERROR([libgoogleapis_cpp_pubsub_protos required but not found. try installing googleapis]) + +test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \ + AC_MSG_ERROR([C++ compiler required but not found. try installing g++]) + +AC_MSG_CHECKING([if pubsub exporting connector should be enabled]) +if test "${enable_exporting_pubsub}" != "no" -a "${have_pubsub_protos}" = "yes" -a "${have_CXX_compiler}" = "yes"; then + 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" +fi + +AC_MSG_RESULT([${enable_exporting_pubsub}]) +AM_CONDITIONAL([ENABLE_EXPORTING_PUBSUB], [test "${enable_exporting_pubsub}" = "yes"]) + + +# ----------------------------------------------------------------------------- # Prometheus remote write backend - libprotobuf, libsnappy, protoc PKG_CHECK_MODULES( @@ -985,11 +1304,11 @@ test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler AC_MSG_ERROR([C++ compiler required but not found. try installing g++]) AC_MSG_CHECKING([if prometheus remote write backend should be enabled]) -if test "${enable_backend_prometeus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \ +if test "${enable_backend_prometheus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \ -a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then enable_backend_prometheus_remote_write="yes" AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability]) - OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS}" + OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS} -Iexporting/prometheus/remote_write" CXX11FLAG="-std=c++11" OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS}" else @@ -1072,7 +1391,9 @@ AC_MSG_RESULT([${enable_lto}]) # ----------------------------------------------------------------------------- -AM_CONDITIONAL([ENABLE_CXX_LINKER], [test "${enable_backend_kinesis}" = "yes" -o "${enable_backend_prometheus_remote_write}" = "yes"]) +AM_CONDITIONAL([ENABLE_CXX_LINKER], [test "${enable_backend_kinesis}" = "yes" \ + -o "${enable_exporting_pubsub}" = "yes" \ + -o "${enable_backend_prometheus_remote_write}" = "yes"]) AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged]) @@ -1102,7 +1423,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}" + ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PUBSUB_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} \ + ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${OPTIONAL_JUDY_CFLAGS}" CXXFLAGS="${CFLAGS} ${CXX11FLAG}" @@ -1122,6 +1444,7 @@ AC_SUBST([OPTIONAL_MATH_CFLAGS]) AC_SUBST([OPTIONAL_MATH_LIBS]) AC_SUBST([OPTIONAL_UV_LIBS]) AC_SUBST([OPTIONAL_LZ4_LIBS]) +AC_SUBST([OPTIONAL_JUDY_CFLAGS]) AC_SUBST([OPTIONAL_JUDY_LIBS]) AC_SUBST([OPTIONAL_SSL_LIBS]) AC_SUBST([OPTIONAL_JSONC_LIBS]) @@ -1131,6 +1454,9 @@ AC_SUBST([OPTIONAL_ZLIB_CFLAGS]) AC_SUBST([OPTIONAL_ZLIB_LIBS]) AC_SUBST([OPTIONAL_UUID_CFLAGS]) AC_SUBST([OPTIONAL_UUID_LIBS]) +AC_SUBST([OPTIONAL_BPF_CFLAGS]) +AC_SUBST([OPTIONAL_BPF_LIBS]) +AC_SUBST([OPTIONAL_MQTT_LIBS]) AC_SUBST([OPTIONAL_LIBCAP_CFLAGS]) AC_SUBST([OPTIONAL_LIBCAP_LIBS]) AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS]) @@ -1141,10 +1467,13 @@ AC_SUBST([OPTIONAL_XENSTAT_CFLAGS]) AC_SUBST([OPTIONAL_XENSTAT_LIBS]) AC_SUBST([OPTIONAL_KINESIS_CFLAGS]) AC_SUBST([OPTIONAL_KINESIS_LIBS]) +AC_SUBST([OPTIONAL_PUBSUB_CFLAGS]) +AC_SUBST([OPTIONAL_PUBSUB_LIBS]) 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 @@ -1157,6 +1486,7 @@ AC_ARG_ENABLE( [enable_unit_tests="yes"] ) + PKG_CHECK_MODULES( [CMOCKA], [cmocka], @@ -1172,6 +1502,14 @@ TEST_LIBS="${CMOCKA_LIBS}" AC_SUBST([TEST_CFLAGS]) AC_SUBST([TEST_LIBS]) +# ----------------------------------------------------------------------------- +# save configure options for build info +AC_DEFINE_UNQUOTED( + [CONFIGURE_COMMAND], + ["$ac_configure_args"], + [options passed to configure script] +) + AC_CONFIG_FILES([ Makefile netdata.spec @@ -1203,13 +1541,25 @@ AC_CONFIG_FILES([ collectors/python.d.plugin/Makefile collectors/slabinfo.plugin/Makefile collectors/statsd.plugin/Makefile + collectors/ebpf.plugin/Makefile collectors/tc.plugin/Makefile collectors/xenstat.plugin/Makefile collectors/perf.plugin/Makefile daemon/Makefile database/Makefile database/engine/Makefile + database/engine/metadata_log/Makefile diagrams/Makefile + exporting/Makefile + exporting/graphite/Makefile + exporting/json/Makefile + exporting/opentsdb/Makefile + exporting/prometheus/Makefile + exporting/prometheus/remote_write/Makefile + exporting/aws_kinesis/Makefile + exporting/pubsub/Makefile + exporting/mongodb/Makefile + exporting/tests/Makefile health/Makefile health/notifications/Makefile libnetdata/Makefile @@ -1220,6 +1570,7 @@ AC_CONFIG_FILES([ libnetdata/clocks/Makefile libnetdata/config/Makefile libnetdata/dictionary/Makefile + libnetdata/ebpf/Makefile libnetdata/eval/Makefile libnetdata/locks/Makefile libnetdata/log/Makefile @@ -1263,6 +1614,10 @@ AC_CONFIG_FILES([ web/gui/Makefile web/server/Makefile web/server/static/Makefile + claim/Makefile + aclk/legacy/Makefile + spawn/Makefile + parser/Makefile ]) AC_OUTPUT |