[PATCH] KERNEL_DIR support in autogen.sh for libnfnetlink/libnetfilter_conntrack

Krzysztof Oledzki olenf at ans.pl
Tue Nov 15 00:48:13 CET 2005


Hello,

Attached two patches for libnfnetlink and libnetfilter_conntrack allow 
user to specify custom KERNEL_DIR like in iptables build. If KERNEL_DIR is 
empty default directory - "/lib/modules/`uname -r`/build" is used.

Best regards,


 				Krzysztof Olędzki
-------------- next part --------------

[libnfnetlink] Add KERNEL_DIR support to autogen.sh

Allow user to specify custom KERNEL_DIR to support building library
against selected kernel tree.

Signed-off-by: Krzysztof Piotr Oledzki <ole at ans.pl>

Index: autogen.sh
===================================================================
--- autogen.sh	(revision 4538)
+++ autogen.sh	(working copy)
@@ -7,14 +7,15 @@
     # the headers that we need from the lastest kernel version at autogen
     # stage.
 
-    INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+    INCLUDEDIR=${KERNEL_DIR:-/lib/modules/`uname -r`/build}/include/linux
+
     if [ -f $INCLUDEDIR/netfilter/nfnetlink.h ]
     then
     	TARGET=include/libnfnetlink/linux_nfnetlink.h
     	echo "Copying nfnetlink.h to linux_nfnetlink.h"
     	cp $INCLUDEDIR/netfilter/nfnetlink.h $TARGET
     else
-    	echo "can't find nfnetlink.h kernel file"
+    	echo "can't find nfnetlink.h kernel file in $INCLUDEDIR"
     	exit 1
     fi
 }
-------------- next part --------------

[libnetfilter_conntrack] Add KERNEL_DIR support to autogen.sh

Allow user to specify custom KERNEL_DIR to support building library
against selected kernel tree.

Signed-off-by: Krzysztof Piotr Oledzki <ole at ans.pl>

Index: autogen.sh
===================================================================
--- autogen.sh	(revision 4538)
+++ autogen.sh	(working copy)
@@ -7,7 +7,7 @@
     # the headers that we need from the lastest kernel version at autogen
     # stage.
 
-    INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+    INCLUDEDIR=${KERNEL_DIR:-/lib/modules/`uname -r`/build}/include/linux
     if [ -f $INCLUDEDIR/netfilter/nfnetlink_conntrack.h ]
     then
     	TARGET=include/libnetfilter_conntrack/linux_nfnetlink_conntrack.h
@@ -17,7 +17,7 @@
 	sed 's/linux\/netfilter\/nfnetlink.h/libnfnetlink\/linux_nfnetlink.h/g' $TARGET > $TEMP
 	mv $TEMP $TARGET
     else
-    	echo "can't find nfnetlink_conntrack.h kernel file"
+    	echo "can't find nfnetlink_conntrack.h kernel file in $INCLUDEDIR"
     	exit 1
     fi
 }


More information about the netfilter-devel mailing list