2cb067b7c6ddabd679022956c9e084455eb6f231
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 4.0.0-rc5)
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
6 AC_LANG(C)
8 AC_PREFIX_DEFAULT("/opt/collectd")
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")
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)
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)
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 ])
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)
209 # For hddtemp module
210 AC_CHECK_HEADERS(linux/major.h)
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)
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)
229 # For the `disk' plugin
230 AC_CHECK_HEADERS(IOKit/IOBSD.h)
231 AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
233 # For load module
234 AC_CHECK_HEADERS(sys/loadavg.h)
236 # For the processes plugin
237 AC_CHECK_HEADERS(linux/config.h)
239 # For the swap module
240 AC_CHECK_HEADERS(sys/swap.h)
242 # For users module
243 AC_CHECK_HEADERS(utmp.h)
244 AC_CHECK_HEADERS(utmpx.h)
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 ])
279 # For apache plugin
280 AC_CHECK_HEADERS(curl/curl.h)
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)
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)
305 # For the swap plugin, FreeBSD
306 AC_CHECK_HEADERS(kvm.h)
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)
318 # For debugging interface (variable number of arguments)
319 AC_CHECK_HEADERS(stdarg.h)
321 # Regular expressions for the ignorelist.
322 AC_CHECK_HEADERS(regex.h)
324 # For the dns plugin
325 AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h)
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 ])
351 # For the multimeter plugin
352 AC_CHECK_HEADERS(termios.h)
353 AC_CHECK_HEADERS(sys/ioctl.h)
355 #
356 # Checking for libraries
357 #
358 AC_CHECK_LIB(m, ext)
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
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)
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")
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")
387 # Regular expressions for the ignorelist.
388 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
390 # For cpu module
391 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
393 # For df module
394 AC_CHECK_FUNCS(statfs statvfs)
396 # For load module
397 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
399 # For the `processes' plugin
400 AC_CHECK_FUNCS(thread_info)
402 # For users module
403 AC_CHECK_FUNCS(getutent getutxent)
405 # For quota module
406 AC_CHECK_FUNCS(quotactl)
407 AC_CHECK_FUNCS(getgrgid getpwuid)
409 # For interface module
410 AC_CHECK_FUNCS(getifaddrs)
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
507 # For mount interface
508 #AC_CHECK_FUNCS(getfsent getvfsent)
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"])
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
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
567 # Check for different versions of `getmntent' here..
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
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 ])
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 ])
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 ])
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])
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")
685 m4_divert_once([HELP_WITH], [
686 collectd additional packages:])
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")
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")
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
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")
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=$?
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=$?
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
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 ###
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")
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")
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")
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")
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")
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 ])
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
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")
1076 perl_interpreter="perl"
1077 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1078 [
1079 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1080 then
1081 LDFLAGS="$LDFLAGS -L$withval/lib"
1082 CPPFLAGS="$CPPFLAGS -I$withval/include"
1083 perl_interpreter="$withval/bin/perl"
1084 with_libperl="yes"
1085 fi
1086 ],
1087 [
1088 with_libperl="yes"
1089 ])
1090 if test "x$with_libperl" = "xyes"
1091 then
1092 SAVE_CFLAGS=$CFLAGS
1093 SAVE_LDFLAGS=$LDFLAGS
1094 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1095 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1096 CFLAGS="$CFLAGS $PERL_CFLAGS"
1097 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1099 AC_CACHE_CHECK([for libperl],
1100 [have_libperl],
1101 AC_LINK_IFELSE(
1102 AC_LANG_PROGRAM(
1103 [[
1104 #include <EXTERN.h>
1105 #include <perl.h>
1106 #include <XSUB.h>
1107 ]],
1108 [[
1109 PerlInterpreter *perl = NULL;
1110 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1111 newSVpv ("Collectd::Plugin::FooBar", 24),
1112 Nullsv);
1113 ]]),
1114 [have_libperl="yes"],
1115 [have_libperl="no"]
1116 )
1117 )
1119 if test "x$have_libperl" = "xyes"
1120 then
1121 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1122 AC_SUBST(PERL_CFLAGS)
1123 AC_SUBST(PERL_LDFLAGS)
1124 else
1125 with_libperl="no"
1126 fi
1128 CFLAGS=$SAVE_CFLAGS
1129 LDFLAGS=$SAVE_LDFLAGS
1130 fi
1131 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1133 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1134 [
1135 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1136 then
1137 LDFLAGS="$LDFLAGS -L$withval/lib"
1138 CPPFLAGS="$CPPFLAGS -I$withval/include"
1139 with_libiptc="yes"
1140 fi
1141 ],
1142 [
1143 if test "x$ac_system" = "xLinux"
1144 then
1145 with_libiptc="yes"
1146 else
1147 with_libiptc="no (Linux only)"
1148 fi
1149 ])
1150 if test "x$with_libiptc" = "xyes"
1151 then
1152 AC_CHECK_LIB(iptc, iptc_init,
1153 [
1154 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1155 ], [with_libiptc="no (libiptc not found)"])
1156 fi
1157 if test "x$with_libiptc" = "xyes"
1158 then
1159 AC_CHECK_HEADERS(libiptc/libiptc.h,
1160 [
1161 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1162 ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1163 fi
1164 if test "x$with_libiptc" = "xyes"
1165 then
1166 collect_libiptc=1
1167 else
1168 collect_libiptc=0
1169 fi
1170 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1172 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1173 [
1174 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1175 then
1176 LDFLAGS="$LDFLAGS -L$withval/lib"
1177 CPPFLAGS="$CPPFLAGS -I$withval/include"
1178 with_libupsclient="yes"
1179 fi
1180 ],
1181 [
1182 with_libupsclient="yes"
1183 ])
1184 if test "x$with_libupsclient" = "xyes"
1185 then
1186 AC_CHECK_LIB(upsclient, upscli_connect,
1187 [
1188 AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).])
1189 ], [with_libupsclient="no (libupsclient not found)"])
1190 fi
1191 if test "x$with_libupsclient" = "xyes"
1192 then
1193 AC_CHECK_HEADERS(upsclient.h,
1194 [
1195 AC_DEFINE(HAVE_UPSCLIENT_H, 1, [Define to 1 if you have the <upsclient.h> header file.])
1196 ], [with_libupsclient="no (upsclient.h not found)"])
1197 fi
1198 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1200 # Check for enabled/disabled features
1201 #
1203 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1204 # ------------------------------------------------------------
1205 dnl
1206 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1207 dnl
1208 AC_DEFUN(
1209 [AC_COLLECTD],
1210 [
1211 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1212 m4_if(
1213 [$2],
1214 [enable],
1215 [dnl
1216 m4_define([EnDis],[disabled])dnl
1217 m4_define([YesNo],[no])dnl
1218 ],dnl
1219 [m4_if(
1220 [$2],
1221 [disable],
1222 [dnl
1223 m4_define([EnDis],[enabled])dnl
1224 m4_define([YesNo],[yes])dnl
1225 ],
1226 [dnl
1227 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1228 ]dnl
1229 )]dnl
1230 )dnl
1231 m4_if([$3], [feature], [],
1232 [m4_if(
1233 [$3], [module], [],
1234 [dnl
1235 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1236 ]dnl
1237 )]dnl
1238 )dnl
1239 AC_ARG_ENABLE(
1240 [$1],
1241 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1242 [],
1243 enable_$1='[YesNo]'dnl
1244 )# AC_ARG_ENABLE
1245 if test "x$enable_$1" = "xno"
1246 then
1247 collectd_$1=0
1248 else
1249 if test "x$enable_$1" = "xyes"
1250 then
1251 collectd_$1=1
1252 else
1253 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1254 collectd_$1=1
1255 enable_$1='yes'
1256 fi
1257 fi
1258 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1259 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1260 ]dnl
1261 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1263 m4_divert_once([HELP_ENABLE], [
1264 collectd features:])
1265 AC_COLLECTD([debug], [enable], [feature], [debugging])
1266 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1267 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1269 m4_divert_once([HELP_ENABLE], [
1270 collectd modules:])
1271 AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics])
1272 AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC])
1273 AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
1274 AC_COLLECTD([battery], [disable], [module], [battery statistics])
1275 AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
1276 AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
1277 AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
1278 AC_COLLECTD([csv], [disable], [module], [csv output plugin])
1279 AC_COLLECTD([df], [disable], [module], [df statistics])
1280 AC_COLLECTD([dns], [disable], [module], [dns statistics])
1281 AC_COLLECTD([email], [disable], [module], [email statistics])
1282 AC_COLLECTD([entropy], [disable], [module], [entropy statistics])
1283 AC_COLLECTD([exec], [disable], [module], [exec of external programs])
1284 AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
1285 AC_COLLECTD([interface], [disable], [module], [interface statistics])
1286 AC_COLLECTD([iptables], [disable], [module], [IPtables statistics])
1287 AC_COLLECTD([irq], [disable], [module], [irq statistics])
1288 AC_COLLECTD([load], [disable], [module], [system load statistics])
1289 AC_COLLECTD([mbmon], [disable], [module], [motherboard monitor statistics])
1290 AC_COLLECTD([memory], [disable], [module], [memory statistics])
1291 AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
1292 AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
1293 AC_COLLECTD([network], [disable], [module], [network functionality])
1294 AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
1295 AC_COLLECTD([ntpd], [disable], [module], [ntpd statistics])
1296 AC_COLLECTD([nut], [disable], [module], [network UPS tools statistics])
1297 AC_COLLECTD([perl], [disable], [module], [embedded perl interpreter])
1298 AC_COLLECTD([ping], [disable], [module], [ping statistics])
1299 AC_COLLECTD([processes], [disable], [module], [processes statistics])
1300 AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
1301 AC_COLLECTD([serial], [disable], [module], [serial statistics])
1302 AC_COLLECTD([logfile], [disable], [module], [logfile log facility])
1303 AC_COLLECTD([swap], [disable], [module], [swap statistics])
1304 AC_COLLECTD([syslog], [disable], [module], [syslog log facility])
1305 AC_COLLECTD([tape], [disable], [module], [tape statistics])
1306 AC_COLLECTD([unixsock], [disable], [module], [UNIX socket plugin])
1307 AC_COLLECTD([users], [disable], [module], [user count statistics])
1308 AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
1309 AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
1311 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
1313 if test "x$with_libperl" = "xyes"
1314 then
1315 with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)"
1316 else
1317 enable_perl="no (needs libperl)"
1318 fi
1320 cat <<EOF;
1322 Configuration:
1323 Libraries:
1324 libcurl . . . . . . $with_libcurl
1325 libiokit . . . . . $with_libiokit
1326 libiptc . . . . . . $with_libiptc
1327 libkstat . . . . . $with_kstat
1328 libmysql . . . . . $with_libmysql
1329 liboping . . . . . $with_liboping
1330 libpcap . . . . . . $with_libpcap
1331 libperl . . . . . . $with_libperl
1332 libpthread . . . . $with_libpthread
1333 librrd . . . . . . $with_rrdtool
1334 libsensors . . . . $with_lm_sensors
1335 libstatgrab . . . . $with_libstatgrab
1336 libupsclient . . . $with_libupsclient
1338 Features:
1339 daemon mode . . . . $enable_daemon
1340 debug . . . . . . . $enable_debug
1342 Modules:
1343 apache . . . . . . $enable_apache
1344 apcups . . . . . . $enable_apcups
1345 apple_sensors . . . $enable_apple_sensors
1346 battery . . . . . . $enable_battery
1347 cpu . . . . . . . . $enable_cpu
1348 cpufreq . . . . . . $enable_cpufreq
1349 csv . . . . . . . . $enable_csv
1350 df . . . . . . . . $enable_df
1351 disk . . . . . . . $enable_disk
1352 dns . . . . . . . . $enable_dns
1353 email . . . . . . . $enable_email
1354 entropy . . . . . . $enable_entropy
1355 exec . . . . . . . $enable_exec
1356 hddtemp . . . . . . $enable_hddtemp
1357 interface . . . . . $enable_interface
1358 iptables . . . . . $enable_iptables
1359 irq . . . . . . . . $enable_irq
1360 load . . . . . . . $enable_load
1361 logfile . . . . . . $enable_logfile
1362 mbmon . . . . . . . $enable_mbmon
1363 memory . . . . . . $enable_memory
1364 multimeter . . . . $enable_multimeter
1365 mysql . . . . . . . $enable_mysql
1366 network . . . . . . $enable_network
1367 nfs . . . . . . . . $enable_nfs
1368 ntpd . . . . . . . $enable_ntpd
1369 nut . . . . . . . . $enable_nut
1370 perl . . . . . . . $enable_perl
1371 ping . . . . . . . $enable_ping
1372 processes . . . . . $enable_processes
1373 sensors . . . . . . $enable_sensors
1374 serial . . . . . . $enable_serial
1375 swap . . . . . . . $enable_swap
1376 syslog . . . . . . $enable_syslog
1377 tape . . . . . . . $enable_tape
1378 unixsock . . . . . $enable_unixsock
1379 users . . . . . . . $enable_users
1380 vserver . . . . . . $enable_vserver
1381 wireless . . . . . $enable_wireless
1383 EOF