])
# For ipvs module
+have_linux_ip_vs_h="no"
have_net_ip_vs_h="no"
have_ip_vs_h="no"
+ip_vs_h_needs_kernel_cflags="no"
if test "x$ac_system" = "xLinux"
then
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $KERNEL_CFLAGS"
-
+ AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
- CFLAGS="$SAVE_CFLAGS"
+ if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
+ then
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+
+ AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
+
+ AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
+ AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
+ AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
+
+ if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
+ then
+ ip_vs_h_needs_kernel_cflags="yes"
+ fi
+
+ CFLAGS="$SAVE_CFLAGS"
+ fi
fi
+AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
# For quota module
AC_CHECK_HEADERS(sys/ucred.h, [], [],
plugin_vserver="yes"
plugin_wireless="yes"
- if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
+ if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
then
plugin_ipvs="yes"
fi
dnl ip_vs.h
if test "x$ac_system" = "xLinux" \
- && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
+ && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
then
enable_ipvs="$enable_ipvs (ip_vs.h not found)"
fi
+if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
+then
+ enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
+fi
+
dnl Perl bindings
AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
[
if BUILD_PLUGIN_IPVS
pkglib_LTLIBRARIES += ipvs.la
ipvs_la_SOURCES = ipvs.c
+if IP_VS_H_NEEDS_KERNEL_CFLAGS
ipvs_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
+endif
ipvs_la_LDFLAGS = -module -avoid-version
collectd_LDADD += "-dlopen" ipvs.la
collectd_DEPENDENCIES += ipvs.la