@@ -13,6 +13,9 @@ else
fi
done
AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive])
+# Hack to circumvent libtool to pass -ldpdk after all PMDS to gcc
+# Otherwise it reorders linking flags and ends up with -ldpdk before all PMDs
+AS_VAR_APPEND([DPDK_PMDS], [" "-Wc,-ldpdk])
AC_SUBST([DPDK_PMDS])
])
@@ -306,7 +306,7 @@ endif
__LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS)
__LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS)
-__LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS) $(DPDK_PMDS)
+__LIB__libodp_linux_la_LIBADD += $(DPDK_PMDS) $(DPDK_LIBS)
__LIB__libodp_linux_la_LIBADD += $(PTHREAD_LIBS)
__LIB__libodp_linux_la_LIBADD += $(TIMER_LIBS)
@@ -13,16 +13,29 @@ AC_ARG_WITH([dpdk-path],
[DPDK_PATH="$withval"
pktio_dpdk_support=yes],[])
-AS_IF([test "x$DPDK_PATH" = "xsystem"],
- [DPDK_CPPFLAGS="-isystem/usr/include/dpdk"
- DPDK_LDFLAGS=""
- DPDK_PMD_PATH="`$CC --print-file-name=librte_pmd_null.a`"
- DPDK_PMD_PATH="`dirname "$DPDK_PMD_PATH"`"
- AS_IF([test "x$DPDK_PMD_PATH" = "x"],
- [AC_MSG_FAILURE([Could not locate system DPDK PMD directory])])],
- [DPDK_CPPFLAGS="-isystem $DPDK_PATH/include"
- DPDK_LDFLAGS="-L$DPDK_PATH/lib"
- DPDK_PMD_PATH="$DPDK_PATH/lib"])
+if test "x$DPDK_PATH" = "xsystem"; then
+ DPDK_CPPFLAGS="-isystem/usr/include/dpdk"
+ DPDK_LDFLAGS=""
+ DPDK_RPATH=""
+ DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.so`"
+ if test "x$DPDK_LIB_PATH" = "x" ; then
+ DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.a`"
+ else
+ DPDK_SHARED=yes
+ fi
+ AS_IF([test "x$DPDK_LIB_PATH" = "x"],
+ [AC_MSG_FAILURE([Could not locate system DPDK library directory])])
+ DPDK_PMD_PATH=`AS_DIRNAME(["$DPDK_PMD_PATH"])`
+else
+ DPDK_CPPFLAGS="-isystem $DPDK_PATH/include"
+ DPDK_LIB_PATH="$DPDK_PATH/lib"
+ DPDK_LDFLAGS="-L$DPDK_LIB_PATH"
+ DPDK_RPATH="-R$DPDK_LIB_PATH"
+ DPDK_PMD_PATH="$DPDK_LIB_PATH"
+ if test -r "$DPDK_LIB_PATH"/libdpdk.so ; then
+ DPDK_SHARED=yes
+ fi
+fi
##########################################################################
# Enable zero-copy DPDK pktio
@@ -45,7 +58,9 @@ then
ODP_DPDK_CHECK([$DPDK_CPPFLAGS], [$DPDK_LDFLAGS], [],
[AC_MSG_FAILURE([can't find DPDK])])
- ODP_DPDK_PMDS([$DPDK_PMD_PATH])
+ if test x$DPDK_SHARED != xyes ; then
+ ODP_DPDK_PMDS([$DPDK_PMD_PATH])
+ fi
AC_DEFINE([ODP_PKTIO_DPDK], [1],
[Define to 1 to enable DPDK packet I/O support])