diff options
Diffstat (limited to '')
-rw-r--r-- | configure.ac | 186 |
1 files changed, 100 insertions, 86 deletions
diff --git a/configure.ac b/configure.ac index 1dc6c53ac..c488f06f5 100644 --- a/configure.ac +++ b/configure.ac @@ -71,10 +71,10 @@ AC_ARG_ENABLE( [enable_plugin_xenstat="detect"] ) AC_ARG_ENABLE( - [backend-kinesis], - [AS_HELP_STRING([--enable-backend-kinesis], [enable kinesis backend @<:@default autodetect@:>@])], + [exporting-kinesis], + [AS_HELP_STRING([--enable-exporting-kinesis], [enable kinesis exporting connector @<:@default autodetect@:>@])], , - [enable_backend_kinesis="detect"] + [enable_exporting_kinesis="detect"] ) AC_ARG_ENABLE( [exporting-pubsub], @@ -83,16 +83,16 @@ AC_ARG_ENABLE( [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@:>@])], + [exporting-prometheus-remote-write], + [AS_HELP_STRING([--enable-exporting-prometheus-remote-write], [enable prometheus remote write exporting connector @<:@default autodetect@:>@])], , - [enable_backend_prometheus_remote_write="detect"] + [enable_exporting_prometheus_remote_write="detect"] ) AC_ARG_ENABLE( - [backend-mongodb], - [AS_HELP_STRING([--enable-backend-mongodb], [enable mongodb backend @<:@default autodetect@:>@])], + [exporting-mongodb], + [AS_HELP_STRING([--enable-exporting-mongodb], [enable mongodb exporting @<:@default autodetect@:>@])], , - [enable_backend_mongodb="detect"] + [enable_exporting_mongodb="detect"] ) AC_ARG_ENABLE( [pedantic], @@ -262,7 +262,6 @@ AC_FUNC_STRERROR_R AC_C__GENERIC AC_C___ATOMIC # AC_C_STMT_EXPR -AC_CHECK_SIZEOF([void *]) AC_CANONICAL_HOST AC_HEADER_MAJOR AC_HEADER_RESOLV @@ -281,15 +280,38 @@ fi # ----------------------------------------------------------------------------- # operating system detection +originalCFLAGS="${CFLAGS}" AC_MSG_CHECKING([operating system]) case "$host_os" in freebsd*) build_target=freebsd - CFLAGS="${CFLAGS} -I/usr/local/include -L/usr/local/lib" + OPTIONAL_OS_DEP_CFLAGS="-I/usr/local/include" + CFLAGS="${CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS}" + LDFLAGS="${LDFLAGS} -L/usr/local/lib" ;; darwin*) build_target=macos LDFLAGS="${LDFLAGS} -framework CoreFoundation -framework IOKit" + # ----------------------------------------------------------------------------- + # Pull in OpenSSL properly if on macOS + if brew --prefix > /dev/null 2>&1; then + if brew --prefix --installed openssl > /dev/null 2>&1; then + HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl) + elif brew --prefix --installed openssl@3 > /dev/null 2>&1; then + HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl@3) + elif brew --prefix --installed openssl@1.1 > /dev/null 2>&1; then + HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl@1.1) + fi + if test -n "${HOMEBREW_OPENSSL_PREFIX}"; then + OPTIONAL_OS_DEP_CFLAGS="-I${HOMEBREW_OPENSSL_PREFIX}/include" + CFLAGS="${CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS}" + LDFLAGS="${LDFLAGS} -L${HOMEBREW_OPENSSL_PREFIX}/lib" + fi + HOMEBREW_PREFIX=$(brew --prefix) + OPTIONAL_OS_DEP_CFLAGS="${OPTIONAL_OS_DEP_CFLAGS} -I${HOMEBREW_PREFIX}/include" + CFLAGS="${CFLAGS} -I${HOMEBREW_PREFIX}/include" + LDFLAGS="${LDFLAGS} -L${HOMEBREW_PREFIX}/lib" + fi ;; *) build_target=linux @@ -405,7 +427,6 @@ PKG_CHECK_MODULES( [have_uuid=yes], [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])] ) -AC_DEFINE([NETDATA_WITH_UUID], [1], [uuid usability]) OPTIONAL_UUID_CFLAGS="${UUID_CFLAGS}" OPTIONAL_UUID_LIBS="${UUID_LIBS}" @@ -1216,11 +1237,10 @@ if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then [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 \$(abs_top_srcdir)/externaldeps/libbpf/include" + OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I \$(abs_top_srcdir)/externaldeps/libbpf/include -I \$(abs_top_srcdir)/externaldeps/libbpf/include/uapi" OPTIONAL_BPF_LIBS="\$(abs_top_srcdir)/externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}" AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability]) enable_ebpf="yes" @@ -1230,6 +1250,7 @@ if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then else enable_ebpf="no" fi +AC_MSG_CHECKING([if ebpf.plugin should be enabled]) AC_MSG_RESULT([${enable_ebpf}]) AM_CONDITIONAL([ENABLE_PLUGIN_EBPF], [test "${enable_ebpf}" = "yes"]) @@ -1248,7 +1269,7 @@ AM_CONDITIONAL([ENABLE_PLUGIN_SLABINFO], [test "${enable_plugin_slabinfo}" = "ye # ----------------------------------------------------------------------------- -# AWS Kinesis backend - libaws-cpp-sdk-kinesis, libaws-cpp-sdk-core, libssl, libcrypto, libcurl +# AWS Kinesis exporting connector - libaws-cpp-sdk-kinesis, libaws-cpp-sdk-core, libssl, libcrypto, libcurl PKG_CHECK_MODULES( [LIBCRYPTO], @@ -1300,39 +1321,39 @@ PKG_CHECK_MODULES( [have_libaws_cpp_sdk_kinesis=no] ) -test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_kinesis}" != "yes" && \ +test "${enable_exporting_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]) -test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" != "yes" && \ +test "${enable_exporting_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" != "yes" && \ AC_MSG_ERROR([libaws-cpp-sdk-core required but not found. try installing AWS C++ SDK]) -test "${enable_backend_kinesis}" = "yes" -a "${have_libcurl}" != "yes" && \ +test "${enable_exporting_kinesis}" = "yes" -a "${have_libcurl}" != "yes" && \ AC_MSG_ERROR([libcurl required but not found]) -test "${enable_backend_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \ +test "${enable_exporting_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \ AC_MSG_ERROR([libssl required but not found]) -test "${enable_backend_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \ +test "${enable_exporting_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \ AC_MSG_ERROR([libcrypto 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" \ +AC_MSG_CHECKING([if kinesis exporting connector should be enabled]) +if test "${enable_exporting_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 - enable_backend_kinesis="yes" + 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_LIBS="${AWS_CPP_SDK_KINESIS_LIBS} ${AWS_CPP_SDK_CORE_LIBS} \ ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}" else - enable_backend_kinesis="no" + enable_exporting_kinesis="no" fi -AC_MSG_RESULT([${enable_backend_kinesis}]) -AM_CONDITIONAL([ENABLE_BACKEND_KINESIS], [test "${enable_backend_kinesis}" = "yes"]) +AC_MSG_RESULT([${enable_exporting_kinesis}]) +AM_CONDITIONAL([ENABLE_EXPORTING_KINESIS], [test "${enable_exporting_kinesis}" = "yes"]) # ----------------------------------------------------------------------------- @@ -1367,7 +1388,7 @@ test "${enable_pubsub}" = "yes" -a "${have_grpc}" != "yes" && \ 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" && \ +test "${enable_exporting_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]) @@ -1386,7 +1407,7 @@ AM_CONDITIONAL([ENABLE_EXPORTING_PUBSUB], [test "${enable_exporting_pubsub}" = " # ----------------------------------------------------------------------------- -# Prometheus remote write backend - libprotobuf, libsnappy, protoc +# Prometheus remote write exporting connector - libprotobuf, libsnappy, protoc AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy]) @@ -1423,22 +1444,22 @@ AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy]) AC_MSG_RESULT([${have_libsnappy}]) -test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_libprotobuf}" != "yes" && \ +test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_libprotobuf}" != "yes" && \ AC_MSG_ERROR([libprotobuf required but not found. try installing protobuf]) -test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_libsnappy}" != "yes" && \ +test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_libsnappy}" != "yes" && \ AC_MSG_ERROR([libsnappy required but not found. try installing snappy]) -test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_protoc}" != "yes" && \ +test "${enable_exporting_prometheus_remote_write}" = "yes" -a "${have_protoc}" != "yes" && \ AC_MSG_ERROR([protoc compiler required but not found. try installing protobuf]) -test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \ +test "${enable_exporting_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 prometheus remote write backend should be enabled]) -if test "${enable_backend_prometheus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \ +AC_MSG_CHECKING([if prometheus remote write exporting connector should be enabled]) +if test "${enable_exporting_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" + 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" @@ -1446,15 +1467,15 @@ if test "${enable_backend_prometheus_remote_write}" != "no" -a "${have_libprotob OPTIONAL_PROTOBUF_CFLAGS="${PROTOBUF_CFLAGS}" OPTIONAL_PROTOBUF_LIBS="${PROTOBUF_LIBS}" else - enable_backend_prometheus_remote_write="no" + enable_exporting_prometheus_remote_write="no" fi -AC_MSG_RESULT([${enable_backend_prometheus_remote_write}]) -AM_CONDITIONAL([ENABLE_BACKEND_PROMETHEUS_REMOTE_WRITE], [test "${enable_backend_prometheus_remote_write}" = "yes"]) +AC_MSG_RESULT([${enable_exporting_prometheus_remote_write}]) +AM_CONDITIONAL([ENABLE_EXPORTING_PROMETHEUS_REMOTE_WRITE], [test "${enable_exporting_prometheus_remote_write}" = "yes"]) # ----------------------------------------------------------------------------- -# MongoDB backend - libmongoc +# MongoDB exporting connector - libmongoc PKG_CHECK_MODULES( [LIBMONGOC], @@ -1463,21 +1484,21 @@ PKG_CHECK_MODULES( [have_libmongoc=no] ) -test "${enable_backend_mongodb}" = "yes" -a "${have_libmongoc}" != "yes" && \ +test "${enable_exporting_mongodb}" = "yes" -a "${have_libmongoc}" != "yes" && \ AC_MSG_ERROR([libmongoc required but not found. Try installing `mongoc`.]) -AC_MSG_CHECKING([if mongodb backend should be enabled]) -if test "${enable_backend_mongodb}" != "no" -a "${have_libmongoc}" = "yes"; then - enable_backend_mongodb="yes" +AC_MSG_CHECKING([if mongodb exporting connector should be enabled]) +if test "${enable_exporting_mongodb}" != "no" -a "${have_libmongoc}" = "yes"; then + enable_exporting_mongodb="yes" AC_DEFINE([HAVE_MONGOC], [1], [libmongoc usability]) OPTIONAL_MONGOC_CFLAGS="${LIBMONGOC_CFLAGS}" OPTIONAL_MONGOC_LIBS="${LIBMONGOC_LIBS}" else - enable_backend_mongodb="no" + enable_exporting_mongodb="no" fi -AC_MSG_RESULT([${enable_backend_mongodb}]) -AM_CONDITIONAL([ENABLE_BACKEND_MONGODB], [test "${enable_backend_mongodb}" = "yes"]) +AC_MSG_RESULT([${enable_exporting_mongodb}]) +AM_CONDITIONAL([ENABLE_EXPORTING_MONGODB], [test "${enable_exporting_mongodb}" = "yes"]) # ----------------------------------------------------------------------------- @@ -1516,7 +1537,7 @@ test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \ AC_MSG_CHECKING([if LTO should be enabled]) if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then enable_lto="yes" - CFLAGS="${CFLAGS} -flto" + OPTIONAL_LTO_CFLAGS="-flto" else enable_lto="no" fi @@ -1525,42 +1546,42 @@ AC_MSG_RESULT([${enable_lto}]) # ----------------------------------------------------------------------------- -if test "${enable_backend_kinesis}" = "yes" -o \ +if test "${enable_exporting_kinesis}" = "yes" -o \ "${enable_exporting_pubsub}" = "yes" -o \ - "${enable_backend_prometheus_remote_write}" = "yes" -o \ + "${enable_exporting_prometheus_remote_write}" = "yes" -o \ "${new_cloud_protocol}" = "yes" -o \ "${build_ml}" = "yes"; then enable_cxx_linker="yes" +fi - # Try to unconditionally link with -latomic. If the compiler can satisfy - # all the atomic ops with builtins then, the library will be left unused. - # Otherwise, some ops will be covered by the compiler's intrinsics and some - # will be picked up by the linker from -latomic. In the later case, if - # -latomic is not available there will be a build failure, which would - # have happened either way before this change. - AC_LANG_PUSH([C++]) - - AC_MSG_CHECKING(whether we can use -latomic) - OLD_LIBS="${LIBS}" - LIBS="-latomic" - AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #include <atomic> - #include <cstdint> - std::atomic<std::int64_t> v; - int main() { - return v; - } - ]])], CAN_USE_LIBATOMIC=yes, CAN_USE_LIBATOMIC=no) - LIBS="${OLD_LIBS}" - AC_MSG_RESULT($CAN_USE_LIBATOMIC) - - if test "x$CAN_USE_LIBATOMIC" = xyes; then - OPTIONAL_ATOMIC_LIBS="-latomic" - fi - AC_SUBST([OPTIONAL_ATOMIC_LIBS]) +# Try to unconditionally link with -latomic. If the compiler can satisfy +# all the atomic ops with builtins then, the library will be left unused. +# Otherwise, some ops will be covered by the compiler's intrinsics and some +# will be picked up by the linker from -latomic. In the later case, if +# -latomic is not available there will be a build failure, which would +# have happened either way before this change. +AC_LANG_PUSH([C++]) - AC_LANG_POP([C++]) +AC_MSG_CHECKING(whether we can use -latomic) +OLD_LIBS="${LIBS}" +LIBS="-latomic" +AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #include <atomic> + #include <cstdint> + std::atomic<std::int64_t> v; + int main() { + return v; + } +]])], CAN_USE_LIBATOMIC=yes, CAN_USE_LIBATOMIC=no) +LIBS="${OLD_LIBS}" +AC_MSG_RESULT($CAN_USE_LIBATOMIC) + +if test "x$CAN_USE_LIBATOMIC" = xyes; then + OPTIONAL_ATOMIC_LIBS="-latomic" fi +AC_SUBST([OPTIONAL_ATOMIC_LIBS]) + +AC_LANG_POP([C++]) AM_CONDITIONAL([ENABLE_CXX_LINKER], [test "${enable_cxx_linker}" = "yes"]) @@ -1589,11 +1610,12 @@ AC_SUBST([logdir]) AC_SUBST([pluginsdir]) AC_SUBST([webdir]) -CFLAGS="${CFLAGS} ${OPTIONAL_PROTOBUF_CFLAGS} ${OPTIONAL_MATH_CFLAGS} ${OPTIONAL_NFACCT_CFLAGS} ${OPTIONAL_ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} \ +CFLAGS="${originalCFLAGS} ${OPTIONAL_LTO_CFLAGS} ${OPTIONAL_PROTOBUF_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_PUBSUB_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} \ ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${OPTIONAL_JUDY_CFLAGS} \ - ${OPTIONAL_ACLK_CFLAGS} ${OPTIONAL_ML_CFLAGS} ${OPTIONAL_ML_TESTS_CFLAGS}" + ${OPTIONAL_ACLK_CFLAGS} ${OPTIONAL_ML_CFLAGS} ${OPTIONAL_ML_TESTS_CFLAGS} ${OPTIONAL_OS_DEP_CFLAGS}" CXXFLAGS="${CFLAGS} ${CXX11FLAG}" @@ -1690,14 +1712,6 @@ AC_DEFINE_UNQUOTED( AC_CONFIG_FILES([ Makefile netdata.spec - backends/graphite/Makefile - backends/json/Makefile - backends/Makefile - backends/opentsdb/Makefile - backends/prometheus/Makefile - backends/prometheus/remote_write/Makefile - backends/aws_kinesis/Makefile - backends/mongodb/Makefile collectors/Makefile collectors/apps.plugin/Makefile collectors/cgroups.plugin/Makefile |