1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
8 AC_PREFIX_DEFAULT("/opt/collectd")
13 # Checks for programs.
20 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
24 AC_LIBLTDL_CONVENIENCE
31 AC_CONFIG_SUBDIRS(libltdl)
33 AC_MSG_CHECKING([for kernel type ($host_os)])
36 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
40 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
49 AC_MSG_RESULT([$ac_system])
52 # Checks for header files.
58 AC_CHECK_HEADERS(stdint.h stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h)
61 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
66 # include <sys/types.h>
69 AC_CHECK_HEADERS(netinet/in.h, [], [],
74 # include <sys/types.h>
76 #if HAVE_NETINET_IN_SYSTM_H
77 # include <netinet/in_systm.h>
80 AC_CHECK_HEADERS(netinet/ip.h, [], [],
85 # include <sys/types.h>
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
91 # include <netinet/in.h>
94 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
99 # include <sys/types.h>
101 #if HAVE_NETINET_IN_SYSTM_H
102 # include <netinet/in_systm.h>
104 #if HAVE_NETINET_IN_H
105 # include <netinet/in.h>
107 #if HAVE_NETINET_IP_H
108 # include <netinet/ip.h>
111 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
116 # include <sys/types.h>
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
124 #if HAVE_NETINET_IP_H
125 # include <netinet/ip.h>
128 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
133 # include <sys/types.h>
135 #if HAVE_NETINET_IN_SYSTM_H
136 # include <netinet/in_systm.h>
138 #if HAVE_NETINET_IN_H
139 # include <netinet/in.h>
142 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
147 # include <sys/types.h>
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
152 #if HAVE_NETINET_IN_H
153 # include <netinet/in.h>
155 #if HAVE_NETINET_IP6_H
156 # include <netinet/ip6.h>
159 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
164 # include <sys/types.h>
166 #if HAVE_NETINET_IN_SYSTM_H
167 # include <netinet/in_systm.h>
169 #if HAVE_NETINET_IN_H
170 # include <netinet/in.h>
172 #if HAVE_NETINET_IP_H
173 # include <netinet/ip.h>
176 AC_CHECK_HEADERS(netinet/udp.h, [], [],
181 # include <sys/types.h>
183 #if HAVE_NETINET_IN_SYSTM_H
184 # include <netinet/in_systm.h>
186 #if HAVE_NETINET_IN_H
187 # include <netinet/in.h>
189 #if HAVE_NETINET_IP_H
190 # include <netinet/ip.h>
195 AC_CHECK_HEADERS(sys/dkstat.h)
196 if test "x$ac_system" = "xDarwin"
198 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
199 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
201 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
204 # include <sys/types.h>
207 # include <sys/param.h>
212 AC_CHECK_HEADERS(linux/major.h libgen.h)
214 # For the battery plugin
215 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
217 #if HAVE_IOKIT_IOKITLIB_H
218 # include <IOKit/IOKitLib.h>
220 #if HAVE_IOKIT_IOTYPES_H
221 # include <IOKit/IOTypes.h>
225 # For the swap module
226 AC_CHECK_HEADERS(sys/swap.h, [], [],
229 # include <sys/types.h>
232 # include <sys/param.h>
237 # For the processes plugin
239 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
241 # For interface plugin
242 AC_CHECK_HEADERS(ifaddrs.h)
243 AC_CHECK_HEADERS(net/if.h, [], [],
246 # include <sys/types.h>
248 #if HAVE_SYS_SOCKET_H
249 # include <sys/socket.h>
252 AC_CHECK_HEADERS(linux/if.h, [], [],
255 # include <sys/types.h>
257 #if HAVE_SYS_SOCKET_H
258 # include <sys/socket.h>
261 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
264 # include <sys/types.h>
266 #if HAVE_SYS_SOCKET_H
267 # include <sys/socket.h>
270 # include <linux/if.h>
275 have_net_ip_vs_h="no"
277 if test "x$ac_system" = "xLinux"
279 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
280 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
284 AC_CHECK_HEADERS(sys/ucred.h, [], [],
287 # include <sys/types.h>
290 # include <sys/param.h>
294 # For mount interface
295 AC_CHECK_HEADERS(sys/mount.h, [], [],
298 # include <sys/types.h>
301 # include <sys/param.h>
305 # For the email plugin
306 AC_CHECK_HEADERS(linux/un.h, [], [],
308 #if HAVE_SYS_SOCKET_H
309 # include <sys/socket.h>
313 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h)
316 AC_CHECK_HEADERS(arpa/nameser.h)
317 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
319 #if HAVE_ARPA_NAMESER_H
320 # include <arpa/nameser.h>
324 AC_CHECK_HEADERS(net/if_arp.h, [], [],
325 [#if HAVE_SYS_SOCKET_H
326 # include <sys/socket.h>
329 AC_CHECK_HEADERS(net/ppp_defs.h)
330 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
331 [#if HAVE_NET_PPP_DEFS_H
332 # include <net/ppp_defs.h>
335 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
340 # include <sys/types.h>
342 #if HAVE_SYS_SOCKET_H
343 # include <sys/socket.h>
348 #if HAVE_NETINET_IN_H
349 # include <netinet/in.h>
353 # For the multimeter plugin
355 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
358 # Checks for typedefs, structures, and compiler characteristics.
367 # Checks for library functions.
369 AC_PROG_GCC_TRADITIONAL
370 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
374 AC_CHECK_FUNCS(getpwnam_r)
375 AC_CHECK_FUNCS(getgrnam_r)
377 socket_needs_socket="no"
378 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
379 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
381 nanosleep_needs_rt="no"
382 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
383 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
385 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
387 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
388 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
389 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
390 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
391 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
392 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
393 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
394 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
395 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
396 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
399 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
402 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
404 if test "x$withval" = "xno"; then
406 else if test "x$withval" = "xyes"; then
413 if test "x$nan_type" = "xnone"; then
414 AC_CACHE_CHECK([whether NAN is defined by default],
421 static float foo = NAN;
429 [have_nan_default="yes"],
430 [have_nan_default="no"]
433 if test "x$have_nan_default" = "xyes"
438 if test "x$nan_type" = "xnone"; then
439 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
445 #define __USE_ISOC99 1
447 static float foo = NAN;
455 [have_nan_isoc="yes"],
459 if test "x$have_nan_isoc" = "xyes"
464 if test "x$nan_type" = "xnone"; then
465 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
475 #define NAN (0.0 / 0.0)
477 # define isnan(f) ((f) != (f))
479 static float foo = NAN;
487 [have_nan_zero="yes"],
491 if test "x$have_nan_zero" = "xyes"
497 if test "x$nan_type" = "xdefault"; then
498 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
499 [Define if NAN is defined by default and can initialize static variables.])
500 else if test "x$nan_type" = "xisoc99"; then
501 AC_DEFINE(NAN_STATIC_ISOC, 1,
502 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
503 else if test "x$nan_type" = "xzero"; then
504 AC_DEFINE(NAN_ZERO_ZERO, 1,
505 [Define if NAN can be defined as (0.0 / 0.0)])
507 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
510 # For mount interface
511 #AC_CHECK_FUNCS(getfsent getvfsent)
514 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
516 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
518 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
521 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
522 if test "x$have_getmntent" = "xno"; then
523 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
525 if test "x$have_getmntent" = "xno"; then
526 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
528 if test "x$have_getmntent" = "xno"; then
529 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
532 if test "x$have_getmntent" = "xc"; then
533 AC_CACHE_CHECK([whether getmntent takes one argument],
534 [have_one_getmntent],
536 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
538 #include "$srcdir/src/utils_mount.h"]],
542 fh = setmntent ("/etc/mtab", "r");
546 [have_one_getmntent="yes"],
547 [have_one_getmntent="no"]
550 AC_CACHE_CHECK([whether getmntent takes two arguments],
551 [have_two_getmntent],
553 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
554 #include <sys/mnttab.h>
555 #include "$srcdir/src/utils_mount.h"]],
560 fh = fopen ("/etc/mnttab", "r");
561 status = getmntent (fh, &mt);
564 [have_two_getmntent="yes"],
565 [have_two_getmntent="no"]
570 # Check for different versions of `getmntent' here..
572 if test "x$have_getmntent" = "xc"; then
573 if test "x$have_one_getmntent" = "xyes"; then
574 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
575 [Define if the function getmntent exists and takes one argument.])
577 if test "x$have_two_getmntent" = "xyes"; then
578 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
579 [Define if the function getmntent exists and takes two arguments.])
582 if test "x$have_getmntent" = "xsun"; then
583 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
584 [Define if the function getmntent exists. It's the version from libsun.])
586 if test "x$have_getmntent" = "xseq"; then
587 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
588 [Define if the function getmntent exists. It's the version from libseq.])
590 if test "x$have_getmntent" = "xgen"; then
591 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
592 [Define if the function getmntent exists. It's the version from libgen.])
595 # Check for structures
596 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
597 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
600 #include <sys/types.h>
601 #include <sys/socket.h>
604 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
605 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
608 #include <sys/types.h>
609 #include <sys/socket.h>
610 #include <linux/if.h>
611 #include <linux/netdevice.h>
614 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
619 # include <sys/types.h>
621 #if HAVE_NETINET_IN_SYSTM_H
622 # include <netinet/in_systm.h>
624 #if HAVE_NETINET_IN_H
625 # include <netinet/in.h>
627 #if HAVE_NETINET_IP_H
628 # include <netinet/ip.h>
630 #if HAVE_NETINET_UDP_H
631 # include <netinet/udp.h>
634 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
639 # include <sys/types.h>
641 #if HAVE_NETINET_IN_SYSTM_H
642 # include <netinet/in_systm.h>
644 #if HAVE_NETINET_IN_H
645 # include <netinet/in.h>
647 #if HAVE_NETINET_IP_H
648 # include <netinet/ip.h>
650 #if HAVE_NETINET_UDP_H
651 # include <netinet/udp.h>
655 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
665 AC_CHECK_LIB(resolv, res_search,
667 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
669 [with_libresolv="no"])
670 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
673 m4_divert_once([HELP_WITH], [
674 collectd additional packages:])
676 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
679 librrd_threadsafe="yes"
680 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
681 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
683 librrd_cflags="-I$withval/include"
684 librrd_ldflags="-L$withval/lib"
687 ], [with_rrdtool="yes"])
688 if test "x$with_rrdtool" = "xyes"
690 SAVE_CPPFLAGS="$CPPFLAGS"
691 SAVE_LDFLAGS="$LDFLAGS"
693 CPPFLAGS="$CPPFLAGS $librrd_cflags"
694 LDFLAGS="$LDFLAGS $librrd_ldflags"
696 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
698 CPPFLAGS="$SAVE_CPPFLAGS"
699 LDFLAGS="$SAVE_LDFLAGS"
701 if test "x$with_rrdtool" = "xyes"
703 SAVE_CPPFLAGS="$CPPFLAGS"
704 SAVE_LDFLAGS="$LDFLAGS"
706 CPPFLAGS="$CPPFLAGS $librrd_cflags"
707 LDFLAGS="$LDFLAGS $librrd_ldflags"
709 AC_CHECK_LIB(rrd_th, rrd_update_r,
711 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
713 [librrd_threadsafe="no"
714 AC_CHECK_LIB(rrd, rrd_update,
716 librrd_ldflags="$librrd_ldflags -lrrd -lm"
718 [with_rrdtool="no (symbol 'rrd_update' not found)"],
723 CPPFLAGS="$SAVE_CPPFLAGS"
724 LDFLAGS="$SAVE_LDFLAGS"
726 if test "x$with_rrdtool" = "xyes"
728 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
729 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
730 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
731 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
733 if test "x$librrd_threadsafe" = "xyes"
735 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
738 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
739 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
741 LDFLAGS="$LDFLAGS -L$withval/lib"
742 CPPFLAGS="$CPPFLAGS -I$withval/include"
743 with_libpthread="yes"
745 if test "x$withval" = "xno"
747 with_libpthread="no (disabled)"
750 ], [with_libpthread="yes"])
751 if test "x$with_libpthread" = "xyes"
753 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
755 if test "x$with_libpthread" = "xyes"
757 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
759 if test "x$with_libpthread" = "xyes"
765 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
766 [Wether or not to use pthread (POSIX threads) library])
767 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
769 if test "x$ac_system" = "xSolaris"
774 with_kstat="no (Solaris only)"
775 with_devinfo="no (Solaris only)"
778 if test "x$with_kstat" = "xyes"
780 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
782 if test "x$with_kstat" = "xyes"
784 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
785 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
787 if test "x$with_kstat" = "xyes"
789 AC_DEFINE(HAVE_LIBKSTAT, 1,
790 [Define to 1 if you have the 'kstat' library (-lkstat)])
792 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
793 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
795 ### BEGIN of check for libcurl ###
796 with_curl_config="curl-config"
799 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
801 if test "x$withval" = "xno"
804 else if test "x$withval" = "xyes"
808 if test -f "$withval" && test -x "$withval"
810 with_curl_config="$withval"
812 else if test -x "$withval/bin/curl-config"
814 with_curl_config="$withval/bin/curl-config"
823 if test "x$with_libcurl" = "xyes"
825 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
826 curl_config_status=$?
828 if test $curl_config_status -ne 0
830 with_libcurl="no ($with_curl_config failed)"
833 CFLAGS="$CFLAGS $with_curl_cflags"
835 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
837 CFLAGS="$SAVE_CFLAGS"
840 if test "x$with_libcurl" = "xyes"
842 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
843 curl_config_status=$?
845 if test $curl_config_status -ne 0
847 with_libcurl="no ($with_curl_config failed)"
849 AC_CHECK_LIB(curl, curl_easy_init,
850 [with_libcurl="yes"],
851 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
855 if test "x$with_libcurl" = "xyes"
857 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
858 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
859 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
860 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
862 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
863 ### END of check for libcurl ###
867 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
876 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
877 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
879 with_libstatgrab="yes"
881 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
883 if test "x$withval" != "xno" -a "x$withval" != "xyes"
885 LDFLAGS="$LDFLAGS -L$withval/lib"
886 CPPFLAGS="$CPPFLAGS -I$withval/include"
887 with_libstatgrab="yes"
891 if test "x$ac_system" == "xunknown"
893 with_libstatgrab="yes"
895 with_libstatgrab="no"
898 if test "x$with_libstatgrab" = "xyes"
900 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
902 if test "x$with_libstatgrab" = "xyes"
904 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
906 if test "x$with_libstatgrab" = "xyes"
908 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
910 if test "x$with_libstatgrab" = "xyes"
912 collect_libstatgrab=1
914 collect_libstatgrab=0
916 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
917 [Wether or not to use statgrab library])
918 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
919 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
921 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
922 if test "x$with_libkvm" = "xyes"
924 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
926 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
928 with_sensors_cflags=""
929 with_sensors_ldflags=""
930 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
932 if test "x$withval" = "xno"
936 with_lm_sensors="yes"
937 if test "x$withval" != "xyes"
939 with_sensors_cflags="-I$withval/include"
940 with_sensors_ldflags="-L$withval/lib"
941 with_lm_sensors="yes"
946 if test "x$ac_system" = "xLinux"
948 with_lm_sensors="yes"
950 with_lm_sensors="no (Linux only library)"
953 if test "x$with_lm_sensors" = "xyes"
955 SAVE_CPPFLAGS="$CPPFLAGS"
956 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
958 # AC_CHECK_HEADERS(sensors/sensors.h,
960 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
962 # [with_lm_sensors="no (sensors/sensors.h not found)"])
963 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_lm_sensors="no (sensors/sensors.h not found)"])
965 CPPFLAGS="$SAVE_CPPFLAGS"
967 if test "x$with_lm_sensors" = "xyes"
969 SAVE_CPPFLAGS="$CPPFLAGS"
970 SAVE_LDFLAGS="$LDFLAGS"
971 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
972 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
974 AC_CHECK_LIB(sensors, sensors_init,
976 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
978 [with_lm_sensors="no (libsensors not found)"])
980 CPPFLAGS="$SAVE_CPPFLAGS"
981 LDFLAGS="$SAVE_LDFLAGS"
983 if test "x$with_lm_sensors" = "xyes"
985 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
986 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
987 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
988 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
990 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
992 with_mysql_config="mysql_config"
995 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
997 if test "x$withval" = "xno"
1000 else if test "x$withval" = "xyes"
1004 if test -f "$withval" && test -x "$withval";
1006 with_mysql_config="$withval"
1007 else if test -x "$withval/bin/mysql_config"
1009 with_mysql_config="$withval/bin/mysql_config"
1017 if test "x$with_libmysql" = "xyes"
1019 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1020 mysql_config_status=$?
1022 if test $mysql_config_status -ne 0
1027 CFLAGS="$CFLAGS $with_mysql_cflags"
1029 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
1031 CFLAGS="$SAVE_CFLAGS"
1034 if test "x$with_libmysql" = "xyes"
1036 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1037 mysql_config_status=$?
1039 if test $mysql_config_status -ne 0
1043 AC_CHECK_LIB(mysqlclient, mysql_init,
1044 [with_libmysql="yes"],
1045 [with_libmysql="no (symbol 'mysql_init' not found)"],
1049 if test "x$with_libmysql" = "xyes"
1051 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1052 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1053 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1054 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1056 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1058 with_own_liboconfig="no"
1059 liboconfig_LDFLAGS="$LDFLAGS"
1060 liboconfig_CPPFLAGS="$CPPFLAGS"
1061 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1063 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1065 if test -d "$withval/lib"
1067 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1069 if test -d "$withval/include"
1071 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1074 if test "x$withval" = "xno"
1076 AC_MSG_ERROR("liboconfig is required")
1080 with_liboconfig="yes"
1083 save_LDFLAGS="$LDFLAGS"
1084 save_CPPFLAGS="$CPPFLAGS"
1085 LDFLAGS="$liboconfig_LDFLAGS"
1086 CPPFLAGS="$liboconfig_CPPFLAGS"
1087 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1089 with_liboconfig="yes"
1090 with_own_liboconfig="no"
1093 with_liboconfig="yes"
1094 with_own_liboconfig="yes"
1095 LDFLAGS="$save_LDFLAGS"
1096 CPPFLAGS="$save_CPPFLAGS"
1099 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1100 if test "x$with_own_liboconfig" = "xyes"
1102 with_liboconfig="yes (shipped version)"
1105 #with_liboping="yes"
1106 with_own_liboping="no"
1107 liboping_LDFLAGS="$LDFLAGS"
1108 liboping_CPPFLAGS="$CPPFLAGS"
1109 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1111 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1113 if test -d "$withval/lib"
1115 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1117 if test -d "$withval/include"
1119 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1122 if test "x$withval" = "xno"
1125 with_own_liboping="no"
1132 if test "x$with_liboping" = "xyes"
1134 save_LDFLAGS="$LDFLAGS"
1135 save_CPPFLAGS="$CPPFLAGS"
1136 LDFLAGS="$liboping_LDFLAGS"
1137 CPPFLAGS="$liboping_CPPFLAGS"
1138 AC_CHECK_LIB(oping, ping_construct,
1141 with_own_liboping="no"
1145 with_own_liboping="yes"
1146 LDFLAGS="$save_LDFLAGS"
1147 CPPFLAGS="$save_CPPFLAGS"
1150 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1151 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1153 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1155 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1157 LDFLAGS="$LDFLAGS -L$withval/lib"
1158 CPPFLAGS="$CPPFLAGS -I$withval/include"
1165 if test "x$with_libpcap" = "xyes"
1167 AC_CHECK_LIB(pcap, pcap_open_live,
1169 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1170 ], [with_libpcap="no (libpcap not found)"])
1172 if test "x$with_libpcap" = "xyes"
1174 AC_CHECK_HEADERS(pcap.h,
1176 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1177 ], [with_libpcap="no (pcap.h not found)"])
1179 if test "x$with_libpcap" = "xyes"
1185 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1186 [Wether or not to use the pcap library])
1187 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1189 perl_interpreter="perl"
1190 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1192 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1194 LDFLAGS="$LDFLAGS -L$withval/lib"
1195 CPPFLAGS="$CPPFLAGS -I$withval/include"
1196 perl_interpreter="$withval/bin/perl"
1204 AC_SUBST(PERL, "$perl_interpreter")
1206 if test "x$with_libperl" = "xyes"
1209 SAVE_LDFLAGS=$LDFLAGS
1210 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1211 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1212 CFLAGS="$CFLAGS $PERL_CFLAGS"
1213 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1215 AC_CACHE_CHECK([for libperl],
1225 PerlInterpreter *perl = NULL;
1226 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1227 newSVpv ("Collectd::Plugin::FooBar", 24),
1230 [have_libperl="yes"],
1235 if test "x$have_libperl" = "xyes"
1237 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1238 AC_SUBST(PERL_CFLAGS)
1239 AC_SUBST(PERL_LDFLAGS)
1245 LDFLAGS=$SAVE_LDFLAGS
1247 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1249 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1251 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1253 LDFLAGS="$LDFLAGS -L$withval/lib"
1254 CPPFLAGS="$CPPFLAGS -I$withval/include"
1259 if test "x$ac_system" = "xLinux"
1263 with_libiptc="no (Linux only)"
1266 if test "x$with_libiptc" = "xyes"
1268 AC_CHECK_LIB(iptc, iptc_init,
1270 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1271 ], [with_libiptc="no (libiptc not found)"])
1273 if test "x$with_libiptc" = "xyes"
1275 AC_CHECK_HEADERS(libiptc/libiptc.h,
1277 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1278 ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1280 if test "x$with_libiptc" = "xyes"
1286 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1288 with_snmp_config="net-snmp-config"
1291 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1293 if test "x$withval" = "xno"
1295 with_libnetsnmp="no"
1296 else if test "x$withval" = "xyes"
1298 with_libnetsnmp="yes"
1300 if test -x "$withval"
1302 with_snmp_config="$withval"
1303 with_libnetsnmp="yes"
1305 with_snmp_config="$withval/bin/net-snmp-config"
1306 with_libnetsnmp="yes"
1310 [with_libnetsnmp="yes"])
1311 if test "x$with_libnetsnmp" = "xyes"
1313 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1314 snmp_config_status=$?
1316 if test $snmp_config_status -ne 0
1318 with_libnetsnmp="no ($with_snmp_config failed)"
1321 CFLAGS="$CFLAGS $with_snmp_cflags"
1323 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1325 CFLAGS="$SAVE_CFLAGS"
1328 if test "x$with_libnetsnmp" = "xyes"
1330 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1331 snmp_config_status=$?
1333 if test $snmp_config_status -ne 0
1335 with_libnetsnmp="no ($with_snmp_config failed)"
1337 AC_CHECK_LIB(netsnmp, init_snmp,
1338 [with_libnetsnmp="yes"],
1339 [with_libnetsnmp="no (libnetsnmp not found)"],
1343 if test "x$with_libnetsnmp" = "xyes"
1345 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1346 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1347 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1348 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1350 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1352 with_upsclient_config="libupsclient-config"
1353 with_upsclient_cflags=""
1354 with_upsclient_libs=""
1355 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1357 if test "x$withval" = "xno"
1359 with_libupsclient="no"
1361 if test "x$withval" != "xyes"
1363 if test -f "$withval" && test -x "$withval";
1365 with_upsclient_config="$withval"
1367 with_upsclient_config="$withval/bin/libupsclient-config"
1370 with_libupsclient="yes"
1374 with_libupsclient="yes"
1376 if test "x$with_libupsclient" = "xyes"
1378 with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1379 upsclient_config_status=$?
1381 if test $upsclient_config_status -ne 0
1383 with_libupsclient="no ($with_upsclient_config failed)"
1386 if test "x$with_libupsclient" = "xyes"
1388 SAVE_CFLAGS="$CFLAGS"
1389 CFLAGS="$CFLAGS $with_upsclient_cflags"
1391 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1393 CFLAGS="$SAVE_CFLAGS"
1395 if test "x$with_libupsclient" = "xyes"
1397 with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1398 upsclient_config_status=$?
1400 if test $upsclient_config_status -ne 0
1402 with_libupsclient="no ($with_upsclient_config failed)"
1405 if test "x$with_libupsclient" = "xyes"
1407 AC_CHECK_LIB(upsclient, upscli_connect,
1409 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1410 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1411 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1412 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1415 with_libupsclient="no (symbol 'upscli_connect' not found)"
1416 ], [$with_upsclient_libs])
1418 if test "x$with_libupsclient" = "xyes"
1420 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1421 [#include <stdlib.h>
1423 #include <upsclient.h>])
1425 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1427 ### BEGIN of check for libxmms ###
1428 with_xmms_config="xmms-config"
1431 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1433 if test "x$withval" != "xno" -a "x$withval" != "xyes"
1435 if test -f "$withval" && test -x "$withval";
1437 with_xmms_config="$withval"
1438 else if test -x "$withval/bin/xmms-config"
1440 with_xmms_config="$withval/bin/xmms-config"
1443 else if test "x$withval" = "xno"
1453 if test "x$with_libxmms" = "xyes"
1455 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1456 xmms_config_status=$?
1458 if test $xmms_config_status -ne 0
1463 if test "x$with_libxmms" = "xyes"
1465 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1466 xmms_config_status=$?
1468 if test $xmms_config_status -ne 0
1473 if test "x$with_libxmms" = "xyes"
1475 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1477 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1478 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1479 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1480 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1487 with_libxmms_numeric=0
1488 if test "x$with_libxmms" = "xyes"
1490 with_libxmms_numeric=1
1492 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1493 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1494 ### END of check for libxmms ###
1496 with_libnetlink_cflags=""
1497 with_libnetlink_libs="-lnetlink"
1498 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1500 echo "libnetlink: withval = $withval"
1501 if test "x$withval" = "xyes"
1503 with_libnetlink="yes"
1504 else if test "x$withval" = "xno"
1506 with_libnetlink="no"
1508 if test -d "$withval/include"
1510 with_libnetlink_cflags="-I$withval/include"
1511 with_libnetlink_libs="-L$withval/lib -lnetlink"
1512 with_libnetlink="yes"
1514 AC_MSG_ERROR("no such directory: $withval/include")
1519 if test "x$ac_system" = "xLinux"
1521 with_libnetlink="yes"
1523 with_libnetlink="no (Linux only library)"
1526 if test "x$with_libnetlink" = "xyes"
1529 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1531 with_libnetlink="no (libnetlink.h not found)"
1533 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1535 with_libnetlink="yes"
1539 #include <sys/types.h>
1540 #include <asm/types.h>
1541 #include <sys/socket.h>
1542 #include <linux/netlink.h>
1543 #include <linux/rtnetlink.h>])
1544 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1546 #include <sys/types.h>
1547 #include <asm/types.h>
1548 #include <sys/socket.h>])
1552 #include <sys/types.h>
1553 #include <asm/types.h>
1554 #include <sys/socket.h>
1555 #include <linux/netlink.h>
1556 #include <linux/rtnetlink.h>
1560 int retval = TCA_STATS2;
1563 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1568 #include <sys/types.h>
1569 #include <asm/types.h>
1570 #include <sys/socket.h>
1571 #include <linux/netlink.h>
1572 #include <linux/rtnetlink.h>
1576 int retval = TCA_STATS;
1579 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1582 CFLAGS="$SAVE_CFLAGS"
1584 if test "x$with_libnetlink" = "xyes"
1586 AC_CHECK_LIB(netlink, rtnl_open,
1587 [with_libnetlink="yes"],
1588 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1589 [$with_libnetlink_libs])
1591 if test "x$with_libnetlink" = "xyes"
1593 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1594 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1595 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1596 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1598 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1600 dnl Check for libvirt and libxml2 libraries.
1601 AC_CHECK_LIB(xml2,xmlXPathEval,
1602 [with_libxml2="yes"],
1603 [with_libxml2="no"])
1606 if test "x$with_libxml2" = "xyes"; then
1607 AC_CHECK_LIB(virt,virDomainBlockStats,
1608 [with_libvirt="yes"],
1609 [with_libvirt="no (symbol virDomainBlockStats not found)"])
1611 dnl Add the right compiler flags and libraries.
1612 if test "x$with_libvirt" = "xyes"; then
1614 if test "x$PKG_CONFIG" != "x"; then
1615 BUILD_WITH_LIBVIRTSTATS_CFLAGS="`pkg-config --cflags libvirt` `pkg-config --cflags libxml-2.0`"
1616 BUILD_WITH_LIBVIRTSTATS_LIBS="`pkg-config --libs libvirt` `pkg-config --libs libxml-2.0`"
1617 AC_SUBST(BUILD_WITH_LIBVIRTSTATS_CFLAGS)
1618 AC_SUBST(BUILD_WITH_LIBVIRTSTATS_LIBS)
1622 dnl End of check for libvirt and libxml2 libraries.
1624 # Check for enabled/disabled features
1627 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1628 # ------------------------------------------------------------
1630 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1635 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1640 m4_define([EnDis],[disabled])dnl
1641 m4_define([YesNo],[no])dnl
1647 m4_define([EnDis],[enabled])dnl
1648 m4_define([YesNo],[yes])dnl
1651 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1655 m4_if([$3], [feature], [],
1659 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1665 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1667 enable_$1='[YesNo]'dnl
1669 if test "x$enable_$1" = "xno"
1673 if test "x$enable_$1" = "xyes"
1677 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1682 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1683 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1685 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1687 # AC_PLUGIN(name, default, info)
1688 # ------------------------------------------------------------
1694 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1696 if test "x$enableval" = "xyes"
1704 if test "x$2" = "xyes"
1711 if test "x$enable_plugin" = "xyes"
1713 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1715 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1716 enable_$1="$enable_plugin"
1718 )# AC_PLUGIN(name, default, info)
1720 m4_divert_once([HELP_ENABLE], [
1721 collectd features:])
1722 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1723 AC_COLLECTD([debug], [enable], [feature], [debugging])
1724 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1725 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1733 plugin_interface="no"
1738 plugin_multimeter="no"
1740 plugin_processes="no"
1744 plugin_tcpconns="no"
1747 plugin_wireless="no"
1750 if test "x$ac_system" = "xLinux"
1752 plugin_battery="yes"
1754 plugin_cpufreq="yes"
1756 plugin_entropy="yes"
1757 plugin_interface="yes"
1762 plugin_processes="yes"
1765 plugin_tcpconns="yes"
1766 plugin_vserver="yes"
1767 plugin_wireless="yes"
1769 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
1776 if test "x$with_libiokit" = "xyes"
1778 plugin_battery="yes"
1783 if test "x$with_devinfo$with_kstat" = "xyesyes"
1787 plugin_interface="yes"
1794 if test "x$with_libstatgrab" = "xyes"
1796 plugin_interface="yes"
1802 if test "x$have_processor_info" = "xyes"
1806 if test "x$have_sysctlbyname" = "xyes"
1810 plugin_tcpconns="yes"
1813 if test "x$have_statfs" = "xyes"
1817 if test "x$have_statvfs" = "xyes"
1822 if test "x$have_getifaddrs" = "xyes"
1824 plugin_interface="yes"
1827 if test "x$have_getloadavg" = "xyes"
1832 # Mac OS X memory interface
1833 if test "x$have_host_statistics" = "xyes"
1838 if test "x$have_termios_h" = "xyes"
1840 plugin_multimeter="yes"
1843 if test "x$have_thread_info" = "xyes"
1845 plugin_processes="yes"
1848 if test "x$with_libkvm" = "xyes"
1853 if test "x$have_getutent" = "xyes"
1857 if test "x$have_getutxent" = "xyes"
1862 # FIXME: sysctl for swap plugin
1864 m4_divert_once([HELP_ENABLE], [
1867 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
1868 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
1869 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
1870 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
1871 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
1872 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
1873 AC_PLUGIN([csv], [yes], [CSV output plugin])
1874 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
1875 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
1876 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
1877 AC_PLUGIN([email], [yes], [EMail statistics])
1878 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
1879 AC_PLUGIN([exec], [yes], [Execution of external programs])
1880 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
1881 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
1882 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
1883 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
1884 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
1885 AC_PLUGIN([libvirtstats],[$with_libvirt], [Virtual machine statistics])
1886 AC_PLUGIN([load], [$plugin_load], [System load])
1887 AC_PLUGIN([logfile], [yes], [File logging plugin])
1888 AC_PLUGIN([mbmon], [yes], [Query mbmond])
1889 AC_PLUGIN([memcached], [yes], [memcached statistics])
1890 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
1891 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
1892 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
1893 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
1894 AC_PLUGIN([network], [yes], [Network communication plugin])
1895 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
1896 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
1897 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
1898 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
1899 AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter])
1900 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
1901 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
1902 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
1903 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
1904 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
1905 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
1906 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
1907 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
1908 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
1909 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
1910 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
1911 AC_PLUGIN([users], [$plugin_users], [User statistics])
1912 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
1913 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
1914 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
1917 if test "x$ac_system" = "xLinux" -a "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
1919 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
1923 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
1925 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1927 PERL_BINDINGS_OPTIONS="$withval"
1928 with_perl_bindings="yes"
1932 PERL_BINDINGS_OPTIONS=""
1933 with_perl_bindings="yes"
1935 if test "x$with_perl_bindings" = "xyes"
1937 PERL_BINDINGS="perl"
1941 AC_SUBST(PERL_BINDINGS)
1942 AC_SUBST(PERL_BINDINGS_OPTIONS)
1944 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
1946 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1948 with_liboping="yes (shipped version)"
1951 if test "x$with_libperl" = "xyes"
1953 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
1955 enable_perl="no (needs libperl)"
1958 if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x"
1960 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
1967 libcurl . . . . . . $with_libcurl
1968 libiokit . . . . . $with_libiokit
1969 libiptc . . . . . . $with_libiptc
1970 libkstat . . . . . $with_kstat
1971 libkvm . . . . . . $with_libkvm
1972 libmysql . . . . . $with_libmysql
1973 libnetlink . . . . $with_libnetlink
1974 libnetsnmp . . . . $with_libnetsnmp
1975 liboconfig . . . . $with_liboconfig
1976 liboping . . . . . $with_liboping
1977 libpcap . . . . . . $with_libpcap
1978 libperl . . . . . . $with_libperl
1979 libpthread . . . . $with_libpthread
1980 librrd . . . . . . $with_rrdtool
1981 libsensors . . . . $with_lm_sensors
1982 libstatgrab . . . . $with_libstatgrab
1983 libupsclient . . . $with_libupsclient
1984 libvirt . . . . . . $with_libvirt
1985 libxml2 . . . . . . $with_libxml2
1986 libxmms . . . . . . $with_libxmms
1989 daemon mode . . . . $enable_daemon
1990 debug . . . . . . . $enable_debug
1993 perl . . . . . . . $with_perl_bindings
1996 apache . . . . . . $enable_apache
1997 apcups . . . . . . $enable_apcups
1998 apple_sensors . . . $enable_apple_sensors
1999 battery . . . . . . $enable_battery
2000 cpu . . . . . . . . $enable_cpu
2001 cpufreq . . . . . . $enable_cpufreq
2002 csv . . . . . . . . $enable_csv
2003 df . . . . . . . . $enable_df
2004 disk . . . . . . . $enable_disk
2005 dns . . . . . . . . $enable_dns
2006 email . . . . . . . $enable_email
2007 entropy . . . . . . $enable_entropy
2008 exec . . . . . . . $enable_exec
2009 hddtemp . . . . . . $enable_hddtemp
2010 interface . . . . . $enable_interface
2011 iptables . . . . . $enable_iptables
2012 ipvs . . . . . . . $enable_ipvs
2013 irq . . . . . . . . $enable_irq
2014 libvirtstats . . . $enable_libvirtstats
2015 load . . . . . . . $enable_load
2016 logfile . . . . . . $enable_logfile
2017 mbmon . . . . . . . $enable_mbmon
2018 memcached . . . . . $enable_memcached
2019 memory . . . . . . $enable_memory
2020 multimeter . . . . $enable_multimeter
2021 mysql . . . . . . . $enable_mysql
2022 netlink . . . . . . $enable_netlink
2023 network . . . . . . $enable_network
2024 nfs . . . . . . . . $enable_nfs
2025 nginx . . . . . . . $enable_nginx
2026 ntpd . . . . . . . $enable_ntpd
2027 nut . . . . . . . . $enable_nut
2028 perl . . . . . . . $enable_perl
2029 ping . . . . . . . $enable_ping
2030 processes . . . . . $enable_processes
2031 rrdtool . . . . . . $enable_rrdtool
2032 sensors . . . . . . $enable_sensors
2033 serial . . . . . . $enable_serial
2034 snmp . . . . . . . $enable_snmp
2035 swap . . . . . . . $enable_swap
2036 syslog . . . . . . $enable_syslog
2037 tape . . . . . . . $enable_tape
2038 tcpconns . . . . . $enable_tcpconns
2039 unixsock . . . . . $enable_unixsock
2040 users . . . . . . . $enable_users
2041 vserver . . . . . . $enable_vserver
2042 wireless . . . . . $enable_wireless
2043 xmms . . . . . . . $enable_xmms