From 6ca79b67b41c4055acf3ae953773d0bb0150f3a4 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 17 Aug 2017 13:34:12 +0200 Subject: [PATCH] configure.ac: dpdk: introduce LIBDPDK_CFLAGS This restores the former behavior of LIBDPDK_CPPFLAGS and now correctly carries CFLAGS read from pkg-config in its own variable. Signed-off-by: Christian Ehrhardt --- Makefile.am | 2 ++ configure.ac | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6d286b3c..bac7604a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -783,6 +783,7 @@ if BUILD_PLUGIN_DPDKEVENTS pkglib_LTLIBRARIES += dpdkevents.la dpdkevents_la_SOURCES = src/dpdkevents.c src/utils_dpdk.c src/utils_dpdk.h dpdkevents_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS) +dpdkevents_la_CFLAGS = $(AM_CFLAGS) $(LIBDPDK_CFLAGS) dpdkevents_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS) dpdkevents_la_LIBADD = $(LIBDPDK_LIBS) endif @@ -791,6 +792,7 @@ if BUILD_PLUGIN_DPDKSTAT pkglib_LTLIBRARIES += dpdkstat.la dpdkstat_la_SOURCES = src/dpdkstat.c src/utils_dpdk.c src/utils_dpdk.h dpdkstat_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS) +dpdkstat_la_CFLAGS = $(AM_CFLAGS) $(LIBDPDK_CFLAGS) dpdkstat_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS) dpdkstat_la_LIBADD = $(LIBDPDK_LIBS) endif diff --git a/configure.ac b/configure.ac index cd777746..667e944b 100644 --- a/configure.ac +++ b/configure.ac @@ -2349,6 +2349,7 @@ AC_SUBST(BUILD_WITH_LIBDBI_LIBS) # --with-libdpdk {{{ AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk]) +AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk]) AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk]) AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk]) @@ -2360,12 +2361,8 @@ AC_ARG_WITH([libdpdk], if test "x$with_libdpdk" != "xno"; then PKG_CHECK_MODULES([DPDK], [libdpdk]) - if test "x$LIBDPDK_CPPFLAGS" = "x"; then - if test "x$DPDK_CFLAGS" != "x"; then - LIBDPDK_CPPFLAGS="$DPDK_CFLAGS" - else - LIBDPDK_CPPFLAGS="-I/usr/include/dpdk" - fi + if test "x$LIBDPDK_CFLAGS" = "x"; then + LIBDPDK_CFLAGS="$DPDK_CFLAGS" fi if test "x$LIBDPDK_LIBS" = "x"; then if test "x$DPDK_LIBS" != "x"; then @@ -2374,8 +2371,13 @@ if test "x$with_libdpdk" != "xno"; then LIBDPDK_LIBS="-ldpdk" fi fi + if test "x$LIBDPDK_CPPFLAGS" = "x"; then + LIBDPDK_CPPFLAGS="-I/usr/include/dpdk" + fi SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$LIBDPDK_CFLAGS $CFLAGS" AC_CHECK_HEADERS([rte_config.h], [ with_libdpdk="yes" @@ -2397,6 +2399,7 @@ if test "x$with_libdpdk" != "xno"; then [with_libdpdk="no (rte_config.h not found)"] ) CPPFLAGS="$SAVE_CPPFLAGS" + CFLAGS="$SAVE_CFLAGS" fi if test "x$with_libdpdk" = "xyes"; then -- 2.11.0