Skip to content

Commit

Permalink
travis: Add dpdk shared library build.
Browse files Browse the repository at this point in the history
Add travis builds for DPDK as a shared library.

Currently the DPDK builds in travis only compile DPDK as a static library.
With static builds in DPDK there is a risk that if a function is not
exported then it will not be supported when DPDK is used as a shared library.
This commit adds the option to build DPDK as a shared library. Also two
build jobs are added to the travis.yml whereby a shared DPDK is built
with both static and shared OVS libraries.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Tiago Lam <tiago.lam@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
istokes authored and ovsrobot committed Jan 16, 2019
1 parent 5bf8428 commit c2af4ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -35,6 +35,8 @@ env:
- BUILD_ENV="-m32" OPTS="--disable-ssl"
- KERNEL=3.16.54 DPDK=1
- KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared"
- KERNEL=3.16.54 DPDK_SHARED=1
- KERNEL=3.16.54 DPDK_SHARED=1 OPTS="--enable-shared"
- KERNEL=4.17.14
- KERNEL=4.16.18
- KERNEL=4.15.18
Expand Down
11 changes: 8 additions & 3 deletions .travis/linux-build.sh
Expand Up @@ -6,6 +6,7 @@ KERNELSRC=""
CFLAGS="-Werror"
SPARSE_FLAGS=""
EXTRA_OPTS=""
TARGET="x86_64-native-linuxapp-gcc"

function install_kernel()
{
Expand Down Expand Up @@ -66,7 +67,11 @@ function install_dpdk()
find ./ -type f | xargs sed -i 's/-Werror/-Werror -Wno-error=inline/'
echo '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
if [ "$DPDK_SHARED" ]; then
sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' config/common_base
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
fi
make config CC=gcc T=$TARGET
make CC=gcc RTE_KERNELDIR=$KERNELSRC
echo "Installed DPDK source in $(pwd)"
cd ..
Expand All @@ -77,11 +82,11 @@ function configure_ovs()
./boot.sh && ./configure $*
}

if [ "$KERNEL" ] || [ "$DPDK" ]; then
if [ "$KERNEL" ] || [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
install_kernel $KERNEL
fi

if [ "$DPDK" ]; then
if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
if [ -z "$DPDK_VER" ]; then
DPDK_VER="18.11"
fi
Expand Down

0 comments on commit c2af4ee

Please sign in to comment.