All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix --with-kernel for libnfnetlink
@ 2006-04-20 15:25 David Vogt
  2006-04-20 16:33 ` Amin Azez
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: David Vogt @ 2006-04-20 15:25 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Amin Azez, pablo

Hi,

Amin Azez has helped me with some trouble concerning the compilation
of libnfnetlink.
The --with-kernel parameter for the configure script did not work as
intended, so Amin has proposed the following changes that 1) look for
the kernel sources 2) recognise --with-kernel parameter.

Index: configure.in
===================================================================
--- configure.in	(revision 6582)
+++ configure.in	(working copy)
@@ -18,6 +18,47 @@


 dnl--------------------------------
+AC_DEFUN([NF_KERNEL_SOURCE],[
+
+ if test "$with_kernel" = ""; then
+   KERNEL="`uname -r`"
+ else
+   KERNEL="$with_kernel"
+ fi
+
+ THIS_PREFIX=""
+ for i in "/lib/modules/$KERNEL/build/include" "$KERNEL"
"$KERNEL/include" "/usr/src/linux-$KERNEL" "/usr/src/kernel-$KERNEL"
"/usr/src/linux-headers-$KERNEL" "/usr/src/kernel-headers-$KERNEL"
+ do
+   AC_MSG_CHECKING([Looking for kernel source or headers in $i])
+   if test -r "$i/linux/config.h"
+   then
+     THIS_PREFIX="$i"
+     AC_MSG_RESULT([found])
+     break
+   fi
+   AC_MSG_RESULT([ ])
+ done
+ if test -r "$THIS_PREFIX/linux/config.h" ; then
+   AC_SUBST(KERNELDIR,[$THIS_PREFIX])
+   AC_MSG_RESULT([found])
+ else
+   AC_MSG_ERROR([not found $THIS_PREFIX])
+ fi
+
+ # somehow add this as an include path
+])
+
+AC_ARG_WITH(kernel,
+              AC_HELP_STRING([--with-kernel=DIR],
+                             [ Show location of kernel source.
Default is to use uname -r and look in
/lib/modules/KERNEL/build/include. ]),
+              NF_KERNEL_SOURCE($with_kernel),NF_KERNEL_SOURCE())
+
+if test ! -z "$libdir"; then
+  MODULE_DIR="\\\"$libdir/\\\""
+  CFLAGS="$CFLAGS -DCONNTRACK_LIB_DIR=$MODULE_DIR"
+fi
+
+
 dnl--------------------------------


Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 6582)
+++ src/Makefile.am	(working copy)
@@ -2,7 +2,7 @@
 # Please read Chapter 6 "Library interface versions" of the libtool
documentation before making any modification
 LIBVERSION=1:0:0

-INCLUDES = $(all_includes) -I$(top_srcdir)/include
+INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(KERNELDIR)
 AM_CFLAGS=-fPIC -Wall
 LIBS=

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-07-26 14:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-20 15:25 Fix --with-kernel for libnfnetlink David Vogt
2006-04-20 16:33 ` Amin Azez
2006-04-20 16:50 ` Sven-Haegar Koch
2006-04-20 18:51   ` Patrick McHardy
2006-04-20 18:53     ` Patrick McHardy
2006-04-20 19:38     ` KOVACS Krisztian
2006-04-20 22:52       ` Patrick McHardy
2006-04-21 15:25         ` Pablo Neira Ayuso
2006-04-21 20:02           ` Harald Welte
2006-04-20 19:34 ` Patrick McHardy
2006-04-21  7:21   ` David Vogt
2006-04-21 11:09     ` Pablo Neira Ayuso
2006-04-21 12:48       ` Amin Azez
2006-04-21 13:12         ` Pablo Neira Ayuso
2006-04-21 13:56           ` Amin Azez
2006-07-26 14:06       ` Amin Azez
2006-07-26 14:11         ` quick fix " Amin Azez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.