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"
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, [],
[
#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
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
[
#endif
])
- CFLAGS="$SAVE_CFLAGS"
+ 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.])
fi
# }}}
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