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])
51 AC_MSG_RESULT([$ac_system])
53 if test "x$ac_system" = "xLinux"
55 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
56 if test -z "$KERNEL_DIR"
58 KERNEL_DIR="/lib/modules/`uname -r`/source"
61 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
62 AC_SUBST(KERNEL_CFLAGS)
65 if test "x$ac_system" = "xSolaris"
67 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
71 # Checks for header files.
77 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 endian.h sys/isa_defs.h)
80 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
85 # include <sys/types.h>
88 AC_CHECK_HEADERS(netinet/in.h, [], [],
93 # include <sys/types.h>
95 #if HAVE_NETINET_IN_SYSTM_H
96 # include <netinet/in_systm.h>
99 AC_CHECK_HEADERS(netinet/ip.h, [], [],
104 # include <sys/types.h>
106 #if HAVE_NETINET_IN_SYSTM_H
107 # include <netinet/in_systm.h>
109 #if HAVE_NETINET_IN_H
110 # include <netinet/in.h>
113 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
118 # include <sys/types.h>
120 #if HAVE_NETINET_IN_SYSTM_H
121 # include <netinet/in_systm.h>
123 #if HAVE_NETINET_IN_H
124 # include <netinet/in.h>
126 #if HAVE_NETINET_IP_H
127 # include <netinet/ip.h>
130 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
135 # include <sys/types.h>
137 #if HAVE_NETINET_IN_SYSTM_H
138 # include <netinet/in_systm.h>
140 #if HAVE_NETINET_IN_H
141 # include <netinet/in.h>
143 #if HAVE_NETINET_IP_H
144 # include <netinet/ip.h>
147 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
152 # include <sys/types.h>
154 #if HAVE_NETINET_IN_SYSTM_H
155 # include <netinet/in_systm.h>
157 #if HAVE_NETINET_IN_H
158 # include <netinet/in.h>
161 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
166 # include <sys/types.h>
168 #if HAVE_NETINET_IN_SYSTM_H
169 # include <netinet/in_systm.h>
171 #if HAVE_NETINET_IN_H
172 # include <netinet/in.h>
174 #if HAVE_NETINET_IP6_H
175 # include <netinet/ip6.h>
178 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
183 # include <sys/types.h>
185 #if HAVE_NETINET_IN_SYSTM_H
186 # include <netinet/in_systm.h>
188 #if HAVE_NETINET_IN_H
189 # include <netinet/in.h>
191 #if HAVE_NETINET_IP_H
192 # include <netinet/ip.h>
195 AC_CHECK_HEADERS(netinet/udp.h, [], [],
200 # include <sys/types.h>
202 #if HAVE_NETINET_IN_SYSTM_H
203 # include <netinet/in_systm.h>
205 #if HAVE_NETINET_IN_H
206 # include <netinet/in.h>
208 #if HAVE_NETINET_IP_H
209 # include <netinet/ip.h>
214 AC_CHECK_HEADERS(sys/dkstat.h)
215 if test "x$ac_system" = "xDarwin"
217 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)
218 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
220 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
223 # include <sys/types.h>
226 # include <sys/param.h>
231 AC_CHECK_HEADERS(linux/major.h libgen.h)
233 # For the battery plugin
234 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
236 #if HAVE_IOKIT_IOKITLIB_H
237 # include <IOKit/IOKitLib.h>
239 #if HAVE_IOKIT_IOTYPES_H
240 # include <IOKit/IOTypes.h>
244 # For the swap module
245 have_sys_swap_h="yes"
246 AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
249 # include <sys/types.h>
252 # include <sys/param.h>
256 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
258 AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
262 # For the processes plugin
264 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
266 # For interface plugin
267 AC_CHECK_HEADERS(ifaddrs.h)
268 AC_CHECK_HEADERS(net/if.h, [], [],
271 # include <sys/types.h>
273 #if HAVE_SYS_SOCKET_H
274 # include <sys/socket.h>
277 AC_CHECK_HEADERS(linux/if.h, [], [],
280 # include <sys/types.h>
282 #if HAVE_SYS_SOCKET_H
283 # include <sys/socket.h>
286 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
289 # include <sys/types.h>
291 #if HAVE_SYS_SOCKET_H
292 # include <sys/socket.h>
295 # include <linux/if.h>
300 have_net_ip_vs_h="no"
302 if test "x$ac_system" = "xLinux"
305 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
307 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
308 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
314 AC_CHECK_HEADERS(sys/ucred.h, [], [],
317 # include <sys/types.h>
320 # include <sys/param.h>
324 # For mount interface
325 AC_CHECK_HEADERS(sys/mount.h, [], [],
328 # include <sys/types.h>
331 # include <sys/param.h>
335 # For the email plugin
336 AC_CHECK_HEADERS(linux/un.h, [], [],
338 #if HAVE_SYS_SOCKET_H
339 # include <sys/socket.h>
343 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)
346 AC_CHECK_HEADERS(arpa/nameser.h)
347 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
349 #if HAVE_ARPA_NAMESER_H
350 # include <arpa/nameser.h>
354 AC_CHECK_HEADERS(net/if_arp.h, [], [],
355 [#if HAVE_SYS_SOCKET_H
356 # include <sys/socket.h>
359 AC_CHECK_HEADERS(net/ppp_defs.h)
360 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
361 [#if HAVE_NET_PPP_DEFS_H
362 # include <net/ppp_defs.h>
365 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
370 # include <sys/types.h>
372 #if HAVE_SYS_SOCKET_H
373 # include <sys/socket.h>
378 #if HAVE_NETINET_IN_H
379 # include <netinet/in.h>
383 # For the multimeter plugin
385 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
388 # Checks for typedefs, structures, and compiler characteristics.
397 # Checks for library functions.
399 AC_PROG_GCC_TRADITIONAL
400 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
404 AC_CACHE_CHECK([for strtok_r],
405 [have_strtok_r_default],
414 char buffer[] = "foo,bar,baz";
421 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
424 printf ("token = %s;\n", token);
427 [have_strtok_r_default="yes"],
428 [have_strtok_r_default="no"]
432 if test "x$have_strtok_r_default" = "xno"
434 SAVE_CFLAGS="$CFLAGS"
435 CFLAGS="$CFLAGS -D_REENTRANT=1"
437 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
438 [have_strtok_r_reentrant],
447 char buffer[] = "foo,bar,baz";
454 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
457 printf ("token = %s;\n", token);
460 [have_strtok_r_reentrant="yes"],
461 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
466 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
468 socket_needs_socket="no"
469 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
470 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
472 nanosleep_needs_rt="no"
473 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
474 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
476 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
477 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
478 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
479 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
480 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
481 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
482 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
483 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
484 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
485 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
488 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
491 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
493 if test "x$withval" = "xno"; then
495 else if test "x$withval" = "xyes"; then
502 if test "x$nan_type" = "xnone"; then
503 AC_CACHE_CHECK([whether NAN is defined by default],
510 static float foo = NAN;
518 [have_nan_default="yes"],
519 [have_nan_default="no"]
522 if test "x$have_nan_default" = "xyes"
527 if test "x$nan_type" = "xnone"; then
528 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
534 #define __USE_ISOC99 1
536 static float foo = NAN;
544 [have_nan_isoc="yes"],
548 if test "x$have_nan_isoc" = "xyes"
553 if test "x$nan_type" = "xnone"; then
554 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
564 #define NAN (0.0 / 0.0)
566 # define isnan(f) ((f) != (f))
568 static float foo = NAN;
576 [have_nan_zero="yes"],
580 if test "x$have_nan_zero" = "xyes"
586 if test "x$nan_type" = "xdefault"; then
587 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
588 [Define if NAN is defined by default and can initialize static variables.])
589 else if test "x$nan_type" = "xisoc99"; then
590 AC_DEFINE(NAN_STATIC_ISOC, 1,
591 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
592 else if test "x$nan_type" = "xzero"; then
593 AC_DEFINE(NAN_ZERO_ZERO, 1,
594 [Define if NAN can be defined as (0.0 / 0.0)])
596 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
599 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
601 if test "x$withval" = "xnothing"; then
602 fp_layout_type="nothing"
603 else if test "x$withval" = "xendianflip"; then
604 fp_layout_type="endianflip"
605 else if test "x$withval" = "xintswap"; then
606 fp_layout_type="intswap"
608 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
611 [fp_layout_type="unknown"])
613 if test "x$fp_layout_type" = "xunknown"; then
614 AC_CACHE_CHECK([if doubles are stored in x86 representation],
615 [fp_layout_need_nothing],
631 memcpy ((void *) &i0, (void *) &d, 8);
634 memcpy ((void *) c, (void *) &i1, 8);
636 if ((c[0] == 0x2f) && (c[1] == 0x25)
637 && (c[2] == 0xc0) && (c[3] == 0xc7)
638 && (c[4] == 0x43) && (c[5] == 0x2b)
639 && (c[6] == 0x1f) && (c[7] == 0x5b))
644 [fp_layout_need_nothing="yes"],
645 [fp_layout_need_nothing="no"]
648 if test "x$fp_layout_need_nothing" = "xyes"; then
649 fp_layout_type="nothing"
652 if test "x$fp_layout_type" = "xunknown"; then
653 AC_CACHE_CHECK([if endianflip converts to x86 representation],
654 [fp_layout_need_endianflip],
662 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
663 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
664 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
665 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
666 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
667 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
668 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
669 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
678 memcpy ((void *) &i0, (void *) &d, 8);
680 i1 = endianflip (i0);
681 memcpy ((void *) c, (void *) &i1, 8);
683 if ((c[0] == 0x2f) && (c[1] == 0x25)
684 && (c[2] == 0xc0) && (c[3] == 0xc7)
685 && (c[4] == 0x43) && (c[5] == 0x2b)
686 && (c[6] == 0x1f) && (c[7] == 0x5b))
691 [fp_layout_need_endianflip="yes"],
692 [fp_layout_need_endianflip="no"]
695 if test "x$fp_layout_need_endianflip" = "xyes"; then
696 fp_layout_type="endianflip"
699 if test "x$fp_layout_type" = "xunknown"; then
700 AC_CACHE_CHECK([if intswap converts to x86 representation],
701 [fp_layout_need_intswap],
709 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
710 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
719 memcpy ((void *) &i0, (void *) &d, 8);
722 memcpy ((void *) c, (void *) &i1, 8);
724 if ((c[0] == 0x2f) && (c[1] == 0x25)
725 && (c[2] == 0xc0) && (c[3] == 0xc7)
726 && (c[4] == 0x43) && (c[5] == 0x2b)
727 && (c[6] == 0x1f) && (c[7] == 0x5b))
732 [fp_layout_need_intswap="yes"],
733 [fp_layout_need_intswap="no"]
736 if test "x$fp_layout_need_intswap" = "xyes"; then
737 fp_layout_type="intswap"
741 if test "x$fp_layout_type" = "xnothing"; then
742 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
743 [Define if doubles are stored in x86 representation.])
744 else if test "x$fp_layout_type" = "xendianflip"; then
745 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
746 [Define if endianflip is needed to convert to x86 representation.])
747 else if test "x$fp_layout_type" = "xintswap"; then
748 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
749 [Define if intswap is needed to convert to x86 representation.])
751 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
755 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
757 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
759 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
762 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
763 if test "x$have_getmntent" = "xno"; then
764 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
766 if test "x$have_getmntent" = "xno"; then
767 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
769 if test "x$have_getmntent" = "xno"; then
770 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
773 if test "x$have_getmntent" = "xc"; then
774 AC_CACHE_CHECK([whether getmntent takes one argument],
775 [have_one_getmntent],
777 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
779 #include "$srcdir/src/utils_mount.h"]],
783 fh = setmntent ("/etc/mtab", "r");
787 [have_one_getmntent="yes"],
788 [have_one_getmntent="no"]
791 AC_CACHE_CHECK([whether getmntent takes two arguments],
792 [have_two_getmntent],
794 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
795 #include <sys/mnttab.h>
796 #include "$srcdir/src/utils_mount.h"]],
801 fh = fopen ("/etc/mnttab", "r");
802 status = getmntent (fh, &mt);
805 [have_two_getmntent="yes"],
806 [have_two_getmntent="no"]
811 # Check for different versions of `getmntent' here..
813 if test "x$have_getmntent" = "xc"; then
814 if test "x$have_one_getmntent" = "xyes"; then
815 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
816 [Define if the function getmntent exists and takes one argument.])
818 if test "x$have_two_getmntent" = "xyes"; then
819 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
820 [Define if the function getmntent exists and takes two arguments.])
823 if test "x$have_getmntent" = "xsun"; then
824 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
825 [Define if the function getmntent exists. It's the version from libsun.])
827 if test "x$have_getmntent" = "xseq"; then
828 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
829 [Define if the function getmntent exists. It's the version from libseq.])
831 if test "x$have_getmntent" = "xgen"; then
832 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
833 [Define if the function getmntent exists. It's the version from libgen.])
836 # Check for structures
837 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
838 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
841 #include <sys/types.h>
842 #include <sys/socket.h>
845 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
846 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
849 #include <sys/types.h>
850 #include <sys/socket.h>
851 #include <linux/if.h>
852 #include <linux/netdevice.h>
855 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
860 # include <sys/types.h>
862 #if HAVE_NETINET_IN_SYSTM_H
863 # include <netinet/in_systm.h>
865 #if HAVE_NETINET_IN_H
866 # include <netinet/in.h>
868 #if HAVE_NETINET_IP_H
869 # include <netinet/ip.h>
871 #if HAVE_NETINET_UDP_H
872 # include <netinet/udp.h>
875 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
880 # include <sys/types.h>
882 #if HAVE_NETINET_IN_SYSTM_H
883 # include <netinet/in_systm.h>
885 #if HAVE_NETINET_IN_H
886 # include <netinet/in.h>
888 #if HAVE_NETINET_IP_H
889 # include <netinet/ip.h>
891 #if HAVE_NETINET_UDP_H
892 # include <netinet/udp.h>
896 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
906 # Checks for libraries begin here
909 AC_CHECK_LIB(resolv, res_search,
911 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
913 [with_libresolv="no"])
914 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
916 dnl Check for HAL (hardware abstraction library)
918 AC_CHECK_LIB(hal,libhal_device_property_exists,
919 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
921 if test "x$with_libhal" = "xyes"; then
922 if test "x$PKG_CONFIG" != "x"; then
923 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
924 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
925 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
926 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
930 m4_divert_once([HELP_WITH], [
931 collectd additional packages:])
933 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
936 librrd_threadsafe="yes"
937 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
938 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
940 librrd_cflags="-I$withval/include"
941 librrd_ldflags="-L$withval/lib"
944 with_rrdtool="$withval"
946 ], [with_rrdtool="yes"])
947 if test "x$with_rrdtool" = "xyes"
949 SAVE_CPPFLAGS="$CPPFLAGS"
950 SAVE_LDFLAGS="$LDFLAGS"
952 CPPFLAGS="$CPPFLAGS $librrd_cflags"
953 LDFLAGS="$LDFLAGS $librrd_ldflags"
955 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
957 CPPFLAGS="$SAVE_CPPFLAGS"
958 LDFLAGS="$SAVE_LDFLAGS"
960 if test "x$with_rrdtool" = "xyes"
962 SAVE_CPPFLAGS="$CPPFLAGS"
963 SAVE_LDFLAGS="$LDFLAGS"
965 CPPFLAGS="$CPPFLAGS $librrd_cflags"
966 LDFLAGS="$LDFLAGS $librrd_ldflags"
968 AC_CHECK_LIB(rrd_th, rrd_update_r,
970 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
972 [librrd_threadsafe="no"
973 AC_CHECK_LIB(rrd, rrd_update,
975 librrd_ldflags="$librrd_ldflags -lrrd -lm"
977 [with_rrdtool="no (symbol 'rrd_update' not found)"],
982 CPPFLAGS="$SAVE_CPPFLAGS"
983 LDFLAGS="$SAVE_LDFLAGS"
985 if test "x$with_rrdtool" = "xyes"
987 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
988 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
989 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
990 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
992 if test "x$librrd_threadsafe" = "xyes"
994 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
997 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
998 [ if test "x$withval" != "xno" \
999 && test "x$withval" != "xyes"
1001 LDFLAGS="$LDFLAGS -L$withval/lib"
1002 CPPFLAGS="$CPPFLAGS -I$withval/include"
1003 with_libpthread="yes"
1005 if test "x$withval" = "xno"
1007 with_libpthread="no (disabled)"
1010 ], [with_libpthread="yes"])
1011 if test "x$with_libpthread" = "xyes"
1013 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
1015 if test "x$with_libpthread" = "xyes"
1017 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
1019 if test "x$with_libpthread" = "xyes"
1025 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
1026 [Wether or not to use pthread (POSIX threads) library])
1027 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
1029 if test "x$ac_system" = "xSolaris"
1034 with_kstat="no (Solaris only)"
1035 with_devinfo="no (Solaris only)"
1038 if test "x$with_kstat" = "xyes"
1040 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1042 if test "x$with_kstat" = "xyes"
1044 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1045 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1047 if test "x$with_kstat" = "xyes"
1049 AC_DEFINE(HAVE_LIBKSTAT, 1,
1050 [Define to 1 if you have the 'kstat' library (-lkstat)])
1052 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1053 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1055 ### BEGIN of check for libcurl ###
1056 with_curl_config="curl-config"
1059 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1061 if test "x$withval" = "xno"
1064 else if test "x$withval" = "xyes"
1068 if test -f "$withval" && test -x "$withval"
1070 with_curl_config="$withval"
1072 else if test -x "$withval/bin/curl-config"
1074 with_curl_config="$withval/bin/curl-config"
1083 if test "x$with_libcurl" = "xyes"
1085 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1086 curl_config_status=$?
1088 if test $curl_config_status -ne 0
1090 with_libcurl="no ($with_curl_config failed)"
1092 SAVE_CPPFLAGS="$CPPFLAGS"
1093 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1095 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1097 CPPFLAGS="$SAVE_CPPFLAGS"
1100 if test "x$with_libcurl" = "xyes"
1102 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1103 curl_config_status=$?
1105 if test $curl_config_status -ne 0
1107 with_libcurl="no ($with_curl_config failed)"
1109 AC_CHECK_LIB(curl, curl_easy_init,
1110 [with_libcurl="yes"],
1111 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1115 if test "x$with_libcurl" = "xyes"
1117 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1118 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1119 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1120 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1122 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1123 ### END of check for libcurl ###
1126 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1133 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1135 with_libstatgrab_cflags=""
1136 with_libstatgrab_ldflags=""
1137 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
1139 if test "x$withval" != "xno" \
1140 && test "x$withval" != "xyes"
1142 with_libstatgrab_cflags="-I$withval/include"
1143 with_libstatgrab_ldflags="-L$withval/lib"
1144 with_libstatgrab="yes"
1146 with_libstatgrab="$withval"
1150 if test "x$ac_system" = "xunknown"
1152 with_libstatgrab="yes"
1154 with_libstatgrab="no"
1157 with_libstatgrab_pkg_config="yes"
1158 if test "x$with_libstatgrab" = "xyes" \
1159 && test "x$PKG_CONFIG" != "x"
1161 AC_MSG_CHECKING([pkg-config for libstatgrab])
1163 $PKG_CONFIG --exists libstatgrab 2>/dev/null
1166 with_libstatgrab_pkg_config="no"
1167 temp_result="not found"
1169 AC_MSG_RESULT([$temp_result])
1171 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
1172 with_libstatgrab_pkg_config="no"
1173 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
1176 if test "x$with_libstatgrab" = "xyes" \
1177 && test "x$with_libstatgrab_pkg_config" = "xyes" \
1178 && test "x$with_libstatgrab_cflags" = "x"
1180 AC_MSG_CHECKING([for libstatgrab CFLAGS])
1181 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
1184 with_libstatgrab_cflags="$temp_result"
1186 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
1187 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
1189 AC_MSG_RESULT([$temp_result])
1192 if test "x$with_libstatgrab" = "xyes" \
1193 && test "x$with_libstatgrab_pkg_config" = "xyes" \
1194 && test "x$with_libstatgrab_ldflags" = "x"
1196 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
1197 temp_result="`$PKG_CONFIG --libs libstatgrab`"
1200 with_libstatgrab_ldflags="$temp_result"
1202 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
1203 temp_result="$PKG_CONFIG --libs libstatgrab failed"
1205 AC_MSG_RESULT([$temp_result])
1208 if test "x$with_libstatgrab" = "xyes"
1210 SAVE_CPPFLAGS="$CPPFLAGS"
1211 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
1213 AC_CHECK_HEADERS(statgrab.h,
1214 [with_libstatgrab="yes"],
1215 [with_libstatgrab="no (statgrab.h not found)"])
1217 CPPFLAGS="$SAVE_CPPFLAGS"
1220 if test "x$with_libstatgrab" = "xyes"
1222 SAVE_CFLAGS="$CFLAGS"
1223 SAVE_LDFLAGS="$LDFLAGS"
1225 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
1226 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
1228 AC_CHECK_LIB(statgrab, sg_init,
1229 [with_libstatgrab="yes"],
1230 [with_libstatgrab="no (symbol sg_init not found)"])
1232 CFLAGS="$SAVE_CFLAGS"
1233 LDFLAGS="$SAVE_LDFLAGS"
1236 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
1237 if test "x$with_libstatgrab" = "xyes"
1239 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
1240 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
1241 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
1242 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1243 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1247 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1248 if test "x$with_kvm_getswapinfo" = "xyes"
1250 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1251 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1254 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1256 with_sensors_cflags=""
1257 with_sensors_ldflags=""
1258 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
1260 if test "x$withval" = "xno"
1262 with_lm_sensors="no"
1264 with_lm_sensors="yes"
1265 if test "x$withval" != "xyes"
1267 with_sensors_cflags="-I$withval/include"
1268 with_sensors_ldflags="-L$withval/lib"
1269 with_lm_sensors="yes"
1274 if test "x$ac_system" = "xLinux"
1276 with_lm_sensors="yes"
1278 with_lm_sensors="no (Linux only library)"
1281 if test "x$with_lm_sensors" = "xyes"
1283 SAVE_CPPFLAGS="$CPPFLAGS"
1284 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
1286 # AC_CHECK_HEADERS(sensors/sensors.h,
1288 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
1290 # [with_lm_sensors="no (sensors/sensors.h not found)"])
1291 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_lm_sensors="no (sensors/sensors.h not found)"])
1293 CPPFLAGS="$SAVE_CPPFLAGS"
1295 if test "x$with_lm_sensors" = "xyes"
1297 SAVE_CPPFLAGS="$CPPFLAGS"
1298 SAVE_LDFLAGS="$LDFLAGS"
1299 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
1300 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
1302 AC_CHECK_LIB(sensors, sensors_init,
1304 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
1306 [with_lm_sensors="no (libsensors not found)"])
1308 CPPFLAGS="$SAVE_CPPFLAGS"
1309 LDFLAGS="$SAVE_LDFLAGS"
1311 if test "x$with_lm_sensors" = "xyes"
1313 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
1314 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
1315 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
1316 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
1318 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
1320 with_mysql_config="mysql_config"
1321 with_mysql_cflags=""
1323 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1325 if test "x$withval" = "xno"
1328 else if test "x$withval" = "xyes"
1332 if test -f "$withval" && test -x "$withval";
1334 with_mysql_config="$withval"
1335 else if test -x "$withval/bin/mysql_config"
1337 with_mysql_config="$withval/bin/mysql_config"
1345 if test "x$with_libmysql" = "xyes"
1347 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1348 mysql_config_status=$?
1350 if test $mysql_config_status -ne 0
1352 with_libmysql="no ($with_mysql_config failed)"
1354 SAVE_CPPFLAGS="$CPPFLAGS"
1355 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1358 have_mysql_mysql_h="no"
1359 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1361 if test "x$have_mysql_h" = "xno"
1363 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1366 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1368 with_libmysql="no (mysql.h not found)"
1371 CPPFLAGS="$SAVE_CPPFLAGS"
1374 if test "x$with_libmysql" = "xyes"
1376 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1377 mysql_config_status=$?
1379 if test $mysql_config_status -ne 0
1381 with_libmysql="no ($with_mysql_config failed)"
1383 AC_CHECK_LIB(mysqlclient, mysql_init,
1384 [with_libmysql="yes"],
1385 [with_libmysql="no (symbol 'mysql_init' not found)"],
1389 if test "x$with_libmysql" = "xyes"
1391 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1392 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1393 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1394 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1396 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1398 with_own_liboconfig="no"
1399 liboconfig_LDFLAGS="$LDFLAGS"
1400 liboconfig_CPPFLAGS="$CPPFLAGS"
1401 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1403 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1405 if test -d "$withval/lib"
1407 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1409 if test -d "$withval/include"
1411 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1414 if test "x$withval" = "xno"
1416 AC_MSG_ERROR("liboconfig is required")
1420 with_liboconfig="yes"
1423 save_LDFLAGS="$LDFLAGS"
1424 save_CPPFLAGS="$CPPFLAGS"
1425 LDFLAGS="$liboconfig_LDFLAGS"
1426 CPPFLAGS="$liboconfig_CPPFLAGS"
1427 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1429 with_liboconfig="yes"
1430 with_own_liboconfig="no"
1433 with_liboconfig="yes"
1434 with_own_liboconfig="yes"
1435 LDFLAGS="$save_LDFLAGS"
1436 CPPFLAGS="$save_CPPFLAGS"
1439 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1440 if test "x$with_own_liboconfig" = "xyes"
1442 with_liboconfig="yes (shipped version)"
1445 #with_liboping="yes"
1446 with_own_liboping="no"
1447 liboping_LDFLAGS="$LDFLAGS"
1448 liboping_CPPFLAGS="$CPPFLAGS"
1449 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1451 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1453 if test -d "$withval/lib"
1455 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1457 if test -d "$withval/include"
1459 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1462 if test "x$withval" = "xno"
1465 with_own_liboping="no"
1466 else if test "x$withval" = "xyes"
1475 if test "x$with_liboping" = "xyes"
1477 save_LDFLAGS="$LDFLAGS"
1478 save_CPPFLAGS="$CPPFLAGS"
1479 LDFLAGS="$liboping_LDFLAGS"
1480 CPPFLAGS="$liboping_CPPFLAGS"
1481 AC_CHECK_LIB(oping, ping_construct,
1484 with_own_liboping="no"
1488 with_own_liboping="yes"
1489 LDFLAGS="$save_LDFLAGS"
1490 CPPFLAGS="$save_CPPFLAGS"
1493 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1494 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1496 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1498 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1500 LDFLAGS="$LDFLAGS -L$withval/lib"
1501 CPPFLAGS="$CPPFLAGS -I$withval/include"
1504 with_libpcap="$withval"
1510 if test "x$with_libpcap" = "xyes"
1512 AC_CHECK_LIB(pcap, pcap_open_live,
1514 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1515 ], [with_libpcap="no (libpcap not found)"])
1517 if test "x$with_libpcap" = "xyes"
1519 AC_CHECK_HEADERS(pcap.h,
1521 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1522 ], [with_libpcap="no (pcap.h not found)"])
1524 if test "x$with_libpcap" = "xyes"
1530 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1531 [Wether or not to use the pcap library])
1532 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1534 perl_interpreter="perl"
1535 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1537 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1539 LDFLAGS="$LDFLAGS -L$withval/lib"
1540 CPPFLAGS="$CPPFLAGS -I$withval/include"
1541 perl_interpreter="$withval/bin/perl"
1544 with_libperl="$withval"
1551 AC_MSG_CHECKING([for perl])
1552 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
1553 if test -x "$perl_interpreter"
1555 AC_MSG_RESULT([yes])
1561 AC_SUBST(PERL, "$perl_interpreter")
1563 if test "x$with_libperl" = "xyes" \
1564 && test -n "$perl_interpreter"
1567 SAVE_LDFLAGS=$LDFLAGS
1568 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1569 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1570 CFLAGS="$CFLAGS $PERL_CFLAGS"
1571 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1573 AC_CACHE_CHECK([for libperl],
1583 PerlInterpreter *perl = NULL;
1584 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1585 newSVpv ("Collectd::Plugin::FooBar", 24),
1588 [have_libperl="yes"],
1593 if test "x$have_libperl" = "xyes"
1595 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1596 AC_SUBST(PERL_CFLAGS)
1597 AC_SUBST(PERL_LDFLAGS)
1603 LDFLAGS=$SAVE_LDFLAGS
1604 else if test -z "$perl_interpreter"; then
1605 with_libperl="no (no perl interpreter found)"
1608 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1610 if test "x$with_libperl" = "xyes"
1613 SAVE_LDFLAGS=$LDFLAGS
1614 CFLAGS="$CFLAGS $PERL_CFLAGS"
1615 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1617 AC_CACHE_CHECK([if perl supports ithreads],
1618 [have_perl_ithreads],
1626 #if !defined(USE_ITHREADS)
1627 # error "Perl does not support ithreads!"
1628 #endif /* !defined(USE_ITHREADS) */
1631 [have_perl_ithreads="yes"],
1632 [have_perl_ithreads="no"]
1636 if test "x$have_perl_ithreads" = "xyes"
1638 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1642 LDFLAGS=$SAVE_LDFLAGS
1645 with_own_libiptc="no"
1646 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1648 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1650 LDFLAGS="$LDFLAGS -L$withval/lib"
1651 CPPFLAGS="$CPPFLAGS -I$withval/include"
1654 with_libiptc="$withval"
1658 if test "x$ac_system" = "xLinux"
1662 with_libiptc="no (Linux only)"
1665 if test "x$with_libiptc" = "xyes"
1667 AC_CHECK_LIB(iptc, iptc_init,
1669 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1673 with_own_libiptc="yes"
1676 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1678 AC_CHECK_HEADERS(libiptc/libiptc.h,
1680 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1684 with_own_libiptc="yes"
1687 if test "x$with_libiptc" = "xyes"
1690 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1692 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1694 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1695 with_own_libiptc="no"
1698 #include "$srcdir/src/libiptc/ipt_kernel_headers.h"
1703 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1704 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1705 if test "x$with_own_libiptc" = "xyes"
1707 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1710 with_snmp_config="net-snmp-config"
1713 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1715 if test "x$withval" = "xno"
1717 with_libnetsnmp="no"
1718 else if test "x$withval" = "xyes"
1720 with_libnetsnmp="yes"
1722 if test -x "$withval"
1724 with_snmp_config="$withval"
1725 with_libnetsnmp="yes"
1727 with_snmp_config="$withval/bin/net-snmp-config"
1728 with_libnetsnmp="yes"
1732 [with_libnetsnmp="yes"])
1733 if test "x$with_libnetsnmp" = "xyes"
1735 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1736 snmp_config_status=$?
1738 if test $snmp_config_status -ne 0
1740 with_libnetsnmp="no ($with_snmp_config failed)"
1742 SAVE_CPPFLAGS="$CPPFLAGS"
1743 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1745 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1747 CPPFLAGS="$SAVE_CPPFLAGS"
1750 if test "x$with_libnetsnmp" = "xyes"
1752 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1753 snmp_config_status=$?
1755 if test $snmp_config_status -ne 0
1757 with_libnetsnmp="no ($with_snmp_config failed)"
1759 AC_CHECK_LIB(netsnmp, init_snmp,
1760 [with_libnetsnmp="yes"],
1761 [with_libnetsnmp="no (libnetsnmp not found)"],
1765 if test "x$with_libnetsnmp" = "xyes"
1767 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1768 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1769 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1770 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1772 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1774 with_libupsclient="no (pkg-config isn't available)"
1775 with_libupsclient_cflags=""
1776 with_libupsclient_libs=""
1777 if test "x$PKG_CONFIG" != "x"
1779 pkg-config --exists 'libupsclient' 2>/dev/null
1782 with_libupsclient="yes"
1784 with_libupsclient="no (pkg-config doesn't know library)"
1787 if test "x$with_libupsclient" = "xyes"
1789 with_libupsclient_cflags="`pkg-config --cflags 'libupsclient'`"
1792 with_libupsclient="no"
1794 with_libupsclient_libs="`pkg-config --libs 'libupsclient'`"
1797 with_libupsclient="no"
1800 if test "x$with_libupsclient" = "xyes"
1802 SAVE_CPPFLAGS="$CPPFLAGS"
1803 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
1805 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1807 CPPFLAGS="$SAVE_CPPFLAGS"
1809 if test "x$with_libupsclient" = "xyes"
1811 SAVE_CPPFLAGS="$CPPFLAGS"
1812 SAVE_LDFLAGS="$LDFLAGS"
1814 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
1815 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
1817 AC_CHECK_LIB(upsclient, upscli_connect,
1818 [with_libupsclient="yes"],
1819 [with_libupsclient="no (symbol upscli_connect not found)"])
1821 CPPFLAGS="$SAVE_CPPFLAGS"
1822 LDFLAGS="$SAVE_LDFLAGS"
1824 if test "x$with_libupsclient" = "xyes"
1826 SAVE_CPPFLAGS="$CPPFLAGS"
1827 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
1829 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1830 [#include <stdlib.h>
1832 #include <upsclient.h>])
1834 CPPFLAGS="$SAVE_CPPFLAGS"
1836 if test "x$with_libupsclient" = "xyes"
1838 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
1839 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
1840 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1841 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1844 ### BEGIN of check for libxmms ###
1845 with_xmms_config="xmms-config"
1848 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1850 if test "x$withval" != "xno" \
1851 && test "x$withval" != "xyes"
1853 if test -f "$withval" && test -x "$withval";
1855 with_xmms_config="$withval"
1856 else if test -x "$withval/bin/xmms-config"
1858 with_xmms_config="$withval/bin/xmms-config"
1861 else if test "x$withval" = "xno"
1871 if test "x$with_libxmms" = "xyes"
1873 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1874 xmms_config_status=$?
1876 if test $xmms_config_status -ne 0
1881 if test "x$with_libxmms" = "xyes"
1883 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1884 xmms_config_status=$?
1886 if test $xmms_config_status -ne 0
1891 if test "x$with_libxmms" = "xyes"
1893 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1895 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1896 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1897 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1898 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1905 with_libxmms_numeric=0
1906 if test "x$with_libxmms" = "xyes"
1908 with_libxmms_numeric=1
1910 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1911 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1912 ### END of check for libxmms ###
1914 with_libnetlink_cflags=""
1915 with_libnetlink_libs="-lnetlink"
1916 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1918 echo "libnetlink: withval = $withval"
1919 if test "x$withval" = "xyes"
1921 with_libnetlink="yes"
1922 else if test "x$withval" = "xno"
1924 with_libnetlink="no"
1926 if test -d "$withval/include"
1928 with_libnetlink_cflags="-I$withval/include"
1929 with_libnetlink_libs="-L$withval/lib -lnetlink"
1930 with_libnetlink="yes"
1932 AC_MSG_ERROR("no such directory: $withval/include")
1937 if test "x$ac_system" = "xLinux"
1939 with_libnetlink="yes"
1941 with_libnetlink="no (Linux only library)"
1944 if test "x$with_libnetlink" = "xyes"
1947 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1949 with_libnetlink="no (libnetlink.h not found)"
1951 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1953 with_libnetlink="yes"
1957 #include <sys/types.h>
1958 #include <asm/types.h>
1959 #include <sys/socket.h>
1960 #include <linux/netlink.h>
1961 #include <linux/rtnetlink.h>])
1962 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1964 #include <sys/types.h>
1965 #include <asm/types.h>
1966 #include <sys/socket.h>])
1970 #include <sys/types.h>
1971 #include <asm/types.h>
1972 #include <sys/socket.h>
1973 #include <linux/netlink.h>
1974 #include <linux/rtnetlink.h>
1978 int retval = TCA_STATS2;
1981 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1986 #include <sys/types.h>
1987 #include <asm/types.h>
1988 #include <sys/socket.h>
1989 #include <linux/netlink.h>
1990 #include <linux/rtnetlink.h>
1994 int retval = TCA_STATS;
1997 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2000 CFLAGS="$SAVE_CFLAGS"
2002 if test "x$with_libnetlink" = "xyes"
2004 AC_CHECK_LIB(netlink, rtnl_open,
2005 [with_libnetlink="yes"],
2006 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2007 [$with_libnetlink_libs])
2009 if test "x$with_libnetlink" = "xyes"
2011 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2012 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2013 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2014 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2016 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2018 with_libopenipmipthread="yes"
2019 with_libopenipmipthread_cflags=""
2020 with_libopenipmipthread_libs=""
2022 AC_MSG_CHECKING([for pkg-config])
2024 if test "x$PKG_CONFIG" = "x"
2026 with_libopenipmipthread="no"
2029 temp_result="$PKG_CONFIG"
2031 AC_MSG_RESULT([$temp_result])
2033 if test "x$with_libopenipmipthread" = "xyes"
2035 AC_MSG_CHECKING([for libOpenIPMIpthread])
2036 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2039 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2041 AC_MSG_RESULT([$with_libopenipmipthread])
2044 if test "x$with_libopenipmipthread" = "xyes"
2046 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2047 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2050 with_libopenipmipthread_cflags="$temp_result"
2052 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2053 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2055 AC_MSG_RESULT([$temp_result])
2058 if test "x$with_libopenipmipthread" = "xyes"
2060 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2061 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2064 with_libopenipmipthread_ldflags="$temp_result"
2066 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2067 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2069 AC_MSG_RESULT([$temp_result])
2072 if test "x$with_libopenipmipthread" = "xyes"
2074 SAVE_CPPFLAGS="$CPPFLAGS"
2075 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2077 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2078 [with_libopenipmipthread="yes"],
2079 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2080 [#include <OpenIPMI/ipmiif.h>
2081 #include <OpenIPMI/ipmi_err.h>
2082 #include <OpenIPMI/ipmi_posix.h>
2083 #include <OpenIPMI/ipmi_conn.h>
2086 CPPFLAGS="$SAVE_CPPFLAGS"
2089 if test "x$with_libopenipmipthread" = "xyes"
2091 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2092 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2093 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2094 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2097 dnl Check for libvirt and libxml2 libraries.
2098 with_libxml2="no (pkg-config isn't available)"
2099 with_libxml2_cflags=""
2100 with_libxml2_ldflags=""
2101 with_libvirt="no (pkg-config isn't available)"
2102 with_libvirt_cflags=""
2103 with_libvirt_ldflags=""
2104 if test "x$PKG_CONFIG" != "x"
2106 pkg-config --exists 'libxml-2.0' 2>/dev/null
2111 with_libxml2="no (pkg-config doesn't know library)"
2114 pkg-config --exists libvirt 2>/dev/null
2119 with_libvirt="no (pkg-config doesn't know library)"
2122 if test "x$with_libxml2" = "xyes"
2124 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2129 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2135 if test "x$with_libxml2" = "xyes"
2137 SAVE_CPPFLAGS="$CPPFLAGS"
2138 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2140 AC_CHECK_HEADERS(libxml/parser.h, [],
2141 [with_libxml2="no (libxml/parser.h not found)"])
2143 CPPFLAGS="$SAVE_CPPFLAGS"
2145 if test "x$with_libxml2" = "xyes"
2147 SAVE_CFLAGS="$CFLAGS"
2148 SAVE_LDFLAGS="$LDFLAGS"
2150 CFLAGS="$CFLAGS $with_libxml2_cflags"
2151 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2153 AC_CHECK_LIB(xml2, xmlXPathEval,
2154 [with_libxml2="yes"],
2155 [with_libxml2="no (symbol xmlXPathEval not found)"])
2157 CFLAGS="$SAVE_CFLAGS"
2158 LDFLAGS="$SAVE_LDFLAGS"
2160 dnl Add the right compiler flags and libraries.
2161 if test "x$with_libxml2" = "xyes"; then
2162 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2163 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2164 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2165 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2167 if test "x$with_libvirt" = "xyes"
2169 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2174 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2180 if test "x$with_libvirt" = "xyes"
2182 SAVE_CPPFLAGS="$CPPFLAGS"
2183 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2185 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2186 [with_libvirt="no (libvirt/libvirt.h not found)"])
2188 CPPFLAGS="$SAVE_CPPFLAGS"
2190 if test "x$with_libvirt" = "xyes"
2192 SAVE_CFLAGS="$CFLAGS"
2193 SAVE_LDFLAGS="$LDFLAGS"
2195 CFLAGS="$CFLAGS $with_libvirt_cflags"
2196 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2198 AC_CHECK_LIB(virt, virDomainBlockStats,
2199 [with_libvirt="yes"],
2200 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2202 CFLAGS="$SAVE_CFLAGS"
2203 LDFLAGS="$SAVE_LDFLAGS"
2205 dnl Add the right compiler flags and libraries.
2206 if test "x$with_libvirt" = "xyes"; then
2207 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2208 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2209 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2210 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2213 dnl End of check for libvirt and libxml2 libraries.
2215 # Check for enabled/disabled features
2218 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2219 # ------------------------------------------------------------
2221 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2226 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2231 m4_define([EnDis],[disabled])dnl
2232 m4_define([YesNo],[no])dnl
2238 m4_define([EnDis],[enabled])dnl
2239 m4_define([YesNo],[yes])dnl
2242 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2246 m4_if([$3], [feature], [],
2250 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2256 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2258 enable_$1='[YesNo]'dnl
2260 if test "x$enable_$1" = "xno"
2264 if test "x$enable_$1" = "xyes"
2268 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2273 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2274 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2276 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2278 # AC_PLUGIN(name, default, info)
2279 # ------------------------------------------------------------
2285 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2287 if test "x$enableval" = "xyes"
2295 if test "x$2" = "xyes"
2302 if test "x$enable_plugin" = "xyes"
2304 if test "x$2" = "xyes"
2306 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2307 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2308 dependency_error="yes"
2309 enable_plugin="no (dependency error)"
2312 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2313 enable_$1="$enable_plugin"
2315 )# AC_PLUGIN(name, default, info)
2317 m4_divert_once([HELP_ENABLE], [
2318 collectd features:])
2319 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2320 AC_COLLECTD([debug], [enable], [feature], [debugging])
2321 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2322 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2324 dependency_error="no"
2332 plugin_interface="no"
2339 plugin_multimeter="no"
2342 plugin_processes="no"
2346 plugin_tcpconns="no"
2350 plugin_wireless="no"
2353 if test "x$ac_system" = "xLinux"
2355 plugin_battery="yes"
2357 plugin_cpufreq="yes"
2359 plugin_entropy="yes"
2360 plugin_interface="yes"
2365 plugin_processes="yes"
2368 plugin_tcpconns="yes"
2370 plugin_vserver="yes"
2371 plugin_wireless="yes"
2373 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2380 if test "x$with_libiokit" = "xyes"
2382 plugin_battery="yes"
2387 if test "x$with_devinfo$with_kstat" = "xyesyes"
2391 plugin_interface="yes"
2396 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
2402 if test "x$with_libstatgrab" = "xyes"
2406 plugin_interface="yes"
2413 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
2418 if test "x$with_libopenipmipthread" = "xyes"
2423 if test "x$have_processor_info" = "xyes"
2427 if test "x$have_sysctlbyname" = "xyes"
2431 plugin_tcpconns="yes"
2434 if test "x$have_statfs" = "xyes"
2438 if test "x$have_statvfs" = "xyes"
2443 if test "x$have_getifaddrs" = "xyes"
2445 plugin_interface="yes"
2448 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
2450 plugin_libvirt="yes"
2453 if test "x$have_getloadavg" = "xyes"
2458 if test "x$have_libperl$have_perl_ithreads" = "xyesyes"
2463 # Mac OS X memory interface
2464 if test "x$have_host_statistics" = "xyes"
2469 if test "x$have_termios_h" = "xyes"
2471 plugin_multimeter="yes"
2474 if test "x$have_thread_info" = "xyes"
2476 plugin_processes="yes"
2479 if test "x$with_kvm_getswapinfo" = "xyes"
2484 if test "x$have_getutent" = "xyes"
2488 if test "x$have_getutxent" = "xyes"
2493 # FIXME: sysctl for swap plugin
2495 m4_divert_once([HELP_ENABLE], [
2498 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
2499 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
2500 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
2501 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
2502 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
2503 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
2504 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
2505 AC_PLUGIN([csv], [yes], [CSV output plugin])
2506 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
2507 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
2508 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
2509 AC_PLUGIN([email], [yes], [EMail statistics])
2510 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
2511 AC_PLUGIN([exec], [yes], [Execution of external programs])
2512 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
2513 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
2514 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
2515 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
2516 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
2517 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
2518 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
2519 AC_PLUGIN([load], [$plugin_load], [System load])
2520 AC_PLUGIN([logfile], [yes], [File logging plugin])
2521 AC_PLUGIN([mbmon], [yes], [Query mbmond])
2522 AC_PLUGIN([memcached], [yes], [memcached statistics])
2523 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
2524 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
2525 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
2526 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
2527 AC_PLUGIN([network], [yes], [Network communication plugin])
2528 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
2529 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
2530 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
2531 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
2532 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
2533 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
2534 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
2535 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
2536 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
2537 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
2538 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
2539 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
2540 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
2541 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
2542 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
2543 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
2544 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
2545 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
2546 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
2547 AC_PLUGIN([users], [$plugin_users], [User statistics])
2548 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
2549 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
2550 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
2551 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
2552 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
2555 if test "x$ac_system" = "xLinux" \
2556 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
2558 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
2562 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
2564 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2566 PERL_BINDINGS_OPTIONS="$withval"
2567 with_perl_bindings="yes"
2569 PERL_BINDINGS_OPTIONS=""
2570 with_perl_bindings="$withval"
2574 PERL_BINDINGS_OPTIONS=""
2575 if test -n "$perl_interpreter"
2577 with_perl_bindings="yes"
2579 with_perl_bindings="no (no perl interpreter found)"
2582 if test "x$with_perl_bindings" = "xyes"
2584 PERL_BINDINGS="perl"
2588 AC_SUBST(PERL_BINDINGS)
2589 AC_SUBST(PERL_BINDINGS_OPTIONS)
2591 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
2593 if test "x$with_rrdtool" = "xyes" \
2594 && test "x$librrd_threadsafe" != "xyes"
2596 with_rrdtool="yes (warning: librrd is not thread-safe)"
2599 if test "x$with_liboping" = "xyes" \
2600 && test "x$with_own_liboping" = "xyes"
2602 with_liboping="yes (shipped version)"
2605 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
2607 with_libiptc="yes (shipped version)"
2610 if test "x$with_libperl" = "xyes"
2612 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
2614 enable_perl="no (needs libperl)"
2617 if test "x$with_perl_bindings" = "xyes" \
2618 && test "x$PERL_BINDINGS_OPTIONS" != "x"
2620 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
2627 libcurl . . . . . . $with_libcurl
2628 libiokit . . . . . $with_libiokit
2629 libiptc . . . . . . $with_libiptc
2630 libkstat . . . . . $with_kstat
2631 libkvm . . . . . . $with_libkvm
2632 libmysql . . . . . $with_libmysql
2633 libnetlink . . . . $with_libnetlink
2634 libnetsnmp . . . . $with_libnetsnmp
2635 liboconfig . . . . $with_liboconfig
2636 libopenipmi . . . . $with_libopenipmipthread
2637 liboping . . . . . $with_liboping
2638 libpcap . . . . . . $with_libpcap
2639 libperl . . . . . . $with_libperl
2640 libpthread . . . . $with_libpthread
2641 librrd . . . . . . $with_rrdtool
2642 libsensors . . . . $with_lm_sensors
2643 libstatgrab . . . . $with_libstatgrab
2644 libupsclient . . . $with_libupsclient
2645 libvirt . . . . . . $with_libvirt
2646 libxml2 . . . . . . $with_libxml2
2647 libxmms . . . . . . $with_libxmms
2650 daemon mode . . . . $enable_daemon
2651 debug . . . . . . . $enable_debug
2654 perl . . . . . . . $with_perl_bindings
2657 apache . . . . . . $enable_apache
2658 apcups . . . . . . $enable_apcups
2659 apple_sensors . . . $enable_apple_sensors
2660 ascent . . . . . . $enable_ascent
2661 battery . . . . . . $enable_battery
2662 cpu . . . . . . . . $enable_cpu
2663 cpufreq . . . . . . $enable_cpufreq
2664 csv . . . . . . . . $enable_csv
2665 df . . . . . . . . $enable_df
2666 disk . . . . . . . $enable_disk
2667 dns . . . . . . . . $enable_dns
2668 email . . . . . . . $enable_email
2669 entropy . . . . . . $enable_entropy
2670 exec . . . . . . . $enable_exec
2671 hddtemp . . . . . . $enable_hddtemp
2672 interface . . . . . $enable_interface
2673 iptables . . . . . $enable_iptables
2674 ipmi . . . . . . . $enable_ipmi
2675 ipvs . . . . . . . $enable_ipvs
2676 irq . . . . . . . . $enable_irq
2677 libvirt . . . . . . $enable_libvirt
2678 load . . . . . . . $enable_load
2679 logfile . . . . . . $enable_logfile
2680 mbmon . . . . . . . $enable_mbmon
2681 memcached . . . . . $enable_memcached
2682 memory . . . . . . $enable_memory
2683 multimeter . . . . $enable_multimeter
2684 mysql . . . . . . . $enable_mysql
2685 netlink . . . . . . $enable_netlink
2686 network . . . . . . $enable_network
2687 nfs . . . . . . . . $enable_nfs
2688 nginx . . . . . . . $enable_nginx
2689 ntpd . . . . . . . $enable_ntpd
2690 nut . . . . . . . . $enable_nut
2691 perl . . . . . . . $enable_perl
2692 ping . . . . . . . $enable_ping
2693 powerdns . . . . . $enable_powerdns
2694 processes . . . . . $enable_processes
2695 rrdtool . . . . . . $enable_rrdtool
2696 sensors . . . . . . $enable_sensors
2697 serial . . . . . . $enable_serial
2698 snmp . . . . . . . $enable_snmp
2699 swap . . . . . . . $enable_swap
2700 syslog . . . . . . $enable_syslog
2701 tail . . . . . . . $enable_tail
2702 tape . . . . . . . $enable_tape
2703 tcpconns . . . . . $enable_tcpconns
2704 teamspeak2 . . . . $enable_teamspeak2
2705 unixsock . . . . . $enable_unixsock
2706 users . . . . . . . $enable_users
2707 uuid . . . . . . . $enable_uuid
2708 vmem . . . . . . . $enable_vmem
2709 vserver . . . . . . $enable_vserver
2710 wireless . . . . . $enable_wireless
2711 xmms . . . . . . . $enable_xmms
2715 if test "x$dependency_error" = "xyes"; then
2716 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")