X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=c076e77023bb1da276cdb60a286ebedba191a491;hb=bf90793e82989b1c36fe8f3b66b9c9fe05c9532d;hp=9f26be3b8d5dbcbafafc10f62296e055dabbb561;hpb=a690e4ac74e05f7294c22df8e0574e5e6f52f510;p=collectd.git diff --git a/configure.in b/configure.in index 9f26be3b..c076e770 100644 --- a/configure.in +++ b/configure.in @@ -1449,11 +1449,16 @@ AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to l with_libiptc="no (Linux only)" fi ]) +SAVE_CPPFLAGS="$CPPFLAGS" +SAVE_LDFLAGS="$LDFLAGS" +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" then - AC_CHECK_LIB(iptc, iptc_init, + AC_CHECK_HEADERS(libiptc/libiptc.h, [ - AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) + AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the header file.]) ], [ with_libiptc="yes" @@ -1462,36 +1467,20 @@ then fi if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" then - AC_CHECK_HEADERS(libiptc/libiptc.h, + AC_CHECK_HEADERS(libiptc/libip6tc.h, [ - AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the header file.]) + AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the header file.]) ], [ with_libiptc="yes" 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 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" then - SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS" - AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [], [ #if OWN_LIBIPTC @@ -1502,8 +1491,31 @@ then # include #endif ]) - - CPPFLAGS="$SAVE_CPPFLAGS" +fi +# Check for the iptc_init symbol in the library. +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 +# 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" + ]) fi AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes") @@ -1518,6 +1530,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 {{{