.gitignore: Add src/*.pb-c.[ch]
[collectd.git] / configure.in
index 9d30290..6f1cc59 100644 (file)
@@ -49,6 +49,13 @@ AC_PROG_YACC
 PKG_PROG_PKG_CONFIG
 
 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
+AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
+                 [have_protobuf_c_h="yes"],
+                 [have_protobuf_c_h="no"])
+if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
+then
+       have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
+fi
 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
 
 AC_MSG_CHECKING([for kernel type ($host_os)])
@@ -770,17 +777,17 @@ if test "x$have_swapctl" = "xyes"; then
         AC_CACHE_CHECK([whether swapctl takes two arguments],
                 [c_cv_have_swapctl_two_args],
                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-                                   [[
-AC_INCLUDES_DEFAULT
+[[
 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #  undef _FILE_OFFSET_BITS
 #  undef _LARGEFILE64_SOURCE
 #endif
 #include <sys/stat.h>
-#include <sys/swap.h>]],
-                                [[[
-                                int num = swapctl(0, NULL);
-                                ]]]
+#include <sys/swap.h>
+]],
+[[
+int num = swapctl(0, NULL);
+]]
                         )],
                         [c_cv_have_swapctl_two_args="yes"],
                         [c_cv_have_swapctl_two_args="no"]
@@ -789,16 +796,18 @@ AC_INCLUDES_DEFAULT
         AC_CACHE_CHECK([whether swapctl takes three arguments],
                 [c_cv_have_swapctl_three_args],
                 AC_COMPILE_IFELSE(
-                        [AC_LANG_PROGRAM([[[AC_INCLUDES_DEFAULT
+                        [AC_LANG_PROGRAM(
+[[
 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #  undef _FILE_OFFSET_BITS
 #  undef _LARGEFILE64_SOURCE
 #endif
 #include <sys/stat.h>
-#include <sys/swap.h>]]],
-                                [[[
-                                int num = swapctl(0, NULL,0);
-                                ]]]
+#include <sys/swap.h>
+]],
+[[
+int num = swapctl(0, NULL, 0);
+]]
                         )],
                         [c_cv_have_swapctl_three_args="yes"],
                         [c_cv_have_swapctl_three_args="no"]
@@ -1131,14 +1140,16 @@ if test "x$have_getmntent" = "xc"; then
        AC_CACHE_CHECK([whether getmntent takes one argument],
                [c_cv_have_one_getmntent],
                AC_COMPILE_IFELSE(
-                       [AC_LANG_PROGRAM([[[AC_INCLUDES_DEFAULT
-#include "$srcdir/src/utils_mount.h"]]],
-                               [[[
-                                FILE *fh;
-                                struct mntent *me;
-                                fh = setmntent ("/etc/mtab", "r");
-                                me = getmntent (fh);
-                               ]]]
+                       [AC_LANG_PROGRAM(
+[[
+#include "$srcdir/src/utils_mount.h"
+]],
+[[
+FILE *fh;
+struct mntent *me;
+fh = setmntent ("/etc/mtab", "r");
+me = getmntent (fh);
+]]
                        )],
                        [c_cv_have_one_getmntent="yes"],
                        [c_cv_have_one_getmntent="no"]
@@ -1147,15 +1158,17 @@ if test "x$have_getmntent" = "xc"; then
        AC_CACHE_CHECK([whether getmntent takes two arguments],
                [c_cv_have_two_getmntent],
                AC_COMPILE_IFELSE(
-                       [AC_LANG_PROGRAM([[[AC_INCLUDES_DEFAULT
-#include "$srcdir/src/utils_mount.h"]]],
-                               [[[
+                       [AC_LANG_PROGRAM(
+[[
+#include "$srcdir/src/utils_mount.h"
+]],
+[[
                                 FILE *fh;
                                 struct mnttab mt;
                                 int status;
                                 fh = fopen ("/etc/mnttab", "r");
                                 status = getmntent (fh, &mt);
-                               ]]]
+]]
                        )],
                        [c_cv_have_two_getmntent="yes"],
                        [c_cv_have_two_getmntent="no"]
@@ -1245,7 +1258,6 @@ AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct
                have_struct_kinfo_proc_freebsd="no"
        ],
        [
-AC_INCLUDES_DEFAULT
 #include <kvm.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -1262,7 +1274,6 @@ AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
                have_struct_kinfo_proc_openbsd="no"
        ],
        [
-AC_INCLUDES_DEFAULT
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <kvm.h>
@@ -2486,35 +2497,36 @@ then
 #include <sys/socket.h>])
 
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-                           [[[
-                            #include <stdio.h>
-                            #include <sys/types.h>
-                            #include <asm/types.h>
-                            #include <sys/socket.h>
-                            #include <linux/netlink.h>
-                            #include <linux/rtnetlink.h>
-                            ]]], [[[
-                                int retval = TCA_STATS2;
-                                return (retval);
-                                ]]]
-                            )],
-                            [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
+[[
+#include <stdio.h>
+#include <sys/types.h>
+#include <asm/types.h>
+#include <sys/socket.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+]],
+[[
+int retval = TCA_STATS2;
+return (retval);
+]]
+       )],
+       [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[[#include <stdio.h>
+[[
+#include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
-]]], [[[
-int main (void)
-{
-       int retval = TCA_STATS;
-       return (retval);
-}]]])],
-       [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
-       []);
+]],
+[[
+int retval = TCA_STATS;
+return (retval);
+]]
+       )],
+       [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
 
        CFLAGS="$SAVE_CFLAGS"
 fi
@@ -2534,8 +2546,9 @@ then
                [if function 'rtnl_dump_filter' expects five arguments],
                [c_cv_rtnl_dump_filter_five_args],
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-                                   [[[
-AC_INCLUDES_DEFAULT
+[[
+#include <stdio.h>
+#include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #if HAVE_LIBNETLINK_H
@@ -2545,23 +2558,25 @@ AC_INCLUDES_DEFAULT
 #elif HAVE_LINUX_LIBNETLINK_H
 # include <linux/libnetlink.h>
 #endif
-                               ]]], [[[
+]],
+[[
 if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL))
        return 1;
 return 0;
-                               ]]]
-                       )],
-                       [c_cv_rtnl_dump_filter_five_args="yes"],
-                       [c_cv_rtnl_dump_filter_five_args="no"]
-               )
+]]
+       )],
+       [c_cv_rtnl_dump_filter_five_args="yes"],
+       [c_cv_rtnl_dump_filter_five_args="no"]
        )
+)
 
        AC_CACHE_CHECK(
                [if function 'rtnl_dump_filter' expects three arguments],
                [c_cv_rtnl_dump_filter_three_args],
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-                               [[[
-AC_INCLUDES_DEFAULT
+[[
+#include <stdio.h>
+#include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #if HAVE_LIBNETLINK_H
@@ -2571,16 +2586,17 @@ AC_INCLUDES_DEFAULT
 #elif HAVE_LINUX_LIBNETLINK_H
 # include <linux/libnetlink.h>
 #endif
-                               ]]], [[[
+]],
+[[
 if (rtnl_dump_filter(NULL, NULL, NULL))
        return 1;
 return 0;
-                               ]]]
-                       )],
-                       [c_cv_rtnl_dump_filter_three_args="yes"],
-                       [c_cv_rtnl_dump_filter_three_args="no"]
-               )
+]]
+       )],
+       [c_cv_rtnl_dump_filter_three_args="yes"],
+       [c_cv_rtnl_dump_filter_three_args="no"]
        )
+)
 
        CFLAGS="$SAVE_CFLAGS"
 
@@ -4938,7 +4954,7 @@ AC_PLUGIN([oracle],      [$with_oracle],       [Oracle 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.
-AC_PLUGIN([pinba],       [$have_protoc_c],     [Pinba statistics])
+AC_PLUGIN([pinba],       [$have_protobuf_c_h], [Pinba statistics])
 AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
 AC_PLUGIN([postgresql],  [$with_libpq],        [PostgreSQL database statistics])
 AC_PLUGIN([powerdns],    [yes],                [PowerDNS statistics])
@@ -4956,6 +4972,7 @@ AC_PLUGIN([swap],        [$plugin_swap],       [Swap usage statistics])
 AC_PLUGIN([syslog],      [$have_syslog],       [Syslog logging plugin])
 AC_PLUGIN([table],       [yes],                [Parsing of tabular data])
 AC_PLUGIN([tail],        [yes],                [Parsing of logfiles])
+AC_PLUGIN([tail_csv],    [yes],                [Parsing of CSV files])
 AC_PLUGIN([tape],        [$plugin_tape],       [Tape drive statistics])
 AC_PLUGIN([target_notification], [yes],        [The notification target])
 AC_PLUGIN([target_replace], [yes],             [The replace target])
@@ -4980,7 +4997,7 @@ AC_PLUGIN([write_graphite], [yes],             [Graphite / Carbon output plugin]
 AC_PLUGIN([write_http],  [$with_libcurl],      [HTTP output plugin])
 AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
 AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
-AC_PLUGIN([write_riemann], [$have_protoc_c],   [Riemann output plugin])
+AC_PLUGIN([write_riemann], [$have_protobuf_c_h], [Riemann output plugin])
 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
 AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
 
@@ -5290,6 +5307,7 @@ Configuration:
     syslog  . . . . . . . $enable_syslog
     table . . . . . . . . $enable_table
     tail  . . . . . . . . $enable_tail
+    tail_csv  . . . . . . $enable_tail_csv
     tape  . . . . . . . . $enable_tape
     target_notification . $enable_target_notification
     target_replace  . . . $enable_target_replace