rrdtool plugin: Sort the list of user defined `RRATimespan's.
[collectd.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
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 AC_SYS_LARGEFILE
11
12 #
13 # Checks for programs.
14 #
15 AC_PROG_CC
16 AC_PROG_CPP
17 AC_PROG_INSTALL
18 AC_PROG_LN_S
19 AC_PROG_MAKE_SET
20 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
21
22 dnl configure libtool
23 AC_DISABLE_STATIC
24 AC_LIBLTDL_CONVENIENCE
25 AC_SUBST(LTDLINCL)
26 AC_SUBST(LIBLTDL)
27 AC_LIBTOOL_DLOPEN
28 AC_PROG_LIBTOOL
29 AC_PROG_LEX
30 AC_PROG_YACC
31 AC_CONFIG_SUBDIRS(libltdl)
32
33 AC_MSG_CHECKING([for kernel type ($host_os)])
34 case $host_os in
35         *linux*)
36         AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
37         ac_system="Linux"
38         ;;
39         *solaris*)
40         AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
41         ac_system="Solaris"
42         ;;
43         *darwin*)
44         ac_system="Darwin"
45         ;;
46         *)
47         ac_system="unknown"
48 esac
49 AC_MSG_RESULT([$ac_system])
50
51 #
52 # Checks for header files.
53 #
54 AC_HEADER_STDC
55 AC_HEADER_SYS_WAIT
56 AC_HEADER_DIRENT
57
58 AC_CHECK_HEADERS(stdint.h stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h)
59
60 # For ping library
61 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
62 [#if HAVE_STDINT_H
63 # include <stdint.h>
64 #endif
65 #if HAVE_SYS_TYPES_H
66 # include <sys/types.h>
67 #endif
68 ])
69 AC_CHECK_HEADERS(netinet/in.h, [], [],
70 [#if HAVE_STDINT_H
71 # include <stdint.h>
72 #endif
73 #if HAVE_SYS_TYPES_H
74 # include <sys/types.h>
75 #endif
76 #if HAVE_NETINET_IN_SYSTM_H
77 # include <netinet/in_systm.h>
78 #endif
79 ])
80 AC_CHECK_HEADERS(netinet/ip.h, [], [],
81 [#if HAVE_STDINT_H
82 # include <stdint.h>
83 #endif
84 #if HAVE_SYS_TYPES_H
85 # include <sys/types.h>
86 #endif
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
89 #endif
90 #if HAVE_NETINET_IN_H
91 # include <netinet/in.h>
92 #endif
93 ])
94 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
95 [#if HAVE_STDINT_H
96 # include <stdint.h>
97 #endif
98 #if HAVE_SYS_TYPES_H
99 # include <sys/types.h>
100 #endif
101 #if HAVE_NETINET_IN_SYSTM_H
102 # include <netinet/in_systm.h>
103 #endif
104 #if HAVE_NETINET_IN_H
105 # include <netinet/in.h>
106 #endif
107 #if HAVE_NETINET_IP_H
108 # include <netinet/ip.h>
109 #endif
110 ])
111 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
112 [#if HAVE_STDINT_H
113 # include <stdint.h>
114 #endif
115 #if HAVE_SYS_TYPES_H
116 # include <sys/types.h>
117 #endif
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
120 #endif
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
123 #endif
124 #if HAVE_NETINET_IP_H
125 # include <netinet/ip.h>
126 #endif
127 ])
128 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
129 [#if HAVE_STDINT_H
130 # include <stdint.h>
131 #endif
132 #if HAVE_SYS_TYPES_H
133 # include <sys/types.h>
134 #endif
135 #if HAVE_NETINET_IN_SYSTM_H
136 # include <netinet/in_systm.h>
137 #endif
138 #if HAVE_NETINET_IN_H
139 # include <netinet/in.h>
140 #endif
141 ])
142 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
143 [#if HAVE_STDINT_H
144 # include <stdint.h>
145 #endif
146 #if HAVE_SYS_TYPES_H
147 # include <sys/types.h>
148 #endif
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
151 #endif
152 #if HAVE_NETINET_IN_H
153 # include <netinet/in.h>
154 #endif
155 #if HAVE_NETINET_IP6_H
156 # include <netinet/ip6.h>
157 #endif
158 ])
159 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
160 [#if HAVE_STDINT_H
161 # include <stdint.h>
162 #endif
163 #if HAVE_SYS_TYPES_H
164 # include <sys/types.h>
165 #endif
166 #if HAVE_NETINET_IN_SYSTM_H
167 # include <netinet/in_systm.h>
168 #endif
169 #if HAVE_NETINET_IN_H
170 # include <netinet/in.h>
171 #endif
172 #if HAVE_NETINET_IP_H
173 # include <netinet/ip.h>
174 #endif
175 ])
176 AC_CHECK_HEADERS(netinet/udp.h, [], [],
177 [#if HAVE_STDINT_H
178 # include <stdint.h>
179 #endif
180 #if HAVE_SYS_TYPES_H
181 # include <sys/types.h>
182 #endif
183 #if HAVE_NETINET_IN_SYSTM_H
184 # include <netinet/in_systm.h>
185 #endif
186 #if HAVE_NETINET_IN_H
187 # include <netinet/in.h>
188 #endif
189 #if HAVE_NETINET_IP_H
190 # include <netinet/ip.h>
191 #endif
192 ])
193
194 # For cpu modules
195 AC_CHECK_HEADERS(sys/dkstat.h)
196 if test "x$ac_system" = "xDarwin"
197 then
198         AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
199         AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
200 fi
201 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
202 [
203 #if HAVE_SYS_TYPES_H
204 #  include <sys/types.h>
205 #endif
206 #if HAVE_SYS_PARAM_H
207 # include <sys/param.h>
208 #endif
209 ])
210
211 # For hddtemp module
212 AC_CHECK_HEADERS(linux/major.h libgen.h)
213
214 # For the battery plugin
215 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
216 [
217 #if HAVE_IOKIT_IOKITLIB_H
218 #  include <IOKit/IOKitLib.h>
219 #endif
220 #if HAVE_IOKIT_IOTYPES_H
221 #  include <IOKit/IOTypes.h>
222 #endif
223 ])
224
225 # For the swap module
226 AC_CHECK_HEADERS(sys/swap.h, [], [],
227 [
228 #if HAVE_SYS_TYPES_H
229 #  include <sys/types.h>
230 #endif
231 #if HAVE_SYS_PARAM_H
232 # include <sys/param.h>
233 #endif
234 ])
235
236 # For load module
237 # For the processes plugin
238 # For users module
239 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
240
241 # For interface plugin
242 AC_CHECK_HEADERS(ifaddrs.h)
243 AC_CHECK_HEADERS(net/if.h, [], [],
244 [
245 #if HAVE_SYS_TYPES_H
246 #  include <sys/types.h>
247 #endif
248 #if HAVE_SYS_SOCKET_H
249 #  include <sys/socket.h>
250 #endif
251 ])
252 AC_CHECK_HEADERS(linux/if.h, [], [],
253 [
254 #if HAVE_SYS_TYPES_H
255 #  include <sys/types.h>
256 #endif
257 #if HAVE_SYS_SOCKET_H
258 #  include <sys/socket.h>
259 #endif
260 ])
261 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
262 [
263 #if HAVE_SYS_TYPES_H
264 #  include <sys/types.h>
265 #endif
266 #if HAVE_SYS_SOCKET_H
267 #  include <sys/socket.h>
268 #endif
269 #if HAVE_LINUX_IF_H
270 # include <linux/if.h>
271 #endif
272 ])
273
274 # For quota module
275 AC_CHECK_HEADERS(sys/ucred.h, [], [],
276 [
277 #if HAVE_SYS_TYPES_H
278 #  include <sys/types.h>
279 #endif
280 #if HAVE_SYS_PARAM_H
281 # include <sys/param.h>
282 #endif
283 ])
284
285 # For mount interface
286 AC_CHECK_HEADERS(sys/mount.h, [], [],
287 [
288 #if HAVE_SYS_TYPES_H
289 #  include <sys/types.h>
290 #endif
291 #if HAVE_SYS_PARAM_H
292 # include <sys/param.h>
293 #endif
294 ])
295
296 # For the email plugin
297 AC_CHECK_HEADERS(linux/un.h, [], [],
298 [
299 #if HAVE_SYS_SOCKET_H
300 #       include <sys/socket.h>
301 #endif
302 ])
303
304 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h)
305
306 # For the dns plugin
307 AC_CHECK_HEADERS(arpa/nameser.h)
308 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
309 [
310 #if HAVE_ARPA_NAMESER_H
311 # include <arpa/nameser.h>
312 #endif
313 ])
314
315 AC_CHECK_HEADERS(net/if_arp.h, [], [],
316 [#if HAVE_SYS_SOCKET_H
317 # include <sys/socket.h>
318 #endif
319 ])
320 AC_CHECK_HEADERS(net/ppp_defs.h)
321 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
322 [#if HAVE_NET_PPP_DEFS_H
323 # include <net/ppp_defs.h>
324 #endif
325 ])
326 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
327 [#if HAVE_STDINT_H
328 # include <stdint.h>
329 #endif
330 #if HAVE_SYS_TYPES_H
331 # include <sys/types.h>
332 #endif
333 #if HAVE_SYS_SOCKET_H
334 # include <sys/socket.h>
335 #endif
336 #if HAVE_NET_IF_H
337 # include <net/if.h>
338 #endif
339 #if HAVE_NETINET_IN_H
340 # include <netinet/in.h>
341 #endif
342 ])
343
344 # For the multimeter plugin
345 have_termios_h="no"
346 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
347
348 #
349 # Checking for libraries
350 #
351 AC_CHECK_LIB(m, ext)
352
353 #
354 # Checks for typedefs, structures, and compiler characteristics.
355 #
356 AC_C_CONST
357 AC_TYPE_PID_T
358 AC_TYPE_SIZE_T
359 AC_TYPE_UID_T
360 AC_HEADER_TIME
361
362 #
363 # Checks for library functions.
364 #
365 AC_PROG_GCC_TRADITIONAL
366 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
367
368 AC_FUNC_STRERROR_R
369
370 AC_CHECK_FUNCS(getpwnam_r)
371 AC_CHECK_FUNCS(getgrnam_r)
372
373 socket_needs_socket="no"
374 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
375 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
376
377 nanosleep_needs_rt="no"
378 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
379 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
380
381 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
382
383 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
384 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
385 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
386 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
387 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
388 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
389 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
390 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
391 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
392 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
393
394 # For load module
395 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
396
397 # Check for NAN
398 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
399 [
400  if test "x$withval" = "xno"; then
401          nan_type="none"
402  else if test "x$withval" = "xyes"; then
403          nan_type="zero"
404  else
405          nan_type="$withval"
406  fi; fi
407 ],
408 [nan_type="none"])
409 if test "x$nan_type" = "xnone"; then
410   AC_CACHE_CHECK([whether NAN is defined by default],
411     [have_nan_default],
412     AC_COMPILE_IFELSE(
413       AC_LANG_PROGRAM(
414       [[
415 #include <stdlib.h>
416 #include <math.h>
417 static float foo = NAN;
418       ]],
419       [[
420        if (isnan (foo))
421         return 0;
422        else
423         return 1;
424       ]]),
425       [have_nan_default="yes"],
426       [have_nan_default="no"]
427     )
428   )
429   if test "x$have_nan_default" = "xyes"
430   then
431     nan_type="default"
432   fi
433 fi
434 if test "x$nan_type" = "xnone"; then
435   AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
436     [have_nan_isoc],
437     AC_COMPILE_IFELSE(
438       AC_LANG_PROGRAM(
439       [[
440 #include <stdlib.h>
441 #define __USE_ISOC99 1
442 #include <math.h>
443 static float foo = NAN;
444       ]],
445       [[
446        if (isnan (foo))
447         return 0;
448        else
449         return 1;
450       ]]),
451       [have_nan_isoc="yes"],
452       [have_nan_isoc="no"]
453     )
454   )
455   if test "x$have_nan_isoc" = "xyes"
456   then
457     nan_type="isoc99"
458   fi
459 fi
460 if test "x$nan_type" = "xnone"; then
461   AC_CACHE_CHECK([whether NAN can be defined by 0/0],
462     [have_nan_zero],
463     AC_RUN_IFELSE(
464       AC_LANG_PROGRAM(
465       [[
466 #include <stdlib.h>
467 #include <math.h>
468 #ifdef NAN
469 # undef NAN
470 #endif
471 #define NAN (0.0 / 0.0)
472 #ifndef isnan
473 # define isnan(f) ((f) != (f))
474 #endif
475 static float foo = NAN;
476       ]],
477       [[
478        if (isnan (foo))
479         return 0;
480        else
481         return 1;
482       ]]),
483       [have_nan_zero="yes"],
484       [have_nan_zero="no"]
485     )
486   )
487   if test "x$have_nan_zero" = "xyes"
488   then
489     nan_type="zero"
490   fi
491 fi
492
493 if test "x$nan_type" = "xdefault"; then
494   AC_DEFINE(NAN_STATIC_DEFAULT, 1,
495     [Define if NAN is defined by default and can initialize static variables.])
496 else if test "x$nan_type" = "xisoc99"; then
497   AC_DEFINE(NAN_STATIC_ISOC, 1,
498     [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
499 else if test "x$nan_type" = "xzero"; then
500   AC_DEFINE(NAN_ZERO_ZERO, 1,
501     [Define if NAN can be defined as (0.0 / 0.0)])
502 else
503   AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
504 fi; fi; fi
505
506 # For mount interface
507 #AC_CHECK_FUNCS(getfsent getvfsent)
508
509 have_getfsstat="no"
510 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
511 have_getvfsstat="no"
512 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
513 have_listmntent="no"
514 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
515
516 have_getmntent="no"
517 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
518 if test "x$have_getmntent" = "xno"; then
519         AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
520 fi
521 if test "x$have_getmntent" = "xno"; then
522         AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
523 fi
524 if test "x$have_getmntent" = "xno"; then
525         AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
526 fi
527
528 if test "x$have_getmntent" = "xc"; then
529         AC_CACHE_CHECK([whether getmntent takes one argument],
530                 [have_one_getmntent],
531                 AC_COMPILE_IFELSE(
532                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
533 #include <mntent.h>
534 #include "$srcdir/src/utils_mount.h"]],
535                                 [[
536                                  FILE *fh;
537                                  struct mntent *me;
538                                  fh = setmntent ("/etc/mtab", "r");
539                                  me = getmntent (fh);
540                                 ]]
541                         ),
542                         [have_one_getmntent="yes"],
543                         [have_one_getmntent="no"]
544                 )
545         )
546         AC_CACHE_CHECK([whether getmntent takes two arguments],
547                 [have_two_getmntent],
548                 AC_COMPILE_IFELSE(
549                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
550 #include <sys/mnttab.h>
551 #include "$srcdir/src/utils_mount.h"]],
552                                 [[
553                                  FILE *fh;
554                                  struct mnttab mt;
555                                  int status;
556                                  fh = fopen ("/etc/mnttab", "r");
557                                  status = getmntent (fh, &mt);
558                                 ]]
559                         ),
560                         [have_two_getmntent="yes"],
561                         [have_two_getmntent="no"]
562                 )
563         )
564 fi
565
566 # Check for different versions of `getmntent' here..
567
568 if test "x$have_getmntent" = "xc"; then
569         if test "x$have_one_getmntent" = "xyes"; then
570                 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
571                           [Define if the function getmntent exists and takes one argument.])
572         fi
573         if test "x$have_two_getmntent" = "xyes"; then
574                 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
575                           [Define if the function getmntent exists and takes two arguments.])
576         fi
577 fi
578 if test "x$have_getmntent" = "xsun"; then
579         AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
580                   [Define if the function getmntent exists. It's the version from libsun.])
581 fi
582 if test "x$have_getmntent" = "xseq"; then
583         AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
584                   [Define if the function getmntent exists. It's the version from libseq.])
585 fi
586 if test "x$have_getmntent" = "xgen"; then
587         AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
588                   [Define if the function getmntent exists. It's the version from libgen.])
589 fi
590
591 # Check for structures
592 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
593         [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
594         [],
595         [
596         #include <sys/types.h>
597         #include <sys/socket.h>
598         #include <net/if.h>
599         ])
600 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
601         [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
602         [],
603         [
604         #include <sys/types.h>
605         #include <sys/socket.h>
606         #include <linux/if.h>
607         #include <linux/netdevice.h>
608         ])
609
610 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
611 [#if HAVE_STDINT_H
612 # include <stdint.h>
613 #endif
614 #if HAVE_SYS_TYPES_H
615 # include <sys/types.h>
616 #endif
617 #if HAVE_NETINET_IN_SYSTM_H
618 # include <netinet/in_systm.h>
619 #endif
620 #if HAVE_NETINET_IN_H
621 # include <netinet/in.h>
622 #endif
623 #if HAVE_NETINET_IP_H
624 # include <netinet/ip.h>
625 #endif
626 #if HAVE_NETINET_UDP_H
627 # include <netinet/udp.h>
628 #endif
629 ])
630 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
631 [#if HAVE_STDINT_H
632 # include <stdint.h>
633 #endif
634 #if HAVE_SYS_TYPES_H
635 # include <sys/types.h>
636 #endif
637 #if HAVE_NETINET_IN_SYSTM_H
638 # include <netinet/in_systm.h>
639 #endif
640 #if HAVE_NETINET_IN_H
641 # include <netinet/in.h>
642 #endif
643 #if HAVE_NETINET_IP_H
644 # include <netinet/ip.h>
645 #endif
646 #if HAVE_NETINET_UDP_H
647 # include <netinet/udp.h>
648 #endif
649 ])
650
651 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
652         [],
653         [],
654         [
655 #if HAVE_KSTAT_H
656 # include <kstat.h>
657 #endif
658         ])
659
660 with_libresolv="yes"
661 AC_CHECK_LIB(resolv, res_search,
662 [
663         AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
664 ],
665 [with_libresolv="no"])
666 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
667
668
669 m4_divert_once([HELP_WITH], [
670 collectd additional packages:])
671
672 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
673 librrd_cflags=""
674 librrd_ldflags=""
675 librrd_threadsafe="yes"
676 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
677 [       if test "x$withval" != "xno" && test "x$withval" != "xyes"
678         then
679                 librrd_cflags="-I$withval/include"
680                 librrd_ldflags="-L$withval/lib"
681                 with_rrdtool="yes"
682         fi
683 ], [with_rrdtool="yes"])
684 if test "x$with_rrdtool" = "xyes"
685 then
686         SAVE_CPPFLAGS="$CPPFLAGS"
687         SAVE_LDFLAGS="$LDFLAGS"
688
689         CPPFLAGS="$CPPFLAGS $librrd_cflags"
690         LDFLAGS="$LDFLAGS $librrd_ldflags"
691
692         AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
693
694         CPPFLAGS="$SAVE_CPPFLAGS"
695         LDFLAGS="$SAVE_LDFLAGS"
696 fi
697 if test "x$with_rrdtool" = "xyes"
698 then
699         SAVE_CPPFLAGS="$CPPFLAGS"
700         SAVE_LDFLAGS="$LDFLAGS"
701
702         CPPFLAGS="$CPPFLAGS $librrd_cflags"
703         LDFLAGS="$LDFLAGS $librrd_ldflags"
704
705         AC_CHECK_LIB(rrd_th, rrd_update_r,
706         [with_rrdtool="yes"
707          librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
708         ],
709         [librrd_threadsafe="no"
710          AC_CHECK_LIB(rrd, rrd_update,
711          [with_rrdtool="yes"
712           librrd_ldflags="$librrd_ldflags -lrrd -lm"
713          ],
714          [with_rrdtool="no (symbol 'rrd_update' not found)"],
715          [-lm])
716         ]
717         [-lm])
718
719         CPPFLAGS="$SAVE_CPPFLAGS"
720         LDFLAGS="$SAVE_LDFLAGS"
721 fi
722 if test "x$with_rrdtool" = "xyes"
723 then
724         BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
725         BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
726         AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
727         AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
728 fi
729 if test "x$librrd_threadsafe" = "xyes"
730 then
731         AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
732 fi
733
734 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
735 [       if test "x$withval" != "xno" -a "x$withval" != "xyes"
736         then
737                 LDFLAGS="$LDFLAGS -L$withval/lib"
738                 CPPFLAGS="$CPPFLAGS -I$withval/include"
739                 with_libpthread="yes"
740         else
741                 if test "x$withval" = "xno"
742                 then
743                         with_libpthread="no (disabled)"
744                 fi
745         fi
746 ], [with_libpthread="yes"])
747 if test "x$with_libpthread" = "xyes"
748 then
749         AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
750 fi
751 if test "x$with_libpthread" = "xyes"
752 then
753         AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
754 fi
755 if test "x$with_libpthread" = "xyes"
756 then
757         collect_pthread=1
758 else
759         collect_pthread=0
760 fi
761 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
762         [Wether or not to use pthread (POSIX threads) library])
763 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
764
765 if test "x$ac_system" = "xSolaris"
766 then
767         with_kstat="yes"
768         with_devinfo="yes"
769 else
770         with_kstat="no (Solaris only)"
771         with_devinfo="no (Solaris only)"
772 fi
773
774 if test "x$with_kstat" = "xyes"
775 then
776         AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
777 fi
778 if test "x$with_kstat" = "xyes"
779 then
780         AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
781         AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
782 fi
783 if test "x$with_kstat" = "xyes"
784 then
785         AC_DEFINE(HAVE_LIBKSTAT, 1,
786                   [Define to 1 if you have the 'kstat' library (-lkstat)])
787 fi
788 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
789 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
790
791 ### BEGIN of check for libcurl ###
792 with_curl_config="curl-config"
793 with_curl_cflags=""
794 with_curl_libs=""
795 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
796 [
797         if test "x$withval" = "xno"
798         then
799                 with_libcurl="no"
800         else if test "x$withval" = "xyes"
801         then
802                 with_libcurl="yes"
803         else
804                 if test -f "$withval" && test -x "$withval"
805                 then
806                         with_curl_config="$withval"
807                         with_libcurl="yes"
808                 else if test -x "$withval/bin/curl-config"
809                 then
810                         with_curl_config="$withval/bin/curl-config"
811                         with_libcurl="yes"
812                 fi; fi
813                 with_libcurl="yes"
814         fi; fi
815 ],
816 [
817         with_libcurl="yes"
818 ])
819 if test "x$with_libcurl" = "xyes"
820 then
821         with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
822         curl_config_status=$?
823
824         if test $curl_config_status -ne 0
825         then
826                 with_libcurl="no ($with_curl_config failed)"
827         else
828                 SAVE_CFLAGS=$CFLAGS
829                 CFLAGS="$CFLAGS $with_curl_cflags"
830
831                 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
832
833                 CFLAGS="$SAVE_CFLAGS"
834         fi
835 fi
836 if test "x$with_libcurl" = "xyes"
837 then
838         with_curl_libs=`$with_curl_config --libs 2>/dev/null`
839         curl_config_status=$?
840
841         if test $curl_config_status -ne 0
842         then
843                 with_libcurl="no ($with_curl_config failed)"
844         else
845                 AC_CHECK_LIB(curl, curl_easy_init,
846                  [with_libcurl="yes"],
847                  [with_libcurl="no (symbol 'curl_easy_init' not found)"],
848                  [$with_curl_libs])
849         fi
850 fi
851 if test "x$with_libcurl" = "xyes"
852 then
853         BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
854         BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
855         AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
856         AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
857 fi
858 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
859 ### END of check for libcurl ###
860
861 with_libiokit="no"
862 collectd_libiokit=0
863 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
864 [
865         with_libiokit="yes"
866         collectd_libiokit=1
867 ], 
868 [
869         with_libiokit="no"
870         collectd_libiokit=0
871 ])
872 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
873 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
874
875 with_libstatgrab="yes"
876 with_libdevstat="no"
877 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
878 [
879         if test "x$withval" != "xno" -a "x$withval" != "xyes"
880         then
881                 LDFLAGS="$LDFLAGS -L$withval/lib"
882                 CPPFLAGS="$CPPFLAGS -I$withval/include"
883                 with_libstatgrab="yes"
884         fi
885 ],
886 [
887         if test "x$ac_system" == "xunknown"
888         then
889                 with_libstatgrab="yes"
890         else
891                 with_libstatgrab="no"
892         fi
893 ])
894 if test "x$with_libstatgrab" = "xyes"
895 then
896         AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
897 fi
898 if test "x$with_libstatgrab" = "xyes"
899 then
900         AC_CHECK_HEADERS(statgrab.h,,    [with_libstatgrab="no (statgrab.h not found)"])
901 fi
902 if test "x$with_libstatgrab" = "xyes"
903 then
904         AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
905 fi
906 if test "x$with_libstatgrab" = "xyes"
907 then
908         collect_libstatgrab=1
909 else
910         collect_libstatgrab=0
911 fi
912 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
913         [Wether or not to use statgrab library])
914 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
915 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT,  test "x$with_libdevstat"  = "xyes")
916
917 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
918 if test "x$with_libkvm" = "xyes"
919 then
920         AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
921 fi
922 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
923
924 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
925 [
926         if test "x$withval" != "xno" && test "x$withval" != "xyes"
927         then
928                 LDFLAGS="$LDFLAGS -L$withval/lib"
929                 CPPFLAGS="$CPPFLAGS -I$withval/include"
930                 with_lm_sensors="yes"
931         fi
932 ],
933 [
934         if test "x$ac_system" = "xLinux"
935         then
936                 with_lm_sensors="yes"
937         else
938                 with_lm_sensors="no (Linux only library)"
939         fi
940 ])
941 if test "x$with_lm_sensors" = "xyes"
942 then
943         AC_CHECK_LIB(sensors, sensors_init,
944         [
945                 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
946         ],
947         [with_lm_sensors="no (libsensors not found)"])
948 fi
949 if test "x$with_lm_sensors" = "xyes"
950 then
951         AC_CHECK_HEADERS(sensors/sensors.h,
952         [
953                 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
954         ],
955         [with_lm_sensors="no (sensors/sensors.h not found)"])
956 fi
957 if test "x$with_lm_sensors" = "xyes"
958 then
959         collect_lm_sensors=1
960 else
961         collect_lm_sensors=0
962 fi
963 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
964         [Wether or not to use sensors library])
965 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
966
967 with_mysql_config="mysql_config"
968 with_mysql_cflags=""
969 with_mysql_libs=""
970 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
971 [
972         if test "x$withval" = "xno"
973         then
974                 with_libmysql="no"
975         else if test "x$withval" = "xyes"
976         then
977                 with_libmysql="yes"
978         else
979                 if test -f "$withval" && test -x "$withval";
980                 then
981                         with_mysql_config="$withval"
982                 else if test -x "$withval/bin/mysql_config"
983                 then
984                         with_mysql_config="$withval/bin/mysql_config"
985                 fi; fi
986                 with_libmysql="yes"
987         fi; fi
988 ],
989 [
990         with_libmysql="yes"
991 ])
992 if test "x$with_libmysql" = "xyes"
993 then
994         with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
995         mysql_config_status=$?
996
997         if test $mysql_config_status -ne 0
998         then
999                 with_libmysql="no"
1000         else
1001                 SAVE_CFLAGS=$CFLAGS
1002                 CFLAGS="$CFLAGS $with_mysql_cflags"
1003
1004                 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
1005
1006                 CFLAGS="$SAVE_CFLAGS"
1007         fi
1008 fi
1009 if test "x$with_libmysql" = "xyes"
1010 then
1011         with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1012         mysql_config_status=$?
1013
1014         if test $mysql_config_status -ne 0
1015         then
1016                 with_libmysql="no"
1017         else
1018                 AC_CHECK_LIB(mysqlclient, mysql_init,
1019                  [with_libmysql="yes"],
1020                  [with_libmysql="no (symbol 'mysql_init' not found)"],
1021                  [$with_mysql_libs])
1022         fi
1023 fi
1024 if test "x$with_libmysql" = "xyes"
1025 then
1026         BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1027         BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1028         AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1029         AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1030 fi
1031 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1032
1033 with_own_liboconfig="no"
1034 liboconfig_LDFLAGS="$LDFLAGS"
1035 liboconfig_CPPFLAGS="$CPPFLAGS"
1036 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1037 [
1038         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1039         then
1040                 if test -d "$withval/lib"
1041                 then
1042                         liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1043                 fi
1044                 if test -d "$withval/include"
1045                 then
1046                         liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1047                 fi
1048         fi
1049         if test "x$withval" = "xno"
1050         then
1051                 AC_MSG_ERROR("liboconfig is required")
1052         fi
1053 ],
1054 [
1055         with_liboconfig="yes"
1056 ])
1057
1058 save_LDFLAGS="$LDFLAGS"
1059 save_CPPFLAGS="$CPPFLAGS"
1060 LDFLAGS="$liboconfig_LDFLAGS"
1061 CPPFLAGS="$liboconfig_CPPFLAGS"
1062 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1063 [
1064         with_liboconfig="yes"
1065         with_own_liboconfig="no"
1066 ],
1067 [
1068         with_liboconfig="yes"
1069         with_own_liboconfig="yes"
1070         LDFLAGS="$save_LDFLAGS"
1071         CPPFLAGS="$save_CPPFLAGS"
1072 ])
1073
1074 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1075 if test "x$with_own_liboconfig" = "xyes"
1076 then
1077         with_liboconfig="yes (shipped version)"
1078 fi
1079
1080 #with_liboping="yes"
1081 with_own_liboping="no"
1082 liboping_LDFLAGS="$LDFLAGS"
1083 liboping_CPPFLAGS="$CPPFLAGS"
1084 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1085 [
1086         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1087         then
1088                 if test -d "$withval/lib"
1089                 then
1090                         liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1091                 fi
1092                 if test -d "$withval/include"
1093                 then
1094                         liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1095                 fi
1096         fi
1097         if test "x$withval" = "xno"
1098         then
1099                 with_liboping="no"
1100                 with_own_liboping="no"
1101         fi
1102 ],
1103 [
1104         #753
1105         with_liboping="yes"
1106 ])
1107
1108 if test "x$with_liboping" = "xyes"
1109 then
1110         save_LDFLAGS="$LDFLAGS"
1111         save_CPPFLAGS="$CPPFLAGS"
1112         LDFLAGS="$liboping_LDFLAGS"
1113         CPPFLAGS="$liboping_CPPFLAGS"
1114         AC_CHECK_LIB(oping, ping_construct,
1115         [
1116                 with_liboping="yes"
1117                 with_own_liboping="no"
1118         ],
1119         [
1120                 with_liboping="yes"
1121                 with_own_liboping="yes"
1122                 LDFLAGS="$save_LDFLAGS"
1123                 CPPFLAGS="$save_CPPFLAGS"
1124         ])
1125 fi
1126 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1127 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1128
1129 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1130 [
1131         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1132         then
1133                 LDFLAGS="$LDFLAGS -L$withval/lib"
1134                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1135                 with_libpcap="yes"
1136         fi
1137 ],
1138 [
1139         with_libpcap="yes"
1140 ])
1141 if test "x$with_libpcap" = "xyes"
1142 then
1143         AC_CHECK_LIB(pcap, pcap_open_live,
1144         [
1145                 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1146         ], [with_libpcap="no (libpcap not found)"])
1147 fi
1148 if test "x$with_libpcap" = "xyes"
1149 then
1150         AC_CHECK_HEADERS(pcap.h,
1151         [
1152                 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1153         ], [with_libpcap="no (pcap.h not found)"])
1154 fi
1155 if test "x$with_libpcap" = "xyes"
1156 then
1157         collect_libpcap=1
1158 else
1159         collect_libpcap=0
1160 fi
1161 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1162         [Wether or not to use the pcap library])
1163 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1164
1165 perl_interpreter="perl"
1166 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1167 [
1168         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1169         then
1170                 LDFLAGS="$LDFLAGS -L$withval/lib"
1171                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1172                 perl_interpreter="$withval/bin/perl"
1173                 with_libperl="yes"
1174         fi
1175 ],
1176 [
1177         with_libperl="yes"
1178 ])
1179 if test "x$with_libperl" = "xyes"
1180 then
1181   SAVE_CFLAGS=$CFLAGS
1182   SAVE_LDFLAGS=$LDFLAGS
1183   PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1184   PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1185   CFLAGS="$CFLAGS $PERL_CFLAGS"
1186   LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1187
1188   AC_CACHE_CHECK([for libperl],
1189     [have_libperl],
1190     AC_LINK_IFELSE(
1191       AC_LANG_PROGRAM(
1192       [[
1193 #include <EXTERN.h>
1194 #include <perl.h>
1195 #include <XSUB.h>
1196       ]],
1197       [[
1198        PerlInterpreter *perl = NULL;
1199        Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1200                          newSVpv ("Collectd::Plugin::FooBar", 24),
1201                          Nullsv);
1202       ]]),
1203       [have_libperl="yes"],
1204       [have_libperl="no"]
1205     )
1206   )
1207
1208   if test "x$have_libperl" = "xyes"
1209   then
1210           AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1211           AC_SUBST(PERL_CFLAGS)
1212           AC_SUBST(PERL_LDFLAGS)
1213   else
1214           with_libperl="no"
1215   fi
1216
1217   CFLAGS=$SAVE_CFLAGS
1218   LDFLAGS=$SAVE_LDFLAGS
1219 fi
1220 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1221
1222 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1223 [
1224         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1225         then
1226                 LDFLAGS="$LDFLAGS -L$withval/lib"
1227                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1228                 with_libiptc="yes"
1229         fi
1230 ],
1231 [
1232         if test "x$ac_system" = "xLinux"
1233         then
1234                 with_libiptc="yes"
1235         else
1236                 with_libiptc="no (Linux only)"
1237         fi
1238 ])
1239 if test "x$with_libiptc" = "xyes"
1240 then
1241         AC_CHECK_LIB(iptc, iptc_init,
1242         [
1243                 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1244         ], [with_libiptc="no (libiptc not found)"])
1245 fi
1246 if test "x$with_libiptc" = "xyes"
1247 then
1248         AC_CHECK_HEADERS(libiptc/libiptc.h,
1249         [
1250                 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1251         ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1252 fi
1253 if test "x$with_libiptc" = "xyes"
1254 then
1255         collect_libiptc=1
1256 else
1257         collect_libiptc=0
1258 fi
1259 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1260
1261 with_snmp_config="net-snmp-config"
1262 with_snmp_cflags=""
1263 with_snmp_libs=""
1264 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1265 [
1266         if test "x$withval" = "xno"
1267         then
1268                 with_libnetsnmp="no"
1269         else if test "x$withval" = "xyes"
1270         then
1271                 with_libnetsnmp="yes"
1272         else
1273                 if test -x "$withval"
1274                 then
1275                         with_snmp_config="$withval"
1276                         with_libnetsnmp="yes"
1277                 else
1278                         with_snmp_config="$withval/bin/net-snmp-config"
1279                         with_libnetsnmp="yes"
1280                 fi
1281         fi; fi
1282 ],
1283 [with_libnetsnmp="yes"])
1284 if test "x$with_libnetsnmp" = "xyes"
1285 then
1286         with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1287         snmp_config_status=$?
1288
1289         if test $snmp_config_status -ne 0
1290         then
1291                 with_libnetsnmp="no ($with_snmp_config failed)"
1292         else
1293                 SAVE_CFLAGS=$CFLAGS
1294                 CFLAGS="$CFLAGS $with_snmp_cflags"
1295                 
1296                 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1297
1298                 CFLAGS="$SAVE_CFLAGS"
1299         fi
1300 fi
1301 if test "x$with_libnetsnmp" = "xyes"
1302 then
1303         with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1304         snmp_config_status=$?
1305
1306         if test $snmp_config_status -ne 0
1307         then
1308                 with_libnetsnmp="no ($with_snmp_config failed)"
1309         else
1310                 AC_CHECK_LIB(netsnmp, init_snmp,
1311                 [with_libnetsnmp="yes"],
1312                 [with_libnetsnmp="no (libnetsnmp not found)"],
1313                 [$with_snmp_libs])
1314         fi
1315 fi
1316 if test "x$with_libnetsnmp" = "xyes"
1317 then
1318         BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1319         BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1320         AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1321         AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1322 fi
1323 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1324
1325 with_upsclient_config="libupsclient-config"
1326 with_upsclient_cflags=""
1327 with_upsclient_libs=""
1328 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1329 [
1330         if test "x$withval" = "xno"
1331         then
1332                 with_libupsclient="no"
1333         else
1334                 if test "x$withval" != "xyes"
1335                 then
1336                         if test -f "$withval" && test -x "$withval";
1337                         then
1338                                 with_upsclient_config="$withval"
1339                         else
1340                                 with_upsclient_config="$withval/bin/libupsclient-config"
1341                         fi
1342                 fi
1343                 with_libupsclient="yes"
1344         fi
1345 ],
1346 [
1347         with_libupsclient="yes"
1348 ])
1349 if test "x$with_libupsclient" = "xyes"
1350 then
1351         with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1352         upsclient_config_status=$?
1353
1354         if test $upsclient_config_status -ne 0
1355         then
1356                 with_libupsclient="no ($with_upsclient_config failed)"
1357         fi
1358 fi
1359 if test "x$with_libupsclient" = "xyes"
1360 then
1361         SAVE_CFLAGS="$CFLAGS"
1362         CFLAGS="$CFLAGS $with_upsclient_cflags"
1363
1364         AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1365
1366         CFLAGS="$SAVE_CFLAGS"
1367 fi
1368 if test "x$with_libupsclient" = "xyes"
1369 then
1370         with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1371         upsclient_config_status=$?
1372
1373         if test $upsclient_config_status -ne 0
1374         then
1375                 with_libupsclient="no ($with_upsclient_config failed)"
1376         fi
1377 fi
1378 if test "x$with_libupsclient" = "xyes"
1379 then
1380         AC_CHECK_LIB(upsclient, upscli_connect,
1381         [
1382                 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1383                 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1384                 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1385                 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1386         ],
1387         [
1388                 with_libupsclient="no (symbol 'upscli_connect' not found)"
1389         ], [$with_upsclient_libs])
1390 fi
1391 if test "x$with_libupsclient" = "xyes"
1392 then
1393         AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [], 
1394 [#include <stdlib.h>
1395 #include <stdio.h>
1396 #include <upsclient.h>])
1397 fi
1398 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1399
1400 ### BEGIN of check for libxmms ###
1401 with_xmms_config="xmms-config"
1402 with_xmms_cflags=""
1403 with_xmms_libs=""
1404 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1405 [
1406         if test "x$withval" != "xno" -a "x$withval" != "xyes"
1407         then
1408                 if test -f "$withval" && test -x "$withval";
1409                 then
1410                         with_xmms_config="$withval"
1411                 else if test -x "$withval/bin/xmms-config"
1412                 then
1413                         with_xmms_config="$withval/bin/xmms-config"
1414                 fi; fi
1415                 with_libxmms="yes"
1416         else if test "x$withval" = "xno"
1417         then
1418                 with_libxmms="no"
1419         else
1420                 with_libxmms="yes"
1421         fi; fi
1422 ],
1423 [
1424         with_libxmms="yes"
1425 ])
1426 if test "x$with_libxmms" = "xyes"
1427 then
1428         with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1429         xmms_config_status=$?
1430
1431         if test $xmms_config_status -ne 0
1432         then
1433                 with_libxmms="no"
1434         fi
1435 fi
1436 if test "x$with_libxmms" = "xyes"
1437 then
1438         with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1439         xmms_config_status=$?
1440
1441         if test $xmms_config_status -ne 0
1442         then
1443                 with_libxmms="no"
1444         fi
1445 fi
1446 if test "x$with_libxmms" = "xyes"
1447 then
1448         AC_CHECK_LIB(xmms, xmms_remote_get_info,
1449         [
1450                 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1451                 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1452                 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1453                 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1454         ],
1455         [
1456                 with_libxmms="no"
1457         ],
1458         [$with_xmms_libs])
1459 fi
1460 with_libxmms_numeric=0
1461 if test "x$with_libxmms" = "xyes"
1462 then
1463         with_libxmms_numeric=1
1464 fi
1465 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1466 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1467 ### END of check for libxmms ###
1468
1469 with_libnetlink_cflags=""
1470 with_libnetlink_libs="-lnetlink"
1471 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1472 [
1473  echo "libnetlink: withval = $withval"
1474  if test "x$withval" = "xyes"
1475  then
1476          with_libnetlink="yes"
1477  else if test "x$withval" = "xno"
1478  then
1479          with_libnetlink="no"
1480  else
1481          if test -d "$withval/include"
1482          then
1483                  with_libnetlink_cflags="-I$withval/include"
1484                  with_libnetlink_libs="-L$withval/lib -lnetlink"
1485                  with_libnetlink="yes"
1486          else
1487                  AC_MSG_ERROR("no such directory: $withval/include")
1488          fi
1489  fi; fi
1490 ],
1491 [
1492  if test "x$ac_system" = "xLinux"
1493  then
1494          with_libnetlink="yes"
1495  else
1496          with_libnetlink="no (Linux only library)"
1497  fi
1498 ])
1499 if test "x$with_libnetlink" = "xyes"
1500 then
1501         SAVE_CFLAGS=$CFLAGS
1502         CFLAGS="$CFLAGS $with_libnetlink_cflags"
1503
1504         with_libnetlink="no (libnetlink.h not found)"
1505
1506         AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1507         [
1508          with_libnetlink="yes"
1509          break
1510         ], [],
1511 [#include <stdio.h>
1512 #include <sys/types.h>
1513 #include <asm/types.h>
1514 #include <sys/socket.h>
1515 #include <linux/netlink.h>
1516 #include <linux/rtnetlink.h>])
1517         AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1518 [#include <stdio.h>
1519 #include <sys/types.h>
1520 #include <asm/types.h>
1521 #include <sys/socket.h>])
1522
1523         AC_COMPILE_IFELSE(
1524 [#include <stdio.h>
1525 #include <sys/types.h>
1526 #include <asm/types.h>
1527 #include <sys/socket.h>
1528 #include <linux/netlink.h>
1529 #include <linux/rtnetlink.h>
1530
1531 int main (void)
1532 {
1533         int retval = TCA_STATS2;
1534         return (retval);
1535 }],
1536         [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1537         []);
1538
1539         AC_COMPILE_IFELSE(
1540 [#include <stdio.h>
1541 #include <sys/types.h>
1542 #include <asm/types.h>
1543 #include <sys/socket.h>
1544 #include <linux/netlink.h>
1545 #include <linux/rtnetlink.h>
1546
1547 int main (void)
1548 {
1549         int retval = TCA_STATS;
1550         return (retval);
1551 }],
1552         [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1553         []);
1554
1555         CFLAGS="$SAVE_CFLAGS"
1556 fi
1557 if test "x$with_libnetlink" = "xyes"
1558 then
1559         AC_CHECK_LIB(netlink, rtnl_open,
1560                      [with_libnetlink="yes"],
1561                      [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1562                      [$with_libnetlink_libs])
1563 fi
1564 if test "x$with_libnetlink" = "xyes"
1565 then
1566         BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1567         BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1568         AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1569         AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1570 fi
1571 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1572
1573 # Check for enabled/disabled features
1574 #
1575
1576 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1577 # ------------------------------------------------------------
1578 dnl
1579 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1580 dnl
1581 AC_DEFUN(
1582         [AC_COLLECTD],
1583         [
1584         m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1585         m4_if(
1586                 [$2],
1587                 [enable],
1588                 [dnl
1589                 m4_define([EnDis],[disabled])dnl
1590                 m4_define([YesNo],[no])dnl
1591                 ],dnl
1592                 [m4_if(
1593                         [$2],
1594                         [disable],
1595                         [dnl
1596                         m4_define([EnDis],[enabled])dnl
1597                         m4_define([YesNo],[yes])dnl
1598                         ],
1599                         [dnl
1600                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1601                         ]dnl
1602                 )]dnl
1603         )dnl
1604         m4_if([$3], [feature], [],
1605                 [m4_if(
1606                         [$3], [module], [],
1607                         [dnl
1608                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1609                         ]dnl
1610                 )]dnl
1611         )dnl
1612         AC_ARG_ENABLE(
1613                 [$1],
1614                 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1615                 [],
1616                 enable_$1='[YesNo]'dnl
1617         )# AC_ARG_ENABLE
1618 if test "x$enable_$1" = "xno"
1619 then
1620         collectd_$1=0
1621 else
1622         if test "x$enable_$1" = "xyes"
1623         then
1624                 collectd_$1=1
1625         else
1626                 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1627                 collectd_$1=1
1628                 enable_$1='yes'
1629         fi
1630 fi
1631         AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1632         AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1633         ]dnl
1634 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1635
1636 # AC_PLUGIN(name, default, info)
1637 # ------------------------------------------------------------
1638 dnl
1639 AC_DEFUN(
1640   [AC_PLUGIN],
1641   [
1642     enable_plugin="no"
1643     AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1644     [
1645      if test "x$enableval" = "xyes"
1646      then
1647              enable_plugin="yes"
1648      else
1649              enable_plugin="no"
1650      fi
1651     ],
1652     [
1653      if test "x$2" = "xyes"
1654      then
1655              enable_plugin="yes"
1656      else
1657              enable_plugin="no"
1658      fi
1659     ])
1660     if test "x$enable_plugin" = "xyes"
1661     then
1662             AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1663     fi
1664     AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1665     enable_$1="$enable_plugin"
1666   ]
1667 )# AC_PLUGIN(name, default, info)
1668
1669 m4_divert_once([HELP_ENABLE], [
1670 collectd features:])
1671 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1672 AC_COLLECTD([debug],     [enable],  [feature], [debugging])
1673 AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
1674 AC_COLLECTD([getifaddrs],[enable],  [feature], [getifaddrs under Linux])
1675
1676 plugin_battery="no"
1677 plugin_cpu="no"
1678 plugin_cpufreq="no"
1679 plugin_df="no"
1680 plugin_disk="no"
1681 plugin_entropy="no"
1682 plugin_interface="no"
1683 plugin_irq="no"
1684 plugin_load="no"
1685 plugin_memory="no"
1686 plugin_multimeter="no"
1687 plugin_nfs="no"
1688 plugin_processes="no"
1689 plugin_serial="no"
1690 plugin_swap="no"
1691 plugin_tape="no"
1692 plugin_users="no"
1693 plugin_vserver="no"
1694 plugin_wireless="no"
1695
1696 # Linux
1697 if test "x$ac_system" = "xLinux"
1698 then
1699         plugin_battery="yes"
1700         plugin_cpu="yes"
1701         plugin_cpufreq="yes"
1702         plugin_disk="yes"
1703         plugin_entropy="yes"
1704         plugin_interface="yes"
1705         plugin_irq="yes"
1706         plugin_load="yes"
1707         plugin_memory="yes"
1708         plugin_nfs="yes"
1709         plugin_processes="yes"
1710         plugin_serial="yes"
1711         plugin_swap="yes"
1712         plugin_vserver="yes"
1713         plugin_wireless="yes"
1714 fi
1715
1716 # Mac OS X devices
1717 if test "x$with_libiokit" = "xyes"
1718 then
1719         plugin_battery="yes"
1720         plugin_disk="yes"
1721 fi
1722
1723 # Solaris
1724 if test "x$with_devinfo$with_kstat" = "xyesyes"
1725 then
1726         plugin_cpu="yes"
1727         plugin_disk="yes"
1728         plugin_interface="yes"
1729         plugin_memory="yes"
1730         plugin_swap="yes"
1731         plugin_tape="yes"
1732 fi
1733
1734 # libstatgrab
1735 if test "x$with_libstatgrab" = "xyes"
1736 then
1737         plugin_interface="yes"
1738         plugin_load="yes"
1739         plugin_memory="yes"
1740         plugin_swap="yes"
1741 fi
1742
1743 if test "x$have_processor_info" = "xyes"
1744 then
1745         plugin_cpu="yes"
1746 fi
1747 if test "x$have_sysctlbyname" = "xyes"
1748 then
1749         plugin_cpu="yes"
1750         plugin_memory="yes"
1751 fi
1752
1753 if test "x$have_statfs" = "xyes"
1754 then
1755         plugin_df="yes"
1756 fi
1757 if test "x$have_statvfs" = "xyes"
1758 then
1759         plugin_df="yes"
1760 fi
1761
1762 if test "x$have_getifaddrs" = "xyes"
1763 then
1764         plugin_interface="yes"
1765 fi
1766
1767 if test "x$have_getloadavg" = "xyes"
1768 then
1769         plugin_load="yes"
1770 fi
1771
1772 # Mac OS X memory interface
1773 if test "x$have_host_statistics" = "xyes"
1774 then
1775         plugin_memory="yes"
1776 fi
1777
1778 if test "x$have_termios_h" = "xyes"
1779 then
1780         plugin_multimeter="yes"
1781 fi
1782
1783 if test "x$have_thread_info" = "xyes"
1784 then
1785         plugin_processes="yes"
1786 fi
1787
1788 if test "x$with_libkvm" = "xyes"
1789 then
1790         plugin_swap="yes"
1791 fi
1792
1793 if test "x$have_getutent" = "xyes"
1794 then
1795         plugin_users="yes"
1796 fi
1797 if test "x$have_getutxent" = "xyes"
1798 then
1799         plugin_users="yes"
1800 fi
1801
1802 # FIXME: sysctl for swap plugin
1803
1804 m4_divert_once([HELP_ENABLE], [
1805 collectd plugins:])
1806
1807 AC_PLUGIN([apache],      [$with_libcurl],      [Apache httpd statistics])
1808 AC_PLUGIN([apcups],      [yes],                [Statistics of UPSes by APC])
1809 AC_PLUGIN([apple_sensors], [$with_libiokit],   [Apple's hardware sensors])
1810 AC_PLUGIN([battery],     [$plugin_battery],    [Battery statistics])
1811 AC_PLUGIN([cpu],         [$plugin_cpu],        [CPU usage statistics])
1812 AC_PLUGIN([cpufreq],     [$plugin_cpufreq],    [CPU frequency statistics])
1813 AC_PLUGIN([csv],         [yes],                [CSV output plugin])
1814 AC_PLUGIN([df],          [$plugin_df],         [Filesystem usage statistics])
1815 AC_PLUGIN([disk],        [$plugin_disk],       [Disk usage statistics])
1816 AC_PLUGIN([dns],         [$with_libpcap],      [DNS traffic analysis])
1817 AC_PLUGIN([email],       [yes],                [EMail statistics])
1818 AC_PLUGIN([entropy],     [$plugin_entropy],    [Entropy statistics])
1819 AC_PLUGIN([exec],        [yes],                [Execution of external programs])
1820 AC_PLUGIN([hddtemp],     [yes],                [Query hddtempd])
1821 AC_PLUGIN([interface],   [$plugin_interface],  [Interface traffic statistics])
1822 AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
1823 AC_PLUGIN([irq],         [$plugin_irq],        [IRQ statistics])
1824 AC_PLUGIN([load],        [$plugin_load],       [System load])
1825 AC_PLUGIN([logfile],     [yes],                [File logging plugin])
1826 AC_PLUGIN([mbmon],       [yes],                [Query mbmond])
1827 AC_PLUGIN([memory],      [$plugin_memory],     [Memory usage])
1828 AC_PLUGIN([multimeter],  [$plugin_multimeter], [Read multimeter values])
1829 AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
1830 AC_PLUGIN([netlink],     [$with_libnetlink],   [Enhanced Linux network statistics])
1831 AC_PLUGIN([network],     [yes],                [Network communication plugin])
1832 AC_PLUGIN([nfs],         [$plugin_nfs],        [NFS statistics])
1833 AC_PLUGIN([ntpd],        [yes],                [NTPd statistics])
1834 AC_PLUGIN([nut],         [$with_libupsclient], [Network UPS tools statistics])
1835 AC_PLUGIN([perl],        [$with_libperl],      [Embed a Perl interpreter])
1836 AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
1837 AC_PLUGIN([processes],   [$plugin_processes],  [Process statistics])
1838 AC_PLUGIN([rrdtool],     [$with_rrdtool],      [RRDTool output plugin])
1839 AC_PLUGIN([sensors],     [$with_lm_sensors],   [lm_sensors statistics])
1840 AC_PLUGIN([serial],      [$plugin_serial],     [serial port traffic])
1841 AC_PLUGIN([snmp],        [$with_libnetsnmp],   [SNMP querying plugin])
1842 AC_PLUGIN([swap],        [$plugin_swap],       [Swap usage statistics])
1843 AC_PLUGIN([syslog],      [$have_syslog],       [Syslog logging plugin])
1844 AC_PLUGIN([tape],        [$plugin_tape],       [Tape drive statistics])
1845 AC_PLUGIN([unixsock],    [yes],                [Unixsock communication plugin])
1846 AC_PLUGIN([users],       [$plugin_users],      [User statistics])
1847 AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
1848 AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
1849 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
1850
1851 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
1852
1853 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1854 then
1855         with_liboping="yes (shipped version)"
1856 fi
1857
1858 if test "x$with_libperl" = "xyes"
1859 then
1860         with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)"
1861 else
1862         enable_perl="no (needs libperl)"
1863 fi
1864
1865 cat <<EOF;
1866
1867 Configuration:
1868   Libraries:
1869     libcurl . . . . . . $with_libcurl
1870     libiokit  . . . . . $with_libiokit
1871     libiptc . . . . . . $with_libiptc
1872     libkstat  . . . . . $with_kstat
1873     libkvm  . . . . . . $with_libkvm
1874     libmysql  . . . . . $with_libmysql
1875     libnetlink  . . . . $with_libnetlink
1876     libnetsnmp  . . . . $with_libnetsnmp
1877     liboconfig  . . . . $with_liboconfig
1878     liboping  . . . . . $with_liboping
1879     libpcap . . . . . . $with_libpcap
1880     libperl . . . . . . $with_libperl
1881     libpthread  . . . . $with_libpthread
1882     librrd  . . . . . . $with_rrdtool
1883     libsensors  . . . . $with_lm_sensors
1884     libstatgrab . . . . $with_libstatgrab
1885     libupsclient  . . . $with_libupsclient
1886     libxmms . . . . . . $with_libxmms
1887
1888   Features:
1889     daemon mode . . . . $enable_daemon
1890     debug . . . . . . . $enable_debug
1891
1892   Modules:
1893     apache  . . . . . . $enable_apache
1894     apcups  . . . . . . $enable_apcups
1895     apple_sensors . . . $enable_apple_sensors
1896     battery . . . . . . $enable_battery
1897     cpu . . . . . . . . $enable_cpu
1898     cpufreq . . . . . . $enable_cpufreq
1899     csv . . . . . . . . $enable_csv
1900     df  . . . . . . . . $enable_df
1901     disk  . . . . . . . $enable_disk
1902     dns . . . . . . . . $enable_dns
1903     email . . . . . . . $enable_email
1904     entropy . . . . . . $enable_entropy
1905     exec  . . . . . . . $enable_exec
1906     hddtemp . . . . . . $enable_hddtemp
1907     interface . . . . . $enable_interface
1908     iptables  . . . . . $enable_iptables
1909     irq . . . . . . . . $enable_irq
1910     load  . . . . . . . $enable_load
1911     logfile . . . . . . $enable_logfile
1912     mbmon . . . . . . . $enable_mbmon
1913     memory  . . . . . . $enable_memory
1914     multimeter  . . . . $enable_multimeter
1915     mysql . . . . . . . $enable_mysql
1916     netlink . . . . . . $enable_netlink
1917     network . . . . . . $enable_network
1918     nfs . . . . . . . . $enable_nfs
1919     ntpd  . . . . . . . $enable_ntpd
1920     nut . . . . . . . . $enable_nut
1921     perl  . . . . . . . $enable_perl
1922     ping  . . . . . . . $enable_ping
1923     processes . . . . . $enable_processes
1924     rrdtool . . . . . . $enable_rrdtool
1925     sensors . . . . . . $enable_sensors
1926     serial  . . . . . . $enable_serial
1927     snmp  . . . . . . . $enable_snmp
1928     swap  . . . . . . . $enable_swap
1929     syslog  . . . . . . $enable_syslog
1930     tape  . . . . . . . $enable_tape
1931     unixsock  . . . . . $enable_unixsock
1932     users . . . . . . . $enable_users
1933     vserver . . . . . . $enable_vserver
1934     wireless  . . . . . $enable_wireless
1935     xmms  . . . . . . . $enable_xmms
1936
1937 EOF