summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-03-19 14:55:32 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2010-03-19 14:55:32 +0100
commit74e7bb8b033640f7c4692c4ea0d5c231e3137b7b (patch)
tree4cc2125d00b83b5ac1b076da2c8e3eff7b08ddc3 /autogen.sh
downloadlibmnl-74e7bb8b033640f7c4692c4ea0d5c231e3137b7b.tar.gz
libmnl-74e7bb8b033640f7c4692c4ea0d5c231e3137b7b.zip
initial libmnl import
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..c167563
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,53 @@
+#!/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=${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
+ TMP=`mktemp`
+ sed 's/__be16/u_int16_t/g' $TARGET > $TMP
+ cp $TMP $TARGET
+ sed 's/#include <linux\/netfilter\/nfnetlink_compat\.h>/#include <libnfnetlink\/linux_nfnetlink_compat\.h>/g' $TARGET > $TMP
+ cp $TMP $TARGET
+ else
+ echo "can't find nfnetlink.h kernel file in $INCLUDEDIR"
+ exit 1
+ fi
+
+ if [ -f $INCLUDEDIR/netfilter/nfnetlink_compat.h ]
+ then
+ TARGET=include/libnfnetlink/linux_nfnetlink_compat.h
+ echo "Copying nfnetlink_compat.h to linux_nfnetlink_compat.h"
+ cp $INCLUDEDIR/netfilter/nfnetlink_compat.h $TARGET
+ else
+ echo "can't find nfnetlink.h kernel file in $INCLUDEDIR, ignoring"
+ fi
+}
+
+run ()
+{
+ echo "running: $*"
+ eval $*
+
+ if test $? != 0 ; then
+ echo "error: while running '$*'"
+ exit 1
+ fi
+}
+
+[ "x$1" = "xdistrib" ] && include
+run aclocal
+#run autoheader
+run libtoolize -f
+run automake -a
+run autoconf