@@ -34,10 +34,24 @@ dpdk_check_ok=yes
AC_CHECK_HEADERS([rte_config.h], [],
[dpdk_check_ok=no])
-AC_CHECK_LIB([dpdk], [rte_eal_init], [],
- [dpdk_check_ok=no], [-ldl -lpthread -lnuma])
+DPDK_LIBS=""
+LIBS="$LIBS -ldpdk"
+AS_IF([test "x$DPDK_LIBS" = "x"],
+ [AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])],
+ [DPDK_LIBS="$2 -ldpdk"])])
+LIBS="$LIBS -ldl -lpthread"
+AS_IF([test "x$DPDK_LIBS" = "x"],
+ [AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])],
+ [DPDK_LIBS="$2 -ldpdk -lm -ldl -lpthread"])])
+LIBS="$LIBS -lnuma"
+AS_IF([test "x$DPDK_LIBS" = "x"],
+ [AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])],
+ [DPDK_LIBS="$2 -ldpdk -lm -ldl -lpthread -lnuma"])])
+AS_IF([test "x$DPDK_LIBS" = "x"],
+ [dpdk_check_ok=no])
AS_IF([test "x$dpdk_check_ok" != "xno"],
- [m4_default([$3], [:])],
+ [AC_SUBST([DPDK_LIBS])
+ m4_default([$3], [:])],
[m4_default([$4], [:])])
##########################################################################
@@ -5,9 +5,21 @@ pktio_dpdk_support=no
AC_ARG_WITH([dpdk-path],
[AS_HELP_STRING([--with-dpdk-path=DIR], [path to dpdk build directory])],
[DPDK_PATH="$withval"
+ pktio_dpdk_support=yes],[])
+
+if test "x$DPDK_PATH" = "xsystem" ; then
+ DPDK_CPPFLAGS="-msse4.2 -isystem/usr/include/dpdk"
+ DPDK_LDFLAGS=""
+ DPDK_PMD_PATH="`$CC --print-file-name=librte_pmd_null.a`"
+ DPDK_PMD_PATH="`dirname "$DPDK_PMD_PATH"`"
+ if test "x$DPDK_PMD_PATH" = "x" ; then
+ AC_MSG_FAILURE([Could not locate system DPDK PMD directory])
+ fi
+else
DPDK_CPPFLAGS="-msse4.2 -isystem $DPDK_PATH/include"
DPDK_LDFLAGS="-L$DPDK_PATH/lib"
- pktio_dpdk_support=yes],[])
+ DPDK_PMD_PATH="$DPDK_PATH/lib"
+fi
##########################################################################
# Enable zero-copy DPDK pktio
@@ -30,14 +42,17 @@ then
ODP_DPDK_CHECK([$DPDK_CPPFLAGS], [$DPDK_LDFLAGS], [],
[AC_MSG_FAILURE([can't find DPDK])])
- ODP_DPDK_PMDS([$DPDK_PATH/lib])
+ ODP_DPDK_PMDS([$DPDK_PMD_PATH])
AC_DEFINE([ODP_PKTIO_DPDK], [1],
[Define to 1 to enable DPDK packet I/O support])
AC_DEFINE_UNQUOTED([ODP_DPDK_ZERO_COPY], [$zero_copy],
[Define to 1 to enable DPDK zero copy support])
- DPDK_LIBS="$DPDK_LDFLAGS -ldpdk -lpthread -ldl -lpcap -lm -lnuma"
+ if test -r "$DPDK_PMD_PATH/librte_pmd_pcap.a" &&
+ ! test -r "$DPDK_PMD_PATH/librte_pmd_pcap.so" ; then
+ DPDK_LIBS="$DPDK_LIBS -lpcap"
+ fi
AC_SUBST([DPDK_CPPFLAGS])
AC_SUBST([DPDK_LIBS])
else