#
# Checks for libraries begin here
#
+
with_libresolv="yes"
AC_CHECK_LIB(resolv, res_search,
[
# }}}
# --with-libiptc {{{
-with_own_libiptc="no"
AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
[
- if test "x$withval" = "xshipped"
- then
- with_own_libiptc="yes"
- with_libiptc="yes"
- else if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
with_libiptc="yes"
else
with_libiptc="$withval"
- fi; fi
+ fi
],
[
if test "x$ac_system" = "xLinux"
CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
# check whether the header file for libiptc is available.
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
+if test "x$with_libiptc" = "xyes"
then
AC_CHECK_HEADERS(libiptc/libiptc.h,
- [
- AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
- ],
- [
- with_libiptc="yes"
- with_own_libiptc="yes"
- ])
+ [with_libiptc="yes"],
+ [with_libiptc="no (libiptc/libiptc.h not found)"])
fi
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
+if test "x$with_libiptc" = "xyes"
then
AC_CHECK_HEADERS(libiptc/libip6tc.h,
- [
- AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
- ],
- [
- with_libiptc="yes"
- with_own_libiptc="yes"
- ])
+ [with_libiptc="yes"],
+ [with_libiptc="no (libiptc/libip6tc.h not found)"])
fi
# If the header file is available, check for the required type declaractions.
# They may be missing in old versions of libiptc. In that case, they will be
# declared in the iptables plugin.
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
+if test "x$with_libiptc" = "xyes"
then
AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
[
-#if OWN_LIBIPTC
-# include "$srcdir/src/owniptc/libiptc.h"
-# include "$srcdir/src/owniptc/libip6tc.h"
-#else
-# include <libiptc/libiptc.h>
-# include <libiptc/libip6tc.h>
-#endif
+#include <libiptc/libiptc.h>
+#include <libiptc/libip6tc.h>
])
fi
# Check for the iptc_init symbol in the library.
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
+if test "x$with_libiptc" = "xyes"
then
AC_CHECK_LIB(iptc, iptc_init,
- [
- AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
- ],
- [
- with_libiptc="yes"
- with_own_libiptc="yes"
- ],
- [-lip4tc -lip6tc])
-fi
-# The system wide version failed for some reason. Check if we have the required
-# headers to build the shipped version.
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
-then
- AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
- [
- with_libiptc="no (Linux iptables headers not found)"
- with_own_libiptc="no"
- ],
- [
-#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
- ])
+ [with_libiptc="yes"],
+ [with_libiptc="no (symbol 'iptc_init' not found)"])
fi
AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
-AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
if test "x$with_libiptc" = "xyes"
then
BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
fi
-if test "x$with_own_libiptc" = "xyes"
-then
- AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
-fi
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
# }}}
fi
# }}}
+# --with-libmongoc {{{
+AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
+[
+ if test "x$withval" = "xyes"
+ then
+ with_libmongoc="yes"
+ 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"
+ 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
+ if test "x$LIBMONGOC_CPPFLAGS" != "x"
+ then
+ AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
+ fi
+ AC_CHECK_HEADERS(mongo.h,
+ [with_libmongoc="yes"],
+ [with_libmongoc="no ('mongo.h' not found)"],
+[#if HAVE_STDINT_H
+# define MONGO_HAVE_STDINT 1
+#else
+# define MONGO_USE_LONG_LONG_INT 1
+#endif
+])
+fi
+if test "x$with_libmongoc" = "xyes"
+then
+ if test "x$LIBMONGOC_LDFLAGS" != "x"
+ then
+ AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
+ fi
+ AC_CHECK_LIB(mongoc, mongo_run_command,
+ [with_libmongoc="yes"],
+ [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
+fi
+
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+
+if test "x$with_libmongoc" = "xyes"
+then
+ BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
+ BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
+ AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
+ AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
+# }}}
+
# --with-libmysql {{{
with_mysql_config="mysql_config"
with_mysql_cflags=""
fi
# AIX
+
+if test "x$ac_system" = "xAIX"
+then
+ plugin_tcpconns="yes"
+fi
+
if test "x$with_perfstat" = "xyes"
then
plugin_cpu="yes"
AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
+AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
-AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
if test "x$with_librrd" = "xyes" \
&& test "x$librrd_threadsafe" != "xyes"
with_librrd="yes (warning: librrd is not thread-safe)"
fi
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
-then
- with_libiptc="yes (shipped version)"
-fi
-
if test "x$with_libperl" = "xyes"
then
with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
wireless . . . . . . $enable_wireless
write_http . . . . . $enable_write_http
write_redis . . . . . $enable_write_redis
+ write_mongodb . . . . $enable_write_mongodb
xmms . . . . . . . . $enable_xmms
zfs_arc . . . . . . . $enable_zfs_arc