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