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/owniptc/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.])
1307 if test "x$with_libiptc" = "xyes"
1310 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1312 AC_CHECK_TYPES([iptc_handle_t], [], [],
1315 # include "$srcdir/src/owniptc/libiptc.h"
1317 # include <libiptc/libiptc.h>
1325 # --with-libmysql {{{
1326 with_mysql_config="mysql_config"
1327 with_mysql_cflags=""
1329 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1331 if test "x$withval" = "xno"
1334 else if test "x$withval" = "xyes"
1338 if test -f "$withval" && test -x "$withval";
1340 with_mysql_config="$withval"
1341 else if test -x "$withval/bin/mysql_config"
1343 with_mysql_config="$withval/bin/mysql_config"
1351 if test "x$with_libmysql" = "xyes"
1353 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1354 mysql_config_status=$?
1356 if test $mysql_config_status -ne 0
1358 with_libmysql="no ($with_mysql_config failed)"
1360 SAVE_CPPFLAGS="$CPPFLAGS"
1361 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1364 have_mysql_mysql_h="no"
1365 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1367 if test "x$have_mysql_h" = "xno"
1369 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1372 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1374 with_libmysql="no (mysql.h not found)"
1377 CPPFLAGS="$SAVE_CPPFLAGS"
1380 if test "x$with_libmysql" = "xyes"
1382 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1383 mysql_config_status=$?
1385 if test $mysql_config_status -ne 0
1387 with_libmysql="no ($with_mysql_config failed)"
1389 AC_CHECK_LIB(mysqlclient, mysql_init,
1390 [with_libmysql="yes"],
1391 [with_libmysql="no (symbol 'mysql_init' not found)"],
1394 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1395 [with_libmysql="yes"],
1396 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1400 if test "x$with_libmysql" = "xyes"
1402 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1403 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1404 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1405 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1407 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1410 # --with-libnetlink {{{
1411 with_libnetlink_cflags=""
1412 with_libnetlink_libs="-lnetlink"
1413 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1415 echo "libnetlink: withval = $withval"
1416 if test "x$withval" = "xyes"
1418 with_libnetlink="yes"
1419 else if test "x$withval" = "xno"
1421 with_libnetlink="no"
1423 if test -d "$withval/include"
1425 with_libnetlink_cflags="-I$withval/include"
1426 with_libnetlink_libs="-L$withval/lib -lnetlink"
1427 with_libnetlink="yes"
1429 AC_MSG_ERROR("no such directory: $withval/include")
1434 if test "x$ac_system" = "xLinux"
1436 with_libnetlink="yes"
1438 with_libnetlink="no (Linux only library)"
1441 if test "x$with_libnetlink" = "xyes"
1444 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1446 with_libnetlink="no (libnetlink.h not found)"
1448 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1450 with_libnetlink="yes"
1454 #include <sys/types.h>
1455 #include <asm/types.h>
1456 #include <sys/socket.h>
1457 #include <linux/netlink.h>
1458 #include <linux/rtnetlink.h>])
1459 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1461 #include <sys/types.h>
1462 #include <asm/types.h>
1463 #include <sys/socket.h>])
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_STATS2;
1478 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1483 #include <sys/types.h>
1484 #include <asm/types.h>
1485 #include <sys/socket.h>
1486 #include <linux/netlink.h>
1487 #include <linux/rtnetlink.h>
1491 int retval = TCA_STATS;
1494 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1497 CFLAGS="$SAVE_CFLAGS"
1499 if test "x$with_libnetlink" = "xyes"
1501 AC_CHECK_LIB(netlink, rtnl_open,
1502 [with_libnetlink="yes"],
1503 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1504 [$with_libnetlink_libs])
1506 if test "x$with_libnetlink" = "xyes"
1508 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1509 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1510 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1511 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1513 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1516 # --with-libnetsnmp {{{
1517 with_snmp_config="net-snmp-config"
1520 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1522 if test "x$withval" = "xno"
1524 with_libnetsnmp="no"
1525 else if test "x$withval" = "xyes"
1527 with_libnetsnmp="yes"
1529 if test -x "$withval"
1531 with_snmp_config="$withval"
1532 with_libnetsnmp="yes"
1534 with_snmp_config="$withval/bin/net-snmp-config"
1535 with_libnetsnmp="yes"
1539 [with_libnetsnmp="yes"])
1540 if test "x$with_libnetsnmp" = "xyes"
1542 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1543 snmp_config_status=$?
1545 if test $snmp_config_status -ne 0
1547 with_libnetsnmp="no ($with_snmp_config failed)"
1549 SAVE_CPPFLAGS="$CPPFLAGS"
1550 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1552 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1554 CPPFLAGS="$SAVE_CPPFLAGS"
1557 if test "x$with_libnetsnmp" = "xyes"
1559 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1560 snmp_config_status=$?
1562 if test $snmp_config_status -ne 0
1564 with_libnetsnmp="no ($with_snmp_config failed)"
1566 AC_CHECK_LIB(netsnmp, init_snmp,
1567 [with_libnetsnmp="yes"],
1568 [with_libnetsnmp="no (libnetsnmp not found)"],
1572 if test "x$with_libnetsnmp" = "xyes"
1574 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1575 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1576 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1577 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1579 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1582 # --with-liboconfig {{{
1583 with_own_liboconfig="no"
1584 liboconfig_LDFLAGS="$LDFLAGS"
1585 liboconfig_CPPFLAGS="$CPPFLAGS"
1586 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1588 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1590 if test -d "$withval/lib"
1592 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1594 if test -d "$withval/include"
1596 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1599 if test "x$withval" = "xno"
1601 AC_MSG_ERROR("liboconfig is required")
1605 with_liboconfig="yes"
1608 save_LDFLAGS="$LDFLAGS"
1609 save_CPPFLAGS="$CPPFLAGS"
1610 LDFLAGS="$liboconfig_LDFLAGS"
1611 CPPFLAGS="$liboconfig_CPPFLAGS"
1612 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1614 with_liboconfig="yes"
1615 with_own_liboconfig="no"
1618 with_liboconfig="yes"
1619 with_own_liboconfig="yes"
1620 LDFLAGS="$save_LDFLAGS"
1621 CPPFLAGS="$save_CPPFLAGS"
1624 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1625 if test "x$with_own_liboconfig" = "xyes"
1627 with_liboconfig="yes (shipped version)"
1631 # --with-liboping {{{
1632 with_own_liboping="no"
1633 liboping_LDFLAGS="$LDFLAGS"
1634 liboping_CPPFLAGS="$CPPFLAGS"
1635 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1637 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1639 if test -d "$withval/lib"
1641 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1643 if test -d "$withval/include"
1645 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1648 if test "x$withval" = "xno"
1651 with_own_liboping="no"
1652 else if test "x$withval" = "xyes"
1661 if test "x$with_liboping" = "xyes"
1663 save_LDFLAGS="$LDFLAGS"
1664 save_CPPFLAGS="$CPPFLAGS"
1665 LDFLAGS="$liboping_LDFLAGS"
1666 CPPFLAGS="$liboping_CPPFLAGS"
1667 AC_CHECK_LIB(oping, ping_construct,
1670 with_own_liboping="no"
1674 with_own_liboping="yes"
1675 LDFLAGS="$save_LDFLAGS"
1676 CPPFLAGS="$save_CPPFLAGS"
1679 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1680 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1684 with_oracle_cppflags=""
1686 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
1688 if test "x$withval" = "xyes"
1690 if test "x$ORACLE_HOME" = "x"
1692 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
1695 else if test "x$withval" = "xno"
1700 ORACLE_HOME="$withval"
1704 if test "x$ORACLE_HOME" = "x"
1706 with_oracle="no (ORACLE_HOME is not set)"
1711 if test "x$ORACLE_HOME" != "x"
1713 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
1715 if test -e "$ORACLE_HOME/lib/ldflags"
1717 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
1719 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
1720 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
1722 if test "x$with_oracle" = "xyes"
1724 SAVE_CPPFLAGS="$CPPFLAGS"
1725 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1727 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
1729 CPPFLAGS="$SAVE_CPPFLAGS"
1731 if test "x$with_oracle" = "xyes"
1733 SAVE_CPPFLAGS="$CPPFLAGS"
1734 SAVE_LDFLAGS="$LDFLAGS"
1735 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1736 LDFLAGS="$LDFLAGS $with_oracle_libs"
1738 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
1740 CPPFLAGS="$SAVE_CPPFLAGS"
1741 LDFLAGS="$SAVE_LDFLAGS"
1743 if test "x$with_oracle" = "xyes"
1745 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
1746 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
1747 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
1748 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
1752 # --with-libowcapi {{{
1753 with_libowcapi_cppflags=""
1754 with_libowcapi_libs="-lowcapi"
1755 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
1757 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1759 with_libowcapi_cppflags="-I$withval/include"
1760 with_libowcapi_libs="-L$withval/lib -lowcapi"
1761 with_libowcapi="yes"
1763 with_libowcapi="$withval"
1767 with_libowcapi="yes"
1769 if test "x$with_libowcapi" = "xyes"
1771 SAVE_CPPFLAGS="$CPPFLAGS"
1772 CPPFLAGS="$with_libowcapi_cppflags"
1774 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
1776 CPPFLAGS="$SAVE_CPPFLAGS"
1778 if test "x$with_libowcapi" = "xyes"
1780 SAVE_LDFLAGS="$LDFLAGS"
1781 SAVE_CPPFLAGS="$CPPFLAGS"
1782 LDFLAGS="$with_libowcapi_libs"
1783 CPPFLAGS="$with_libowcapi_cppflags"
1785 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
1787 LDFLAGS="$SAVE_LDFLAGS"
1788 CPPFLAGS="$SAVE_CPPFLAGS"
1790 if test "x$with_libowcapi" = "xyes"
1792 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
1793 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
1794 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
1795 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
1799 # --with-libpcap {{{
1800 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1802 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1804 LDFLAGS="$LDFLAGS -L$withval/lib"
1805 CPPFLAGS="$CPPFLAGS -I$withval/include"
1808 with_libpcap="$withval"
1814 if test "x$with_libpcap" = "xyes"
1816 AC_CHECK_LIB(pcap, pcap_open_live,
1818 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1819 ], [with_libpcap="no (libpcap not found)"])
1821 if test "x$with_libpcap" = "xyes"
1823 AC_CHECK_HEADERS(pcap.h,
1825 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1826 ], [with_libpcap="no (pcap.h not found)"])
1828 if test "x$with_libpcap" = "xyes"
1834 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1835 [Wether or not to use the pcap library])
1836 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1839 # --with-libperl {{{
1840 perl_interpreter="perl"
1841 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1843 if test -x "$withval"
1845 perl_interpreter="$withval"
1847 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1849 LDFLAGS="$LDFLAGS -L$withval/lib"
1850 CPPFLAGS="$CPPFLAGS -I$withval/include"
1851 perl_interpreter="$withval/bin/perl"
1854 with_libperl="$withval"
1861 AC_MSG_CHECKING([for perl])
1862 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
1863 if test -x "$perl_interpreter"
1865 AC_MSG_RESULT([yes ($perl_interpreter)])
1871 AC_SUBST(PERL, "$perl_interpreter")
1873 if test "x$with_libperl" = "xyes" \
1874 && test -n "$perl_interpreter"
1877 SAVE_LDFLAGS=$LDFLAGS
1878 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
1879 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
1880 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
1881 CFLAGS="$CFLAGS $PERL_CFLAGS"
1882 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1884 AC_CACHE_CHECK([for libperl],
1885 [c_cv_have_libperl],
1889 #define PERL_NO_GET_CONTEXT
1896 load_module (PERL_LOADMOD_NOIMPORT,
1897 newSVpv ("Collectd::Plugin::FooBar", 24),
1900 [c_cv_have_libperl="yes"],
1901 [c_cv_have_libperl="no"]
1905 if test "x$c_cv_have_libperl" = "xyes"
1907 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1908 AC_SUBST(PERL_CFLAGS)
1909 AC_SUBST(PERL_LDFLAGS)
1915 LDFLAGS=$SAVE_LDFLAGS
1916 else if test -z "$perl_interpreter"; then
1917 with_libperl="no (no perl interpreter found)"
1918 c_cv_have_libperl="no"
1920 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1922 if test "x$with_libperl" = "xyes"
1925 SAVE_LDFLAGS=$LDFLAGS
1926 CFLAGS="$CFLAGS $PERL_CFLAGS"
1927 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1929 AC_CACHE_CHECK([if perl supports ithreads],
1930 [c_cv_have_perl_ithreads],
1938 #if !defined(USE_ITHREADS)
1939 # error "Perl does not support ithreads!"
1940 #endif /* !defined(USE_ITHREADS) */
1943 [c_cv_have_perl_ithreads="yes"],
1944 [c_cv_have_perl_ithreads="no"]
1948 if test "x$c_cv_have_perl_ithreads" = "xyes"
1950 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1954 LDFLAGS=$SAVE_LDFLAGS
1957 c_cv_have_broken_perl_load_module="no"
1958 if test "x$with_libperl" = "xyes"
1961 SAVE_LDFLAGS=$LDFLAGS
1962 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
1963 # (see issues #41 and #42)
1964 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
1965 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1967 AC_CACHE_CHECK([for broken Perl_load_module()],
1968 [c_cv_have_broken_perl_load_module],
1972 #define PERL_NO_GET_CONTEXT
1979 load_module (PERL_LOADMOD_NOIMPORT,
1980 newSVpv ("Collectd::Plugin::FooBar", 24),
1983 [c_cv_have_broken_perl_load_module="no"],
1984 [c_cv_have_broken_perl_load_module="yes"]
1989 LDFLAGS=$SAVE_LDFLAGS
1991 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
1992 test "x$c_cv_have_broken_perl_load_module" = "xyes")
1994 if test "x$with_libperl" = "xyes"
1997 SAVE_LDFLAGS=$LDFLAGS
1998 CFLAGS="$CFLAGS $PERL_CFLAGS"
1999 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2002 [struct mgvtbl.svt_local],
2003 [have_struct_mgvtbl_svt_local="yes"],
2004 [have_struct_mgvtbl_svt_local="no"],
2011 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2013 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2014 [Define if Perl's struct mgvtbl has member svt_local.])
2018 LDFLAGS=$SAVE_LDFLAGS
2023 with_pg_config="pg_config"
2024 with_libpq_includedir=""
2025 with_libpq_libdir=""
2026 with_libpq_cppflags=""
2027 with_libpq_ldflags=""
2028 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2031 if test "x$withval" = "xno"
2034 else if test "x$withval" = "xyes"
2038 if test -f "$withval" && test -x "$withval";
2040 with_pg_config="$withval"
2041 else if test -x "$withval/bin/pg_config"
2043 with_pg_config="$withval/bin/pg_config"
2051 if test "x$with_libpq" = "xyes"
2053 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2056 if test $pg_config_status -eq 0
2058 if test -n "$with_libpq_includedir"; then
2059 for dir in $with_libpq_includedir; do
2060 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2064 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2067 SAVE_CPPFLAGS="$CPPFLAGS"
2068 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2070 AC_CHECK_HEADERS(libpq-fe.h, [],
2071 [with_libpq="no (libpq-fe.h not found)"], [])
2073 CPPFLAGS="$SAVE_CPPFLAGS"
2075 if test "x$with_libpq" = "xyes"
2077 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2080 if test $pg_config_status -eq 0
2082 if test -n "$with_libpq_libdir"; then
2083 for dir in $with_libpq_libdir; do
2084 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2088 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2091 SAVE_LDFLAGS="$LDFLAGS"
2092 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2094 AC_CHECK_LIB(pq, PQconnectdb,
2096 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2098 LDFLAGS="$SAVE_LDFLAGS"
2100 if test "x$with_libpq" = "xyes"
2102 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2103 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2104 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2105 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2107 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2110 # --with-libpthread {{{
2111 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2112 [ if test "x$withval" != "xno" \
2113 && test "x$withval" != "xyes"
2115 LDFLAGS="$LDFLAGS -L$withval/lib"
2116 CPPFLAGS="$CPPFLAGS -I$withval/include"
2117 with_libpthread="yes"
2119 if test "x$withval" = "xno"
2121 with_libpthread="no (disabled)"
2124 ], [with_libpthread="yes"])
2125 if test "x$with_libpthread" = "xyes"
2127 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2130 if test "x$with_libpthread" = "xyes"
2132 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2134 if test "x$with_libpthread" = "xyes"
2140 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2141 [Wether or not to use pthread (POSIX threads) library])
2142 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2146 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2149 librrd_threadsafe="yes"
2150 librrd_rrdc_update="no"
2151 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2152 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2154 librrd_cflags="-I$withval/include"
2155 librrd_ldflags="-L$withval/lib"
2158 with_librrd="$withval"
2160 ], [with_librrd="yes"])
2161 if test "x$with_librrd" = "xyes"
2163 SAVE_CPPFLAGS="$CPPFLAGS"
2164 SAVE_LDFLAGS="$LDFLAGS"
2166 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2167 LDFLAGS="$LDFLAGS $librrd_ldflags"
2169 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2171 CPPFLAGS="$SAVE_CPPFLAGS"
2172 LDFLAGS="$SAVE_LDFLAGS"
2174 if test "x$with_librrd" = "xyes"
2176 SAVE_CPPFLAGS="$CPPFLAGS"
2177 SAVE_LDFLAGS="$LDFLAGS"
2179 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2180 LDFLAGS="$LDFLAGS $librrd_ldflags"
2182 AC_CHECK_LIB(rrd_th, rrd_update_r,
2184 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2186 [librrd_threadsafe="no"
2187 AC_CHECK_LIB(rrd, rrd_update,
2189 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2191 [with_librrd="no (symbol 'rrd_update' not found)"],
2196 if test "x$librrd_threadsafe" = "xyes"
2198 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2200 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2203 CPPFLAGS="$SAVE_CPPFLAGS"
2204 LDFLAGS="$SAVE_LDFLAGS"
2206 if test "x$with_librrd" = "xyes"
2208 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2209 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2210 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2211 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2213 if test "x$librrd_threadsafe" = "xyes"
2215 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2219 # --with-libsensors {{{
2220 with_sensors_cflags=""
2221 with_sensors_ldflags=""
2222 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2224 if test "x$withval" = "xno"
2226 with_libsensors="no"
2228 with_libsensors="yes"
2229 if test "x$withval" != "xyes"
2231 with_sensors_cflags="-I$withval/include"
2232 with_sensors_ldflags="-L$withval/lib"
2233 with_libsensors="yes"
2238 if test "x$ac_system" = "xLinux"
2240 with_libsensors="yes"
2242 with_libsensors="no (Linux only library)"
2245 if test "x$with_libsensors" = "xyes"
2247 SAVE_CPPFLAGS="$CPPFLAGS"
2248 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2250 # AC_CHECK_HEADERS(sensors/sensors.h,
2252 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2254 # [with_libsensors="no (sensors/sensors.h not found)"])
2255 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2257 CPPFLAGS="$SAVE_CPPFLAGS"
2259 if test "x$with_libsensors" = "xyes"
2261 SAVE_CPPFLAGS="$CPPFLAGS"
2262 SAVE_LDFLAGS="$LDFLAGS"
2263 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2264 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2266 AC_CHECK_LIB(sensors, sensors_init,
2268 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2270 [with_libsensors="no (libsensors not found)"])
2272 CPPFLAGS="$SAVE_CPPFLAGS"
2273 LDFLAGS="$SAVE_LDFLAGS"
2275 if test "x$with_libsensors" = "xyes"
2277 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2278 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2279 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2280 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2282 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2285 # --with-libstatgrab {{{
2286 with_libstatgrab_cflags=""
2287 with_libstatgrab_ldflags=""
2288 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2290 if test "x$withval" != "xno" \
2291 && test "x$withval" != "xyes"
2293 with_libstatgrab_cflags="-I$withval/include"
2294 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
2295 with_libstatgrab="yes"
2296 with_libstatgrab_pkg_config="no"
2298 with_libstatgrab="$withval"
2299 with_libstatgrab_pkg_config="yes"
2303 with_libstatgrab="yes"
2304 with_libstatgrab_pkg_config="yes"
2307 if test "x$with_libstatgrab" = "xyes" \
2308 && test "x$with_libstatgrab_pkg_config" = "xyes"
2310 if test "x$PKG_CONFIG" != "x"
2312 AC_MSG_CHECKING([pkg-config for libstatgrab])
2314 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2317 with_libstatgrab_pkg_config="no"
2318 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
2319 temp_result="not found"
2321 AC_MSG_RESULT([$temp_result])
2323 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2324 with_libstatgrab_pkg_config="no"
2325 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2329 if test "x$with_libstatgrab" = "xyes" \
2330 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2331 && test "x$with_libstatgrab_cflags" = "x"
2333 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2334 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2337 with_libstatgrab_cflags="$temp_result"
2339 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2340 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2342 AC_MSG_RESULT([$temp_result])
2345 if test "x$with_libstatgrab" = "xyes" \
2346 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2347 && test "x$with_libstatgrab_ldflags" = "x"
2349 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2350 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2353 with_libstatgrab_ldflags="$temp_result"
2355 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2356 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2358 AC_MSG_RESULT([$temp_result])
2361 if test "x$with_libstatgrab" = "xyes"
2363 SAVE_CPPFLAGS="$CPPFLAGS"
2364 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2366 AC_CHECK_HEADERS(statgrab.h,
2367 [with_libstatgrab="yes"],
2368 [with_libstatgrab="no (statgrab.h not found)"])
2370 CPPFLAGS="$SAVE_CPPFLAGS"
2373 if test "x$with_libstatgrab" = "xyes"
2375 SAVE_CFLAGS="$CFLAGS"
2376 SAVE_LDFLAGS="$LDFLAGS"
2378 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2379 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2381 AC_CHECK_LIB(statgrab, sg_init,
2382 [with_libstatgrab="yes"],
2383 [with_libstatgrab="no (symbol sg_init not found)"])
2385 CFLAGS="$SAVE_CFLAGS"
2386 LDFLAGS="$SAVE_LDFLAGS"
2389 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2390 if test "x$with_libstatgrab" = "xyes"
2392 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2393 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2394 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2395 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2396 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2400 # --with-libupsclient {{{
2401 with_libupsclient_config=""
2402 with_libupsclient_cflags=""
2403 with_libupsclient_libs=""
2404 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2406 if test "x$withval" = "xno"
2408 with_libupsclient="no"
2409 else if test "x$withval" = "xyes"
2411 with_libupsclient="use_pkgconfig"
2413 if test -x "$withval"
2415 with_libupsclient_config="$withval"
2416 with_libupsclient="use_libupsclient_config"
2417 else if test -x "$withval/bin/libupsclient-config"
2419 with_libupsclient_config="$withval/bin/net-snmp-config"
2420 with_libupsclient="use_libupsclient_config"
2422 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
2423 with_libupsclient_cflags="-I$withval/include"
2424 with_libupsclient_libs="-L$withval/lib -lupsclient"
2425 with_libupsclient="yes"
2429 [with_libupsclient="use_pkgconfig"])
2431 # configure using libupsclient-config
2432 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2434 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
2435 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
2438 with_libupsclient="no ($with_libupsclient_config failed)"
2440 with_libupsclient_libs="`$with_libupsclient_config --libs`"
2443 with_libupsclient="no ($with_libupsclient_config failed)"
2446 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2448 with_libupsclient="yes"
2451 # configure using pkg-config
2452 if test "x$with_libupsclient" = "xuse_pkgconfig"
2454 if test "x$PKG_CONFIG" = "x"
2456 with_libupsclient="no (Don't have pkg-config)"
2459 if test "x$with_libupsclient" = "xuse_pkgconfig"
2461 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
2462 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
2465 with_libupsclient="no (pkg-config doesn't know library)"
2468 if test "x$with_libupsclient" = "xuse_pkgconfig"
2470 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
2473 with_libupsclient="no ($PKG_CONFIG failed)"
2475 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
2478 with_libupsclient="no ($PKG_CONFIG failed)"
2481 if test "x$with_libupsclient" = "xuse_pkgconfig"
2483 with_libupsclient="yes"
2486 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
2487 # the actual checks.
2488 if test "x$with_libupsclient" = "xyes"
2490 SAVE_CPPFLAGS="$CPPFLAGS"
2491 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2493 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2495 CPPFLAGS="$SAVE_CPPFLAGS"
2497 if test "x$with_libupsclient" = "xyes"
2499 SAVE_CPPFLAGS="$CPPFLAGS"
2500 SAVE_LDFLAGS="$LDFLAGS"
2502 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2503 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2505 AC_CHECK_LIB(upsclient, upscli_connect,
2506 [with_libupsclient="yes"],
2507 [with_libupsclient="no (symbol upscli_connect not found)"])
2509 CPPFLAGS="$SAVE_CPPFLAGS"
2510 LDFLAGS="$SAVE_LDFLAGS"
2512 if test "x$with_libupsclient" = "xyes"
2514 SAVE_CPPFLAGS="$CPPFLAGS"
2515 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2517 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2518 [#include <stdlib.h>
2520 #include <upsclient.h>])
2522 CPPFLAGS="$SAVE_CPPFLAGS"
2524 if test "x$with_libupsclient" = "xyes"
2526 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2527 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2528 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2529 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2533 # --with-libxmms {{{
2534 with_xmms_config="xmms-config"
2537 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2539 if test "x$withval" != "xno" \
2540 && test "x$withval" != "xyes"
2542 if test -f "$withval" && test -x "$withval";
2544 with_xmms_config="$withval"
2545 else if test -x "$withval/bin/xmms-config"
2547 with_xmms_config="$withval/bin/xmms-config"
2550 else if test "x$withval" = "xno"
2560 if test "x$with_libxmms" = "xyes"
2562 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2563 xmms_config_status=$?
2565 if test $xmms_config_status -ne 0
2570 if test "x$with_libxmms" = "xyes"
2572 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2573 xmms_config_status=$?
2575 if test $xmms_config_status -ne 0
2580 if test "x$with_libxmms" = "xyes"
2582 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2584 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2585 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2586 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2587 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2594 with_libxmms_numeric=0
2595 if test "x$with_libxmms" = "xyes"
2597 with_libxmms_numeric=1
2599 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2600 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2603 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
2604 with_libxml2="no (pkg-config isn't available)"
2605 with_libxml2_cflags=""
2606 with_libxml2_ldflags=""
2607 with_libvirt="no (pkg-config isn't available)"
2608 with_libvirt_cflags=""
2609 with_libvirt_ldflags=""
2610 if test "x$PKG_CONFIG" != "x"
2612 pkg-config --exists 'libxml-2.0' 2>/dev/null
2617 with_libxml2="no (pkg-config doesn't know library)"
2620 pkg-config --exists libvirt 2>/dev/null
2625 with_libvirt="no (pkg-config doesn't know library)"
2628 if test "x$with_libxml2" = "xyes"
2630 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2635 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2641 if test "x$with_libxml2" = "xyes"
2643 SAVE_CPPFLAGS="$CPPFLAGS"
2644 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2646 AC_CHECK_HEADERS(libxml/parser.h, [],
2647 [with_libxml2="no (libxml/parser.h not found)"])
2649 CPPFLAGS="$SAVE_CPPFLAGS"
2651 if test "x$with_libxml2" = "xyes"
2653 SAVE_CFLAGS="$CFLAGS"
2654 SAVE_LDFLAGS="$LDFLAGS"
2656 CFLAGS="$CFLAGS $with_libxml2_cflags"
2657 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2659 AC_CHECK_LIB(xml2, xmlXPathEval,
2660 [with_libxml2="yes"],
2661 [with_libxml2="no (symbol xmlXPathEval not found)"])
2663 CFLAGS="$SAVE_CFLAGS"
2664 LDFLAGS="$SAVE_LDFLAGS"
2666 dnl Add the right compiler flags and libraries.
2667 if test "x$with_libxml2" = "xyes"; then
2668 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2669 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2670 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2671 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2673 if test "x$with_libvirt" = "xyes"
2675 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2680 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2686 if test "x$with_libvirt" = "xyes"
2688 SAVE_CPPFLAGS="$CPPFLAGS"
2689 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2691 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2692 [with_libvirt="no (libvirt/libvirt.h not found)"])
2694 CPPFLAGS="$SAVE_CPPFLAGS"
2696 if test "x$with_libvirt" = "xyes"
2698 SAVE_CFLAGS="$CFLAGS"
2699 SAVE_LDFLAGS="$LDFLAGS"
2701 CFLAGS="$CFLAGS $with_libvirt_cflags"
2702 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2704 AC_CHECK_LIB(virt, virDomainBlockStats,
2705 [with_libvirt="yes"],
2706 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2708 CFLAGS="$SAVE_CFLAGS"
2709 LDFLAGS="$SAVE_LDFLAGS"
2711 dnl Add the right compiler flags and libraries.
2712 if test "x$with_libvirt" = "xyes"; then
2713 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2714 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2715 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2716 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2720 # $PKG_CONFIG --exists OpenIPMIpthread {{{
2721 with_libopenipmipthread="yes"
2722 with_libopenipmipthread_cflags=""
2723 with_libopenipmipthread_libs=""
2725 AC_MSG_CHECKING([for pkg-config])
2727 if test "x$PKG_CONFIG" = "x"
2729 with_libopenipmipthread="no"
2732 temp_result="$PKG_CONFIG"
2734 AC_MSG_RESULT([$temp_result])
2736 if test "x$with_libopenipmipthread" = "xyes"
2738 AC_MSG_CHECKING([for libOpenIPMIpthread])
2739 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2742 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2744 AC_MSG_RESULT([$with_libopenipmipthread])
2747 if test "x$with_libopenipmipthread" = "xyes"
2749 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2750 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2753 with_libopenipmipthread_cflags="$temp_result"
2755 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2756 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2758 AC_MSG_RESULT([$temp_result])
2761 if test "x$with_libopenipmipthread" = "xyes"
2763 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2764 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2767 with_libopenipmipthread_ldflags="$temp_result"
2769 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2770 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2772 AC_MSG_RESULT([$temp_result])
2775 if test "x$with_libopenipmipthread" = "xyes"
2777 SAVE_CPPFLAGS="$CPPFLAGS"
2778 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2780 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2781 [with_libopenipmipthread="yes"],
2782 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2783 [#include <OpenIPMI/ipmiif.h>
2784 #include <OpenIPMI/ipmi_err.h>
2785 #include <OpenIPMI/ipmi_posix.h>
2786 #include <OpenIPMI/ipmi_conn.h>
2789 CPPFLAGS="$SAVE_CPPFLAGS"
2792 if test "x$with_libopenipmipthread" = "xyes"
2794 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2795 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2796 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2797 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2801 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
2802 [with_libnotify="yes"],
2803 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
2805 # Check for enabled/disabled features
2808 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2809 # ------------------------------------------------------------
2811 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2816 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2821 m4_define([EnDis],[disabled])dnl
2822 m4_define([YesNo],[no])dnl
2828 m4_define([EnDis],[enabled])dnl
2829 m4_define([YesNo],[yes])dnl
2832 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2836 m4_if([$3], [feature], [],
2840 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2846 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2848 enable_$1='[YesNo]'dnl
2850 if test "x$enable_$1" = "xno"
2854 if test "x$enable_$1" = "xyes"
2858 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2863 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2864 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2866 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2868 # AC_PLUGIN(name, default, info)
2869 # ------------------------------------------------------------
2875 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2877 if test "x$enableval" = "xyes"
2885 if test "x$2" = "xyes"
2892 if test "x$enable_plugin" = "xyes"
2894 if test "x$2" = "xyes"
2896 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2897 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2898 dependency_error="yes"
2899 enable_plugin="no (dependency error)"
2902 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2903 enable_$1="$enable_plugin"
2905 )# AC_PLUGIN(name, default, info)
2907 m4_divert_once([HELP_ENABLE], [
2908 collectd features:])
2909 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2910 AC_COLLECTD([debug], [enable], [feature], [debugging])
2911 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2912 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2914 dependency_error="no"
2923 plugin_interface="no"
2930 plugin_multimeter="no"
2933 plugin_processes="no"
2937 plugin_tcpconns="no"
2942 plugin_wireless="no"
2945 if test "x$ac_system" = "xLinux"
2947 plugin_battery="yes"
2949 plugin_cpufreq="yes"
2951 plugin_entropy="yes"
2952 plugin_interface="yes"
2957 plugin_processes="yes"
2960 plugin_tcpconns="yes"
2961 plugin_thermal="yes"
2963 plugin_vserver="yes"
2964 plugin_wireless="yes"
2966 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2972 if test "x$ac_system" = "xOpenBSD"
2974 plugin_tcpconns="yes"
2978 if test "x$with_libiokit" = "xyes"
2980 plugin_battery="yes"
2985 if test "x$with_devinfo$with_kstat" = "xyesyes"
2989 plugin_interface="yes"
2994 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
3000 if test "x$with_libstatgrab" = "xyes"
3004 plugin_interface="yes"
3011 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
3017 if test "x$with_libopenipmipthread" = "xyes"
3022 if test "x$have_processor_info" = "xyes"
3026 if test "x$have_sysctl" = "xyes"
3031 if test "x$have_sysctlbyname" = "xyes"
3035 plugin_tcpconns="yes"
3038 # Df plugin: Check if we know how to determine mount points first.
3039 #if test "x$have_listmntent" = "xyes"; then
3042 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
3046 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
3050 #if test "x$have_getmntent" = "xseq"
3054 if test "x$c_cv_have_one_getmntent" = "xyes"
3059 # Df plugin: Check if we have either `statfs' or `statvfs' second.
3060 if test "x$plugin_df" = "xyes"
3063 if test "x$have_statfs" = "xyes"
3067 if test "x$have_statvfs" = "xyes"
3073 if test "x$have_getifaddrs" = "xyes"
3075 plugin_interface="yes"
3078 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
3080 plugin_libvirt="yes"
3083 if test "x$have_getloadavg" = "xyes"
3088 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
3093 # Mac OS X memory interface
3094 if test "x$have_host_statistics" = "xyes"
3099 if test "x$have_termios_h" = "xyes"
3101 plugin_multimeter="yes"
3104 if test "x$have_thread_info" = "xyes"
3106 plugin_processes="yes"
3109 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
3111 plugin_processes="yes"
3114 if test "x$with_kvm_getswapinfo" = "xyes"
3119 if test "x$have_swapctl" = "xyes"
3124 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
3126 plugin_tcpconns="yes"
3129 if test "x$have_getutent" = "xyes"
3133 if test "x$have_getutxent" = "xyes"
3138 m4_divert_once([HELP_ENABLE], [
3141 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3142 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3143 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3144 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3145 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3146 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3147 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3148 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3149 AC_PLUGIN([csv], [yes], [CSV output plugin])
3150 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
3151 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3152 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3153 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3154 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3155 AC_PLUGIN([email], [yes], [EMail statistics])
3156 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3157 AC_PLUGIN([exec], [yes], [Execution of external programs])
3158 AC_PLUGIN([filecount], [yes], [Count files in directories])
3159 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3160 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3161 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3162 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3163 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3164 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3165 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3166 AC_PLUGIN([load], [$plugin_load], [System load])
3167 AC_PLUGIN([logfile], [yes], [File logging plugin])
3168 AC_PLUGIN([match_regex], [yes], [The regex match])
3169 AC_PLUGIN([match_timediff], [yes], [The timediff match])
3170 AC_PLUGIN([match_value], [yes], [The value match])
3171 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3172 AC_PLUGIN([memcached], [yes], [memcached statistics])
3173 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3174 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3175 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3176 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3177 AC_PLUGIN([network], [yes], [Network communication plugin])
3178 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3179 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3180 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3181 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3182 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3183 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3184 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3185 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3186 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3187 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3188 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3189 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3190 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3191 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3192 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3193 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3194 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3195 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3196 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3197 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3198 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3199 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3200 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3201 AC_PLUGIN([target_notification], [yes], [The notification target])
3202 AC_PLUGIN([target_replace], [yes], [The replace target])
3203 AC_PLUGIN([target_set], [yes], [The set target])
3204 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3205 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3206 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3207 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3208 AC_PLUGIN([users], [$plugin_users], [User statistics])
3209 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3210 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3211 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3212 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3213 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3216 if test "x$ac_system" = "xLinux" \
3217 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3219 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3223 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3225 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3227 PERL_BINDINGS_OPTIONS="$withval"
3228 with_perl_bindings="yes"
3230 PERL_BINDINGS_OPTIONS=""
3231 with_perl_bindings="$withval"
3235 PERL_BINDINGS_OPTIONS=""
3236 if test -n "$perl_interpreter"
3238 with_perl_bindings="yes"
3240 with_perl_bindings="no (no perl interpreter found)"
3243 if test "x$with_perl_bindings" = "xyes"
3245 PERL_BINDINGS="perl"
3249 AC_SUBST(PERL_BINDINGS)
3250 AC_SUBST(PERL_BINDINGS_OPTIONS)
3252 dnl libcollectdclient
3253 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3254 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3255 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3257 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3259 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3261 AC_SUBST(LCC_VERSION_MAJOR)
3262 AC_SUBST(LCC_VERSION_MINOR)
3263 AC_SUBST(LCC_VERSION_PATCH)
3264 AC_SUBST(LCC_VERSION_EXTRA)
3265 AC_SUBST(LCC_VERSION_STRING)
3267 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3269 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
3271 if test "x$with_librrd" = "xyes" \
3272 && test "x$librrd_threadsafe" != "xyes"
3274 with_librrd="yes (warning: librrd is not thread-safe)"
3277 if test "x$with_liboping" = "xyes" \
3278 && test "x$with_own_liboping" = "xyes"
3280 with_liboping="yes (shipped version)"
3283 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3285 with_libiptc="yes (shipped version)"
3288 if test "x$with_libperl" = "xyes"
3290 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3292 enable_perl="no (needs libperl)"
3295 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
3297 enable_perl="no (libperl doesn't support ithreads)"
3300 if test "x$with_perl_bindings" = "xyes" \
3301 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3303 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3310 libcurl . . . . . . . $with_libcurl
3311 libdbi . . . . . . . $with_libdbi
3312 libesmtp . . . . . . $with_libesmtp
3313 libiokit . . . . . . $with_libiokit
3314 libiptc . . . . . . . $with_libiptc
3315 libkstat . . . . . . $with_kstat
3316 libkvm . . . . . . . $with_libkvm
3317 libmysql . . . . . . $with_libmysql
3318 libnetlink . . . . . $with_libnetlink
3319 libnetsnmp . . . . . $with_libnetsnmp
3320 libnotify . . . . . . $with_libnotify
3321 liboconfig . . . . . $with_liboconfig
3322 libopenipmi . . . . . $with_libopenipmipthread
3323 liboping . . . . . . $with_liboping
3324 libpcap . . . . . . . $with_libpcap
3325 libperl . . . . . . . $with_libperl
3326 libpq . . . . . . . . $with_libpq
3327 libpthread . . . . . $with_libpthread
3328 librrd . . . . . . . $with_librrd
3329 libsensors . . . . . $with_libsensors
3330 libstatgrab . . . . . $with_libstatgrab
3331 libupsclient . . . . $with_libupsclient
3332 libvirt . . . . . . . $with_libvirt
3333 libxml2 . . . . . . . $with_libxml2
3334 libxmms . . . . . . . $with_libxmms
3335 oracle . . . . . . . $with_oracle
3338 daemon mode . . . . . $enable_daemon
3339 debug . . . . . . . . $enable_debug
3342 perl . . . . . . . . $with_perl_bindings
3345 apache . . . . . . . $enable_apache
3346 apcups . . . . . . . $enable_apcups
3347 apple_sensors . . . . $enable_apple_sensors
3348 ascent . . . . . . . $enable_ascent
3349 battery . . . . . . . $enable_battery
3350 bind . . . . . . . . $enable_bind
3351 cpu . . . . . . . . . $enable_cpu
3352 cpufreq . . . . . . . $enable_cpufreq
3353 csv . . . . . . . . . $enable_csv
3354 curl . . . . . . . . $enable_curl
3355 dbi . . . . . . . . . $enable_dbi
3356 df . . . . . . . . . $enable_df
3357 disk . . . . . . . . $enable_disk
3358 dns . . . . . . . . . $enable_dns
3359 email . . . . . . . . $enable_email
3360 entropy . . . . . . . $enable_entropy
3361 exec . . . . . . . . $enable_exec
3362 filecount . . . . . . $enable_filecount
3363 hddtemp . . . . . . . $enable_hddtemp
3364 interface . . . . . . $enable_interface
3365 ipmi . . . . . . . . $enable_ipmi
3366 iptables . . . . . . $enable_iptables
3367 ipvs . . . . . . . . $enable_ipvs
3368 irq . . . . . . . . . $enable_irq
3369 libvirt . . . . . . . $enable_libvirt
3370 load . . . . . . . . $enable_load
3371 logfile . . . . . . . $enable_logfile
3372 match_regex . . . . . $enable_match_regex
3373 match_timediff . . . $enable_match_timediff
3374 match_value . . . . . $enable_match_value
3375 mbmon . . . . . . . . $enable_mbmon
3376 memcached . . . . . . $enable_memcached
3377 memory . . . . . . . $enable_memory
3378 multimeter . . . . . $enable_multimeter
3379 mysql . . . . . . . . $enable_mysql
3380 netlink . . . . . . . $enable_netlink
3381 network . . . . . . . $enable_network
3382 nfs . . . . . . . . . $enable_nfs
3383 nginx . . . . . . . . $enable_nginx
3384 notify_desktop . . . $enable_notify_desktop
3385 notify_email . . . . $enable_notify_email
3386 ntpd . . . . . . . . $enable_ntpd
3387 nut . . . . . . . . . $enable_nut
3388 onewire . . . . . . . $enable_onewire
3389 openvpn . . . . . . . $enable_openvpn
3390 oracle . . . . . . . $enable_oracle
3391 perl . . . . . . . . $enable_perl
3392 ping . . . . . . . . $enable_ping
3393 postgresql . . . . . $enable_postgresql
3394 powerdns . . . . . . $enable_powerdns
3395 processes . . . . . . $enable_processes
3396 rrdcached . . . . . . $enable_rrdcached
3397 rrdtool . . . . . . . $enable_rrdtool
3398 sensors . . . . . . . $enable_sensors
3399 serial . . . . . . . $enable_serial
3400 snmp . . . . . . . . $enable_snmp
3401 swap . . . . . . . . $enable_swap
3402 syslog . . . . . . . $enable_syslog
3403 tail . . . . . . . . $enable_tail
3404 tape . . . . . . . . $enable_tape
3405 target_notification . $enable_target_notification
3406 target_replace . . . $enable_target_replace
3407 target_set . . . . . $enable_target_set
3408 tcpconns . . . . . . $enable_tcpconns
3409 teamspeak2 . . . . . $enable_teamspeak2
3410 thermal . . . . . . . $enable_thermal
3411 unixsock . . . . . . $enable_unixsock
3412 users . . . . . . . . $enable_users
3413 uuid . . . . . . . . $enable_uuid
3414 vmem . . . . . . . . $enable_vmem
3415 vserver . . . . . . . $enable_vserver
3416 wireless . . . . . . $enable_wireless
3417 xmms . . . . . . . . $enable_xmms
3421 if test "x$dependency_error" = "xyes"; then
3422 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
3425 # vim: set fdm=marker :