net/vpp: allow to compile with vpp

This patch prepares environment to allow compile applications and
libraries with VPP.

Change-Id: Icc067c17b57932062afa5e6a67791bd58de3a2cc
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456461
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Tomasz Kulasek 2018-09-26 03:57:32 -04:00 committed by Ben Walker
parent a44c743417
commit 14a62d67ac
3 changed files with 22 additions and 4 deletions

12
configure vendored
View File

@ -520,6 +520,18 @@ if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
fi
fi
if [[ "${CONFIG[VPP]}" = "y" ]]; then
if [ ! -z "${CONFIG[VPP_DIR]}" ]; then
VPP_CFLAGS="-L${CONFIG[VPP_DIR]}/lib -I${CONFIG[VPP_DIR]}/include"
fi
if ! echo -e '#include <vnet/session/application_interface.h>\nint main(void) { return 0; }\n' \
| $BUILD_CMD ${VPP_CFLAGS} -lvppinfra -lsvm -lvlibmemoryclient - 2>/dev/null; then
echo --with-vpp requires installed vpp.
echo Please install then re-run this script.
exit 1
fi
fi
if [[ "${CONFIG[RBD]}" = "y" ]]; then
if ! echo -e '#include <rbd/librbd.h>\n#include <rados/librados.h>\n' \
'int main(void) { return 0; }\n' \

View File

@ -91,11 +91,9 @@ SOCK_MODULES_LIST = sock_posix
ifeq ($(CONFIG_VPP),y)
SYS_LIBS += -Wl,--whole-archive
ifneq ($(CONFIG_VPP_DIR),)
SYS_LIBS += -l:libvppinfra.a -l:libsvm.a -l:libvapiclient.a
SYS_LIBS += -l:libvppcom.a -l:libvlibmemoryclient.a
else
SYS_LIBS += -lvppcom
SYS_LIBS += -L$(CONFIG_VPP_DIR)/lib
endif
SYS_LIBS += -lvppinfra -lsvm -lvlibmemoryclient
SYS_LIBS += -Wl,--no-whole-archive
SOCK_MODULES_LIST += sock_vpp
endif

View File

@ -51,6 +51,7 @@ export RUN_NIGHTLY_FAILING
: ${SPDK_TEST_LVOL=0}; export SPDK_TEST_LVOL
: ${SPDK_TEST_JSON=0}; export SPDK_TEST_JSON
: ${SPDK_TEST_REDUCE=0}; export SPDK_TEST_REDUCE
: ${SPDK_TEST_VPP=0}; export SPDK_TEST_VPP
: ${SPDK_RUN_ASAN=0}; export SPDK_RUN_ASAN
: ${SPDK_RUN_UBSAN=0}; export SPDK_RUN_UBSAN
: ${SPDK_RUN_INSTALLED_DPDK=0}; export SPDK_RUN_INSTALLED_DPDK
@ -175,6 +176,13 @@ if [ -d /usr/include/rbd ] && [ -d /usr/include/rados ] && [ $SPDK_TEST_RBD -eq
fi
fi
if [ $SPDK_TEST_VPP -eq 1 ]; then
VPP_PATH="/usr/local/src/vpp/build-root/install-vpp_debug-native/vpp/"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${VPP_PATH}/lib/
export PATH=${PATH}:${VPP_PATH}/bin/
config_params+=" --with-vpp=${VPP_PATH}"
fi
# for options with no required dependencies, just test flags, set them here
if [ $SPDK_TEST_CRYPTO -eq 1 ]; then
config_params+=' --with-crypto'