From: Florian Forster Date: Thu, 17 Sep 2009 07:40:28 +0000 (+0200) Subject: Merge branch 'collectd-4.7' into collectd-4.8 X-Git-Tag: collectd-4.8.1~12 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=4374305bd9523620d4291c9be5bfd81640f789a7;hp=e21d0408e4e4001b8c66bb1ea7d41b890100d0f5;p=collectd.git Merge branch 'collectd-4.7' into collectd-4.8 --- diff --git a/README b/README index 2f80cc89..6529a900 100644 --- a/README +++ b/README @@ -481,11 +481,16 @@ Prerequisites If present, the uuid plugin will check for UUID from HAL. - * libiptc (optional, if not found a version shipped with this distribution - can be used if the Linux kernel headers are available) + * libiptc (optional) For querying iptables counters. + If not found on the system, a version shipped with this distribution can + be used. It requires some Linux headers in /usr/include/linux. You can + force the build system to use the shipped version by specifying + --with-libiptc=shipped + when running the configure script. + * libjvm (optional) Library that encapsulates the `Java Virtual Machine' (JVM). This library is used by the Java plugin to execute Java bytecode. See “Configuring with diff --git a/configure.in b/configure.in index 637a56a8..a58002a0 100644 --- a/configure.in +++ b/configure.in @@ -1463,16 +1463,21 @@ AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to l with_libiptc="no (Linux only)" fi ]) -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" +SAVE_CPPFLAGS="$CPPFLAGS" +SAVE_LDFLAGS="$LDFLAGS" +CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS" +LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS" +if test "x$with_libiptc" = "xyes" then - AC_CHECK_LIB(iptc, iptc_init, + AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [], [ - AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) + with_libiptc="no (Linux iptables headers not found)" + with_own_libiptc="no" ], [ - with_libiptc="yes" - with_own_libiptc="yes" +#include "$srcdir/src/owniptc/ipt_kernel_headers.h" ]) + fi if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" then @@ -1485,27 +1490,8 @@ then with_own_libiptc="yes" ]) fi -if test "x$with_libiptc" = "xyes" -then - SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS" - - AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [], - [ - with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)" - with_own_libiptc="no" - ], - [ -#include "$srcdir/src/owniptc/ipt_kernel_headers.h" - ]) - - CPPFLAGS="$SAVE_CPPFLAGS" -fi -if test "x$with_libiptc" = "xyes" +if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" then - SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS" - AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [], [ #if OWN_LIBIPTC @@ -1516,8 +1502,17 @@ then # include #endif ]) - - CPPFLAGS="$SAVE_CPPFLAGS" +fi +if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" +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" + ]) fi AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes") @@ -1532,6 +1527,8 @@ 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" # }}} # --with-java {{{ diff --git a/src/iptables.c b/src/iptables.c index 69cd39c4..aa53074a 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -34,10 +34,13 @@ #if OWN_LIBIPTC # include "owniptc/libiptc.h" # include "owniptc/libip6tc.h" -#else + +# define HAVE_IPTC_HANDLE_T 1 +# define HAVE_IP6TC_HANDLE_T 1 + +#else /* if !OWN_LIBIPTC */ # include # include -#endif /* * iptc_handle_t was available before libiptc was officially available as a @@ -51,12 +54,13 @@ * this is somewhat hacky, I didn't find better way to solve that :-/ * -tokkee */ -#ifndef HAVE_IPTC_HANDLE_T +# ifndef HAVE_IPTC_HANDLE_T typedef struct iptc_handle iptc_handle_t; -#endif -#ifndef HAVE_IP6TC_HANDLE_T +# endif +# ifndef HAVE_IP6TC_HANDLE_T typedef struct ip6tc_handle ip6tc_handle_t; -#endif +# endif +#endif /* !OWN_LIBIPTC */ /* * (Module-)Global variables