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.
20 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
24 AC_LIBLTDL_CONVENIENCE
31 AC_CONFIG_SUBDIRS(libltdl)
33 AC_MSG_CHECKING([for kernel type ($host_os)])
36 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
40 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
49 AC_MSG_RESULT([$ac_system])
52 # Checks for header files.
58 AC_CHECK_HEADERS(stdint.h stdio.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)
61 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
66 # include <sys/types.h>
69 AC_CHECK_HEADERS(netinet/in.h, [], [],
74 # include <sys/types.h>
76 #if HAVE_NETINET_IN_SYSTM_H
77 # include <netinet/in_systm.h>
80 AC_CHECK_HEADERS(netinet/ip.h, [], [],
85 # include <sys/types.h>
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
91 # include <netinet/in.h>
94 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
99 # include <sys/types.h>
101 #if HAVE_NETINET_IN_SYSTM_H
102 # include <netinet/in_systm.h>
104 #if HAVE_NETINET_IN_H
105 # include <netinet/in.h>
107 #if HAVE_NETINET_IP_H
108 # include <netinet/ip.h>
111 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
116 # include <sys/types.h>
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
124 #if HAVE_NETINET_IP_H
125 # include <netinet/ip.h>
128 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
133 # include <sys/types.h>
135 #if HAVE_NETINET_IN_SYSTM_H
136 # include <netinet/in_systm.h>
138 #if HAVE_NETINET_IN_H
139 # include <netinet/in.h>
142 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
147 # include <sys/types.h>
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
152 #if HAVE_NETINET_IN_H
153 # include <netinet/in.h>
155 #if HAVE_NETINET_IP6_H
156 # include <netinet/ip6.h>
159 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
164 # include <sys/types.h>
166 #if HAVE_NETINET_IN_SYSTM_H
167 # include <netinet/in_systm.h>
169 #if HAVE_NETINET_IN_H
170 # include <netinet/in.h>
172 #if HAVE_NETINET_IP_H
173 # include <netinet/ip.h>
176 AC_CHECK_HEADERS(netinet/udp.h, [], [],
181 # include <sys/types.h>
183 #if HAVE_NETINET_IN_SYSTM_H
184 # include <netinet/in_systm.h>
186 #if HAVE_NETINET_IN_H
187 # include <netinet/in.h>
189 #if HAVE_NETINET_IP_H
190 # include <netinet/ip.h>
195 AC_CHECK_HEADERS(sys/dkstat.h)
196 if test "x$ac_system" = "xDarwin"
198 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)
199 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
201 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
204 # include <sys/types.h>
207 # include <sys/param.h>
212 AC_CHECK_HEADERS(linux/major.h libgen.h)
214 # For the battery plugin
215 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
217 #if HAVE_IOKIT_IOKITLIB_H
218 # include <IOKit/IOKitLib.h>
220 #if HAVE_IOKIT_IOTYPES_H
221 # include <IOKit/IOTypes.h>
225 # For the swap module
226 AC_CHECK_HEADERS(sys/swap.h, [], [],
229 # include <sys/types.h>
232 # include <sys/param.h>
237 # For the processes plugin
239 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
241 # For interface plugin
242 AC_CHECK_HEADERS(ifaddrs.h)
243 AC_CHECK_HEADERS(net/if.h, [], [],
246 # include <sys/types.h>
248 #if HAVE_SYS_SOCKET_H
249 # include <sys/socket.h>
252 AC_CHECK_HEADERS(linux/if.h, [], [],
255 # include <sys/types.h>
257 #if HAVE_SYS_SOCKET_H
258 # include <sys/socket.h>
261 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
264 # include <sys/types.h>
266 #if HAVE_SYS_SOCKET_H
267 # include <sys/socket.h>
270 # include <linux/if.h>
275 have_net_ip_vs_h="no"
277 if test "x$ac_system" = "xLinux"
279 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
280 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
284 AC_CHECK_HEADERS(sys/ucred.h, [], [],
287 # include <sys/types.h>
290 # include <sys/param.h>
294 # For mount interface
295 AC_CHECK_HEADERS(sys/mount.h, [], [],
298 # include <sys/types.h>
301 # include <sys/param.h>
305 # For the email plugin
306 AC_CHECK_HEADERS(linux/un.h, [], [],
308 #if HAVE_SYS_SOCKET_H
309 # include <sys/socket.h>
313 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)
316 AC_CHECK_HEADERS(arpa/nameser.h)
317 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
319 #if HAVE_ARPA_NAMESER_H
320 # include <arpa/nameser.h>
324 AC_CHECK_HEADERS(net/if_arp.h, [], [],
325 [#if HAVE_SYS_SOCKET_H
326 # include <sys/socket.h>
329 AC_CHECK_HEADERS(net/ppp_defs.h)
330 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
331 [#if HAVE_NET_PPP_DEFS_H
332 # include <net/ppp_defs.h>
335 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
340 # include <sys/types.h>
342 #if HAVE_SYS_SOCKET_H
343 # include <sys/socket.h>
348 #if HAVE_NETINET_IN_H
349 # include <netinet/in.h>
353 # For the multimeter plugin
355 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
358 # Checks for typedefs, structures, and compiler characteristics.
367 # Checks for library functions.
369 AC_PROG_GCC_TRADITIONAL
370 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
374 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
376 socket_needs_socket="no"
377 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
378 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
380 nanosleep_needs_rt="no"
381 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
382 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
384 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
385 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
386 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
387 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
388 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
389 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
390 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
391 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
392 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
393 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
396 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
399 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
401 if test "x$withval" = "xno"; then
403 else if test "x$withval" = "xyes"; then
410 if test "x$nan_type" = "xnone"; then
411 AC_CACHE_CHECK([whether NAN is defined by default],
418 static float foo = NAN;
426 [have_nan_default="yes"],
427 [have_nan_default="no"]
430 if test "x$have_nan_default" = "xyes"
435 if test "x$nan_type" = "xnone"; then
436 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
442 #define __USE_ISOC99 1
444 static float foo = NAN;
452 [have_nan_isoc="yes"],
456 if test "x$have_nan_isoc" = "xyes"
461 if test "x$nan_type" = "xnone"; then
462 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
472 #define NAN (0.0 / 0.0)
474 # define isnan(f) ((f) != (f))
476 static float foo = NAN;
484 [have_nan_zero="yes"],
488 if test "x$have_nan_zero" = "xyes"
494 if test "x$nan_type" = "xdefault"; then
495 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
496 [Define if NAN is defined by default and can initialize static variables.])
497 else if test "x$nan_type" = "xisoc99"; then
498 AC_DEFINE(NAN_STATIC_ISOC, 1,
499 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
500 else if test "x$nan_type" = "xzero"; then
501 AC_DEFINE(NAN_ZERO_ZERO, 1,
502 [Define if NAN can be defined as (0.0 / 0.0)])
504 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
507 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
509 if test "x$withval" = "xnothing"; then
510 fp_layout_type="nothing"
511 else if test "x$withval" = "xendianflip"; then
512 fp_layout_type="endianflip"
513 else if test "x$withval" = "xintswap"; then
514 fp_layout_type="intswap"
516 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
519 [fp_layout_type="unknown"])
521 if test "x$fp_layout_type" = "xunknown"; then
522 AC_CACHE_CHECK([if doubles are stored in x86 representation],
523 [fp_layout_need_nothing],
539 memcpy ((void *) &i0, (void *) &d, 8);
542 memcpy ((void *) c, (void *) &i1, 8);
544 if ((c[0] == 0x2f) && (c[1] == 0x25)
545 && (c[2] == 0xc0) && (c[3] == 0xc7)
546 && (c[4] == 0x43) && (c[5] == 0x2b)
547 && (c[6] == 0x1f) && (c[7] == 0x5b))
552 [fp_layout_need_nothing="yes"],
553 [fp_layout_need_nothing="no"]
556 if test "x$fp_layout_need_nothing" = "xyes"; then
557 fp_layout_type="nothing"
560 if test "x$fp_layout_type" = "xunknown"; then
561 AC_CACHE_CHECK([if endianflip converts to x86 representation],
562 [fp_layout_need_endianflip],
570 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
571 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
572 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
573 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
574 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
575 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
576 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
577 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
586 memcpy ((void *) &i0, (void *) &d, 8);
588 i1 = endianflip (i0);
589 memcpy ((void *) c, (void *) &i1, 8);
591 if ((c[0] == 0x2f) && (c[1] == 0x25)
592 && (c[2] == 0xc0) && (c[3] == 0xc7)
593 && (c[4] == 0x43) && (c[5] == 0x2b)
594 && (c[6] == 0x1f) && (c[7] == 0x5b))
599 [fp_layout_need_endianflip="yes"],
600 [fp_layout_need_endianflip="no"]
603 if test "x$fp_layout_need_endianflip" = "xyes"; then
604 fp_layout_type="endianflip"
607 if test "x$fp_layout_type" = "xunknown"; then
608 AC_CACHE_CHECK([if intswap converts to x86 representation],
609 [fp_layout_need_intswap],
617 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
618 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
627 memcpy ((void *) &i0, (void *) &d, 8);
630 memcpy ((void *) c, (void *) &i1, 8);
632 if ((c[0] == 0x2f) && (c[1] == 0x25)
633 && (c[2] == 0xc0) && (c[3] == 0xc7)
634 && (c[4] == 0x43) && (c[5] == 0x2b)
635 && (c[6] == 0x1f) && (c[7] == 0x5b))
640 [fp_layout_need_intswap="yes"],
641 [fp_layout_need_intswap="no"]
644 if test "x$fp_layout_need_intswap" = "xyes"; then
645 fp_layout_type="intswap"
649 if test "x$fp_layout_type" = "xnothing"; then
650 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
651 [Define if doubles are stored in x86 representation.])
652 else if test "x$fp_layout_type" = "xendianflip"; then
653 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
654 [Define if endianflip is needed to convert to x86 representation.])
655 else if test "x$fp_layout_type" = "xintswap"; then
656 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
657 [Define if intswap is needed to convert to x86 representation.])
659 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
663 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
665 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
667 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
670 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
671 if test "x$have_getmntent" = "xno"; then
672 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
674 if test "x$have_getmntent" = "xno"; then
675 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
677 if test "x$have_getmntent" = "xno"; then
678 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
681 if test "x$have_getmntent" = "xc"; then
682 AC_CACHE_CHECK([whether getmntent takes one argument],
683 [have_one_getmntent],
685 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
687 #include "$srcdir/src/utils_mount.h"]],
691 fh = setmntent ("/etc/mtab", "r");
695 [have_one_getmntent="yes"],
696 [have_one_getmntent="no"]
699 AC_CACHE_CHECK([whether getmntent takes two arguments],
700 [have_two_getmntent],
702 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
703 #include <sys/mnttab.h>
704 #include "$srcdir/src/utils_mount.h"]],
709 fh = fopen ("/etc/mnttab", "r");
710 status = getmntent (fh, &mt);
713 [have_two_getmntent="yes"],
714 [have_two_getmntent="no"]
719 # Check for different versions of `getmntent' here..
721 if test "x$have_getmntent" = "xc"; then
722 if test "x$have_one_getmntent" = "xyes"; then
723 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
724 [Define if the function getmntent exists and takes one argument.])
726 if test "x$have_two_getmntent" = "xyes"; then
727 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
728 [Define if the function getmntent exists and takes two arguments.])
731 if test "x$have_getmntent" = "xsun"; then
732 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
733 [Define if the function getmntent exists. It's the version from libsun.])
735 if test "x$have_getmntent" = "xseq"; then
736 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
737 [Define if the function getmntent exists. It's the version from libseq.])
739 if test "x$have_getmntent" = "xgen"; then
740 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
741 [Define if the function getmntent exists. It's the version from libgen.])
744 # Check for structures
745 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
746 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
749 #include <sys/types.h>
750 #include <sys/socket.h>
753 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
754 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
757 #include <sys/types.h>
758 #include <sys/socket.h>
759 #include <linux/if.h>
760 #include <linux/netdevice.h>
763 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
768 # include <sys/types.h>
770 #if HAVE_NETINET_IN_SYSTM_H
771 # include <netinet/in_systm.h>
773 #if HAVE_NETINET_IN_H
774 # include <netinet/in.h>
776 #if HAVE_NETINET_IP_H
777 # include <netinet/ip.h>
779 #if HAVE_NETINET_UDP_H
780 # include <netinet/udp.h>
783 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
788 # include <sys/types.h>
790 #if HAVE_NETINET_IN_SYSTM_H
791 # include <netinet/in_systm.h>
793 #if HAVE_NETINET_IN_H
794 # include <netinet/in.h>
796 #if HAVE_NETINET_IP_H
797 # include <netinet/ip.h>
799 #if HAVE_NETINET_UDP_H
800 # include <netinet/udp.h>
804 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
814 AC_CHECK_LIB(resolv, res_search,
816 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
818 [with_libresolv="no"])
819 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
822 m4_divert_once([HELP_WITH], [
823 collectd additional packages:])
825 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
828 librrd_threadsafe="yes"
829 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
830 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
832 librrd_cflags="-I$withval/include"
833 librrd_ldflags="-L$withval/lib"
836 ], [with_rrdtool="yes"])
837 if test "x$with_rrdtool" = "xyes"
839 SAVE_CPPFLAGS="$CPPFLAGS"
840 SAVE_LDFLAGS="$LDFLAGS"
842 CPPFLAGS="$CPPFLAGS $librrd_cflags"
843 LDFLAGS="$LDFLAGS $librrd_ldflags"
845 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
847 CPPFLAGS="$SAVE_CPPFLAGS"
848 LDFLAGS="$SAVE_LDFLAGS"
850 if test "x$with_rrdtool" = "xyes"
852 SAVE_CPPFLAGS="$CPPFLAGS"
853 SAVE_LDFLAGS="$LDFLAGS"
855 CPPFLAGS="$CPPFLAGS $librrd_cflags"
856 LDFLAGS="$LDFLAGS $librrd_ldflags"
858 AC_CHECK_LIB(rrd_th, rrd_update_r,
860 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
862 [librrd_threadsafe="no"
863 AC_CHECK_LIB(rrd, rrd_update,
865 librrd_ldflags="$librrd_ldflags -lrrd -lm"
867 [with_rrdtool="no (symbol 'rrd_update' not found)"],
872 CPPFLAGS="$SAVE_CPPFLAGS"
873 LDFLAGS="$SAVE_LDFLAGS"
875 if test "x$with_rrdtool" = "xyes"
877 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
878 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
879 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
880 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
882 if test "x$librrd_threadsafe" = "xyes"
884 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
887 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
888 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
890 LDFLAGS="$LDFLAGS -L$withval/lib"
891 CPPFLAGS="$CPPFLAGS -I$withval/include"
892 with_libpthread="yes"
894 if test "x$withval" = "xno"
896 with_libpthread="no (disabled)"
899 ], [with_libpthread="yes"])
900 if test "x$with_libpthread" = "xyes"
902 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
904 if test "x$with_libpthread" = "xyes"
906 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
908 if test "x$with_libpthread" = "xyes"
914 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
915 [Wether or not to use pthread (POSIX threads) library])
916 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
918 if test "x$ac_system" = "xSolaris"
923 with_kstat="no (Solaris only)"
924 with_devinfo="no (Solaris only)"
927 if test "x$with_kstat" = "xyes"
929 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
931 if test "x$with_kstat" = "xyes"
933 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
934 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
936 if test "x$with_kstat" = "xyes"
938 AC_DEFINE(HAVE_LIBKSTAT, 1,
939 [Define to 1 if you have the 'kstat' library (-lkstat)])
941 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
942 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
944 ### BEGIN of check for libcurl ###
945 with_curl_config="curl-config"
948 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
950 if test "x$withval" = "xno"
953 else if test "x$withval" = "xyes"
957 if test -f "$withval" && test -x "$withval"
959 with_curl_config="$withval"
961 else if test -x "$withval/bin/curl-config"
963 with_curl_config="$withval/bin/curl-config"
972 if test "x$with_libcurl" = "xyes"
974 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
975 curl_config_status=$?
977 if test $curl_config_status -ne 0
979 with_libcurl="no ($with_curl_config failed)"
982 CFLAGS="$CFLAGS $with_curl_cflags"
984 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
986 CFLAGS="$SAVE_CFLAGS"
989 if test "x$with_libcurl" = "xyes"
991 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
992 curl_config_status=$?
994 if test $curl_config_status -ne 0
996 with_libcurl="no ($with_curl_config failed)"
998 AC_CHECK_LIB(curl, curl_easy_init,
999 [with_libcurl="yes"],
1000 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1004 if test "x$with_libcurl" = "xyes"
1006 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1007 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1008 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1009 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1011 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1012 ### END of check for libcurl ###
1016 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1025 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
1026 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1028 with_libstatgrab="yes"
1029 with_libdevstat="no"
1030 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
1032 if test "x$withval" != "xno" -a "x$withval" != "xyes"
1034 LDFLAGS="$LDFLAGS -L$withval/lib"
1035 CPPFLAGS="$CPPFLAGS -I$withval/include"
1036 with_libstatgrab="yes"
1040 if test "x$ac_system" == "xunknown"
1042 with_libstatgrab="yes"
1044 with_libstatgrab="no"
1047 if test "x$with_libstatgrab" = "xyes"
1049 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
1051 if test "x$with_libstatgrab" = "xyes"
1053 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
1055 if test "x$with_libstatgrab" = "xyes"
1057 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
1059 if test "x$with_libstatgrab" = "xyes"
1061 collect_libstatgrab=1
1063 collect_libstatgrab=0
1065 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
1066 [Wether or not to use statgrab library])
1067 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
1068 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
1070 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
1071 if test "x$with_libkvm" = "xyes"
1073 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
1075 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
1077 with_sensors_cflags=""
1078 with_sensors_ldflags=""
1079 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
1081 if test "x$withval" = "xno"
1083 with_lm_sensors="no"
1085 with_lm_sensors="yes"
1086 if test "x$withval" != "xyes"
1088 with_sensors_cflags="-I$withval/include"
1089 with_sensors_ldflags="-L$withval/lib"
1090 with_lm_sensors="yes"
1095 if test "x$ac_system" = "xLinux"
1097 with_lm_sensors="yes"
1099 with_lm_sensors="no (Linux only library)"
1102 if test "x$with_lm_sensors" = "xyes"
1104 SAVE_CPPFLAGS="$CPPFLAGS"
1105 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
1107 # AC_CHECK_HEADERS(sensors/sensors.h,
1109 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
1111 # [with_lm_sensors="no (sensors/sensors.h not found)"])
1112 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_lm_sensors="no (sensors/sensors.h not found)"])
1114 CPPFLAGS="$SAVE_CPPFLAGS"
1116 if test "x$with_lm_sensors" = "xyes"
1118 SAVE_CPPFLAGS="$CPPFLAGS"
1119 SAVE_LDFLAGS="$LDFLAGS"
1120 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
1121 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
1123 AC_CHECK_LIB(sensors, sensors_init,
1125 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
1127 [with_lm_sensors="no (libsensors not found)"])
1129 CPPFLAGS="$SAVE_CPPFLAGS"
1130 LDFLAGS="$SAVE_LDFLAGS"
1132 if test "x$with_lm_sensors" = "xyes"
1134 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
1135 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
1136 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
1137 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
1139 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
1141 with_mysql_config="mysql_config"
1142 with_mysql_cflags=""
1144 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1146 if test "x$withval" = "xno"
1149 else if test "x$withval" = "xyes"
1153 if test -f "$withval" && test -x "$withval";
1155 with_mysql_config="$withval"
1156 else if test -x "$withval/bin/mysql_config"
1158 with_mysql_config="$withval/bin/mysql_config"
1166 if test "x$with_libmysql" = "xyes"
1168 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1169 mysql_config_status=$?
1171 if test $mysql_config_status -ne 0
1176 CFLAGS="$CFLAGS $with_mysql_cflags"
1178 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
1180 CFLAGS="$SAVE_CFLAGS"
1183 if test "x$with_libmysql" = "xyes"
1185 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1186 mysql_config_status=$?
1188 if test $mysql_config_status -ne 0
1192 AC_CHECK_LIB(mysqlclient, mysql_init,
1193 [with_libmysql="yes"],
1194 [with_libmysql="no (symbol 'mysql_init' not found)"],
1198 if test "x$with_libmysql" = "xyes"
1200 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1201 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1202 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1203 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1205 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1207 with_own_liboconfig="no"
1208 liboconfig_LDFLAGS="$LDFLAGS"
1209 liboconfig_CPPFLAGS="$CPPFLAGS"
1210 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1212 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1214 if test -d "$withval/lib"
1216 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1218 if test -d "$withval/include"
1220 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1223 if test "x$withval" = "xno"
1225 AC_MSG_ERROR("liboconfig is required")
1229 with_liboconfig="yes"
1232 save_LDFLAGS="$LDFLAGS"
1233 save_CPPFLAGS="$CPPFLAGS"
1234 LDFLAGS="$liboconfig_LDFLAGS"
1235 CPPFLAGS="$liboconfig_CPPFLAGS"
1236 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1238 with_liboconfig="yes"
1239 with_own_liboconfig="no"
1242 with_liboconfig="yes"
1243 with_own_liboconfig="yes"
1244 LDFLAGS="$save_LDFLAGS"
1245 CPPFLAGS="$save_CPPFLAGS"
1248 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1249 if test "x$with_own_liboconfig" = "xyes"
1251 with_liboconfig="yes (shipped version)"
1254 #with_liboping="yes"
1255 with_own_liboping="no"
1256 liboping_LDFLAGS="$LDFLAGS"
1257 liboping_CPPFLAGS="$CPPFLAGS"
1258 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1260 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1262 if test -d "$withval/lib"
1264 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1266 if test -d "$withval/include"
1268 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1271 if test "x$withval" = "xno"
1274 with_own_liboping="no"
1282 if test "x$with_liboping" = "xyes"
1284 save_LDFLAGS="$LDFLAGS"
1285 save_CPPFLAGS="$CPPFLAGS"
1286 LDFLAGS="$liboping_LDFLAGS"
1287 CPPFLAGS="$liboping_CPPFLAGS"
1288 AC_CHECK_LIB(oping, ping_construct,
1291 with_own_liboping="no"
1295 with_own_liboping="yes"
1296 LDFLAGS="$save_LDFLAGS"
1297 CPPFLAGS="$save_CPPFLAGS"
1300 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1301 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1303 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1305 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1307 LDFLAGS="$LDFLAGS -L$withval/lib"
1308 CPPFLAGS="$CPPFLAGS -I$withval/include"
1315 if test "x$with_libpcap" = "xyes"
1317 AC_CHECK_LIB(pcap, pcap_open_live,
1319 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1320 ], [with_libpcap="no (libpcap not found)"])
1322 if test "x$with_libpcap" = "xyes"
1324 AC_CHECK_HEADERS(pcap.h,
1326 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1327 ], [with_libpcap="no (pcap.h not found)"])
1329 if test "x$with_libpcap" = "xyes"
1335 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1336 [Wether or not to use the pcap library])
1337 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1339 perl_interpreter="perl"
1340 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1342 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1344 LDFLAGS="$LDFLAGS -L$withval/lib"
1345 CPPFLAGS="$CPPFLAGS -I$withval/include"
1346 perl_interpreter="$withval/bin/perl"
1354 AC_SUBST(PERL, "$perl_interpreter")
1356 if test "x$with_libperl" = "xyes"
1359 SAVE_LDFLAGS=$LDFLAGS
1360 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1361 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1362 CFLAGS="$CFLAGS $PERL_CFLAGS"
1363 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1365 AC_CACHE_CHECK([for libperl],
1375 PerlInterpreter *perl = NULL;
1376 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1377 newSVpv ("Collectd::Plugin::FooBar", 24),
1380 [have_libperl="yes"],
1385 if test "x$have_libperl" = "xyes"
1387 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1388 AC_SUBST(PERL_CFLAGS)
1389 AC_SUBST(PERL_LDFLAGS)
1395 LDFLAGS=$SAVE_LDFLAGS
1397 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1399 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1401 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1403 LDFLAGS="$LDFLAGS -L$withval/lib"
1404 CPPFLAGS="$CPPFLAGS -I$withval/include"
1409 if test "x$ac_system" = "xLinux"
1413 with_libiptc="no (Linux only)"
1416 if test "x$with_libiptc" = "xyes"
1418 AC_CHECK_LIB(iptc, iptc_init,
1420 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1421 ], [with_libiptc="no (libiptc not found)"])
1423 if test "x$with_libiptc" = "xyes"
1425 AC_CHECK_HEADERS(libiptc/libiptc.h,
1427 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1428 ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1430 if test "x$with_libiptc" = "xyes"
1436 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1438 with_snmp_config="net-snmp-config"
1441 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1443 if test "x$withval" = "xno"
1445 with_libnetsnmp="no"
1446 else if test "x$withval" = "xyes"
1448 with_libnetsnmp="yes"
1450 if test -x "$withval"
1452 with_snmp_config="$withval"
1453 with_libnetsnmp="yes"
1455 with_snmp_config="$withval/bin/net-snmp-config"
1456 with_libnetsnmp="yes"
1460 [with_libnetsnmp="yes"])
1461 if test "x$with_libnetsnmp" = "xyes"
1463 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1464 snmp_config_status=$?
1466 if test $snmp_config_status -ne 0
1468 with_libnetsnmp="no ($with_snmp_config failed)"
1471 CFLAGS="$CFLAGS $with_snmp_cflags"
1473 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1475 CFLAGS="$SAVE_CFLAGS"
1478 if test "x$with_libnetsnmp" = "xyes"
1480 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1481 snmp_config_status=$?
1483 if test $snmp_config_status -ne 0
1485 with_libnetsnmp="no ($with_snmp_config failed)"
1487 AC_CHECK_LIB(netsnmp, init_snmp,
1488 [with_libnetsnmp="yes"],
1489 [with_libnetsnmp="no (libnetsnmp not found)"],
1493 if test "x$with_libnetsnmp" = "xyes"
1495 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1496 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1497 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1498 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1500 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1502 with_upsclient_config="libupsclient-config"
1503 with_upsclient_cflags=""
1504 with_upsclient_libs=""
1505 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1507 if test "x$withval" = "xno"
1509 with_libupsclient="no"
1511 if test "x$withval" != "xyes"
1513 if test -f "$withval" && test -x "$withval";
1515 with_upsclient_config="$withval"
1517 with_upsclient_config="$withval/bin/libupsclient-config"
1520 with_libupsclient="yes"
1524 with_libupsclient="yes"
1526 if test "x$with_libupsclient" = "xyes"
1528 with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1529 upsclient_config_status=$?
1531 if test $upsclient_config_status -ne 0
1533 with_libupsclient="no ($with_upsclient_config failed)"
1536 if test "x$with_libupsclient" = "xyes"
1538 SAVE_CFLAGS="$CFLAGS"
1539 CFLAGS="$CFLAGS $with_upsclient_cflags"
1541 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1543 CFLAGS="$SAVE_CFLAGS"
1545 if test "x$with_libupsclient" = "xyes"
1547 with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1548 upsclient_config_status=$?
1550 if test $upsclient_config_status -ne 0
1552 with_libupsclient="no ($with_upsclient_config failed)"
1555 if test "x$with_libupsclient" = "xyes"
1557 AC_CHECK_LIB(upsclient, upscli_connect,
1559 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1560 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1561 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1562 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1565 with_libupsclient="no (symbol 'upscli_connect' not found)"
1566 ], [$with_upsclient_libs])
1568 if test "x$with_libupsclient" = "xyes"
1570 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1571 [#include <stdlib.h>
1573 #include <upsclient.h>])
1575 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1577 ### BEGIN of check for libxmms ###
1578 with_xmms_config="xmms-config"
1581 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1583 if test "x$withval" != "xno" -a "x$withval" != "xyes"
1585 if test -f "$withval" && test -x "$withval";
1587 with_xmms_config="$withval"
1588 else if test -x "$withval/bin/xmms-config"
1590 with_xmms_config="$withval/bin/xmms-config"
1593 else if test "x$withval" = "xno"
1603 if test "x$with_libxmms" = "xyes"
1605 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1606 xmms_config_status=$?
1608 if test $xmms_config_status -ne 0
1613 if test "x$with_libxmms" = "xyes"
1615 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1616 xmms_config_status=$?
1618 if test $xmms_config_status -ne 0
1623 if test "x$with_libxmms" = "xyes"
1625 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1627 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1628 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1629 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1630 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1637 with_libxmms_numeric=0
1638 if test "x$with_libxmms" = "xyes"
1640 with_libxmms_numeric=1
1642 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1643 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1644 ### END of check for libxmms ###
1646 with_libnetlink_cflags=""
1647 with_libnetlink_libs="-lnetlink"
1648 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1650 echo "libnetlink: withval = $withval"
1651 if test "x$withval" = "xyes"
1653 with_libnetlink="yes"
1654 else if test "x$withval" = "xno"
1656 with_libnetlink="no"
1658 if test -d "$withval/include"
1660 with_libnetlink_cflags="-I$withval/include"
1661 with_libnetlink_libs="-L$withval/lib -lnetlink"
1662 with_libnetlink="yes"
1664 AC_MSG_ERROR("no such directory: $withval/include")
1669 if test "x$ac_system" = "xLinux"
1671 with_libnetlink="yes"
1673 with_libnetlink="no (Linux only library)"
1676 if test "x$with_libnetlink" = "xyes"
1679 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1681 with_libnetlink="no (libnetlink.h not found)"
1683 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1685 with_libnetlink="yes"
1689 #include <sys/types.h>
1690 #include <asm/types.h>
1691 #include <sys/socket.h>
1692 #include <linux/netlink.h>
1693 #include <linux/rtnetlink.h>])
1694 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1696 #include <sys/types.h>
1697 #include <asm/types.h>
1698 #include <sys/socket.h>])
1702 #include <sys/types.h>
1703 #include <asm/types.h>
1704 #include <sys/socket.h>
1705 #include <linux/netlink.h>
1706 #include <linux/rtnetlink.h>
1710 int retval = TCA_STATS2;
1713 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1718 #include <sys/types.h>
1719 #include <asm/types.h>
1720 #include <sys/socket.h>
1721 #include <linux/netlink.h>
1722 #include <linux/rtnetlink.h>
1726 int retval = TCA_STATS;
1729 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1732 CFLAGS="$SAVE_CFLAGS"
1734 if test "x$with_libnetlink" = "xyes"
1736 AC_CHECK_LIB(netlink, rtnl_open,
1737 [with_libnetlink="yes"],
1738 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1739 [$with_libnetlink_libs])
1741 if test "x$with_libnetlink" = "xyes"
1743 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1744 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1745 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1746 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1748 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1750 # Check for enabled/disabled features
1753 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1754 # ------------------------------------------------------------
1756 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1761 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1766 m4_define([EnDis],[disabled])dnl
1767 m4_define([YesNo],[no])dnl
1773 m4_define([EnDis],[enabled])dnl
1774 m4_define([YesNo],[yes])dnl
1777 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1781 m4_if([$3], [feature], [],
1785 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1791 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1793 enable_$1='[YesNo]'dnl
1795 if test "x$enable_$1" = "xno"
1799 if test "x$enable_$1" = "xyes"
1803 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1808 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1809 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1811 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1813 # AC_PLUGIN(name, default, info)
1814 # ------------------------------------------------------------
1820 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1822 if test "x$enableval" = "xyes"
1830 if test "x$2" = "xyes"
1837 if test "x$enable_plugin" = "xyes"
1839 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1841 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1842 enable_$1="$enable_plugin"
1844 )# AC_PLUGIN(name, default, info)
1846 m4_divert_once([HELP_ENABLE], [
1847 collectd features:])
1848 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1849 AC_COLLECTD([debug], [enable], [feature], [debugging])
1850 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1851 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1859 plugin_interface="no"
1864 plugin_multimeter="no"
1866 plugin_processes="no"
1870 plugin_tcpconns="no"
1873 plugin_wireless="no"
1876 if test "x$ac_system" = "xLinux"
1878 plugin_battery="yes"
1880 plugin_cpufreq="yes"
1882 plugin_entropy="yes"
1883 plugin_interface="yes"
1888 plugin_processes="yes"
1891 plugin_tcpconns="yes"
1892 plugin_vserver="yes"
1893 plugin_wireless="yes"
1895 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
1902 if test "x$with_libiokit" = "xyes"
1904 plugin_battery="yes"
1909 if test "x$with_devinfo$with_kstat" = "xyesyes"
1913 plugin_interface="yes"
1920 if test "x$with_libstatgrab" = "xyes"
1922 plugin_interface="yes"
1928 if test "x$have_processor_info" = "xyes"
1932 if test "x$have_sysctlbyname" = "xyes"
1936 plugin_tcpconns="yes"
1939 if test "x$have_statfs" = "xyes"
1943 if test "x$have_statvfs" = "xyes"
1948 if test "x$have_getifaddrs" = "xyes"
1950 plugin_interface="yes"
1953 if test "x$have_getloadavg" = "xyes"
1958 # Mac OS X memory interface
1959 if test "x$have_host_statistics" = "xyes"
1964 if test "x$have_termios_h" = "xyes"
1966 plugin_multimeter="yes"
1969 if test "x$have_thread_info" = "xyes"
1971 plugin_processes="yes"
1974 if test "x$with_libkvm" = "xyes"
1979 if test "x$have_getutent" = "xyes"
1983 if test "x$have_getutxent" = "xyes"
1988 # FIXME: sysctl for swap plugin
1990 m4_divert_once([HELP_ENABLE], [
1993 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
1994 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
1995 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
1996 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
1997 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
1998 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
1999 AC_PLUGIN([csv], [yes], [CSV output plugin])
2000 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
2001 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
2002 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
2003 AC_PLUGIN([email], [yes], [EMail statistics])
2004 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
2005 AC_PLUGIN([exec], [yes], [Execution of external programs])
2006 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
2007 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
2008 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
2009 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
2010 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
2011 AC_PLUGIN([load], [$plugin_load], [System load])
2012 AC_PLUGIN([logfile], [yes], [File logging plugin])
2013 AC_PLUGIN([mbmon], [yes], [Query mbmond])
2014 AC_PLUGIN([memcached], [yes], [memcached statistics])
2015 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
2016 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
2017 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
2018 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
2019 AC_PLUGIN([network], [yes], [Network communication plugin])
2020 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
2021 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
2022 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
2023 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
2024 AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter])
2025 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
2026 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
2027 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
2028 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
2029 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
2030 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
2031 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
2032 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
2033 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
2034 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
2035 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
2036 AC_PLUGIN([users], [$plugin_users], [User statistics])
2037 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
2038 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
2039 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
2042 if test "x$ac_system" = "xLinux" -a "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
2044 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
2048 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
2050 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2052 PERL_BINDINGS_OPTIONS="$withval"
2053 with_perl_bindings="yes"
2055 PERL_BINDINGS_OPTIONS=""
2056 with_perl_bindings="$withval"
2060 PERL_BINDINGS_OPTIONS=""
2061 with_perl_bindings="yes"
2063 if test "x$with_perl_bindings" = "xyes"
2065 PERL_BINDINGS="perl"
2069 AC_SUBST(PERL_BINDINGS)
2070 AC_SUBST(PERL_BINDINGS_OPTIONS)
2072 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
2074 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
2076 with_liboping="yes (shipped version)"
2079 if test "x$with_libperl" = "xyes"
2081 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
2083 enable_perl="no (needs libperl)"
2086 if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x"
2088 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
2095 libcurl . . . . . . $with_libcurl
2096 libiokit . . . . . $with_libiokit
2097 libiptc . . . . . . $with_libiptc
2098 libkstat . . . . . $with_kstat
2099 libkvm . . . . . . $with_libkvm
2100 libmysql . . . . . $with_libmysql
2101 libnetlink . . . . $with_libnetlink
2102 libnetsnmp . . . . $with_libnetsnmp
2103 liboconfig . . . . $with_liboconfig
2104 liboping . . . . . $with_liboping
2105 libpcap . . . . . . $with_libpcap
2106 libperl . . . . . . $with_libperl
2107 libpthread . . . . $with_libpthread
2108 librrd . . . . . . $with_rrdtool
2109 libsensors . . . . $with_lm_sensors
2110 libstatgrab . . . . $with_libstatgrab
2111 libupsclient . . . $with_libupsclient
2112 libxmms . . . . . . $with_libxmms
2115 daemon mode . . . . $enable_daemon
2116 debug . . . . . . . $enable_debug
2119 perl . . . . . . . $with_perl_bindings
2122 apache . . . . . . $enable_apache
2123 apcups . . . . . . $enable_apcups
2124 apple_sensors . . . $enable_apple_sensors
2125 battery . . . . . . $enable_battery
2126 cpu . . . . . . . . $enable_cpu
2127 cpufreq . . . . . . $enable_cpufreq
2128 csv . . . . . . . . $enable_csv
2129 df . . . . . . . . $enable_df
2130 disk . . . . . . . $enable_disk
2131 dns . . . . . . . . $enable_dns
2132 email . . . . . . . $enable_email
2133 entropy . . . . . . $enable_entropy
2134 exec . . . . . . . $enable_exec
2135 hddtemp . . . . . . $enable_hddtemp
2136 interface . . . . . $enable_interface
2137 iptables . . . . . $enable_iptables
2138 ipvs . . . . . . . $enable_ipvs
2139 irq . . . . . . . . $enable_irq
2140 load . . . . . . . $enable_load
2141 logfile . . . . . . $enable_logfile
2142 mbmon . . . . . . . $enable_mbmon
2143 memcached . . . . . $enable_memcached
2144 memory . . . . . . $enable_memory
2145 multimeter . . . . $enable_multimeter
2146 mysql . . . . . . . $enable_mysql
2147 netlink . . . . . . $enable_netlink
2148 network . . . . . . $enable_network
2149 nfs . . . . . . . . $enable_nfs
2150 nginx . . . . . . . $enable_nginx
2151 ntpd . . . . . . . $enable_ntpd
2152 nut . . . . . . . . $enable_nut
2153 perl . . . . . . . $enable_perl
2154 ping . . . . . . . $enable_ping
2155 processes . . . . . $enable_processes
2156 rrdtool . . . . . . $enable_rrdtool
2157 sensors . . . . . . $enable_sensors
2158 serial . . . . . . $enable_serial
2159 snmp . . . . . . . $enable_snmp
2160 swap . . . . . . . $enable_swap
2161 syslog . . . . . . $enable_syslog
2162 tape . . . . . . . $enable_tape
2163 tcpconns . . . . . $enable_tcpconns
2164 unixsock . . . . . $enable_unixsock
2165 users . . . . . . . $enable_users
2166 vserver . . . . . . $enable_vserver
2167 wireless . . . . . $enable_wireless
2168 xmms . . . . . . . $enable_xmms