mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
These changes allow for the building of shared libraries by providing the --enable-shared option to configure. In particular, lib/libopenvwitch.so, lib/libsflow.so, ofproto/libofproto.so, and ovsdb/libovsdb.so will be built. Original behavior of building static remains the same. Additionally, versioning is introduced to each of the libraries objects paving the way for APIs to be built around them. A detailed comment outlining the rules for changing a version number is provided in configure.ac. Note that at this time, the version number is set to 1.0.0, no API is specified yet, and there are no requirements to maintain any sort of compatibility in any of the libraries. Signed-off-by: Scott Mann <smann@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
71 lines
1.8 KiB
Bash
Executable File
71 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o errexit
|
|
|
|
KERNELSRC=""
|
|
CFLAGS="-Werror"
|
|
|
|
function install_kernel()
|
|
{
|
|
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.2.tar.gz
|
|
tar xzvf linux-3.16.2.tar.gz > /dev/null
|
|
cd linux-3.16.2
|
|
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.1.tar.gz
|
|
tar xzvf dpdk-1.7.1.tar.gz > /dev/null
|
|
cd dpdk-1.7.1
|
|
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
|
|
sed -ri '/CONFIG_RTE_LIBNAME/a CONFIG_RTE_BUILD_FPIC=y' config/common_linuxapp
|
|
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
|
|
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
|
|
|
|
if [ "$DPDK" ]; then
|
|
install_dpdk
|
|
# Disregard bad function cassts until DPDK is fixed
|
|
CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
|
|
elif [ $CC != "clang" ]; then
|
|
# DPDK headers currently trigger sparse errors
|
|
CFLAGS="$CFLAGS -Wsparse-error"
|
|
fi
|
|
|
|
configure_ovs $*
|
|
|
|
|
|
if [ $CC = "clang" ]; then
|
|
make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
|
|
else
|
|
make CFLAGS="$CFLAGS" C=1
|
|
fi
|
|
|
|
if [ $TESTSUITE ]; then
|
|
if ! make distcheck; then
|
|
# testsuite.log is necessary for debugging.
|
|
cat */_build/tests/testsuite.log
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
exit 0
|