forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·58 lines (47 loc) · 1.29 KB
/
build.sh
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
#!/bin/bash
set -o errexit
KERNELSRC=""
CFLAGS="-Werror"
function install_kernel()
{
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.7.tar.gz
tar xzvf linux-3.14.7.tar.gz > /dev/null
cd linux-3.14.7
make allmodconfig
make net/openvswitch/
KERNELSRC=$(pwd)
echo "Installed kernel source in $(pwd)"
cd ..
}
function install_dpdk()
{
wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-1.7.0.tar.gz
tar xzvf dpdk-1.7.0.tar.gz > /dev/null
cd dpdk-1.7.0
find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp
make config CC=gcc T=x86_64-native-linuxapp-gcc
make CC=gcc RTE_KERNELDIR=$KERNELSRC
echo "Installed DPDK source in $(pwd)"
cd ..
}
function configure_ovs()
{
./boot.sh && ./configure $*
}
if [ "$KERNEL" ] || [ "$DPDK" ]; then
install_kernel
fi
[ "$DPDK" ] && {
install_dpdk
# Disregard bad function cassts until DPDK is fixed
CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
}
configure_ovs $*
if [ $CC = "clang" ]; then
make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
else
make CFLAGS="$CFLAGS" C=1
[ "$TESTSUITE" ] && make distcheck
fi
exit 0