- yes)
- DPDK_AUTO_DISCOVER="true"
- PKG_CHECK_MODULES_STATIC([DPDK], [libdpdk], [
- DPDK_INCLUDE="$DPDK_CFLAGS"
- DPDK_LIB="$DPDK_LIBS"], [
- DPDK_INCLUDE="-I/usr/local/include/dpdk -I/usr/include/dpdk"
- DPDK_LIB="-ldpdk"])
- ;;
- *)
- DPDK_AUTO_DISCOVER="false"
- DPDK_INCLUDE_PATH="$with_dpdk/include"
- # If 'with_dpdk' is passed install directory, point to headers
- # installed in $DESTDIR/$prefix/include/dpdk
- if test -e "$DPDK_INCLUDE_PATH/rte_config.h"; then
- DPDK_INCLUDE="-I$DPDK_INCLUDE_PATH"
- elif test -e "$DPDK_INCLUDE_PATH/dpdk/rte_config.h"; then
- DPDK_INCLUDE="-I$DPDK_INCLUDE_PATH/dpdk"
- fi
- DPDK_LIB_DIR="$with_dpdk/lib"
- DPDK_LIB="-ldpdk"
- ;;
+ "shared")
+ PKG_CHECK_MODULES([DPDK], [libdpdk], [
+ DPDK_INCLUDE="$DPDK_CFLAGS"
+ DPDK_LIB="$DPDK_LIBS"])
+ ;;
+ "static" | "yes")
+ PKG_CHECK_MODULES_STATIC([DPDK], [libdpdk], [
+ DPDK_INCLUDE="$DPDK_CFLAGS"
+ DPDK_LIB="$DPDK_LIBS"])
+
+ dnl Statically linked private DPDK objects of form
+ dnl -l:file.a must be positioned between
+ dnl --whole-archive ... --no-whole-archive linker parameters.
+ dnl Old pkg-config versions misplace --no-whole-archive parameter
+ dnl and put it next to --whole-archive.
+ AC_MSG_CHECKING([for faulty pkg-config version])
+ echo "$DPDK_LIB" | grep -q 'whole-archive.*l:lib.*no-whole-archive'
+ status=$?
+ case $status in
+ 0)
+ AC_MSG_RESULT([no])
+ ;;
+ 1)
+ AC_MSG_RESULT([yes])
+ AC_MSG_ERROR([Please upgrade pkg-config])
+ ;;
+ *)
+ AC_MSG_ERROR([grep exited with status $status])
+ ;;
+ esac