From 9bf39535ce55d5ff736c2ab3ee8ffdd8d8d8d62f Mon Sep 17 00:00:00 2001 From: Boian Berberov Date: Mon, 11 Aug 2008 16:57:57 +0200 Subject: [PATCH] configure.in: Look for ip_vs.h in the kernel sources. Developers, I am writing an updated ebuild for gentoo and I made this patch that allows ip_vs.h to be located and the ipvs module to build. Normally I would include this with the ebuild, but I thought it may be beneficial to send it to you. Please review it and let me know what you think. I am still inexperienced with autotools so the patch may not be well put together. If you would consider applying it or a similar patch, please let me know so I can adjust the ebuild accordingly. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- configure.in | 28 ++++++++++++++++++---------- src/Makefile.am | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index 41ee9555..ceb25538 100644 --- a/configure.in +++ b/configure.in @@ -50,6 +50,18 @@ case $host_os in esac AC_MSG_RESULT([$ac_system]) +if test "x$ac_system" = "xLinux" +then + AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources]) + if test -z "$KERNEL_DIR" + then + KERNEL_DIR="/lib/modules/`uname -r`/source" + fi + + KERNEL_CFLAGS="-I$KERNEL_DIR/include" + AC_SUBST(KERNEL_CFLAGS) +fi + # # Checks for header files. # @@ -278,8 +290,13 @@ have_net_ip_vs_h="no" have_ip_vs_h="no" if test "x$ac_system" = "xLinux" then + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $KERNEL_CFLAGS" + 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 fi # For quota module @@ -1599,15 +1616,6 @@ then LDFLAGS=$SAVE_LDFLAGS fi -if test "x$ac_system" = "xLinux" -then - AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources]) - if test -z "$KERNEL_DIR" - then - KERNEL_DIR="/lib/modules/`uname -r`/source" - fi -fi - with_own_libiptc="no" AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], [ @@ -1653,7 +1661,7 @@ fi if test "x$with_libiptc" = "xyes" then SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -I$KERNEL_DIR/include" + CFLAGS="$CFLAGS $KERNEL_CFLAGS" AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [], [ diff --git a/src/Makefile.am b/src/Makefile.am index 21022493..a4f9a79f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -311,6 +311,7 @@ endif if BUILD_PLUGIN_IPVS pkglib_LTLIBRARIES += ipvs.la ipvs_la_SOURCES = ipvs.c +ipvs_la_CFLAGS = $(KERNEL_CFLAGS) ipvs_la_LDFLAGS = -module -avoid-version collectd_LDADD += "-dlopen" ipvs.la collectd_DEPENDENCIES += ipvs.la -- 2.30.2