1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 3.11.0)
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)
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 processes plugin
201 AC_CHECK_HEADERS(linux/config.h)
203 # For the swap module
204 AC_CHECK_HEADERS(sys/swap.h)
207 AC_CHECK_HEADERS(utmp.h)
208 AC_CHECK_HEADERS(utmpx.h)
211 AC_CHECK_HEADERS(ifaddrs.h)
212 AC_CHECK_HEADERS(net/if.h, [], [],
215 # include <sys/types.h>
217 #if HAVE_SYS_SOCKET_H
218 # include <sys/socket.h>
221 AC_CHECK_HEADERS(linux/if.h, [], [],
224 # include <sys/types.h>
226 #if HAVE_SYS_SOCKET_H
227 # include <sys/socket.h>
230 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
233 # include <sys/types.h>
235 #if HAVE_SYS_SOCKET_H
236 # include <sys/socket.h>
239 # include <linux/if.h>
244 AC_CHECK_HEADERS(curl/curl.h)
247 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
248 AC_CHECK_HEADERS(ctype.h)
249 AC_CHECK_HEADERS(limits.h)
250 AC_CHECK_HEADERS(sys/quota.h)
251 AC_CHECK_HEADERS(xfs/xqm.h)
253 # For mount interface
254 AC_CHECK_HEADERS(fs_info.h)
255 AC_CHECK_HEADERS(fshelp.h)
256 AC_CHECK_HEADERS(paths.h)
257 AC_CHECK_HEADERS(mntent.h)
258 AC_CHECK_HEADERS(mnttab.h)
259 AC_CHECK_HEADERS(sys/fstyp.h)
260 AC_CHECK_HEADERS(sys/fs_types.h)
261 AC_CHECK_HEADERS(sys/mntent.h)
262 AC_CHECK_HEADERS(sys/mnttab.h)
263 AC_CHECK_HEADERS(sys/mount.h)
264 AC_CHECK_HEADERS(sys/statfs.h)
265 AC_CHECK_HEADERS(sys/statvfs.h)
266 AC_CHECK_HEADERS(sys/vfs.h)
267 AC_CHECK_HEADERS(sys/vfstab.h)
269 # For the swap plugin, FreeBSD
270 AC_CHECK_HEADERS(kvm.h)
272 # For the email plugin
273 AC_CHECK_HEADERS(linux/un.h, [], [],
275 #if HAVE_SYS_SOCKET_H
276 # include <sys/socket.h>
279 AC_CHECK_HEADERS(sys/un.h)
280 AC_CHECK_HEADERS(grp.h)
282 # For debugging interface (variable number of arguments)
283 AC_CHECK_HEADERS(stdarg.h)
285 # Regular expressions for the ignorelist.
286 AC_CHECK_HEADERS(regex.h)
289 AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h)
291 AC_CHECK_HEADERS(net/if_arp.h)
292 AC_CHECK_HEADERS(net/if_ppp.h)
293 AC_CHECK_HEADERS(netinet/if_ether.h)
294 AC_CHECK_HEADERS(netinet/udp.h)
296 dnl Checking for libraries
300 # Checks for typedefs, structures, and compiler characteristics.
309 # Checks for library functions.
311 AC_PROG_GCC_TRADITIONAL
312 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
313 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
314 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
315 AC_CHECK_FUNCS(strncasecmp strcasecmp)
316 AC_CHECK_FUNCS(openlog syslog closelog)
318 socket_needs_socket="no"
319 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
320 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
322 nanosleep_needs_rt="no"
323 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
324 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
326 # Regular expressions for the ignorelist.
327 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
330 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
333 AC_CHECK_FUNCS(statfs statvfs)
336 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
338 # For the `processes' plugin
339 AC_CHECK_FUNCS(thread_info)
342 AC_CHECK_FUNCS(getutent getutxent)
345 AC_CHECK_FUNCS(quotactl)
346 AC_CHECK_FUNCS(getgrgid getpwuid)
349 AC_CHECK_FUNCS(getifaddrs)
351 # For mount interface
352 #AC_CHECK_FUNCS(getfsent getvfsent)
355 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
357 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
359 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
362 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
363 if test "x$have_getmntent" = "xno"; then
364 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
366 if test "x$have_getmntent" = "xno"; then
367 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
369 if test "x$have_getmntent" = "xno"; then
370 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
373 if test "x$have_getmntent" = "xc"; then
374 AC_CACHE_CHECK([whether getmntent takes one argument],
375 [have_one_getmntent],
377 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
379 #include "$srcdir/src/utils_mount.h"]],
383 fh = setmntent ("/etc/mtab", "r");
387 [have_one_getmntent="yes"],
388 [have_one_getmntent="no"]
391 AC_CACHE_CHECK([whether getmntent takes two arguments],
392 [have_two_getmntent],
394 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
395 #include <sys/mnttab.h>
396 #include "$srcdir/src/utils_mount.h"]],
401 fh = fopen ("/etc/mnttab", "r");
402 status = getmntent (fh, &mt);
405 [have_two_getmntent="yes"],
406 [have_two_getmntent="no"]
411 # Check for different versions of `getmntent' here..
413 if test "x$have_getmntent" = "xc"; then
414 if test "x$have_one_getmntent" = "xyes"; then
415 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
416 [Define if the function getmntent exists and takes one argument.])
418 if test "x$have_two_getmntent" = "xyes"; then
419 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
420 [Define if the function getmntent exists and takes two arguments.])
423 if test "x$have_getmntent" = "xsun"; then
424 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
425 [Define if the function getmntent exists. It's the version from libsun.])
427 if test "x$have_getmntent" = "xseq"; then
428 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
429 [Define if the function getmntent exists. It's the version from libseq.])
431 if test "x$have_getmntent" = "xgen"; then
432 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
433 [Define if the function getmntent exists. It's the version from libgen.])
436 # Check for structures
437 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
438 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
441 #include <sys/types.h>
442 #include <sys/socket.h>
445 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
446 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
449 #include <sys/types.h>
450 #include <sys/socket.h>
451 #include <linux/if.h>
452 #include <linux/netdevice.h>
455 AC_MSG_CHECKING([for kernel type ($host_os)])
458 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
462 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
468 AC_MSG_RESULT([$ac_system])
471 AC_CHECK_LIB(resolv, res_search,
473 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
475 [with_libresolv="no"])
476 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
479 m4_divert_once([HELP_WITH], [
480 collectd additional packages:])
482 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
483 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
484 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
486 LDFLAGS="$LDFLAGS -L$withval/lib"
487 CPPFLAGS="$CPPFLAGS -I$withval/include"
490 ], [with_rrdtool="yes"])
491 if test "x$with_rrdtool" = "xyes"
493 AC_CHECK_LIB(rrd, rrd_update,
495 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
497 [with_rrdtool="no (librrd not found)"], [-lm])
499 if test "x$with_rrdtool" = "xyes"
501 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
503 if test "x$with_rrdtool" = "xyes"
509 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
510 [Wether or not to use rrdtool library])
511 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
513 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
514 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
516 LDFLAGS="$LDFLAGS -L$withval/lib"
517 CPPFLAGS="$CPPFLAGS -I$withval/include"
518 with_libpthread="yes"
520 if test "x$withval" = "xno"
522 with_libpthread="no (disabled)"
525 ], [with_libpthread="yes"])
526 if test "x$with_libpthread" = "xyes"
528 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
530 if test "x$with_libpthread" = "xyes"
532 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
534 if test "x$with_libpthread" = "xyes"
540 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
541 [Wether or not to use pthread (POSIX threads) library])
542 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
544 if test "$ac_system" = "Solaris"
549 with_kstat="no (Solaris only)"
550 with_devinfo="no (Solaris only)"
553 if test "x$with_kstat" = "xyes"
555 AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"])
557 if test "x$with_kstat" = "xyes"
559 AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"])
560 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
562 if test "x$with_kstat" = "xyes"
568 AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat],
569 [Wether or not to use kstat library (Solaris)])
570 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
571 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
573 ### BEGIN of check for libcurl ###
574 with_curl_config="curl-config"
577 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
579 if test "x$withval" != "xno" -a "x$withval" != "xyes"
581 if test -x "$withval/bin/curl-config"
583 with_curl_config="$withval/bin/curl-config"
587 if test "x$withval" = "xno"
597 if test "x$with_libcurl" = "xyes"
599 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
600 curl_config_status=$?
602 if test $curl_config_status -ne 0
606 AC_CHECK_LIB(curl, curl_easy_init,
608 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
609 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
617 if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
619 with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
620 curl_config_status=$?
622 if test $curl_config_status -ne 0
626 if test -d "$with_curl_prefix/include"
628 CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
633 with_libcurl_numeric=0
634 if test "x$with_libcurl" = "xyes"
636 with_libcurl_numeric=1
638 AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
639 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
640 ### END of check for libcurl ###
644 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
653 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
654 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
656 with_libstatgrab="yes"
658 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
660 if test "x$withval" != "xno" -a "x$withval" != "xyes"
662 LDFLAGS="$LDFLAGS -L$withval/lib"
663 CPPFLAGS="$CPPFLAGS -I$withval/include"
664 with_libstatgrab="yes"
668 if test "x$ac_system" == "xunknown"
670 with_libstatgrab="yes"
672 with_libstatgrab="no"
675 if test "x$with_libstatgrab" = "xyes"
677 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
679 if test "x$with_libstatgrab" = "xyes"
681 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
683 if test "x$with_libstatgrab" = "xyes"
685 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
687 if test "x$with_libstatgrab" = "xyes"
689 collect_libstatgrab=1
691 collect_libstatgrab=0
693 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
694 [Wether or not to use statgrab library])
695 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
696 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
698 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
699 if test "x$with_libkvm" = "xyes"
701 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
703 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
705 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
707 if test "x$withval" != "xno" && test "x$withval" != "xyes"
709 LDFLAGS="$LDFLAGS -L$withval/lib"
710 CPPFLAGS="$CPPFLAGS -I$withval/include"
711 with_lm_sensors="yes"
715 if test "x$ac_system" = "xLinux"
717 with_lm_sensors="yes"
722 if test "x$with_lm_sensors" = "xyes"
724 AC_CHECK_LIB(sensors, sensors_init,
726 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
728 [with_lm_sensors="no (libsensors not found)"])
730 if test "x$with_lm_sensors" = "xyes"
732 AC_CHECK_HEADERS(sensors/sensors.h,
734 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
736 [with_lm_sensors="no (sensors/sensors.h not found)"])
738 if test "x$with_lm_sensors" = "xyes"
744 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
745 [Wether or not to use sensors library])
746 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
748 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
750 if test "x$withval" != "xno" && test "x$withval" != "xyes"
752 LDFLAGS="$LDFLAGS -L$withval/lib"
753 CPPFLAGS="$CPPFLAGS -I$withval/include"
760 if test "x$with_libmysql" = "xyes"
762 AC_CHECK_LIB(mysqlclient, mysql_init,
764 AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
765 ], [with_libmysql="no (libmysql not found)"])
767 if test "x$with_libmysql" = "xyes"
769 AC_CHECK_HEADERS(mysql/mysql.h,
771 AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
772 ], [with_libmysql="no (mysql/mysql.h not found)"])
774 if test "x$with_libmysql" = "xyes"
780 AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
781 [Wether or not to use mysql library])
782 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
785 with_own_liboping="no"
786 liboping_LDFLAGS="$LDFLAGS"
787 liboping_CPPFLAGS="$CPPFLAGS"
788 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
790 if test "x$withval" != "xno" && test "x$withval" != "xyes"
792 if test -d "$withval/lib"
794 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
796 if test -d "$withval/include"
798 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
801 if test "x$withval" = "xno"
804 with_own_liboping="no"
812 if test "x$with_liboping" = "xyes"
814 save_LDFLAGS="$LDFLAGS"
815 save_CPPFLAGS="$CPPFLAGS"
816 LDFLAGS="$liboping_LDFLAGS"
817 CPPFLAGS="$liboping_CPPFLAGS"
818 AC_CHECK_LIB(oping, ping_construct,
821 with_own_liboping="no"
825 with_own_liboping="yes"
826 LDFLAGS="$save_LDFLAGS"
827 CPPFLAGS="$save_CPPFLAGS"
830 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
831 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
832 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
834 with_liboping="yes (shipped version)"
837 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
839 if test "x$withval" != "xno" && test "x$withval" != "xyes"
841 LDFLAGS="$LDFLAGS -L$withval/lib"
842 CPPFLAGS="$CPPFLAGS -I$withval/include"
849 if test "x$with_libpcap" = "xyes"
851 AC_CHECK_LIB(pcap, pcap_open_live,
853 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
854 ], [with_libpcap="no (libpcap not found)"])
856 if test "x$with_libpcap" = "xyes"
858 AC_CHECK_HEADERS(pcap.h,
860 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
861 ], [with_libpcap="no (pcap.h not found)"])
863 if test "x$with_libpcap" = "xyes"
869 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
870 [Wether or not to use the pcap library])
871 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
873 # Define `step' and `hearbeat' values..
874 declare -i collectd_step=10
875 declare -i collectd_heartbeat=25
876 AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
878 if test "x$withval" != "xno" -a "x$withval" != "xyes"
880 declare -i tmp_collectd_step="$withval"
881 if test $tmp_collectd_step -gt 0
883 collectd_step=$tmp_collectd_step
884 let "collectd_heartbeat=$collectd_step*2"
888 AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
890 if test "x$withval" != "xno" -a "x$withval" != "xyes"
892 declare -i tmp_collectd_heartbeat="$withval"
893 if test $tmp_collectd_heartbeat -gt 0
895 collectd_heartbeat=$tmp_collectd_heartbeat
900 if test $collectd_step -ne 10
902 AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
904 if test $collectd_heartbeat -ne 25
906 AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
909 # Check for enabled/disabled features
912 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
913 # ------------------------------------------------------------
915 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
920 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
925 m4_define([EnDis],[disabled])dnl
926 m4_define([YesNo],[no])dnl
932 m4_define([EnDis],[enabled])dnl
933 m4_define([YesNo],[yes])dnl
936 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
940 m4_if([$3], [feature], [],
944 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
950 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
952 enable_$1='[YesNo]'dnl
954 if test "x$enable_$1" = "xno"
958 if test "x$enable_$1" = "xyes"
962 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
967 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
968 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
970 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
972 m4_divert_once([HELP_ENABLE], [
974 AC_COLLECTD([debug], [enable], [feature], [debugging])
975 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
976 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
978 m4_divert_once([HELP_ENABLE], [
980 AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics])
981 AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC])
982 AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
983 AC_COLLECTD([battery], [disable], [module], [battery statistics])
984 AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
985 AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
986 AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
987 AC_COLLECTD([df], [disable], [module], [df statistics])
988 AC_COLLECTD([dns], [disable], [module], [dns statistics])
989 AC_COLLECTD([email], [disable], [module], [email statistics])
990 AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
991 AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
992 AC_COLLECTD([load], [disable], [module], [system load statistics])
993 AC_COLLECTD([mbmon], [disable], [module], [motherboard monitor statistics])
994 AC_COLLECTD([memory], [disable], [module], [memory statistics])
995 AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
996 AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
997 AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
998 AC_COLLECTD([ntpd], [disable], [module], [nfs statistics])
999 AC_COLLECTD([ping], [disable], [module], [ping statistics])
1000 AC_COLLECTD([processes], [disable], [module], [processes statistics])
1001 AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
1002 AC_COLLECTD([serial], [disable], [module], [serial statistics])
1003 AC_COLLECTD([swap], [disable], [module], [swap statistics])
1004 AC_COLLECTD([tape], [disable], [module], [tape statistics])
1005 AC_COLLECTD([traffic], [disable], [module], [system traffic statistics])
1006 AC_COLLECTD([users], [disable], [module], [user count statistics])
1007 AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
1008 AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
1010 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libconfig/Makefile src/liboping/Makefile)
1016 libcurl . . . . . . $with_libcurl
1017 libiokit . . . . . $with_libiokit
1018 liboping . . . . . $with_liboping
1019 librrd . . . . . . $with_rrdtool
1020 lm_sensors . . . . $with_lm_sensors
1021 libstatgrab . . . . $with_libstatgrab
1022 libkstat . . . . . $with_kstat
1023 libmysql . . . . . $with_libmysql
1024 libpcap . . . . . . $with_libpcap
1025 libpthread . . . . $with_libpthread
1028 debug . . . . . . . $enable_debug
1029 daemon mode . . . . $enable_daemon
1030 step . . . . . . . $collectd_step seconds
1031 heartbeat . . . . . $collectd_heartbeat seconds
1034 apache . . . . . . $enable_apache
1035 apcups . . . . . . $enable_apcups
1036 apple_sensors . . . $enable_apple_sensors
1037 battery . . . . . . $enable_battery
1038 cpu . . . . . . . . $enable_cpu
1039 cpufreq . . . . . . $enable_cpufreq
1040 df . . . . . . . . $enable_df
1041 disk . . . . . . . $enable_disk
1042 dns . . . . . . . . $enable_dns
1043 email . . . . . . . $enable_email
1044 hddtemp . . . . . . $enable_hddtemp
1045 load . . . . . . . $enable_load
1046 mbmon . . . . . . . $enable_mbmon
1047 memory . . . . . . $enable_memory
1048 multimeter . . . . $enable_multimeter
1049 mysql . . . . . . . $enable_mysql
1050 nfs . . . . . . . . $enable_nfs
1051 ntpd . . . . . . . $enable_ntpd
1052 ping . . . . . . . $enable_ping
1053 processes . . . . . $enable_processes
1054 sensors . . . . . . $enable_sensors
1055 serial . . . . . . $enable_serial
1056 swap . . . . . . . $enable_swap
1057 tape . . . . . . . $enable_tape
1058 traffic . . . . . . $enable_traffic
1059 users . . . . . . . $enable_users
1060 vserver . . . . . . $enable_vserver
1061 wireless . . . . . $enable_wireless