1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
6 m4_ifdef([LT_PACKAGE_VERSION],
9 LT_CONFIG_LTDL_DIR([libltdl])
11 LTDL_INIT([convenience])
16 AC_LIBLTDL_CONVENIENCE
20 AC_CONFIG_SUBDIRS(libltdl)
24 AM_INIT_AUTOMAKE(dist-bzip2)
27 AC_PREFIX_DEFAULT("/opt/collectd")
32 # Checks for programs.
40 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
48 AC_MSG_CHECKING([for kernel type ($host_os)])
51 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
55 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
67 AC_MSG_RESULT([$ac_system])
69 if test "x$ac_system" = "xLinux"
71 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
72 if test -z "$KERNEL_DIR"
74 KERNEL_DIR="/lib/modules/`uname -r`/source"
77 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
78 AC_SUBST(KERNEL_CFLAGS)
81 if test "x$ac_system" = "xSolaris"
83 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
86 # Where to install .pc files.
87 pkgconfigdir="${libdir}/pkgconfig"
88 AC_SUBST(pkgconfigdir)
91 # Checks for header files.
98 AC_CHECK_HEADERS(stdio.h stdint.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
101 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
106 # include <sys/types.h>
109 AC_CHECK_HEADERS(netinet/in.h, [], [],
114 # include <sys/types.h>
116 #if HAVE_NETINET_IN_SYSTM_H
117 # include <netinet/in_systm.h>
120 AC_CHECK_HEADERS(netinet/ip.h, [], [],
125 # include <sys/types.h>
127 #if HAVE_NETINET_IN_SYSTM_H
128 # include <netinet/in_systm.h>
130 #if HAVE_NETINET_IN_H
131 # include <netinet/in.h>
134 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
139 # include <sys/types.h>
141 #if HAVE_NETINET_IN_SYSTM_H
142 # include <netinet/in_systm.h>
144 #if HAVE_NETINET_IN_H
145 # include <netinet/in.h>
147 #if HAVE_NETINET_IP_H
148 # include <netinet/ip.h>
151 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
156 # include <sys/types.h>
158 #if HAVE_NETINET_IN_SYSTM_H
159 # include <netinet/in_systm.h>
161 #if HAVE_NETINET_IN_H
162 # include <netinet/in.h>
164 #if HAVE_NETINET_IP_H
165 # include <netinet/ip.h>
168 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
173 # include <sys/types.h>
175 #if HAVE_NETINET_IN_SYSTM_H
176 # include <netinet/in_systm.h>
178 #if HAVE_NETINET_IN_H
179 # include <netinet/in.h>
182 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
187 # include <sys/types.h>
189 #if HAVE_NETINET_IN_SYSTM_H
190 # include <netinet/in_systm.h>
192 #if HAVE_NETINET_IN_H
193 # include <netinet/in.h>
195 #if HAVE_NETINET_IP6_H
196 # include <netinet/ip6.h>
199 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
204 # include <sys/types.h>
206 #if HAVE_NETINET_IN_SYSTM_H
207 # include <netinet/in_systm.h>
209 #if HAVE_NETINET_IN_H
210 # include <netinet/in.h>
212 #if HAVE_NETINET_IP_H
213 # include <netinet/ip.h>
216 AC_CHECK_HEADERS(netinet/udp.h, [], [],
221 # include <sys/types.h>
223 #if HAVE_NETINET_IN_SYSTM_H
224 # include <netinet/in_systm.h>
226 #if HAVE_NETINET_IN_H
227 # include <netinet/in.h>
229 #if HAVE_NETINET_IP_H
230 # include <netinet/ip.h>
235 AC_CHECK_HEADERS(sys/dkstat.h)
236 if test "x$ac_system" = "xDarwin"
238 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
239 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
241 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
244 # include <sys/types.h>
247 # include <sys/param.h>
252 AC_CHECK_HEADERS(linux/major.h libgen.h)
254 # For the battery plugin
255 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
257 #if HAVE_IOKIT_IOKITLIB_H
258 # include <IOKit/IOKitLib.h>
260 #if HAVE_IOKIT_IOTYPES_H
261 # include <IOKit/IOTypes.h>
265 # For the swap module
266 have_sys_swap_h="yes"
267 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
270 # include <sys/types.h>
273 # include <sys/param.h>
277 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
280 if test "x$GCC" = "xyes"
282 hint_64="CFLAGS='-m64'"
284 hint_64="CFLAGS='-xarch=v9'"
286 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
290 # For the processes plugin
292 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
294 # For interface plugin
295 AC_CHECK_HEADERS(ifaddrs.h)
296 AC_CHECK_HEADERS(net/if.h, [], [],
299 # include <sys/types.h>
301 #if HAVE_SYS_SOCKET_H
302 # include <sys/socket.h>
305 AC_CHECK_HEADERS(linux/if.h, [], [],
308 # include <sys/types.h>
310 #if HAVE_SYS_SOCKET_H
311 # include <sys/socket.h>
314 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
317 # include <sys/types.h>
319 #if HAVE_SYS_SOCKET_H
320 # include <sys/socket.h>
323 # include <linux/if.h>
328 have_net_ip_vs_h="no"
330 if test "x$ac_system" = "xLinux"
333 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
335 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
336 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
342 AC_CHECK_HEADERS(sys/ucred.h, [], [],
345 # include <sys/types.h>
348 # include <sys/param.h>
352 # For mount interface
353 AC_CHECK_HEADERS(sys/mount.h, [], [],
356 # include <sys/types.h>
359 # include <sys/param.h>
363 # For the email plugin
364 AC_CHECK_HEADERS(linux/un.h, [], [],
366 #if HAVE_SYS_SOCKET_H
367 # include <sys/socket.h>
371 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
374 AC_CHECK_HEADERS(arpa/nameser.h)
375 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
377 #if HAVE_ARPA_NAMESER_H
378 # include <arpa/nameser.h>
382 AC_CHECK_HEADERS(net/if_arp.h, [], [],
383 [#if HAVE_SYS_SOCKET_H
384 # include <sys/socket.h>
387 AC_CHECK_HEADERS(net/ppp_defs.h)
388 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
389 [#if HAVE_NET_PPP_DEFS_H
390 # include <net/ppp_defs.h>
393 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
398 # include <sys/types.h>
400 #if HAVE_SYS_SOCKET_H
401 # include <sys/socket.h>
406 #if HAVE_NETINET_IN_H
407 # include <netinet/in.h>
411 # For the multimeter plugin
413 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
416 # Checks for typedefs, structures, and compiler characteristics.
425 # Checks for library functions.
427 AC_PROG_GCC_TRADITIONAL
428 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
432 AC_CACHE_CHECK([for strtok_r],
433 [c_cv_have_strtok_r_default],
442 char buffer[] = "foo,bar,baz";
449 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
452 printf ("token = %s;\n", token);
455 [c_cv_have_strtok_r_default="yes"],
456 [c_cv_have_strtok_r_default="no"]
460 if test "x$c_cv_have_strtok_r_default" = "xno"
462 SAVE_CFLAGS="$CFLAGS"
463 CFLAGS="$CFLAGS -D_REENTRANT=1"
465 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
466 [c_cv_have_strtok_r_reentrant],
475 char buffer[] = "foo,bar,baz";
482 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
485 printf ("token = %s;\n", token);
488 [c_cv_have_strtok_r_reentrant="yes"],
489 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
494 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
496 socket_needs_socket="no"
497 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
498 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
500 nanosleep_needs_rt="no"
501 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
502 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
504 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
505 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
506 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
507 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
508 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
509 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
510 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
511 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
512 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
513 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
514 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
515 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
518 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
521 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
523 if test "x$withval" = "xno"; then
525 else if test "x$withval" = "xyes"; then
532 if test "x$nan_type" = "xnone"; then
533 AC_CACHE_CHECK([whether NAN is defined by default],
534 [c_cv_have_nan_default],
540 static float foo = NAN;
548 [c_cv_have_nan_default="yes"],
549 [c_cv_have_nan_default="no"]
552 if test "x$c_cv_have_nan_default" = "xyes"
557 if test "x$nan_type" = "xnone"; then
558 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
559 [c_cv_have_nan_isoc],
564 #define __USE_ISOC99 1
566 static float foo = NAN;
574 [c_cv_have_nan_isoc="yes"],
575 [c_cv_have_nan_isoc="no"]
578 if test "x$c_cv_have_nan_isoc" = "xyes"
583 if test "x$nan_type" = "xnone"; then
584 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
585 [c_cv_have_nan_zero],
594 #define NAN (0.0 / 0.0)
596 # define isnan(f) ((f) != (f))
598 static float foo = NAN;
606 [c_cv_have_nan_zero="yes"],
607 [c_cv_have_nan_zero="no"]
610 if test "x$c_cv_have_nan_zero" = "xyes"
616 if test "x$nan_type" = "xdefault"; then
617 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
618 [Define if NAN is defined by default and can initialize static variables.])
619 else if test "x$nan_type" = "xisoc99"; then
620 AC_DEFINE(NAN_STATIC_ISOC, 1,
621 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
622 else if test "x$nan_type" = "xzero"; then
623 AC_DEFINE(NAN_ZERO_ZERO, 1,
624 [Define if NAN can be defined as (0.0 / 0.0)])
626 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
629 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
631 if test "x$withval" = "xnothing"; then
632 fp_layout_type="nothing"
633 else if test "x$withval" = "xendianflip"; then
634 fp_layout_type="endianflip"
635 else if test "x$withval" = "xintswap"; then
636 fp_layout_type="intswap"
638 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
641 [fp_layout_type="unknown"])
643 if test "x$fp_layout_type" = "xunknown"; then
644 AC_CACHE_CHECK([if doubles are stored in x86 representation],
645 [c_cv_fp_layout_need_nothing],
656 # include <stdbool.h>
666 memcpy ((void *) &i0, (void *) &d, 8);
669 memcpy ((void *) c, (void *) &i1, 8);
671 if ((c[0] == 0x2f) && (c[1] == 0x25)
672 && (c[2] == 0xc0) && (c[3] == 0xc7)
673 && (c[4] == 0x43) && (c[5] == 0x2b)
674 && (c[6] == 0x1f) && (c[7] == 0x5b))
679 [c_cv_fp_layout_need_nothing="yes"],
680 [c_cv_fp_layout_need_nothing="no"]
683 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
684 fp_layout_type="nothing"
687 if test "x$fp_layout_type" = "xunknown"; then
688 AC_CACHE_CHECK([if endianflip converts to x86 representation],
689 [c_cv_fp_layout_need_endianflip],
700 # include <stdbool.h>
702 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
703 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
704 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
705 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
706 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
707 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
708 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
709 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
718 memcpy ((void *) &i0, (void *) &d, 8);
720 i1 = endianflip (i0);
721 memcpy ((void *) c, (void *) &i1, 8);
723 if ((c[0] == 0x2f) && (c[1] == 0x25)
724 && (c[2] == 0xc0) && (c[3] == 0xc7)
725 && (c[4] == 0x43) && (c[5] == 0x2b)
726 && (c[6] == 0x1f) && (c[7] == 0x5b))
731 [c_cv_fp_layout_need_endianflip="yes"],
732 [c_cv_fp_layout_need_endianflip="no"]
735 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
736 fp_layout_type="endianflip"
739 if test "x$fp_layout_type" = "xunknown"; then
740 AC_CACHE_CHECK([if intswap converts to x86 representation],
741 [c_cv_fp_layout_need_intswap],
752 # include <stdbool.h>
754 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
755 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
764 memcpy ((void *) &i0, (void *) &d, 8);
767 memcpy ((void *) c, (void *) &i1, 8);
769 if ((c[0] == 0x2f) && (c[1] == 0x25)
770 && (c[2] == 0xc0) && (c[3] == 0xc7)
771 && (c[4] == 0x43) && (c[5] == 0x2b)
772 && (c[6] == 0x1f) && (c[7] == 0x5b))
777 [c_cv_fp_layout_need_intswap="yes"],
778 [c_cv_fp_layout_need_intswap="no"]
781 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
782 fp_layout_type="intswap"
786 if test "x$fp_layout_type" = "xnothing"; then
787 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
788 [Define if doubles are stored in x86 representation.])
789 else if test "x$fp_layout_type" = "xendianflip"; then
790 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
791 [Define if endianflip is needed to convert to x86 representation.])
792 else if test "x$fp_layout_type" = "xintswap"; then
793 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
794 [Define if intswap is needed to convert to x86 representation.])
796 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
800 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
802 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
804 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
807 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
808 if test "x$have_getmntent" = "xno"; then
809 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
811 if test "x$have_getmntent" = "xno"; then
812 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
814 if test "x$have_getmntent" = "xno"; then
815 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
818 if test "x$have_getmntent" = "xc"; then
819 AC_CACHE_CHECK([whether getmntent takes one argument],
820 [c_cv_have_one_getmntent],
822 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
823 #include "$srcdir/src/utils_mount.h"]],
827 fh = setmntent ("/etc/mtab", "r");
831 [c_cv_have_one_getmntent="yes"],
832 [c_cv_have_one_getmntent="no"]
835 AC_CACHE_CHECK([whether getmntent takes two arguments],
836 [c_cv_have_two_getmntent],
838 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
839 #include "$srcdir/src/utils_mount.h"]],
844 fh = fopen ("/etc/mnttab", "r");
845 status = getmntent (fh, &mt);
848 [c_cv_have_two_getmntent="yes"],
849 [c_cv_have_two_getmntent="no"]
854 # Check for different versions of `getmntent' here..
856 if test "x$have_getmntent" = "xc"; then
857 if test "x$c_cv_have_one_getmntent" = "xyes"; then
858 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
859 [Define if the function getmntent exists and takes one argument.])
861 if test "x$c_cv_have_two_getmntent" = "xyes"; then
862 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
863 [Define if the function getmntent exists and takes two arguments.])
866 if test "x$have_getmntent" = "xsun"; then
867 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
868 [Define if the function getmntent exists. It's the version from libsun.])
870 if test "x$have_getmntent" = "xseq"; then
871 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
872 [Define if the function getmntent exists. It's the version from libseq.])
874 if test "x$have_getmntent" = "xgen"; then
875 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
876 [Define if the function getmntent exists. It's the version from libgen.])
879 # Check for structures
880 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
881 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
884 #include <sys/types.h>
885 #include <sys/socket.h>
888 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
889 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
892 #include <sys/types.h>
893 #include <sys/socket.h>
894 #include <linux/if.h>
895 #include <linux/netdevice.h>
898 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
900 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
901 [Define if struct kinfo_proc exists in the FreeBSD variant.])
902 have_struct_kinfo_proc_freebsd="yes"
905 have_struct_kinfo_proc_freebsd="no"
909 #include <sys/param.h>
910 #include <sys/sysctl.h>
911 #include <sys/user.h>
914 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
916 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
917 [Define if struct kinfo_proc exists in the OpenBSD variant.])
918 have_struct_kinfo_proc_openbsd="yes"
921 have_struct_kinfo_proc_openbsd="no"
924 #include <sys/param.h>
925 #include <sys/sysctl.h>
929 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
934 # include <sys/types.h>
936 #if HAVE_NETINET_IN_SYSTM_H
937 # include <netinet/in_systm.h>
939 #if HAVE_NETINET_IN_H
940 # include <netinet/in.h>
942 #if HAVE_NETINET_IP_H
943 # include <netinet/ip.h>
945 #if HAVE_NETINET_UDP_H
946 # include <netinet/udp.h>
949 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
954 # include <sys/types.h>
956 #if HAVE_NETINET_IN_SYSTM_H
957 # include <netinet/in_systm.h>
959 #if HAVE_NETINET_IN_H
960 # include <netinet/in.h>
962 #if HAVE_NETINET_IP_H
963 # include <netinet/ip.h>
965 #if HAVE_NETINET_UDP_H
966 # include <netinet/udp.h>
970 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
980 # Checks for libraries begin here
983 AC_CHECK_LIB(resolv, res_search,
985 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
987 [with_libresolv="no"])
988 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
990 dnl Check for HAL (hardware abstraction library)
992 AC_CHECK_LIB(hal,libhal_device_property_exists,
993 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
995 if test "x$with_libhal" = "xyes"; then
996 if test "x$PKG_CONFIG" != "x"; then
997 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
998 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
999 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1000 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1004 m4_divert_once([HELP_WITH], [
1005 collectd additional packages:])
1007 if test "x$ac_system" = "xSolaris"
1012 with_kstat="no (Solaris only)"
1013 with_devinfo="no (Solaris only)"
1016 if test "x$with_kstat" = "xyes"
1018 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1020 if test "x$with_kstat" = "xyes"
1022 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1023 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1025 if test "x$with_kstat" = "xyes"
1027 AC_DEFINE(HAVE_LIBKSTAT, 1,
1028 [Define to 1 if you have the 'kstat' library (-lkstat)])
1030 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1031 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1034 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1041 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1044 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1045 if test "x$with_kvm_getprocs" = "xyes"
1047 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1048 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1051 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1053 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1054 if test "x$with_kvm_getswapinfo" = "xyes"
1056 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1057 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1060 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1062 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1063 if test "x$with_kvm_nlist" = "xyes"
1065 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1066 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1069 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1071 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1072 if test "x$with_kvm_openfiles" = "xyes"
1074 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1075 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1078 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1080 # --with-libcurl {{{
1081 with_curl_config="curl-config"
1084 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1086 if test "x$withval" = "xno"
1089 else if test "x$withval" = "xyes"
1093 if test -f "$withval" && test -x "$withval"
1095 with_curl_config="$withval"
1097 else if test -x "$withval/bin/curl-config"
1099 with_curl_config="$withval/bin/curl-config"
1108 if test "x$with_libcurl" = "xyes"
1110 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1111 curl_config_status=$?
1113 if test $curl_config_status -ne 0
1115 with_libcurl="no ($with_curl_config failed)"
1117 SAVE_CPPFLAGS="$CPPFLAGS"
1118 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1120 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1122 CPPFLAGS="$SAVE_CPPFLAGS"
1125 if test "x$with_libcurl" = "xyes"
1127 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1128 curl_config_status=$?
1130 if test $curl_config_status -ne 0
1132 with_libcurl="no ($with_curl_config failed)"
1134 AC_CHECK_LIB(curl, curl_easy_init,
1135 [with_libcurl="yes"],
1136 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1140 if test "x$with_libcurl" = "xyes"
1142 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1143 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1144 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1145 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1147 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1151 with_libdbi_cppflags=""
1152 with_libdbi_ldflags=""
1153 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1155 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1157 with_libdbi_cppflags="-I$withval/include"
1158 with_libdbi_ldflags="-L$withval/lib"
1161 with_libdbi="$withval"
1167 if test "x$with_libdbi" = "xyes"
1169 SAVE_CPPFLAGS="$CPPFLAGS"
1170 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1172 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1174 CPPFLAGS="$SAVE_CPPFLAGS"
1176 if test "x$with_libdbi" = "xyes"
1178 SAVE_CPPFLAGS="$CPPFLAGS"
1179 SAVE_LDFLAGS="$LDFLAGS"
1180 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1181 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1183 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1185 CPPFLAGS="$SAVE_CPPFLAGS"
1186 LDFLAGS="$SAVE_LDFLAGS"
1188 if test "x$with_libdbi" = "xyes"
1190 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1191 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1192 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1193 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1194 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1195 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1197 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1200 # --with-libesmtp {{{
1201 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1203 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1205 LDFLAGS="$LDFLAGS -L$withval/lib"
1206 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1209 with_libesmtp="$withval"
1215 if test "x$with_libesmtp" = "xyes"
1217 AC_CHECK_LIB(esmtp, smtp_create_session,
1219 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1220 ], [with_libesmtp="no (libesmtp not found)"])
1222 if test "x$with_libesmtp" = "xyes"
1224 AC_CHECK_HEADERS(libesmtp.h,
1226 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1227 ], [with_libesmtp="no (libesmtp.h not found)"])
1229 if test "x$with_libesmtp" = "xyes"
1235 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1236 [Wether or not to use the esmtp library])
1237 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1240 # --with-libiptc {{{
1241 with_own_libiptc="no"
1242 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1244 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1246 LDFLAGS="$LDFLAGS -L$withval/lib"
1247 CPPFLAGS="$CPPFLAGS -I$withval/include"
1250 with_libiptc="$withval"
1254 if test "x$ac_system" = "xLinux"
1258 with_libiptc="no (Linux only)"
1261 if test "x$with_libiptc" = "xyes"
1263 AC_CHECK_LIB(iptc, iptc_init,
1265 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1269 with_own_libiptc="yes"
1272 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1274 AC_CHECK_HEADERS(libiptc/libiptc.h,
1276 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1280 with_own_libiptc="yes"
1283 if test "x$with_libiptc" = "xyes"
1286 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1288 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1290 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1291 with_own_libiptc="no"
1294 #include "$srcdir/src/libiptc/ipt_kernel_headers.h"
1299 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1300 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1301 if test "x$with_own_libiptc" = "xyes"
1303 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1307 # --with-libmysql {{{
1308 with_mysql_config="mysql_config"
1309 with_mysql_cflags=""
1311 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1313 if test "x$withval" = "xno"
1316 else if test "x$withval" = "xyes"
1320 if test -f "$withval" && test -x "$withval";
1322 with_mysql_config="$withval"
1323 else if test -x "$withval/bin/mysql_config"
1325 with_mysql_config="$withval/bin/mysql_config"
1333 if test "x$with_libmysql" = "xyes"
1335 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1336 mysql_config_status=$?
1338 if test $mysql_config_status -ne 0
1340 with_libmysql="no ($with_mysql_config failed)"
1342 SAVE_CPPFLAGS="$CPPFLAGS"
1343 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1346 have_mysql_mysql_h="no"
1347 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1349 if test "x$have_mysql_h" = "xno"
1351 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1354 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1356 with_libmysql="no (mysql.h not found)"
1359 CPPFLAGS="$SAVE_CPPFLAGS"
1362 if test "x$with_libmysql" = "xyes"
1364 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1365 mysql_config_status=$?
1367 if test $mysql_config_status -ne 0
1369 with_libmysql="no ($with_mysql_config failed)"
1371 AC_CHECK_LIB(mysqlclient, mysql_init,
1372 [with_libmysql="yes"],
1373 [with_libmysql="no (symbol 'mysql_init' not found)"],
1376 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1377 [with_libmysql="yes"],
1378 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1382 if test "x$with_libmysql" = "xyes"
1384 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1385 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1386 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1387 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1389 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1392 # --with-libnetlink {{{
1393 with_libnetlink_cflags=""
1394 with_libnetlink_libs="-lnetlink"
1395 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1397 echo "libnetlink: withval = $withval"
1398 if test "x$withval" = "xyes"
1400 with_libnetlink="yes"
1401 else if test "x$withval" = "xno"
1403 with_libnetlink="no"
1405 if test -d "$withval/include"
1407 with_libnetlink_cflags="-I$withval/include"
1408 with_libnetlink_libs="-L$withval/lib -lnetlink"
1409 with_libnetlink="yes"
1411 AC_MSG_ERROR("no such directory: $withval/include")
1416 if test "x$ac_system" = "xLinux"
1418 with_libnetlink="yes"
1420 with_libnetlink="no (Linux only library)"
1423 if test "x$with_libnetlink" = "xyes"
1426 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1428 with_libnetlink="no (libnetlink.h not found)"
1430 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1432 with_libnetlink="yes"
1436 #include <sys/types.h>
1437 #include <asm/types.h>
1438 #include <sys/socket.h>
1439 #include <linux/netlink.h>
1440 #include <linux/rtnetlink.h>])
1441 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1443 #include <sys/types.h>
1444 #include <asm/types.h>
1445 #include <sys/socket.h>])
1449 #include <sys/types.h>
1450 #include <asm/types.h>
1451 #include <sys/socket.h>
1452 #include <linux/netlink.h>
1453 #include <linux/rtnetlink.h>
1457 int retval = TCA_STATS2;
1460 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1465 #include <sys/types.h>
1466 #include <asm/types.h>
1467 #include <sys/socket.h>
1468 #include <linux/netlink.h>
1469 #include <linux/rtnetlink.h>
1473 int retval = TCA_STATS;
1476 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1479 CFLAGS="$SAVE_CFLAGS"
1481 if test "x$with_libnetlink" = "xyes"
1483 AC_CHECK_LIB(netlink, rtnl_open,
1484 [with_libnetlink="yes"],
1485 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1486 [$with_libnetlink_libs])
1488 if test "x$with_libnetlink" = "xyes"
1490 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1491 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1492 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1493 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1495 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1498 # --with-libnetsnmp {{{
1499 with_snmp_config="net-snmp-config"
1502 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1504 if test "x$withval" = "xno"
1506 with_libnetsnmp="no"
1507 else if test "x$withval" = "xyes"
1509 with_libnetsnmp="yes"
1511 if test -x "$withval"
1513 with_snmp_config="$withval"
1514 with_libnetsnmp="yes"
1516 with_snmp_config="$withval/bin/net-snmp-config"
1517 with_libnetsnmp="yes"
1521 [with_libnetsnmp="yes"])
1522 if test "x$with_libnetsnmp" = "xyes"
1524 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1525 snmp_config_status=$?
1527 if test $snmp_config_status -ne 0
1529 with_libnetsnmp="no ($with_snmp_config failed)"
1531 SAVE_CPPFLAGS="$CPPFLAGS"
1532 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1534 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1536 CPPFLAGS="$SAVE_CPPFLAGS"
1539 if test "x$with_libnetsnmp" = "xyes"
1541 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1542 snmp_config_status=$?
1544 if test $snmp_config_status -ne 0
1546 with_libnetsnmp="no ($with_snmp_config failed)"
1548 AC_CHECK_LIB(netsnmp, init_snmp,
1549 [with_libnetsnmp="yes"],
1550 [with_libnetsnmp="no (libnetsnmp not found)"],
1554 if test "x$with_libnetsnmp" = "xyes"
1556 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1557 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1558 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1559 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1561 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1564 # --with-liboconfig {{{
1565 with_own_liboconfig="no"
1566 liboconfig_LDFLAGS="$LDFLAGS"
1567 liboconfig_CPPFLAGS="$CPPFLAGS"
1568 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1570 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1572 if test -d "$withval/lib"
1574 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1576 if test -d "$withval/include"
1578 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1581 if test "x$withval" = "xno"
1583 AC_MSG_ERROR("liboconfig is required")
1587 with_liboconfig="yes"
1590 save_LDFLAGS="$LDFLAGS"
1591 save_CPPFLAGS="$CPPFLAGS"
1592 LDFLAGS="$liboconfig_LDFLAGS"
1593 CPPFLAGS="$liboconfig_CPPFLAGS"
1594 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1596 with_liboconfig="yes"
1597 with_own_liboconfig="no"
1600 with_liboconfig="yes"
1601 with_own_liboconfig="yes"
1602 LDFLAGS="$save_LDFLAGS"
1603 CPPFLAGS="$save_CPPFLAGS"
1606 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1607 if test "x$with_own_liboconfig" = "xyes"
1609 with_liboconfig="yes (shipped version)"
1613 # --with-liboping {{{
1614 with_own_liboping="no"
1615 liboping_LDFLAGS="$LDFLAGS"
1616 liboping_CPPFLAGS="$CPPFLAGS"
1617 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1619 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1621 if test -d "$withval/lib"
1623 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1625 if test -d "$withval/include"
1627 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1630 if test "x$withval" = "xno"
1633 with_own_liboping="no"
1634 else if test "x$withval" = "xyes"
1643 if test "x$with_liboping" = "xyes"
1645 save_LDFLAGS="$LDFLAGS"
1646 save_CPPFLAGS="$CPPFLAGS"
1647 LDFLAGS="$liboping_LDFLAGS"
1648 CPPFLAGS="$liboping_CPPFLAGS"
1649 AC_CHECK_LIB(oping, ping_construct,
1652 with_own_liboping="no"
1656 with_own_liboping="yes"
1657 LDFLAGS="$save_LDFLAGS"
1658 CPPFLAGS="$save_CPPFLAGS"
1661 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1662 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1666 with_oracle_cppflags=""
1668 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
1670 if test "x$withval" = "xyes"
1672 if test "x$ORACLE_HOME" = "x"
1674 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
1677 else if test "x$withval" = "xno"
1682 ORACLE_HOME="$withval"
1686 if test "x$ORACLE_HOME" = "x"
1688 with_oracle="no (ORACLE_HOME is not set)"
1693 if test "x$ORACLE_HOME" != "x"
1695 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
1697 if test -e "$ORACLE_HOME/lib/ldflags"
1699 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
1701 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
1702 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
1704 if test "x$with_oracle" = "xyes"
1706 SAVE_CPPFLAGS="$CPPFLAGS"
1707 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1709 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
1711 CPPFLAGS="$SAVE_CPPFLAGS"
1713 if test "x$with_oracle" = "xyes"
1715 SAVE_CPPFLAGS="$CPPFLAGS"
1716 SAVE_LDFLAGS="$LDFLAGS"
1717 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1718 LDFLAGS="$LDFLAGS $with_oracle_libs"
1720 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
1722 CPPFLAGS="$SAVE_CPPFLAGS"
1723 LDFLAGS="$SAVE_LDFLAGS"
1725 if test "x$with_oracle" = "xyes"
1727 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
1728 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
1729 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
1730 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
1734 # --with-libowcapi {{{
1735 with_libowcapi_cppflags=""
1736 with_libowcapi_libs="-lowcapi"
1737 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
1739 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1741 with_libowcapi_cppflags="-I$withval/include"
1742 with_libowcapi_libs="-L$withval/lib -lowcapi"
1743 with_libowcapi="yes"
1745 with_libowcapi="$withval"
1749 with_libowcapi="yes"
1751 if test "x$with_libowcapi" = "xyes"
1753 SAVE_CPPFLAGS="$CPPFLAGS"
1754 CPPFLAGS="$with_libowcapi_cppflags"
1756 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
1758 CPPFLAGS="$SAVE_CPPFLAGS"
1760 if test "x$with_libowcapi" = "xyes"
1762 SAVE_LDFLAGS="$LDFLAGS"
1763 SAVE_CPPFLAGS="$CPPFLAGS"
1764 LDFLAGS="$with_libowcapi_libs"
1765 CPPFLAGS="$with_libowcapi_cppflags"
1767 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
1769 LDFLAGS="$SAVE_LDFLAGS"
1770 CPPFLAGS="$SAVE_CPPFLAGS"
1772 if test "x$with_libowcapi" = "xyes"
1774 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
1775 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
1776 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
1777 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
1781 # --with-libpcap {{{
1782 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1784 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1786 LDFLAGS="$LDFLAGS -L$withval/lib"
1787 CPPFLAGS="$CPPFLAGS -I$withval/include"
1790 with_libpcap="$withval"
1796 if test "x$with_libpcap" = "xyes"
1798 AC_CHECK_LIB(pcap, pcap_open_live,
1800 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1801 ], [with_libpcap="no (libpcap not found)"])
1803 if test "x$with_libpcap" = "xyes"
1805 AC_CHECK_HEADERS(pcap.h,
1807 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1808 ], [with_libpcap="no (pcap.h not found)"])
1810 if test "x$with_libpcap" = "xyes"
1816 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1817 [Wether or not to use the pcap library])
1818 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1821 # --with-libperl {{{
1822 perl_interpreter="perl"
1823 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1825 if test -x "$withval"
1827 perl_interpreter="$withval"
1829 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1831 LDFLAGS="$LDFLAGS -L$withval/lib"
1832 CPPFLAGS="$CPPFLAGS -I$withval/include"
1833 perl_interpreter="$withval/bin/perl"
1836 with_libperl="$withval"
1843 AC_MSG_CHECKING([for perl])
1844 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
1845 if test -x "$perl_interpreter"
1847 AC_MSG_RESULT([yes ($perl_interpreter)])
1853 AC_SUBST(PERL, "$perl_interpreter")
1855 if test "x$with_libperl" = "xyes" \
1856 && test -n "$perl_interpreter"
1859 SAVE_LDFLAGS=$LDFLAGS
1860 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
1861 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
1862 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
1863 CFLAGS="$CFLAGS $PERL_CFLAGS"
1864 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1866 AC_CACHE_CHECK([for libperl],
1867 [c_cv_have_libperl],
1871 #define PERL_NO_GET_CONTEXT
1878 load_module (PERL_LOADMOD_NOIMPORT,
1879 newSVpv ("Collectd::Plugin::FooBar", 24),
1882 [c_cv_have_libperl="yes"],
1883 [c_cv_have_libperl="no"]
1887 if test "x$c_cv_have_libperl" = "xyes"
1889 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1890 AC_SUBST(PERL_CFLAGS)
1891 AC_SUBST(PERL_LDFLAGS)
1897 LDFLAGS=$SAVE_LDFLAGS
1898 else if test -z "$perl_interpreter"; then
1899 with_libperl="no (no perl interpreter found)"
1900 c_cv_have_libperl="no"
1902 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1904 if test "x$with_libperl" = "xyes"
1907 SAVE_LDFLAGS=$LDFLAGS
1908 CFLAGS="$CFLAGS $PERL_CFLAGS"
1909 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1911 AC_CACHE_CHECK([if perl supports ithreads],
1912 [c_cv_have_perl_ithreads],
1920 #if !defined(USE_ITHREADS)
1921 # error "Perl does not support ithreads!"
1922 #endif /* !defined(USE_ITHREADS) */
1925 [c_cv_have_perl_ithreads="yes"],
1926 [c_cv_have_perl_ithreads="no"]
1930 if test "x$c_cv_have_perl_ithreads" = "xyes"
1932 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1936 LDFLAGS=$SAVE_LDFLAGS
1939 c_cv_have_broken_perl_load_module="no"
1940 if test "x$with_libperl" = "xyes"
1943 SAVE_LDFLAGS=$LDFLAGS
1944 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
1945 # (see issues #41 and #42)
1946 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
1947 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1949 AC_CACHE_CHECK([for broken Perl_load_module()],
1950 [c_cv_have_broken_perl_load_module],
1954 #define PERL_NO_GET_CONTEXT
1961 load_module (PERL_LOADMOD_NOIMPORT,
1962 newSVpv ("Collectd::Plugin::FooBar", 24),
1965 [c_cv_have_broken_perl_load_module="no"],
1966 [c_cv_have_broken_perl_load_module="yes"]
1971 LDFLAGS=$SAVE_LDFLAGS
1973 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
1974 test "x$c_cv_have_broken_perl_load_module" = "xyes")
1976 if test "x$with_libperl" = "xyes"
1979 SAVE_LDFLAGS=$LDFLAGS
1980 CFLAGS="$CFLAGS $PERL_CFLAGS"
1981 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1984 [struct mgvtbl.svt_local],
1985 [have_struct_mgvtbl_svt_local="yes"],
1986 [have_struct_mgvtbl_svt_local="no"],
1993 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
1995 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
1996 [Define if Perl's struct mgvtbl has member svt_local.])
2000 LDFLAGS=$SAVE_LDFLAGS
2005 with_pg_config="pg_config"
2006 with_libpq_includedir=""
2007 with_libpq_libdir=""
2008 with_libpq_cppflags=""
2009 with_libpq_ldflags=""
2010 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2013 if test "x$withval" = "xno"
2016 else if test "x$withval" = "xyes"
2020 if test -f "$withval" && test -x "$withval";
2022 with_pg_config="$withval"
2023 else if test -x "$withval/bin/pg_config"
2025 with_pg_config="$withval/bin/pg_config"
2033 if test "x$with_libpq" = "xyes"
2035 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2038 if test $pg_config_status -eq 0
2040 if test -n "$with_libpq_includedir"; then
2041 for dir in $with_libpq_includedir; do
2042 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2046 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2049 SAVE_CPPFLAGS="$CPPFLAGS"
2050 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2052 AC_CHECK_HEADERS(libpq-fe.h, [],
2053 [with_libpq="no (libpq-fe.h not found)"], [])
2055 CPPFLAGS="$SAVE_CPPFLAGS"
2057 if test "x$with_libpq" = "xyes"
2059 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2062 if test $pg_config_status -eq 0
2064 if test -n "$with_libpq_libdir"; then
2065 for dir in $with_libpq_libdir; do
2066 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2070 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2073 SAVE_LDFLAGS="$LDFLAGS"
2074 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2076 AC_CHECK_LIB(pq, PQconnectdb,
2078 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2080 LDFLAGS="$SAVE_LDFLAGS"
2082 if test "x$with_libpq" = "xyes"
2084 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2085 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2086 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2087 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2089 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2092 # --with-libpthread {{{
2093 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2094 [ if test "x$withval" != "xno" \
2095 && test "x$withval" != "xyes"
2097 LDFLAGS="$LDFLAGS -L$withval/lib"
2098 CPPFLAGS="$CPPFLAGS -I$withval/include"
2099 with_libpthread="yes"
2101 if test "x$withval" = "xno"
2103 with_libpthread="no (disabled)"
2106 ], [with_libpthread="yes"])
2107 if test "x$with_libpthread" = "xyes"
2109 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2112 if test "x$with_libpthread" = "xyes"
2114 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2116 if test "x$with_libpthread" = "xyes"
2122 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2123 [Wether or not to use pthread (POSIX threads) library])
2124 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2128 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2131 librrd_threadsafe="yes"
2132 librrd_rrdc_update="no"
2133 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2134 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2136 librrd_cflags="-I$withval/include"
2137 librrd_ldflags="-L$withval/lib"
2140 with_librrd="$withval"
2142 ], [with_librrd="yes"])
2143 if test "x$with_librrd" = "xyes"
2145 SAVE_CPPFLAGS="$CPPFLAGS"
2146 SAVE_LDFLAGS="$LDFLAGS"
2148 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2149 LDFLAGS="$LDFLAGS $librrd_ldflags"
2151 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2153 CPPFLAGS="$SAVE_CPPFLAGS"
2154 LDFLAGS="$SAVE_LDFLAGS"
2156 if test "x$with_librrd" = "xyes"
2158 SAVE_CPPFLAGS="$CPPFLAGS"
2159 SAVE_LDFLAGS="$LDFLAGS"
2161 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2162 LDFLAGS="$LDFLAGS $librrd_ldflags"
2164 AC_CHECK_LIB(rrd_th, rrd_update_r,
2166 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2168 [librrd_threadsafe="no"
2169 AC_CHECK_LIB(rrd, rrd_update,
2171 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2173 [with_librrd="no (symbol 'rrd_update' not found)"],
2178 if test "x$librrd_threadsafe" = "xyes"
2180 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2182 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2185 CPPFLAGS="$SAVE_CPPFLAGS"
2186 LDFLAGS="$SAVE_LDFLAGS"
2188 if test "x$with_librrd" = "xyes"
2190 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2191 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2192 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2193 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2195 if test "x$librrd_threadsafe" = "xyes"
2197 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2201 # --with-libsensors {{{
2202 with_sensors_cflags=""
2203 with_sensors_ldflags=""
2204 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2206 if test "x$withval" = "xno"
2208 with_libsensors="no"
2210 with_libsensors="yes"
2211 if test "x$withval" != "xyes"
2213 with_sensors_cflags="-I$withval/include"
2214 with_sensors_ldflags="-L$withval/lib"
2215 with_libsensors="yes"
2220 if test "x$ac_system" = "xLinux"
2222 with_libsensors="yes"
2224 with_libsensors="no (Linux only library)"
2227 if test "x$with_libsensors" = "xyes"
2229 SAVE_CPPFLAGS="$CPPFLAGS"
2230 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2232 # AC_CHECK_HEADERS(sensors/sensors.h,
2234 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2236 # [with_libsensors="no (sensors/sensors.h not found)"])
2237 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2239 CPPFLAGS="$SAVE_CPPFLAGS"
2241 if test "x$with_libsensors" = "xyes"
2243 SAVE_CPPFLAGS="$CPPFLAGS"
2244 SAVE_LDFLAGS="$LDFLAGS"
2245 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2246 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2248 AC_CHECK_LIB(sensors, sensors_init,
2250 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2252 [with_libsensors="no (libsensors not found)"])
2254 CPPFLAGS="$SAVE_CPPFLAGS"
2255 LDFLAGS="$SAVE_LDFLAGS"
2257 if test "x$with_libsensors" = "xyes"
2259 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2260 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2261 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2262 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2264 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2267 # --with-libstatgrab {{{
2268 with_libstatgrab_cflags=""
2269 with_libstatgrab_ldflags=""
2270 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2272 if test "x$withval" != "xno" \
2273 && test "x$withval" != "xyes"
2275 with_libstatgrab_cflags="-I$withval/include"
2276 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
2277 with_libstatgrab="yes"
2278 with_libstatgrab_pkg_config="no"
2280 with_libstatgrab="$withval"
2281 with_libstatgrab_pkg_config="yes"
2285 with_libstatgrab="yes"
2286 with_libstatgrab_pkg_config="yes"
2289 if test "x$with_libstatgrab" = "xyes" \
2290 && test "x$with_libstatgrab_pkg_config" = "xyes"
2292 if test "x$PKG_CONFIG" != "x"
2294 AC_MSG_CHECKING([pkg-config for libstatgrab])
2296 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2299 with_libstatgrab_pkg_config="no"
2300 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
2301 temp_result="not found"
2303 AC_MSG_RESULT([$temp_result])
2305 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2306 with_libstatgrab_pkg_config="no"
2307 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2311 if test "x$with_libstatgrab" = "xyes" \
2312 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2313 && test "x$with_libstatgrab_cflags" = "x"
2315 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2316 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2319 with_libstatgrab_cflags="$temp_result"
2321 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2322 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2324 AC_MSG_RESULT([$temp_result])
2327 if test "x$with_libstatgrab" = "xyes" \
2328 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2329 && test "x$with_libstatgrab_ldflags" = "x"
2331 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2332 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2335 with_libstatgrab_ldflags="$temp_result"
2337 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2338 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2340 AC_MSG_RESULT([$temp_result])
2343 if test "x$with_libstatgrab" = "xyes"
2345 SAVE_CPPFLAGS="$CPPFLAGS"
2346 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2348 AC_CHECK_HEADERS(statgrab.h,
2349 [with_libstatgrab="yes"],
2350 [with_libstatgrab="no (statgrab.h not found)"])
2352 CPPFLAGS="$SAVE_CPPFLAGS"
2355 if test "x$with_libstatgrab" = "xyes"
2357 SAVE_CFLAGS="$CFLAGS"
2358 SAVE_LDFLAGS="$LDFLAGS"
2360 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2361 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2363 AC_CHECK_LIB(statgrab, sg_init,
2364 [with_libstatgrab="yes"],
2365 [with_libstatgrab="no (symbol sg_init not found)"])
2367 CFLAGS="$SAVE_CFLAGS"
2368 LDFLAGS="$SAVE_LDFLAGS"
2371 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2372 if test "x$with_libstatgrab" = "xyes"
2374 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2375 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2376 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2377 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2378 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2382 # --with-libupsclient {{{
2383 with_libupsclient_config=""
2384 with_libupsclient_cflags=""
2385 with_libupsclient_libs=""
2386 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2388 if test "x$withval" = "xno"
2390 with_libupsclient="no"
2391 else if test "x$withval" = "xyes"
2393 with_libupsclient="use_pkgconfig"
2395 if test -x "$withval"
2397 with_libupsclient_config="$withval"
2398 with_libupsclient="use_libupsclient_config"
2399 else if test -x "$withval/bin/libupsclient-config"
2401 with_libupsclient_config="$withval/bin/net-snmp-config"
2402 with_libupsclient="use_libupsclient_config"
2404 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
2405 with_libupsclient_cflags="-I$withval/include"
2406 with_libupsclient_libs="-L$withval/lib -lupsclient"
2407 with_libupsclient="yes"
2411 [with_libupsclient="use_pkgconfig"])
2413 # configure using libupsclient-config
2414 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2416 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
2417 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
2420 with_libupsclient="no ($with_libupsclient_config failed)"
2422 with_libupsclient_libs="`$with_libupsclient_config --libs`"
2425 with_libupsclient="no ($with_libupsclient_config failed)"
2428 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2430 with_libupsclient="yes"
2433 # configure using pkg-config
2434 if test "x$with_libupsclient" = "xuse_pkgconfig"
2436 if test "x$PKG_CONFIG" = "x"
2438 with_libupsclient="no (Don't have pkg-config)"
2441 if test "x$with_libupsclient" = "xuse_pkgconfig"
2443 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
2444 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
2447 with_libupsclient="no (pkg-config doesn't know library)"
2450 if test "x$with_libupsclient" = "xuse_pkgconfig"
2452 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
2455 with_libupsclient="no ($PKG_CONFIG failed)"
2457 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
2460 with_libupsclient="no ($PKG_CONFIG failed)"
2463 if test "x$with_libupsclient" = "xuse_pkgconfig"
2465 with_libupsclient="yes"
2468 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
2469 # the actual checks.
2470 if test "x$with_libupsclient" = "xyes"
2472 SAVE_CPPFLAGS="$CPPFLAGS"
2473 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2475 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2477 CPPFLAGS="$SAVE_CPPFLAGS"
2479 if test "x$with_libupsclient" = "xyes"
2481 SAVE_CPPFLAGS="$CPPFLAGS"
2482 SAVE_LDFLAGS="$LDFLAGS"
2484 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2485 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2487 AC_CHECK_LIB(upsclient, upscli_connect,
2488 [with_libupsclient="yes"],
2489 [with_libupsclient="no (symbol upscli_connect not found)"])
2491 CPPFLAGS="$SAVE_CPPFLAGS"
2492 LDFLAGS="$SAVE_LDFLAGS"
2494 if test "x$with_libupsclient" = "xyes"
2496 SAVE_CPPFLAGS="$CPPFLAGS"
2497 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2499 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2500 [#include <stdlib.h>
2502 #include <upsclient.h>])
2504 CPPFLAGS="$SAVE_CPPFLAGS"
2506 if test "x$with_libupsclient" = "xyes"
2508 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2509 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2510 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2511 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2515 # --with-libxmms {{{
2516 with_xmms_config="xmms-config"
2519 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2521 if test "x$withval" != "xno" \
2522 && test "x$withval" != "xyes"
2524 if test -f "$withval" && test -x "$withval";
2526 with_xmms_config="$withval"
2527 else if test -x "$withval/bin/xmms-config"
2529 with_xmms_config="$withval/bin/xmms-config"
2532 else if test "x$withval" = "xno"
2542 if test "x$with_libxmms" = "xyes"
2544 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2545 xmms_config_status=$?
2547 if test $xmms_config_status -ne 0
2552 if test "x$with_libxmms" = "xyes"
2554 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2555 xmms_config_status=$?
2557 if test $xmms_config_status -ne 0
2562 if test "x$with_libxmms" = "xyes"
2564 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2566 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2567 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2568 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2569 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2576 with_libxmms_numeric=0
2577 if test "x$with_libxmms" = "xyes"
2579 with_libxmms_numeric=1
2581 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2582 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2585 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
2586 with_libxml2="no (pkg-config isn't available)"
2587 with_libxml2_cflags=""
2588 with_libxml2_ldflags=""
2589 with_libvirt="no (pkg-config isn't available)"
2590 with_libvirt_cflags=""
2591 with_libvirt_ldflags=""
2592 if test "x$PKG_CONFIG" != "x"
2594 pkg-config --exists 'libxml-2.0' 2>/dev/null
2599 with_libxml2="no (pkg-config doesn't know library)"
2602 pkg-config --exists libvirt 2>/dev/null
2607 with_libvirt="no (pkg-config doesn't know library)"
2610 if test "x$with_libxml2" = "xyes"
2612 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2617 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2623 if test "x$with_libxml2" = "xyes"
2625 SAVE_CPPFLAGS="$CPPFLAGS"
2626 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2628 AC_CHECK_HEADERS(libxml/parser.h, [],
2629 [with_libxml2="no (libxml/parser.h not found)"])
2631 CPPFLAGS="$SAVE_CPPFLAGS"
2633 if test "x$with_libxml2" = "xyes"
2635 SAVE_CFLAGS="$CFLAGS"
2636 SAVE_LDFLAGS="$LDFLAGS"
2638 CFLAGS="$CFLAGS $with_libxml2_cflags"
2639 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2641 AC_CHECK_LIB(xml2, xmlXPathEval,
2642 [with_libxml2="yes"],
2643 [with_libxml2="no (symbol xmlXPathEval not found)"])
2645 CFLAGS="$SAVE_CFLAGS"
2646 LDFLAGS="$SAVE_LDFLAGS"
2648 dnl Add the right compiler flags and libraries.
2649 if test "x$with_libxml2" = "xyes"; then
2650 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2651 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2652 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2653 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2655 if test "x$with_libvirt" = "xyes"
2657 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2662 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2668 if test "x$with_libvirt" = "xyes"
2670 SAVE_CPPFLAGS="$CPPFLAGS"
2671 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2673 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2674 [with_libvirt="no (libvirt/libvirt.h not found)"])
2676 CPPFLAGS="$SAVE_CPPFLAGS"
2678 if test "x$with_libvirt" = "xyes"
2680 SAVE_CFLAGS="$CFLAGS"
2681 SAVE_LDFLAGS="$LDFLAGS"
2683 CFLAGS="$CFLAGS $with_libvirt_cflags"
2684 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2686 AC_CHECK_LIB(virt, virDomainBlockStats,
2687 [with_libvirt="yes"],
2688 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2690 CFLAGS="$SAVE_CFLAGS"
2691 LDFLAGS="$SAVE_LDFLAGS"
2693 dnl Add the right compiler flags and libraries.
2694 if test "x$with_libvirt" = "xyes"; then
2695 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2696 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2697 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2698 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2702 # $PKG_CONFIG --exists OpenIPMIpthread {{{
2703 with_libopenipmipthread="yes"
2704 with_libopenipmipthread_cflags=""
2705 with_libopenipmipthread_libs=""
2707 AC_MSG_CHECKING([for pkg-config])
2709 if test "x$PKG_CONFIG" = "x"
2711 with_libopenipmipthread="no"
2714 temp_result="$PKG_CONFIG"
2716 AC_MSG_RESULT([$temp_result])
2718 if test "x$with_libopenipmipthread" = "xyes"
2720 AC_MSG_CHECKING([for libOpenIPMIpthread])
2721 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2724 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2726 AC_MSG_RESULT([$with_libopenipmipthread])
2729 if test "x$with_libopenipmipthread" = "xyes"
2731 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2732 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2735 with_libopenipmipthread_cflags="$temp_result"
2737 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2738 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2740 AC_MSG_RESULT([$temp_result])
2743 if test "x$with_libopenipmipthread" = "xyes"
2745 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2746 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2749 with_libopenipmipthread_ldflags="$temp_result"
2751 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2752 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2754 AC_MSG_RESULT([$temp_result])
2757 if test "x$with_libopenipmipthread" = "xyes"
2759 SAVE_CPPFLAGS="$CPPFLAGS"
2760 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2762 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2763 [with_libopenipmipthread="yes"],
2764 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2765 [#include <OpenIPMI/ipmiif.h>
2766 #include <OpenIPMI/ipmi_err.h>
2767 #include <OpenIPMI/ipmi_posix.h>
2768 #include <OpenIPMI/ipmi_conn.h>
2771 CPPFLAGS="$SAVE_CPPFLAGS"
2774 if test "x$with_libopenipmipthread" = "xyes"
2776 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2777 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2778 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2779 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2783 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
2784 [with_libnotify="yes"],
2785 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
2787 # Check for enabled/disabled features
2790 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2791 # ------------------------------------------------------------
2793 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2798 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2803 m4_define([EnDis],[disabled])dnl
2804 m4_define([YesNo],[no])dnl
2810 m4_define([EnDis],[enabled])dnl
2811 m4_define([YesNo],[yes])dnl
2814 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2818 m4_if([$3], [feature], [],
2822 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2828 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2830 enable_$1='[YesNo]'dnl
2832 if test "x$enable_$1" = "xno"
2836 if test "x$enable_$1" = "xyes"
2840 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2845 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2846 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2848 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2850 # AC_PLUGIN(name, default, info)
2851 # ------------------------------------------------------------
2857 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2859 if test "x$enableval" = "xyes"
2867 if test "x$2" = "xyes"
2874 if test "x$enable_plugin" = "xyes"
2876 if test "x$2" = "xyes"
2878 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2879 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2880 dependency_error="yes"
2881 enable_plugin="no (dependency error)"
2884 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2885 enable_$1="$enable_plugin"
2887 )# AC_PLUGIN(name, default, info)
2889 m4_divert_once([HELP_ENABLE], [
2890 collectd features:])
2891 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2892 AC_COLLECTD([debug], [enable], [feature], [debugging])
2893 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2894 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2896 dependency_error="no"
2905 plugin_interface="no"
2912 plugin_multimeter="no"
2915 plugin_processes="no"
2919 plugin_tcpconns="no"
2924 plugin_wireless="no"
2927 if test "x$ac_system" = "xLinux"
2929 plugin_battery="yes"
2931 plugin_cpufreq="yes"
2933 plugin_entropy="yes"
2934 plugin_interface="yes"
2939 plugin_processes="yes"
2942 plugin_tcpconns="yes"
2943 plugin_thermal="yes"
2945 plugin_vserver="yes"
2946 plugin_wireless="yes"
2948 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2954 if test "x$ac_system" = "xOpenBSD"
2956 plugin_tcpconns="yes"
2960 if test "x$with_libiokit" = "xyes"
2962 plugin_battery="yes"
2967 if test "x$with_devinfo$with_kstat" = "xyesyes"
2971 plugin_interface="yes"
2976 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
2982 if test "x$with_libstatgrab" = "xyes"
2986 plugin_interface="yes"
2993 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
2999 if test "x$with_libopenipmipthread" = "xyes"
3004 if test "x$have_processor_info" = "xyes"
3008 if test "x$have_sysctl" = "xyes"
3013 if test "x$have_sysctlbyname" = "xyes"
3017 plugin_tcpconns="yes"
3020 # Df plugin: Check if we know how to determine mount points first.
3021 #if test "x$have_listmntent" = "xyes"; then
3024 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
3028 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
3032 #if test "x$have_getmntent" = "xseq"
3036 if test "x$c_cv_have_one_getmntent" = "xyes"
3041 # Df plugin: Check if we have either `statfs' or `statvfs' second.
3042 if test "x$plugin_df" = "xyes"
3045 if test "x$have_statfs" = "xyes"
3049 if test "x$have_statvfs" = "xyes"
3055 if test "x$have_getifaddrs" = "xyes"
3057 plugin_interface="yes"
3060 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
3062 plugin_libvirt="yes"
3065 if test "x$have_getloadavg" = "xyes"
3070 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
3075 # Mac OS X memory interface
3076 if test "x$have_host_statistics" = "xyes"
3081 if test "x$have_termios_h" = "xyes"
3083 plugin_multimeter="yes"
3086 if test "x$have_thread_info" = "xyes"
3088 plugin_processes="yes"
3091 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
3093 plugin_processes="yes"
3096 if test "x$with_kvm_getswapinfo" = "xyes"
3101 if test "x$have_swapctl" = "xyes"
3106 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
3108 plugin_tcpconns="yes"
3111 if test "x$have_getutent" = "xyes"
3115 if test "x$have_getutxent" = "xyes"
3120 m4_divert_once([HELP_ENABLE], [
3123 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3124 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3125 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3126 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3127 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3128 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3129 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3130 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3131 AC_PLUGIN([csv], [yes], [CSV output plugin])
3132 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
3133 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3134 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3135 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3136 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3137 AC_PLUGIN([email], [yes], [EMail statistics])
3138 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3139 AC_PLUGIN([exec], [yes], [Execution of external programs])
3140 AC_PLUGIN([filecount], [yes], [Count files in directories])
3141 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3142 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3143 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3144 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3145 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3146 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3147 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3148 AC_PLUGIN([load], [$plugin_load], [System load])
3149 AC_PLUGIN([logfile], [yes], [File logging plugin])
3150 AC_PLUGIN([match_regex], [yes], [The regex match])
3151 AC_PLUGIN([match_timediff], [yes], [The timediff match])
3152 AC_PLUGIN([match_value], [yes], [The value match])
3153 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3154 AC_PLUGIN([memcached], [yes], [memcached statistics])
3155 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3156 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3157 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3158 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3159 AC_PLUGIN([network], [yes], [Network communication plugin])
3160 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3161 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3162 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3163 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3164 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3165 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3166 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3167 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3168 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3169 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3170 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3171 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3172 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3173 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3174 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3175 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3176 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3177 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3178 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3179 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3180 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3181 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3182 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3183 AC_PLUGIN([target_notification], [yes], [The notification target])
3184 AC_PLUGIN([target_replace], [yes], [The replace target])
3185 AC_PLUGIN([target_set], [yes], [The set target])
3186 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3187 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3188 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3189 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3190 AC_PLUGIN([users], [$plugin_users], [User statistics])
3191 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3192 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3193 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3194 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3195 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3198 if test "x$ac_system" = "xLinux" \
3199 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3201 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3205 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3207 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3209 PERL_BINDINGS_OPTIONS="$withval"
3210 with_perl_bindings="yes"
3212 PERL_BINDINGS_OPTIONS=""
3213 with_perl_bindings="$withval"
3217 PERL_BINDINGS_OPTIONS=""
3218 if test -n "$perl_interpreter"
3220 with_perl_bindings="yes"
3222 with_perl_bindings="no (no perl interpreter found)"
3225 if test "x$with_perl_bindings" = "xyes"
3227 PERL_BINDINGS="perl"
3231 AC_SUBST(PERL_BINDINGS)
3232 AC_SUBST(PERL_BINDINGS_OPTIONS)
3234 dnl libcollectdclient
3235 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3236 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3237 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3239 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3241 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3243 AC_SUBST(LCC_VERSION_MAJOR)
3244 AC_SUBST(LCC_VERSION_MINOR)
3245 AC_SUBST(LCC_VERSION_PATCH)
3246 AC_SUBST(LCC_VERSION_EXTRA)
3247 AC_SUBST(LCC_VERSION_STRING)
3249 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3251 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
3253 if test "x$with_librrd" = "xyes" \
3254 && test "x$librrd_threadsafe" != "xyes"
3256 with_librrd="yes (warning: librrd is not thread-safe)"
3259 if test "x$with_liboping" = "xyes" \
3260 && test "x$with_own_liboping" = "xyes"
3262 with_liboping="yes (shipped version)"
3265 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3267 with_libiptc="yes (shipped version)"
3270 if test "x$with_libperl" = "xyes"
3272 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3274 enable_perl="no (needs libperl)"
3277 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
3279 enable_perl="no (libperl doesn't support ithreads)"
3282 if test "x$with_perl_bindings" = "xyes" \
3283 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3285 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3292 libcurl . . . . . . . $with_libcurl
3293 libdbi . . . . . . . $with_libdbi
3294 libesmtp . . . . . . $with_libesmtp
3295 libiokit . . . . . . $with_libiokit
3296 libiptc . . . . . . . $with_libiptc
3297 libkstat . . . . . . $with_kstat
3298 libkvm . . . . . . . $with_libkvm
3299 libmysql . . . . . . $with_libmysql
3300 libnetlink . . . . . $with_libnetlink
3301 libnetsnmp . . . . . $with_libnetsnmp
3302 libnotify . . . . . . $with_libnotify
3303 liboconfig . . . . . $with_liboconfig
3304 libopenipmi . . . . . $with_libopenipmipthread
3305 liboping . . . . . . $with_liboping
3306 libpcap . . . . . . . $with_libpcap
3307 libperl . . . . . . . $with_libperl
3308 libpq . . . . . . . . $with_libpq
3309 libpthread . . . . . $with_libpthread
3310 librrd . . . . . . . $with_librrd
3311 libsensors . . . . . $with_libsensors
3312 libstatgrab . . . . . $with_libstatgrab
3313 libupsclient . . . . $with_libupsclient
3314 libvirt . . . . . . . $with_libvirt
3315 libxml2 . . . . . . . $with_libxml2
3316 libxmms . . . . . . . $with_libxmms
3317 oracle . . . . . . . $with_oracle
3320 daemon mode . . . . . $enable_daemon
3321 debug . . . . . . . . $enable_debug
3324 perl . . . . . . . . $with_perl_bindings
3327 apache . . . . . . . $enable_apache
3328 apcups . . . . . . . $enable_apcups
3329 apple_sensors . . . . $enable_apple_sensors
3330 ascent . . . . . . . $enable_ascent
3331 battery . . . . . . . $enable_battery
3332 bind . . . . . . . . $enable_bind
3333 cpu . . . . . . . . . $enable_cpu
3334 cpufreq . . . . . . . $enable_cpufreq
3335 csv . . . . . . . . . $enable_csv
3336 curl . . . . . . . . $enable_curl
3337 dbi . . . . . . . . . $enable_dbi
3338 df . . . . . . . . . $enable_df
3339 disk . . . . . . . . $enable_disk
3340 dns . . . . . . . . . $enable_dns
3341 email . . . . . . . . $enable_email
3342 entropy . . . . . . . $enable_entropy
3343 exec . . . . . . . . $enable_exec
3344 filecount . . . . . . $enable_filecount
3345 hddtemp . . . . . . . $enable_hddtemp
3346 interface . . . . . . $enable_interface
3347 ipmi . . . . . . . . $enable_ipmi
3348 iptables . . . . . . $enable_iptables
3349 ipvs . . . . . . . . $enable_ipvs
3350 irq . . . . . . . . . $enable_irq
3351 libvirt . . . . . . . $enable_libvirt
3352 load . . . . . . . . $enable_load
3353 logfile . . . . . . . $enable_logfile
3354 match_regex . . . . . $enable_match_regex
3355 match_timediff . . . $enable_match_timediff
3356 match_value . . . . . $enable_match_value
3357 mbmon . . . . . . . . $enable_mbmon
3358 memcached . . . . . . $enable_memcached
3359 memory . . . . . . . $enable_memory
3360 multimeter . . . . . $enable_multimeter
3361 mysql . . . . . . . . $enable_mysql
3362 netlink . . . . . . . $enable_netlink
3363 network . . . . . . . $enable_network
3364 nfs . . . . . . . . . $enable_nfs
3365 nginx . . . . . . . . $enable_nginx
3366 notify_desktop . . . $enable_notify_desktop
3367 notify_email . . . . $enable_notify_email
3368 ntpd . . . . . . . . $enable_ntpd
3369 nut . . . . . . . . . $enable_nut
3370 onewire . . . . . . . $enable_onewire
3371 openvpn . . . . . . . $enable_openvpn
3372 oracle . . . . . . . $enable_oracle
3373 perl . . . . . . . . $enable_perl
3374 ping . . . . . . . . $enable_ping
3375 postgresql . . . . . $enable_postgresql
3376 powerdns . . . . . . $enable_powerdns
3377 processes . . . . . . $enable_processes
3378 rrdcached . . . . . . $enable_rrdcached
3379 rrdtool . . . . . . . $enable_rrdtool
3380 sensors . . . . . . . $enable_sensors
3381 serial . . . . . . . $enable_serial
3382 snmp . . . . . . . . $enable_snmp
3383 swap . . . . . . . . $enable_swap
3384 syslog . . . . . . . $enable_syslog
3385 tail . . . . . . . . $enable_tail
3386 tape . . . . . . . . $enable_tape
3387 target_notification . $enable_target_notification
3388 target_replace . . . $enable_target_replace
3389 target_set . . . . . $enable_target_set
3390 tcpconns . . . . . . $enable_tcpconns
3391 teamspeak2 . . . . . $enable_teamspeak2
3392 thermal . . . . . . . $enable_thermal
3393 unixsock . . . . . . $enable_unixsock
3394 users . . . . . . . . $enable_users
3395 uuid . . . . . . . . $enable_uuid
3396 vmem . . . . . . . . $enable_vmem
3397 vserver . . . . . . . $enable_vserver
3398 wireless . . . . . . $enable_wireless
3399 xmms . . . . . . . . $enable_xmms
3403 if test "x$dependency_error" = "xyes"; then
3404 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
3407 # vim: set fdm=marker :