From dcddb48f386aea329fcd68e4ff677ab7ccbf2611 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 3 Dec 2018 15:56:13 +0000 Subject: [PATCH] configure.ac: run dpdk build tests only if pkgconfig fails The AC_CHECK_LIB test runs unconditionally, and fails with DPDK 18.11 when built with Meson as there is no longer a libdpdk.so linker script, but only a pkg-config file, so -ldpdk (which is what AC_CHECK_LIB runs) fails. Use AC_LINK_IFELSE instead, with compiler and linker flags set appropriately. Signed-off-by: Luca Boccassi --- configure.ac | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 83e6dc17..2ffa7179 100644 --- a/configure.ac +++ b/configure.ac @@ -2465,13 +2465,30 @@ if test "x$with_libdpdk" != "xno"; then fi if test "x$with_libdpdk" = "xyes"; then + SAVE_LIBS="$LIBS" + LIBS="$LIBDPDK_LIBS $LIBS" SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS" - AC_CHECK_LIB([dpdk], [rte_eal_init], + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$LIBDPDK_CFLAGS $CFLAGS" + AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM( + [[ + #include + ]], + [[return rte_eal_init(0, NULL);]] + ) + ], [with_libdpdk="yes"], [with_libdpdk="no (symbol 'rte_eal_init' not found)"] ) + LIBS="$SAVE_LIBS" LDFLAGS="$SAVE_LDFLAGS" + CPPFLAGS="$SAVE_CPPFLAGS" + CFLAGS="$SAVE_CFLAGS" fi # }}} -- 2.11.0