rrdtool plugin: Use the thread-safe `librrd_th' if available.
[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_CFLAGS="$CFLAGS"
687         SAVE_LDFLAGS="$LDFLAGS"
688
689         CFLAGS="$CFLAGS $librrd_cflags"
690         LDFLAGS="$LDFLAGS $librrd_ldflags"
691
692         AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
693
694         CFLAGS="$SAVE_CFLAGS"
695         LDFLAGS="$SAVE_LDFLAGS"
696 fi
697 if test "x$with_rrdtool" = "xyes"
698 then
699         AC_CHECK_LIB(rrd_th, rrd_update_r,
700         [with_rrdtool="yes"
701          librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
702         ],
703         [librrd_threadsafe="no"
704          AC_CHECK_LIB(rrd, rrd_update,
705          [with_rrdtool="yes"
706           librrd_ldflags="$librrd_ldflags -lrrd -lm"
707          ],
708          [with_rrdtool="no (symbol 'rrd_update' not found)"],
709          [-lm])
710         ]
711         [-lm])
712 fi
713 if test "x$with_rrdtool" = "xyes"
714 then
715         BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
716         BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
717         AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
718         AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
719 fi
720 if test "x$librrd_threadsafe" = "xyes"
721 then
722         AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
723 fi
724
725 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
726 [       if test "x$withval" != "xno" -a "x$withval" != "xyes"
727         then
728                 LDFLAGS="$LDFLAGS -L$withval/lib"
729                 CPPFLAGS="$CPPFLAGS -I$withval/include"
730                 with_libpthread="yes"
731         else
732                 if test "x$withval" = "xno"
733                 then
734                         with_libpthread="no (disabled)"
735                 fi
736         fi
737 ], [with_libpthread="yes"])
738 if test "x$with_libpthread" = "xyes"
739 then
740         AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
741 fi
742 if test "x$with_libpthread" = "xyes"
743 then
744         AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
745 fi
746 if test "x$with_libpthread" = "xyes"
747 then
748         collect_pthread=1
749 else
750         collect_pthread=0
751 fi
752 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
753         [Wether or not to use pthread (POSIX threads) library])
754 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
755
756 if test "x$ac_system" = "xSolaris"
757 then
758         with_kstat="yes"
759         with_devinfo="yes"
760 else
761         with_kstat="no (Solaris only)"
762         with_devinfo="no (Solaris only)"
763 fi
764
765 if test "x$with_kstat" = "xyes"
766 then
767         AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
768 fi
769 if test "x$with_kstat" = "xyes"
770 then
771         AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
772         AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
773 fi
774 if test "x$with_kstat" = "xyes"
775 then
776         AC_DEFINE(HAVE_LIBKSTAT, 1,
777                   [Define to 1 if you have the 'kstat' library (-lkstat)])
778 fi
779 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
780 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
781
782 ### BEGIN of check for libcurl ###
783 with_curl_config="curl-config"
784 with_curl_cflags=""
785 with_curl_libs=""
786 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
787 [
788         if test "x$withval" = "xno"
789         then
790                 with_libcurl="no"
791         else if test "x$withval" = "xyes"
792         then
793                 with_libcurl="yes"
794         else
795                 if test -f "$withval" && test -x "$withval"
796                 then
797                         with_curl_config="$withval"
798                         with_libcurl="yes"
799                 else if test -x "$withval/bin/curl-config"
800                 then
801                         with_curl_config="$withval/bin/curl-config"
802                         with_libcurl="yes"
803                 fi; fi
804                 with_libcurl="yes"
805         fi; fi
806 ],
807 [
808         with_libcurl="yes"
809 ])
810 if test "x$with_libcurl" = "xyes"
811 then
812         with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
813         curl_config_status=$?
814
815         if test $curl_config_status -ne 0
816         then
817                 with_libcurl="no ($with_curl_config failed)"
818         else
819                 SAVE_CFLAGS=$CFLAGS
820                 CFLAGS="$CFLAGS $with_curl_cflags"
821
822                 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
823
824                 CFLAGS="$SAVE_CFLAGS"
825         fi
826 fi
827 if test "x$with_libcurl" = "xyes"
828 then
829         with_curl_libs=`$with_curl_config --libs 2>/dev/null`
830         curl_config_status=$?
831
832         if test $curl_config_status -ne 0
833         then
834                 with_libcurl="no ($with_curl_config failed)"
835         else
836                 AC_CHECK_LIB(curl, curl_easy_init,
837                  [with_libcurl="yes"],
838                  [with_libcurl="no (symbol 'curl_easy_init' not found)"],
839                  [$with_curl_libs])
840         fi
841 fi
842 if test "x$with_libcurl" = "xyes"
843 then
844         BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
845         BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
846         AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
847         AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
848 fi
849 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
850 ### END of check for libcurl ###
851
852 with_libiokit="no"
853 collectd_libiokit=0
854 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
855 [
856         with_libiokit="yes"
857         collectd_libiokit=1
858 ], 
859 [
860         with_libiokit="no"
861         collectd_libiokit=0
862 ])
863 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
864 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
865
866 with_libstatgrab="yes"
867 with_libdevstat="no"
868 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
869 [
870         if test "x$withval" != "xno" -a "x$withval" != "xyes"
871         then
872                 LDFLAGS="$LDFLAGS -L$withval/lib"
873                 CPPFLAGS="$CPPFLAGS -I$withval/include"
874                 with_libstatgrab="yes"
875         fi
876 ],
877 [
878         if test "x$ac_system" == "xunknown"
879         then
880                 with_libstatgrab="yes"
881         else
882                 with_libstatgrab="no"
883         fi
884 ])
885 if test "x$with_libstatgrab" = "xyes"
886 then
887         AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
888 fi
889 if test "x$with_libstatgrab" = "xyes"
890 then
891         AC_CHECK_HEADERS(statgrab.h,,    [with_libstatgrab="no (statgrab.h not found)"])
892 fi
893 if test "x$with_libstatgrab" = "xyes"
894 then
895         AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
896 fi
897 if test "x$with_libstatgrab" = "xyes"
898 then
899         collect_libstatgrab=1
900 else
901         collect_libstatgrab=0
902 fi
903 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
904         [Wether or not to use statgrab library])
905 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
906 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT,  test "x$with_libdevstat"  = "xyes")
907
908 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
909 if test "x$with_libkvm" = "xyes"
910 then
911         AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
912 fi
913 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
914
915 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
916 [
917         if test "x$withval" != "xno" && test "x$withval" != "xyes"
918         then
919                 LDFLAGS="$LDFLAGS -L$withval/lib"
920                 CPPFLAGS="$CPPFLAGS -I$withval/include"
921                 with_lm_sensors="yes"
922         fi
923 ],
924 [
925         if test "x$ac_system" = "xLinux"
926         then
927                 with_lm_sensors="yes"
928         else
929                 with_lm_sensors="no (Linux only library)"
930         fi
931 ])
932 if test "x$with_lm_sensors" = "xyes"
933 then
934         AC_CHECK_LIB(sensors, sensors_init,
935         [
936                 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
937         ],
938         [with_lm_sensors="no (libsensors not found)"])
939 fi
940 if test "x$with_lm_sensors" = "xyes"
941 then
942         AC_CHECK_HEADERS(sensors/sensors.h,
943         [
944                 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
945         ],
946         [with_lm_sensors="no (sensors/sensors.h not found)"])
947 fi
948 if test "x$with_lm_sensors" = "xyes"
949 then
950         collect_lm_sensors=1
951 else
952         collect_lm_sensors=0
953 fi
954 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
955         [Wether or not to use sensors library])
956 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
957
958 with_mysql_config="mysql_config"
959 with_mysql_cflags=""
960 with_mysql_libs=""
961 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
962 [
963         if test "x$withval" = "xno"
964         then
965                 with_libmysql="no"
966         else if test "x$withval" = "xyes"
967         then
968                 with_libmysql="yes"
969         else
970                 if test -f "$withval" && test -x "$withval";
971                 then
972                         with_mysql_config="$withval"
973                 else if test -x "$withval/bin/mysql_config"
974                 then
975                         with_mysql_config="$withval/bin/mysql_config"
976                 fi; fi
977                 with_libmysql="yes"
978         fi; fi
979 ],
980 [
981         with_libmysql="yes"
982 ])
983 if test "x$with_libmysql" = "xyes"
984 then
985         with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
986         mysql_config_status=$?
987
988         if test $mysql_config_status -ne 0
989         then
990                 with_libmysql="no"
991         else
992                 SAVE_CFLAGS=$CFLAGS
993                 CFLAGS="$CFLAGS $with_mysql_cflags"
994
995                 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
996
997                 CFLAGS="$SAVE_CFLAGS"
998         fi
999 fi
1000 if test "x$with_libmysql" = "xyes"
1001 then
1002         with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1003         mysql_config_status=$?
1004
1005         if test $mysql_config_status -ne 0
1006         then
1007                 with_libmysql="no"
1008         else
1009                 AC_CHECK_LIB(mysqlclient, mysql_init,
1010                  [with_libmysql="yes"],
1011                  [with_libmysql="no (symbol 'mysql_init' not found)"],
1012                  [$with_mysql_libs])
1013         fi
1014 fi
1015 if test "x$with_libmysql" = "xyes"
1016 then
1017         BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1018         BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1019         AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1020         AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1021 fi
1022 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1023
1024 with_own_liboconfig="no"
1025 liboconfig_LDFLAGS="$LDFLAGS"
1026 liboconfig_CPPFLAGS="$CPPFLAGS"
1027 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1028 [
1029         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1030         then
1031                 if test -d "$withval/lib"
1032                 then
1033                         liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1034                 fi
1035                 if test -d "$withval/include"
1036                 then
1037                         liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1038                 fi
1039         fi
1040         if test "x$withval" = "xno"
1041         then
1042                 AC_MSG_ERROR("liboconfig is required")
1043         fi
1044 ],
1045 [
1046         with_liboconfig="yes"
1047 ])
1048
1049 save_LDFLAGS="$LDFLAGS"
1050 save_CPPFLAGS="$CPPFLAGS"
1051 LDFLAGS="$liboconfig_LDFLAGS"
1052 CPPFLAGS="$liboconfig_CPPFLAGS"
1053 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1054 [
1055         with_liboconfig="yes"
1056         with_own_liboconfig="no"
1057 ],
1058 [
1059         with_liboconfig="yes"
1060         with_own_liboconfig="yes"
1061         LDFLAGS="$save_LDFLAGS"
1062         CPPFLAGS="$save_CPPFLAGS"
1063 ])
1064
1065 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1066 if test "x$with_own_liboconfig" = "xyes"
1067 then
1068         with_liboconfig="yes (shipped version)"
1069 fi
1070
1071 #with_liboping="yes"
1072 with_own_liboping="no"
1073 liboping_LDFLAGS="$LDFLAGS"
1074 liboping_CPPFLAGS="$CPPFLAGS"
1075 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1076 [
1077         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1078         then
1079                 if test -d "$withval/lib"
1080                 then
1081                         liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1082                 fi
1083                 if test -d "$withval/include"
1084                 then
1085                         liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1086                 fi
1087         fi
1088         if test "x$withval" = "xno"
1089         then
1090                 with_liboping="no"
1091                 with_own_liboping="no"
1092         fi
1093 ],
1094 [
1095         #753
1096         with_liboping="yes"
1097 ])
1098
1099 if test "x$with_liboping" = "xyes"
1100 then
1101         save_LDFLAGS="$LDFLAGS"
1102         save_CPPFLAGS="$CPPFLAGS"
1103         LDFLAGS="$liboping_LDFLAGS"
1104         CPPFLAGS="$liboping_CPPFLAGS"
1105         AC_CHECK_LIB(oping, ping_construct,
1106         [
1107                 with_liboping="yes"
1108                 with_own_liboping="no"
1109         ],
1110         [
1111                 with_liboping="yes"
1112                 with_own_liboping="yes"
1113                 LDFLAGS="$save_LDFLAGS"
1114                 CPPFLAGS="$save_CPPFLAGS"
1115         ])
1116 fi
1117 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1118 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1119
1120 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1121 [
1122         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1123         then
1124                 LDFLAGS="$LDFLAGS -L$withval/lib"
1125                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1126                 with_libpcap="yes"
1127         fi
1128 ],
1129 [
1130         with_libpcap="yes"
1131 ])
1132 if test "x$with_libpcap" = "xyes"
1133 then
1134         AC_CHECK_LIB(pcap, pcap_open_live,
1135         [
1136                 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1137         ], [with_libpcap="no (libpcap not found)"])
1138 fi
1139 if test "x$with_libpcap" = "xyes"
1140 then
1141         AC_CHECK_HEADERS(pcap.h,
1142         [
1143                 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1144         ], [with_libpcap="no (pcap.h not found)"])
1145 fi
1146 if test "x$with_libpcap" = "xyes"
1147 then
1148         collect_libpcap=1
1149 else
1150         collect_libpcap=0
1151 fi
1152 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1153         [Wether or not to use the pcap library])
1154 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1155
1156 perl_interpreter="perl"
1157 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1158 [
1159         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1160         then
1161                 LDFLAGS="$LDFLAGS -L$withval/lib"
1162                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1163                 perl_interpreter="$withval/bin/perl"
1164                 with_libperl="yes"
1165         fi
1166 ],
1167 [
1168         with_libperl="yes"
1169 ])
1170 if test "x$with_libperl" = "xyes"
1171 then
1172   SAVE_CFLAGS=$CFLAGS
1173   SAVE_LDFLAGS=$LDFLAGS
1174   PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1175   PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1176   CFLAGS="$CFLAGS $PERL_CFLAGS"
1177   LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1178
1179   AC_CACHE_CHECK([for libperl],
1180     [have_libperl],
1181     AC_LINK_IFELSE(
1182       AC_LANG_PROGRAM(
1183       [[
1184 #include <EXTERN.h>
1185 #include <perl.h>
1186 #include <XSUB.h>
1187       ]],
1188       [[
1189        PerlInterpreter *perl = NULL;
1190        Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1191                          newSVpv ("Collectd::Plugin::FooBar", 24),
1192                          Nullsv);
1193       ]]),
1194       [have_libperl="yes"],
1195       [have_libperl="no"]
1196     )
1197   )
1198
1199   if test "x$have_libperl" = "xyes"
1200   then
1201           AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1202           AC_SUBST(PERL_CFLAGS)
1203           AC_SUBST(PERL_LDFLAGS)
1204   else
1205           with_libperl="no"
1206   fi
1207
1208   CFLAGS=$SAVE_CFLAGS
1209   LDFLAGS=$SAVE_LDFLAGS
1210 fi
1211 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1212
1213 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1214 [
1215         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1216         then
1217                 LDFLAGS="$LDFLAGS -L$withval/lib"
1218                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1219                 with_libiptc="yes"
1220         fi
1221 ],
1222 [
1223         if test "x$ac_system" = "xLinux"
1224         then
1225                 with_libiptc="yes"
1226         else
1227                 with_libiptc="no (Linux only)"
1228         fi
1229 ])
1230 if test "x$with_libiptc" = "xyes"
1231 then
1232         AC_CHECK_LIB(iptc, iptc_init,
1233         [
1234                 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1235         ], [with_libiptc="no (libiptc not found)"])
1236 fi
1237 if test "x$with_libiptc" = "xyes"
1238 then
1239         AC_CHECK_HEADERS(libiptc/libiptc.h,
1240         [
1241                 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1242         ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1243 fi
1244 if test "x$with_libiptc" = "xyes"
1245 then
1246         collect_libiptc=1
1247 else
1248         collect_libiptc=0
1249 fi
1250 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1251
1252 with_snmp_config="net-snmp-config"
1253 with_snmp_cflags=""
1254 with_snmp_libs=""
1255 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1256 [
1257         if test "x$withval" = "xno"
1258         then
1259                 with_libnetsnmp="no"
1260         else if "x$withval" = "xyes"
1261         then
1262                 with_libnetsnmp="yes"
1263         else
1264                 if test -x "$withval"
1265                 then
1266                         with_snmp_config="$withval"
1267                         with_libnetsnmp="yes"
1268                 else
1269                         with_snmp_config="$withval/bin/net-snmp-config"
1270                         with_libnetsnmp="yes"
1271                 fi
1272         fi; fi
1273 ],
1274 [with_libnetsnmp="yes"])
1275 if test "x$with_libnetsnmp" = "xyes"
1276 then
1277         with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1278         snmp_config_status=$?
1279
1280         if test $snmp_config_status -ne 0
1281         then
1282                 with_libnetsnmp="no ($with_snmp_config failed)"
1283         else
1284                 SAVE_CFLAGS=$CFLAGS
1285                 CFLAGS="$CFLAGS $with_snmp_cflags"
1286                 
1287                 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1288
1289                 CFLAGS="$SAVE_CFLAGS"
1290         fi
1291 fi
1292 if test "x$with_libnetsnmp" = "xyes"
1293 then
1294         with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1295         snmp_config_status=$?
1296
1297         if test $snmp_config_status -ne 0
1298         then
1299                 with_libnetsnmp="no ($with_snmp_config failed)"
1300         else
1301                 AC_CHECK_LIB(netsnmp, init_snmp,
1302                 [with_libnetsnmp="yes"],
1303                 [with_libnetsnmp="no (libnetsnmp not found)"],
1304                 [$with_snmp_libs])
1305         fi
1306 fi
1307 if test "x$with_libnetsnmp" = "xyes"
1308 then
1309         BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1310         BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1311         AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1312         AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1313 fi
1314 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1315
1316 with_upsclient_config="libupsclient-config"
1317 with_upsclient_cflags=""
1318 with_upsclient_libs=""
1319 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1320 [
1321         if test "x$withval" = "xno"
1322         then
1323                 with_libupsclient="no"
1324         else
1325                 if test "x$withval" != "xyes"
1326                 then
1327                         if test -f "$withval" && test -x "$withval";
1328                         then
1329                                 with_upsclient_config="$withval"
1330                         else
1331                                 with_upsclient_config="$withval/bin/libupsclient-config"
1332                         fi
1333                 fi
1334                 with_libupsclient="yes"
1335         fi
1336 ],
1337 [
1338         with_libupsclient="yes"
1339 ])
1340 if test "x$with_libupsclient" = "xyes"
1341 then
1342         with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1343         upsclient_config_status=$?
1344
1345         if test $upsclient_config_status -ne 0
1346         then
1347                 with_libupsclient="no ($with_upsclient_config failed)"
1348         fi
1349 fi
1350 if test "x$with_libupsclient" = "xyes"
1351 then
1352         SAVE_CFLAGS="$CFLAGS"
1353         CFLAGS="$CFLAGS $with_upsclient_cflags"
1354
1355         AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1356
1357         CFLAGS="$SAVE_CFLAGS"
1358 fi
1359 if test "x$with_libupsclient" = "xyes"
1360 then
1361         with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1362         upsclient_config_status=$?
1363
1364         if test $upsclient_config_status -ne 0
1365         then
1366                 with_libupsclient="no ($with_upsclient_config failed)"
1367         fi
1368 fi
1369 if test "x$with_libupsclient" = "xyes"
1370 then
1371         AC_CHECK_LIB(upsclient, upscli_connect,
1372         [
1373                 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1374                 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1375                 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1376                 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1377         ],
1378         [
1379                 with_libupsclient="no (symbol 'upscli_connect' not found)"
1380         ], [$with_upsclient_libs])
1381 fi
1382 if test "x$with_libupsclient" = "xyes"
1383 then
1384         AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [], 
1385 [#include <stdlib.h>
1386 #include <stdio.h>
1387 #include <upsclient.h>])
1388 fi
1389 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1390
1391 ### BEGIN of check for libxmms ###
1392 with_xmms_config="xmms-config"
1393 with_xmms_cflags=""
1394 with_xmms_libs=""
1395 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1396 [
1397         if test "x$withval" != "xno" -a "x$withval" != "xyes"
1398         then
1399                 if test -f "$withval" && test -x "$withval";
1400                 then
1401                         with_xmms_config="$withval"
1402                 else if test -x "$withval/bin/xmms-config"
1403                 then
1404                         with_xmms_config="$withval/bin/xmms-config"
1405                 fi; fi
1406                 with_libxmms="yes"
1407         else if test "x$withval" = "xno"
1408         then
1409                 with_libxmms="no"
1410         else
1411                 with_libxmms="yes"
1412         fi; fi
1413 ],
1414 [
1415         with_libxmms="yes"
1416 ])
1417 if test "x$with_libxmms" = "xyes"
1418 then
1419         with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1420         xmms_config_status=$?
1421
1422         if test $xmms_config_status -ne 0
1423         then
1424                 with_libxmms="no"
1425         fi
1426 fi
1427 if test "x$with_libxmms" = "xyes"
1428 then
1429         with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1430         xmms_config_status=$?
1431
1432         if test $xmms_config_status -ne 0
1433         then
1434                 with_libxmms="no"
1435         fi
1436 fi
1437 if test "x$with_libxmms" = "xyes"
1438 then
1439         AC_CHECK_LIB(xmms, xmms_remote_get_info,
1440         [
1441                 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1442                 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1443                 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1444                 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1445         ],
1446         [
1447                 with_libxmms="no"
1448         ],
1449         [$with_xmms_libs])
1450 fi
1451 with_libxmms_numeric=0
1452 if test "x$with_libxmms" = "xyes"
1453 then
1454         with_libxmms_numeric=1
1455 fi
1456 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1457 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1458 ### END of check for libxmms ###
1459
1460 with_libnetlink_cflags=""
1461 with_libnetlink_libs="-lnetlink"
1462 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1463 [
1464  echo "libnetlink: withval = $withval"
1465  if test "x$withval" = "xyes"
1466  then
1467          with_libnetlink="yes"
1468  else if test "x$withval" = "xno"
1469  then
1470          with_libnetlink="no"
1471  else
1472          if test -d "$withval/include"
1473          then
1474                  with_libnetlink_cflags="-I$withval/include"
1475                  with_libnetlink_libs="-L$withval/lib -lnetlink"
1476                  with_libnetlink="yes"
1477          else
1478                  AC_MSG_ERROR("no such directory: $withval/include")
1479          fi
1480  fi; fi
1481 ],
1482 [
1483  if test "x$ac_system" = "xLinux"
1484  then
1485          with_libnetlink="yes"
1486  else
1487          with_libnetlink="no (Linux only library)"
1488  fi
1489 ])
1490 if test "x$with_libnetlink" = "xyes"
1491 then
1492         SAVE_CFLAGS=$CFLAGS
1493         CFLAGS="$CFLAGS $with_libnetlink_cflags"
1494
1495         with_libnetlink="no (libnetlink.h not found)"
1496
1497         AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1498         [
1499          with_libnetlink="yes"
1500          break
1501         ], [],
1502 [#include <stdio.h>
1503 #include <sys/types.h>
1504 #include <asm/types.h>
1505 #include <sys/socket.h>
1506 #include <linux/netlink.h>
1507 #include <linux/rtnetlink.h>])
1508         AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1509 [#include <stdio.h>
1510 #include <sys/types.h>
1511 #include <asm/types.h>
1512 #include <sys/socket.h>])
1513
1514         AC_COMPILE_IFELSE(
1515 [#include <stdio.h>
1516 #include <sys/types.h>
1517 #include <asm/types.h>
1518 #include <sys/socket.h>
1519 #include <linux/netlink.h>
1520 #include <linux/rtnetlink.h>
1521
1522 int main (void)
1523 {
1524         int retval = TCA_STATS2;
1525         return (retval);
1526 }],
1527         [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1528         []);
1529
1530         AC_COMPILE_IFELSE(
1531 [#include <stdio.h>
1532 #include <sys/types.h>
1533 #include <asm/types.h>
1534 #include <sys/socket.h>
1535 #include <linux/netlink.h>
1536 #include <linux/rtnetlink.h>
1537
1538 int main (void)
1539 {
1540         int retval = TCA_STATS;
1541         return (retval);
1542 }],
1543         [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1544         []);
1545
1546         CFLAGS="$SAVE_CFLAGS"
1547 fi
1548 if test "x$with_libnetlink" = "xyes"
1549 then
1550         AC_CHECK_LIB(netlink, rtnl_open,
1551                      [with_libnetlink="yes"],
1552                      [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1553                      [$with_libnetlink_libs])
1554 fi
1555 if test "x$with_libnetlink" = "xyes"
1556 then
1557         BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1558         BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1559         AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1560         AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1561 fi
1562 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1563
1564 # Check for enabled/disabled features
1565 #
1566
1567 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1568 # ------------------------------------------------------------
1569 dnl
1570 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1571 dnl
1572 AC_DEFUN(
1573         [AC_COLLECTD],
1574         [
1575         m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1576         m4_if(
1577                 [$2],
1578                 [enable],
1579                 [dnl
1580                 m4_define([EnDis],[disabled])dnl
1581                 m4_define([YesNo],[no])dnl
1582                 ],dnl
1583                 [m4_if(
1584                         [$2],
1585                         [disable],
1586                         [dnl
1587                         m4_define([EnDis],[enabled])dnl
1588                         m4_define([YesNo],[yes])dnl
1589                         ],
1590                         [dnl
1591                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1592                         ]dnl
1593                 )]dnl
1594         )dnl
1595         m4_if([$3], [feature], [],
1596                 [m4_if(
1597                         [$3], [module], [],
1598                         [dnl
1599                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1600                         ]dnl
1601                 )]dnl
1602         )dnl
1603         AC_ARG_ENABLE(
1604                 [$1],
1605                 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1606                 [],
1607                 enable_$1='[YesNo]'dnl
1608         )# AC_ARG_ENABLE
1609 if test "x$enable_$1" = "xno"
1610 then
1611         collectd_$1=0
1612 else
1613         if test "x$enable_$1" = "xyes"
1614         then
1615                 collectd_$1=1
1616         else
1617                 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1618                 collectd_$1=1
1619                 enable_$1='yes'
1620         fi
1621 fi
1622         AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1623         AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1624         ]dnl
1625 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1626
1627 # AC_PLUGIN(name, default, info)
1628 # ------------------------------------------------------------
1629 dnl
1630 AC_DEFUN(
1631   [AC_PLUGIN],
1632   [
1633     enable_plugin="no"
1634     AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1635     [
1636      if test "x$enableval" = "xyes"
1637      then
1638              enable_plugin="yes"
1639      else
1640              enable_plugin="no"
1641      fi
1642     ],
1643     [
1644      if test "x$2" = "xyes"
1645      then
1646              enable_plugin="yes"
1647      else
1648              enable_plugin="no"
1649      fi
1650     ])
1651     if test "x$enable_plugin" = "xyes"
1652     then
1653             AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1654     fi
1655     AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1656     enable_$1="$enable_plugin"
1657   ]
1658 )# AC_PLUGIN(name, default, info)
1659
1660 m4_divert_once([HELP_ENABLE], [
1661 collectd features:])
1662 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1663 AC_COLLECTD([debug],     [enable],  [feature], [debugging])
1664 AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
1665 AC_COLLECTD([getifaddrs],[enable],  [feature], [getifaddrs under Linux])
1666
1667 plugin_battery="no"
1668 plugin_cpu="no"
1669 plugin_cpufreq="no"
1670 plugin_df="no"
1671 plugin_disk="no"
1672 plugin_entropy="no"
1673 plugin_interface="no"
1674 plugin_irq="no"
1675 plugin_load="no"
1676 plugin_memory="no"
1677 plugin_multimeter="no"
1678 plugin_nfs="no"
1679 plugin_processes="no"
1680 plugin_serial="no"
1681 plugin_swap="no"
1682 plugin_tape="no"
1683 plugin_users="no"
1684 plugin_vserver="no"
1685 plugin_wireless="no"
1686
1687 # Linux
1688 if test "x$ac_system" = "xLinux"
1689 then
1690         plugin_battery="yes"
1691         plugin_cpu="yes"
1692         plugin_cpufreq="yes"
1693         plugin_disk="yes"
1694         plugin_entropy="yes"
1695         plugin_interface="yes"
1696         plugin_irq="yes"
1697         plugin_load="yes"
1698         plugin_memory="yes"
1699         plugin_nfs="yes"
1700         plugin_processes="yes"
1701         plugin_serial="yes"
1702         plugin_swap="yes"
1703         plugin_vserver="yes"
1704         plugin_wireless="yes"
1705 fi
1706
1707 # Mac OS X devices
1708 if test "x$with_libiokit" = "xyes"
1709 then
1710         plugin_battery="yes"
1711         plugin_disk="yes"
1712 fi
1713
1714 # Solaris
1715 if test "x$with_devinfo$with_kstat" = "xyesyes"
1716 then
1717         plugin_cpu="yes"
1718         plugin_disk="yes"
1719         plugin_interface="yes"
1720         plugin_memory="yes"
1721         plugin_swap="yes"
1722         plugin_tape="yes"
1723 fi
1724
1725 # libstatgrab
1726 if test "x$with_libstatgrab" = "xyes"
1727 then
1728         plugin_interface="yes"
1729         plugin_load="yes"
1730         plugin_memory="yes"
1731         plugin_swap="yes"
1732 fi
1733
1734 if test "x$have_processor_info" = "xyes"
1735 then
1736         plugin_cpu="yes"
1737 fi
1738 if test "x$have_sysctlbyname" = "xyes"
1739 then
1740         plugin_cpu="yes"
1741         plugin_memory="yes"
1742 fi
1743
1744 if test "x$have_statfs" = "xyes"
1745 then
1746         plugin_df="yes"
1747 fi
1748 if test "x$have_statvfs" = "xyes"
1749 then
1750         plugin_df="yes"
1751 fi
1752
1753 if test "x$have_getifaddrs" = "xyes"
1754 then
1755         plugin_interface="yes"
1756 fi
1757
1758 if test "x$have_getloadavg" = "xyes"
1759 then
1760         plugin_load="yes"
1761 fi
1762
1763 # Mac OS X memory interface
1764 if test "x$have_host_statistics" = "xyes"
1765 then
1766         plugin_memory="yes"
1767 fi
1768
1769 if test "x$have_termios_h" = "xyes"
1770 then
1771         plugin_multimeter="yes"
1772 fi
1773
1774 if test "x$have_thread_info" = "xyes"
1775 then
1776         plugin_processes="yes"
1777 fi
1778
1779 if test "x$with_libkvm" = "xyes"
1780 then
1781         plugin_swap="yes"
1782 fi
1783
1784 if test "x$have_getutent" = "xyes"
1785 then
1786         plugin_users="yes"
1787 fi
1788 if test "x$have_getutxent" = "xyes"
1789 then
1790         plugin_users="yes"
1791 fi
1792
1793 # FIXME: sysctl for swap plugin
1794
1795 m4_divert_once([HELP_ENABLE], [
1796 collectd plugins:])
1797
1798 AC_PLUGIN([apache],      [$with_libcurl],      [Apache httpd statistics])
1799 AC_PLUGIN([apcups],      [yes],                [Statistics of UPSes by APC])
1800 AC_PLUGIN([apple_sensors], [$with_libiokit],   [Apple's hardware sensors])
1801 AC_PLUGIN([battery],     [$plugin_battery],    [Battery statistics])
1802 AC_PLUGIN([cpu],         [$plugin_cpu],        [CPU usage statistics])
1803 AC_PLUGIN([cpufreq],     [$plugin_cpufreq],    [CPU frequency statistics])
1804 AC_PLUGIN([csv],         [yes],                [CSV output plugin])
1805 AC_PLUGIN([df],          [$plugin_df],         [Filesystem usage statistics])
1806 AC_PLUGIN([disk],        [$plugin_disk],       [Disk usage statistics])
1807 AC_PLUGIN([dns],         [$with_libpcap],      [DNS traffic analysis])
1808 AC_PLUGIN([email],       [yes],                [EMail statistics])
1809 AC_PLUGIN([entropy],     [$plugin_entropy],    [Entropy statistics])
1810 AC_PLUGIN([exec],        [yes],                [Execution of external programs])
1811 AC_PLUGIN([hddtemp],     [yes],                [Query hddtempd])
1812 AC_PLUGIN([interface],   [$plugin_interface],  [Interface traffic statistics])
1813 AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
1814 AC_PLUGIN([irq],         [$plugin_irq],        [IRQ statistics])
1815 AC_PLUGIN([load],        [$plugin_load],       [System load])
1816 AC_PLUGIN([logfile],     [yes],                [File logging plugin])
1817 AC_PLUGIN([mbmon],       [yes],                [Query mbmond])
1818 AC_PLUGIN([memory],      [$plugin_memory],     [Memory usage])
1819 AC_PLUGIN([multimeter],  [$plugin_multimeter], [Read multimeter values])
1820 AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
1821 AC_PLUGIN([netlink],     [$with_libnetlink],   [Enhanced Linux network statistics])
1822 AC_PLUGIN([network],     [yes],                [Network communication plugin])
1823 AC_PLUGIN([nfs],         [$plugin_nfs],        [NFS statistics])
1824 AC_PLUGIN([ntpd],        [yes],                [NTPd statistics])
1825 AC_PLUGIN([nut],         [$with_libupsclient], [Network UPS tools statistics])
1826 AC_PLUGIN([perl],        [$with_libperl],      [Embed a Perl interpreter])
1827 AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
1828 AC_PLUGIN([processes],   [$plugin_processes],  [Process statistics])
1829 AC_PLUGIN([rrdtool],     [$with_rrdtool],      [RRDTool output plugin])
1830 AC_PLUGIN([sensors],     [$with_lm_sensors],   [lm_sensors statistics])
1831 AC_PLUGIN([serial],      [$plugin_serial],     [serial port traffic])
1832 AC_PLUGIN([snmp],        [$with_libnetsnmp],   [SNMP querying plugin])
1833 AC_PLUGIN([swap],        [$plugin_swap],       [Swap usage statistics])
1834 AC_PLUGIN([syslog],      [$have_syslog],       [Syslog logging plugin])
1835 AC_PLUGIN([tape],        [$plugin_tape],       [Tape drive statistics])
1836 AC_PLUGIN([unixsock],    [yes],                [Unixsock communication plugin])
1837 AC_PLUGIN([users],       [$plugin_users],      [User statistics])
1838 AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
1839 AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
1840 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
1841
1842 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
1843
1844 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1845 then
1846         with_liboping="yes (shipped version)"
1847 fi
1848
1849 if test "x$with_libperl" = "xyes"
1850 then
1851         with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)"
1852 else
1853         enable_perl="no (needs libperl)"
1854 fi
1855
1856 cat <<EOF;
1857
1858 Configuration:
1859   Libraries:
1860     libcurl . . . . . . $with_libcurl
1861     libiokit  . . . . . $with_libiokit
1862     libiptc . . . . . . $with_libiptc
1863     libkstat  . . . . . $with_kstat
1864     libkvm  . . . . . . $with_libkvm
1865     libmysql  . . . . . $with_libmysql
1866     libnetlink  . . . . $with_libnetlink
1867     libnetsnmp  . . . . $with_libnetsnmp
1868     liboconfig  . . . . $with_liboconfig
1869     liboping  . . . . . $with_liboping
1870     libpcap . . . . . . $with_libpcap
1871     libperl . . . . . . $with_libperl
1872     libpthread  . . . . $with_libpthread
1873     librrd  . . . . . . $with_rrdtool
1874     libsensors  . . . . $with_lm_sensors
1875     libstatgrab . . . . $with_libstatgrab
1876     libupsclient  . . . $with_libupsclient
1877     libxmms . . . . . . $with_libxmms
1878
1879   Features:
1880     daemon mode . . . . $enable_daemon
1881     debug . . . . . . . $enable_debug
1882
1883   Modules:
1884     apache  . . . . . . $enable_apache
1885     apcups  . . . . . . $enable_apcups
1886     apple_sensors . . . $enable_apple_sensors
1887     battery . . . . . . $enable_battery
1888     cpu . . . . . . . . $enable_cpu
1889     cpufreq . . . . . . $enable_cpufreq
1890     csv . . . . . . . . $enable_csv
1891     df  . . . . . . . . $enable_df
1892     disk  . . . . . . . $enable_disk
1893     dns . . . . . . . . $enable_dns
1894     email . . . . . . . $enable_email
1895     entropy . . . . . . $enable_entropy
1896     exec  . . . . . . . $enable_exec
1897     hddtemp . . . . . . $enable_hddtemp
1898     interface . . . . . $enable_interface
1899     iptables  . . . . . $enable_iptables
1900     irq . . . . . . . . $enable_irq
1901     load  . . . . . . . $enable_load
1902     logfile . . . . . . $enable_logfile
1903     mbmon . . . . . . . $enable_mbmon
1904     memory  . . . . . . $enable_memory
1905     multimeter  . . . . $enable_multimeter
1906     mysql . . . . . . . $enable_mysql
1907     netlink . . . . . . $enable_netlink
1908     network . . . . . . $enable_network
1909     nfs . . . . . . . . $enable_nfs
1910     ntpd  . . . . . . . $enable_ntpd
1911     nut . . . . . . . . $enable_nut
1912     perl  . . . . . . . $enable_perl
1913     ping  . . . . . . . $enable_ping
1914     processes . . . . . $enable_processes
1915     sensors . . . . . . $enable_sensors
1916     serial  . . . . . . $enable_serial
1917     snmp  . . . . . . . $enable_snmp
1918     swap  . . . . . . . $enable_swap
1919     syslog  . . . . . . $enable_syslog
1920     tape  . . . . . . . $enable_tape
1921     unixsock  . . . . . $enable_unixsock
1922     users . . . . . . . $enable_users
1923     vserver . . . . . . $enable_vserver
1924     wireless  . . . . . $enable_wireless
1925     xmms  . . . . . . . $enable_xmms
1926
1927 EOF