1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 3.11.4)
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
30 AC_CONFIG_SUBDIRS(libltdl)
33 # Checks for header files.
38 AC_CHECK_HEADERS(stdint.h)
39 AC_CHECK_HEADERS(stdio.h)
40 AC_CHECK_HEADERS(errno.h)
41 AC_CHECK_HEADERS(math.h)
42 AC_CHECK_HEADERS(syslog.h)
43 AC_CHECK_HEADERS(fcntl.h)
44 AC_CHECK_HEADERS(signal.h)
45 AC_CHECK_HEADERS(assert.h)
46 AC_CHECK_HEADERS(sys/types.h)
47 AC_CHECK_HEADERS(sys/socket.h)
48 AC_CHECK_HEADERS(sys/select.h)
49 AC_CHECK_HEADERS(sys/poll.h)
50 AC_CHECK_HEADERS(netdb.h)
51 AC_CHECK_HEADERS(arpa/inet.h)
52 AC_CHECK_HEADERS(sys/resource.h)
53 AC_CHECK_HEADERS(sys/param.h)
56 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
61 # include <sys/types.h>
64 AC_CHECK_HEADERS(netinet/in.h, [], [],
69 # include <sys/types.h>
71 #if HAVE_NETINET_IN_SYSTM_H
72 # include <netinet/in_systm.h>
75 AC_CHECK_HEADERS(netinet/ip.h, [], [],
80 # include <sys/types.h>
82 #if HAVE_NETINET_IN_SYSTM_H
83 # include <netinet/in_systm.h>
86 # include <netinet/in.h>
89 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
94 # include <sys/types.h>
96 #if HAVE_NETINET_IN_SYSTM_H
97 # include <netinet/in_systm.h>
100 # include <netinet/in.h>
102 #if HAVE_NETINET_IP_H
103 # include <netinet/ip.h>
106 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
111 # include <sys/types.h>
113 #if HAVE_NETINET_IN_SYSTM_H
114 # include <netinet/in_systm.h>
116 #if HAVE_NETINET_IN_H
117 # include <netinet/in.h>
119 #if HAVE_NETINET_IP_H
120 # include <netinet/ip.h>
123 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
128 # include <sys/types.h>
130 #if HAVE_NETINET_IN_SYSTM_H
131 # include <netinet/in_systm.h>
133 #if HAVE_NETINET_IN_H
134 # include <netinet/in.h>
137 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
142 # include <sys/types.h>
144 #if HAVE_NETINET_IN_SYSTM_H
145 # include <netinet/in_systm.h>
147 #if HAVE_NETINET_IN_H
148 # include <netinet/in.h>
150 #if HAVE_NETINET_IP6_H
151 # include <netinet/ip6.h>
154 AC_CHECK_HEADERS(netinet/udp.h, [], [],
159 # include <sys/types.h>
161 #if HAVE_NETINET_IN_SYSTM_H
162 # include <netinet/in_systm.h>
164 #if HAVE_NETINET_IN_H
165 # include <netinet/in.h>
167 #if HAVE_NETINET_IP_H
168 # include <netinet/ip.h>
173 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
174 AC_CHECK_HEADERS(mach/mach_init.h)
175 AC_CHECK_HEADERS(mach/host_priv.h)
176 AC_CHECK_HEADERS(mach/mach_error.h)
177 AC_CHECK_HEADERS(mach/mach_host.h)
178 AC_CHECK_HEADERS(mach/mach_port.h)
179 AC_CHECK_HEADERS(mach/mach_types.h)
180 AC_CHECK_HEADERS(mach/message.h)
181 AC_CHECK_HEADERS(mach/processor_set.h)
182 AC_CHECK_HEADERS(mach/processor.h)
183 AC_CHECK_HEADERS(mach/processor_info.h)
184 AC_CHECK_HEADERS(mach/task.h)
185 AC_CHECK_HEADERS(mach/thread_act.h)
186 AC_CHECK_HEADERS(mach/vm_region.h)
187 AC_CHECK_HEADERS(mach/vm_map.h)
188 AC_CHECK_HEADERS(mach/vm_prot.h)
189 AC_CHECK_HEADERS(mach/vm_statistics.h)
190 AC_CHECK_HEADERS(mach/kern_return.h)
193 AC_CHECK_HEADERS(linux/major.h)
195 # For the apple_sensors module
196 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
197 AC_CHECK_HEADERS(IOKit/IOKitLib.h)
198 AC_CHECK_HEADERS(IOKit/IOTypes.h)
200 # For the battery plugin
201 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
203 #if HAVE_IOKIT_IOKITLIB_H
204 # include <IOKit/IOKitLib.h>
206 #if HAVE_IOKIT_IOTYPES_H
207 # include <IOKit/IOTypes.h>
210 AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h)
212 # For the `disk' plugin
213 AC_CHECK_HEADERS(IOKit/IOBSD.h)
214 AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
217 AC_CHECK_HEADERS(sys/loadavg.h)
219 # For the processes plugin
220 AC_CHECK_HEADERS(linux/config.h)
222 # For the swap module
223 AC_CHECK_HEADERS(sys/swap.h)
226 AC_CHECK_HEADERS(utmp.h)
227 AC_CHECK_HEADERS(utmpx.h)
230 AC_CHECK_HEADERS(ifaddrs.h)
231 AC_CHECK_HEADERS(net/if.h, [], [],
234 # include <sys/types.h>
236 #if HAVE_SYS_SOCKET_H
237 # include <sys/socket.h>
240 AC_CHECK_HEADERS(linux/if.h, [], [],
243 # include <sys/types.h>
245 #if HAVE_SYS_SOCKET_H
246 # include <sys/socket.h>
249 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
252 # include <sys/types.h>
254 #if HAVE_SYS_SOCKET_H
255 # include <sys/socket.h>
258 # include <linux/if.h>
263 AC_CHECK_HEADERS(curl/curl.h)
266 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
267 AC_CHECK_HEADERS(ctype.h)
268 AC_CHECK_HEADERS(limits.h)
269 AC_CHECK_HEADERS(sys/quota.h)
270 AC_CHECK_HEADERS(xfs/xqm.h)
272 # For mount interface
273 AC_CHECK_HEADERS(fs_info.h)
274 AC_CHECK_HEADERS(fshelp.h)
275 AC_CHECK_HEADERS(paths.h)
276 AC_CHECK_HEADERS(mntent.h)
277 AC_CHECK_HEADERS(mnttab.h)
278 AC_CHECK_HEADERS(sys/fstyp.h)
279 AC_CHECK_HEADERS(sys/fs_types.h)
280 AC_CHECK_HEADERS(sys/mntent.h)
281 AC_CHECK_HEADERS(sys/mnttab.h)
282 AC_CHECK_HEADERS(sys/mount.h)
283 AC_CHECK_HEADERS(sys/statfs.h)
284 AC_CHECK_HEADERS(sys/statvfs.h)
285 AC_CHECK_HEADERS(sys/vfs.h)
286 AC_CHECK_HEADERS(sys/vfstab.h)
288 # For the swap plugin, FreeBSD
289 AC_CHECK_HEADERS(kvm.h)
291 # For the email plugin
292 AC_CHECK_HEADERS(linux/un.h, [], [],
294 #if HAVE_SYS_SOCKET_H
295 # include <sys/socket.h>
298 AC_CHECK_HEADERS(sys/un.h)
299 AC_CHECK_HEADERS(grp.h)
301 # For debugging interface (variable number of arguments)
302 AC_CHECK_HEADERS(stdarg.h)
304 # Regular expressions for the ignorelist.
305 AC_CHECK_HEADERS(regex.h)
308 AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h)
310 AC_CHECK_HEADERS(net/if_arp.h, [], [],
311 [#if HAVE_SYS_SOCKET_H
312 # include <sys/socket.h>
315 AC_CHECK_HEADERS(net/if_ppp.h)
316 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
321 # include <sys/types.h>
323 #if HAVE_SYS_SOCKET_H
324 # include <sys/socket.h>
329 #if HAVE_NETINET_IN_H
330 # include <netinet/in.h>
334 dnl Checking for libraries
338 # Checks for typedefs, structures, and compiler characteristics.
347 # Checks for library functions.
349 AC_PROG_GCC_TRADITIONAL
350 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
351 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
352 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
353 AC_CHECK_FUNCS(strncasecmp strcasecmp)
354 AC_CHECK_FUNCS(openlog syslog closelog)
356 socket_needs_socket="no"
357 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
358 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
360 nanosleep_needs_rt="no"
361 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
362 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
364 # Regular expressions for the ignorelist.
365 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
368 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
371 AC_CHECK_FUNCS(statfs statvfs)
374 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
376 # For the `processes' plugin
377 AC_CHECK_FUNCS(thread_info)
380 AC_CHECK_FUNCS(getutent getutxent)
383 AC_CHECK_FUNCS(quotactl)
384 AC_CHECK_FUNCS(getgrgid getpwuid)
387 AC_CHECK_FUNCS(getifaddrs)
389 # For mount interface
390 #AC_CHECK_FUNCS(getfsent getvfsent)
393 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
395 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
397 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
400 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
401 if test "x$have_getmntent" = "xno"; then
402 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
404 if test "x$have_getmntent" = "xno"; then
405 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
407 if test "x$have_getmntent" = "xno"; then
408 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
411 if test "x$have_getmntent" = "xc"; then
412 AC_CACHE_CHECK([whether getmntent takes one argument],
413 [have_one_getmntent],
415 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
417 #include "$srcdir/src/utils_mount.h"]],
421 fh = setmntent ("/etc/mtab", "r");
425 [have_one_getmntent="yes"],
426 [have_one_getmntent="no"]
429 AC_CACHE_CHECK([whether getmntent takes two arguments],
430 [have_two_getmntent],
432 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
433 #include <sys/mnttab.h>
434 #include "$srcdir/src/utils_mount.h"]],
439 fh = fopen ("/etc/mnttab", "r");
440 status = getmntent (fh, &mt);
443 [have_two_getmntent="yes"],
444 [have_two_getmntent="no"]
449 # Check for different versions of `getmntent' here..
451 if test "x$have_getmntent" = "xc"; then
452 if test "x$have_one_getmntent" = "xyes"; then
453 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
454 [Define if the function getmntent exists and takes one argument.])
456 if test "x$have_two_getmntent" = "xyes"; then
457 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
458 [Define if the function getmntent exists and takes two arguments.])
461 if test "x$have_getmntent" = "xsun"; then
462 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
463 [Define if the function getmntent exists. It's the version from libsun.])
465 if test "x$have_getmntent" = "xseq"; then
466 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
467 [Define if the function getmntent exists. It's the version from libseq.])
469 if test "x$have_getmntent" = "xgen"; then
470 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
471 [Define if the function getmntent exists. It's the version from libgen.])
474 # Check for structures
475 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
476 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
479 #include <sys/types.h>
480 #include <sys/socket.h>
483 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
484 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
487 #include <sys/types.h>
488 #include <sys/socket.h>
489 #include <linux/if.h>
490 #include <linux/netdevice.h>
493 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
498 # include <sys/types.h>
500 #if HAVE_NETINET_IN_SYSTM_H
501 # include <netinet/in_systm.h>
503 #if HAVE_NETINET_IN_H
504 # include <netinet/in.h>
506 #if HAVE_NETINET_IP_H
507 # include <netinet/ip.h>
509 #if HAVE_NETINET_UDP_H
510 # include <netinet/udp.h>
513 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
518 # include <sys/types.h>
520 #if HAVE_NETINET_IN_SYSTM_H
521 # include <netinet/in_systm.h>
523 #if HAVE_NETINET_IN_H
524 # include <netinet/in.h>
526 #if HAVE_NETINET_IP_H
527 # include <netinet/ip.h>
529 #if HAVE_NETINET_UDP_H
530 # include <netinet/udp.h>
534 AC_MSG_CHECKING([for kernel type ($host_os)])
537 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
541 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
547 AC_MSG_RESULT([$ac_system])
550 AC_CHECK_LIB(resolv, res_search,
552 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
554 [with_libresolv="no"])
555 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
558 m4_divert_once([HELP_WITH], [
559 collectd additional packages:])
561 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
562 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
563 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
565 LDFLAGS="$LDFLAGS -L$withval/lib"
566 CPPFLAGS="$CPPFLAGS -I$withval/include"
569 ], [with_rrdtool="yes"])
570 if test "x$with_rrdtool" = "xyes"
572 AC_CHECK_LIB(rrd, rrd_update,
574 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
576 [with_rrdtool="no (librrd not found)"], [-lm])
578 if test "x$with_rrdtool" = "xyes"
580 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
582 if test "x$with_rrdtool" = "xyes"
588 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
589 [Wether or not to use rrdtool library])
590 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
592 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
593 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
595 LDFLAGS="$LDFLAGS -L$withval/lib"
596 CPPFLAGS="$CPPFLAGS -I$withval/include"
597 with_libpthread="yes"
599 if test "x$withval" = "xno"
601 with_libpthread="no (disabled)"
604 ], [with_libpthread="yes"])
605 if test "x$with_libpthread" = "xyes"
607 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
609 if test "x$with_libpthread" = "xyes"
611 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
613 if test "x$with_libpthread" = "xyes"
619 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
620 [Wether or not to use pthread (POSIX threads) library])
621 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
623 if test "$ac_system" = "Solaris"
628 with_kstat="no (Solaris only)"
629 with_devinfo="no (Solaris only)"
632 if test "x$with_kstat" = "xyes"
634 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
636 if test "x$with_kstat" = "xyes"
638 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
639 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
641 if test "x$with_kstat" = "xyes"
643 AC_DEFINE(HAVE_LIBKSTAT, 1,
644 [Define to 1 if you have the 'kstat' library (-lkstat)])
646 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
647 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
649 ### BEGIN of check for libcurl ###
650 with_curl_config="curl-config"
653 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
655 if test "x$withval" != "xno" -a "x$withval" != "xyes"
657 if test -x "$withval/bin/curl-config"
659 with_curl_config="$withval/bin/curl-config"
663 if test "x$withval" = "xno"
673 if test "x$with_libcurl" = "xyes"
675 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
676 curl_config_status=$?
678 if test $curl_config_status -ne 0
682 AC_CHECK_LIB(curl, curl_easy_init,
684 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
685 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
693 if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
695 with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
696 curl_config_status=$?
698 if test $curl_config_status -ne 0
702 if test -d "$with_curl_prefix/include"
704 CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
709 with_libcurl_numeric=0
710 if test "x$with_libcurl" = "xyes"
712 with_libcurl_numeric=1
714 AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
715 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
716 ### END of check for libcurl ###
720 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
729 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
730 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
732 with_libstatgrab="yes"
734 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
736 if test "x$withval" != "xno" -a "x$withval" != "xyes"
738 LDFLAGS="$LDFLAGS -L$withval/lib"
739 CPPFLAGS="$CPPFLAGS -I$withval/include"
740 with_libstatgrab="yes"
744 if test "x$ac_system" == "xunknown"
746 with_libstatgrab="yes"
748 with_libstatgrab="no"
751 if test "x$with_libstatgrab" = "xyes"
753 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
755 if test "x$with_libstatgrab" = "xyes"
757 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
759 if test "x$with_libstatgrab" = "xyes"
761 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
763 if test "x$with_libstatgrab" = "xyes"
765 collect_libstatgrab=1
767 collect_libstatgrab=0
769 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
770 [Wether or not to use statgrab library])
771 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
772 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
774 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
775 if test "x$with_libkvm" = "xyes"
777 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
779 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
781 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
783 if test "x$withval" != "xno" && test "x$withval" != "xyes"
785 LDFLAGS="$LDFLAGS -L$withval/lib"
786 CPPFLAGS="$CPPFLAGS -I$withval/include"
787 with_lm_sensors="yes"
791 if test "x$ac_system" = "xLinux"
793 with_lm_sensors="yes"
798 if test "x$with_lm_sensors" = "xyes"
800 AC_CHECK_LIB(sensors, sensors_init,
802 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
804 [with_lm_sensors="no (libsensors not found)"])
806 if test "x$with_lm_sensors" = "xyes"
808 AC_CHECK_HEADERS(sensors/sensors.h,
810 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
812 [with_lm_sensors="no (sensors/sensors.h not found)"])
814 if test "x$with_lm_sensors" = "xyes"
820 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
821 [Wether or not to use sensors library])
822 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
824 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
826 if test "x$withval" != "xno" && test "x$withval" != "xyes"
828 LDFLAGS="$LDFLAGS -L$withval/lib"
829 CPPFLAGS="$CPPFLAGS -I$withval/include"
836 if test "x$with_libmysql" = "xyes"
838 AC_CHECK_LIB(mysqlclient, mysql_init,
840 AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
841 ], [with_libmysql="no (libmysql not found)"])
843 if test "x$with_libmysql" = "xyes"
845 AC_CHECK_HEADERS(mysql/mysql.h,
847 AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
848 ], [with_libmysql="no (mysql/mysql.h not found)"])
850 if test "x$with_libmysql" = "xyes"
856 AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
857 [Wether or not to use mysql library])
858 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
861 with_own_liboping="no"
862 liboping_LDFLAGS="$LDFLAGS"
863 liboping_CPPFLAGS="$CPPFLAGS"
864 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
866 if test "x$withval" != "xno" && test "x$withval" != "xyes"
868 if test -d "$withval/lib"
870 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
872 if test -d "$withval/include"
874 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
877 if test "x$withval" = "xno"
880 with_own_liboping="no"
888 if test "x$with_liboping" = "xyes"
890 save_LDFLAGS="$LDFLAGS"
891 save_CPPFLAGS="$CPPFLAGS"
892 LDFLAGS="$liboping_LDFLAGS"
893 CPPFLAGS="$liboping_CPPFLAGS"
894 AC_CHECK_LIB(oping, ping_construct,
897 with_own_liboping="no"
901 with_own_liboping="yes"
902 LDFLAGS="$save_LDFLAGS"
903 CPPFLAGS="$save_CPPFLAGS"
906 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
907 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
908 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
910 with_liboping="yes (shipped version)"
913 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
915 if test "x$withval" != "xno" && test "x$withval" != "xyes"
917 LDFLAGS="$LDFLAGS -L$withval/lib"
918 CPPFLAGS="$CPPFLAGS -I$withval/include"
925 if test "x$with_libpcap" = "xyes"
927 AC_CHECK_LIB(pcap, pcap_open_live,
929 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
930 ], [with_libpcap="no (libpcap not found)"])
932 if test "x$with_libpcap" = "xyes"
934 AC_CHECK_HEADERS(pcap.h,
936 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
937 ], [with_libpcap="no (pcap.h not found)"])
939 if test "x$with_libpcap" = "xyes"
945 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
946 [Wether or not to use the pcap library])
947 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
949 # Define `step' and `hearbeat' values..
950 declare -i collectd_step=10
951 declare -i collectd_heartbeat=25
952 AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
954 if test "x$withval" != "xno" -a "x$withval" != "xyes"
956 declare -i tmp_collectd_step="$withval"
957 if test $tmp_collectd_step -gt 0
959 collectd_step=$tmp_collectd_step
960 let "collectd_heartbeat=$collectd_step*2"
964 AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
966 if test "x$withval" != "xno" -a "x$withval" != "xyes"
968 declare -i tmp_collectd_heartbeat="$withval"
969 if test $tmp_collectd_heartbeat -gt 0
971 collectd_heartbeat=$tmp_collectd_heartbeat
976 if test $collectd_step -ne 10
978 AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
980 if test $collectd_heartbeat -ne 25
982 AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
985 # Check for enabled/disabled features
988 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
989 # ------------------------------------------------------------
991 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
996 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1001 m4_define([EnDis],[disabled])dnl
1002 m4_define([YesNo],[no])dnl
1008 m4_define([EnDis],[enabled])dnl
1009 m4_define([YesNo],[yes])dnl
1012 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1016 m4_if([$3], [feature], [],
1020 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1026 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1028 enable_$1='[YesNo]'dnl
1030 if test "x$enable_$1" = "xno"
1034 if test "x$enable_$1" = "xyes"
1038 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1043 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1044 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1046 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1048 m4_divert_once([HELP_ENABLE], [
1049 collectd features:])
1050 AC_COLLECTD([debug], [enable], [feature], [debugging])
1051 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1052 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1054 m4_divert_once([HELP_ENABLE], [
1056 AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics])
1057 AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC])
1058 AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
1059 AC_COLLECTD([battery], [disable], [module], [battery statistics])
1060 AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
1061 AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
1062 AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
1063 AC_COLLECTD([df], [disable], [module], [df statistics])
1064 AC_COLLECTD([dns], [disable], [module], [dns statistics])
1065 AC_COLLECTD([email], [disable], [module], [email statistics])
1066 AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
1067 AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
1068 AC_COLLECTD([load], [disable], [module], [system load statistics])
1069 AC_COLLECTD([mbmon], [disable], [module], [motherboard monitor statistics])
1070 AC_COLLECTD([memory], [disable], [module], [memory statistics])
1071 AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
1072 AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
1073 AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
1074 AC_COLLECTD([ntpd], [disable], [module], [nfs statistics])
1075 AC_COLLECTD([ping], [disable], [module], [ping statistics])
1076 AC_COLLECTD([processes], [disable], [module], [processes statistics])
1077 AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
1078 AC_COLLECTD([serial], [disable], [module], [serial statistics])
1079 AC_COLLECTD([swap], [disable], [module], [swap statistics])
1080 AC_COLLECTD([tape], [disable], [module], [tape statistics])
1081 AC_COLLECTD([traffic], [disable], [module], [system traffic statistics])
1082 AC_COLLECTD([users], [disable], [module], [user count statistics])
1083 AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
1084 AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
1086 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libconfig/Makefile src/liboping/Makefile)
1092 libcurl . . . . . . $with_libcurl
1093 libiokit . . . . . $with_libiokit
1094 liboping . . . . . $with_liboping
1095 librrd . . . . . . $with_rrdtool
1096 lm_sensors . . . . $with_lm_sensors
1097 libstatgrab . . . . $with_libstatgrab
1098 libkstat . . . . . $with_kstat
1099 libmysql . . . . . $with_libmysql
1100 libpcap . . . . . . $with_libpcap
1101 libpthread . . . . $with_libpthread
1104 debug . . . . . . . $enable_debug
1105 daemon mode . . . . $enable_daemon
1106 step . . . . . . . $collectd_step seconds
1107 heartbeat . . . . . $collectd_heartbeat seconds
1110 apache . . . . . . $enable_apache
1111 apcups . . . . . . $enable_apcups
1112 apple_sensors . . . $enable_apple_sensors
1113 battery . . . . . . $enable_battery
1114 cpu . . . . . . . . $enable_cpu
1115 cpufreq . . . . . . $enable_cpufreq
1116 df . . . . . . . . $enable_df
1117 disk . . . . . . . $enable_disk
1118 dns . . . . . . . . $enable_dns
1119 email . . . . . . . $enable_email
1120 hddtemp . . . . . . $enable_hddtemp
1121 load . . . . . . . $enable_load
1122 mbmon . . . . . . . $enable_mbmon
1123 memory . . . . . . $enable_memory
1124 multimeter . . . . $enable_multimeter
1125 mysql . . . . . . . $enable_mysql
1126 nfs . . . . . . . . $enable_nfs
1127 ntpd . . . . . . . $enable_ntpd
1128 ping . . . . . . . $enable_ping
1129 processes . . . . . $enable_processes
1130 sensors . . . . . . $enable_sensors
1131 serial . . . . . . $enable_serial
1132 swap . . . . . . . $enable_swap
1133 tape . . . . . . . $enable_tape
1134 traffic . . . . . . $enable_traffic
1135 users . . . . . . . $enable_users
1136 vserver . . . . . . $enable_vserver
1137 wireless . . . . . $enable_wireless