collectd.spec: add ovs_stats plugin
[collectd.git] / configure.ac
index 2d4e9dc..3b932ca 100644 (file)
@@ -585,14 +585,22 @@ if test "x$ac_system" = "xLinux"; then
   )
 
   if test "x$have_capability" = "xyes"; then
-    AC_CHECK_LIB([cap], [cap_get_bound],
+    AC_CHECK_LIB([cap], [cap_get_proc],
       [have_capability="yes"],
-      [have_capability="no (cap_get_bound() not found)"]
+      [have_capability="no (cap_get_proc() not found)"]
     )
   fi
 
   if test "x$have_capability" = "xyes"; then
-    AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_bound() (-lcap).])
+    AC_CHECK_DECL([CAP_IS_SUPPORTED],
+      [have_capability="yes"],
+      [have_capability="no (CAP_IS_SUPPORTED not found)"],
+      [[#include <sys/capability.h>]]
+    )
+  fi
+
+  if test "x$have_capability" = "xyes"; then
+    AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
   fi
 
 else
@@ -2700,62 +2708,46 @@ AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
 
 AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])])
 
-rte_version_major=""
-rte_version_minor=""
-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],
-               [
+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"
-      AC_RUN_IFELSE(
-        [
-          AC_LANG_PROGRAM(
-            [[
-              #include <rte_version.h>
-            ]],
-            [[
-              return (RTE_VER_YEAR & 0xFF)
-            ]]
-          )
-        ],
-        [rte_version_major=0],
-        [rte_version_major=$?]
-      )
-      AC_RUN_IFELSE(
+      AC_COMPILE_IFELSE(
         [
           AC_LANG_PROGRAM(
             [[
               #include <rte_version.h>
+              #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
+              #error "required DPDK >= 16.07"
+              #endif
             ]],
             [[
-              return (RTE_VER_MONTH & 0xFF)
+              return 0;
             ]]
           )
         ],
-        [rte_version_minor=0],
-        [rte_version_minor=$?]
+        [dpdk_keepalive="yes"],
+        [dpdk_keepalive="no (DPDK version < 16.07)"]
       )
     ],
-               [with_libdpdk="no (rte_config.h not found)"]
-       )
-       CPPFLAGS="$SAVE_CPPFLAGS"
+    [with_libdpdk="no (rte_config.h not found)"]
+  )
+  CPPFLAGS="$SAVE_CPPFLAGS"
 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
 
 # }}}
@@ -5218,6 +5210,11 @@ if test "x$with_libupsclient" = "xyes"; then
     [with_libupsclient="no (symbol upscli_connect not found)"]
   )
 
+  AC_CHECK_LIB([upsclient], [upscli_init],
+    [AC_DEFINE([WITH_UPSCLIENT_27], [1], [At least version 2-7])],
+    []
+  )
+
   LDFLAGS="$SAVE_LDFLAGS"
 fi
 
@@ -5936,6 +5933,7 @@ plugin_multimeter="no"
 plugin_nfs="no"
 plugin_numa="no"
 plugin_ovs_events="no"
+plugin_ovs_stats="no"
 plugin_perl="no"
 plugin_pinba="no"
 plugin_processes="no"
@@ -6185,6 +6183,7 @@ fi
 
 if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
   plugin_ovs_events="yes"
+  plugin_ovs_stats="yes"
 fi
 
 if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then
@@ -6264,14 +6263,7 @@ fi
 
 if test "x$with_libdpdk" = "xyes"
 then
-  plugin_dpdkevents="no (DPDK version < 16.07)"
-  if test $rte_version_major -eq 16
-  then
-    if test $rte_version_minor -ge 7
-    then
-    plugin_dpdkevents="yes"
-    fi
-  fi
+  plugin_dpdkevents="$dpdk_keepalive"
   plugin_dpdkstat="yes"
 fi
 
@@ -6383,6 +6375,7 @@ AC_PLUGIN([openldap],            [$with_libldap],           [OpenLDAP statistics
 AC_PLUGIN([openvpn],             [yes],                     [OpenVPN client statistics])
 AC_PLUGIN([oracle],              [$with_oracle],            [Oracle plugin])
 AC_PLUGIN([ovs_events],          [$plugin_ovs_events],      [OVS events plugin])
+AC_PLUGIN([ovs_stats],           [$plugin_ovs_stats],       [OVS statistics plugin])
 AC_PLUGIN([perl],                [$plugin_perl],            [Embed a Perl interpreter])
 AC_PLUGIN([pf],                  [$have_net_pfvar_h],       [BSD packet filter (PF) statistics])
 # FIXME: Check for libevent, too.
@@ -6809,6 +6802,7 @@ AC_MSG_RESULT([    openldap  . . . . . . $enable_openldap])
 AC_MSG_RESULT([    openvpn . . . . . . . $enable_openvpn])
 AC_MSG_RESULT([    oracle  . . . . . . . $enable_oracle])
 AC_MSG_RESULT([    ovs_events  . . . . . $enable_ovs_events])
+AC_MSG_RESULT([    ovs_stats . . . . . . $enable_ovs_stats])
 AC_MSG_RESULT([    perl  . . . . . . . . $enable_perl])
 AC_MSG_RESULT([    pf  . . . . . . . . . $enable_pf])
 AC_MSG_RESULT([    pinba . . . . . . . . $enable_pinba])