@@ -210,7 +210,6 @@ AC_SUBST([testdir])
# Set conditionals as computed within platform specific files
##########################################################################
AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ])
-AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ])
AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])
AM_CONDITIONAL([SDK_INSTALL_PATH_], [test "x${SDK_INSTALL_PATH_}" = "x1"])
AM_CONDITIONAL([test_installdir], [test "$testdir" != ""])
@@ -6,6 +6,6 @@ includedir=@includedir@
Name: libodp-linux
Description: The ODP packet processing engine
Version: @PKGCONFIG_VERSION@
-Libs: -L${libdir} -lodp-linux
-Libs.private: @OPENSSL_STATIC_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
+Libs: -L${libdir} -lodp-linux @DPDK_LIBS@
+Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
Cflags: -I${includedir}
@@ -12,6 +12,7 @@ AM_CFLAGS += -Iinclude
AM_CFLAGS += -D_ODP_PKTIO_IPC
AM_CPPFLAGS += $(OPENSSL_CPPFLAGS)
+AM_CPPFLAGS += $(DPDK_CPPFLAGS)
include_HEADERS = \
$(top_srcdir)/include/odp.h \
@@ -257,6 +258,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)
# Create symlink for ABI header files. Application does not need to use the arch
# specific include path for installed files.
@@ -4,15 +4,15 @@
pktio_dpdk_support=no
AC_ARG_WITH([dpdk-path],
AC_HELP_STRING([--with-dpdk-path=DIR path to dpdk build directory]),
- [DPDK_PATH=$withval
- AM_CPPFLAGS="$AM_CPPFLAGS -msse4.2 -isystem $DPDK_PATH/include"
+ [DPDK_PATH="$withval"
+ DPDK_CPPFLAGS="-msse4.2 -isystem $DPDK_PATH/include"
pktio_dpdk_support=yes],[])
##########################################################################
# Save and set temporary compilation flags
##########################################################################
-OLD_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
+OLD_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$DPDK_CPPFLAGS $CPPFLAGS"
##########################################################################
# Check for DPDK availability
@@ -25,22 +25,23 @@ then
AC_CHECK_HEADERS([rte_config.h], [],
[AC_MSG_FAILURE(["can't find DPDK header"])])
- DPDK_PMD=--whole-archive,
- for filename in $with_dpdk_path/lib/*.a; do
- cur_driver=`echo $(basename "$filename" .a) | \
- sed -n 's/^\(librte_pmd_\)/-lrte_pmd_/p' | sed -n 's/$/,/p'`
+ AS_VAR_SET([DPDK_PMDS], [-Wl,--whole-archive,])
+ for filename in "$DPDK_PATH"/lib/librte_pmd_*.a; do
+ cur_driver=`basename "$filename" .a | sed -e 's/^lib//'`
# rte_pmd_nfp has external dependencies which break linking
- if test "$cur_driver" = "-lrte_pmd_nfp,"; then
+ if test "$cur_driver" = "rte_pmd_nfp"; then
echo "skip linking rte_pmd_nfp"
else
- DPDK_PMD+=$cur_driver
+ AS_VAR_APPEND([DPDK_PMDS], [-l$cur_driver,])
fi
done
- DPDK_PMD+=--no-whole-archive
+ AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive])
ODP_CFLAGS="$ODP_CFLAGS -DODP_PKTIO_DPDK"
- AM_LDFLAGS="$AM_LDFLAGS -L$DPDK_PATH/lib -Wl,$DPDK_PMD"
- LIBS="$LIBS -ldpdk -ldl -lpcap"
+ DPDK_LIBS="-L$DPDK_PATH/lib -ldpdk -lpthread -ldl -lpcap"
+ AC_SUBST([DPDK_CPPFLAGS])
+ AC_SUBST([DPDK_LIBS])
+ AC_SUBST([DPDK_PMDS])
else
pktio_dpdk_support=no
fi
@@ -49,3 +50,5 @@ fi
# Restore old saved variables
##########################################################################
CPPFLAGS=$OLD_CPPFLAGS
+
+AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ])
@@ -4,7 +4,7 @@ LIB = $(top_builddir)/lib
#in the following line, the libs using the symbols should come before
#the libs containing them! The includer is given a chance to add things
#before libodp by setting PRE_LDADD before the inclusion.
-LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
+LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS)
INCFLAGS = \
-I$(top_builddir)/platform/@with_platform@/include \
@@ -9,6 +9,7 @@ AUTOMAKE_OPTIONS = nostdinc
AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common
AM_LDFLAGS += -static
+AM_LDFLAGS += $(DPDK_PMDS)
LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la
LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la
@@ -6,7 +6,7 @@ AM_LDFLAGS += -static
LIBCUNIT_COMMON = $(top_builddir)/test/common_plat/common/libcunit_common.la
LIB = $(top_builddir)/lib
-LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
+LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS)
INCCUNIT_COMMON = -I$(top_srcdir)/test/common_plat/common
INCODP = \