1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 3.9.2)
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(netdb.h)
48 AC_CHECK_HEADERS(arpa/inet.h)
49 AC_CHECK_HEADERS(sys/resource.h)
50 AC_CHECK_HEADERS(sys/param.h)
53 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
58 AC_CHECK_HEADERS(netinet/in.h, [], [],
62 #if HAVE_NETINET_IN_SYSTM_H
63 # include <netinet/in_systm.h>
66 AC_CHECK_HEADERS(netinet/ip.h, [], [],
70 #if HAVE_NETINET_IN_SYSTM_H
71 # include <netinet/in_systm.h>
74 # include <netinet/in.h>
77 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
81 #if HAVE_NETINET_IN_SYSTM_H
82 # include <netinet/in_systm.h>
85 # include <netinet/in.h>
88 # include <netinet/ip.h>
91 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
95 #if HAVE_NETINET_IN_SYSTM_H
96 # include <netinet/in_systm.h>
99 # include <netinet/in.h>
101 #if HAVE_NETINET_IP_H
102 # include <netinet/ip.h>
105 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
110 # include <sys/types.h>
112 #if HAVE_NETINET_IN_SYSTM_H
113 # include <netinet/in_systm.h>
115 #if HAVE_NETINET_IN_H
116 # include <netinet/in.h>
119 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
124 # include <sys/types.h>
126 #if HAVE_NETINET_IN_SYSTM_H
127 # include <netinet/in_systm.h>
129 #if HAVE_NETINET_IN_H
130 # include <netinet/in.h>
132 #if HAVE_NETINET_IP6_H
133 # include <netinet/ip6.h>
138 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
139 AC_CHECK_HEADERS(mach/mach_init.h)
140 AC_CHECK_HEADERS(mach/host_priv.h)
141 AC_CHECK_HEADERS(mach/mach_error.h)
142 AC_CHECK_HEADERS(mach/mach_host.h)
143 AC_CHECK_HEADERS(mach/mach_port.h)
144 AC_CHECK_HEADERS(mach/mach_types.h)
145 AC_CHECK_HEADERS(mach/message.h)
146 AC_CHECK_HEADERS(mach/processor_set.h)
147 AC_CHECK_HEADERS(mach/processor.h)
148 AC_CHECK_HEADERS(mach/processor_info.h)
149 AC_CHECK_HEADERS(mach/task.h)
150 AC_CHECK_HEADERS(mach/thread_act.h)
151 AC_CHECK_HEADERS(mach/vm_region.h)
152 AC_CHECK_HEADERS(mach/vm_map.h)
153 AC_CHECK_HEADERS(mach/vm_prot.h)
154 AC_CHECK_HEADERS(mach/vm_statistics.h)
155 AC_CHECK_HEADERS(mach/kern_return.h)
158 AC_CHECK_HEADERS(linux/major.h)
160 # For the apple_sensors module
161 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
162 AC_CHECK_HEADERS(IOKit/IOKitLib.h)
163 AC_CHECK_HEADERS(IOKit/IOTypes.h)
165 # For the battery plugin
166 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
168 #if HAVE_IOKIT_IOKITLIB_H
169 # include <IOKit/IOKitLib.h>
171 #if HAVE_IOKIT_IOTYPES_H
172 # include <IOKit/IOTypes.h>
175 AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h)
177 # For the `disk' plugin
178 AC_CHECK_HEADERS(IOKit/IOBSD.h)
179 AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
182 AC_CHECK_HEADERS(sys/loadavg.h)
184 # For the swap module
185 AC_CHECK_HEADERS(sys/swap.h)
188 AC_CHECK_HEADERS(utmp.h)
189 AC_CHECK_HEADERS(utmpx.h)
192 AC_CHECK_HEADERS(ifaddrs.h)
193 AC_CHECK_HEADERS(net/if.h, [], [],
196 # include <sys/types.h>
198 #if HAVE_SYS_SOCKET_H
199 # include <sys/socket.h>
202 AC_CHECK_HEADERS(linux/if.h, [], [],
205 # include <sys/types.h>
207 #if HAVE_SYS_SOCKET_H
208 # include <sys/socket.h>
211 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
214 # include <sys/types.h>
216 #if HAVE_SYS_SOCKET_H
217 # include <sys/socket.h>
220 # include <linux/if.h>
225 AC_CHECK_HEADERS(curl/curl.h)
228 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
229 AC_CHECK_HEADERS(ctype.h)
230 AC_CHECK_HEADERS(limits.h)
231 AC_CHECK_HEADERS(sys/quota.h)
232 AC_CHECK_HEADERS(xfs/xqm.h)
234 # For mount interface
235 AC_CHECK_HEADERS(fs_info.h)
236 AC_CHECK_HEADERS(fshelp.h)
237 AC_CHECK_HEADERS(paths.h)
238 AC_CHECK_HEADERS(mntent.h)
239 AC_CHECK_HEADERS(mnttab.h)
240 AC_CHECK_HEADERS(sys/fstyp.h)
241 AC_CHECK_HEADERS(sys/fs_types.h)
242 AC_CHECK_HEADERS(sys/mntent.h)
243 AC_CHECK_HEADERS(sys/mnttab.h)
244 AC_CHECK_HEADERS(sys/mount.h)
245 AC_CHECK_HEADERS(sys/statfs.h)
246 AC_CHECK_HEADERS(sys/statvfs.h)
247 AC_CHECK_HEADERS(sys/vfs.h)
248 AC_CHECK_HEADERS(sys/vfstab.h)
250 # For debugging interface (variable number of arguments)
251 AC_CHECK_HEADERS(stdarg.h)
253 dnl Checking for libraries
257 # Checks for typedefs, structures, and compiler characteristics.
266 # Checks for library functions.
268 AC_PROG_GCC_TRADITIONAL
269 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
270 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
271 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
272 AC_CHECK_FUNCS(strncasecmp strcasecmp)
273 AC_CHECK_FUNCS(openlog syslog closelog)
275 socket_needs_socket="no"
276 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
277 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
279 nanosleep_needs_rt="no"
280 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
281 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
284 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
287 AC_CHECK_FUNCS(statfs statvfs)
290 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
292 # For the `processes' plugin
293 AC_CHECK_FUNCS(thread_info)
296 AC_CHECK_FUNCS(getutent getutxent)
299 AC_CHECK_FUNCS(quotactl)
300 AC_CHECK_FUNCS(getgrgid getpwuid)
303 AC_CHECK_FUNCS(getifaddrs)
305 # For mount interface
306 AC_CHECK_FUNCS(getfsent getvfsent listmntent)
307 AC_CHECK_FUNCS(getfsstat)
309 # Check for different versions of `getmntent' here..
311 if test "x$ac_cv_lib_sun_getmntent" = "xyes"
313 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
314 [Define if the function getmntent exists. It's the version from libsun.])
316 if test "x$ac_cv_lib_seq_getmntent" = "xyes"
318 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
319 [Define if the function getmntent exists. It's the version from libseq.])
321 if test "x$ac_cv_lib_gen_getmntent" = "xyes"
323 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
324 [Define if the function getmntent exists. It's the version from libgen.])
327 if test "x$ac_cv_func_getmntent" = "xyes"; then
329 CFLAGS="-Wall -Werror $CFLAGS"
330 AC_CACHE_CHECK([whether getmntent takes one argument],
333 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
334 #include "$srcdir/src/utils_mount.h"]],
335 [[(void)getmntent((FILE *)NULL);]]
337 [fu_cv_getmntent1=yes],
338 [fu_cv_getmntent1=no]
341 if test "x$fu_cv_getmntent1" = "xno"; then
342 AC_CACHE_CHECK([whether getmntent takes two arguments],
345 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
346 #include "$srcdir/src/utils_mount.h"]],
347 [[(void)getmntent((FILE *)NULL,
348 (struct mnttab *)NULL);]]
350 [fu_cv_getmntent2=yes],
351 [fu_cv_getmntent2=no]
357 if test "x$fu_cv_getmntent1" = "xyes"; then
358 AC_DEFINE(HAVE_GETMNTENT1,
360 [Define if there is a function named getmntent
361 for reading the list of mounted filesystems, and
362 that function takes a single argument. (4.3BSD,
363 SunOS, HP-UX, Dynix, Irix, Linux)]
366 if test "x$fu_cv_getmntent2" = "xyes"; then
367 AC_DEFINE(HAVE_GETMNTENT2,
369 [Define if there is a function named getmntent
370 for reading the list of mounted filesystems, and
371 that function takes two arguments. (SVR4)]
375 # Check for structures
376 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
377 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
380 #include <sys/types.h>
381 #include <sys/socket.h>
384 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
385 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
388 #include <sys/types.h>
389 #include <sys/socket.h>
390 #include <linux/if.h>
391 #include <linux/netdevice.h>
394 AC_MSG_CHECKING([for kernel type ($host_os)])
397 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
401 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
407 AC_MSG_RESULT([$ac_system])
410 AC_CHECK_LIB(resolv, res_search,
412 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
414 [with_libresolv="no"])
415 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
418 m4_divert_once([HELP_WITH], [
419 collectd additional packages:])
421 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
422 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
423 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
425 LDFLAGS="$LDFLAGS -L$withval/lib"
426 CPPFLAGS="$CPPFLAGS -I$withval/include"
429 ], [with_rrdtool="yes"])
430 if test "x$with_rrdtool" = "xyes"
432 AC_CHECK_LIB(rrd, rrd_update,
434 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
436 [with_rrdtool="no (librrd not found)"], [-lm])
438 if test "x$with_rrdtool" = "xyes"
440 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
442 if test "x$with_rrdtool" = "xyes"
448 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
449 [Wether or not to use rrdtool library])
450 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
452 #AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]),
453 #[ if test "x$withval" != "xno" && test "x$withval" != "xyes"
455 # LDFLAGS="$LDFLAGS -L$withval/lib"
456 # CPPFLAGS="$CPPFLAGS -I$withval/include"
460 #if test "x$with_pth" = "xyes"
462 # AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], [])
464 #if test "x$with_pth" = "xyes"
466 # AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"])
468 #if test "x$with_pth" = "xyes"
474 #AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth],
475 # [Wether or not to use pth (portable threads) library])
476 #AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes")
478 if test "$ac_system" = "Solaris"
483 with_kstat="no (Solaris only)"
484 with_devinfo="no (Solaris only)"
487 if test "x$with_kstat" = "xyes"
489 AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"])
491 if test "x$with_kstat" = "xyes"
493 AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"])
494 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
496 if test "x$with_kstat" = "xyes"
502 AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat],
503 [Wether or not to use kstat library (Solaris)])
504 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
505 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
507 ### BEGIN of check for libcurl ###
508 with_curl_config="curl-config"
511 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
513 if test "x$withval" != "xno" -a "x$withval" != "xyes"
515 if test -x "$withval/bin/curl-config"
517 with_curl_config="$withval/bin/curl-config"
521 if test "x$withval" = "xno"
531 if test "x$with_libcurl" = "xyes"
533 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
534 curl_config_status=$?
536 if test $curl_config_status -ne 0
540 AC_CHECK_LIB(curl, curl_easy_init,
542 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
543 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
551 if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
553 with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
554 curl_config_status=$?
556 if test $curl_config_status -ne 0
560 if test -d "$with_curl_prefix/include"
562 CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
567 with_libcurl_numeric=0
568 if test "x$with_libcurl" = "xyes"
570 with_libcurl_numeric=1
572 AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
573 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
574 ### END of check for libcurl ###
578 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
587 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
588 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
590 with_libstatgrab="yes"
593 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
595 if test "x$withval" != "xno" -a "x$withval" != "xyes"
597 LDFLAGS="$LDFLAGS -L$withval/lib"
598 CPPFLAGS="$CPPFLAGS -I$withval/include"
599 with_libstatgrab="yes"
603 if test "x$ac_system" == "xunknown"
605 with_libstatgrab="yes"
607 with_libstatgrab="no"
610 if test "x$with_libstatgrab" = "xyes"
612 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
614 if test "x$with_libstatgrab" = "xyes"
616 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
618 if test "x$with_libstatgrab" = "xyes"
620 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
621 AC_CHECK_LIB(kvm, kvm_getargv, [with_libkvm="yes"], [with_libkvm="no"])
623 if test "x$with_libstatgrab" = "xyes"
625 collect_libstatgrab=1
627 collect_libstatgrab=0
629 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
630 [Wether or not to use statgrab library])
631 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
632 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
633 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
635 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
637 if test "x$withval" != "xno" && test "x$withval" != "xyes"
639 LDFLAGS="$LDFLAGS -L$withval/lib"
640 CPPFLAGS="$CPPFLAGS -I$withval/include"
641 with_lm_sensors="yes"
645 if test "x$ac_system" = "xLinux"
647 with_lm_sensors="yes"
652 if test "x$with_lm_sensors" = "xyes"
654 AC_CHECK_LIB(sensors, sensors_init,
656 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
658 [with_lm_sensors="no (libsensors not found)"])
660 if test "x$with_lm_sensors" = "xyes"
662 AC_CHECK_HEADERS(sensors/sensors.h,
664 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
666 [with_lm_sensors="no (sensors/sensors.h not found)"])
668 if test "x$with_lm_sensors" = "xyes"
674 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
675 [Wether or not to use sensors library])
676 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
678 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
680 if test "x$withval" != "xno" && test "x$withval" != "xyes"
682 LDFLAGS="$LDFLAGS -L$withval/lib"
683 CPPFLAGS="$CPPFLAGS -I$withval/include"
690 if test "x$with_libmysql" = "xyes"
692 AC_CHECK_LIB(mysqlclient, mysql_init,
694 AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
695 ], [with_libmysql="no (libmysql not found)"])
697 if test "x$with_libmysql" = "xyes"
699 AC_CHECK_HEADERS(mysql/mysql.h,
701 AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
702 ], [with_libmysql="no (mysql/mysql.h not found)"])
704 if test "x$with_libmysql" = "xyes"
710 AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
711 [Wether or not to use mysql library])
712 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
714 # Define `step' and `hearbeat' values..
715 declare -i collectd_step=10
716 declare -i collectd_heartbeat=25
717 AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
719 if test "x$withval" != "xno" -a "x$withval" != "xyes"
721 declare -i tmp_collectd_step="$withval"
722 if test $tmp_collectd_step -gt 0
724 collectd_step=$tmp_collectd_step
725 let "collectd_heartbeat=$collectd_step*2"
729 AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
731 if test "x$withval" != "xno" -a "x$withval" != "xyes"
733 declare -i tmp_collectd_heartbeat="$withval"
734 if test $tmp_collectd_heartbeat -gt 0
736 collectd_heartbeat=$tmp_collectd_heartbeat
741 if test $collectd_step -ne 10
743 AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
745 if test $collectd_heartbeat -ne 25
747 AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
751 # Check for enabled/disabled features
754 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
755 # ------------------------------------------------------------
757 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
762 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
767 m4_define([EnDis],[disabled])dnl
768 m4_define([YesNo],[no])dnl
774 m4_define([EnDis],[enabled])dnl
775 m4_define([YesNo],[yes])dnl
778 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
782 m4_if([$3], [feature], [],
786 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
792 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
794 enable_$1='[YesNo]'dnl
796 if test "x$enable_$1" = "xno"
800 if test "x$enable_$1" = "xyes"
804 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
809 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
810 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
812 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
814 m4_divert_once([HELP_ENABLE], [
816 AC_COLLECTD([debug], [enable], [feature], [debugging])
817 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
819 m4_divert_once([HELP_ENABLE], [
821 AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics])
822 AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC])
823 AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
824 AC_COLLECTD([battery], [disable], [module], [battery statistics])
825 AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
826 AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
827 AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
828 AC_COLLECTD([df], [disable], [module], [df statistics])
829 AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
830 AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
831 AC_COLLECTD([load], [disable], [module], [system load statistics])
832 AC_COLLECTD([memory], [disable], [module], [memory statistics])
833 AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
834 AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
835 AC_COLLECTD([ping], [disable], [module], [ping statistics])
836 AC_COLLECTD([processes], [disable], [module], [processes statistics])
837 AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
838 AC_COLLECTD([serial], [disable], [module], [serial statistics])
839 AC_COLLECTD([swap], [disable], [module], [swap statistics])
840 AC_COLLECTD([tape], [disable], [module], [tape statistics])
841 AC_COLLECTD([traffic], [disable], [module], [system traffic statistics])
842 AC_COLLECTD([users], [disable], [module], [user count statistics])
843 AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
844 AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
846 #m4_divert_once([HELP_ENABLE], [
848 #AC_ARG_ENABLE(cpu, AC_HELP_STRING([--disable-cpu], [Disable CPU usage statistics]),, [enable_cpu="yes"])
849 #if test "x$enable_cpu" != "xno"
851 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$have_sysctlbyname" = "xyes"
858 #if test "x$enable_cpu" = "xno"
860 # AC_DEFINE(COLLECT_CPU, 0, [Wether or not to collect CPU usage statistics])
862 #AM_CONDITIONAL(BUILD_MODULE_CPU, test "x$enable_cpu" = "xyes")
864 #AC_ARG_ENABLE(cpufreq, AC_HELP_STRING([--disable-cpufreq], [Disable system cpu frequency statistics]),, [enable_cpufreq="yes"])
865 #if test "x$enable_cpufreq" != "xno"
867 # if test "x$ac_system" = "xLinux"
869 # enable_cpufreq="yes"
871 # enable_cpufreq="no"
874 #if test "x$enable_cpufreq" = "xno"
876 # AC_DEFINE(COLLECT_CPUFREQ, 0, [Wether or not to collect cpu frequency statistics])
878 #AM_CONDITIONAL(BUILD_MODULE_CPUFREQ, test "x$enable_cpufreq" = "xyes")
880 #AC_ARG_ENABLE(disk, AC_HELP_STRING([--disable-disk], [Disable disk/partition statistics]),, [enable_disk="yes"])
881 #if test "x$enable_disk" != "xno"
883 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes"
890 #if test "x$enable_disk" = "xno"
892 # AC_DEFINE(COLLECT_DISK, 0, [Wether or not to collect diskstats])
894 #AM_CONDITIONAL(BUILD_MODULE_DISK, test "x$enable_disk" = "xyes")
896 #AC_ARG_ENABLE(hddtemp, AC_HELP_STRING([--disable-hddtemp], [Disable hdd temperature statistics]),, [enable_hddtemp="yes"])
897 #if test "x$enable_hddtemp" = "xno"
899 # AC_DEFINE(COLLECT_HDDTEMP, 0, [Wether or not to collect hdd temperature statistics])
901 #AM_CONDITIONAL(BUILD_MODULE_HDDTEMP, test "x$enable_hddtemp" = "xyes")
903 #AC_ARG_ENABLE(load, AC_HELP_STRING([--disable-load], [Disable system load statistics]),, [enable_load="yes"])
904 #if test "x$enable_load" != "xno"
906 # if test "x$have_getloadavg" = "xyes" -o "x$ac_system" = "xLinux" -o "x$with_libstatgrab" = "xyes"
913 #if test "x$enable_load" = "xno"
915 # AC_DEFINE(COLLECT_LOAD, 0, [Wether or not to collect system load statistics])
917 #AM_CONDITIONAL(BUILD_MODULE_LOAD, test "x$enable_load" = "xyes")
919 #AC_ARG_ENABLE(memory, AC_HELP_STRING([--disable-memory], [Disable memory statistics]),, [enable_memory="yes"])
920 #if test "x$enable_memory" != "xno"
922 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
924 # enable_memory="yes"
929 #if test "x$enable_memory" = "xno"
931 # AC_DEFINE(COLLECT_MEMORY, 0, [Wether or not to collect memory statistics])
933 #AM_CONDITIONAL(BUILD_MODULE_MEMORY, test "x$enable_memory" = "xyes")
935 #AC_ARG_ENABLE(nfs, AC_HELP_STRING([--disable-nfs], [Disable nfs statistics]),, [enable_nfs="yes"])
936 #if test "x$enable_nfs" != "xno"
938 # if test "x$ac_system" = "xLinux"
945 #if test "x$enable_nfs" = "xno"
947 # AC_DEFINE(COLLECT_NFS, 0, [Wether or not to collect nfs statistics])
949 #AM_CONDITIONAL(BUILD_MODULE_NFS, test "x$enable_nfs" = "xyes")
951 #AC_ARG_ENABLE(ping, AC_HELP_STRING([--disable-ping], [Disable ping statistics]),, [enable_ping="yes"])
952 #if test "x$enable_ping" != "xno"
956 #if test "x$enable_ping" = "xno"
958 # AC_DEFINE(COLLECT_PING, 0, [Wether or not to collect ping statistics])
960 #AM_CONDITIONAL(BUILD_MODULE_PING, test "x$enable_ping" = "xyes")
962 #AC_ARG_ENABLE(processes, AC_HELP_STRING([--disable-processes], [Disable processes statistics]),, [enable_processes="yes"])
963 #if test "x$enable_processes" != "xno"
965 # if test "x$ac_system" = "xLinux"
967 # enable_processes="yes"
969 # enable_processes="no"
972 #if test "x$enable_processes" = "xno"
974 # AC_DEFINE(COLLECT_PROCESSES, 0, [Wether or not to collect processes statistics])
976 #AM_CONDITIONAL(BUILD_MODULE_PROCESSES, test "x$enable_processes" = "xyes")
978 ##AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
980 #AC_ARG_ENABLE(sensors, AC_HELP_STRING([--disable-sensors], [Disable lm_sensors statistics]),, [enable_sensors=$with_lm_sensors])
981 #if test "x$enable_sensors" != "xno"
983 # if test "x$with_lm_sensors" = "xyes"
985 # enable_sensors="yes"
987 # enable_sensors="no"
990 #if test "x$enable_sensors" = "xno"
992 # AC_DEFINE(COLLECT_SENSORS, 0, [Wether or not to collect lm_sensors statistics])
994 #AM_CONDITIONAL(BUILD_MODULE_SENSORS, test "x$enable_sensors" = "xyes")
996 #AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [Disable serial statistics]),, [enable_serial="yes"])
997 #if test "x$enable_serial" != "xno"
999 # if test "x$ac_system" = "xLinux"
1001 # enable_serial="yes"
1003 # enable_serial="no"
1006 #if test "x$enable_serial" = "xno"
1008 # AC_DEFINE(COLLECT_SERIAL, 0, [Wether or not to collect serial statistics])
1010 #AM_CONDITIONAL(BUILD_MODULE_SERIAL, test "x$enable_serial" = "xyes")
1012 #AC_ARG_ENABLE(swap, AC_HELP_STRING([--disable-swap], [Disable swap statistics]),, [enable_swap="yes"])
1013 #if test "x$enable_swap" != "xno"
1015 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
1022 #if test "x$enable_swap" = "xno"
1024 # AC_DEFINE(COLLECT_SWAP, 0, [Wether or not to collect swap statistics])
1026 #AM_CONDITIONAL(BUILD_MODULE_SWAP, test "x$enable_swap" = "xyes")
1028 #AC_ARG_ENABLE(tape, AC_HELP_STRING([--disable-tape], [Disable tape statistics]),, [enable_tape="yes"])
1029 #if test "x$enable_tape" != "xno"
1031 # if test "x$with_kstat" = "xyes"
1038 #if test "x$enable_tape" = "xno"
1040 # AC_DEFINE(COLLECT_TAPE, 0, [Wether or not to collect tape statistics])
1042 #AM_CONDITIONAL(BUILD_MODULE_TAPE, test "x$enable_tape" = "xyes")
1044 #AC_ARG_ENABLE(traffic, AC_HELP_STRING([--disable-traffic], [Disable system traffic statistics]),, [enable_traffic="yes"])
1045 #if test "x$enable_traffic" != "xno"
1047 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
1049 # enable_traffic="yes"
1051 # enable_traffic="no"
1054 #if test "x$enable_traffic" = "xno"
1056 # AC_DEFINE(COLLECT_TRAFFIC, 0, [Wether or not to collect network traffic statistics])
1058 #AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes")
1060 #AC_COLLECTD([users], [disable], [module], [user count statistics])
1062 AC_OUTPUT(Makefile src/libconfig/Makefile src/liboping/Makefile src/Makefile)
1068 libcurl . . . . . . $with_libcurl
1069 libiokit . . . . . $with_libiokit
1070 librrd . . . . . . $with_rrdtool
1071 lm_sensors . . . . $with_lm_sensors
1072 libstatgrab . . . . $with_libstatgrab
1073 libkstat . . . . . $with_kstat
1074 libmysql . . . . . $with_libmysql
1077 debug . . . . . . . $enable_debug
1078 daemon mode . . . . $enable_daemon
1079 step . . . . . . . $collectd_step seconds
1080 heartbeat . . . . . $collectd_heartbeat seconds
1083 apache . . . . . . $enable_apache
1084 apcups . . . . . . $enable_apcups
1085 apple_sensors . . . $enable_apple_sensors
1086 battery . . . . . . $enable_battery
1087 cpu . . . . . . . . $enable_cpu
1088 cpufreq . . . . . . $enable_cpufreq
1089 df . . . . . . . . $enable_df
1090 disk . . . . . . . $enable_disk
1091 hddtemp . . . . . . $enable_hddtemp
1092 load . . . . . . . $enable_load
1093 memory . . . . . . $enable_memory
1094 mysql . . . . . . . $enable_mysql
1095 nfs . . . . . . . . $enable_nfs
1096 ping . . . . . . . $enable_ping
1097 processes . . . . . $enable_processes
1098 sensors . . . . . . $enable_sensors
1099 serial . . . . . . $enable_serial
1100 swap . . . . . . . $enable_swap
1101 tape . . . . . . . $enable_tape
1102 traffic . . . . . . $enable_traffic
1103 users . . . . . . . $enable_users
1104 vserver . . . . . . $enable_vserver
1105 wireless . . . . . $enable_wireless