X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.ac;h=320572d0c0e58b026f904b902305460e26452965;hb=2b4445ea9b4b978468d75864f98e8137ba628dec;hp=63cfca77db933d0644752264728d2dcb7370c686;hpb=79a94204db8de144bf5bd84159afde444df9e0a4;p=collectd.git diff --git a/configure.ac b/configure.ac index 63cfca77..320572d0 100644 --- a/configure.ac +++ b/configure.ac @@ -592,6 +592,14 @@ if test "x$ac_system" = "xLinux"; then fi if test "x$have_capability" = "xyes"; then + AC_CHECK_DECL([CAP_IS_SUPPORTED], + [have_capability="yes"], + [have_capability="no (CAP_IS_SUPPORTED not found)"], + [[#include ]] + ) + fi + + if test "x$have_capability" = "xyes"; then AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).]) fi @@ -3302,52 +3310,62 @@ AC_ARG_WITH([libmongoc], else if test "x$withval" = "xno"; then with_libmongoc="no" else - with_libmongoc="yes" - LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include" - LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib" + with_libmongoc="no" fi; fi ], [with_libmongoc="yes"] ) -SAVE_CPPFLAGS="$CPPFLAGS" -SAVE_LDFLAGS="$LDFLAGS" - -CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS" -LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS" +if test "x$with_libmongoc" = "xyes"; then + PKG_CHECK_MODULES([LIBMONGOC], [libmongoc-1.0], + [with_libmongoc="yes"], + [with_libmongoc="no (pkg-config could not find libmongoc)"] + ) +fi if test "x$with_libmongoc" = "xyes"; then - if test "x$LIBMONGOC_CPPFLAGS" != "x"; then - AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS]) + SAVE_CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS" + + if test "x$CPPFLAGS" != "x"; then + AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CFLAGS]) fi - AC_CHECK_HEADERS([mongo.h], + AC_CHECK_HEADERS([mongoc.h], [with_libmongoc="yes"], - [with_libmongoc="no ('mongo.h' not found)"], - [[#define MONGO_HAVE_STDINT 1]] + [with_libmongoc="no ('mongoc.h' not found)"] ) + + CPPFLAGS="$SAVE_CPPFLAGS" fi if test "x$with_libmongoc" = "xyes"; then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + + CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS" + LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS" + if test "x$LIBMONGOC_LDFLAGS" != "x"; then AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS]) fi - AC_CHECK_LIB([mongoc], [mongo_run_command], + AC_CHECK_LIB([mongoc-1.0], [mongoc_init], [with_libmongoc="yes"], - [with_libmongoc="no (symbol 'mongo_run_command' not found)"] + [with_libmongoc="no (symbol 'mongoc_init' not found)"] ) -fi -CPPFLAGS="$SAVE_CPPFLAGS" -LDFLAGS="$SAVE_LDFLAGS" + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi if test "x$with_libmongoc" = "xyes"; then - BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS" + BUILD_WITH_LIBMONGOC_CFLAGS="$LIBMONGOC_CFLAGS" BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS" fi -AC_SUBST([BUILD_WITH_LIBMONGOC_CPPFLAGS]) +AC_SUBST([BUILD_WITH_LIBMONGOC_CFLAGS]) AC_SUBST([BUILD_WITH_LIBMONGOC_LDFLAGS]) # }}} @@ -5997,6 +6015,11 @@ if test "x$ac_system" = "xLinux"; then if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"; then plugin_cpusleep="yes" fi + + if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then + plugin_ovs_events="yes" + plugin_ovs_stats="yes" + fi fi if test "x$ac_system" = "xOpenBSD"; then @@ -6173,11 +6196,6 @@ if test "x$with_libyajl" = "xyes"; then plugin_log_logstash="yes" fi -if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then - plugin_ovs_events="yes" - plugin_ovs_stats="yes" -fi - if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then plugin_perl="yes" fi