9 function install_kernel()
11 if [[ "$1" =~ ^3.* ]]; then
14 PREFIX="v2.6/longterm/v2.6.32"
17 wget https://www.kernel.org/pub/linux/kernel/${PREFIX}/linux-${1}.tar.gz
18 tar xzvf linux-${1}.tar.gz > /dev/null
22 # Older kernels do not include openvswitch
23 if [ -d "net/openvswitch" ]; then
30 if [ ! "$DPDK" ]; then
31 EXTRA_OPTS="--with-linux=$(pwd)"
33 echo "Installed kernel source in $(pwd)"
37 function install_dpdk()
39 wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-1.7.1.tar.gz
40 tar xzvf dpdk-1.7.1.tar.gz > /dev/null
42 find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
43 sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp
44 sed -ri '/CONFIG_RTE_LIBNAME/a CONFIG_RTE_BUILD_FPIC=y' config/common_linuxapp
45 sed -ri '/EXECENV_CFLAGS = -pthread -fPIC/{s/$/\nelse ifeq ($(CONFIG_RTE_BUILD_FPIC),y)/;s/$/\nEXECENV_CFLAGS = -pthread -fPIC/}' mk/exec-env/linuxapp/rte.vars.mk
46 make config CC=gcc T=x86_64-native-linuxapp-gcc
47 make CC=gcc RTE_KERNELDIR=$KERNELSRC
48 echo "Installed DPDK source in $(pwd)"
52 function configure_ovs()
54 ./boot.sh && ./configure $*
57 if [ "$KERNEL" ] || [ "$DPDK" ]; then
58 install_kernel $KERNEL
63 # Disregard bad function cassts until DPDK is fixed
64 CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
65 elif [ $CC != "clang" ]; then
66 # DPDK headers currently trigger sparse errors
67 CFLAGS="$CFLAGS -Wsparse-error"
70 configure_ovs $EXTRA_OPTS $*
72 # Only build datapath if we are testing kernel w/o running testsuite
73 if [ $KERNEL ] && [ ! "$TESTSUITE" ] && [ ! "$DPDK" ]; then
77 if [ $CC = "clang" ]; then
78 make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
80 make CFLAGS="$CFLAGS" C=1
83 if [ $TESTSUITE ] && [ $CC != "clang" ]; then
84 if ! make distcheck; then
85 # testsuite.log is necessary for debugging.
86 cat */_build/tests/testsuite.log