@cryptotaxi247 / netdata-1 / commits / 5d5266dc1

Better checks for nfacct headers (#6351)

Vladimir Kobal committed Jun 27, 2019 at 22:59 UTC 5d5266dc1a863d877d91cab232b6369091a198ee
1 file changed +16 -2
configure.ac
+16 -2
@@ -608,7 +608,16 @@ AM_CONDITIONAL([ENABLE_PLUGIN_CUPS], [test "${enable_plugin_cups}" = "yes"])
608 # -----------------------------------------------------------------------------
609 # nfacct.plugin - libmnl, libnetfilter_acct
610
611 -AC_CHECK_HEADERS_ONCE([linux/netfilter/nfnetlink_conntrack.h])
611 +AC_CHECK_HEADER(
612 + [linux/netfilter/nfnetlink_conntrack.h],
613 + [AC_CHECK_DECL(
614 + [CTA_STATS_MAX],
615 + [have_nfnetlink_conntrack=yes],
616 + [have_nfnetlink_conntrack=no],
617 + [#include <linux/netfilter/nfnetlink_conntrack.h>]
618 + )],
619 + [have_nfnetlink_conntrack=no]
620 +)
621
622 PKG_CHECK_MODULES(
623 [NFACCT],
@@ -634,6 +643,9 @@ PKG_CHECK_MODULES(
643 [have_libmnl=no]
644 )
645
646 +test "${enable_plugin_nfacct}" = "yes" -a "${have_nfnetlink_conntrack}" != "yes" && \
647 + AC_MSG_ERROR([nfnetlink_conntrack.h required but not found or too old])
648 +
649 test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
650 AC_MSG_ERROR([netfilter_acct required but not found])
651
@@ -641,7 +653,9 @@ test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \
653 AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
654
655 AC_MSG_CHECKING([if nfacct.plugin should be enabled])
644 -if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" -a "${have_libmnl}" = "yes"; then
656 +if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" \
657 + -a "${have_libmnl}" = "yes" \
658 + -a "${have_nfnetlink_conntrack}" = "yes"; then
659 enable_plugin_nfacct="yes"
660 AC_DEFINE([HAVE_LIBMNL], [1], [libmnl usability])
661 AC_DEFINE([HAVE_LIBNETFILTER_ACCT], [1], [libnetfilter_acct usability])