summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d79874)
raw | patch | inline | side by side (parent: 6d79874)
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | |
Wed, 16 Aug 2017 12:31:48 +0000 (14:31 +0200) | ||
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | |
Thu, 17 Aug 2017 09:54:34 +0000 (11:54 +0200) |
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
This closes #2399
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
This closes #2399
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Makefile.am | patch | blob | history | |
configure.ac | patch | blob | history |
diff --git a/Makefile.am b/Makefile.am
index 0ef9e31da57ef98dfc6699cdc3d4bc5511040982..6d286b3c9231cb583c80fce54032b6dec94aa855 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
dpdkevents_la_SOURCES = src/dpdkevents.c src/utils_dpdk.c src/utils_dpdk.h
dpdkevents_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS)
dpdkevents_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS)
-dpdkevents_la_LIBADD = -ldpdk
+dpdkevents_la_LIBADD = $(LIBDPDK_LIBS)
endif
if BUILD_PLUGIN_DPDKSTAT
dpdkstat_la_SOURCES = src/dpdkstat.c src/utils_dpdk.c src/utils_dpdk.h
dpdkstat_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS)
dpdkstat_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS)
-dpdkstat_la_LIBADD = -ldpdk
+dpdkstat_la_LIBADD = $(LIBDPDK_LIBS)
endif
if BUILD_PLUGIN_DRBD
diff --git a/configure.ac b/configure.ac
index 62bea50e6c125d5a60d87d032641747a6123788e..cd777746212ea569d635199619db088c0c613d7f 100644 (file)
--- a/configure.ac
+++ b/configure.ac
# --with-libdpdk {{{
AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
+AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
AC_ARG_WITH([libdpdk],
[AS_HELP_STRING([--without-libdpdk], [Disable 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"
+ if test "x$DPDK_CFLAGS" != "x"; then
+ LIBDPDK_CPPFLAGS="$DPDK_CFLAGS"
+ else
+ LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
+ fi
+ fi
+ if test "x$LIBDPDK_LIBS" = "x"; then
+ if test "x$DPDK_LIBS" != "x"; then
+ LIBDPDK_LIBS="$DPDK_LIBS"
+ else
+ LIBDPDK_LIBS="-ldpdk"
+ fi
fi
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"