-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·87 lines (75 loc) · 1.93 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
usage() {
cat <<EOF
configure options:
--help Show this help and exit
--prefix [/] Prefix path for installation of kernel and user components
--kdir Path to the kernel directory to use for out-of-tree module compilation
--nodriver Don't build the guest kernel driver
--noproxy Don't build proxy code
--netmap Build the proxy backend with netmap support
EOF
}
# Default parameter values
INSTALL_PREFIX="/"
KERNBUILDDIR="/lib/modules/`uname -r`/build"
BUILD_DRIVER="y"
BUILD_PROXY="y"
KER_INSTALL_DEPS="ker"
NETMAP="n"
# Option parsing
while [[ $# > 0 ]]
do
key="$1"
case $key in
"-h")
usage
exit 0
;;
"--help")
usage
exit 0
;;
"--prefix")
if [ -n "$2" ]; then
INSTALL_PREFIX=$2
shift
else
echo "--prefix requires a path argument"
exit 255
fi
;;
"--kdir")
if [ -n "$2" ]; then
KERNBUILDDIR=$2
shift
else
echo "--kdir requires a path argument"
exit 255
fi
;;
"--nodriver")
BUILD_DRIVER="n"
;;
"--noproxy")
BUILD_PROXY="n"
;;
"--netmap")
NETMAP="y"
;;
*)
echo "Unknown option '$key'"
echo "Try ./configure --help"
exit 255
;;
esac
shift
done
SRCDIR=$(dirname $(realpath $0))
cp $SRCDIR/Makefile.in $SRCDIR/Makefile
sed -i "s|@SRCDIR@|$SRCDIR|g" $SRCDIR/Makefile
sed -i "s|@NETMAP@|$NETMAP|g" $SRCDIR/Makefile
sed -i "s|@PROXY@|${BUILD_PROXY}|g" $SRCDIR/Makefile
sed -i "s|@DRIVER@|${BUILD_DRIVER}|g" $SRCDIR/Makefile
sed -i "s|@INSTALL_MOD_PATH@|${INSTALL_PREFIX}|g" $SRCDIR/Makefile
sed -i "s|@KERNBUILDDIR@|$KERNBUILDDIR|g" $SRCDIR/Makefile