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)
5 AM_INIT_AUTOMAKE(dist-bzip2)
8 AC_PREFIX_DEFAULT("/opt/collectd")
13 # Checks for programs.
21 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
25 AC_LIBLTDL_CONVENIENCE
33 AC_CONFIG_SUBDIRS(libltdl)
35 AC_MSG_CHECKING([for kernel type ($host_os)])
38 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
42 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
54 AC_MSG_RESULT([$ac_system])
56 if test "x$ac_system" = "xLinux"
58 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
59 if test -z "$KERNEL_DIR"
61 KERNEL_DIR="/lib/modules/`uname -r`/source"
64 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
65 AC_SUBST(KERNEL_CFLAGS)
68 if test "x$ac_system" = "xSolaris"
70 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
73 # Where to install .pc files.
74 pkgconfigdir="${libdir}/pkgconfig"
75 AC_SUBST(pkgconfigdir)
78 # Checks for header files.
85 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)
88 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
93 # include <sys/types.h>
96 AC_CHECK_HEADERS(netinet/in.h, [], [],
101 # include <sys/types.h>
103 #if HAVE_NETINET_IN_SYSTM_H
104 # include <netinet/in_systm.h>
107 AC_CHECK_HEADERS(netinet/ip.h, [], [],
112 # include <sys/types.h>
114 #if HAVE_NETINET_IN_SYSTM_H
115 # include <netinet/in_systm.h>
117 #if HAVE_NETINET_IN_H
118 # include <netinet/in.h>
121 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
126 # include <sys/types.h>
128 #if HAVE_NETINET_IN_SYSTM_H
129 # include <netinet/in_systm.h>
131 #if HAVE_NETINET_IN_H
132 # include <netinet/in.h>
134 #if HAVE_NETINET_IP_H
135 # include <netinet/ip.h>
138 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
143 # include <sys/types.h>
145 #if HAVE_NETINET_IN_SYSTM_H
146 # include <netinet/in_systm.h>
148 #if HAVE_NETINET_IN_H
149 # include <netinet/in.h>
151 #if HAVE_NETINET_IP_H
152 # include <netinet/ip.h>
155 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
160 # include <sys/types.h>
162 #if HAVE_NETINET_IN_SYSTM_H
163 # include <netinet/in_systm.h>
165 #if HAVE_NETINET_IN_H
166 # include <netinet/in.h>
169 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
174 # include <sys/types.h>
176 #if HAVE_NETINET_IN_SYSTM_H
177 # include <netinet/in_systm.h>
179 #if HAVE_NETINET_IN_H
180 # include <netinet/in.h>
182 #if HAVE_NETINET_IP6_H
183 # include <netinet/ip6.h>
186 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
191 # include <sys/types.h>
193 #if HAVE_NETINET_IN_SYSTM_H
194 # include <netinet/in_systm.h>
196 #if HAVE_NETINET_IN_H
197 # include <netinet/in.h>
199 #if HAVE_NETINET_IP_H
200 # include <netinet/ip.h>
203 AC_CHECK_HEADERS(netinet/udp.h, [], [],
208 # include <sys/types.h>
210 #if HAVE_NETINET_IN_SYSTM_H
211 # include <netinet/in_systm.h>
213 #if HAVE_NETINET_IN_H
214 # include <netinet/in.h>
216 #if HAVE_NETINET_IP_H
217 # include <netinet/ip.h>
222 AC_CHECK_HEADERS(sys/dkstat.h)
223 if test "x$ac_system" = "xDarwin"
225 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)
226 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
228 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
231 # include <sys/types.h>
234 # include <sys/param.h>
239 AC_CHECK_HEADERS(linux/major.h libgen.h)
241 # For the battery plugin
242 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
244 #if HAVE_IOKIT_IOKITLIB_H
245 # include <IOKit/IOKitLib.h>
247 #if HAVE_IOKIT_IOTYPES_H
248 # include <IOKit/IOTypes.h>
252 # For the swap module
253 have_sys_swap_h="yes"
254 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
257 # include <sys/types.h>
260 # include <sys/param.h>
264 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
267 if test "x$GCC" = "xyes"
269 hint_64="CFLAGS='-m64'"
271 hint_64="CFLAGS='-xarch=v9'"
273 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
277 # For the processes plugin
279 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
281 # For interface plugin
282 AC_CHECK_HEADERS(ifaddrs.h)
283 AC_CHECK_HEADERS(net/if.h, [], [],
286 # include <sys/types.h>
288 #if HAVE_SYS_SOCKET_H
289 # include <sys/socket.h>
292 AC_CHECK_HEADERS(linux/if.h, [], [],
295 # include <sys/types.h>
297 #if HAVE_SYS_SOCKET_H
298 # include <sys/socket.h>
301 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
304 # include <sys/types.h>
306 #if HAVE_SYS_SOCKET_H
307 # include <sys/socket.h>
310 # include <linux/if.h>
315 have_net_ip_vs_h="no"
317 if test "x$ac_system" = "xLinux"
320 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
322 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
323 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
329 AC_CHECK_HEADERS(sys/ucred.h, [], [],
332 # include <sys/types.h>
335 # include <sys/param.h>
339 # For mount interface
340 AC_CHECK_HEADERS(sys/mount.h, [], [],
343 # include <sys/types.h>
346 # include <sys/param.h>
350 # For the email plugin
351 AC_CHECK_HEADERS(linux/un.h, [], [],
353 #if HAVE_SYS_SOCKET_H
354 # include <sys/socket.h>
358 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)
361 AC_CHECK_HEADERS(arpa/nameser.h)
362 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
364 #if HAVE_ARPA_NAMESER_H
365 # include <arpa/nameser.h>
369 AC_CHECK_HEADERS(net/if_arp.h, [], [],
370 [#if HAVE_SYS_SOCKET_H
371 # include <sys/socket.h>
374 AC_CHECK_HEADERS(net/ppp_defs.h)
375 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
376 [#if HAVE_NET_PPP_DEFS_H
377 # include <net/ppp_defs.h>
380 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
385 # include <sys/types.h>
387 #if HAVE_SYS_SOCKET_H
388 # include <sys/socket.h>
393 #if HAVE_NETINET_IN_H
394 # include <netinet/in.h>
398 # For the multimeter plugin
400 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
403 # Checks for typedefs, structures, and compiler characteristics.
412 # Checks for library functions.
414 AC_PROG_GCC_TRADITIONAL
415 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
419 AC_CACHE_CHECK([for strtok_r],
420 [c_cv_have_strtok_r_default],
429 char buffer[] = "foo,bar,baz";
436 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
439 printf ("token = %s;\n", token);
442 [c_cv_have_strtok_r_default="yes"],
443 [c_cv_have_strtok_r_default="no"]
447 if test "x$c_cv_have_strtok_r_default" = "xno"
449 SAVE_CFLAGS="$CFLAGS"
450 CFLAGS="$CFLAGS -D_REENTRANT=1"
452 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
453 [c_cv_have_strtok_r_reentrant],
462 char buffer[] = "foo,bar,baz";
469 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
472 printf ("token = %s;\n", token);
475 [c_cv_have_strtok_r_reentrant="yes"],
476 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
481 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
483 socket_needs_socket="no"
484 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
485 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
487 nanosleep_needs_rt="no"
488 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
489 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
491 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
492 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
493 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
494 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
495 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
496 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
497 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
498 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
499 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
500 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
501 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
502 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
505 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
508 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
510 if test "x$withval" = "xno"; then
512 else if test "x$withval" = "xyes"; then
519 if test "x$nan_type" = "xnone"; then
520 AC_CACHE_CHECK([whether NAN is defined by default],
521 [c_cv_have_nan_default],
527 static float foo = NAN;
535 [c_cv_have_nan_default="yes"],
536 [c_cv_have_nan_default="no"]
539 if test "x$c_cv_have_nan_default" = "xyes"
544 if test "x$nan_type" = "xnone"; then
545 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
546 [c_cv_have_nan_isoc],
551 #define __USE_ISOC99 1
553 static float foo = NAN;
561 [c_cv_have_nan_isoc="yes"],
562 [c_cv_have_nan_isoc="no"]
565 if test "x$c_cv_have_nan_isoc" = "xyes"
570 if test "x$nan_type" = "xnone"; then
571 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
572 [c_cv_have_nan_zero],
581 #define NAN (0.0 / 0.0)
583 # define isnan(f) ((f) != (f))
585 static float foo = NAN;
593 [c_cv_have_nan_zero="yes"],
594 [c_cv_have_nan_zero="no"]
597 if test "x$c_cv_have_nan_zero" = "xyes"
603 if test "x$nan_type" = "xdefault"; then
604 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
605 [Define if NAN is defined by default and can initialize static variables.])
606 else if test "x$nan_type" = "xisoc99"; then
607 AC_DEFINE(NAN_STATIC_ISOC, 1,
608 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
609 else if test "x$nan_type" = "xzero"; then
610 AC_DEFINE(NAN_ZERO_ZERO, 1,
611 [Define if NAN can be defined as (0.0 / 0.0)])
613 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
616 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
618 if test "x$withval" = "xnothing"; then
619 fp_layout_type="nothing"
620 else if test "x$withval" = "xendianflip"; then
621 fp_layout_type="endianflip"
622 else if test "x$withval" = "xintswap"; then
623 fp_layout_type="intswap"
625 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
628 [fp_layout_type="unknown"])
630 if test "x$fp_layout_type" = "xunknown"; then
631 AC_CACHE_CHECK([if doubles are stored in x86 representation],
632 [c_cv_fp_layout_need_nothing],
643 # include <stdbool.h>
653 memcpy ((void *) &i0, (void *) &d, 8);
656 memcpy ((void *) c, (void *) &i1, 8);
658 if ((c[0] == 0x2f) && (c[1] == 0x25)
659 && (c[2] == 0xc0) && (c[3] == 0xc7)
660 && (c[4] == 0x43) && (c[5] == 0x2b)
661 && (c[6] == 0x1f) && (c[7] == 0x5b))
666 [c_cv_fp_layout_need_nothing="yes"],
667 [c_cv_fp_layout_need_nothing="no"]
670 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
671 fp_layout_type="nothing"
674 if test "x$fp_layout_type" = "xunknown"; then
675 AC_CACHE_CHECK([if endianflip converts to x86 representation],
676 [c_cv_fp_layout_need_endianflip],
687 # include <stdbool.h>
689 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
690 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
691 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
692 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
693 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
694 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
695 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
696 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
705 memcpy ((void *) &i0, (void *) &d, 8);
707 i1 = endianflip (i0);
708 memcpy ((void *) c, (void *) &i1, 8);
710 if ((c[0] == 0x2f) && (c[1] == 0x25)
711 && (c[2] == 0xc0) && (c[3] == 0xc7)
712 && (c[4] == 0x43) && (c[5] == 0x2b)
713 && (c[6] == 0x1f) && (c[7] == 0x5b))
718 [c_cv_fp_layout_need_endianflip="yes"],
719 [c_cv_fp_layout_need_endianflip="no"]
722 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
723 fp_layout_type="endianflip"
726 if test "x$fp_layout_type" = "xunknown"; then
727 AC_CACHE_CHECK([if intswap converts to x86 representation],
728 [c_cv_fp_layout_need_intswap],
739 # include <stdbool.h>
741 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
742 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
751 memcpy ((void *) &i0, (void *) &d, 8);
754 memcpy ((void *) c, (void *) &i1, 8);
756 if ((c[0] == 0x2f) && (c[1] == 0x25)
757 && (c[2] == 0xc0) && (c[3] == 0xc7)
758 && (c[4] == 0x43) && (c[5] == 0x2b)
759 && (c[6] == 0x1f) && (c[7] == 0x5b))
764 [c_cv_fp_layout_need_intswap="yes"],
765 [c_cv_fp_layout_need_intswap="no"]
768 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
769 fp_layout_type="intswap"
773 if test "x$fp_layout_type" = "xnothing"; then
774 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
775 [Define if doubles are stored in x86 representation.])
776 else if test "x$fp_layout_type" = "xendianflip"; then
777 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
778 [Define if endianflip is needed to convert to x86 representation.])
779 else if test "x$fp_layout_type" = "xintswap"; then
780 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
781 [Define if intswap is needed to convert to x86 representation.])
783 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
787 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
789 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
791 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
794 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
795 if test "x$have_getmntent" = "xno"; then
796 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
798 if test "x$have_getmntent" = "xno"; then
799 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
801 if test "x$have_getmntent" = "xno"; then
802 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
805 if test "x$have_getmntent" = "xc"; then
806 AC_CACHE_CHECK([whether getmntent takes one argument],
807 [c_cv_have_one_getmntent],
809 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
810 #include "$srcdir/src/utils_mount.h"]],
814 fh = setmntent ("/etc/mtab", "r");
818 [c_cv_have_one_getmntent="yes"],
819 [c_cv_have_one_getmntent="no"]
822 AC_CACHE_CHECK([whether getmntent takes two arguments],
823 [c_cv_have_two_getmntent],
825 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
826 #include "$srcdir/src/utils_mount.h"]],
831 fh = fopen ("/etc/mnttab", "r");
832 status = getmntent (fh, &mt);
835 [c_cv_have_two_getmntent="yes"],
836 [c_cv_have_two_getmntent="no"]
841 # Check for different versions of `getmntent' here..
843 if test "x$have_getmntent" = "xc"; then
844 if test "x$c_cv_have_one_getmntent" = "xyes"; then
845 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
846 [Define if the function getmntent exists and takes one argument.])
848 if test "x$c_cv_have_two_getmntent" = "xyes"; then
849 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
850 [Define if the function getmntent exists and takes two arguments.])
853 if test "x$have_getmntent" = "xsun"; then
854 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
855 [Define if the function getmntent exists. It's the version from libsun.])
857 if test "x$have_getmntent" = "xseq"; then
858 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
859 [Define if the function getmntent exists. It's the version from libseq.])
861 if test "x$have_getmntent" = "xgen"; then
862 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
863 [Define if the function getmntent exists. It's the version from libgen.])
866 # Check for structures
867 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
868 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
871 #include <sys/types.h>
872 #include <sys/socket.h>
875 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
876 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
879 #include <sys/types.h>
880 #include <sys/socket.h>
881 #include <linux/if.h>
882 #include <linux/netdevice.h>
885 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
887 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
888 [Define if struct kinfo_proc exists in the FreeBSD variant.])
889 have_struct_kinfo_proc_freebsd="yes"
892 have_struct_kinfo_proc_freebsd="no"
896 #include <sys/param.h>
897 #include <sys/sysctl.h>
898 #include <sys/user.h>
901 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
903 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
904 [Define if struct kinfo_proc exists in the OpenBSD variant.])
905 have_struct_kinfo_proc_openbsd="yes"
908 have_struct_kinfo_proc_openbsd="no"
911 #include <sys/param.h>
912 #include <sys/sysctl.h>
916 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
921 # include <sys/types.h>
923 #if HAVE_NETINET_IN_SYSTM_H
924 # include <netinet/in_systm.h>
926 #if HAVE_NETINET_IN_H
927 # include <netinet/in.h>
929 #if HAVE_NETINET_IP_H
930 # include <netinet/ip.h>
932 #if HAVE_NETINET_UDP_H
933 # include <netinet/udp.h>
936 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
941 # include <sys/types.h>
943 #if HAVE_NETINET_IN_SYSTM_H
944 # include <netinet/in_systm.h>
946 #if HAVE_NETINET_IN_H
947 # include <netinet/in.h>
949 #if HAVE_NETINET_IP_H
950 # include <netinet/ip.h>
952 #if HAVE_NETINET_UDP_H
953 # include <netinet/udp.h>
957 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
967 # Checks for libraries begin here
970 AC_CHECK_LIB(resolv, res_search,
972 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
974 [with_libresolv="no"])
975 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
977 dnl Check for HAL (hardware abstraction library)
979 AC_CHECK_LIB(hal,libhal_device_property_exists,
980 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
982 if test "x$with_libhal" = "xyes"; then
983 if test "x$PKG_CONFIG" != "x"; then
984 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
985 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
986 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
987 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
991 m4_divert_once([HELP_WITH], [
992 collectd additional packages:])
994 if test "x$ac_system" = "xSolaris"
999 with_kstat="no (Solaris only)"
1000 with_devinfo="no (Solaris only)"
1003 if test "x$with_kstat" = "xyes"
1005 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1007 if test "x$with_kstat" = "xyes"
1009 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1010 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1012 if test "x$with_kstat" = "xyes"
1014 AC_DEFINE(HAVE_LIBKSTAT, 1,
1015 [Define to 1 if you have the 'kstat' library (-lkstat)])
1017 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1018 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1021 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1028 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1031 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1032 if test "x$with_kvm_getprocs" = "xyes"
1034 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1035 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1038 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1040 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1041 if test "x$with_kvm_getswapinfo" = "xyes"
1043 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1044 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1047 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1049 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1050 if test "x$with_kvm_nlist" = "xyes"
1052 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1053 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1056 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1058 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1059 if test "x$with_kvm_openfiles" = "xyes"
1061 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1062 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1065 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1067 # --with-libcurl {{{
1068 with_curl_config="curl-config"
1071 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1073 if test "x$withval" = "xno"
1076 else if test "x$withval" = "xyes"
1080 if test -f "$withval" && test -x "$withval"
1082 with_curl_config="$withval"
1084 else if test -x "$withval/bin/curl-config"
1086 with_curl_config="$withval/bin/curl-config"
1095 if test "x$with_libcurl" = "xyes"
1097 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1098 curl_config_status=$?
1100 if test $curl_config_status -ne 0
1102 with_libcurl="no ($with_curl_config failed)"
1104 SAVE_CPPFLAGS="$CPPFLAGS"
1105 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1107 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1109 CPPFLAGS="$SAVE_CPPFLAGS"
1112 if test "x$with_libcurl" = "xyes"
1114 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1115 curl_config_status=$?
1117 if test $curl_config_status -ne 0
1119 with_libcurl="no ($with_curl_config failed)"
1121 AC_CHECK_LIB(curl, curl_easy_init,
1122 [with_libcurl="yes"],
1123 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1127 if test "x$with_libcurl" = "xyes"
1129 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1130 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1131 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1132 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1134 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1138 with_libdbi_cppflags=""
1139 with_libdbi_ldflags=""
1140 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1142 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1144 with_libdbi_cppflags="-I$withval/include"
1145 with_libdbi_ldflags="-L$withval/lib"
1148 with_libdbi="$withval"
1154 if test "x$with_libdbi" = "xyes"
1156 SAVE_CPPFLAGS="$CPPFLAGS"
1157 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1159 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1161 CPPFLAGS="$SAVE_CPPFLAGS"
1163 if test "x$with_libdbi" = "xyes"
1165 SAVE_CPPFLAGS="$CPPFLAGS"
1166 SAVE_LDFLAGS="$LDFLAGS"
1167 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1168 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1170 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1172 CPPFLAGS="$SAVE_CPPFLAGS"
1173 LDFLAGS="$SAVE_LDFLAGS"
1175 if test "x$with_libdbi" = "xyes"
1177 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1178 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1179 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1180 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1181 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1182 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1184 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1187 # --with-libesmtp {{{
1188 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1190 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1192 LDFLAGS="$LDFLAGS -L$withval/lib"
1193 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1196 with_libesmtp="$withval"
1202 if test "x$with_libesmtp" = "xyes"
1204 AC_CHECK_LIB(esmtp, smtp_create_session,
1206 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1207 ], [with_libesmtp="no (libesmtp not found)"])
1209 if test "x$with_libesmtp" = "xyes"
1211 AC_CHECK_HEADERS(libesmtp.h,
1213 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1214 ], [with_libesmtp="no (libesmtp.h not found)"])
1216 if test "x$with_libesmtp" = "xyes"
1222 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1223 [Wether or not to use the esmtp library])
1224 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1227 # --with-libiptc {{{
1228 with_own_libiptc="no"
1229 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1231 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1233 LDFLAGS="$LDFLAGS -L$withval/lib"
1234 CPPFLAGS="$CPPFLAGS -I$withval/include"
1237 with_libiptc="$withval"
1241 if test "x$ac_system" = "xLinux"
1245 with_libiptc="no (Linux only)"
1248 if test "x$with_libiptc" = "xyes"
1250 AC_CHECK_LIB(iptc, iptc_init,
1252 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1256 with_own_libiptc="yes"
1259 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1261 AC_CHECK_HEADERS(libiptc/libiptc.h,
1263 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1267 with_own_libiptc="yes"
1270 if test "x$with_libiptc" = "xyes"
1273 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1275 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1277 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1278 with_own_libiptc="no"
1281 #include "$srcdir/src/libiptc/ipt_kernel_headers.h"
1286 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1287 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1288 if test "x$with_own_libiptc" = "xyes"
1290 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1294 # --with-libmysql {{{
1295 with_mysql_config="mysql_config"
1296 with_mysql_cflags=""
1298 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1300 if test "x$withval" = "xno"
1303 else if test "x$withval" = "xyes"
1307 if test -f "$withval" && test -x "$withval";
1309 with_mysql_config="$withval"
1310 else if test -x "$withval/bin/mysql_config"
1312 with_mysql_config="$withval/bin/mysql_config"
1320 if test "x$with_libmysql" = "xyes"
1322 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1323 mysql_config_status=$?
1325 if test $mysql_config_status -ne 0
1327 with_libmysql="no ($with_mysql_config failed)"
1329 SAVE_CPPFLAGS="$CPPFLAGS"
1330 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1333 have_mysql_mysql_h="no"
1334 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1336 if test "x$have_mysql_h" = "xno"
1338 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1341 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1343 with_libmysql="no (mysql.h not found)"
1346 CPPFLAGS="$SAVE_CPPFLAGS"
1349 if test "x$with_libmysql" = "xyes"
1351 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1352 mysql_config_status=$?
1354 if test $mysql_config_status -ne 0
1356 with_libmysql="no ($with_mysql_config failed)"
1358 AC_CHECK_LIB(mysqlclient, mysql_init,
1359 [with_libmysql="yes"],
1360 [with_libmysql="no (symbol 'mysql_init' not found)"],
1363 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1364 [with_libmysql="yes"],
1365 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1369 if test "x$with_libmysql" = "xyes"
1371 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1372 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1373 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1374 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1376 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1379 # --with-libnetlink {{{
1380 with_libnetlink_cflags=""
1381 with_libnetlink_libs="-lnetlink"
1382 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1384 echo "libnetlink: withval = $withval"
1385 if test "x$withval" = "xyes"
1387 with_libnetlink="yes"
1388 else if test "x$withval" = "xno"
1390 with_libnetlink="no"
1392 if test -d "$withval/include"
1394 with_libnetlink_cflags="-I$withval/include"
1395 with_libnetlink_libs="-L$withval/lib -lnetlink"
1396 with_libnetlink="yes"
1398 AC_MSG_ERROR("no such directory: $withval/include")
1403 if test "x$ac_system" = "xLinux"
1405 with_libnetlink="yes"
1407 with_libnetlink="no (Linux only library)"
1410 if test "x$with_libnetlink" = "xyes"
1413 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1415 with_libnetlink="no (libnetlink.h not found)"
1417 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1419 with_libnetlink="yes"
1423 #include <sys/types.h>
1424 #include <asm/types.h>
1425 #include <sys/socket.h>
1426 #include <linux/netlink.h>
1427 #include <linux/rtnetlink.h>])
1428 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1430 #include <sys/types.h>
1431 #include <asm/types.h>
1432 #include <sys/socket.h>])
1436 #include <sys/types.h>
1437 #include <asm/types.h>
1438 #include <sys/socket.h>
1439 #include <linux/netlink.h>
1440 #include <linux/rtnetlink.h>
1444 int retval = TCA_STATS2;
1447 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1452 #include <sys/types.h>
1453 #include <asm/types.h>
1454 #include <sys/socket.h>
1455 #include <linux/netlink.h>
1456 #include <linux/rtnetlink.h>
1460 int retval = TCA_STATS;
1463 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1466 CFLAGS="$SAVE_CFLAGS"
1468 if test "x$with_libnetlink" = "xyes"
1470 AC_CHECK_LIB(netlink, rtnl_open,
1471 [with_libnetlink="yes"],
1472 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1473 [$with_libnetlink_libs])
1475 if test "x$with_libnetlink" = "xyes"
1477 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1478 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1479 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1480 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1482 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1485 # --with-libnetsnmp {{{
1486 with_snmp_config="net-snmp-config"
1489 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1491 if test "x$withval" = "xno"
1493 with_libnetsnmp="no"
1494 else if test "x$withval" = "xyes"
1496 with_libnetsnmp="yes"
1498 if test -x "$withval"
1500 with_snmp_config="$withval"
1501 with_libnetsnmp="yes"
1503 with_snmp_config="$withval/bin/net-snmp-config"
1504 with_libnetsnmp="yes"
1508 [with_libnetsnmp="yes"])
1509 if test "x$with_libnetsnmp" = "xyes"
1511 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1512 snmp_config_status=$?
1514 if test $snmp_config_status -ne 0
1516 with_libnetsnmp="no ($with_snmp_config failed)"
1518 SAVE_CPPFLAGS="$CPPFLAGS"
1519 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1521 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1523 CPPFLAGS="$SAVE_CPPFLAGS"
1526 if test "x$with_libnetsnmp" = "xyes"
1528 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1529 snmp_config_status=$?
1531 if test $snmp_config_status -ne 0
1533 with_libnetsnmp="no ($with_snmp_config failed)"
1535 AC_CHECK_LIB(netsnmp, init_snmp,
1536 [with_libnetsnmp="yes"],
1537 [with_libnetsnmp="no (libnetsnmp not found)"],
1541 if test "x$with_libnetsnmp" = "xyes"
1543 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1544 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1545 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1546 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1548 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1551 # --with-liboconfig {{{
1552 with_own_liboconfig="no"
1553 liboconfig_LDFLAGS="$LDFLAGS"
1554 liboconfig_CPPFLAGS="$CPPFLAGS"
1555 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1557 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1559 if test -d "$withval/lib"
1561 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1563 if test -d "$withval/include"
1565 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1568 if test "x$withval" = "xno"
1570 AC_MSG_ERROR("liboconfig is required")
1574 with_liboconfig="yes"
1577 save_LDFLAGS="$LDFLAGS"
1578 save_CPPFLAGS="$CPPFLAGS"
1579 LDFLAGS="$liboconfig_LDFLAGS"
1580 CPPFLAGS="$liboconfig_CPPFLAGS"
1581 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1583 with_liboconfig="yes"
1584 with_own_liboconfig="no"
1587 with_liboconfig="yes"
1588 with_own_liboconfig="yes"
1589 LDFLAGS="$save_LDFLAGS"
1590 CPPFLAGS="$save_CPPFLAGS"
1593 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1594 if test "x$with_own_liboconfig" = "xyes"
1596 with_liboconfig="yes (shipped version)"
1600 # --with-liboping {{{
1601 with_own_liboping="no"
1602 liboping_LDFLAGS="$LDFLAGS"
1603 liboping_CPPFLAGS="$CPPFLAGS"
1604 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1606 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1608 if test -d "$withval/lib"
1610 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1612 if test -d "$withval/include"
1614 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1617 if test "x$withval" = "xno"
1620 with_own_liboping="no"
1621 else if test "x$withval" = "xyes"
1630 if test "x$with_liboping" = "xyes"
1632 save_LDFLAGS="$LDFLAGS"
1633 save_CPPFLAGS="$CPPFLAGS"
1634 LDFLAGS="$liboping_LDFLAGS"
1635 CPPFLAGS="$liboping_CPPFLAGS"
1636 AC_CHECK_LIB(oping, ping_construct,
1639 with_own_liboping="no"
1643 with_own_liboping="yes"
1644 LDFLAGS="$save_LDFLAGS"
1645 CPPFLAGS="$save_CPPFLAGS"
1648 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1649 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1653 with_oracle_cppflags=""
1655 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
1657 if test "x$withval" = "xyes"
1659 if test "x$ORACLE_HOME" = "x"
1661 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
1664 else if test "x$withval" = "xno"
1669 ORACLE_HOME="$withval"
1673 if test "x$ORACLE_HOME" = "x"
1675 with_oracle="no (ORACLE_HOME is not set)"
1680 if test "x$ORACLE_HOME" != "x"
1682 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
1684 if test -e "$ORACLE_HOME/lib/ldflags"
1686 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
1688 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
1689 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
1691 if test "x$with_oracle" = "xyes"
1693 SAVE_CPPFLAGS="$CPPFLAGS"
1694 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1696 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
1698 CPPFLAGS="$SAVE_CPPFLAGS"
1700 if test "x$with_oracle" = "xyes"
1702 SAVE_CPPFLAGS="$CPPFLAGS"
1703 SAVE_LDFLAGS="$LDFLAGS"
1704 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1705 LDFLAGS="$LDFLAGS $with_oracle_libs"
1707 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
1709 CPPFLAGS="$SAVE_CPPFLAGS"
1710 LDFLAGS="$SAVE_LDFLAGS"
1712 if test "x$with_oracle" = "xyes"
1714 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
1715 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
1716 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
1717 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
1721 # --with-libowcapi {{{
1722 with_libowcapi_cppflags=""
1723 with_libowcapi_libs="-lowcapi"
1724 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
1726 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1728 with_libowcapi_cppflags="-I$withval/include"
1729 with_libowcapi_libs="-L$withval/lib -lowcapi"
1730 with_libowcapi="yes"
1732 with_libowcapi="$withval"
1736 with_libowcapi="yes"
1738 if test "x$with_libowcapi" = "xyes"
1740 SAVE_CPPFLAGS="$CPPFLAGS"
1741 CPPFLAGS="$with_libowcapi_cppflags"
1743 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
1745 CPPFLAGS="$SAVE_CPPFLAGS"
1747 if test "x$with_libowcapi" = "xyes"
1749 SAVE_LDFLAGS="$LDFLAGS"
1750 SAVE_CPPFLAGS="$CPPFLAGS"
1751 LDFLAGS="$with_libowcapi_libs"
1752 CPPFLAGS="$with_libowcapi_cppflags"
1754 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
1756 LDFLAGS="$SAVE_LDFLAGS"
1757 CPPFLAGS="$SAVE_CPPFLAGS"
1759 if test "x$with_libowcapi" = "xyes"
1761 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
1762 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
1763 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
1764 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
1768 # --with-libpcap {{{
1769 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1771 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1773 LDFLAGS="$LDFLAGS -L$withval/lib"
1774 CPPFLAGS="$CPPFLAGS -I$withval/include"
1777 with_libpcap="$withval"
1783 if test "x$with_libpcap" = "xyes"
1785 AC_CHECK_LIB(pcap, pcap_open_live,
1787 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1788 ], [with_libpcap="no (libpcap not found)"])
1790 if test "x$with_libpcap" = "xyes"
1792 AC_CHECK_HEADERS(pcap.h,
1794 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1795 ], [with_libpcap="no (pcap.h not found)"])
1797 if test "x$with_libpcap" = "xyes"
1803 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1804 [Wether or not to use the pcap library])
1805 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1808 # --with-libperl {{{
1809 perl_interpreter="perl"
1810 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1812 if test -x "$withval"
1814 perl_interpreter="$withval"
1816 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1818 LDFLAGS="$LDFLAGS -L$withval/lib"
1819 CPPFLAGS="$CPPFLAGS -I$withval/include"
1820 perl_interpreter="$withval/bin/perl"
1823 with_libperl="$withval"
1830 AC_MSG_CHECKING([for perl])
1831 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
1832 if test -x "$perl_interpreter"
1834 AC_MSG_RESULT([yes ($perl_interpreter)])
1840 AC_SUBST(PERL, "$perl_interpreter")
1842 if test "x$with_libperl" = "xyes" \
1843 && test -n "$perl_interpreter"
1846 SAVE_LDFLAGS=$LDFLAGS
1847 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
1848 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
1849 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
1850 CFLAGS="$CFLAGS $PERL_CFLAGS"
1851 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1853 AC_CACHE_CHECK([for libperl],
1854 [c_cv_have_libperl],
1858 #define PERL_NO_GET_CONTEXT
1865 load_module (PERL_LOADMOD_NOIMPORT,
1866 newSVpv ("Collectd::Plugin::FooBar", 24),
1869 [c_cv_have_libperl="yes"],
1870 [c_cv_have_libperl="no"]
1874 if test "x$c_cv_have_libperl" = "xyes"
1876 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1877 AC_SUBST(PERL_CFLAGS)
1878 AC_SUBST(PERL_LDFLAGS)
1884 LDFLAGS=$SAVE_LDFLAGS
1885 else if test -z "$perl_interpreter"; then
1886 with_libperl="no (no perl interpreter found)"
1887 c_cv_have_libperl="no"
1889 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1891 if test "x$with_libperl" = "xyes"
1894 SAVE_LDFLAGS=$LDFLAGS
1895 CFLAGS="$CFLAGS $PERL_CFLAGS"
1896 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1898 AC_CACHE_CHECK([if perl supports ithreads],
1899 [c_cv_have_perl_ithreads],
1907 #if !defined(USE_ITHREADS)
1908 # error "Perl does not support ithreads!"
1909 #endif /* !defined(USE_ITHREADS) */
1912 [c_cv_have_perl_ithreads="yes"],
1913 [c_cv_have_perl_ithreads="no"]
1917 if test "x$c_cv_have_perl_ithreads" = "xyes"
1919 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1923 LDFLAGS=$SAVE_LDFLAGS
1926 c_cv_have_broken_perl_load_module="no"
1927 if test "x$with_libperl" = "xyes"
1930 SAVE_LDFLAGS=$LDFLAGS
1931 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
1932 # (see issues #41 and #42)
1933 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
1934 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1936 AC_CACHE_CHECK([for broken Perl_load_module()],
1937 [c_cv_have_broken_perl_load_module],
1941 #define PERL_NO_GET_CONTEXT
1948 load_module (PERL_LOADMOD_NOIMPORT,
1949 newSVpv ("Collectd::Plugin::FooBar", 24),
1952 [c_cv_have_broken_perl_load_module="no"],
1953 [c_cv_have_broken_perl_load_module="yes"]
1958 LDFLAGS=$SAVE_LDFLAGS
1960 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
1961 test "x$c_cv_have_broken_perl_load_module" = "xyes")
1963 if test "x$with_libperl" = "xyes"
1966 SAVE_LDFLAGS=$LDFLAGS
1967 CFLAGS="$CFLAGS $PERL_CFLAGS"
1968 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1971 [struct mgvtbl.svt_local],
1972 [have_struct_mgvtbl_svt_local="yes"],
1973 [have_struct_mgvtbl_svt_local="no"],
1980 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
1982 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
1983 [Define if Perl's struct mgvtbl has member svt_local.])
1987 LDFLAGS=$SAVE_LDFLAGS
1992 with_pg_config="pg_config"
1993 with_libpq_includedir=""
1994 with_libpq_libdir=""
1995 with_libpq_cppflags=""
1996 with_libpq_ldflags=""
1997 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2000 if test "x$withval" = "xno"
2003 else if test "x$withval" = "xyes"
2007 if test -f "$withval" && test -x "$withval";
2009 with_pg_config="$withval"
2010 else if test -x "$withval/bin/pg_config"
2012 with_pg_config="$withval/bin/pg_config"
2020 if test "x$with_libpq" = "xyes"
2022 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2025 if test $pg_config_status -eq 0
2027 if test -n "$with_libpq_includedir"; then
2028 for dir in $with_libpq_includedir; do
2029 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2033 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2036 SAVE_CPPFLAGS="$CPPFLAGS"
2037 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2039 AC_CHECK_HEADERS(libpq-fe.h, [],
2040 [with_libpq="no (libpq-fe.h not found)"], [])
2042 CPPFLAGS="$SAVE_CPPFLAGS"
2044 if test "x$with_libpq" = "xyes"
2046 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2049 if test $pg_config_status -eq 0
2051 if test -n "$with_libpq_libdir"; then
2052 for dir in $with_libpq_libdir; do
2053 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2057 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2060 SAVE_LDFLAGS="$LDFLAGS"
2061 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2063 AC_CHECK_LIB(pq, PQconnectdb,
2065 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2067 LDFLAGS="$SAVE_LDFLAGS"
2069 if test "x$with_libpq" = "xyes"
2071 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2072 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2073 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2074 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2076 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2079 # --with-libpthread {{{
2080 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2081 [ if test "x$withval" != "xno" \
2082 && test "x$withval" != "xyes"
2084 LDFLAGS="$LDFLAGS -L$withval/lib"
2085 CPPFLAGS="$CPPFLAGS -I$withval/include"
2086 with_libpthread="yes"
2088 if test "x$withval" = "xno"
2090 with_libpthread="no (disabled)"
2093 ], [with_libpthread="yes"])
2094 if test "x$with_libpthread" = "xyes"
2096 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2099 if test "x$with_libpthread" = "xyes"
2101 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2103 if test "x$with_libpthread" = "xyes"
2109 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2110 [Wether or not to use pthread (POSIX threads) library])
2111 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2115 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2118 librrd_threadsafe="yes"
2119 librrd_rrdc_update="no"
2120 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2121 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2123 librrd_cflags="-I$withval/include"
2124 librrd_ldflags="-L$withval/lib"
2127 with_librrd="$withval"
2129 ], [with_librrd="yes"])
2130 if test "x$with_librrd" = "xyes"
2132 SAVE_CPPFLAGS="$CPPFLAGS"
2133 SAVE_LDFLAGS="$LDFLAGS"
2135 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2136 LDFLAGS="$LDFLAGS $librrd_ldflags"
2138 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2140 CPPFLAGS="$SAVE_CPPFLAGS"
2141 LDFLAGS="$SAVE_LDFLAGS"
2143 if test "x$with_librrd" = "xyes"
2145 SAVE_CPPFLAGS="$CPPFLAGS"
2146 SAVE_LDFLAGS="$LDFLAGS"
2148 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2149 LDFLAGS="$LDFLAGS $librrd_ldflags"
2151 AC_CHECK_LIB(rrd_th, rrd_update_r,
2153 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2155 [librrd_threadsafe="no"
2156 AC_CHECK_LIB(rrd, rrd_update,
2158 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2160 [with_librrd="no (symbol 'rrd_update' not found)"],
2165 if test "x$librrd_threadsafe" = "xyes"
2167 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2169 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2172 CPPFLAGS="$SAVE_CPPFLAGS"
2173 LDFLAGS="$SAVE_LDFLAGS"
2175 if test "x$with_librrd" = "xyes"
2177 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2178 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2179 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2180 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2182 if test "x$librrd_threadsafe" = "xyes"
2184 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2188 # --with-libsensors {{{
2189 with_sensors_cflags=""
2190 with_sensors_ldflags=""
2191 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2193 if test "x$withval" = "xno"
2195 with_libsensors="no"
2197 with_libsensors="yes"
2198 if test "x$withval" != "xyes"
2200 with_sensors_cflags="-I$withval/include"
2201 with_sensors_ldflags="-L$withval/lib"
2202 with_libsensors="yes"
2207 if test "x$ac_system" = "xLinux"
2209 with_libsensors="yes"
2211 with_libsensors="no (Linux only library)"
2214 if test "x$with_libsensors" = "xyes"
2216 SAVE_CPPFLAGS="$CPPFLAGS"
2217 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2219 # AC_CHECK_HEADERS(sensors/sensors.h,
2221 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2223 # [with_libsensors="no (sensors/sensors.h not found)"])
2224 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2226 CPPFLAGS="$SAVE_CPPFLAGS"
2228 if test "x$with_libsensors" = "xyes"
2230 SAVE_CPPFLAGS="$CPPFLAGS"
2231 SAVE_LDFLAGS="$LDFLAGS"
2232 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2233 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2235 AC_CHECK_LIB(sensors, sensors_init,
2237 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2239 [with_libsensors="no (libsensors not found)"])
2241 CPPFLAGS="$SAVE_CPPFLAGS"
2242 LDFLAGS="$SAVE_LDFLAGS"
2244 if test "x$with_libsensors" = "xyes"
2246 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2247 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2248 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2249 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2251 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2254 # --with-libstatgrab {{{
2255 with_libstatgrab_cflags=""
2256 with_libstatgrab_ldflags=""
2257 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2259 if test "x$withval" != "xno" \
2260 && test "x$withval" != "xyes"
2262 with_libstatgrab_cflags="-I$withval/include"
2263 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
2264 with_libstatgrab="yes"
2265 with_libstatgrab_pkg_config="no"
2267 with_libstatgrab="$withval"
2268 with_libstatgrab_pkg_config="yes"
2272 with_libstatgrab="yes"
2273 with_libstatgrab_pkg_config="yes"
2276 if test "x$with_libstatgrab" = "xyes" \
2277 && test "x$with_libstatgrab_pkg_config" = "xyes"
2279 if test "x$PKG_CONFIG" != "x"
2281 AC_MSG_CHECKING([pkg-config for libstatgrab])
2283 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2286 with_libstatgrab_pkg_config="no"
2287 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
2288 temp_result="not found"
2290 AC_MSG_RESULT([$temp_result])
2292 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2293 with_libstatgrab_pkg_config="no"
2294 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2298 if test "x$with_libstatgrab" = "xyes" \
2299 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2300 && test "x$with_libstatgrab_cflags" = "x"
2302 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2303 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2306 with_libstatgrab_cflags="$temp_result"
2308 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2309 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2311 AC_MSG_RESULT([$temp_result])
2314 if test "x$with_libstatgrab" = "xyes" \
2315 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2316 && test "x$with_libstatgrab_ldflags" = "x"
2318 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2319 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2322 with_libstatgrab_ldflags="$temp_result"
2324 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2325 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2327 AC_MSG_RESULT([$temp_result])
2330 if test "x$with_libstatgrab" = "xyes"
2332 SAVE_CPPFLAGS="$CPPFLAGS"
2333 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2335 AC_CHECK_HEADERS(statgrab.h,
2336 [with_libstatgrab="yes"],
2337 [with_libstatgrab="no (statgrab.h not found)"])
2339 CPPFLAGS="$SAVE_CPPFLAGS"
2342 if test "x$with_libstatgrab" = "xyes"
2344 SAVE_CFLAGS="$CFLAGS"
2345 SAVE_LDFLAGS="$LDFLAGS"
2347 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2348 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2350 AC_CHECK_LIB(statgrab, sg_init,
2351 [with_libstatgrab="yes"],
2352 [with_libstatgrab="no (symbol sg_init not found)"])
2354 CFLAGS="$SAVE_CFLAGS"
2355 LDFLAGS="$SAVE_LDFLAGS"
2358 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2359 if test "x$with_libstatgrab" = "xyes"
2361 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2362 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2363 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2364 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2365 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2369 # --with-libupsclient {{{
2370 with_libupsclient_config=""
2371 with_libupsclient_cflags=""
2372 with_libupsclient_libs=""
2373 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2375 if test "x$withval" = "xno"
2377 with_libupsclient="no"
2378 else if test "x$withval" = "xyes"
2380 with_libupsclient="use_pkgconfig"
2382 if test -x "$withval"
2384 with_libupsclient_config="$withval"
2385 with_libupsclient="use_libupsclient_config"
2386 else if test -x "$withval/bin/libupsclient-config"
2388 with_libupsclient_config="$withval/bin/net-snmp-config"
2389 with_libupsclient="use_libupsclient_config"
2391 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
2392 with_libupsclient_cflags="-I$withval/include"
2393 with_libupsclient_libs="-L$withval/lib -lupsclient"
2394 with_libupsclient="yes"
2398 [with_libupsclient="use_pkgconfig"])
2400 # configure using libupsclient-config
2401 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2403 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
2404 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
2407 with_libupsclient="no ($with_libupsclient_config failed)"
2409 with_libupsclient_libs="`$with_libupsclient_config --libs`"
2412 with_libupsclient="no ($with_libupsclient_config failed)"
2415 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2417 with_libupsclient="yes"
2420 # configure using pkg-config
2421 if test "x$with_libupsclient" = "xuse_pkgconfig"
2423 if test "x$PKG_CONFIG" = "x"
2425 with_libupsclient="no (Don't have pkg-config)"
2428 if test "x$with_libupsclient" = "xuse_pkgconfig"
2430 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
2431 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
2434 with_libupsclient="no (pkg-config doesn't know library)"
2437 if test "x$with_libupsclient" = "xuse_pkgconfig"
2439 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
2442 with_libupsclient="no ($PKG_CONFIG failed)"
2444 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
2447 with_libupsclient="no ($PKG_CONFIG failed)"
2450 if test "x$with_libupsclient" = "xuse_pkgconfig"
2452 with_libupsclient="yes"
2455 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
2456 # the actual checks.
2457 if test "x$with_libupsclient" = "xyes"
2459 SAVE_CPPFLAGS="$CPPFLAGS"
2460 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2462 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2464 CPPFLAGS="$SAVE_CPPFLAGS"
2466 if test "x$with_libupsclient" = "xyes"
2468 SAVE_CPPFLAGS="$CPPFLAGS"
2469 SAVE_LDFLAGS="$LDFLAGS"
2471 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2472 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2474 AC_CHECK_LIB(upsclient, upscli_connect,
2475 [with_libupsclient="yes"],
2476 [with_libupsclient="no (symbol upscli_connect not found)"])
2478 CPPFLAGS="$SAVE_CPPFLAGS"
2479 LDFLAGS="$SAVE_LDFLAGS"
2481 if test "x$with_libupsclient" = "xyes"
2483 SAVE_CPPFLAGS="$CPPFLAGS"
2484 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2486 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2487 [#include <stdlib.h>
2489 #include <upsclient.h>])
2491 CPPFLAGS="$SAVE_CPPFLAGS"
2493 if test "x$with_libupsclient" = "xyes"
2495 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2496 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2497 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2498 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2502 # --with-libxmms {{{
2503 with_xmms_config="xmms-config"
2506 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2508 if test "x$withval" != "xno" \
2509 && test "x$withval" != "xyes"
2511 if test -f "$withval" && test -x "$withval";
2513 with_xmms_config="$withval"
2514 else if test -x "$withval/bin/xmms-config"
2516 with_xmms_config="$withval/bin/xmms-config"
2519 else if test "x$withval" = "xno"
2529 if test "x$with_libxmms" = "xyes"
2531 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2532 xmms_config_status=$?
2534 if test $xmms_config_status -ne 0
2539 if test "x$with_libxmms" = "xyes"
2541 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2542 xmms_config_status=$?
2544 if test $xmms_config_status -ne 0
2549 if test "x$with_libxmms" = "xyes"
2551 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2553 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2554 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2555 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2556 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2563 with_libxmms_numeric=0
2564 if test "x$with_libxmms" = "xyes"
2566 with_libxmms_numeric=1
2568 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2569 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2572 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
2573 with_libxml2="no (pkg-config isn't available)"
2574 with_libxml2_cflags=""
2575 with_libxml2_ldflags=""
2576 with_libvirt="no (pkg-config isn't available)"
2577 with_libvirt_cflags=""
2578 with_libvirt_ldflags=""
2579 if test "x$PKG_CONFIG" != "x"
2581 pkg-config --exists 'libxml-2.0' 2>/dev/null
2586 with_libxml2="no (pkg-config doesn't know library)"
2589 pkg-config --exists libvirt 2>/dev/null
2594 with_libvirt="no (pkg-config doesn't know library)"
2597 if test "x$with_libxml2" = "xyes"
2599 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2604 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2610 if test "x$with_libxml2" = "xyes"
2612 SAVE_CPPFLAGS="$CPPFLAGS"
2613 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2615 AC_CHECK_HEADERS(libxml/parser.h, [],
2616 [with_libxml2="no (libxml/parser.h not found)"])
2618 CPPFLAGS="$SAVE_CPPFLAGS"
2620 if test "x$with_libxml2" = "xyes"
2622 SAVE_CFLAGS="$CFLAGS"
2623 SAVE_LDFLAGS="$LDFLAGS"
2625 CFLAGS="$CFLAGS $with_libxml2_cflags"
2626 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2628 AC_CHECK_LIB(xml2, xmlXPathEval,
2629 [with_libxml2="yes"],
2630 [with_libxml2="no (symbol xmlXPathEval not found)"])
2632 CFLAGS="$SAVE_CFLAGS"
2633 LDFLAGS="$SAVE_LDFLAGS"
2635 dnl Add the right compiler flags and libraries.
2636 if test "x$with_libxml2" = "xyes"; then
2637 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2638 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2639 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2640 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2642 if test "x$with_libvirt" = "xyes"
2644 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2649 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2655 if test "x$with_libvirt" = "xyes"
2657 SAVE_CPPFLAGS="$CPPFLAGS"
2658 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2660 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2661 [with_libvirt="no (libvirt/libvirt.h not found)"])
2663 CPPFLAGS="$SAVE_CPPFLAGS"
2665 if test "x$with_libvirt" = "xyes"
2667 SAVE_CFLAGS="$CFLAGS"
2668 SAVE_LDFLAGS="$LDFLAGS"
2670 CFLAGS="$CFLAGS $with_libvirt_cflags"
2671 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2673 AC_CHECK_LIB(virt, virDomainBlockStats,
2674 [with_libvirt="yes"],
2675 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2677 CFLAGS="$SAVE_CFLAGS"
2678 LDFLAGS="$SAVE_LDFLAGS"
2680 dnl Add the right compiler flags and libraries.
2681 if test "x$with_libvirt" = "xyes"; then
2682 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2683 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2684 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2685 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2689 # $PKG_CONFIG --exists OpenIPMIpthread {{{
2690 with_libopenipmipthread="yes"
2691 with_libopenipmipthread_cflags=""
2692 with_libopenipmipthread_libs=""
2694 AC_MSG_CHECKING([for pkg-config])
2696 if test "x$PKG_CONFIG" = "x"
2698 with_libopenipmipthread="no"
2701 temp_result="$PKG_CONFIG"
2703 AC_MSG_RESULT([$temp_result])
2705 if test "x$with_libopenipmipthread" = "xyes"
2707 AC_MSG_CHECKING([for libOpenIPMIpthread])
2708 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2711 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2713 AC_MSG_RESULT([$with_libopenipmipthread])
2716 if test "x$with_libopenipmipthread" = "xyes"
2718 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2719 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2722 with_libopenipmipthread_cflags="$temp_result"
2724 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2725 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2727 AC_MSG_RESULT([$temp_result])
2730 if test "x$with_libopenipmipthread" = "xyes"
2732 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2733 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2736 with_libopenipmipthread_ldflags="$temp_result"
2738 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2739 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2741 AC_MSG_RESULT([$temp_result])
2744 if test "x$with_libopenipmipthread" = "xyes"
2746 SAVE_CPPFLAGS="$CPPFLAGS"
2747 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2749 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2750 [with_libopenipmipthread="yes"],
2751 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2752 [#include <OpenIPMI/ipmiif.h>
2753 #include <OpenIPMI/ipmi_err.h>
2754 #include <OpenIPMI/ipmi_posix.h>
2755 #include <OpenIPMI/ipmi_conn.h>
2758 CPPFLAGS="$SAVE_CPPFLAGS"
2761 if test "x$with_libopenipmipthread" = "xyes"
2763 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2764 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2765 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2766 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2770 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
2771 [with_libnotify="yes"],
2772 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
2774 # Check for enabled/disabled features
2777 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2778 # ------------------------------------------------------------
2780 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2785 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2790 m4_define([EnDis],[disabled])dnl
2791 m4_define([YesNo],[no])dnl
2797 m4_define([EnDis],[enabled])dnl
2798 m4_define([YesNo],[yes])dnl
2801 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2805 m4_if([$3], [feature], [],
2809 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2815 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2817 enable_$1='[YesNo]'dnl
2819 if test "x$enable_$1" = "xno"
2823 if test "x$enable_$1" = "xyes"
2827 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2832 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2833 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2835 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2837 # AC_PLUGIN(name, default, info)
2838 # ------------------------------------------------------------
2844 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2846 if test "x$enableval" = "xyes"
2854 if test "x$2" = "xyes"
2861 if test "x$enable_plugin" = "xyes"
2863 if test "x$2" = "xyes"
2865 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2866 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2867 dependency_error="yes"
2868 enable_plugin="no (dependency error)"
2871 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2872 enable_$1="$enable_plugin"
2874 )# AC_PLUGIN(name, default, info)
2876 m4_divert_once([HELP_ENABLE], [
2877 collectd features:])
2878 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2879 AC_COLLECTD([debug], [enable], [feature], [debugging])
2880 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2881 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2883 dependency_error="no"
2892 plugin_interface="no"
2899 plugin_multimeter="no"
2902 plugin_processes="no"
2906 plugin_tcpconns="no"
2911 plugin_wireless="no"
2914 if test "x$ac_system" = "xLinux"
2916 plugin_battery="yes"
2918 plugin_cpufreq="yes"
2920 plugin_entropy="yes"
2921 plugin_interface="yes"
2926 plugin_processes="yes"
2929 plugin_tcpconns="yes"
2930 plugin_thermal="yes"
2932 plugin_vserver="yes"
2933 plugin_wireless="yes"
2935 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2941 if test "x$ac_system" = "xOpenBSD"
2943 plugin_tcpconns="yes"
2947 if test "x$with_libiokit" = "xyes"
2949 plugin_battery="yes"
2954 if test "x$with_devinfo$with_kstat" = "xyesyes"
2958 plugin_interface="yes"
2963 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
2969 if test "x$with_libstatgrab" = "xyes"
2973 plugin_interface="yes"
2980 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
2986 if test "x$with_libopenipmipthread" = "xyes"
2991 if test "x$have_processor_info" = "xyes"
2995 if test "x$have_sysctl" = "xyes"
3000 if test "x$have_sysctlbyname" = "xyes"
3004 plugin_tcpconns="yes"
3007 # Df plugin: Check if we know how to determine mount points first.
3008 #if test "x$have_listmntent" = "xyes"; then
3011 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
3015 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
3019 #if test "x$have_getmntent" = "xseq"
3023 if test "x$c_cv_have_one_getmntent" = "xyes"
3028 # Df plugin: Check if we have either `statfs' or `statvfs' second.
3029 if test "x$plugin_df" = "xyes"
3032 if test "x$have_statfs" = "xyes"
3036 if test "x$have_statvfs" = "xyes"
3042 if test "x$have_getifaddrs" = "xyes"
3044 plugin_interface="yes"
3047 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
3049 plugin_libvirt="yes"
3052 if test "x$have_getloadavg" = "xyes"
3057 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
3062 # Mac OS X memory interface
3063 if test "x$have_host_statistics" = "xyes"
3068 if test "x$have_termios_h" = "xyes"
3070 plugin_multimeter="yes"
3073 if test "x$have_thread_info" = "xyes"
3075 plugin_processes="yes"
3078 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
3080 plugin_processes="yes"
3083 if test "x$with_kvm_getswapinfo" = "xyes"
3088 if test "x$have_swapctl" = "xyes"
3093 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
3095 plugin_tcpconns="yes"
3098 if test "x$have_getutent" = "xyes"
3102 if test "x$have_getutxent" = "xyes"
3107 m4_divert_once([HELP_ENABLE], [
3110 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3111 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3112 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3113 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3114 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3115 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3116 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3117 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3118 AC_PLUGIN([csv], [yes], [CSV output plugin])
3119 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
3120 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3121 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3122 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3123 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3124 AC_PLUGIN([email], [yes], [EMail statistics])
3125 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3126 AC_PLUGIN([exec], [yes], [Execution of external programs])
3127 AC_PLUGIN([filecount], [yes], [Count files in directories])
3128 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3129 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3130 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3131 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3132 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3133 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3134 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3135 AC_PLUGIN([load], [$plugin_load], [System load])
3136 AC_PLUGIN([logfile], [yes], [File logging plugin])
3137 AC_PLUGIN([match_regex], [yes], [The regex match])
3138 AC_PLUGIN([match_timediff], [yes], [The timediff match])
3139 AC_PLUGIN([match_value], [yes], [The value match])
3140 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3141 AC_PLUGIN([memcached], [yes], [memcached statistics])
3142 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3143 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3144 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3145 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3146 AC_PLUGIN([network], [yes], [Network communication plugin])
3147 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3148 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3149 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3150 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3151 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3152 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3153 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3154 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3155 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3156 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3157 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3158 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3159 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3160 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3161 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3162 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3163 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3164 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3165 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3166 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3167 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3168 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3169 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3170 AC_PLUGIN([target_notification], [yes], [The notification target])
3171 AC_PLUGIN([target_replace], [yes], [The replace target])
3172 AC_PLUGIN([target_set], [yes], [The set target])
3173 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3174 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3175 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3176 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3177 AC_PLUGIN([users], [$plugin_users], [User statistics])
3178 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3179 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3180 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3181 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3182 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3185 if test "x$ac_system" = "xLinux" \
3186 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3188 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3192 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3194 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3196 PERL_BINDINGS_OPTIONS="$withval"
3197 with_perl_bindings="yes"
3199 PERL_BINDINGS_OPTIONS=""
3200 with_perl_bindings="$withval"
3204 PERL_BINDINGS_OPTIONS=""
3205 if test -n "$perl_interpreter"
3207 with_perl_bindings="yes"
3209 with_perl_bindings="no (no perl interpreter found)"
3212 if test "x$with_perl_bindings" = "xyes"
3214 PERL_BINDINGS="perl"
3218 AC_SUBST(PERL_BINDINGS)
3219 AC_SUBST(PERL_BINDINGS_OPTIONS)
3221 dnl libcollectdclient
3222 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3223 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3224 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3226 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3228 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3230 AC_SUBST(LCC_VERSION_MAJOR)
3231 AC_SUBST(LCC_VERSION_MINOR)
3232 AC_SUBST(LCC_VERSION_PATCH)
3233 AC_SUBST(LCC_VERSION_EXTRA)
3234 AC_SUBST(LCC_VERSION_STRING)
3236 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3238 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)
3240 if test "x$with_librrd" = "xyes" \
3241 && test "x$librrd_threadsafe" != "xyes"
3243 with_librrd="yes (warning: librrd is not thread-safe)"
3246 if test "x$with_liboping" = "xyes" \
3247 && test "x$with_own_liboping" = "xyes"
3249 with_liboping="yes (shipped version)"
3252 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3254 with_libiptc="yes (shipped version)"
3257 if test "x$with_libperl" = "xyes"
3259 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3261 enable_perl="no (needs libperl)"
3264 if test "x$with_perl_bindings" = "xyes" \
3265 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3267 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3274 libcurl . . . . . . . $with_libcurl
3275 libdbi . . . . . . . $with_libdbi
3276 libesmtp . . . . . . $with_libesmtp
3277 libiokit . . . . . . $with_libiokit
3278 libiptc . . . . . . . $with_libiptc
3279 libkstat . . . . . . $with_kstat
3280 libkvm . . . . . . . $with_libkvm
3281 libmysql . . . . . . $with_libmysql
3282 libnetlink . . . . . $with_libnetlink
3283 libnetsnmp . . . . . $with_libnetsnmp
3284 libnotify . . . . . . $with_libnotify
3285 liboconfig . . . . . $with_liboconfig
3286 libopenipmi . . . . . $with_libopenipmipthread
3287 liboping . . . . . . $with_liboping
3288 libpcap . . . . . . . $with_libpcap
3289 libperl . . . . . . . $with_libperl
3290 libpq . . . . . . . . $with_libpq
3291 libpthread . . . . . $with_libpthread
3292 librrd . . . . . . . $with_librrd
3293 libsensors . . . . . $with_libsensors
3294 libstatgrab . . . . . $with_libstatgrab
3295 libupsclient . . . . $with_libupsclient
3296 libvirt . . . . . . . $with_libvirt
3297 libxml2 . . . . . . . $with_libxml2
3298 libxmms . . . . . . . $with_libxmms
3299 oracle . . . . . . . $with_oracle
3302 daemon mode . . . . . $enable_daemon
3303 debug . . . . . . . . $enable_debug
3306 perl . . . . . . . . $with_perl_bindings
3309 apache . . . . . . . $enable_apache
3310 apcups . . . . . . . $enable_apcups
3311 apple_sensors . . . . $enable_apple_sensors
3312 ascent . . . . . . . $enable_ascent
3313 battery . . . . . . . $enable_battery
3314 bind . . . . . . . . $enable_bind
3315 cpu . . . . . . . . . $enable_cpu
3316 cpufreq . . . . . . . $enable_cpufreq
3317 csv . . . . . . . . . $enable_csv
3318 curl . . . . . . . . $enable_curl
3319 dbi . . . . . . . . . $enable_dbi
3320 df . . . . . . . . . $enable_df
3321 disk . . . . . . . . $enable_disk
3322 dns . . . . . . . . . $enable_dns
3323 email . . . . . . . . $enable_email
3324 entropy . . . . . . . $enable_entropy
3325 exec . . . . . . . . $enable_exec
3326 filecount . . . . . . $enable_filecount
3327 hddtemp . . . . . . . $enable_hddtemp
3328 interface . . . . . . $enable_interface
3329 ipmi . . . . . . . . $enable_ipmi
3330 iptables . . . . . . $enable_iptables
3331 ipvs . . . . . . . . $enable_ipvs
3332 irq . . . . . . . . . $enable_irq
3333 libvirt . . . . . . . $enable_libvirt
3334 load . . . . . . . . $enable_load
3335 logfile . . . . . . . $enable_logfile
3336 match_regex . . . . . $enable_match_regex
3337 match_timediff . . . $enable_match_timediff
3338 match_value . . . . . $enable_match_value
3339 mbmon . . . . . . . . $enable_mbmon
3340 memcached . . . . . . $enable_memcached
3341 memory . . . . . . . $enable_memory
3342 multimeter . . . . . $enable_multimeter
3343 mysql . . . . . . . . $enable_mysql
3344 netlink . . . . . . . $enable_netlink
3345 network . . . . . . . $enable_network
3346 nfs . . . . . . . . . $enable_nfs
3347 nginx . . . . . . . . $enable_nginx
3348 notify_desktop . . . $enable_notify_desktop
3349 notify_email . . . . $enable_notify_email
3350 ntpd . . . . . . . . $enable_ntpd
3351 nut . . . . . . . . . $enable_nut
3352 onewire . . . . . . . $enable_onewire
3353 openvpn . . . . . . . $enable_openvpn
3354 oracle . . . . . . . $enable_oracle
3355 perl . . . . . . . . $enable_perl
3356 ping . . . . . . . . $enable_ping
3357 postgresql . . . . . $enable_postgresql
3358 powerdns . . . . . . $enable_powerdns
3359 processes . . . . . . $enable_processes
3360 rrdcached . . . . . . $enable_rrdcached
3361 rrdtool . . . . . . . $enable_rrdtool
3362 sensors . . . . . . . $enable_sensors
3363 serial . . . . . . . $enable_serial
3364 snmp . . . . . . . . $enable_snmp
3365 swap . . . . . . . . $enable_swap
3366 syslog . . . . . . . $enable_syslog
3367 tail . . . . . . . . $enable_tail
3368 tape . . . . . . . . $enable_tape
3369 target_notification . $enable_target_notification
3370 target_replace . . . $enable_target_replace
3371 target_set . . . . . $enable_target_set
3372 tcpconns . . . . . . $enable_tcpconns
3373 teamspeak2 . . . . . $enable_teamspeak2
3374 thermal . . . . . . . $enable_thermal
3375 unixsock . . . . . . $enable_unixsock
3376 users . . . . . . . . $enable_users
3377 uuid . . . . . . . . $enable_uuid
3378 vmem . . . . . . . . $enable_vmem
3379 vserver . . . . . . . $enable_vserver
3380 wireless . . . . . . $enable_wireless
3381 xmms . . . . . . . . $enable_xmms
3385 if test "x$dependency_error" = "xyes"; then
3386 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
3389 # vim: set fdm=marker :