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"],
269 #undef _FILE_OFFSET_BITS
270 #undef _LARGEFILE64_SOURCE
272 # include <sys/types.h>
275 # include <sys/param.h>
279 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
282 if test "x$GCC" = "xyes"
284 hint_64="CFLAGS='-m64'"
286 hint_64="CFLAGS='-xarch=v9'"
288 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
292 # For the processes plugin
294 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
296 # For interface plugin
297 AC_CHECK_HEADERS(ifaddrs.h)
298 AC_CHECK_HEADERS(net/if.h, [], [],
301 # include <sys/types.h>
303 #if HAVE_SYS_SOCKET_H
304 # include <sys/socket.h>
307 AC_CHECK_HEADERS(linux/if.h, [], [],
310 # include <sys/types.h>
312 #if HAVE_SYS_SOCKET_H
313 # include <sys/socket.h>
316 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
319 # include <sys/types.h>
321 #if HAVE_SYS_SOCKET_H
322 # include <sys/socket.h>
325 # include <linux/if.h>
330 have_net_ip_vs_h="no"
332 if test "x$ac_system" = "xLinux"
335 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
337 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
338 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
344 AC_CHECK_HEADERS(sys/ucred.h, [], [],
347 # include <sys/types.h>
350 # include <sys/param.h>
354 # For mount interface
355 AC_CHECK_HEADERS(sys/mount.h, [], [],
358 # include <sys/types.h>
361 # include <sys/param.h>
365 # For the email plugin
366 AC_CHECK_HEADERS(linux/un.h, [], [],
368 #if HAVE_SYS_SOCKET_H
369 # include <sys/socket.h>
373 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)
376 AC_CHECK_HEADERS(arpa/nameser.h)
377 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
379 #if HAVE_ARPA_NAMESER_H
380 # include <arpa/nameser.h>
384 AC_CHECK_HEADERS(net/if_arp.h, [], [],
385 [#if HAVE_SYS_SOCKET_H
386 # include <sys/socket.h>
389 AC_CHECK_HEADERS(net/ppp_defs.h)
390 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
391 [#if HAVE_NET_PPP_DEFS_H
392 # include <net/ppp_defs.h>
395 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
400 # include <sys/types.h>
402 #if HAVE_SYS_SOCKET_H
403 # include <sys/socket.h>
408 #if HAVE_NETINET_IN_H
409 # include <netinet/in.h>
413 # For the multimeter plugin
415 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
418 # Checks for typedefs, structures, and compiler characteristics.
427 # Checks for library functions.
429 AC_PROG_GCC_TRADITIONAL
430 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
434 AC_CACHE_CHECK([for strtok_r],
435 [c_cv_have_strtok_r_default],
444 char buffer[] = "foo,bar,baz";
451 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
454 printf ("token = %s;\n", token);
457 [c_cv_have_strtok_r_default="yes"],
458 [c_cv_have_strtok_r_default="no"]
462 if test "x$c_cv_have_strtok_r_default" = "xno"
464 SAVE_CFLAGS="$CFLAGS"
465 CFLAGS="$CFLAGS -D_REENTRANT=1"
467 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
468 [c_cv_have_strtok_r_reentrant],
477 char buffer[] = "foo,bar,baz";
484 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
487 printf ("token = %s;\n", token);
490 [c_cv_have_strtok_r_reentrant="yes"],
491 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
496 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
498 socket_needs_socket="no"
499 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
500 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
502 nanosleep_needs_rt="no"
503 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
504 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
506 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
507 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
508 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
509 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
510 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
511 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
512 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
513 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
514 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
515 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
516 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
517 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
520 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
523 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
525 if test "x$withval" = "xno"; then
527 else if test "x$withval" = "xyes"; then
534 if test "x$nan_type" = "xnone"; then
535 AC_CACHE_CHECK([whether NAN is defined by default],
536 [c_cv_have_nan_default],
542 static float foo = NAN;
550 [c_cv_have_nan_default="yes"],
551 [c_cv_have_nan_default="no"]
554 if test "x$c_cv_have_nan_default" = "xyes"
559 if test "x$nan_type" = "xnone"; then
560 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
561 [c_cv_have_nan_isoc],
566 #define __USE_ISOC99 1
568 static float foo = NAN;
576 [c_cv_have_nan_isoc="yes"],
577 [c_cv_have_nan_isoc="no"]
580 if test "x$c_cv_have_nan_isoc" = "xyes"
585 if test "x$nan_type" = "xnone"; then
586 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
587 [c_cv_have_nan_zero],
596 #define NAN (0.0 / 0.0)
598 # define isnan(f) ((f) != (f))
600 static float foo = NAN;
608 [c_cv_have_nan_zero="yes"],
609 [c_cv_have_nan_zero="no"]
612 if test "x$c_cv_have_nan_zero" = "xyes"
618 if test "x$nan_type" = "xdefault"; then
619 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
620 [Define if NAN is defined by default and can initialize static variables.])
621 else if test "x$nan_type" = "xisoc99"; then
622 AC_DEFINE(NAN_STATIC_ISOC, 1,
623 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
624 else if test "x$nan_type" = "xzero"; then
625 AC_DEFINE(NAN_ZERO_ZERO, 1,
626 [Define if NAN can be defined as (0.0 / 0.0)])
628 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
631 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
633 if test "x$withval" = "xnothing"; then
634 fp_layout_type="nothing"
635 else if test "x$withval" = "xendianflip"; then
636 fp_layout_type="endianflip"
637 else if test "x$withval" = "xintswap"; then
638 fp_layout_type="intswap"
640 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
643 [fp_layout_type="unknown"])
645 if test "x$fp_layout_type" = "xunknown"; then
646 AC_CACHE_CHECK([if doubles are stored in x86 representation],
647 [c_cv_fp_layout_need_nothing],
658 # include <stdbool.h>
668 memcpy ((void *) &i0, (void *) &d, 8);
671 memcpy ((void *) c, (void *) &i1, 8);
673 if ((c[0] == 0x2f) && (c[1] == 0x25)
674 && (c[2] == 0xc0) && (c[3] == 0xc7)
675 && (c[4] == 0x43) && (c[5] == 0x2b)
676 && (c[6] == 0x1f) && (c[7] == 0x5b))
681 [c_cv_fp_layout_need_nothing="yes"],
682 [c_cv_fp_layout_need_nothing="no"]
685 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
686 fp_layout_type="nothing"
689 if test "x$fp_layout_type" = "xunknown"; then
690 AC_CACHE_CHECK([if endianflip converts to x86 representation],
691 [c_cv_fp_layout_need_endianflip],
702 # include <stdbool.h>
704 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
705 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
706 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
707 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
708 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
709 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
710 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
711 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
720 memcpy ((void *) &i0, (void *) &d, 8);
722 i1 = endianflip (i0);
723 memcpy ((void *) c, (void *) &i1, 8);
725 if ((c[0] == 0x2f) && (c[1] == 0x25)
726 && (c[2] == 0xc0) && (c[3] == 0xc7)
727 && (c[4] == 0x43) && (c[5] == 0x2b)
728 && (c[6] == 0x1f) && (c[7] == 0x5b))
733 [c_cv_fp_layout_need_endianflip="yes"],
734 [c_cv_fp_layout_need_endianflip="no"]
737 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
738 fp_layout_type="endianflip"
741 if test "x$fp_layout_type" = "xunknown"; then
742 AC_CACHE_CHECK([if intswap converts to x86 representation],
743 [c_cv_fp_layout_need_intswap],
754 # include <stdbool.h>
756 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
757 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
766 memcpy ((void *) &i0, (void *) &d, 8);
769 memcpy ((void *) c, (void *) &i1, 8);
771 if ((c[0] == 0x2f) && (c[1] == 0x25)
772 && (c[2] == 0xc0) && (c[3] == 0xc7)
773 && (c[4] == 0x43) && (c[5] == 0x2b)
774 && (c[6] == 0x1f) && (c[7] == 0x5b))
779 [c_cv_fp_layout_need_intswap="yes"],
780 [c_cv_fp_layout_need_intswap="no"]
783 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
784 fp_layout_type="intswap"
788 if test "x$fp_layout_type" = "xnothing"; then
789 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
790 [Define if doubles are stored in x86 representation.])
791 else if test "x$fp_layout_type" = "xendianflip"; then
792 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
793 [Define if endianflip is needed to convert to x86 representation.])
794 else if test "x$fp_layout_type" = "xintswap"; then
795 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
796 [Define if intswap is needed to convert to x86 representation.])
798 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
802 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
804 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
806 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
809 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
810 if test "x$have_getmntent" = "xno"; then
811 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
813 if test "x$have_getmntent" = "xno"; then
814 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
816 if test "x$have_getmntent" = "xno"; then
817 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
820 if test "x$have_getmntent" = "xc"; then
821 AC_CACHE_CHECK([whether getmntent takes one argument],
822 [c_cv_have_one_getmntent],
824 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
825 #include "$srcdir/src/utils_mount.h"]],
829 fh = setmntent ("/etc/mtab", "r");
833 [c_cv_have_one_getmntent="yes"],
834 [c_cv_have_one_getmntent="no"]
837 AC_CACHE_CHECK([whether getmntent takes two arguments],
838 [c_cv_have_two_getmntent],
840 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
841 #include "$srcdir/src/utils_mount.h"]],
846 fh = fopen ("/etc/mnttab", "r");
847 status = getmntent (fh, &mt);
850 [c_cv_have_two_getmntent="yes"],
851 [c_cv_have_two_getmntent="no"]
856 # Check for different versions of `getmntent' here..
858 if test "x$have_getmntent" = "xc"; then
859 if test "x$c_cv_have_one_getmntent" = "xyes"; then
860 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
861 [Define if the function getmntent exists and takes one argument.])
863 if test "x$c_cv_have_two_getmntent" = "xyes"; then
864 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
865 [Define if the function getmntent exists and takes two arguments.])
868 if test "x$have_getmntent" = "xsun"; then
869 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
870 [Define if the function getmntent exists. It's the version from libsun.])
872 if test "x$have_getmntent" = "xseq"; then
873 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
874 [Define if the function getmntent exists. It's the version from libseq.])
876 if test "x$have_getmntent" = "xgen"; then
877 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
878 [Define if the function getmntent exists. It's the version from libgen.])
881 # Check for structures
882 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
883 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
886 #include <sys/types.h>
887 #include <sys/socket.h>
890 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
891 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
894 #include <sys/types.h>
895 #include <sys/socket.h>
896 #include <linux/if.h>
897 #include <linux/netdevice.h>
900 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
902 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
903 [Define if struct kinfo_proc exists in the FreeBSD variant.])
904 have_struct_kinfo_proc_freebsd="yes"
907 have_struct_kinfo_proc_freebsd="no"
911 #include <sys/param.h>
912 #include <sys/sysctl.h>
913 #include <sys/user.h>
916 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
918 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
919 [Define if struct kinfo_proc exists in the OpenBSD variant.])
920 have_struct_kinfo_proc_openbsd="yes"
923 have_struct_kinfo_proc_openbsd="no"
926 #include <sys/param.h>
927 #include <sys/sysctl.h>
931 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
936 # include <sys/types.h>
938 #if HAVE_NETINET_IN_SYSTM_H
939 # include <netinet/in_systm.h>
941 #if HAVE_NETINET_IN_H
942 # include <netinet/in.h>
944 #if HAVE_NETINET_IP_H
945 # include <netinet/ip.h>
947 #if HAVE_NETINET_UDP_H
948 # include <netinet/udp.h>
951 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
956 # include <sys/types.h>
958 #if HAVE_NETINET_IN_SYSTM_H
959 # include <netinet/in_systm.h>
961 #if HAVE_NETINET_IN_H
962 # include <netinet/in.h>
964 #if HAVE_NETINET_IP_H
965 # include <netinet/ip.h>
967 #if HAVE_NETINET_UDP_H
968 # include <netinet/udp.h>
972 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
982 # Checks for libraries begin here
985 AC_CHECK_LIB(resolv, res_search,
987 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
989 [with_libresolv="no"])
990 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
992 dnl Check for HAL (hardware abstraction library)
994 AC_CHECK_LIB(hal,libhal_device_property_exists,
995 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
997 if test "x$with_libhal" = "xyes"; then
998 if test "x$PKG_CONFIG" != "x"; then
999 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1000 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1001 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1002 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1006 m4_divert_once([HELP_WITH], [
1007 collectd additional packages:])
1009 if test "x$ac_system" = "xSolaris"
1014 with_kstat="no (Solaris only)"
1015 with_devinfo="no (Solaris only)"
1018 if test "x$with_kstat" = "xyes"
1020 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1022 if test "x$with_kstat" = "xyes"
1024 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1025 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1027 if test "x$with_kstat" = "xyes"
1029 AC_DEFINE(HAVE_LIBKSTAT, 1,
1030 [Define to 1 if you have the 'kstat' library (-lkstat)])
1032 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1033 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1036 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1043 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1046 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1047 if test "x$with_kvm_getprocs" = "xyes"
1049 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1050 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1053 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1055 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1056 if test "x$with_kvm_getswapinfo" = "xyes"
1058 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1059 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1062 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1064 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1065 if test "x$with_kvm_nlist" = "xyes"
1067 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1068 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1071 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1073 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1074 if test "x$with_kvm_openfiles" = "xyes"
1076 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1077 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1080 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1082 # --with-libcurl {{{
1083 with_curl_config="curl-config"
1086 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1088 if test "x$withval" = "xno"
1091 else if test "x$withval" = "xyes"
1095 if test -f "$withval" && test -x "$withval"
1097 with_curl_config="$withval"
1099 else if test -x "$withval/bin/curl-config"
1101 with_curl_config="$withval/bin/curl-config"
1110 if test "x$with_libcurl" = "xyes"
1112 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1113 curl_config_status=$?
1115 if test $curl_config_status -ne 0
1117 with_libcurl="no ($with_curl_config failed)"
1119 SAVE_CPPFLAGS="$CPPFLAGS"
1120 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1122 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1124 CPPFLAGS="$SAVE_CPPFLAGS"
1127 if test "x$with_libcurl" = "xyes"
1129 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1130 curl_config_status=$?
1132 if test $curl_config_status -ne 0
1134 with_libcurl="no ($with_curl_config failed)"
1136 AC_CHECK_LIB(curl, curl_easy_init,
1137 [with_libcurl="yes"],
1138 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1142 if test "x$with_libcurl" = "xyes"
1144 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1145 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1146 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1147 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1149 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1153 with_libdbi_cppflags=""
1154 with_libdbi_ldflags=""
1155 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1157 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1159 with_libdbi_cppflags="-I$withval/include"
1160 with_libdbi_ldflags="-L$withval/lib"
1163 with_libdbi="$withval"
1169 if test "x$with_libdbi" = "xyes"
1171 SAVE_CPPFLAGS="$CPPFLAGS"
1172 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1174 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1176 CPPFLAGS="$SAVE_CPPFLAGS"
1178 if test "x$with_libdbi" = "xyes"
1180 SAVE_CPPFLAGS="$CPPFLAGS"
1181 SAVE_LDFLAGS="$LDFLAGS"
1182 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1183 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1185 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1187 CPPFLAGS="$SAVE_CPPFLAGS"
1188 LDFLAGS="$SAVE_LDFLAGS"
1190 if test "x$with_libdbi" = "xyes"
1192 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1193 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1194 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1195 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1196 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1197 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1199 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1202 # --with-libesmtp {{{
1203 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1205 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1207 LDFLAGS="$LDFLAGS -L$withval/lib"
1208 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1211 with_libesmtp="$withval"
1217 if test "x$with_libesmtp" = "xyes"
1219 AC_CHECK_LIB(esmtp, smtp_create_session,
1221 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1222 ], [with_libesmtp="no (libesmtp not found)"])
1224 if test "x$with_libesmtp" = "xyes"
1226 AC_CHECK_HEADERS(libesmtp.h,
1228 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1229 ], [with_libesmtp="no (libesmtp.h not found)"])
1231 if test "x$with_libesmtp" = "xyes"
1237 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1238 [Wether or not to use the esmtp library])
1239 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1242 # --with-libiptc {{{
1243 with_own_libiptc="no"
1244 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1246 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1248 LDFLAGS="$LDFLAGS -L$withval/lib"
1249 CPPFLAGS="$CPPFLAGS -I$withval/include"
1252 with_libiptc="$withval"
1256 if test "x$ac_system" = "xLinux"
1260 with_libiptc="no (Linux only)"
1263 if test "x$with_libiptc" = "xyes"
1265 AC_CHECK_LIB(iptc, iptc_init,
1267 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1271 with_own_libiptc="yes"
1274 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1276 AC_CHECK_HEADERS(libiptc/libiptc.h,
1278 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1282 with_own_libiptc="yes"
1285 if test "x$with_libiptc" = "xyes"
1288 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1290 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1292 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1293 with_own_libiptc="no"
1296 #include "$srcdir/src/libiptc/ipt_kernel_headers.h"
1301 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1302 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1303 if test "x$with_own_libiptc" = "xyes"
1305 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1309 # --with-libmysql {{{
1310 with_mysql_config="mysql_config"
1311 with_mysql_cflags=""
1313 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1315 if test "x$withval" = "xno"
1318 else if test "x$withval" = "xyes"
1322 if test -f "$withval" && test -x "$withval";
1324 with_mysql_config="$withval"
1325 else if test -x "$withval/bin/mysql_config"
1327 with_mysql_config="$withval/bin/mysql_config"
1335 if test "x$with_libmysql" = "xyes"
1337 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1338 mysql_config_status=$?
1340 if test $mysql_config_status -ne 0
1342 with_libmysql="no ($with_mysql_config failed)"
1344 SAVE_CPPFLAGS="$CPPFLAGS"
1345 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1348 have_mysql_mysql_h="no"
1349 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1351 if test "x$have_mysql_h" = "xno"
1353 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1356 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1358 with_libmysql="no (mysql.h not found)"
1361 CPPFLAGS="$SAVE_CPPFLAGS"
1364 if test "x$with_libmysql" = "xyes"
1366 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1367 mysql_config_status=$?
1369 if test $mysql_config_status -ne 0
1371 with_libmysql="no ($with_mysql_config failed)"
1373 AC_CHECK_LIB(mysqlclient, mysql_init,
1374 [with_libmysql="yes"],
1375 [with_libmysql="no (symbol 'mysql_init' not found)"],
1378 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1379 [with_libmysql="yes"],
1380 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1384 if test "x$with_libmysql" = "xyes"
1386 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1387 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1388 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1389 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1391 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1394 # --with-libnetlink {{{
1395 with_libnetlink_cflags=""
1396 with_libnetlink_libs="-lnetlink"
1397 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1399 echo "libnetlink: withval = $withval"
1400 if test "x$withval" = "xyes"
1402 with_libnetlink="yes"
1403 else if test "x$withval" = "xno"
1405 with_libnetlink="no"
1407 if test -d "$withval/include"
1409 with_libnetlink_cflags="-I$withval/include"
1410 with_libnetlink_libs="-L$withval/lib -lnetlink"
1411 with_libnetlink="yes"
1413 AC_MSG_ERROR("no such directory: $withval/include")
1418 if test "x$ac_system" = "xLinux"
1420 with_libnetlink="yes"
1422 with_libnetlink="no (Linux only library)"
1425 if test "x$with_libnetlink" = "xyes"
1428 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1430 with_libnetlink="no (libnetlink.h not found)"
1432 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1434 with_libnetlink="yes"
1438 #include <sys/types.h>
1439 #include <asm/types.h>
1440 #include <sys/socket.h>
1441 #include <linux/netlink.h>
1442 #include <linux/rtnetlink.h>])
1443 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1445 #include <sys/types.h>
1446 #include <asm/types.h>
1447 #include <sys/socket.h>])
1451 #include <sys/types.h>
1452 #include <asm/types.h>
1453 #include <sys/socket.h>
1454 #include <linux/netlink.h>
1455 #include <linux/rtnetlink.h>
1459 int retval = TCA_STATS2;
1462 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1467 #include <sys/types.h>
1468 #include <asm/types.h>
1469 #include <sys/socket.h>
1470 #include <linux/netlink.h>
1471 #include <linux/rtnetlink.h>
1475 int retval = TCA_STATS;
1478 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1481 CFLAGS="$SAVE_CFLAGS"
1483 if test "x$with_libnetlink" = "xyes"
1485 AC_CHECK_LIB(netlink, rtnl_open,
1486 [with_libnetlink="yes"],
1487 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1488 [$with_libnetlink_libs])
1490 if test "x$with_libnetlink" = "xyes"
1492 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1493 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1494 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1495 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1497 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1500 # --with-libnetsnmp {{{
1501 with_snmp_config="net-snmp-config"
1504 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1506 if test "x$withval" = "xno"
1508 with_libnetsnmp="no"
1509 else if test "x$withval" = "xyes"
1511 with_libnetsnmp="yes"
1513 if test -x "$withval"
1515 with_snmp_config="$withval"
1516 with_libnetsnmp="yes"
1518 with_snmp_config="$withval/bin/net-snmp-config"
1519 with_libnetsnmp="yes"
1523 [with_libnetsnmp="yes"])
1524 if test "x$with_libnetsnmp" = "xyes"
1526 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1527 snmp_config_status=$?
1529 if test $snmp_config_status -ne 0
1531 with_libnetsnmp="no ($with_snmp_config failed)"
1533 SAVE_CPPFLAGS="$CPPFLAGS"
1534 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1536 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1538 CPPFLAGS="$SAVE_CPPFLAGS"
1541 if test "x$with_libnetsnmp" = "xyes"
1543 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1544 snmp_config_status=$?
1546 if test $snmp_config_status -ne 0
1548 with_libnetsnmp="no ($with_snmp_config failed)"
1550 AC_CHECK_LIB(netsnmp, init_snmp,
1551 [with_libnetsnmp="yes"],
1552 [with_libnetsnmp="no (libnetsnmp not found)"],
1556 if test "x$with_libnetsnmp" = "xyes"
1558 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1559 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1560 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1561 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1563 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1566 # --with-liboconfig {{{
1567 with_own_liboconfig="no"
1568 liboconfig_LDFLAGS="$LDFLAGS"
1569 liboconfig_CPPFLAGS="$CPPFLAGS"
1570 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1572 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1574 if test -d "$withval/lib"
1576 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1578 if test -d "$withval/include"
1580 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1583 if test "x$withval" = "xno"
1585 AC_MSG_ERROR("liboconfig is required")
1589 with_liboconfig="yes"
1592 save_LDFLAGS="$LDFLAGS"
1593 save_CPPFLAGS="$CPPFLAGS"
1594 LDFLAGS="$liboconfig_LDFLAGS"
1595 CPPFLAGS="$liboconfig_CPPFLAGS"
1596 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1598 with_liboconfig="yes"
1599 with_own_liboconfig="no"
1602 with_liboconfig="yes"
1603 with_own_liboconfig="yes"
1604 LDFLAGS="$save_LDFLAGS"
1605 CPPFLAGS="$save_CPPFLAGS"
1608 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1609 if test "x$with_own_liboconfig" = "xyes"
1611 with_liboconfig="yes (shipped version)"
1615 # --with-liboping {{{
1616 with_own_liboping="no"
1617 liboping_LDFLAGS="$LDFLAGS"
1618 liboping_CPPFLAGS="$CPPFLAGS"
1619 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1621 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1623 if test -d "$withval/lib"
1625 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1627 if test -d "$withval/include"
1629 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1632 if test "x$withval" = "xno"
1635 with_own_liboping="no"
1636 else if test "x$withval" = "xyes"
1645 if test "x$with_liboping" = "xyes"
1647 save_LDFLAGS="$LDFLAGS"
1648 save_CPPFLAGS="$CPPFLAGS"
1649 LDFLAGS="$liboping_LDFLAGS"
1650 CPPFLAGS="$liboping_CPPFLAGS"
1651 AC_CHECK_LIB(oping, ping_construct,
1654 with_own_liboping="no"
1658 with_own_liboping="yes"
1659 LDFLAGS="$save_LDFLAGS"
1660 CPPFLAGS="$save_CPPFLAGS"
1663 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1664 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1668 with_oracle_cppflags=""
1670 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
1672 if test "x$withval" = "xyes"
1674 if test "x$ORACLE_HOME" = "x"
1676 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
1679 else if test "x$withval" = "xno"
1684 ORACLE_HOME="$withval"
1688 if test "x$ORACLE_HOME" = "x"
1690 with_oracle="no (ORACLE_HOME is not set)"
1695 if test "x$ORACLE_HOME" != "x"
1697 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
1699 if test -e "$ORACLE_HOME/lib/ldflags"
1701 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
1703 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
1704 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
1706 if test "x$with_oracle" = "xyes"
1708 SAVE_CPPFLAGS="$CPPFLAGS"
1709 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1711 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
1713 CPPFLAGS="$SAVE_CPPFLAGS"
1715 if test "x$with_oracle" = "xyes"
1717 SAVE_CPPFLAGS="$CPPFLAGS"
1718 SAVE_LDFLAGS="$LDFLAGS"
1719 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1720 LDFLAGS="$LDFLAGS $with_oracle_libs"
1722 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
1724 CPPFLAGS="$SAVE_CPPFLAGS"
1725 LDFLAGS="$SAVE_LDFLAGS"
1727 if test "x$with_oracle" = "xyes"
1729 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
1730 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
1731 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
1732 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
1736 # --with-libowcapi {{{
1737 with_libowcapi_cppflags=""
1738 with_libowcapi_libs="-lowcapi"
1739 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
1741 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1743 with_libowcapi_cppflags="-I$withval/include"
1744 with_libowcapi_libs="-L$withval/lib -lowcapi"
1745 with_libowcapi="yes"
1747 with_libowcapi="$withval"
1751 with_libowcapi="yes"
1753 if test "x$with_libowcapi" = "xyes"
1755 SAVE_CPPFLAGS="$CPPFLAGS"
1756 CPPFLAGS="$with_libowcapi_cppflags"
1758 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
1760 CPPFLAGS="$SAVE_CPPFLAGS"
1762 if test "x$with_libowcapi" = "xyes"
1764 SAVE_LDFLAGS="$LDFLAGS"
1765 SAVE_CPPFLAGS="$CPPFLAGS"
1766 LDFLAGS="$with_libowcapi_libs"
1767 CPPFLAGS="$with_libowcapi_cppflags"
1769 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
1771 LDFLAGS="$SAVE_LDFLAGS"
1772 CPPFLAGS="$SAVE_CPPFLAGS"
1774 if test "x$with_libowcapi" = "xyes"
1776 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
1777 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
1778 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
1779 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
1783 # --with-libpcap {{{
1784 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1786 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1788 LDFLAGS="$LDFLAGS -L$withval/lib"
1789 CPPFLAGS="$CPPFLAGS -I$withval/include"
1792 with_libpcap="$withval"
1798 if test "x$with_libpcap" = "xyes"
1800 AC_CHECK_LIB(pcap, pcap_open_live,
1802 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1803 ], [with_libpcap="no (libpcap not found)"])
1805 if test "x$with_libpcap" = "xyes"
1807 AC_CHECK_HEADERS(pcap.h,
1809 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1810 ], [with_libpcap="no (pcap.h not found)"])
1812 if test "x$with_libpcap" = "xyes"
1818 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1819 [Wether or not to use the pcap library])
1820 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1823 # --with-libperl {{{
1824 perl_interpreter="perl"
1825 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1827 if test -x "$withval"
1829 perl_interpreter="$withval"
1831 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1833 LDFLAGS="$LDFLAGS -L$withval/lib"
1834 CPPFLAGS="$CPPFLAGS -I$withval/include"
1835 perl_interpreter="$withval/bin/perl"
1838 with_libperl="$withval"
1845 AC_MSG_CHECKING([for perl])
1846 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
1847 if test -x "$perl_interpreter"
1849 AC_MSG_RESULT([yes ($perl_interpreter)])
1855 AC_SUBST(PERL, "$perl_interpreter")
1857 if test "x$with_libperl" = "xyes" \
1858 && test -n "$perl_interpreter"
1861 SAVE_LDFLAGS=$LDFLAGS
1862 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
1863 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
1864 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
1865 CFLAGS="$CFLAGS $PERL_CFLAGS"
1866 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1868 AC_CACHE_CHECK([for libperl],
1869 [c_cv_have_libperl],
1873 #define PERL_NO_GET_CONTEXT
1880 load_module (PERL_LOADMOD_NOIMPORT,
1881 newSVpv ("Collectd::Plugin::FooBar", 24),
1884 [c_cv_have_libperl="yes"],
1885 [c_cv_have_libperl="no"]
1889 if test "x$c_cv_have_libperl" = "xyes"
1891 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1892 AC_SUBST(PERL_CFLAGS)
1893 AC_SUBST(PERL_LDFLAGS)
1899 LDFLAGS=$SAVE_LDFLAGS
1900 else if test -z "$perl_interpreter"; then
1901 with_libperl="no (no perl interpreter found)"
1902 c_cv_have_libperl="no"
1904 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1906 if test "x$with_libperl" = "xyes"
1909 SAVE_LDFLAGS=$LDFLAGS
1910 CFLAGS="$CFLAGS $PERL_CFLAGS"
1911 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1913 AC_CACHE_CHECK([if perl supports ithreads],
1914 [c_cv_have_perl_ithreads],
1922 #if !defined(USE_ITHREADS)
1923 # error "Perl does not support ithreads!"
1924 #endif /* !defined(USE_ITHREADS) */
1927 [c_cv_have_perl_ithreads="yes"],
1928 [c_cv_have_perl_ithreads="no"]
1932 if test "x$c_cv_have_perl_ithreads" = "xyes"
1934 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1938 LDFLAGS=$SAVE_LDFLAGS
1941 c_cv_have_broken_perl_load_module="no"
1942 if test "x$with_libperl" = "xyes"
1945 SAVE_LDFLAGS=$LDFLAGS
1946 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
1947 # (see issues #41 and #42)
1948 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
1949 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1951 AC_CACHE_CHECK([for broken Perl_load_module()],
1952 [c_cv_have_broken_perl_load_module],
1956 #define PERL_NO_GET_CONTEXT
1963 load_module (PERL_LOADMOD_NOIMPORT,
1964 newSVpv ("Collectd::Plugin::FooBar", 24),
1967 [c_cv_have_broken_perl_load_module="no"],
1968 [c_cv_have_broken_perl_load_module="yes"]
1973 LDFLAGS=$SAVE_LDFLAGS
1975 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
1976 test "x$c_cv_have_broken_perl_load_module" = "xyes")
1978 if test "x$with_libperl" = "xyes"
1981 SAVE_LDFLAGS=$LDFLAGS
1982 CFLAGS="$CFLAGS $PERL_CFLAGS"
1983 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1986 [struct mgvtbl.svt_local],
1987 [have_struct_mgvtbl_svt_local="yes"],
1988 [have_struct_mgvtbl_svt_local="no"],
1995 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
1997 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
1998 [Define if Perl's struct mgvtbl has member svt_local.])
2002 LDFLAGS=$SAVE_LDFLAGS
2007 with_pg_config="pg_config"
2008 with_libpq_includedir=""
2009 with_libpq_libdir=""
2010 with_libpq_cppflags=""
2011 with_libpq_ldflags=""
2012 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2015 if test "x$withval" = "xno"
2018 else if test "x$withval" = "xyes"
2022 if test -f "$withval" && test -x "$withval";
2024 with_pg_config="$withval"
2025 else if test -x "$withval/bin/pg_config"
2027 with_pg_config="$withval/bin/pg_config"
2035 if test "x$with_libpq" = "xyes"
2037 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2040 if test $pg_config_status -eq 0
2042 if test -n "$with_libpq_includedir"; then
2043 for dir in $with_libpq_includedir; do
2044 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2048 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2051 SAVE_CPPFLAGS="$CPPFLAGS"
2052 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2054 AC_CHECK_HEADERS(libpq-fe.h, [],
2055 [with_libpq="no (libpq-fe.h not found)"], [])
2057 CPPFLAGS="$SAVE_CPPFLAGS"
2059 if test "x$with_libpq" = "xyes"
2061 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2064 if test $pg_config_status -eq 0
2066 if test -n "$with_libpq_libdir"; then
2067 for dir in $with_libpq_libdir; do
2068 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2072 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2075 SAVE_LDFLAGS="$LDFLAGS"
2076 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2078 AC_CHECK_LIB(pq, PQconnectdb,
2080 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2082 LDFLAGS="$SAVE_LDFLAGS"
2084 if test "x$with_libpq" = "xyes"
2086 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2087 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2088 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2089 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2091 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2094 # --with-libpthread {{{
2095 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2096 [ if test "x$withval" != "xno" \
2097 && test "x$withval" != "xyes"
2099 LDFLAGS="$LDFLAGS -L$withval/lib"
2100 CPPFLAGS="$CPPFLAGS -I$withval/include"
2101 with_libpthread="yes"
2103 if test "x$withval" = "xno"
2105 with_libpthread="no (disabled)"
2108 ], [with_libpthread="yes"])
2109 if test "x$with_libpthread" = "xyes"
2111 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2114 if test "x$with_libpthread" = "xyes"
2116 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2118 if test "x$with_libpthread" = "xyes"
2124 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2125 [Wether or not to use pthread (POSIX threads) library])
2126 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2130 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2133 librrd_threadsafe="yes"
2134 librrd_rrdc_update="no"
2135 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2136 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2138 librrd_cflags="-I$withval/include"
2139 librrd_ldflags="-L$withval/lib"
2142 with_librrd="$withval"
2144 ], [with_librrd="yes"])
2145 if test "x$with_librrd" = "xyes"
2147 SAVE_CPPFLAGS="$CPPFLAGS"
2148 SAVE_LDFLAGS="$LDFLAGS"
2150 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2151 LDFLAGS="$LDFLAGS $librrd_ldflags"
2153 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2155 CPPFLAGS="$SAVE_CPPFLAGS"
2156 LDFLAGS="$SAVE_LDFLAGS"
2158 if test "x$with_librrd" = "xyes"
2160 SAVE_CPPFLAGS="$CPPFLAGS"
2161 SAVE_LDFLAGS="$LDFLAGS"
2163 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2164 LDFLAGS="$LDFLAGS $librrd_ldflags"
2166 AC_CHECK_LIB(rrd_th, rrd_update_r,
2168 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2170 [librrd_threadsafe="no"
2171 AC_CHECK_LIB(rrd, rrd_update,
2173 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2175 [with_librrd="no (symbol 'rrd_update' not found)"],
2180 if test "x$librrd_threadsafe" = "xyes"
2182 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2184 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2187 CPPFLAGS="$SAVE_CPPFLAGS"
2188 LDFLAGS="$SAVE_LDFLAGS"
2190 if test "x$with_librrd" = "xyes"
2192 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2193 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2194 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2195 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2197 if test "x$librrd_threadsafe" = "xyes"
2199 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2203 # --with-libsensors {{{
2204 with_sensors_cflags=""
2205 with_sensors_ldflags=""
2206 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2208 if test "x$withval" = "xno"
2210 with_libsensors="no"
2212 with_libsensors="yes"
2213 if test "x$withval" != "xyes"
2215 with_sensors_cflags="-I$withval/include"
2216 with_sensors_ldflags="-L$withval/lib"
2217 with_libsensors="yes"
2222 if test "x$ac_system" = "xLinux"
2224 with_libsensors="yes"
2226 with_libsensors="no (Linux only library)"
2229 if test "x$with_libsensors" = "xyes"
2231 SAVE_CPPFLAGS="$CPPFLAGS"
2232 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2234 # AC_CHECK_HEADERS(sensors/sensors.h,
2236 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2238 # [with_libsensors="no (sensors/sensors.h not found)"])
2239 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2241 CPPFLAGS="$SAVE_CPPFLAGS"
2243 if test "x$with_libsensors" = "xyes"
2245 SAVE_CPPFLAGS="$CPPFLAGS"
2246 SAVE_LDFLAGS="$LDFLAGS"
2247 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2248 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2250 AC_CHECK_LIB(sensors, sensors_init,
2252 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2254 [with_libsensors="no (libsensors not found)"])
2256 CPPFLAGS="$SAVE_CPPFLAGS"
2257 LDFLAGS="$SAVE_LDFLAGS"
2259 if test "x$with_libsensors" = "xyes"
2261 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2262 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2263 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2264 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2266 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2269 # --with-libstatgrab {{{
2270 with_libstatgrab_cflags=""
2271 with_libstatgrab_ldflags=""
2272 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2274 if test "x$withval" != "xno" \
2275 && test "x$withval" != "xyes"
2277 with_libstatgrab_cflags="-I$withval/include"
2278 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
2279 with_libstatgrab="yes"
2280 with_libstatgrab_pkg_config="no"
2282 with_libstatgrab="$withval"
2283 with_libstatgrab_pkg_config="yes"
2287 with_libstatgrab="yes"
2288 with_libstatgrab_pkg_config="yes"
2291 if test "x$with_libstatgrab" = "xyes" \
2292 && test "x$with_libstatgrab_pkg_config" = "xyes"
2294 if test "x$PKG_CONFIG" != "x"
2296 AC_MSG_CHECKING([pkg-config for libstatgrab])
2298 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2301 with_libstatgrab_pkg_config="no"
2302 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
2303 temp_result="not found"
2305 AC_MSG_RESULT([$temp_result])
2307 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2308 with_libstatgrab_pkg_config="no"
2309 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2313 if test "x$with_libstatgrab" = "xyes" \
2314 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2315 && test "x$with_libstatgrab_cflags" = "x"
2317 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2318 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2321 with_libstatgrab_cflags="$temp_result"
2323 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2324 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2326 AC_MSG_RESULT([$temp_result])
2329 if test "x$with_libstatgrab" = "xyes" \
2330 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2331 && test "x$with_libstatgrab_ldflags" = "x"
2333 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2334 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2337 with_libstatgrab_ldflags="$temp_result"
2339 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2340 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2342 AC_MSG_RESULT([$temp_result])
2345 if test "x$with_libstatgrab" = "xyes"
2347 SAVE_CPPFLAGS="$CPPFLAGS"
2348 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2350 AC_CHECK_HEADERS(statgrab.h,
2351 [with_libstatgrab="yes"],
2352 [with_libstatgrab="no (statgrab.h not found)"])
2354 CPPFLAGS="$SAVE_CPPFLAGS"
2357 if test "x$with_libstatgrab" = "xyes"
2359 SAVE_CFLAGS="$CFLAGS"
2360 SAVE_LDFLAGS="$LDFLAGS"
2362 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2363 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2365 AC_CHECK_LIB(statgrab, sg_init,
2366 [with_libstatgrab="yes"],
2367 [with_libstatgrab="no (symbol sg_init not found)"])
2369 CFLAGS="$SAVE_CFLAGS"
2370 LDFLAGS="$SAVE_LDFLAGS"
2373 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2374 if test "x$with_libstatgrab" = "xyes"
2376 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2377 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2378 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2379 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2380 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2384 # --with-libupsclient {{{
2385 with_libupsclient_config=""
2386 with_libupsclient_cflags=""
2387 with_libupsclient_libs=""
2388 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2390 if test "x$withval" = "xno"
2392 with_libupsclient="no"
2393 else if test "x$withval" = "xyes"
2395 with_libupsclient="use_pkgconfig"
2397 if test -x "$withval"
2399 with_libupsclient_config="$withval"
2400 with_libupsclient="use_libupsclient_config"
2401 else if test -x "$withval/bin/libupsclient-config"
2403 with_libupsclient_config="$withval/bin/net-snmp-config"
2404 with_libupsclient="use_libupsclient_config"
2406 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
2407 with_libupsclient_cflags="-I$withval/include"
2408 with_libupsclient_libs="-L$withval/lib -lupsclient"
2409 with_libupsclient="yes"
2413 [with_libupsclient="use_pkgconfig"])
2415 # configure using libupsclient-config
2416 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2418 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
2419 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
2422 with_libupsclient="no ($with_libupsclient_config failed)"
2424 with_libupsclient_libs="`$with_libupsclient_config --libs`"
2427 with_libupsclient="no ($with_libupsclient_config failed)"
2430 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2432 with_libupsclient="yes"
2435 # configure using pkg-config
2436 if test "x$with_libupsclient" = "xuse_pkgconfig"
2438 if test "x$PKG_CONFIG" = "x"
2440 with_libupsclient="no (Don't have pkg-config)"
2443 if test "x$with_libupsclient" = "xuse_pkgconfig"
2445 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
2446 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
2449 with_libupsclient="no (pkg-config doesn't know library)"
2452 if test "x$with_libupsclient" = "xuse_pkgconfig"
2454 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
2457 with_libupsclient="no ($PKG_CONFIG failed)"
2459 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
2462 with_libupsclient="no ($PKG_CONFIG failed)"
2465 if test "x$with_libupsclient" = "xuse_pkgconfig"
2467 with_libupsclient="yes"
2470 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
2471 # the actual checks.
2472 if test "x$with_libupsclient" = "xyes"
2474 SAVE_CPPFLAGS="$CPPFLAGS"
2475 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2477 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2479 CPPFLAGS="$SAVE_CPPFLAGS"
2481 if test "x$with_libupsclient" = "xyes"
2483 SAVE_CPPFLAGS="$CPPFLAGS"
2484 SAVE_LDFLAGS="$LDFLAGS"
2486 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2487 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2489 AC_CHECK_LIB(upsclient, upscli_connect,
2490 [with_libupsclient="yes"],
2491 [with_libupsclient="no (symbol upscli_connect not found)"])
2493 CPPFLAGS="$SAVE_CPPFLAGS"
2494 LDFLAGS="$SAVE_LDFLAGS"
2496 if test "x$with_libupsclient" = "xyes"
2498 SAVE_CPPFLAGS="$CPPFLAGS"
2499 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2501 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2502 [#include <stdlib.h>
2504 #include <upsclient.h>])
2506 CPPFLAGS="$SAVE_CPPFLAGS"
2508 if test "x$with_libupsclient" = "xyes"
2510 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2511 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2512 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2513 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2517 # --with-libxmms {{{
2518 with_xmms_config="xmms-config"
2521 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2523 if test "x$withval" != "xno" \
2524 && test "x$withval" != "xyes"
2526 if test -f "$withval" && test -x "$withval";
2528 with_xmms_config="$withval"
2529 else if test -x "$withval/bin/xmms-config"
2531 with_xmms_config="$withval/bin/xmms-config"
2534 else if test "x$withval" = "xno"
2544 if test "x$with_libxmms" = "xyes"
2546 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2547 xmms_config_status=$?
2549 if test $xmms_config_status -ne 0
2554 if test "x$with_libxmms" = "xyes"
2556 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2557 xmms_config_status=$?
2559 if test $xmms_config_status -ne 0
2564 if test "x$with_libxmms" = "xyes"
2566 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2568 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2569 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2570 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2571 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2578 with_libxmms_numeric=0
2579 if test "x$with_libxmms" = "xyes"
2581 with_libxmms_numeric=1
2583 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2584 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2587 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
2588 with_libxml2="no (pkg-config isn't available)"
2589 with_libxml2_cflags=""
2590 with_libxml2_ldflags=""
2591 with_libvirt="no (pkg-config isn't available)"
2592 with_libvirt_cflags=""
2593 with_libvirt_ldflags=""
2594 if test "x$PKG_CONFIG" != "x"
2596 pkg-config --exists 'libxml-2.0' 2>/dev/null
2601 with_libxml2="no (pkg-config doesn't know library)"
2604 pkg-config --exists libvirt 2>/dev/null
2609 with_libvirt="no (pkg-config doesn't know library)"
2612 if test "x$with_libxml2" = "xyes"
2614 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2619 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2625 if test "x$with_libxml2" = "xyes"
2627 SAVE_CPPFLAGS="$CPPFLAGS"
2628 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2630 AC_CHECK_HEADERS(libxml/parser.h, [],
2631 [with_libxml2="no (libxml/parser.h not found)"])
2633 CPPFLAGS="$SAVE_CPPFLAGS"
2635 if test "x$with_libxml2" = "xyes"
2637 SAVE_CFLAGS="$CFLAGS"
2638 SAVE_LDFLAGS="$LDFLAGS"
2640 CFLAGS="$CFLAGS $with_libxml2_cflags"
2641 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2643 AC_CHECK_LIB(xml2, xmlXPathEval,
2644 [with_libxml2="yes"],
2645 [with_libxml2="no (symbol xmlXPathEval not found)"])
2647 CFLAGS="$SAVE_CFLAGS"
2648 LDFLAGS="$SAVE_LDFLAGS"
2650 dnl Add the right compiler flags and libraries.
2651 if test "x$with_libxml2" = "xyes"; then
2652 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2653 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2654 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2655 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2657 if test "x$with_libvirt" = "xyes"
2659 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2664 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2670 if test "x$with_libvirt" = "xyes"
2672 SAVE_CPPFLAGS="$CPPFLAGS"
2673 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2675 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2676 [with_libvirt="no (libvirt/libvirt.h not found)"])
2678 CPPFLAGS="$SAVE_CPPFLAGS"
2680 if test "x$with_libvirt" = "xyes"
2682 SAVE_CFLAGS="$CFLAGS"
2683 SAVE_LDFLAGS="$LDFLAGS"
2685 CFLAGS="$CFLAGS $with_libvirt_cflags"
2686 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2688 AC_CHECK_LIB(virt, virDomainBlockStats,
2689 [with_libvirt="yes"],
2690 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2692 CFLAGS="$SAVE_CFLAGS"
2693 LDFLAGS="$SAVE_LDFLAGS"
2695 dnl Add the right compiler flags and libraries.
2696 if test "x$with_libvirt" = "xyes"; then
2697 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2698 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2699 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2700 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2704 # $PKG_CONFIG --exists OpenIPMIpthread {{{
2705 with_libopenipmipthread="yes"
2706 with_libopenipmipthread_cflags=""
2707 with_libopenipmipthread_libs=""
2709 AC_MSG_CHECKING([for pkg-config])
2711 if test "x$PKG_CONFIG" = "x"
2713 with_libopenipmipthread="no"
2716 temp_result="$PKG_CONFIG"
2718 AC_MSG_RESULT([$temp_result])
2720 if test "x$with_libopenipmipthread" = "xyes"
2722 AC_MSG_CHECKING([for libOpenIPMIpthread])
2723 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2726 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2728 AC_MSG_RESULT([$with_libopenipmipthread])
2731 if test "x$with_libopenipmipthread" = "xyes"
2733 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2734 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2737 with_libopenipmipthread_cflags="$temp_result"
2739 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2740 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2742 AC_MSG_RESULT([$temp_result])
2745 if test "x$with_libopenipmipthread" = "xyes"
2747 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2748 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2751 with_libopenipmipthread_ldflags="$temp_result"
2753 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2754 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2756 AC_MSG_RESULT([$temp_result])
2759 if test "x$with_libopenipmipthread" = "xyes"
2761 SAVE_CPPFLAGS="$CPPFLAGS"
2762 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2764 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2765 [with_libopenipmipthread="yes"],
2766 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2767 [#include <OpenIPMI/ipmiif.h>
2768 #include <OpenIPMI/ipmi_err.h>
2769 #include <OpenIPMI/ipmi_posix.h>
2770 #include <OpenIPMI/ipmi_conn.h>
2773 CPPFLAGS="$SAVE_CPPFLAGS"
2776 if test "x$with_libopenipmipthread" = "xyes"
2778 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2779 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2780 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2781 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2785 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
2786 [with_libnotify="yes"],
2787 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
2789 # Check for enabled/disabled features
2792 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2793 # ------------------------------------------------------------
2795 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2800 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2805 m4_define([EnDis],[disabled])dnl
2806 m4_define([YesNo],[no])dnl
2812 m4_define([EnDis],[enabled])dnl
2813 m4_define([YesNo],[yes])dnl
2816 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2820 m4_if([$3], [feature], [],
2824 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2830 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2832 enable_$1='[YesNo]'dnl
2834 if test "x$enable_$1" = "xno"
2838 if test "x$enable_$1" = "xyes"
2842 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2847 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2848 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2850 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2852 # AC_PLUGIN(name, default, info)
2853 # ------------------------------------------------------------
2859 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2861 if test "x$enableval" = "xyes"
2869 if test "x$2" = "xyes"
2876 if test "x$enable_plugin" = "xyes"
2878 if test "x$2" = "xyes"
2880 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2881 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2882 dependency_error="yes"
2883 enable_plugin="no (dependency error)"
2886 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2887 enable_$1="$enable_plugin"
2889 )# AC_PLUGIN(name, default, info)
2891 m4_divert_once([HELP_ENABLE], [
2892 collectd features:])
2893 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2894 AC_COLLECTD([debug], [enable], [feature], [debugging])
2895 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2896 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2898 dependency_error="no"
2907 plugin_interface="no"
2914 plugin_multimeter="no"
2917 plugin_processes="no"
2921 plugin_tcpconns="no"
2926 plugin_wireless="no"
2929 if test "x$ac_system" = "xLinux"
2931 plugin_battery="yes"
2933 plugin_cpufreq="yes"
2935 plugin_entropy="yes"
2936 plugin_interface="yes"
2941 plugin_processes="yes"
2944 plugin_tcpconns="yes"
2945 plugin_thermal="yes"
2947 plugin_vserver="yes"
2948 plugin_wireless="yes"
2950 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2956 if test "x$ac_system" = "xOpenBSD"
2958 plugin_tcpconns="yes"
2962 if test "x$with_libiokit" = "xyes"
2964 plugin_battery="yes"
2969 if test "x$with_devinfo$with_kstat" = "xyesyes"
2973 plugin_interface="yes"
2978 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
2984 if test "x$with_libstatgrab" = "xyes"
2988 plugin_interface="yes"
2995 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
3001 if test "x$with_libopenipmipthread" = "xyes"
3006 if test "x$have_processor_info" = "xyes"
3010 if test "x$have_sysctl" = "xyes"
3015 if test "x$have_sysctlbyname" = "xyes"
3019 plugin_tcpconns="yes"
3022 # Df plugin: Check if we know how to determine mount points first.
3023 #if test "x$have_listmntent" = "xyes"; then
3026 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
3030 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
3034 #if test "x$have_getmntent" = "xseq"
3038 if test "x$c_cv_have_one_getmntent" = "xyes"
3043 # Df plugin: Check if we have either `statfs' or `statvfs' second.
3044 if test "x$plugin_df" = "xyes"
3047 if test "x$have_statfs" = "xyes"
3051 if test "x$have_statvfs" = "xyes"
3057 if test "x$have_getifaddrs" = "xyes"
3059 plugin_interface="yes"
3062 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
3064 plugin_libvirt="yes"
3067 if test "x$have_getloadavg" = "xyes"
3072 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
3077 # Mac OS X memory interface
3078 if test "x$have_host_statistics" = "xyes"
3083 if test "x$have_termios_h" = "xyes"
3085 plugin_multimeter="yes"
3088 if test "x$have_thread_info" = "xyes"
3090 plugin_processes="yes"
3093 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
3095 plugin_processes="yes"
3098 if test "x$with_kvm_getswapinfo" = "xyes"
3103 if test "x$have_swapctl" = "xyes"
3108 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
3110 plugin_tcpconns="yes"
3113 if test "x$have_getutent" = "xyes"
3117 if test "x$have_getutxent" = "xyes"
3122 m4_divert_once([HELP_ENABLE], [
3125 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3126 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3127 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3128 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3129 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3130 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3131 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3132 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3133 AC_PLUGIN([csv], [yes], [CSV output plugin])
3134 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
3135 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3136 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3137 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3138 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3139 AC_PLUGIN([email], [yes], [EMail statistics])
3140 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3141 AC_PLUGIN([exec], [yes], [Execution of external programs])
3142 AC_PLUGIN([filecount], [yes], [Count files in directories])
3143 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3144 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3145 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3146 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3147 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3148 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3149 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3150 AC_PLUGIN([load], [$plugin_load], [System load])
3151 AC_PLUGIN([logfile], [yes], [File logging plugin])
3152 AC_PLUGIN([match_regex], [yes], [The regex match])
3153 AC_PLUGIN([match_timediff], [yes], [The timediff match])
3154 AC_PLUGIN([match_value], [yes], [The value match])
3155 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3156 AC_PLUGIN([memcached], [yes], [memcached statistics])
3157 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3158 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3159 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3160 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3161 AC_PLUGIN([network], [yes], [Network communication plugin])
3162 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3163 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3164 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3165 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3166 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3167 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3168 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3169 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3170 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3171 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3172 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3173 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3174 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3175 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3176 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3177 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3178 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3179 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3180 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3181 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3182 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3183 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3184 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3185 AC_PLUGIN([target_notification], [yes], [The notification target])
3186 AC_PLUGIN([target_replace], [yes], [The replace target])
3187 AC_PLUGIN([target_set], [yes], [The set target])
3188 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3189 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3190 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3191 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3192 AC_PLUGIN([users], [$plugin_users], [User statistics])
3193 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3194 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3195 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3196 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3197 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3200 if test "x$ac_system" = "xLinux" \
3201 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3203 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3207 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3209 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3211 PERL_BINDINGS_OPTIONS="$withval"
3212 with_perl_bindings="yes"
3214 PERL_BINDINGS_OPTIONS=""
3215 with_perl_bindings="$withval"
3219 PERL_BINDINGS_OPTIONS=""
3220 if test -n "$perl_interpreter"
3222 with_perl_bindings="yes"
3224 with_perl_bindings="no (no perl interpreter found)"
3227 if test "x$with_perl_bindings" = "xyes"
3229 PERL_BINDINGS="perl"
3233 AC_SUBST(PERL_BINDINGS)
3234 AC_SUBST(PERL_BINDINGS_OPTIONS)
3236 dnl libcollectdclient
3237 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3238 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3239 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3241 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3243 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3245 AC_SUBST(LCC_VERSION_MAJOR)
3246 AC_SUBST(LCC_VERSION_MINOR)
3247 AC_SUBST(LCC_VERSION_PATCH)
3248 AC_SUBST(LCC_VERSION_EXTRA)
3249 AC_SUBST(LCC_VERSION_STRING)
3251 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3253 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)
3255 if test "x$with_librrd" = "xyes" \
3256 && test "x$librrd_threadsafe" != "xyes"
3258 with_librrd="yes (warning: librrd is not thread-safe)"
3261 if test "x$with_liboping" = "xyes" \
3262 && test "x$with_own_liboping" = "xyes"
3264 with_liboping="yes (shipped version)"
3267 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3269 with_libiptc="yes (shipped version)"
3272 if test "x$with_libperl" = "xyes"
3274 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3276 enable_perl="no (needs libperl)"
3279 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
3281 enable_perl="no (libperl doesn't support ithreads)"
3284 if test "x$with_perl_bindings" = "xyes" \
3285 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3287 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3294 libcurl . . . . . . . $with_libcurl
3295 libdbi . . . . . . . $with_libdbi
3296 libesmtp . . . . . . $with_libesmtp
3297 libiokit . . . . . . $with_libiokit
3298 libiptc . . . . . . . $with_libiptc
3299 libkstat . . . . . . $with_kstat
3300 libkvm . . . . . . . $with_libkvm
3301 libmysql . . . . . . $with_libmysql
3302 libnetlink . . . . . $with_libnetlink
3303 libnetsnmp . . . . . $with_libnetsnmp
3304 libnotify . . . . . . $with_libnotify
3305 liboconfig . . . . . $with_liboconfig
3306 libopenipmi . . . . . $with_libopenipmipthread
3307 liboping . . . . . . $with_liboping
3308 libpcap . . . . . . . $with_libpcap
3309 libperl . . . . . . . $with_libperl
3310 libpq . . . . . . . . $with_libpq
3311 libpthread . . . . . $with_libpthread
3312 librrd . . . . . . . $with_librrd
3313 libsensors . . . . . $with_libsensors
3314 libstatgrab . . . . . $with_libstatgrab
3315 libupsclient . . . . $with_libupsclient
3316 libvirt . . . . . . . $with_libvirt
3317 libxml2 . . . . . . . $with_libxml2
3318 libxmms . . . . . . . $with_libxmms
3319 oracle . . . . . . . $with_oracle
3322 daemon mode . . . . . $enable_daemon
3323 debug . . . . . . . . $enable_debug
3326 perl . . . . . . . . $with_perl_bindings
3329 apache . . . . . . . $enable_apache
3330 apcups . . . . . . . $enable_apcups
3331 apple_sensors . . . . $enable_apple_sensors
3332 ascent . . . . . . . $enable_ascent
3333 battery . . . . . . . $enable_battery
3334 bind . . . . . . . . $enable_bind
3335 cpu . . . . . . . . . $enable_cpu
3336 cpufreq . . . . . . . $enable_cpufreq
3337 csv . . . . . . . . . $enable_csv
3338 curl . . . . . . . . $enable_curl
3339 dbi . . . . . . . . . $enable_dbi
3340 df . . . . . . . . . $enable_df
3341 disk . . . . . . . . $enable_disk
3342 dns . . . . . . . . . $enable_dns
3343 email . . . . . . . . $enable_email
3344 entropy . . . . . . . $enable_entropy
3345 exec . . . . . . . . $enable_exec
3346 filecount . . . . . . $enable_filecount
3347 hddtemp . . . . . . . $enable_hddtemp
3348 interface . . . . . . $enable_interface
3349 ipmi . . . . . . . . $enable_ipmi
3350 iptables . . . . . . $enable_iptables
3351 ipvs . . . . . . . . $enable_ipvs
3352 irq . . . . . . . . . $enable_irq
3353 libvirt . . . . . . . $enable_libvirt
3354 load . . . . . . . . $enable_load
3355 logfile . . . . . . . $enable_logfile
3356 match_regex . . . . . $enable_match_regex
3357 match_timediff . . . $enable_match_timediff
3358 match_value . . . . . $enable_match_value
3359 mbmon . . . . . . . . $enable_mbmon
3360 memcached . . . . . . $enable_memcached
3361 memory . . . . . . . $enable_memory
3362 multimeter . . . . . $enable_multimeter
3363 mysql . . . . . . . . $enable_mysql
3364 netlink . . . . . . . $enable_netlink
3365 network . . . . . . . $enable_network
3366 nfs . . . . . . . . . $enable_nfs
3367 nginx . . . . . . . . $enable_nginx
3368 notify_desktop . . . $enable_notify_desktop
3369 notify_email . . . . $enable_notify_email
3370 ntpd . . . . . . . . $enable_ntpd
3371 nut . . . . . . . . . $enable_nut
3372 onewire . . . . . . . $enable_onewire
3373 openvpn . . . . . . . $enable_openvpn
3374 oracle . . . . . . . $enable_oracle
3375 perl . . . . . . . . $enable_perl
3376 ping . . . . . . . . $enable_ping
3377 postgresql . . . . . $enable_postgresql
3378 powerdns . . . . . . $enable_powerdns
3379 processes . . . . . . $enable_processes
3380 rrdcached . . . . . . $enable_rrdcached
3381 rrdtool . . . . . . . $enable_rrdtool
3382 sensors . . . . . . . $enable_sensors
3383 serial . . . . . . . $enable_serial
3384 snmp . . . . . . . . $enable_snmp
3385 swap . . . . . . . . $enable_swap
3386 syslog . . . . . . . $enable_syslog
3387 tail . . . . . . . . $enable_tail
3388 tape . . . . . . . . $enable_tape
3389 target_notification . $enable_target_notification
3390 target_replace . . . $enable_target_replace
3391 target_set . . . . . $enable_target_set
3392 tcpconns . . . . . . $enable_tcpconns
3393 teamspeak2 . . . . . $enable_teamspeak2
3394 thermal . . . . . . . $enable_thermal
3395 unixsock . . . . . . $enable_unixsock
3396 users . . . . . . . . $enable_users
3397 uuid . . . . . . . . $enable_uuid
3398 vmem . . . . . . . . $enable_vmem
3399 vserver . . . . . . . $enable_vserver
3400 wireless . . . . . . $enable_wireless
3401 xmms . . . . . . . . $enable_xmms
3405 if test "x$dependency_error" = "xyes"; then
3406 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
3409 # vim: set fdm=marker :