doxygen: improve documentation
[platform/upstream/libnetfilter_queue.git] / autogen.sh
1 #!/bin/sh -e
2
3 include ()
4 {
5     # If we keep a copy of the kernel header in the SVN tree, we'll have
6     # to worry about synchronization issues forever. Instead, we just copy 
7     # the headers that we need from the lastest kernel version at autogen
8     # stage.
9
10     INCLUDEDIR=${KERNEL_DIR:-/lib/modules/`uname -r`/build}/include/linux
11     if [ -f $INCLUDEDIR/netfilter/nfnetlink_queue.h ]
12     then
13         TARGET=include/libnetfilter_queue/linux_nfnetlink_queue.h
14         echo "Copying nfnetlink_queue.h to linux_nfnetlink_queue.h"
15         cp $INCLUDEDIR/netfilter/nfnetlink_queue.h $TARGET
16         TEMP=`tempfile`
17         sed 's/linux\/netfilter\/nfnetlink.h/libnfnetlink\/linux_nfnetlink.h/g' $TARGET > $TEMP
18         # Add aligned_u64 definition after #define _NFNETLINK_QUEUE_H
19         awk '{
20         if ( $0 == "#define _NFNETLINK_QUEUE_H" ) {
21                 print $0
22                 getline
23                 print $0
24                 print "#ifndef aligned_u64"
25                 print "#define aligned_u64 unsigned long long __attribute__((aligned(8)))"
26                 print "#endif"
27         }
28
29         print $0
30         }' $TEMP > $TARGET
31     else
32         echo "can't find nfnetlink_queue.h kernel file in $INCLUDEDIR"
33         exit 1
34     fi
35 }
36
37 [ "x$1" = "xdistrib" ] && include
38 autoreconf -fi
39 rm -Rf autom4te.cache