configure.ac: dpdk: append DPDK_CFLAGS to LIBDPDK_CPPFLAGS
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Thu, 17 Aug 2017 13:01:27 +0000 (15:01 +0200)
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>
Thu, 17 Aug 2017 13:01:27 +0000 (15:01 +0200)
In some way it is bad naming in pkg-config - it is always some sort of
conflated ldflags + libs and cppflags + cxxflags + cflags.
Due to that to work correctly we append DPDK_CFLAGS (if defined by
pkg-config) to LIBDPDK_CPPFLAGS as well.
This intentionally does not add those CFLAGS specified by a user to
allow full override and fully separated CLFAGS/CPPFLAGS if needed.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
configure.ac

index 667e944..13e6340 100644 (file)
@@ -2361,8 +2361,12 @@ AC_ARG_WITH([libdpdk],
 
 if test "x$with_libdpdk" != "xno"; then
   PKG_CHECK_MODULES([DPDK], [libdpdk])
+  if test "x$LIBDPDK_CPPFLAGS" = "x"; then
+    LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
+  fi
   if test "x$LIBDPDK_CFLAGS" = "x"; then
       LIBDPDK_CFLAGS="$DPDK_CFLAGS"
+      LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
   fi
   if test "x$LIBDPDK_LIBS" = "x"; then
       if test "x$DPDK_LIBS" != "x"; then
@@ -2371,9 +2375,6 @@ 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"