When checking for the iptc headers and data types, the configure script
added the kernel directory to the CFLAGS. Later, when actually building
the iptables plugin, the CFLAGS were left untouched.
At least on Debian, the “real” kernel headers are not required – the
libc versions in /usr/include/linux are sufficient. The usage of
KERNEL_DIR has therefore been removed from the iptc checks.
In addition, an directory specified by “--with-libiptc=/path” is no
longer added to the global CFLAGS but rather to the iptables specific
CPPFLAGS.
Hopefully this resolved build problems on various platforms.
with_libiptc="yes"
else if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
with_libiptc="yes"
else if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
- LDFLAGS="$LDFLAGS -L$withval/lib"
- CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
+ LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
with_libiptc="yes"
else
with_libiptc="$withval"
with_libiptc="yes"
else
with_libiptc="$withval"
fi
if test "x$with_libiptc" = "xyes"
then
fi
if test "x$with_libiptc" = "xyes"
then
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
[
AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
[
#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
])
#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
])
- CFLAGS="$SAVE_CFLAGS"
-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_own_libiptc" = "xyes"
-then
- AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
+ CPPFLAGS="$SAVE_CPPFLAGS"
fi
if test "x$with_libiptc" = "xyes"
then
fi
if test "x$with_libiptc" = "xyes"
then
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
[
AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
[
+ CPPFLAGS="$SAVE_CPPFLAGS"
+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"
+ BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
+ 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.])
if BUILD_PLUGIN_IPTABLES
pkglib_LTLIBRARIES += iptables.la
iptables_la_SOURCES = iptables.c
if BUILD_PLUGIN_IPTABLES
pkglib_LTLIBRARIES += iptables.la
iptables_la_SOURCES = iptables.c
-iptables_la_LDFLAGS = -module -avoid-version
+iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
+iptables_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBIPTC_LDFLAGS)
if BUILD_WITH_OWN_LIBIPTC
iptables_la_LIBADD = owniptc/libiptc.la
iptables_la_DEPENDENCIES = owniptc/libiptc.la
if BUILD_WITH_OWN_LIBIPTC
iptables_la_LIBADD = owniptc/libiptc.la
iptables_la_DEPENDENCIES = owniptc/libiptc.la