From 88998e1d5523cb2a949c09b75c3fcea93bea88ea Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 17 Sep 2009 10:56:19 +0200 Subject: [PATCH] =?utf8?q?Build=20system:=20Check=20for=20=E2=80=9Clibiptc?= =?utf8?q?/libip6tc.h=E2=80=9D=20and=20=E2=80=9Clinux/netfilter/x=5Ftables?= =?utf8?q?.h=E2=80=9D,=20too.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Apparently “linux/netfilter/x_tables.h” is not available with older kernels which leads to build fails there: -- 8< -- In file included from libiptc.c:47, from libip4tc.c:136: xtables.h:24:38: linux/netfilter/x_tables.h: No such file or directory -- >8 -- --- configure.in | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 092fbd02..c076e770 100644 --- a/configure.in +++ b/configure.in @@ -1453,29 +1453,32 @@ SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS" LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS" -if test "x$with_libiptc" = "xyes" +# check whether the header file for libiptc is available. +if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" then - AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [], + AC_CHECK_HEADERS(libiptc/libiptc.h, [ - with_libiptc="no (Linux iptables headers not found)" - with_own_libiptc="no" + AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the header file.]) ], [ -#include "$srcdir/src/owniptc/ipt_kernel_headers.h" + with_libiptc="yes" + with_own_libiptc="yes" ]) - 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 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 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [], @@ -1489,6 +1492,7 @@ then #endif ]) 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, @@ -1500,6 +1504,19 @@ then 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") if test "x$with_libiptc" = "xyes" -- 2.11.0