diff options
author | Matias Elo <matias.elo@nokia.com> | 2021-01-28 15:41:39 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-02-12 10:34:29 +0200 |
commit | 17c1a5e283abb33fec380f6519be082d2b2b1b33 (patch) | |
tree | 15c05ce6f7d17e4a2d720481d7e8d8132108c8aa | |
parent | a75e60d9e79f3c6c65082baa150b7378ba3a21fc (diff) |
m4: odp_dpdk: fix pkg-config build dpdk v20.11
Enable building ODP-DPDK with the latest DPDK LTS release v20.11.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
-rw-r--r-- | m4/odp_dpdk.m4 | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index a3b57eff8..69ebb9c77 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -190,13 +190,23 @@ PKG_CONFIG=$_save_PKG_CONFIG[]dnl # ----------------------------------------------------------------------- # Configure DPDK using pkg-config information AC_DEFUN([_ODP_DPDK_PKGCONFIG], [dnl -PKG_CHECK_MODULES_STATIC([DPDK_STATIC], [libdpdk]) DPDK_PKG=", libdpdk" AC_SUBST([DPDK_PKG]) -# applications don't need to be linked to anything, just rpath -DPDK_LIBS_LT="" -# FIXME: this might need to be changed to DPDK_LIBS_STATIC -DPDK_LIBS_LIBODP="$DPDK_LIBS" + +# Check if linking against static DPDK lib +echo "$DPDK_LIBS" | grep -q 'librte_eal.a' +status=$? +if test $status -eq 0 ; then + # Build long list of libraries for applications, which should not be + # rearranged by libtool + DPDK_LIBS_LIBODP=$(echo "$DPDK_LIBS" | sed -e 's/ /,/g' | sed 's/-Wl,//g') + DPDK_LIBS_LIBODP=$(echo "$DPDK_LIBS_LIBODP" | sed 's/-pthread/-lpthread/g') + DPDK_LIBS_LIBODP="-Wl,$DPDK_LIBS_LIBODP" + DPDK_LIBS_LT="$DPDK_LIBS_LIBODP" +else + DPDK_LIBS_LIBODP="$DPDK_LIBS" + DPDK_LIBS_LT="" +fi DPDK_LIBS="" ]) @@ -205,7 +215,7 @@ DPDK_LIBS="" # Check for DPDK availability AC_DEFUN([ODP_DPDK], [dnl AS_IF([test "x$1" = "xsystem"], - [PKG_CHECK_MODULES([DPDK], [libdpdk], + [PKG_CHECK_MODULES_STATIC([DPDK], [libdpdk], [AC_MSG_NOTICE([Using DPDK detected via pkg-config]) _ODP_DPDK_PKGCONFIG m4_default([$2], [:])], |