1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
8 AC_PREFIX_DEFAULT("/opt/collectd")
13 # Checks for programs.
20 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
24 AC_LIBLTDL_CONVENIENCE
31 AC_CONFIG_SUBDIRS(libltdl)
33 AC_MSG_CHECKING([for kernel type ($host_os)])
36 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
40 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
49 AC_MSG_RESULT([$ac_system])
52 # Checks for header files.
58 AC_CHECK_HEADERS(stdint.h stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h)
61 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
66 # include <sys/types.h>
69 AC_CHECK_HEADERS(netinet/in.h, [], [],
74 # include <sys/types.h>
76 #if HAVE_NETINET_IN_SYSTM_H
77 # include <netinet/in_systm.h>
80 AC_CHECK_HEADERS(netinet/ip.h, [], [],
85 # include <sys/types.h>
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
91 # include <netinet/in.h>
94 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
99 # include <sys/types.h>
101 #if HAVE_NETINET_IN_SYSTM_H
102 # include <netinet/in_systm.h>
104 #if HAVE_NETINET_IN_H
105 # include <netinet/in.h>
107 #if HAVE_NETINET_IP_H
108 # include <netinet/ip.h>
111 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
116 # include <sys/types.h>
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
124 #if HAVE_NETINET_IP_H
125 # include <netinet/ip.h>
128 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
133 # include <sys/types.h>
135 #if HAVE_NETINET_IN_SYSTM_H
136 # include <netinet/in_systm.h>
138 #if HAVE_NETINET_IN_H
139 # include <netinet/in.h>
142 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
147 # include <sys/types.h>
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
152 #if HAVE_NETINET_IN_H
153 # include <netinet/in.h>
155 #if HAVE_NETINET_IP6_H
156 # include <netinet/ip6.h>
159 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
164 # include <sys/types.h>
166 #if HAVE_NETINET_IN_SYSTM_H
167 # include <netinet/in_systm.h>
169 #if HAVE_NETINET_IN_H
170 # include <netinet/in.h>
172 #if HAVE_NETINET_IP_H
173 # include <netinet/ip.h>
176 AC_CHECK_HEADERS(netinet/udp.h, [], [],
181 # include <sys/types.h>
183 #if HAVE_NETINET_IN_SYSTM_H
184 # include <netinet/in_systm.h>
186 #if HAVE_NETINET_IN_H
187 # include <netinet/in.h>
189 #if HAVE_NETINET_IP_H
190 # include <netinet/ip.h>
195 AC_CHECK_HEADERS(sys/dkstat.h)
196 if test "x$ac_system" = "xDarwin"
198 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
199 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
201 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
204 # include <sys/types.h>
207 # include <sys/param.h>
212 AC_CHECK_HEADERS(linux/major.h libgen.h)
214 # For the battery plugin
215 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
217 #if HAVE_IOKIT_IOKITLIB_H
218 # include <IOKit/IOKitLib.h>
220 #if HAVE_IOKIT_IOTYPES_H
221 # include <IOKit/IOTypes.h>
225 # For the swap module
226 AC_CHECK_HEADERS(sys/swap.h, [], [],
229 # include <sys/types.h>
232 # include <sys/param.h>
237 # For the processes plugin
239 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
241 # For interface plugin
242 AC_CHECK_HEADERS(ifaddrs.h)
243 AC_CHECK_HEADERS(net/if.h, [], [],
246 # include <sys/types.h>
248 #if HAVE_SYS_SOCKET_H
249 # include <sys/socket.h>
252 AC_CHECK_HEADERS(linux/if.h, [], [],
255 # include <sys/types.h>
257 #if HAVE_SYS_SOCKET_H
258 # include <sys/socket.h>
261 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
264 # include <sys/types.h>
266 #if HAVE_SYS_SOCKET_H
267 # include <sys/socket.h>
270 # include <linux/if.h>
275 have_net_ip_vs_h="no"
277 if test "x$ac_system" = "xLinux"
279 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
280 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
284 AC_CHECK_HEADERS(sys/ucred.h, [], [],
287 # include <sys/types.h>
290 # include <sys/param.h>
294 # For mount interface
295 AC_CHECK_HEADERS(sys/mount.h, [], [],
298 # include <sys/types.h>
301 # include <sys/param.h>
305 # For the email plugin
306 AC_CHECK_HEADERS(linux/un.h, [], [],
308 #if HAVE_SYS_SOCKET_H
309 # include <sys/socket.h>
313 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h)
316 AC_CHECK_HEADERS(arpa/nameser.h)
317 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
319 #if HAVE_ARPA_NAMESER_H
320 # include <arpa/nameser.h>
324 AC_CHECK_HEADERS(net/if_arp.h, [], [],
325 [#if HAVE_SYS_SOCKET_H
326 # include <sys/socket.h>
329 AC_CHECK_HEADERS(net/ppp_defs.h)
330 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
331 [#if HAVE_NET_PPP_DEFS_H
332 # include <net/ppp_defs.h>
335 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
340 # include <sys/types.h>
342 #if HAVE_SYS_SOCKET_H
343 # include <sys/socket.h>
348 #if HAVE_NETINET_IN_H
349 # include <netinet/in.h>
353 # For the multimeter plugin
355 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
358 # Checking for libraries
363 # Checks for typedefs, structures, and compiler characteristics.
372 # Checks for library functions.
374 AC_PROG_GCC_TRADITIONAL
375 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
379 AC_CHECK_FUNCS(getpwnam_r)
380 AC_CHECK_FUNCS(getgrnam_r)
382 socket_needs_socket="no"
383 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
384 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
386 nanosleep_needs_rt="no"
387 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
388 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
390 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
392 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
393 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
394 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
395 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
396 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
397 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
398 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
399 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
400 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
401 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
404 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
407 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
409 if test "x$withval" = "xno"; then
411 else if test "x$withval" = "xyes"; then
418 if test "x$nan_type" = "xnone"; then
419 AC_CACHE_CHECK([whether NAN is defined by default],
426 static float foo = NAN;
434 [have_nan_default="yes"],
435 [have_nan_default="no"]
438 if test "x$have_nan_default" = "xyes"
443 if test "x$nan_type" = "xnone"; then
444 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
450 #define __USE_ISOC99 1
452 static float foo = NAN;
460 [have_nan_isoc="yes"],
464 if test "x$have_nan_isoc" = "xyes"
469 if test "x$nan_type" = "xnone"; then
470 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
480 #define NAN (0.0 / 0.0)
482 # define isnan(f) ((f) != (f))
484 static float foo = NAN;
492 [have_nan_zero="yes"],
496 if test "x$have_nan_zero" = "xyes"
502 if test "x$nan_type" = "xdefault"; then
503 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
504 [Define if NAN is defined by default and can initialize static variables.])
505 else if test "x$nan_type" = "xisoc99"; then
506 AC_DEFINE(NAN_STATIC_ISOC, 1,
507 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
508 else if test "x$nan_type" = "xzero"; then
509 AC_DEFINE(NAN_ZERO_ZERO, 1,
510 [Define if NAN can be defined as (0.0 / 0.0)])
512 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
515 # For mount interface
516 #AC_CHECK_FUNCS(getfsent getvfsent)
519 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
521 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
523 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
526 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
527 if test "x$have_getmntent" = "xno"; then
528 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
530 if test "x$have_getmntent" = "xno"; then
531 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
533 if test "x$have_getmntent" = "xno"; then
534 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
537 if test "x$have_getmntent" = "xc"; then
538 AC_CACHE_CHECK([whether getmntent takes one argument],
539 [have_one_getmntent],
541 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
543 #include "$srcdir/src/utils_mount.h"]],
547 fh = setmntent ("/etc/mtab", "r");
551 [have_one_getmntent="yes"],
552 [have_one_getmntent="no"]
555 AC_CACHE_CHECK([whether getmntent takes two arguments],
556 [have_two_getmntent],
558 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
559 #include <sys/mnttab.h>
560 #include "$srcdir/src/utils_mount.h"]],
565 fh = fopen ("/etc/mnttab", "r");
566 status = getmntent (fh, &mt);
569 [have_two_getmntent="yes"],
570 [have_two_getmntent="no"]
575 # Check for different versions of `getmntent' here..
577 if test "x$have_getmntent" = "xc"; then
578 if test "x$have_one_getmntent" = "xyes"; then
579 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
580 [Define if the function getmntent exists and takes one argument.])
582 if test "x$have_two_getmntent" = "xyes"; then
583 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
584 [Define if the function getmntent exists and takes two arguments.])
587 if test "x$have_getmntent" = "xsun"; then
588 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
589 [Define if the function getmntent exists. It's the version from libsun.])
591 if test "x$have_getmntent" = "xseq"; then
592 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
593 [Define if the function getmntent exists. It's the version from libseq.])
595 if test "x$have_getmntent" = "xgen"; then
596 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
597 [Define if the function getmntent exists. It's the version from libgen.])
600 # Check for structures
601 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
602 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
605 #include <sys/types.h>
606 #include <sys/socket.h>
609 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
610 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
613 #include <sys/types.h>
614 #include <sys/socket.h>
615 #include <linux/if.h>
616 #include <linux/netdevice.h>
619 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
624 # include <sys/types.h>
626 #if HAVE_NETINET_IN_SYSTM_H
627 # include <netinet/in_systm.h>
629 #if HAVE_NETINET_IN_H
630 # include <netinet/in.h>
632 #if HAVE_NETINET_IP_H
633 # include <netinet/ip.h>
635 #if HAVE_NETINET_UDP_H
636 # include <netinet/udp.h>
639 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
644 # include <sys/types.h>
646 #if HAVE_NETINET_IN_SYSTM_H
647 # include <netinet/in_systm.h>
649 #if HAVE_NETINET_IN_H
650 # include <netinet/in.h>
652 #if HAVE_NETINET_IP_H
653 # include <netinet/ip.h>
655 #if HAVE_NETINET_UDP_H
656 # include <netinet/udp.h>
660 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
670 AC_CHECK_LIB(resolv, res_search,
672 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
674 [with_libresolv="no"])
675 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
678 m4_divert_once([HELP_WITH], [
679 collectd additional packages:])
681 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
684 librrd_threadsafe="yes"
685 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
686 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
688 librrd_cflags="-I$withval/include"
689 librrd_ldflags="-L$withval/lib"
692 ], [with_rrdtool="yes"])
693 if test "x$with_rrdtool" = "xyes"
695 SAVE_CPPFLAGS="$CPPFLAGS"
696 SAVE_LDFLAGS="$LDFLAGS"
698 CPPFLAGS="$CPPFLAGS $librrd_cflags"
699 LDFLAGS="$LDFLAGS $librrd_ldflags"
701 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
703 CPPFLAGS="$SAVE_CPPFLAGS"
704 LDFLAGS="$SAVE_LDFLAGS"
706 if test "x$with_rrdtool" = "xyes"
708 SAVE_CPPFLAGS="$CPPFLAGS"
709 SAVE_LDFLAGS="$LDFLAGS"
711 CPPFLAGS="$CPPFLAGS $librrd_cflags"
712 LDFLAGS="$LDFLAGS $librrd_ldflags"
714 AC_CHECK_LIB(rrd_th, rrd_update_r,
716 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
718 [librrd_threadsafe="no"
719 AC_CHECK_LIB(rrd, rrd_update,
721 librrd_ldflags="$librrd_ldflags -lrrd -lm"
723 [with_rrdtool="no (symbol 'rrd_update' not found)"],
728 CPPFLAGS="$SAVE_CPPFLAGS"
729 LDFLAGS="$SAVE_LDFLAGS"
731 if test "x$with_rrdtool" = "xyes"
733 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
734 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
735 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
736 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
738 if test "x$librrd_threadsafe" = "xyes"
740 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
743 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
744 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
746 LDFLAGS="$LDFLAGS -L$withval/lib"
747 CPPFLAGS="$CPPFLAGS -I$withval/include"
748 with_libpthread="yes"
750 if test "x$withval" = "xno"
752 with_libpthread="no (disabled)"
755 ], [with_libpthread="yes"])
756 if test "x$with_libpthread" = "xyes"
758 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
760 if test "x$with_libpthread" = "xyes"
762 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
764 if test "x$with_libpthread" = "xyes"
770 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
771 [Wether or not to use pthread (POSIX threads) library])
772 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
774 if test "x$ac_system" = "xSolaris"
779 with_kstat="no (Solaris only)"
780 with_devinfo="no (Solaris only)"
783 if test "x$with_kstat" = "xyes"
785 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
787 if test "x$with_kstat" = "xyes"
789 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
790 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
792 if test "x$with_kstat" = "xyes"
794 AC_DEFINE(HAVE_LIBKSTAT, 1,
795 [Define to 1 if you have the 'kstat' library (-lkstat)])
797 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
798 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
800 ### BEGIN of check for libcurl ###
801 with_curl_config="curl-config"
804 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
806 if test "x$withval" = "xno"
809 else if test "x$withval" = "xyes"
813 if test -f "$withval" && test -x "$withval"
815 with_curl_config="$withval"
817 else if test -x "$withval/bin/curl-config"
819 with_curl_config="$withval/bin/curl-config"
828 if test "x$with_libcurl" = "xyes"
830 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
831 curl_config_status=$?
833 if test $curl_config_status -ne 0
835 with_libcurl="no ($with_curl_config failed)"
838 CFLAGS="$CFLAGS $with_curl_cflags"
840 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
842 CFLAGS="$SAVE_CFLAGS"
845 if test "x$with_libcurl" = "xyes"
847 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
848 curl_config_status=$?
850 if test $curl_config_status -ne 0
852 with_libcurl="no ($with_curl_config failed)"
854 AC_CHECK_LIB(curl, curl_easy_init,
855 [with_libcurl="yes"],
856 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
860 if test "x$with_libcurl" = "xyes"
862 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
863 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
864 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
865 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
867 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
868 ### END of check for libcurl ###
872 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
881 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
882 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
884 with_libstatgrab="yes"
886 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
888 if test "x$withval" != "xno" -a "x$withval" != "xyes"
890 LDFLAGS="$LDFLAGS -L$withval/lib"
891 CPPFLAGS="$CPPFLAGS -I$withval/include"
892 with_libstatgrab="yes"
896 if test "x$ac_system" == "xunknown"
898 with_libstatgrab="yes"
900 with_libstatgrab="no"
903 if test "x$with_libstatgrab" = "xyes"
905 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
907 if test "x$with_libstatgrab" = "xyes"
909 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
911 if test "x$with_libstatgrab" = "xyes"
913 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
915 if test "x$with_libstatgrab" = "xyes"
917 collect_libstatgrab=1
919 collect_libstatgrab=0
921 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
922 [Wether or not to use statgrab library])
923 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
924 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
926 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
927 if test "x$with_libkvm" = "xyes"
929 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
931 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
933 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
935 if test "x$withval" != "xno" && test "x$withval" != "xyes"
937 LDFLAGS="$LDFLAGS -L$withval/lib"
938 CPPFLAGS="$CPPFLAGS -I$withval/include"
939 with_lm_sensors="yes"
943 if test "x$ac_system" = "xLinux"
945 with_lm_sensors="yes"
947 with_lm_sensors="no (Linux only library)"
950 if test "x$with_lm_sensors" = "xyes"
952 AC_CHECK_LIB(sensors, sensors_init,
954 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
956 [with_lm_sensors="no (libsensors not found)"])
958 if test "x$with_lm_sensors" = "xyes"
960 AC_CHECK_HEADERS(sensors/sensors.h,
962 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
964 [with_lm_sensors="no (sensors/sensors.h not found)"])
966 if test "x$with_lm_sensors" = "xyes"
972 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
973 [Wether or not to use sensors library])
974 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
976 with_mysql_config="mysql_config"
979 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
981 if test "x$withval" = "xno"
984 else if test "x$withval" = "xyes"
988 if test -f "$withval" && test -x "$withval";
990 with_mysql_config="$withval"
991 else if test -x "$withval/bin/mysql_config"
993 with_mysql_config="$withval/bin/mysql_config"
1001 if test "x$with_libmysql" = "xyes"
1003 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1004 mysql_config_status=$?
1006 if test $mysql_config_status -ne 0
1011 CFLAGS="$CFLAGS $with_mysql_cflags"
1013 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
1015 CFLAGS="$SAVE_CFLAGS"
1018 if test "x$with_libmysql" = "xyes"
1020 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1021 mysql_config_status=$?
1023 if test $mysql_config_status -ne 0
1027 AC_CHECK_LIB(mysqlclient, mysql_init,
1028 [with_libmysql="yes"],
1029 [with_libmysql="no (symbol 'mysql_init' not found)"],
1033 if test "x$with_libmysql" = "xyes"
1035 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1036 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1037 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1038 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1040 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1042 with_own_liboconfig="no"
1043 liboconfig_LDFLAGS="$LDFLAGS"
1044 liboconfig_CPPFLAGS="$CPPFLAGS"
1045 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1047 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1049 if test -d "$withval/lib"
1051 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1053 if test -d "$withval/include"
1055 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1058 if test "x$withval" = "xno"
1060 AC_MSG_ERROR("liboconfig is required")
1064 with_liboconfig="yes"
1067 save_LDFLAGS="$LDFLAGS"
1068 save_CPPFLAGS="$CPPFLAGS"
1069 LDFLAGS="$liboconfig_LDFLAGS"
1070 CPPFLAGS="$liboconfig_CPPFLAGS"
1071 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1073 with_liboconfig="yes"
1074 with_own_liboconfig="no"
1077 with_liboconfig="yes"
1078 with_own_liboconfig="yes"
1079 LDFLAGS="$save_LDFLAGS"
1080 CPPFLAGS="$save_CPPFLAGS"
1083 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1084 if test "x$with_own_liboconfig" = "xyes"
1086 with_liboconfig="yes (shipped version)"
1089 #with_liboping="yes"
1090 with_own_liboping="no"
1091 liboping_LDFLAGS="$LDFLAGS"
1092 liboping_CPPFLAGS="$CPPFLAGS"
1093 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1095 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1097 if test -d "$withval/lib"
1099 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1101 if test -d "$withval/include"
1103 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1106 if test "x$withval" = "xno"
1109 with_own_liboping="no"
1117 if test "x$with_liboping" = "xyes"
1119 save_LDFLAGS="$LDFLAGS"
1120 save_CPPFLAGS="$CPPFLAGS"
1121 LDFLAGS="$liboping_LDFLAGS"
1122 CPPFLAGS="$liboping_CPPFLAGS"
1123 AC_CHECK_LIB(oping, ping_construct,
1126 with_own_liboping="no"
1130 with_own_liboping="yes"
1131 LDFLAGS="$save_LDFLAGS"
1132 CPPFLAGS="$save_CPPFLAGS"
1135 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1136 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1138 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1140 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1142 LDFLAGS="$LDFLAGS -L$withval/lib"
1143 CPPFLAGS="$CPPFLAGS -I$withval/include"
1150 if test "x$with_libpcap" = "xyes"
1152 AC_CHECK_LIB(pcap, pcap_open_live,
1154 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1155 ], [with_libpcap="no (libpcap not found)"])
1157 if test "x$with_libpcap" = "xyes"
1159 AC_CHECK_HEADERS(pcap.h,
1161 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1162 ], [with_libpcap="no (pcap.h not found)"])
1164 if test "x$with_libpcap" = "xyes"
1170 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1171 [Wether or not to use the pcap library])
1172 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1174 perl_interpreter="perl"
1175 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1177 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1179 LDFLAGS="$LDFLAGS -L$withval/lib"
1180 CPPFLAGS="$CPPFLAGS -I$withval/include"
1181 perl_interpreter="$withval/bin/perl"
1189 AC_SUBST(PERL, "$perl_interpreter")
1191 if test "x$with_libperl" = "xyes"
1194 SAVE_LDFLAGS=$LDFLAGS
1195 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1196 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1197 CFLAGS="$CFLAGS $PERL_CFLAGS"
1198 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1200 AC_CACHE_CHECK([for libperl],
1210 PerlInterpreter *perl = NULL;
1211 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1212 newSVpv ("Collectd::Plugin::FooBar", 24),
1215 [have_libperl="yes"],
1220 if test "x$have_libperl" = "xyes"
1222 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1223 AC_SUBST(PERL_CFLAGS)
1224 AC_SUBST(PERL_LDFLAGS)
1230 LDFLAGS=$SAVE_LDFLAGS
1232 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1234 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1236 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1238 LDFLAGS="$LDFLAGS -L$withval/lib"
1239 CPPFLAGS="$CPPFLAGS -I$withval/include"
1244 if test "x$ac_system" = "xLinux"
1248 with_libiptc="no (Linux only)"
1251 if test "x$with_libiptc" = "xyes"
1253 AC_CHECK_LIB(iptc, iptc_init,
1255 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1256 ], [with_libiptc="no (libiptc not found)"])
1258 if test "x$with_libiptc" = "xyes"
1260 AC_CHECK_HEADERS(libiptc/libiptc.h,
1262 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1263 ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1265 if test "x$with_libiptc" = "xyes"
1271 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1273 with_snmp_config="net-snmp-config"
1276 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1278 if test "x$withval" = "xno"
1280 with_libnetsnmp="no"
1281 else if "x$withval" = "xyes"
1283 with_libnetsnmp="yes"
1285 if test -x "$withval"
1287 with_snmp_config="$withval"
1288 with_libnetsnmp="yes"
1290 with_snmp_config="$withval/bin/net-snmp-config"
1291 with_libnetsnmp="yes"
1295 [with_libnetsnmp="yes"])
1296 if test "x$with_libnetsnmp" = "xyes"
1298 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1299 snmp_config_status=$?
1301 if test $snmp_config_status -ne 0
1303 with_libnetsnmp="no ($with_snmp_config failed)"
1306 CFLAGS="$CFLAGS $with_snmp_cflags"
1308 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1310 CFLAGS="$SAVE_CFLAGS"
1313 if test "x$with_libnetsnmp" = "xyes"
1315 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1316 snmp_config_status=$?
1318 if test $snmp_config_status -ne 0
1320 with_libnetsnmp="no ($with_snmp_config failed)"
1322 AC_CHECK_LIB(netsnmp, init_snmp,
1323 [with_libnetsnmp="yes"],
1324 [with_libnetsnmp="no (libnetsnmp not found)"],
1328 if test "x$with_libnetsnmp" = "xyes"
1330 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1331 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1332 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1333 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1335 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1337 with_upsclient_config="libupsclient-config"
1338 with_upsclient_cflags=""
1339 with_upsclient_libs=""
1340 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1342 if test "x$withval" = "xno"
1344 with_libupsclient="no"
1346 if test "x$withval" != "xyes"
1348 if test -f "$withval" && test -x "$withval";
1350 with_upsclient_config="$withval"
1352 with_upsclient_config="$withval/bin/libupsclient-config"
1355 with_libupsclient="yes"
1359 with_libupsclient="yes"
1361 if test "x$with_libupsclient" = "xyes"
1363 with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1364 upsclient_config_status=$?
1366 if test $upsclient_config_status -ne 0
1368 with_libupsclient="no ($with_upsclient_config failed)"
1371 if test "x$with_libupsclient" = "xyes"
1373 SAVE_CFLAGS="$CFLAGS"
1374 CFLAGS="$CFLAGS $with_upsclient_cflags"
1376 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1378 CFLAGS="$SAVE_CFLAGS"
1380 if test "x$with_libupsclient" = "xyes"
1382 with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1383 upsclient_config_status=$?
1385 if test $upsclient_config_status -ne 0
1387 with_libupsclient="no ($with_upsclient_config failed)"
1390 if test "x$with_libupsclient" = "xyes"
1392 AC_CHECK_LIB(upsclient, upscli_connect,
1394 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1395 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1396 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1397 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1400 with_libupsclient="no (symbol 'upscli_connect' not found)"
1401 ], [$with_upsclient_libs])
1403 if test "x$with_libupsclient" = "xyes"
1405 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1406 [#include <stdlib.h>
1408 #include <upsclient.h>])
1410 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1412 ### BEGIN of check for libxmms ###
1413 with_xmms_config="xmms-config"
1416 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1418 if test "x$withval" != "xno" -a "x$withval" != "xyes"
1420 if test -f "$withval" && test -x "$withval";
1422 with_xmms_config="$withval"
1423 else if test -x "$withval/bin/xmms-config"
1425 with_xmms_config="$withval/bin/xmms-config"
1428 else if test "x$withval" = "xno"
1438 if test "x$with_libxmms" = "xyes"
1440 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1441 xmms_config_status=$?
1443 if test $xmms_config_status -ne 0
1448 if test "x$with_libxmms" = "xyes"
1450 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1451 xmms_config_status=$?
1453 if test $xmms_config_status -ne 0
1458 if test "x$with_libxmms" = "xyes"
1460 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1462 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1463 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1464 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1465 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1472 with_libxmms_numeric=0
1473 if test "x$with_libxmms" = "xyes"
1475 with_libxmms_numeric=1
1477 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1478 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1479 ### END of check for libxmms ###
1481 with_libnetlink_cflags=""
1482 with_libnetlink_libs="-lnetlink"
1483 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1485 echo "libnetlink: withval = $withval"
1486 if test "x$withval" = "xyes"
1488 with_libnetlink="yes"
1489 else if test "x$withval" = "xno"
1491 with_libnetlink="no"
1493 if test -d "$withval/include"
1495 with_libnetlink_cflags="-I$withval/include"
1496 with_libnetlink_libs="-L$withval/lib -lnetlink"
1497 with_libnetlink="yes"
1499 AC_MSG_ERROR("no such directory: $withval/include")
1504 if test "x$ac_system" = "xLinux"
1506 with_libnetlink="yes"
1508 with_libnetlink="no (Linux only library)"
1511 if test "x$with_libnetlink" = "xyes"
1514 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1516 with_libnetlink="no (libnetlink.h not found)"
1518 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1520 with_libnetlink="yes"
1524 #include <sys/types.h>
1525 #include <asm/types.h>
1526 #include <sys/socket.h>
1527 #include <linux/netlink.h>
1528 #include <linux/rtnetlink.h>])
1529 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1531 #include <sys/types.h>
1532 #include <asm/types.h>
1533 #include <sys/socket.h>])
1537 #include <sys/types.h>
1538 #include <asm/types.h>
1539 #include <sys/socket.h>
1540 #include <linux/netlink.h>
1541 #include <linux/rtnetlink.h>
1545 int retval = TCA_STATS2;
1548 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1553 #include <sys/types.h>
1554 #include <asm/types.h>
1555 #include <sys/socket.h>
1556 #include <linux/netlink.h>
1557 #include <linux/rtnetlink.h>
1561 int retval = TCA_STATS;
1564 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1567 CFLAGS="$SAVE_CFLAGS"
1569 if test "x$with_libnetlink" = "xyes"
1571 AC_CHECK_LIB(netlink, rtnl_open,
1572 [with_libnetlink="yes"],
1573 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1574 [$with_libnetlink_libs])
1576 if test "x$with_libnetlink" = "xyes"
1578 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1579 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1580 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1581 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1583 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1585 # Check for enabled/disabled features
1588 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1589 # ------------------------------------------------------------
1591 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1596 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1601 m4_define([EnDis],[disabled])dnl
1602 m4_define([YesNo],[no])dnl
1608 m4_define([EnDis],[enabled])dnl
1609 m4_define([YesNo],[yes])dnl
1612 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1616 m4_if([$3], [feature], [],
1620 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1626 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1628 enable_$1='[YesNo]'dnl
1630 if test "x$enable_$1" = "xno"
1634 if test "x$enable_$1" = "xyes"
1638 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1643 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1644 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1646 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1648 # AC_PLUGIN(name, default, info)
1649 # ------------------------------------------------------------
1655 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1657 if test "x$enableval" = "xyes"
1665 if test "x$2" = "xyes"
1672 if test "x$enable_plugin" = "xyes"
1674 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1676 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1677 enable_$1="$enable_plugin"
1679 )# AC_PLUGIN(name, default, info)
1681 m4_divert_once([HELP_ENABLE], [
1682 collectd features:])
1683 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1684 AC_COLLECTD([debug], [enable], [feature], [debugging])
1685 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1686 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1694 plugin_interface="no"
1699 plugin_multimeter="no"
1701 plugin_processes="no"
1705 plugin_tcpconns="no"
1708 plugin_wireless="no"
1711 if test "x$ac_system" = "xLinux"
1713 plugin_battery="yes"
1715 plugin_cpufreq="yes"
1717 plugin_entropy="yes"
1718 plugin_interface="yes"
1723 plugin_processes="yes"
1726 plugin_tcpconns="yes"
1727 plugin_vserver="yes"
1728 plugin_wireless="yes"
1730 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
1737 if test "x$with_libiokit" = "xyes"
1739 plugin_battery="yes"
1744 if test "x$with_devinfo$with_kstat" = "xyesyes"
1748 plugin_interface="yes"
1755 if test "x$with_libstatgrab" = "xyes"
1757 plugin_interface="yes"
1763 if test "x$have_processor_info" = "xyes"
1767 if test "x$have_sysctlbyname" = "xyes"
1771 plugin_tcpconns="yes"
1774 if test "x$have_statfs" = "xyes"
1778 if test "x$have_statvfs" = "xyes"
1783 if test "x$have_getifaddrs" = "xyes"
1785 plugin_interface="yes"
1788 if test "x$have_getloadavg" = "xyes"
1793 # Mac OS X memory interface
1794 if test "x$have_host_statistics" = "xyes"
1799 if test "x$have_termios_h" = "xyes"
1801 plugin_multimeter="yes"
1804 if test "x$have_thread_info" = "xyes"
1806 plugin_processes="yes"
1809 if test "x$with_libkvm" = "xyes"
1814 if test "x$have_getutent" = "xyes"
1818 if test "x$have_getutxent" = "xyes"
1823 # FIXME: sysctl for swap plugin
1825 m4_divert_once([HELP_ENABLE], [
1828 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
1829 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
1830 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
1831 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
1832 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
1833 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
1834 AC_PLUGIN([csv], [yes], [CSV output plugin])
1835 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
1836 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
1837 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
1838 AC_PLUGIN([email], [yes], [EMail statistics])
1839 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
1840 AC_PLUGIN([exec], [yes], [Execution of external programs])
1841 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
1842 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
1843 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
1844 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
1845 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
1846 AC_PLUGIN([load], [$plugin_load], [System load])
1847 AC_PLUGIN([logfile], [yes], [File logging plugin])
1848 AC_PLUGIN([mbmon], [yes], [Query mbmond])
1849 AC_PLUGIN([memcached], [yes], [memcached statistics])
1850 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
1851 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
1852 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
1853 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
1854 AC_PLUGIN([network], [yes], [Network communication plugin])
1855 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
1856 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
1857 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
1858 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
1859 AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter])
1860 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
1861 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
1862 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
1863 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
1864 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
1865 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
1866 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
1867 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
1868 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
1869 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
1870 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
1871 AC_PLUGIN([users], [$plugin_users], [User statistics])
1872 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
1873 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
1874 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
1877 if test "x$ac_system" = "xLinux" -a "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
1879 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
1883 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
1885 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1887 PERL_BINDINGS_OPTIONS="$withval"
1888 with_perl_bindings="yes"
1892 PERL_BINDINGS_OPTIONS=""
1893 with_perl_bindings="yes"
1895 if test "x$with_perl_bindings" = "xyes"
1897 PERL_BINDINGS="perl"
1901 AC_SUBST(PERL_BINDINGS)
1902 AC_SUBST(PERL_BINDINGS_OPTIONS)
1904 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
1906 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1908 with_liboping="yes (shipped version)"
1911 if test "x$with_libperl" = "xyes"
1913 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
1915 enable_perl="no (needs libperl)"
1918 if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x"
1920 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
1927 libcurl . . . . . . $with_libcurl
1928 libiokit . . . . . $with_libiokit
1929 libiptc . . . . . . $with_libiptc
1930 libkstat . . . . . $with_kstat
1931 libkvm . . . . . . $with_libkvm
1932 libmysql . . . . . $with_libmysql
1933 libnetlink . . . . $with_libnetlink
1934 libnetsnmp . . . . $with_libnetsnmp
1935 liboconfig . . . . $with_liboconfig
1936 liboping . . . . . $with_liboping
1937 libpcap . . . . . . $with_libpcap
1938 libperl . . . . . . $with_libperl
1939 libpthread . . . . $with_libpthread
1940 librrd . . . . . . $with_rrdtool
1941 libsensors . . . . $with_lm_sensors
1942 libstatgrab . . . . $with_libstatgrab
1943 libupsclient . . . $with_libupsclient
1944 libxmms . . . . . . $with_libxmms
1947 daemon mode . . . . $enable_daemon
1948 debug . . . . . . . $enable_debug
1951 perl . . . . . . . $with_perl_bindings
1954 apache . . . . . . $enable_apache
1955 apcups . . . . . . $enable_apcups
1956 apple_sensors . . . $enable_apple_sensors
1957 battery . . . . . . $enable_battery
1958 cpu . . . . . . . . $enable_cpu
1959 cpufreq . . . . . . $enable_cpufreq
1960 csv . . . . . . . . $enable_csv
1961 df . . . . . . . . $enable_df
1962 disk . . . . . . . $enable_disk
1963 dns . . . . . . . . $enable_dns
1964 email . . . . . . . $enable_email
1965 entropy . . . . . . $enable_entropy
1966 exec . . . . . . . $enable_exec
1967 hddtemp . . . . . . $enable_hddtemp
1968 interface . . . . . $enable_interface
1969 iptables . . . . . $enable_iptables
1970 ipvs . . . . . . . $enable_ipvs
1971 irq . . . . . . . . $enable_irq
1972 load . . . . . . . $enable_load
1973 logfile . . . . . . $enable_logfile
1974 mbmon . . . . . . . $enable_mbmon
1975 memcached . . . . . $enable_memcached
1976 memory . . . . . . $enable_memory
1977 multimeter . . . . $enable_multimeter
1978 mysql . . . . . . . $enable_mysql
1979 netlink . . . . . . $enable_netlink
1980 network . . . . . . $enable_network
1981 nfs . . . . . . . . $enable_nfs
1982 nginx . . . . . . . $enable_nginx
1983 ntpd . . . . . . . $enable_ntpd
1984 nut . . . . . . . . $enable_nut
1985 perl . . . . . . . $enable_perl
1986 ping . . . . . . . $enable_ping
1987 processes . . . . . $enable_processes
1988 rrdtool . . . . . . $enable_rrdtool
1989 sensors . . . . . . $enable_sensors
1990 serial . . . . . . $enable_serial
1991 snmp . . . . . . . $enable_snmp
1992 swap . . . . . . . $enable_swap
1993 syslog . . . . . . $enable_syslog
1994 tape . . . . . . . $enable_tape
1995 tcpconns . . . . . $enable_tcpconns
1996 unixsock . . . . . $enable_unixsock
1997 users . . . . . . . $enable_users
1998 vserver . . . . . . $enable_vserver
1999 wireless . . . . . $enable_wireless
2000 xmms . . . . . . . $enable_xmms