1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 3.10.3)
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")
11 # Checks for programs.
18 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
22 AC_LIBLTDL_CONVENIENCE
28 AC_CONFIG_SUBDIRS(libltdl src/libconfig)
31 # Checks for header files.
36 AC_CHECK_HEADERS(stdint.h)
37 AC_CHECK_HEADERS(stdio.h)
38 AC_CHECK_HEADERS(errno.h)
39 AC_CHECK_HEADERS(math.h)
40 AC_CHECK_HEADERS(syslog.h)
41 AC_CHECK_HEADERS(fcntl.h)
42 AC_CHECK_HEADERS(signal.h)
43 AC_CHECK_HEADERS(assert.h)
44 AC_CHECK_HEADERS(sys/types.h)
45 AC_CHECK_HEADERS(sys/socket.h)
46 AC_CHECK_HEADERS(sys/select.h)
47 AC_CHECK_HEADERS(sys/poll.h)
48 AC_CHECK_HEADERS(netdb.h)
49 AC_CHECK_HEADERS(arpa/inet.h)
50 AC_CHECK_HEADERS(sys/resource.h)
51 AC_CHECK_HEADERS(sys/param.h)
54 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
59 # include <sys/types.h>
62 AC_CHECK_HEADERS(netinet/in.h, [], [],
67 # include <sys/types.h>
69 #if HAVE_NETINET_IN_SYSTM_H
70 # include <netinet/in_systm.h>
73 AC_CHECK_HEADERS(netinet/ip.h, [], [],
78 # include <sys/types.h>
80 #if HAVE_NETINET_IN_SYSTM_H
81 # include <netinet/in_systm.h>
84 # include <netinet/in.h>
87 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
92 # include <sys/types.h>
94 #if HAVE_NETINET_IN_SYSTM_H
95 # include <netinet/in_systm.h>
98 # include <netinet/in.h>
100 #if HAVE_NETINET_IP_H
101 # include <netinet/ip.h>
104 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
109 # include <sys/types.h>
111 #if HAVE_NETINET_IN_SYSTM_H
112 # include <netinet/in_systm.h>
114 #if HAVE_NETINET_IN_H
115 # include <netinet/in.h>
117 #if HAVE_NETINET_IP_H
118 # include <netinet/ip.h>
121 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
126 # include <sys/types.h>
128 #if HAVE_NETINET_IN_SYSTM_H
129 # include <netinet/in_systm.h>
131 #if HAVE_NETINET_IN_H
132 # include <netinet/in.h>
135 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
140 # include <sys/types.h>
142 #if HAVE_NETINET_IN_SYSTM_H
143 # include <netinet/in_systm.h>
145 #if HAVE_NETINET_IN_H
146 # include <netinet/in.h>
148 #if HAVE_NETINET_IP6_H
149 # include <netinet/ip6.h>
154 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
155 AC_CHECK_HEADERS(mach/mach_init.h)
156 AC_CHECK_HEADERS(mach/host_priv.h)
157 AC_CHECK_HEADERS(mach/mach_error.h)
158 AC_CHECK_HEADERS(mach/mach_host.h)
159 AC_CHECK_HEADERS(mach/mach_port.h)
160 AC_CHECK_HEADERS(mach/mach_types.h)
161 AC_CHECK_HEADERS(mach/message.h)
162 AC_CHECK_HEADERS(mach/processor_set.h)
163 AC_CHECK_HEADERS(mach/processor.h)
164 AC_CHECK_HEADERS(mach/processor_info.h)
165 AC_CHECK_HEADERS(mach/task.h)
166 AC_CHECK_HEADERS(mach/thread_act.h)
167 AC_CHECK_HEADERS(mach/vm_region.h)
168 AC_CHECK_HEADERS(mach/vm_map.h)
169 AC_CHECK_HEADERS(mach/vm_prot.h)
170 AC_CHECK_HEADERS(mach/vm_statistics.h)
171 AC_CHECK_HEADERS(mach/kern_return.h)
174 AC_CHECK_HEADERS(linux/major.h)
176 # For the apple_sensors module
177 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
178 AC_CHECK_HEADERS(IOKit/IOKitLib.h)
179 AC_CHECK_HEADERS(IOKit/IOTypes.h)
181 # For the battery plugin
182 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
184 #if HAVE_IOKIT_IOKITLIB_H
185 # include <IOKit/IOKitLib.h>
187 #if HAVE_IOKIT_IOTYPES_H
188 # include <IOKit/IOTypes.h>
191 AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h)
193 # For the `disk' plugin
194 AC_CHECK_HEADERS(IOKit/IOBSD.h)
195 AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
198 AC_CHECK_HEADERS(sys/loadavg.h)
200 # For the swap module
201 AC_CHECK_HEADERS(sys/swap.h)
204 AC_CHECK_HEADERS(utmp.h)
205 AC_CHECK_HEADERS(utmpx.h)
208 AC_CHECK_HEADERS(ifaddrs.h)
209 AC_CHECK_HEADERS(net/if.h, [], [],
212 # include <sys/types.h>
214 #if HAVE_SYS_SOCKET_H
215 # include <sys/socket.h>
218 AC_CHECK_HEADERS(linux/if.h, [], [],
221 # include <sys/types.h>
223 #if HAVE_SYS_SOCKET_H
224 # include <sys/socket.h>
227 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
230 # include <sys/types.h>
232 #if HAVE_SYS_SOCKET_H
233 # include <sys/socket.h>
236 # include <linux/if.h>
241 AC_CHECK_HEADERS(curl/curl.h)
244 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
245 AC_CHECK_HEADERS(ctype.h)
246 AC_CHECK_HEADERS(limits.h)
247 AC_CHECK_HEADERS(sys/quota.h)
248 AC_CHECK_HEADERS(xfs/xqm.h)
250 # For mount interface
251 AC_CHECK_HEADERS(fs_info.h)
252 AC_CHECK_HEADERS(fshelp.h)
253 AC_CHECK_HEADERS(paths.h)
254 AC_CHECK_HEADERS(mntent.h)
255 AC_CHECK_HEADERS(mnttab.h)
256 AC_CHECK_HEADERS(sys/fstyp.h)
257 AC_CHECK_HEADERS(sys/fs_types.h)
258 AC_CHECK_HEADERS(sys/mntent.h)
259 AC_CHECK_HEADERS(sys/mnttab.h)
260 AC_CHECK_HEADERS(sys/mount.h)
261 AC_CHECK_HEADERS(sys/statfs.h)
262 AC_CHECK_HEADERS(sys/statvfs.h)
263 AC_CHECK_HEADERS(sys/vfs.h)
264 AC_CHECK_HEADERS(sys/vfstab.h)
266 # For the swap plugin, FreeBSD
267 AC_CHECK_HEADERS(kvm.h)
269 # For debugging interface (variable number of arguments)
270 AC_CHECK_HEADERS(stdarg.h)
272 dnl Checking for libraries
276 # Checks for typedefs, structures, and compiler characteristics.
285 # Checks for library functions.
287 AC_PROG_GCC_TRADITIONAL
288 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
289 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
290 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
291 AC_CHECK_FUNCS(strncasecmp strcasecmp)
292 AC_CHECK_FUNCS(openlog syslog closelog)
294 socket_needs_socket="no"
295 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
296 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
298 nanosleep_needs_rt="no"
299 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
300 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
303 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
306 AC_CHECK_FUNCS(statfs statvfs)
309 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
311 # For the `processes' plugin
312 AC_CHECK_FUNCS(thread_info)
315 AC_CHECK_FUNCS(getutent getutxent)
318 AC_CHECK_FUNCS(quotactl)
319 AC_CHECK_FUNCS(getgrgid getpwuid)
322 AC_CHECK_FUNCS(getifaddrs)
324 # For mount interface
325 #AC_CHECK_FUNCS(getfsent getvfsent)
328 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
330 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
332 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
335 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
336 if test "x$have_getmntent" = "xno"; then
337 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
339 if test "x$have_getmntent" = "xno"; then
340 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
342 if test "x$have_getmntent" = "xno"; then
343 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
346 if test "x$have_getmntent" = "xc"; then
347 AC_CACHE_CHECK([whether getmntent takes one argument],
348 [have_one_getmntent],
350 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
352 #include "$srcdir/src/utils_mount.h"]],
356 fh = setmntent ("/etc/mtab", "r");
360 [have_one_getmntent="yes"],
361 [have_one_getmntent="no"]
364 AC_CACHE_CHECK([whether getmntent takes two arguments],
365 [have_two_getmntent],
367 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
368 #include <sys/mnttab.h>
369 #include "$srcdir/src/utils_mount.h"]],
374 fh = fopen ("/etc/mnttab", "r");
375 status = getmntent (fh, &mt);
378 [have_two_getmntent="yes"],
379 [have_two_getmntent="no"]
384 # Check for different versions of `getmntent' here..
386 if test "x$have_getmntent" = "xc"; then
387 if test "x$have_one_getmntent" = "xyes"; then
388 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
389 [Define if the function getmntent exists and takes one argument.])
391 if test "x$have_two_getmntent" = "xyes"; then
392 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
393 [Define if the function getmntent exists and takes two arguments.])
396 if test "x$have_getmntent" = "xsun"; then
397 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
398 [Define if the function getmntent exists. It's the version from libsun.])
400 if test "x$have_getmntent" = "xseq"; then
401 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
402 [Define if the function getmntent exists. It's the version from libseq.])
404 if test "x$have_getmntent" = "xgen"; then
405 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
406 [Define if the function getmntent exists. It's the version from libgen.])
409 # Check for structures
410 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
411 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
414 #include <sys/types.h>
415 #include <sys/socket.h>
418 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
419 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
422 #include <sys/types.h>
423 #include <sys/socket.h>
424 #include <linux/if.h>
425 #include <linux/netdevice.h>
428 AC_MSG_CHECKING([for kernel type ($host_os)])
431 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
435 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
441 AC_MSG_RESULT([$ac_system])
444 AC_CHECK_LIB(resolv, res_search,
446 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
448 [with_libresolv="no"])
449 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
452 m4_divert_once([HELP_WITH], [
453 collectd additional packages:])
455 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
456 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
457 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
459 LDFLAGS="$LDFLAGS -L$withval/lib"
460 CPPFLAGS="$CPPFLAGS -I$withval/include"
463 ], [with_rrdtool="yes"])
464 if test "x$with_rrdtool" = "xyes"
466 AC_CHECK_LIB(rrd, rrd_update,
468 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
470 [with_rrdtool="no (librrd not found)"], [-lm])
472 if test "x$with_rrdtool" = "xyes"
474 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
476 if test "x$with_rrdtool" = "xyes"
482 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
483 [Wether or not to use rrdtool library])
484 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
486 #AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]),
487 #[ if test "x$withval" != "xno" && test "x$withval" != "xyes"
489 # LDFLAGS="$LDFLAGS -L$withval/lib"
490 # CPPFLAGS="$CPPFLAGS -I$withval/include"
494 #if test "x$with_pth" = "xyes"
496 # AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], [])
498 #if test "x$with_pth" = "xyes"
500 # AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"])
502 #if test "x$with_pth" = "xyes"
508 #AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth],
509 # [Wether or not to use pth (portable threads) library])
510 #AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes")
512 if test "$ac_system" = "Solaris"
517 with_kstat="no (Solaris only)"
518 with_devinfo="no (Solaris only)"
521 if test "x$with_kstat" = "xyes"
523 AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"])
525 if test "x$with_kstat" = "xyes"
527 AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"])
528 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
530 if test "x$with_kstat" = "xyes"
536 AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat],
537 [Wether or not to use kstat library (Solaris)])
538 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
539 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
541 ### BEGIN of check for libcurl ###
542 with_curl_config="curl-config"
545 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
547 if test "x$withval" != "xno" -a "x$withval" != "xyes"
549 if test -x "$withval/bin/curl-config"
551 with_curl_config="$withval/bin/curl-config"
555 if test "x$withval" = "xno"
565 if test "x$with_libcurl" = "xyes"
567 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
568 curl_config_status=$?
570 if test $curl_config_status -ne 0
574 AC_CHECK_LIB(curl, curl_easy_init,
576 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
577 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
585 if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
587 with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
588 curl_config_status=$?
590 if test $curl_config_status -ne 0
594 if test -d "$with_curl_prefix/include"
596 CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
601 with_libcurl_numeric=0
602 if test "x$with_libcurl" = "xyes"
604 with_libcurl_numeric=1
606 AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
607 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
608 ### END of check for libcurl ###
612 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
621 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
622 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
624 with_libstatgrab="yes"
626 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
628 if test "x$withval" != "xno" -a "x$withval" != "xyes"
630 LDFLAGS="$LDFLAGS -L$withval/lib"
631 CPPFLAGS="$CPPFLAGS -I$withval/include"
632 with_libstatgrab="yes"
636 if test "x$ac_system" == "xunknown"
638 with_libstatgrab="yes"
640 with_libstatgrab="no"
643 if test "x$with_libstatgrab" = "xyes"
645 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
647 if test "x$with_libstatgrab" = "xyes"
649 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
651 if test "x$with_libstatgrab" = "xyes"
653 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
655 if test "x$with_libstatgrab" = "xyes"
657 collect_libstatgrab=1
659 collect_libstatgrab=0
661 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
662 [Wether or not to use statgrab library])
663 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
664 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
666 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
667 if test "x$with_libkvm" = "xyes"
669 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
671 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
673 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
675 if test "x$withval" != "xno" && test "x$withval" != "xyes"
677 LDFLAGS="$LDFLAGS -L$withval/lib"
678 CPPFLAGS="$CPPFLAGS -I$withval/include"
679 with_lm_sensors="yes"
683 if test "x$ac_system" = "xLinux"
685 with_lm_sensors="yes"
690 if test "x$with_lm_sensors" = "xyes"
692 AC_CHECK_LIB(sensors, sensors_init,
694 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
696 [with_lm_sensors="no (libsensors not found)"])
698 if test "x$with_lm_sensors" = "xyes"
700 AC_CHECK_HEADERS(sensors/sensors.h,
702 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
704 [with_lm_sensors="no (sensors/sensors.h not found)"])
706 if test "x$with_lm_sensors" = "xyes"
712 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
713 [Wether or not to use sensors library])
714 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
716 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
718 if test "x$withval" != "xno" && test "x$withval" != "xyes"
720 LDFLAGS="$LDFLAGS -L$withval/lib"
721 CPPFLAGS="$CPPFLAGS -I$withval/include"
728 if test "x$with_libmysql" = "xyes"
730 AC_CHECK_LIB(mysqlclient, mysql_init,
732 AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
733 ], [with_libmysql="no (libmysql not found)"])
735 if test "x$with_libmysql" = "xyes"
737 AC_CHECK_HEADERS(mysql/mysql.h,
739 AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
740 ], [with_libmysql="no (mysql/mysql.h not found)"])
742 if test "x$with_libmysql" = "xyes"
748 AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
749 [Wether or not to use mysql library])
750 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
753 with_own_liboping="no"
754 liboping_LDFLAGS="$LDFLAGS"
755 liboping_CPPFLAGS="$CPPFLAGS"
756 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
758 if test "x$withval" != "xno" && test "x$withval" != "xyes"
760 if test -d "$withval/lib"
762 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
764 if test -d "$withval/include"
766 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
769 if test "x$withval" = "xno"
772 with_own_liboping="no"
780 if test "x$with_liboping" = "xyes"
782 save_LDFLAGS="$LDFLAGS"
783 save_CPPFLAGS="$CPPFLAGS"
784 LDFLAGS="$liboping_LDFLAGS"
785 CPPFLAGS="$liboping_CPPFLAGS"
786 AC_CHECK_LIB(oping, ping_construct,
789 with_own_liboping="no"
793 with_own_liboping="yes"
794 LDFLAGS="$save_LDFLAGS"
795 CPPFLAGS="$save_CPPFLAGS"
798 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
799 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
800 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
802 with_liboping="yes (shipped version)"
805 # Define `step' and `hearbeat' values..
806 declare -i collectd_step=10
807 declare -i collectd_heartbeat=25
808 AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
810 if test "x$withval" != "xno" -a "x$withval" != "xyes"
812 declare -i tmp_collectd_step="$withval"
813 if test $tmp_collectd_step -gt 0
815 collectd_step=$tmp_collectd_step
816 let "collectd_heartbeat=$collectd_step*2"
820 AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
822 if test "x$withval" != "xno" -a "x$withval" != "xyes"
824 declare -i tmp_collectd_heartbeat="$withval"
825 if test $tmp_collectd_heartbeat -gt 0
827 collectd_heartbeat=$tmp_collectd_heartbeat
832 if test $collectd_step -ne 10
834 AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
836 if test $collectd_heartbeat -ne 25
838 AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
842 # Check for enabled/disabled features
845 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
846 # ------------------------------------------------------------
848 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
853 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
858 m4_define([EnDis],[disabled])dnl
859 m4_define([YesNo],[no])dnl
865 m4_define([EnDis],[enabled])dnl
866 m4_define([YesNo],[yes])dnl
869 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
873 m4_if([$3], [feature], [],
877 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
883 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
885 enable_$1='[YesNo]'dnl
887 if test "x$enable_$1" = "xno"
891 if test "x$enable_$1" = "xyes"
895 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
900 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
901 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
903 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
905 m4_divert_once([HELP_ENABLE], [
907 AC_COLLECTD([debug], [enable], [feature], [debugging])
908 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
909 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
911 m4_divert_once([HELP_ENABLE], [
913 AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics])
914 AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC])
915 AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
916 AC_COLLECTD([battery], [disable], [module], [battery statistics])
917 AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
918 AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
919 AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
920 AC_COLLECTD([df], [disable], [module], [df statistics])
921 AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
922 AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
923 AC_COLLECTD([load], [disable], [module], [system load statistics])
924 AC_COLLECTD([memory], [disable], [module], [memory statistics])
925 AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
926 AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
927 AC_COLLECTD([ntpd], [disable], [module], [nfs statistics])
928 AC_COLLECTD([ping], [disable], [module], [ping statistics])
929 AC_COLLECTD([processes], [disable], [module], [processes statistics])
930 AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
931 AC_COLLECTD([serial], [disable], [module], [serial statistics])
932 AC_COLLECTD([swap], [disable], [module], [swap statistics])
933 AC_COLLECTD([tape], [disable], [module], [tape statistics])
934 AC_COLLECTD([traffic], [disable], [module], [system traffic statistics])
935 AC_COLLECTD([users], [disable], [module], [user count statistics])
936 AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
937 AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
939 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libconfig/Makefile src/liboping/Makefile)
945 libcurl . . . . . . $with_libcurl
946 libiokit . . . . . $with_libiokit
947 liboping . . . . . $with_liboping
948 librrd . . . . . . $with_rrdtool
949 lm_sensors . . . . $with_lm_sensors
950 libstatgrab . . . . $with_libstatgrab
951 libkstat . . . . . $with_kstat
952 libmysql . . . . . $with_libmysql
955 debug . . . . . . . $enable_debug
956 daemon mode . . . . $enable_daemon
957 step . . . . . . . $collectd_step seconds
958 heartbeat . . . . . $collectd_heartbeat seconds
961 apache . . . . . . $enable_apache
962 apcups . . . . . . $enable_apcups
963 apple_sensors . . . $enable_apple_sensors
964 battery . . . . . . $enable_battery
965 cpu . . . . . . . . $enable_cpu
966 cpufreq . . . . . . $enable_cpufreq
967 df . . . . . . . . $enable_df
968 disk . . . . . . . $enable_disk
969 hddtemp . . . . . . $enable_hddtemp
970 load . . . . . . . $enable_load
971 memory . . . . . . $enable_memory
972 mysql . . . . . . . $enable_mysql
973 nfs . . . . . . . . $enable_nfs
974 ntpd . . . . . . . $enable_ntpd
975 ping . . . . . . . $enable_ping
976 processes . . . . . $enable_processes
977 sensors . . . . . . $enable_sensors
978 serial . . . . . . $enable_serial
979 swap . . . . . . . $enable_swap
980 tape . . . . . . . $enable_tape
981 traffic . . . . . . $enable_traffic
982 users . . . . . . . $enable_users
983 vserver . . . . . . $enable_vserver
984 wireless . . . . . $enable_wireless