summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2005-11-14 14:50:30 +0000
committer/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2005-11-14 14:50:30 +0000
commit0cc1901da792be66305ece4a8ecc5dca37860649 (patch)
tree0b5bba31ce1a292bbd2ff120f6f8dc5ba6185379
parent59bf809b352a966e14baac51e90d36ac8feb077b (diff)
This patch add the ability to copy and mangle the kernel headers
required by libnfnetlink and libnetfilter_[queue|log|conntrack] at autogen.sh stage. (Pablo Neira)
-rwxr-xr-xautogen.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index 59a046b..c20a2de 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,5 +1,39 @@
#!/bin/sh
+include ()
+{
+ # If we keep a copy of the kernel header in the SVN tree, we'll have
+ # to worry about synchronization issues forever. Instead, we just copy
+ # the headers that we need from the lastest kernel version at autogen
+ # stage.
+
+ INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+ if [ -f $INCLUDEDIR/netfilter/nfnetlink_queue.h ]
+ then
+ TARGET=include/libnetfilter_queue/linux_nfnetlink_queue.h
+ echo "Copying nfnetlink_queue.h to linux_nfnetlink_queue.h"
+ cp $INCLUDEDIR/netfilter/nfnetlink_queue.h $TARGET
+ TEMP=`tempfile`
+ sed 's/linux\/netfilter\/nfnetlink.h/libnfnetlink\/linux_nfnetlink.h/g' $TARGET > $TEMP
+ # Add aligned_u64 definition after #define _NFNETLINK_QUEUE_H
+ awk '{
+ if ( $0 == "#define _NFNETLINK_QUEUE_H" ) {
+ print $0
+ getline
+ print $0
+ print "#ifndef aligned_u64"
+ print "#define aligned_u64 unsigned long long __attribute__((aligned(8)))"
+ print "#endif"
+ }
+
+ print $0
+ }' $TEMP > $TARGET
+ else
+ echo "can't find nfnetlink_queue.h kernel file"
+ exit 1
+ fi
+}
+
run ()
{
echo "running: $*"
@@ -11,6 +45,7 @@ run ()
fi
}
+include
run libtoolize
run aclocal
#run autoheader