X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.ac;h=c4cdf4dd97b4c317cc07d4d197d1b8b7bc4fb89b;hb=419c41409a5c3ba5531008165dff12c6ef5cc819;hp=feed08538de15a5cbfd0721f3ac293b765b38a92;hpb=632cca47086de6cb23c32fc35802da1a19f40875;p=collectd.git diff --git a/configure.ac b/configure.ac index feed0853..c4cdf4dd 100644 --- a/configure.ac +++ b/configure.ac @@ -805,30 +805,10 @@ AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported], # For the turbostat plugin -have_asm_msrindex_h="no" -AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"]) - -if test "x$have_asm_msrindex_h" = "xyes" -then - AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY], - [c_cv_have_usable_asm_msrindex_h], - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[[[ -#include -]]], -[[[ -int y = MSR_PKG_C10_RESIDENCY; -return(y); -]]] - )], - [c_cv_have_usable_asm_msrindex_h="yes"], - [c_cv_have_usable_asm_msrindex_h="no"], - ) - ) -fi - -have_cpuid_h="no" -AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"]) +AC_CHECK_HEADERS([cpuid.h], + [have_cpuid_h="yes"], + [have_cpuid_h="no (cpuid.h not found)"] +) have_capability="yes" AC_CHECK_HEADERS(sys/capability.h, @@ -2699,34 +2679,69 @@ fi # --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]) -AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])]) +AC_ARG_WITH([libdpdk], + [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])], + [with_libdpdk="$withval"], + [with_libdpdk="yes"] +) -if test "x$with_libdpdk" != "xno" -then - if test "x$LIBDPDK_CPPFLAGS" = "x" - then - LIBDPDK_CPPFLAGS="-I/usr/include/dpdk" - fi - SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS" - AC_CHECK_HEADERS([rte_config.h], - [with_libdpdk="yes"], - [with_libdpdk="no (rte_config.h not found)"] - ) - CPPFLAGS="$SAVE_CPPFLAGS" +if test "x$with_libdpdk" != "xno"; then + PKG_CHECK_MODULES([DPDK], [libdpdk], [], + [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])]) + 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 + LIBDPDK_LIBS="$DPDK_LIBS" + else + LIBDPDK_LIBS="-ldpdk" + fi + fi + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$LIBDPDK_CFLAGS $CFLAGS" + AC_CHECK_HEADERS([rte_config.h], + [ + with_libdpdk="yes" + AC_PREPROC_IFELSE( + [ + AC_LANG_SOURCE( + [[ + #include + #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0) + #error "required DPDK >= 16.07" + #endif + ]] + ) + ], + [dpdk_keepalive="yes"], + [dpdk_keepalive="no (DPDK version < 16.07)"] + ) + ], + [with_libdpdk="no (rte_config.h not found)"] + ) + CPPFLAGS="$SAVE_CPPFLAGS" + CFLAGS="$SAVE_CFLAGS" fi -if test "x$with_libdpdk" = "xyes" -then - SAVE_LDFLAGS="$LDFLAGS" - LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS" - AC_CHECK_LIB([dpdk], [rte_eal_init], - [with_libdpdk="yes"], - [with_libdpdk="no (symbol 'rte_eal_init' not found)"] - ) - LDFLAGS="$SAVE_LDFLAGS" +if test "x$with_libdpdk" = "xyes"; then + SAVE_LDFLAGS="$LDFLAGS" + LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS" + AC_CHECK_LIB([dpdk], [rte_eal_init], + [with_libdpdk="yes"], + [with_libdpdk="no (symbol 'rte_eal_init' not found)"] + ) + LDFLAGS="$SAVE_LDFLAGS" fi # }}} @@ -6108,8 +6123,7 @@ then then plugin_ipvs="yes" fi - if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes" - then + if test "x$have_cpuid_h" = "xyes"; then plugin_turbostat="yes" fi