--- configure.in | 107 -------------------------------------------------------- src/Makefile.am | 15 ++----- 2 files changed, 5 insertions(+), 117 deletions(-) Index: collectd-4.10.3/configure.in =================================================================== --- collectd-4.10.3.orig/configure.in +++ collectd-4.10.3/configure.in @@ -1560,113 +1560,8 @@ AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, tes # }}} # --with-libiptc {{{ -with_own_libiptc="no" -AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], -[ - if test "x$withval" = "xshipped" - then - with_own_libiptc="yes" - with_libiptc="yes" - else if test "x$withval" != "xno" && test "x$withval" != "xyes" - then - LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include" - LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib" - with_libiptc="yes" - else - with_libiptc="$withval" - fi; fi -], -[ - if test "x$ac_system" = "xLinux" - then - with_libiptc="yes" - else - 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_HEADERS(libiptc/libiptc.h, - [ - AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_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" && test "x$with_own_libiptc" = "xno" -then - AC_CHECK_HEADERS(libiptc/libip6tc.h, - [ - 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], [], [], - [ -#if OWN_LIBIPTC -# include "$srcdir/src/owniptc/libiptc.h" -# include "$srcdir/src/owniptc/libip6tc.h" -#else -# include -# include -#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, - [ - 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 +PKG_CHECK_MODULES([libiptc], [libiptc], [with_libiptc=yes], [with_libiptc=no]) 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 -CPPFLAGS="$SAVE_CPPFLAGS" -LDFLAGS="$SAVE_LDFLAGS" # }}} # --with-java {{{ Index: collectd-4.10.3/src/Makefile.am =================================================================== --- collectd-4.10.3.orig/src/Makefile.am +++ collectd-4.10.3/src/Makefile.am @@ -1,7 +1,4 @@ SUBDIRS = libcollectdclient -if BUILD_WITH_OWN_LIBIPTC -SUBDIRS += owniptc -endif if BUILD_WITH_OWN_LIBOCONFIG SUBDIRS += liboconfig endif @@ -413,14 +410,10 @@ endif # BUILD_PLUGIN_INTERFACE if BUILD_PLUGIN_IPTABLES pkglib_LTLIBRARIES += iptables.la iptables_la_SOURCES = iptables.c -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 -else -iptables_la_LIBADD = -liptc -endif +iptables_la_CPPFLAGS = $(AM_CPPFLAGS) +iptables_la_CFLAGS = ${AM_CFLAGS} ${libiptc_CFLAGS} +iptables_la_LDFLAGS = -module -avoid-version +iptables_la_LIBADD = ${libiptc_LIBS} collectd_LDADD += "-dlopen" iptables.la collectd_DEPENDENCIES += iptables.la endif