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_config=""
1775 with_libupsclient_cflags=""
1776 with_libupsclient_libs=""
1777 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1779 if test "x$withval" = "xno"
1781 with_libupsclient="no"
1782 else if test "x$withval" = "xyes"
1784 with_libupsclient="use_pkgconfig"
1786 if test -x "$withval"
1788 with_libupsclient_config="$withval"
1789 with_libupsclient="use_libupsclient_config"
1790 else if test -x "$withval/bin/libupsclient-config"
1792 with_libupsclient_config="$withval/bin/net-snmp-config"
1793 with_libupsclient="use_libupsclient_config"
1795 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
1796 with_libupsclient_cflags="-I$withval/include"
1797 with_libupsclient_libs="-L$withval/lib -lupsclient"
1798 with_libupsclient="yes"
1802 [with_libupsclient="use_pkgconfig"])
1804 # configure using libupsclient-config
1805 if test "x$with_libupsclient" = "xuse_libupsclient_config"
1807 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
1808 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
1811 with_libupsclient="no ($with_libupsclient_config failed)"
1813 with_libupsclient_libs="`$with_libupsclient_config --libs`"
1816 with_libupsclient="no ($with_libupsclient_config failed)"
1819 if test "x$with_libupsclient" = "xuse_libupsclient_config"
1821 with_libupsclient="yes"
1824 # configure using pkg-config
1825 if test "x$with_libupsclient" = "xuse_pkgconfig"
1827 if test "x$PKG_CONFIG" = "x"
1829 with_libupsclient="no (Don't have pkg-config)"
1832 if test "x$with_libupsclient" = "xuse_pkgconfig"
1834 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
1835 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
1838 with_libupsclient="no (pkg-config doesn't know library)"
1841 if test "x$with_libupsclient" = "xuse_pkgconfig"
1843 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
1846 with_libupsclient="no ($PKG_CONFIG failed)"
1848 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
1851 with_libupsclient="no ($PKG_CONFIG failed)"
1854 if test "x$with_libupsclient" = "xuse_pkgconfig"
1856 with_libupsclient="yes"
1859 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
1860 # the actual checks.
1861 if test "x$with_libupsclient" = "xyes"
1863 SAVE_CPPFLAGS="$CPPFLAGS"
1864 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
1866 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1868 CPPFLAGS="$SAVE_CPPFLAGS"
1870 if test "x$with_libupsclient" = "xyes"
1872 SAVE_CPPFLAGS="$CPPFLAGS"
1873 SAVE_LDFLAGS="$LDFLAGS"
1875 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
1876 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
1878 AC_CHECK_LIB(upsclient, upscli_connect,
1879 [with_libupsclient="yes"],
1880 [with_libupsclient="no (symbol upscli_connect not found)"])
1882 CPPFLAGS="$SAVE_CPPFLAGS"
1883 LDFLAGS="$SAVE_LDFLAGS"
1885 if test "x$with_libupsclient" = "xyes"
1887 SAVE_CPPFLAGS="$CPPFLAGS"
1888 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
1890 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1891 [#include <stdlib.h>
1893 #include <upsclient.h>])
1895 CPPFLAGS="$SAVE_CPPFLAGS"
1897 if test "x$with_libupsclient" = "xyes"
1899 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
1900 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
1901 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1902 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1905 ### BEGIN of check for libxmms ###
1906 with_xmms_config="xmms-config"
1909 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1911 if test "x$withval" != "xno" \
1912 && test "x$withval" != "xyes"
1914 if test -f "$withval" && test -x "$withval";
1916 with_xmms_config="$withval"
1917 else if test -x "$withval/bin/xmms-config"
1919 with_xmms_config="$withval/bin/xmms-config"
1922 else if test "x$withval" = "xno"
1932 if test "x$with_libxmms" = "xyes"
1934 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1935 xmms_config_status=$?
1937 if test $xmms_config_status -ne 0
1942 if test "x$with_libxmms" = "xyes"
1944 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1945 xmms_config_status=$?
1947 if test $xmms_config_status -ne 0
1952 if test "x$with_libxmms" = "xyes"
1954 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1956 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1957 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1958 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1959 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1966 with_libxmms_numeric=0
1967 if test "x$with_libxmms" = "xyes"
1969 with_libxmms_numeric=1
1971 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1972 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1973 ### END of check for libxmms ###
1975 with_libnetlink_cflags=""
1976 with_libnetlink_libs="-lnetlink"
1977 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1979 echo "libnetlink: withval = $withval"
1980 if test "x$withval" = "xyes"
1982 with_libnetlink="yes"
1983 else if test "x$withval" = "xno"
1985 with_libnetlink="no"
1987 if test -d "$withval/include"
1989 with_libnetlink_cflags="-I$withval/include"
1990 with_libnetlink_libs="-L$withval/lib -lnetlink"
1991 with_libnetlink="yes"
1993 AC_MSG_ERROR("no such directory: $withval/include")
1998 if test "x$ac_system" = "xLinux"
2000 with_libnetlink="yes"
2002 with_libnetlink="no (Linux only library)"
2005 if test "x$with_libnetlink" = "xyes"
2008 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2010 with_libnetlink="no (libnetlink.h not found)"
2012 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2014 with_libnetlink="yes"
2018 #include <sys/types.h>
2019 #include <asm/types.h>
2020 #include <sys/socket.h>
2021 #include <linux/netlink.h>
2022 #include <linux/rtnetlink.h>])
2023 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2025 #include <sys/types.h>
2026 #include <asm/types.h>
2027 #include <sys/socket.h>])
2031 #include <sys/types.h>
2032 #include <asm/types.h>
2033 #include <sys/socket.h>
2034 #include <linux/netlink.h>
2035 #include <linux/rtnetlink.h>
2039 int retval = TCA_STATS2;
2042 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2047 #include <sys/types.h>
2048 #include <asm/types.h>
2049 #include <sys/socket.h>
2050 #include <linux/netlink.h>
2051 #include <linux/rtnetlink.h>
2055 int retval = TCA_STATS;
2058 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2061 CFLAGS="$SAVE_CFLAGS"
2063 if test "x$with_libnetlink" = "xyes"
2065 AC_CHECK_LIB(netlink, rtnl_open,
2066 [with_libnetlink="yes"],
2067 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2068 [$with_libnetlink_libs])
2070 if test "x$with_libnetlink" = "xyes"
2072 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2073 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2074 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2075 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2077 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2079 with_libopenipmipthread="yes"
2080 with_libopenipmipthread_cflags=""
2081 with_libopenipmipthread_libs=""
2083 AC_MSG_CHECKING([for pkg-config])
2085 if test "x$PKG_CONFIG" = "x"
2087 with_libopenipmipthread="no"
2090 temp_result="$PKG_CONFIG"
2092 AC_MSG_RESULT([$temp_result])
2094 if test "x$with_libopenipmipthread" = "xyes"
2096 AC_MSG_CHECKING([for libOpenIPMIpthread])
2097 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2100 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2102 AC_MSG_RESULT([$with_libopenipmipthread])
2105 if test "x$with_libopenipmipthread" = "xyes"
2107 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2108 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2111 with_libopenipmipthread_cflags="$temp_result"
2113 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2114 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2116 AC_MSG_RESULT([$temp_result])
2119 if test "x$with_libopenipmipthread" = "xyes"
2121 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2122 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2125 with_libopenipmipthread_ldflags="$temp_result"
2127 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2128 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2130 AC_MSG_RESULT([$temp_result])
2133 if test "x$with_libopenipmipthread" = "xyes"
2135 SAVE_CPPFLAGS="$CPPFLAGS"
2136 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2138 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2139 [with_libopenipmipthread="yes"],
2140 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2141 [#include <OpenIPMI/ipmiif.h>
2142 #include <OpenIPMI/ipmi_err.h>
2143 #include <OpenIPMI/ipmi_posix.h>
2144 #include <OpenIPMI/ipmi_conn.h>
2147 CPPFLAGS="$SAVE_CPPFLAGS"
2150 if test "x$with_libopenipmipthread" = "xyes"
2152 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2153 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2154 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2155 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2158 dnl Check for libvirt and libxml2 libraries.
2159 with_libxml2="no (pkg-config isn't available)"
2160 with_libxml2_cflags=""
2161 with_libxml2_ldflags=""
2162 with_libvirt="no (pkg-config isn't available)"
2163 with_libvirt_cflags=""
2164 with_libvirt_ldflags=""
2165 if test "x$PKG_CONFIG" != "x"
2167 pkg-config --exists 'libxml-2.0' 2>/dev/null
2172 with_libxml2="no (pkg-config doesn't know library)"
2175 pkg-config --exists libvirt 2>/dev/null
2180 with_libvirt="no (pkg-config doesn't know library)"
2183 if test "x$with_libxml2" = "xyes"
2185 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2190 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2196 if test "x$with_libxml2" = "xyes"
2198 SAVE_CPPFLAGS="$CPPFLAGS"
2199 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2201 AC_CHECK_HEADERS(libxml/parser.h, [],
2202 [with_libxml2="no (libxml/parser.h not found)"])
2204 CPPFLAGS="$SAVE_CPPFLAGS"
2206 if test "x$with_libxml2" = "xyes"
2208 SAVE_CFLAGS="$CFLAGS"
2209 SAVE_LDFLAGS="$LDFLAGS"
2211 CFLAGS="$CFLAGS $with_libxml2_cflags"
2212 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2214 AC_CHECK_LIB(xml2, xmlXPathEval,
2215 [with_libxml2="yes"],
2216 [with_libxml2="no (symbol xmlXPathEval not found)"])
2218 CFLAGS="$SAVE_CFLAGS"
2219 LDFLAGS="$SAVE_LDFLAGS"
2221 dnl Add the right compiler flags and libraries.
2222 if test "x$with_libxml2" = "xyes"; then
2223 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2224 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2225 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2226 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2228 if test "x$with_libvirt" = "xyes"
2230 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2235 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2241 if test "x$with_libvirt" = "xyes"
2243 SAVE_CPPFLAGS="$CPPFLAGS"
2244 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2246 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2247 [with_libvirt="no (libvirt/libvirt.h not found)"])
2249 CPPFLAGS="$SAVE_CPPFLAGS"
2251 if test "x$with_libvirt" = "xyes"
2253 SAVE_CFLAGS="$CFLAGS"
2254 SAVE_LDFLAGS="$LDFLAGS"
2256 CFLAGS="$CFLAGS $with_libvirt_cflags"
2257 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2259 AC_CHECK_LIB(virt, virDomainBlockStats,
2260 [with_libvirt="yes"],
2261 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2263 CFLAGS="$SAVE_CFLAGS"
2264 LDFLAGS="$SAVE_LDFLAGS"
2266 dnl Add the right compiler flags and libraries.
2267 if test "x$with_libvirt" = "xyes"; then
2268 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2269 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2270 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2271 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2274 dnl End of check for libvirt and libxml2 libraries.
2276 # Check for enabled/disabled features
2279 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2280 # ------------------------------------------------------------
2282 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2287 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2292 m4_define([EnDis],[disabled])dnl
2293 m4_define([YesNo],[no])dnl
2299 m4_define([EnDis],[enabled])dnl
2300 m4_define([YesNo],[yes])dnl
2303 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2307 m4_if([$3], [feature], [],
2311 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2317 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2319 enable_$1='[YesNo]'dnl
2321 if test "x$enable_$1" = "xno"
2325 if test "x$enable_$1" = "xyes"
2329 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2334 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2335 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2337 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2339 # AC_PLUGIN(name, default, info)
2340 # ------------------------------------------------------------
2346 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2348 if test "x$enableval" = "xyes"
2356 if test "x$2" = "xyes"
2363 if test "x$enable_plugin" = "xyes"
2365 if test "x$2" = "xyes"
2367 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2368 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2369 dependency_error="yes"
2370 enable_plugin="no (dependency error)"
2373 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2374 enable_$1="$enable_plugin"
2376 )# AC_PLUGIN(name, default, info)
2378 m4_divert_once([HELP_ENABLE], [
2379 collectd features:])
2380 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2381 AC_COLLECTD([debug], [enable], [feature], [debugging])
2382 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2383 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2385 dependency_error="no"
2393 plugin_interface="no"
2400 plugin_multimeter="no"
2403 plugin_processes="no"
2407 plugin_tcpconns="no"
2411 plugin_wireless="no"
2414 if test "x$ac_system" = "xLinux"
2416 plugin_battery="yes"
2418 plugin_cpufreq="yes"
2420 plugin_entropy="yes"
2421 plugin_interface="yes"
2426 plugin_processes="yes"
2429 plugin_tcpconns="yes"
2431 plugin_vserver="yes"
2432 plugin_wireless="yes"
2434 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2441 if test "x$with_libiokit" = "xyes"
2443 plugin_battery="yes"
2448 if test "x$with_devinfo$with_kstat" = "xyesyes"
2452 plugin_interface="yes"
2457 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
2463 if test "x$with_libstatgrab" = "xyes"
2467 plugin_interface="yes"
2474 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
2479 if test "x$with_libopenipmipthread" = "xyes"
2484 if test "x$have_processor_info" = "xyes"
2488 if test "x$have_sysctlbyname" = "xyes"
2492 plugin_tcpconns="yes"
2495 if test "x$have_statfs" = "xyes"
2499 if test "x$have_statvfs" = "xyes"
2504 if test "x$have_getifaddrs" = "xyes"
2506 plugin_interface="yes"
2509 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
2511 plugin_libvirt="yes"
2514 if test "x$have_getloadavg" = "xyes"
2519 if test "x$have_libperl$have_perl_ithreads" = "xyesyes"
2524 # Mac OS X memory interface
2525 if test "x$have_host_statistics" = "xyes"
2530 if test "x$have_termios_h" = "xyes"
2532 plugin_multimeter="yes"
2535 if test "x$have_thread_info" = "xyes"
2537 plugin_processes="yes"
2540 if test "x$with_kvm_getswapinfo" = "xyes"
2545 if test "x$have_getutent" = "xyes"
2549 if test "x$have_getutxent" = "xyes"
2554 # FIXME: sysctl for swap plugin
2556 m4_divert_once([HELP_ENABLE], [
2559 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
2560 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
2561 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
2562 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
2563 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
2564 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
2565 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
2566 AC_PLUGIN([csv], [yes], [CSV output plugin])
2567 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
2568 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
2569 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
2570 AC_PLUGIN([email], [yes], [EMail statistics])
2571 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
2572 AC_PLUGIN([exec], [yes], [Execution of external programs])
2573 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
2574 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
2575 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
2576 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
2577 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
2578 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
2579 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
2580 AC_PLUGIN([load], [$plugin_load], [System load])
2581 AC_PLUGIN([logfile], [yes], [File logging plugin])
2582 AC_PLUGIN([mbmon], [yes], [Query mbmond])
2583 AC_PLUGIN([memcached], [yes], [memcached statistics])
2584 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
2585 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
2586 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
2587 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
2588 AC_PLUGIN([network], [yes], [Network communication plugin])
2589 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
2590 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
2591 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
2592 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
2593 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
2594 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
2595 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
2596 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
2597 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
2598 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
2599 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
2600 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
2601 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
2602 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
2603 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
2604 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
2605 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
2606 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
2607 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
2608 AC_PLUGIN([users], [$plugin_users], [User statistics])
2609 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
2610 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
2611 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
2612 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
2613 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
2616 if test "x$ac_system" = "xLinux" \
2617 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
2619 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
2623 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
2625 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2627 PERL_BINDINGS_OPTIONS="$withval"
2628 with_perl_bindings="yes"
2630 PERL_BINDINGS_OPTIONS=""
2631 with_perl_bindings="$withval"
2635 PERL_BINDINGS_OPTIONS=""
2636 if test -n "$perl_interpreter"
2638 with_perl_bindings="yes"
2640 with_perl_bindings="no (no perl interpreter found)"
2643 if test "x$with_perl_bindings" = "xyes"
2645 PERL_BINDINGS="perl"
2649 AC_SUBST(PERL_BINDINGS)
2650 AC_SUBST(PERL_BINDINGS_OPTIONS)
2652 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
2654 if test "x$with_rrdtool" = "xyes" \
2655 && test "x$librrd_threadsafe" != "xyes"
2657 with_rrdtool="yes (warning: librrd is not thread-safe)"
2660 if test "x$with_liboping" = "xyes" \
2661 && test "x$with_own_liboping" = "xyes"
2663 with_liboping="yes (shipped version)"
2666 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
2668 with_libiptc="yes (shipped version)"
2671 if test "x$with_libperl" = "xyes"
2673 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
2675 enable_perl="no (needs libperl)"
2678 if test "x$with_perl_bindings" = "xyes" \
2679 && test "x$PERL_BINDINGS_OPTIONS" != "x"
2681 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
2688 libcurl . . . . . . $with_libcurl
2689 libiokit . . . . . $with_libiokit
2690 libiptc . . . . . . $with_libiptc
2691 libkstat . . . . . $with_kstat
2692 libkvm . . . . . . $with_libkvm
2693 libmysql . . . . . $with_libmysql
2694 libnetlink . . . . $with_libnetlink
2695 libnetsnmp . . . . $with_libnetsnmp
2696 liboconfig . . . . $with_liboconfig
2697 libopenipmi . . . . $with_libopenipmipthread
2698 liboping . . . . . $with_liboping
2699 libpcap . . . . . . $with_libpcap
2700 libperl . . . . . . $with_libperl
2701 libpthread . . . . $with_libpthread
2702 librrd . . . . . . $with_rrdtool
2703 libsensors . . . . $with_lm_sensors
2704 libstatgrab . . . . $with_libstatgrab
2705 libupsclient . . . $with_libupsclient
2706 libvirt . . . . . . $with_libvirt
2707 libxml2 . . . . . . $with_libxml2
2708 libxmms . . . . . . $with_libxmms
2711 daemon mode . . . . $enable_daemon
2712 debug . . . . . . . $enable_debug
2715 perl . . . . . . . $with_perl_bindings
2718 apache . . . . . . $enable_apache
2719 apcups . . . . . . $enable_apcups
2720 apple_sensors . . . $enable_apple_sensors
2721 ascent . . . . . . $enable_ascent
2722 battery . . . . . . $enable_battery
2723 cpu . . . . . . . . $enable_cpu
2724 cpufreq . . . . . . $enable_cpufreq
2725 csv . . . . . . . . $enable_csv
2726 df . . . . . . . . $enable_df
2727 disk . . . . . . . $enable_disk
2728 dns . . . . . . . . $enable_dns
2729 email . . . . . . . $enable_email
2730 entropy . . . . . . $enable_entropy
2731 exec . . . . . . . $enable_exec
2732 hddtemp . . . . . . $enable_hddtemp
2733 interface . . . . . $enable_interface
2734 iptables . . . . . $enable_iptables
2735 ipmi . . . . . . . $enable_ipmi
2736 ipvs . . . . . . . $enable_ipvs
2737 irq . . . . . . . . $enable_irq
2738 libvirt . . . . . . $enable_libvirt
2739 load . . . . . . . $enable_load
2740 logfile . . . . . . $enable_logfile
2741 mbmon . . . . . . . $enable_mbmon
2742 memcached . . . . . $enable_memcached
2743 memory . . . . . . $enable_memory
2744 multimeter . . . . $enable_multimeter
2745 mysql . . . . . . . $enable_mysql
2746 netlink . . . . . . $enable_netlink
2747 network . . . . . . $enable_network
2748 nfs . . . . . . . . $enable_nfs
2749 nginx . . . . . . . $enable_nginx
2750 ntpd . . . . . . . $enable_ntpd
2751 nut . . . . . . . . $enable_nut
2752 perl . . . . . . . $enable_perl
2753 ping . . . . . . . $enable_ping
2754 powerdns . . . . . $enable_powerdns
2755 processes . . . . . $enable_processes
2756 rrdtool . . . . . . $enable_rrdtool
2757 sensors . . . . . . $enable_sensors
2758 serial . . . . . . $enable_serial
2759 snmp . . . . . . . $enable_snmp
2760 swap . . . . . . . $enable_swap
2761 syslog . . . . . . $enable_syslog
2762 tail . . . . . . . $enable_tail
2763 tape . . . . . . . $enable_tape
2764 tcpconns . . . . . $enable_tcpconns
2765 teamspeak2 . . . . $enable_teamspeak2
2766 unixsock . . . . . $enable_unixsock
2767 users . . . . . . . $enable_users
2768 uuid . . . . . . . $enable_uuid
2769 vmem . . . . . . . $enable_vmem
2770 vserver . . . . . . $enable_vserver
2771 wireless . . . . . $enable_wireless
2772 xmms . . . . . . . $enable_xmms
2776 if test "x$dependency_error" = "xyes"; then
2777 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")