configure.in: Many fixes for Solaris. Especially check the `kstat_io_t'-type for...
[collectd.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 4.0.0-rc2)
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
6 AC_LANG(C)
7
8 AC_PREFIX_DEFAULT("/opt/collectd")
9
10 #
11 # Checks for programs.
12 #
13 AC_PROG_CC
14 AC_PROG_CPP
15 AC_PROG_INSTALL
16 AC_PROG_LN_S
17 AC_PROG_MAKE_SET
18 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
19
20 dnl configure libtool
21 AC_DISABLE_STATIC
22 AC_LIBLTDL_CONVENIENCE
23 AC_SUBST(LTDLINCL)
24 AC_SUBST(LIBLTDL)
25 AC_LIBTOOL_DLOPEN
26 AC_PROG_LIBTOOL
27 AC_PROG_LEX
28 AC_PROG_YACC
29 AC_CONFIG_SUBDIRS(libltdl)
30
31 #
32 # Checks for header files.
33 #
34 AC_HEADER_STDC
35 AC_HEADER_SYS_WAIT
36 AC_HEADER_DIRENT
37 AC_CHECK_HEADERS(stdint.h)
38 AC_CHECK_HEADERS(stdio.h)
39 AC_CHECK_HEADERS(errno.h)
40 AC_CHECK_HEADERS(math.h)
41 AC_CHECK_HEADERS(syslog.h)
42 AC_CHECK_HEADERS(fcntl.h)
43 AC_CHECK_HEADERS(signal.h)
44 AC_CHECK_HEADERS(assert.h)
45 AC_CHECK_HEADERS(sys/types.h)
46 AC_CHECK_HEADERS(sys/socket.h)
47 AC_CHECK_HEADERS(sys/select.h)
48 AC_CHECK_HEADERS(poll.h)
49 AC_CHECK_HEADERS(netdb.h)
50 AC_CHECK_HEADERS(arpa/inet.h)
51 AC_CHECK_HEADERS(sys/resource.h)
52 AC_CHECK_HEADERS(sys/param.h)
53 AC_CHECK_HEADERS(kstat.h)
54
55 # For ping library
56 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
57 [#if HAVE_STDINT_H
58 # include <stdint.h>
59 #endif
60 #if HAVE_SYS_TYPES_H
61 # include <sys/types.h>
62 #endif
63 ])
64 AC_CHECK_HEADERS(netinet/in.h, [], [],
65 [#if HAVE_STDINT_H
66 # include <stdint.h>
67 #endif
68 #if HAVE_SYS_TYPES_H
69 # include <sys/types.h>
70 #endif
71 #if HAVE_NETINET_IN_SYSTM_H
72 # include <netinet/in_systm.h>
73 #endif
74 ])
75 AC_CHECK_HEADERS(netinet/ip.h, [], [],
76 [#if HAVE_STDINT_H
77 # include <stdint.h>
78 #endif
79 #if HAVE_SYS_TYPES_H
80 # include <sys/types.h>
81 #endif
82 #if HAVE_NETINET_IN_SYSTM_H
83 # include <netinet/in_systm.h>
84 #endif
85 #if HAVE_NETINET_IN_H
86 # include <netinet/in.h>
87 #endif
88 ])
89 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
90 [#if HAVE_STDINT_H
91 # include <stdint.h>
92 #endif
93 #if HAVE_SYS_TYPES_H
94 # include <sys/types.h>
95 #endif
96 #if HAVE_NETINET_IN_SYSTM_H
97 # include <netinet/in_systm.h>
98 #endif
99 #if HAVE_NETINET_IN_H
100 # include <netinet/in.h>
101 #endif
102 #if HAVE_NETINET_IP_H
103 # include <netinet/ip.h>
104 #endif
105 ])
106 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
107 [#if HAVE_STDINT_H
108 # include <stdint.h>
109 #endif
110 #if HAVE_SYS_TYPES_H
111 # include <sys/types.h>
112 #endif
113 #if HAVE_NETINET_IN_SYSTM_H
114 # include <netinet/in_systm.h>
115 #endif
116 #if HAVE_NETINET_IN_H
117 # include <netinet/in.h>
118 #endif
119 #if HAVE_NETINET_IP_H
120 # include <netinet/ip.h>
121 #endif
122 ])
123 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
124 [#if HAVE_STDINT_H
125 # include <stdint.h>
126 #endif
127 #if HAVE_SYS_TYPES_H
128 # include <sys/types.h>
129 #endif
130 #if HAVE_NETINET_IN_SYSTM_H
131 # include <netinet/in_systm.h>
132 #endif
133 #if HAVE_NETINET_IN_H
134 # include <netinet/in.h>
135 #endif
136 ])
137 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
138 [#if HAVE_STDINT_H
139 # include <stdint.h>
140 #endif
141 #if HAVE_SYS_TYPES_H
142 # include <sys/types.h>
143 #endif
144 #if HAVE_NETINET_IN_SYSTM_H
145 # include <netinet/in_systm.h>
146 #endif
147 #if HAVE_NETINET_IN_H
148 # include <netinet/in.h>
149 #endif
150 #if HAVE_NETINET_IP6_H
151 # include <netinet/ip6.h>
152 #endif
153 ])
154 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
155 [#if HAVE_STDINT_H
156 # include <stdint.h>
157 #endif
158 #if HAVE_SYS_TYPES_H
159 # include <sys/types.h>
160 #endif
161 #if HAVE_NETINET_IN_SYSTM_H
162 # include <netinet/in_systm.h>
163 #endif
164 #if HAVE_NETINET_IN_H
165 # include <netinet/in.h>
166 #endif
167 #if HAVE_NETINET_IP_H
168 # include <netinet/ip.h>
169 #endif
170 ])
171 AC_CHECK_HEADERS(netinet/udp.h, [], [],
172 [#if HAVE_STDINT_H
173 # include <stdint.h>
174 #endif
175 #if HAVE_SYS_TYPES_H
176 # include <sys/types.h>
177 #endif
178 #if HAVE_NETINET_IN_SYSTM_H
179 # include <netinet/in_systm.h>
180 #endif
181 #if HAVE_NETINET_IN_H
182 # include <netinet/in.h>
183 #endif
184 #if HAVE_NETINET_IP_H
185 # include <netinet/ip.h>
186 #endif
187 ])
188
189 # For cpu modules
190 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
191 AC_CHECK_HEADERS(mach/mach_init.h)
192 AC_CHECK_HEADERS(mach/host_priv.h)
193 AC_CHECK_HEADERS(mach/mach_error.h)
194 AC_CHECK_HEADERS(mach/mach_host.h)
195 AC_CHECK_HEADERS(mach/mach_port.h)
196 AC_CHECK_HEADERS(mach/mach_types.h)
197 AC_CHECK_HEADERS(mach/message.h)
198 AC_CHECK_HEADERS(mach/processor_set.h)
199 AC_CHECK_HEADERS(mach/processor.h)
200 AC_CHECK_HEADERS(mach/processor_info.h)
201 AC_CHECK_HEADERS(mach/task.h)
202 AC_CHECK_HEADERS(mach/thread_act.h)
203 AC_CHECK_HEADERS(mach/vm_region.h)
204 AC_CHECK_HEADERS(mach/vm_map.h)
205 AC_CHECK_HEADERS(mach/vm_prot.h)
206 AC_CHECK_HEADERS(mach/vm_statistics.h)
207 AC_CHECK_HEADERS(mach/kern_return.h)
208
209 # For hddtemp module
210 AC_CHECK_HEADERS(linux/major.h)
211
212 # For the apple_sensors module
213 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
214 AC_CHECK_HEADERS(IOKit/IOKitLib.h)
215 AC_CHECK_HEADERS(IOKit/IOTypes.h)
216
217 # For the battery plugin
218 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
219 [
220 #if HAVE_IOKIT_IOKITLIB_H
221 #  include <IOKit/IOKitLib.h>
222 #endif
223 #if HAVE_IOKIT_IOTYPES_H
224 #  include <IOKit/IOTypes.h>
225 #endif
226 ])
227 AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h)
228
229 # For the `disk' plugin
230 AC_CHECK_HEADERS(IOKit/IOBSD.h)
231 AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
232
233 # For load module
234 AC_CHECK_HEADERS(sys/loadavg.h)
235
236 # For the processes plugin
237 AC_CHECK_HEADERS(linux/config.h)
238
239 # For the swap module
240 AC_CHECK_HEADERS(sys/swap.h)
241
242 # For users module
243 AC_CHECK_HEADERS(utmp.h)
244 AC_CHECK_HEADERS(utmpx.h)
245
246 # For interface plugin
247 AC_CHECK_HEADERS(ifaddrs.h)
248 AC_CHECK_HEADERS(net/if.h, [], [],
249 [
250 #if HAVE_SYS_TYPES_H
251 #  include <sys/types.h>
252 #endif
253 #if HAVE_SYS_SOCKET_H
254 #  include <sys/socket.h>
255 #endif
256 ])
257 AC_CHECK_HEADERS(linux/if.h, [], [],
258 [
259 #if HAVE_SYS_TYPES_H
260 #  include <sys/types.h>
261 #endif
262 #if HAVE_SYS_SOCKET_H
263 #  include <sys/socket.h>
264 #endif
265 ])
266 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
267 [
268 #if HAVE_SYS_TYPES_H
269 #  include <sys/types.h>
270 #endif
271 #if HAVE_SYS_SOCKET_H
272 #  include <sys/socket.h>
273 #endif
274 #if HAVE_LINUX_IF_H
275 # include <linux/if.h>
276 #endif
277 ])
278
279 # For apache plugin
280 AC_CHECK_HEADERS(curl/curl.h)
281
282 # For quota module
283 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
284 AC_CHECK_HEADERS(ctype.h)
285 AC_CHECK_HEADERS(limits.h)
286 AC_CHECK_HEADERS(sys/quota.h)
287 AC_CHECK_HEADERS(xfs/xqm.h)
288
289 # For mount interface
290 AC_CHECK_HEADERS(fs_info.h)
291 AC_CHECK_HEADERS(fshelp.h)
292 AC_CHECK_HEADERS(paths.h)
293 AC_CHECK_HEADERS(mntent.h)
294 AC_CHECK_HEADERS(mnttab.h)
295 AC_CHECK_HEADERS(sys/fstyp.h)
296 AC_CHECK_HEADERS(sys/fs_types.h)
297 AC_CHECK_HEADERS(sys/mntent.h)
298 AC_CHECK_HEADERS(sys/mnttab.h)
299 AC_CHECK_HEADERS(sys/mount.h)
300 AC_CHECK_HEADERS(sys/statfs.h)
301 AC_CHECK_HEADERS(sys/statvfs.h)
302 AC_CHECK_HEADERS(sys/vfs.h)
303 AC_CHECK_HEADERS(sys/vfstab.h)
304
305 # For the swap plugin, FreeBSD
306 AC_CHECK_HEADERS(kvm.h)
307
308 # For the email plugin
309 AC_CHECK_HEADERS(linux/un.h, [], [],
310 [
311 #if HAVE_SYS_SOCKET_H
312 #       include <sys/socket.h>
313 #endif
314 ])
315 AC_CHECK_HEADERS(sys/un.h)
316 AC_CHECK_HEADERS(grp.h)
317
318 # For debugging interface (variable number of arguments)
319 AC_CHECK_HEADERS(stdarg.h)
320
321 # Regular expressions for the ignorelist.
322 AC_CHECK_HEADERS(regex.h)
323
324 # For the dns plugin
325 AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h)
326
327 AC_CHECK_HEADERS(net/if_arp.h, [], [],
328 [#if HAVE_SYS_SOCKET_H
329 # include <sys/socket.h>
330 #endif
331 ])
332 AC_CHECK_HEADERS(net/if_ppp.h)
333 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
334 [#if HAVE_STDINT_H
335 # include <stdint.h>
336 #endif
337 #if HAVE_SYS_TYPES_H
338 # include <sys/types.h>
339 #endif
340 #if HAVE_SYS_SOCKET_H
341 # include <sys/socket.h>
342 #endif
343 #if HAVE_NET_IF_H
344 # include <net/if.h>
345 #endif
346 #if HAVE_NETINET_IN_H
347 # include <netinet/in.h>
348 #endif
349 ])
350
351 # For the multimeter plugin
352 AC_CHECK_HEADERS(termios.h)
353 AC_CHECK_HEADERS(sys/ioctl.h)
354
355 #
356 # Checking for libraries
357 #
358 AC_CHECK_LIB(m, ext)
359
360 #
361 # Checks for typedefs, structures, and compiler characteristics.
362 #
363 AC_C_CONST
364 AC_TYPE_PID_T
365 AC_TYPE_SIZE_T
366 AC_TYPE_UID_T
367 AC_HEADER_TIME
368
369 #
370 # Checks for library functions.
371 #
372 AC_PROG_GCC_TRADITIONAL
373 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
374 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
375 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
376 AC_CHECK_FUNCS(strncasecmp strcasecmp)
377 AC_CHECK_FUNCS(openlog syslog closelog)
378
379 socket_needs_socket="no"
380 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
381 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
382
383 nanosleep_needs_rt="no"
384 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
385 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
386
387 # Regular expressions for the ignorelist.
388 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
389
390 # For cpu module
391 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
392
393 # For df module
394 AC_CHECK_FUNCS(statfs statvfs)
395
396 # For load module
397 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
398
399 # For the `processes' plugin
400 AC_CHECK_FUNCS(thread_info)
401
402 # For users module
403 AC_CHECK_FUNCS(getutent getutxent)
404
405 # For quota module
406 AC_CHECK_FUNCS(quotactl)
407 AC_CHECK_FUNCS(getgrgid getpwuid)
408
409 # For interface module
410 AC_CHECK_FUNCS(getifaddrs)
411
412 # Check for NAN
413 nan_type="none"
414 if test "x$nan_type" = "xnone"; then
415   AC_CACHE_CHECK([whether NAN is defined by default],
416     [have_nan_default],
417     AC_COMPILE_IFELSE(
418       AC_LANG_PROGRAM(
419       [[
420 #include <stdlib.h>
421 #include <math.h>
422 static float foo = NAN;
423       ]],
424       [[
425        if (isnan (foo))
426         return 0;
427        else
428         return 1;
429       ]]),
430       [have_nan_default="yes"],
431       [have_nan_default="no"]
432     )
433   )
434   if test "x$have_nan_default" = "xyes"
435   then
436    nan_type="default"
437    AC_DEFINE(NAN_STATIC_DEFAULT, 1,
438      [Define if NAN is defined by default and can initialize static variables.])
439   fi
440 fi
441 if test "x$nan_type" = "xnone"; then
442   AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
443     [have_nan_isoc],
444     AC_COMPILE_IFELSE(
445       AC_LANG_PROGRAM(
446       [[
447 #include <stdlib.h>
448 #define __USE_ISOC99 1
449 #include <math.h>
450 static float foo = NAN;
451       ]],
452       [[
453        if (isnan (foo))
454         return 0;
455        else
456         return 1;
457       ]]),
458       [have_nan_isoc="yes"],
459       [have_nan_isoc="no"]
460     )
461   )
462   if test "x$have_nan_isoc" = "xyes"
463   then
464    nan_type="isoc99"
465    AC_DEFINE(NAN_STATIC_ISOC, 1,
466      [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
467   fi
468 fi
469 if test "x$nan_type" = "xnone"; then
470   AC_CACHE_CHECK([whether NAN can be defined by 0/0],
471     [have_nan_zero],
472     AC_RUN_IFELSE(
473       AC_LANG_PROGRAM(
474       [[
475 #include <stdlib.h>
476 #include <math.h>
477 #ifdef NAN
478 # undef NAN
479 #endif
480 #define NAN (0.0 / 0.0)
481 #ifndef isnan
482 # define isnan(f) ((f) != (f))
483 #endif
484 static float foo = NAN;
485       ]],
486       [[
487        if (isnan (foo))
488         return 0;
489        else
490         return 1;
491       ]]),
492       [have_nan_zero="yes"],
493       [have_nan_zero="no"]
494     )
495   )
496   if test "x$have_nan_zero" = "xyes"
497   then
498    nan_type="zero"
499    AC_DEFINE(NAN_ZERO_ZERO, 1,
500      [Define if NAN can be defined as (0.0 / 0.0)])
501   fi
502 fi
503 if test "x$nan_type" = "xnone"; then
504   AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
505 fi
506
507 # For mount interface
508 #AC_CHECK_FUNCS(getfsent getvfsent)
509
510 have_getfsstat="no"
511 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
512 have_getvfsstat="no"
513 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
514 have_listmntent="no"
515 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
516
517 have_getmntent="no"
518 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
519 if test "x$have_getmntent" = "xno"; then
520         AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
521 fi
522 if test "x$have_getmntent" = "xno"; then
523         AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
524 fi
525 if test "x$have_getmntent" = "xno"; then
526         AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
527 fi
528
529 if test "x$have_getmntent" = "xc"; then
530         AC_CACHE_CHECK([whether getmntent takes one argument],
531                 [have_one_getmntent],
532                 AC_COMPILE_IFELSE(
533                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
534 #include <mntent.h>
535 #include "$srcdir/src/utils_mount.h"]],
536                                 [[
537                                  FILE *fh;
538                                  struct mntent *me;
539                                  fh = setmntent ("/etc/mtab", "r");
540                                  me = getmntent (fh);
541                                 ]]
542                         ),
543                         [have_one_getmntent="yes"],
544                         [have_one_getmntent="no"]
545                 )
546         )
547         AC_CACHE_CHECK([whether getmntent takes two arguments],
548                 [have_two_getmntent],
549                 AC_COMPILE_IFELSE(
550                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
551 #include <sys/mnttab.h>
552 #include "$srcdir/src/utils_mount.h"]],
553                                 [[
554                                  FILE *fh;
555                                  struct mnttab mt;
556                                  int status;
557                                  fh = fopen ("/etc/mnttab", "r");
558                                  status = getmntent (fh, &mt);
559                                 ]]
560                         ),
561                         [have_two_getmntent="yes"],
562                         [have_two_getmntent="no"]
563                 )
564         )
565 fi
566
567 # Check for different versions of `getmntent' here..
568
569 if test "x$have_getmntent" = "xc"; then
570         if test "x$have_one_getmntent" = "xyes"; then
571                 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
572                           [Define if the function getmntent exists and takes one argument.])
573         fi
574         if test "x$have_two_getmntent" = "xyes"; then
575                 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
576                           [Define if the function getmntent exists and takes two arguments.])
577         fi
578 fi
579 if test "x$have_getmntent" = "xsun"; then
580         AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
581                   [Define if the function getmntent exists. It's the version from libsun.])
582 fi
583 if test "x$have_getmntent" = "xseq"; then
584         AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
585                   [Define if the function getmntent exists. It's the version from libseq.])
586 fi
587 if test "x$have_getmntent" = "xgen"; then
588         AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
589                   [Define if the function getmntent exists. It's the version from libgen.])
590 fi
591
592 # Check for structures
593 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
594         [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
595         [],
596         [
597         #include <sys/types.h>
598         #include <sys/socket.h>
599         #include <net/if.h>
600         ])
601 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
602         [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
603         [],
604         [
605         #include <sys/types.h>
606         #include <sys/socket.h>
607         #include <linux/if.h>
608         #include <linux/netdevice.h>
609         ])
610
611 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
612 [#if HAVE_STDINT_H
613 # include <stdint.h>
614 #endif
615 #if HAVE_SYS_TYPES_H
616 # include <sys/types.h>
617 #endif
618 #if HAVE_NETINET_IN_SYSTM_H
619 # include <netinet/in_systm.h>
620 #endif
621 #if HAVE_NETINET_IN_H
622 # include <netinet/in.h>
623 #endif
624 #if HAVE_NETINET_IP_H
625 # include <netinet/ip.h>
626 #endif
627 #if HAVE_NETINET_UDP_H
628 # include <netinet/udp.h>
629 #endif
630 ])
631 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
632 [#if HAVE_STDINT_H
633 # include <stdint.h>
634 #endif
635 #if HAVE_SYS_TYPES_H
636 # include <sys/types.h>
637 #endif
638 #if HAVE_NETINET_IN_SYSTM_H
639 # include <netinet/in_systm.h>
640 #endif
641 #if HAVE_NETINET_IN_H
642 # include <netinet/in.h>
643 #endif
644 #if HAVE_NETINET_IP_H
645 # include <netinet/ip.h>
646 #endif
647 #if HAVE_NETINET_UDP_H
648 # include <netinet/udp.h>
649 #endif
650 ])
651
652 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
653         [],
654         [],
655         [
656 #if HAVE_KSTAT_H
657 # include <kstat.h>
658 #endif
659         ])
660
661 AC_MSG_CHECKING([for kernel type ($host_os)])
662 case $host_os in
663         *linux*)
664         AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
665         ac_system="Linux"
666         ;;
667         *solaris*)
668         AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
669         ac_system="Solaris"
670         ;;
671         *)
672         ac_system="unknown"
673 esac
674 AC_MSG_RESULT([$ac_system])
675
676 with_libresolv="yes"
677 AC_CHECK_LIB(resolv, res_search,
678 [
679         AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
680 ],
681 [with_libresolv="no"])
682 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
683
684
685 m4_divert_once([HELP_WITH], [
686 collectd additional packages:])
687
688 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
689 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
690 [       if test "x$withval" != "xno" && test "x$withval" != "xyes"
691         then
692                 LDFLAGS="$LDFLAGS -L$withval/lib"
693                 CPPFLAGS="$CPPFLAGS -I$withval/include"
694                 with_rrdtool="yes"
695         fi
696 ], [with_rrdtool="yes"])
697 if test "x$with_rrdtool" = "xyes"
698 then
699         AC_CHECK_LIB(rrd, rrd_update,
700         [
701                 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
702         ],
703         [with_rrdtool="no (librrd not found)"], [-lm])
704 fi
705 if test "x$with_rrdtool" = "xyes"
706 then
707         AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
708 fi
709 if test "x$with_rrdtool" = "xyes"
710 then
711         collect_rrdtool=1
712 else
713         collect_rrdtool=0
714 fi
715 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
716         [Wether or not to use rrdtool library])
717 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
718
719 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
720 [       if test "x$withval" != "xno" -a "x$withval" != "xyes"
721         then
722                 LDFLAGS="$LDFLAGS -L$withval/lib"
723                 CPPFLAGS="$CPPFLAGS -I$withval/include"
724                 with_libpthread="yes"
725         else
726                 if test "x$withval" = "xno"
727                 then
728                         with_libpthread="no (disabled)"
729                 fi
730         fi
731 ], [with_libpthread="yes"])
732 if test "x$with_libpthread" = "xyes"
733 then
734         AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
735 fi
736 if test "x$with_libpthread" = "xyes"
737 then
738         AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
739 fi
740 if test "x$with_libpthread" = "xyes"
741 then
742         collect_pthread=1
743 else
744         collect_pthread=0
745 fi
746 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
747         [Wether or not to use pthread (POSIX threads) library])
748 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
749
750 if test "$ac_system" = "Solaris"
751 then
752         with_kstat="yes"
753         with_devinfo="yes"
754 else
755         with_kstat="no (Solaris only)"
756         with_devinfo="no (Solaris only)"
757 fi
758
759 if test "x$with_kstat" = "xyes"
760 then
761         AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
762 fi
763 if test "x$with_kstat" = "xyes"
764 then
765         AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
766         AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
767 fi
768 if test "x$with_kstat" = "xyes"
769 then
770         AC_DEFINE(HAVE_LIBKSTAT, 1,
771                   [Define to 1 if you have the 'kstat' library (-lkstat)])
772 fi
773 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
774 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
775
776 ### BEGIN of check for libcurl ###
777 with_curl_config="curl-config"
778 with_curl_prefix=0
779 with_curl_libs=""
780 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
781 [
782         if test "x$withval" != "xno" -a "x$withval" != "xyes"
783         then
784                 if test -x "$withval/bin/curl-config"
785                 then
786                         with_curl_config="$withval/bin/curl-config"
787                         with_curl_prefix=1
788                 fi
789         fi
790         if test "x$withval" = "xno"
791         then
792                 with_libcurl="no"
793         else
794                 with_libcurl="yes"
795         fi
796 ],
797 [
798         with_libcurl="yes"
799 ])
800 if test "x$with_libcurl" = "xyes"
801 then
802         with_curl_libs=`$with_curl_config --libs 2>/dev/null`
803         curl_config_status=$?
804
805         if test $curl_config_status -ne 0
806         then
807                 with_libcurl="no"
808         else
809                 AC_CHECK_LIB(curl, curl_easy_init,
810                 [
811                         BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
812                         AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
813                 ],
814                 [
815                         with_libcurl="no"
816                 ],
817                 [$with_curl_libs])
818         fi
819 fi
820 if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
821 then
822         with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
823         curl_config_status=$?
824
825         if test $curl_config_status -ne 0
826         then
827                 with_libcurl="no"
828         else
829                 if test -d "$with_curl_prefix/include"
830                 then
831                         CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
832                 fi
833         fi
834 fi
835
836 with_libcurl_numeric=0
837 if test "x$with_libcurl" = "xyes"
838 then
839         with_libcurl_numeric=1
840 fi
841 AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
842 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
843 ### END of check for libcurl ###
844
845 with_libiokit="no"
846 collectd_libiokit=0
847 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
848 [
849         with_libiokit="yes"
850         collectd_libiokit=1
851 ], 
852 [
853         with_libiokit="no"
854         collectd_libiokit=0
855 ])
856 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
857 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
858
859 with_libstatgrab="yes"
860 with_libdevstat="no"
861 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
862 [
863         if test "x$withval" != "xno" -a "x$withval" != "xyes"
864         then
865                 LDFLAGS="$LDFLAGS -L$withval/lib"
866                 CPPFLAGS="$CPPFLAGS -I$withval/include"
867                 with_libstatgrab="yes"
868         fi
869 ],
870 [
871         if test "x$ac_system" == "xunknown"
872         then
873                 with_libstatgrab="yes"
874         else
875                 with_libstatgrab="no"
876         fi
877 ])
878 if test "x$with_libstatgrab" = "xyes"
879 then
880         AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
881 fi
882 if test "x$with_libstatgrab" = "xyes"
883 then
884         AC_CHECK_HEADERS(statgrab.h,,    [with_libstatgrab="no (statgrab.h not found)"])
885 fi
886 if test "x$with_libstatgrab" = "xyes"
887 then
888         AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
889 fi
890 if test "x$with_libstatgrab" = "xyes"
891 then
892         collect_libstatgrab=1
893 else
894         collect_libstatgrab=0
895 fi
896 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
897         [Wether or not to use statgrab library])
898 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
899 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT,  test "x$with_libdevstat"  = "xyes")
900
901 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
902 if test "x$with_libkvm" = "xyes"
903 then
904         AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
905 fi
906 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
907
908 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
909 [
910         if test "x$withval" != "xno" && test "x$withval" != "xyes"
911         then
912                 LDFLAGS="$LDFLAGS -L$withval/lib"
913                 CPPFLAGS="$CPPFLAGS -I$withval/include"
914                 with_lm_sensors="yes"
915         fi
916 ],
917 [
918         if test "x$ac_system" = "xLinux"
919         then
920                 with_lm_sensors="yes"
921         else
922                 with_lm_sensors="no"
923         fi
924 ])
925 if test "x$with_lm_sensors" = "xyes"
926 then
927         AC_CHECK_LIB(sensors, sensors_init,
928         [
929                 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
930         ],
931         [with_lm_sensors="no (libsensors not found)"])
932 fi
933 if test "x$with_lm_sensors" = "xyes"
934 then
935         AC_CHECK_HEADERS(sensors/sensors.h,
936         [
937                 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
938         ],
939         [with_lm_sensors="no (sensors/sensors.h not found)"])
940 fi
941 if test "x$with_lm_sensors" = "xyes"
942 then
943         collect_lm_sensors=1
944 else
945         collect_lm_sensors=0
946 fi
947 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
948         [Wether or not to use sensors library])
949 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
950
951 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
952 [
953         if test "x$withval" != "xno" && test "x$withval" != "xyes"
954         then
955                 LDFLAGS="$LDFLAGS -L$withval/lib"
956                 CPPFLAGS="$CPPFLAGS -I$withval/include"
957                 with_libmysql="yes"
958         fi
959 ],
960 [
961         with_libmysql="yes"
962 ])
963 if test "x$with_libmysql" = "xyes"
964 then
965         AC_CHECK_LIB(mysqlclient, mysql_init,
966         [
967                 AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
968         ], [with_libmysql="no (libmysql not found)"])
969 fi
970 if test "x$with_libmysql" = "xyes"
971 then
972         AC_CHECK_HEADERS(mysql/mysql.h,
973         [
974                 AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
975         ], [with_libmysql="no (mysql/mysql.h not found)"])
976 fi
977 if test "x$with_libmysql" = "xyes"
978 then
979         collect_libmysql=1
980 else
981         collect_libmysql=0
982 fi
983 AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
984         [Wether or not to use mysql library])
985 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
986
987 #with_liboping="yes"
988 with_own_liboping="no"
989 liboping_LDFLAGS="$LDFLAGS"
990 liboping_CPPFLAGS="$CPPFLAGS"
991 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
992 [
993         if test "x$withval" != "xno" && test "x$withval" != "xyes"
994         then
995                 if test -d "$withval/lib"
996                 then
997                         liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
998                 fi
999                 if test -d "$withval/include"
1000                 then
1001                         liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1002                 fi
1003         fi
1004         if test "x$withval" = "xno"
1005         then
1006                 with_liboping="no"
1007                 with_own_liboping="no"
1008         fi
1009 ],
1010 [
1011         #753
1012         with_liboping="yes"
1013 ])
1014
1015 if test "x$with_liboping" = "xyes"
1016 then
1017         save_LDFLAGS="$LDFLAGS"
1018         save_CPPFLAGS="$CPPFLAGS"
1019         LDFLAGS="$liboping_LDFLAGS"
1020         CPPFLAGS="$liboping_CPPFLAGS"
1021         AC_CHECK_LIB(oping, ping_construct,
1022         [
1023                 with_liboping="yes"
1024                 with_own_liboping="no"
1025         ],
1026         [
1027                 with_liboping="yes"
1028                 with_own_liboping="yes"
1029                 LDFLAGS="$save_LDFLAGS"
1030                 CPPFLAGS="$save_CPPFLAGS"
1031         ])
1032 fi
1033 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1034 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1035 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1036 then
1037         with_liboping="yes (shipped version)"
1038 fi
1039
1040 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1041 [
1042         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1043         then
1044                 LDFLAGS="$LDFLAGS -L$withval/lib"
1045                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1046                 with_libpcap="yes"
1047         fi
1048 ],
1049 [
1050         with_libpcap="yes"
1051 ])
1052 if test "x$with_libpcap" = "xyes"
1053 then
1054         AC_CHECK_LIB(pcap, pcap_open_live,
1055         [
1056                 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1057         ], [with_libpcap="no (libpcap not found)"])
1058 fi
1059 if test "x$with_libpcap" = "xyes"
1060 then
1061         AC_CHECK_HEADERS(pcap.h,
1062         [
1063                 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1064         ], [with_libpcap="no (pcap.h not found)"])
1065 fi
1066 if test "x$with_libpcap" = "xyes"
1067 then
1068         collect_libpcap=1
1069 else
1070         collect_libpcap=0
1071 fi
1072 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1073         [Wether or not to use the pcap library])
1074 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1075
1076 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1077 [
1078         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1079         then
1080                 LDFLAGS="$LDFLAGS -L$withval/lib"
1081                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1082                 with_libiptc="yes"
1083         fi
1084 ],
1085 [
1086         if test "x$ac_system" = "xLinux"
1087         then
1088                 with_libiptc="yes"
1089         else
1090                 with_libiptc="no (Linux only)"
1091         fi
1092 ])
1093 if test "x$with_libiptc" = "xyes"
1094 then
1095         AC_CHECK_LIB(iptc, iptc_init,
1096         [
1097                 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1098         ], [with_libiptc="no (libiptc not found)"])
1099 fi
1100 if test "x$with_libiptc" = "xyes"
1101 then
1102         AC_CHECK_HEADERS(libiptc/libiptc.h,
1103         [
1104                 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1105         ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1106 fi
1107 if test "x$with_libiptc" = "xyes"
1108 then
1109         collect_libiptc=1
1110 else
1111         collect_libiptc=0
1112 fi
1113 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1114
1115 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1116 [
1117         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1118         then
1119                 LDFLAGS="$LDFLAGS -L$withval/lib"
1120                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1121                 with_libupsclient="yes"
1122         fi
1123 ],
1124 [
1125         with_libupsclient="yes"
1126 ])
1127 if test "x$with_libupsclient" = "xyes"
1128 then
1129         AC_CHECK_LIB(upsclient, upscli_connect,
1130         [
1131                 AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).])
1132         ], [with_libupsclient="no (libupsclient not found)"])
1133 fi
1134 if test "x$with_libupsclient" = "xyes"
1135 then
1136         AC_CHECK_HEADERS(upsclient.h,
1137         [
1138                 AC_DEFINE(HAVE_UPSCLIENT_H, 1, [Define to 1 if you have the <upsclient.h> header file.])
1139         ], [with_libupsclient="no (upsclient.h not found)"])
1140 fi
1141 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1142
1143 # Check for enabled/disabled features
1144 #
1145
1146 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1147 # ------------------------------------------------------------
1148 dnl
1149 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1150 dnl
1151 AC_DEFUN(
1152         [AC_COLLECTD],
1153         [
1154         m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1155         m4_if(
1156                 [$2],
1157                 [enable],
1158                 [dnl
1159                 m4_define([EnDis],[disabled])dnl
1160                 m4_define([YesNo],[no])dnl
1161                 ],dnl
1162                 [m4_if(
1163                         [$2],
1164                         [disable],
1165                         [dnl
1166                         m4_define([EnDis],[enabled])dnl
1167                         m4_define([YesNo],[yes])dnl
1168                         ],
1169                         [dnl
1170                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1171                         ]dnl
1172                 )]dnl
1173         )dnl
1174         m4_if([$3], [feature], [],
1175                 [m4_if(
1176                         [$3], [module], [],
1177                         [dnl
1178                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1179                         ]dnl
1180                 )]dnl
1181         )dnl
1182         AC_ARG_ENABLE(
1183                 [$1],
1184                 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1185                 [],
1186                 enable_$1='[YesNo]'dnl
1187         )# AC_ARG_ENABLE
1188 if test "x$enable_$1" = "xno"
1189 then
1190         collectd_$1=0
1191 else
1192         if test "x$enable_$1" = "xyes"
1193         then
1194                 collectd_$1=1
1195         else
1196                 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1197                 collectd_$1=1
1198                 enable_$1='yes'
1199         fi
1200 fi
1201         AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1202         AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1203         ]dnl
1204 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1205
1206 m4_divert_once([HELP_ENABLE], [
1207 collectd features:])
1208 AC_COLLECTD([debug],     [enable],  [feature], [debugging])
1209 AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
1210 AC_COLLECTD([getifaddrs],[enable],  [feature], [getifaddrs under Linux])
1211
1212 m4_divert_once([HELP_ENABLE], [
1213 collectd modules:])
1214 AC_COLLECTD([apache],    [disable], [module], [Apache httpd statistics])
1215 AC_COLLECTD([apcups],    [disable], [module], [Statistics of UPSes by APC])
1216 AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
1217 AC_COLLECTD([battery],   [disable], [module], [battery statistics])
1218 AC_COLLECTD([cpu],       [disable], [module], [cpu usage statistics])
1219 AC_COLLECTD([cpufreq],   [disable], [module], [system cpu frequency statistics])
1220 AC_COLLECTD([disk],      [disable], [module], [disk/partition statistics])
1221 AC_COLLECTD([csv],       [disable], [module], [csv output plugin])
1222 AC_COLLECTD([df],        [disable], [module], [df statistics])
1223 AC_COLLECTD([dns],       [disable], [module], [dns statistics])
1224 AC_COLLECTD([email],     [disable], [module], [email statistics])
1225 AC_COLLECTD([entropy],   [disable], [module], [entropy statistics])
1226 AC_COLLECTD([exec],      [disable], [module], [exec of external programs])
1227 AC_COLLECTD([hddtemp],   [disable], [module], [hdd temperature statistics])
1228 AC_COLLECTD([interface], [disable], [module], [interface statistics])
1229 AC_COLLECTD([iptables],  [disable], [module], [IPtables statistics])
1230 AC_COLLECTD([irq],       [disable], [module], [irq statistics])
1231 AC_COLLECTD([load],      [disable], [module], [system load statistics])
1232 AC_COLLECTD([mbmon],     [disable], [module], [motherboard monitor statistics])
1233 AC_COLLECTD([memory],    [disable], [module], [memory statistics])
1234 AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
1235 AC_COLLECTD([mysql],     [disable], [module], [mysql statistics])
1236 AC_COLLECTD([network],   [disable], [module], [network functionality])
1237 AC_COLLECTD([nfs],       [disable], [module], [nfs statistics])
1238 AC_COLLECTD([ntpd],      [disable], [module], [ntpd statistics])
1239 AC_COLLECTD([nut],       [disable], [module], [network UPS tools statistics])
1240 AC_COLLECTD([ping],      [disable], [module], [ping statistics])
1241 AC_COLLECTD([processes], [disable], [module], [processes statistics])
1242 AC_COLLECTD([sensors],   [disable], [module], [lm_sensors statistics])
1243 AC_COLLECTD([serial],    [disable], [module], [serial statistics])
1244 AC_COLLECTD([logfile],   [disable], [module], [logfile log facility])
1245 AC_COLLECTD([swap],      [disable], [module], [swap statistics])
1246 AC_COLLECTD([syslog],    [disable], [module], [syslog log facility])
1247 AC_COLLECTD([tape],      [disable], [module], [tape statistics])
1248 AC_COLLECTD([unixsock],  [disable], [module], [UNIX socket plugin])
1249 AC_COLLECTD([users],     [disable], [module], [user count statistics])
1250 AC_COLLECTD([vserver],   [disable], [module], [vserver statistics])
1251 AC_COLLECTD([wireless],  [disable], [module], [wireless link statistics])
1252
1253 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
1254
1255 cat <<EOF;
1256
1257 Configuration:
1258   Libraries:
1259     libcurl . . . . . . $with_libcurl
1260     libiokit  . . . . . $with_libiokit
1261     libiptc . . . . . . $with_libiptc
1262     libkstat  . . . . . $with_kstat
1263     libmysql  . . . . . $with_libmysql
1264     liboping  . . . . . $with_liboping
1265     libpcap . . . . . . $with_libpcap
1266     libpthread  . . . . $with_libpthread
1267     librrd  . . . . . . $with_rrdtool
1268     libsensors  . . . . $with_lm_sensors
1269     libstatgrab . . . . $with_libstatgrab
1270     libupsclient  . . . $with_libupsclient
1271
1272   Features:
1273     daemon mode . . . . $enable_daemon
1274     debug . . . . . . . $enable_debug
1275
1276   Modules:
1277     apache  . . . . . . $enable_apache
1278     apcups  . . . . . . $enable_apcups
1279     apple_sensors . . . $enable_apple_sensors
1280     battery . . . . . . $enable_battery
1281     cpu . . . . . . . . $enable_cpu
1282     cpufreq . . . . . . $enable_cpufreq
1283     csv . . . . . . . . $enable_csv
1284     df  . . . . . . . . $enable_df
1285     disk  . . . . . . . $enable_disk
1286     dns . . . . . . . . $enable_dns
1287     email . . . . . . . $enable_email
1288     entropy . . . . . . $enable_entropy
1289     exec  . . . . . . . $enable_exec
1290     hddtemp . . . . . . $enable_hddtemp
1291     interface . . . . . $enable_interface
1292     iptables  . . . . . $enable_iptables
1293     irq . . . . . . . . $enable_irq
1294     load  . . . . . . . $enable_load
1295     logfile . . . . . . $enable_logfile
1296     mbmon . . . . . . . $enable_mbmon
1297     memory  . . . . . . $enable_memory
1298     multimeter  . . . . $enable_multimeter
1299     mysql . . . . . . . $enable_mysql
1300     network . . . . . . $enable_network
1301     nfs . . . . . . . . $enable_nfs
1302     ntpd  . . . . . . . $enable_ntpd
1303     nut . . . . . . . . $enable_nut
1304     ping  . . . . . . . $enable_ping
1305     processes . . . . . $enable_processes
1306     sensors . . . . . . $enable_sensors
1307     serial  . . . . . . $enable_serial
1308     swap  . . . . . . . $enable_swap
1309     syslog  . . . . . . $enable_syslog
1310     tape  . . . . . . . $enable_tape
1311     unixsock  . . . . . $enable_unixsock
1312     users . . . . . . . $enable_users
1313     vserver . . . . . . $enable_vserver
1314     wireless  . . . . . $enable_wireless
1315
1316 EOF