Merge branch 'collectd-4.2' into collectd-4.3
[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_PROG_CC_C_O
21 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
22
23 dnl configure libtool
24 AC_DISABLE_STATIC
25 AC_LIBLTDL_CONVENIENCE
26 AC_SUBST(LTDLINCL)
27 AC_SUBST(LIBLTDL)
28 AC_LIBTOOL_DLOPEN
29 AC_PROG_LIBTOOL
30 AC_PROG_LEX
31 AC_PROG_YACC
32 PKG_PROG_PKG_CONFIG
33 AC_CONFIG_SUBDIRS(libltdl)
34
35 AC_MSG_CHECKING([for kernel type ($host_os)])
36 case $host_os in
37         *linux*)
38         AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
39         ac_system="Linux"
40         ;;
41         *solaris*)
42         AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
43         ac_system="Solaris"
44         ;;
45         *darwin*)
46         ac_system="Darwin"
47         ;;
48         *)
49         ac_system="unknown"
50 esac
51 AC_MSG_RESULT([$ac_system])
52
53 #
54 # Checks for header files.
55 #
56 AC_HEADER_STDC
57 AC_HEADER_SYS_WAIT
58 AC_HEADER_DIRENT
59
60 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 endian.h)
61
62 # For ping library
63 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
64 [#if HAVE_STDINT_H
65 # include <stdint.h>
66 #endif
67 #if HAVE_SYS_TYPES_H
68 # include <sys/types.h>
69 #endif
70 ])
71 AC_CHECK_HEADERS(netinet/in.h, [], [],
72 [#if HAVE_STDINT_H
73 # include <stdint.h>
74 #endif
75 #if HAVE_SYS_TYPES_H
76 # include <sys/types.h>
77 #endif
78 #if HAVE_NETINET_IN_SYSTM_H
79 # include <netinet/in_systm.h>
80 #endif
81 ])
82 AC_CHECK_HEADERS(netinet/ip.h, [], [],
83 [#if HAVE_STDINT_H
84 # include <stdint.h>
85 #endif
86 #if HAVE_SYS_TYPES_H
87 # include <sys/types.h>
88 #endif
89 #if HAVE_NETINET_IN_SYSTM_H
90 # include <netinet/in_systm.h>
91 #endif
92 #if HAVE_NETINET_IN_H
93 # include <netinet/in.h>
94 #endif
95 ])
96 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
97 [#if HAVE_STDINT_H
98 # include <stdint.h>
99 #endif
100 #if HAVE_SYS_TYPES_H
101 # include <sys/types.h>
102 #endif
103 #if HAVE_NETINET_IN_SYSTM_H
104 # include <netinet/in_systm.h>
105 #endif
106 #if HAVE_NETINET_IN_H
107 # include <netinet/in.h>
108 #endif
109 #if HAVE_NETINET_IP_H
110 # include <netinet/ip.h>
111 #endif
112 ])
113 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
114 [#if HAVE_STDINT_H
115 # include <stdint.h>
116 #endif
117 #if HAVE_SYS_TYPES_H
118 # include <sys/types.h>
119 #endif
120 #if HAVE_NETINET_IN_SYSTM_H
121 # include <netinet/in_systm.h>
122 #endif
123 #if HAVE_NETINET_IN_H
124 # include <netinet/in.h>
125 #endif
126 #if HAVE_NETINET_IP_H
127 # include <netinet/ip.h>
128 #endif
129 ])
130 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
131 [#if HAVE_STDINT_H
132 # include <stdint.h>
133 #endif
134 #if HAVE_SYS_TYPES_H
135 # include <sys/types.h>
136 #endif
137 #if HAVE_NETINET_IN_SYSTM_H
138 # include <netinet/in_systm.h>
139 #endif
140 #if HAVE_NETINET_IN_H
141 # include <netinet/in.h>
142 #endif
143 ])
144 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
145 [#if HAVE_STDINT_H
146 # include <stdint.h>
147 #endif
148 #if HAVE_SYS_TYPES_H
149 # include <sys/types.h>
150 #endif
151 #if HAVE_NETINET_IN_SYSTM_H
152 # include <netinet/in_systm.h>
153 #endif
154 #if HAVE_NETINET_IN_H
155 # include <netinet/in.h>
156 #endif
157 #if HAVE_NETINET_IP6_H
158 # include <netinet/ip6.h>
159 #endif
160 ])
161 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
162 [#if HAVE_STDINT_H
163 # include <stdint.h>
164 #endif
165 #if HAVE_SYS_TYPES_H
166 # include <sys/types.h>
167 #endif
168 #if HAVE_NETINET_IN_SYSTM_H
169 # include <netinet/in_systm.h>
170 #endif
171 #if HAVE_NETINET_IN_H
172 # include <netinet/in.h>
173 #endif
174 #if HAVE_NETINET_IP_H
175 # include <netinet/ip.h>
176 #endif
177 ])
178 AC_CHECK_HEADERS(netinet/udp.h, [], [],
179 [#if HAVE_STDINT_H
180 # include <stdint.h>
181 #endif
182 #if HAVE_SYS_TYPES_H
183 # include <sys/types.h>
184 #endif
185 #if HAVE_NETINET_IN_SYSTM_H
186 # include <netinet/in_systm.h>
187 #endif
188 #if HAVE_NETINET_IN_H
189 # include <netinet/in.h>
190 #endif
191 #if HAVE_NETINET_IP_H
192 # include <netinet/ip.h>
193 #endif
194 ])
195
196 # For cpu modules
197 AC_CHECK_HEADERS(sys/dkstat.h)
198 if test "x$ac_system" = "xDarwin"
199 then
200         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)
201         AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
202 fi
203 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
204 [
205 #if HAVE_SYS_TYPES_H
206 #  include <sys/types.h>
207 #endif
208 #if HAVE_SYS_PARAM_H
209 # include <sys/param.h>
210 #endif
211 ])
212
213 # For hddtemp module
214 AC_CHECK_HEADERS(linux/major.h libgen.h)
215
216 # For the battery plugin
217 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
218 [
219 #if HAVE_IOKIT_IOKITLIB_H
220 #  include <IOKit/IOKitLib.h>
221 #endif
222 #if HAVE_IOKIT_IOTYPES_H
223 #  include <IOKit/IOTypes.h>
224 #endif
225 ])
226
227 # For the swap module
228 AC_CHECK_HEADERS(sys/swap.h, [], [],
229 [
230 #if HAVE_SYS_TYPES_H
231 #  include <sys/types.h>
232 #endif
233 #if HAVE_SYS_PARAM_H
234 # include <sys/param.h>
235 #endif
236 ])
237
238 # For load module
239 # For the processes plugin
240 # For users module
241 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
242
243 # For interface plugin
244 AC_CHECK_HEADERS(ifaddrs.h)
245 AC_CHECK_HEADERS(net/if.h, [], [],
246 [
247 #if HAVE_SYS_TYPES_H
248 #  include <sys/types.h>
249 #endif
250 #if HAVE_SYS_SOCKET_H
251 #  include <sys/socket.h>
252 #endif
253 ])
254 AC_CHECK_HEADERS(linux/if.h, [], [],
255 [
256 #if HAVE_SYS_TYPES_H
257 #  include <sys/types.h>
258 #endif
259 #if HAVE_SYS_SOCKET_H
260 #  include <sys/socket.h>
261 #endif
262 ])
263 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
264 [
265 #if HAVE_SYS_TYPES_H
266 #  include <sys/types.h>
267 #endif
268 #if HAVE_SYS_SOCKET_H
269 #  include <sys/socket.h>
270 #endif
271 #if HAVE_LINUX_IF_H
272 # include <linux/if.h>
273 #endif
274 ])
275
276 # For ipvs module
277 have_net_ip_vs_h="no"
278 have_ip_vs_h="no"
279 if test "x$ac_system" = "xLinux"
280 then
281         AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
282         AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
283 fi
284
285 # For quota module
286 AC_CHECK_HEADERS(sys/ucred.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 mount interface
297 AC_CHECK_HEADERS(sys/mount.h, [], [],
298 [
299 #if HAVE_SYS_TYPES_H
300 #  include <sys/types.h>
301 #endif
302 #if HAVE_SYS_PARAM_H
303 # include <sys/param.h>
304 #endif
305 ])
306
307 # For the email plugin
308 AC_CHECK_HEADERS(linux/un.h, [], [],
309 [
310 #if HAVE_SYS_SOCKET_H
311 #       include <sys/socket.h>
312 #endif
313 ])
314
315 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 wordexp.h)
316
317 # For the dns plugin
318 AC_CHECK_HEADERS(arpa/nameser.h)
319 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
320 [
321 #if HAVE_ARPA_NAMESER_H
322 # include <arpa/nameser.h>
323 #endif
324 ])
325
326 AC_CHECK_HEADERS(net/if_arp.h, [], [],
327 [#if HAVE_SYS_SOCKET_H
328 # include <sys/socket.h>
329 #endif
330 ])
331 AC_CHECK_HEADERS(net/ppp_defs.h)
332 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
333 [#if HAVE_NET_PPP_DEFS_H
334 # include <net/ppp_defs.h>
335 #endif
336 ])
337 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
338 [#if HAVE_STDINT_H
339 # include <stdint.h>
340 #endif
341 #if HAVE_SYS_TYPES_H
342 # include <sys/types.h>
343 #endif
344 #if HAVE_SYS_SOCKET_H
345 # include <sys/socket.h>
346 #endif
347 #if HAVE_NET_IF_H
348 # include <net/if.h>
349 #endif
350 #if HAVE_NETINET_IN_H
351 # include <netinet/in.h>
352 #endif
353 ])
354
355 # For the multimeter plugin
356 have_termios_h="no"
357 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
358
359 #
360 # Checks for typedefs, structures, and compiler characteristics.
361 #
362 AC_C_CONST
363 AC_TYPE_PID_T
364 AC_TYPE_SIZE_T
365 AC_TYPE_UID_T
366 AC_HEADER_TIME
367
368 #
369 # Checks for library functions.
370 #
371 AC_PROG_GCC_TRADITIONAL
372 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
373
374 AC_FUNC_STRERROR_R
375
376 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
377
378 socket_needs_socket="no"
379 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
380 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
381
382 nanosleep_needs_rt="no"
383 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
384 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
385
386 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
387 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
388 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
389 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
390 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
391 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
392 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
393 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
394 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
395 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
396
397 # For load module
398 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
399
400 # Check for NAN
401 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
402 [
403  if test "x$withval" = "xno"; then
404          nan_type="none"
405  else if test "x$withval" = "xyes"; then
406          nan_type="zero"
407  else
408          nan_type="$withval"
409  fi; fi
410 ],
411 [nan_type="none"])
412 if test "x$nan_type" = "xnone"; then
413   AC_CACHE_CHECK([whether NAN is defined by default],
414     [have_nan_default],
415     AC_COMPILE_IFELSE(
416       AC_LANG_PROGRAM(
417       [[
418 #include <stdlib.h>
419 #include <math.h>
420 static float foo = NAN;
421       ]],
422       [[
423        if (isnan (foo))
424         return 0;
425        else
426         return 1;
427       ]]),
428       [have_nan_default="yes"],
429       [have_nan_default="no"]
430     )
431   )
432   if test "x$have_nan_default" = "xyes"
433   then
434     nan_type="default"
435   fi
436 fi
437 if test "x$nan_type" = "xnone"; then
438   AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
439     [have_nan_isoc],
440     AC_COMPILE_IFELSE(
441       AC_LANG_PROGRAM(
442       [[
443 #include <stdlib.h>
444 #define __USE_ISOC99 1
445 #include <math.h>
446 static float foo = NAN;
447       ]],
448       [[
449        if (isnan (foo))
450         return 0;
451        else
452         return 1;
453       ]]),
454       [have_nan_isoc="yes"],
455       [have_nan_isoc="no"]
456     )
457   )
458   if test "x$have_nan_isoc" = "xyes"
459   then
460     nan_type="isoc99"
461   fi
462 fi
463 if test "x$nan_type" = "xnone"; then
464   AC_CACHE_CHECK([whether NAN can be defined by 0/0],
465     [have_nan_zero],
466     AC_RUN_IFELSE(
467       AC_LANG_PROGRAM(
468       [[
469 #include <stdlib.h>
470 #include <math.h>
471 #ifdef NAN
472 # undef NAN
473 #endif
474 #define NAN (0.0 / 0.0)
475 #ifndef isnan
476 # define isnan(f) ((f) != (f))
477 #endif
478 static float foo = NAN;
479       ]],
480       [[
481        if (isnan (foo))
482         return 0;
483        else
484         return 1;
485       ]]),
486       [have_nan_zero="yes"],
487       [have_nan_zero="no"]
488     )
489   )
490   if test "x$have_nan_zero" = "xyes"
491   then
492     nan_type="zero"
493   fi
494 fi
495
496 if test "x$nan_type" = "xdefault"; then
497   AC_DEFINE(NAN_STATIC_DEFAULT, 1,
498     [Define if NAN is defined by default and can initialize static variables.])
499 else if test "x$nan_type" = "xisoc99"; then
500   AC_DEFINE(NAN_STATIC_ISOC, 1,
501     [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
502 else if test "x$nan_type" = "xzero"; then
503   AC_DEFINE(NAN_ZERO_ZERO, 1,
504     [Define if NAN can be defined as (0.0 / 0.0)])
505 else
506   AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
507 fi; fi; fi
508
509 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
510 [
511  if test "x$withval" = "xnothing"; then
512         fp_layout_type="nothing"
513  else if test "x$withval" = "xendianflip"; then
514         fp_layout_type="endianflip"
515  else if test "x$withval" = "xintswap"; then
516         fp_layout_type="intswap"
517  else
518         AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
519 fi; fi; fi
520 ],
521 [fp_layout_type="unknown"])
522
523 if test "x$fp_layout_type" = "xunknown"; then
524   AC_CACHE_CHECK([if doubles are stored in x86 representation],
525     [fp_layout_need_nothing],
526     AC_RUN_IFELSE(
527       AC_LANG_PROGRAM(
528       [[[[
529 #include <stdlib.h>
530 #include <stdio.h>
531 #include <stdint.h>
532 #include <string.h>
533       ]]]],
534       [[[[
535         uint64_t i0;
536         uint64_t i1;
537         uint8_t c[8];
538         double d;
539
540         d = 8.642135e130; 
541         memcpy ((void *) &i0, (void *) &d, 8);
542
543         i1 = i0;
544         memcpy ((void *) c, (void *) &i1, 8);
545
546         if ((c[0] == 0x2f) && (c[1] == 0x25)
547                         && (c[2] == 0xc0) && (c[3] == 0xc7)
548                         && (c[4] == 0x43) && (c[5] == 0x2b)
549                         && (c[6] == 0x1f) && (c[7] == 0x5b))
550                 return (0);
551         else
552                 return (1);
553       ]]]]),
554       [fp_layout_need_nothing="yes"],
555       [fp_layout_need_nothing="no"]
556     )
557   )
558   if test "x$fp_layout_need_nothing" = "xyes"; then
559     fp_layout_type="nothing"
560   fi
561 fi
562 if test "x$fp_layout_type" = "xunknown"; then
563   AC_CACHE_CHECK([if endianflip converts to x86 representation],
564     [fp_layout_need_endianflip],
565     AC_RUN_IFELSE(
566       AC_LANG_PROGRAM(
567       [[[[
568 #include <stdlib.h>
569 #include <stdio.h>
570 #include <stdint.h>
571 #include <string.h>
572 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
573                        (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
574                        (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
575                        (((uint64_t)(A) & 0x000000ff00000000LL) >> 8)  | \
576                        (((uint64_t)(A) & 0x00000000ff000000LL) << 8)  | \
577                        (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
578                        (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
579                        (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
580       ]]]],
581       [[[[
582         uint64_t i0;
583         uint64_t i1;
584         uint8_t c[8];
585         double d;
586
587         d = 8.642135e130; 
588         memcpy ((void *) &i0, (void *) &d, 8);
589
590         i1 = endianflip (i0);
591         memcpy ((void *) c, (void *) &i1, 8);
592
593         if ((c[0] == 0x2f) && (c[1] == 0x25)
594                         && (c[2] == 0xc0) && (c[3] == 0xc7)
595                         && (c[4] == 0x43) && (c[5] == 0x2b)
596                         && (c[6] == 0x1f) && (c[7] == 0x5b))
597                 return (0);
598         else
599                 return (1);
600       ]]]]),
601       [fp_layout_need_endianflip="yes"],
602       [fp_layout_need_endianflip="no"]
603     )
604   )
605   if test "x$fp_layout_need_endianflip" = "xyes"; then
606     fp_layout_type="endianflip"
607   fi
608 fi
609 if test "x$fp_layout_type" = "xunknown"; then
610   AC_CACHE_CHECK([if intswap converts to x86 representation],
611     [fp_layout_need_intswap],
612     AC_RUN_IFELSE(
613       AC_LANG_PROGRAM(
614       [[[[
615 #include <stdlib.h>
616 #include <stdio.h>
617 #include <stdint.h>
618 #include <string.h>
619 #define intswap(A)    ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
620                        (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
621       ]]]],
622       [[[[
623         uint64_t i0;
624         uint64_t i1;
625         uint8_t c[8];
626         double d;
627
628         d = 8.642135e130; 
629         memcpy ((void *) &i0, (void *) &d, 8);
630
631         i1 = intswap (i0);
632         memcpy ((void *) c, (void *) &i1, 8);
633
634         if ((c[0] == 0x2f) && (c[1] == 0x25)
635                         && (c[2] == 0xc0) && (c[3] == 0xc7)
636                         && (c[4] == 0x43) && (c[5] == 0x2b)
637                         && (c[6] == 0x1f) && (c[7] == 0x5b))
638                 return (0);
639         else
640                 return (1);
641       ]]]]),
642       [fp_layout_need_intswap="yes"],
643       [fp_layout_need_intswap="no"]
644     )
645   )
646   if test "x$fp_layout_need_intswap" = "xyes"; then
647     fp_layout_type="intswap"
648   fi
649 fi
650
651 if test "x$fp_layout_type" = "xnothing"; then
652   AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
653   [Define if doubles are stored in x86 representation.])
654 else if test "x$fp_layout_type" = "xendianflip"; then
655   AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
656   [Define if endianflip is needed to convert to x86 representation.])
657 else if test "x$fp_layout_type" = "xintswap"; then
658   AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
659   [Define if intswap is needed to convert to x86 representation.])
660 else
661   AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
662 fi; fi; fi
663
664 have_getfsstat="no"
665 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
666 have_getvfsstat="no"
667 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
668 have_listmntent="no"
669 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
670
671 have_getmntent="no"
672 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
673 if test "x$have_getmntent" = "xno"; then
674         AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
675 fi
676 if test "x$have_getmntent" = "xno"; then
677         AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
678 fi
679 if test "x$have_getmntent" = "xno"; then
680         AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
681 fi
682
683 if test "x$have_getmntent" = "xc"; then
684         AC_CACHE_CHECK([whether getmntent takes one argument],
685                 [have_one_getmntent],
686                 AC_COMPILE_IFELSE(
687                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
688 #include <mntent.h>
689 #include "$srcdir/src/utils_mount.h"]],
690                                 [[
691                                  FILE *fh;
692                                  struct mntent *me;
693                                  fh = setmntent ("/etc/mtab", "r");
694                                  me = getmntent (fh);
695                                 ]]
696                         ),
697                         [have_one_getmntent="yes"],
698                         [have_one_getmntent="no"]
699                 )
700         )
701         AC_CACHE_CHECK([whether getmntent takes two arguments],
702                 [have_two_getmntent],
703                 AC_COMPILE_IFELSE(
704                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
705 #include <sys/mnttab.h>
706 #include "$srcdir/src/utils_mount.h"]],
707                                 [[
708                                  FILE *fh;
709                                  struct mnttab mt;
710                                  int status;
711                                  fh = fopen ("/etc/mnttab", "r");
712                                  status = getmntent (fh, &mt);
713                                 ]]
714                         ),
715                         [have_two_getmntent="yes"],
716                         [have_two_getmntent="no"]
717                 )
718         )
719 fi
720
721 # Check for different versions of `getmntent' here..
722
723 if test "x$have_getmntent" = "xc"; then
724         if test "x$have_one_getmntent" = "xyes"; then
725                 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
726                           [Define if the function getmntent exists and takes one argument.])
727         fi
728         if test "x$have_two_getmntent" = "xyes"; then
729                 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
730                           [Define if the function getmntent exists and takes two arguments.])
731         fi
732 fi
733 if test "x$have_getmntent" = "xsun"; then
734         AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
735                   [Define if the function getmntent exists. It's the version from libsun.])
736 fi
737 if test "x$have_getmntent" = "xseq"; then
738         AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
739                   [Define if the function getmntent exists. It's the version from libseq.])
740 fi
741 if test "x$have_getmntent" = "xgen"; then
742         AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
743                   [Define if the function getmntent exists. It's the version from libgen.])
744 fi
745
746 # Check for structures
747 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
748         [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
749         [],
750         [
751         #include <sys/types.h>
752         #include <sys/socket.h>
753         #include <net/if.h>
754         ])
755 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
756         [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
757         [],
758         [
759         #include <sys/types.h>
760         #include <sys/socket.h>
761         #include <linux/if.h>
762         #include <linux/netdevice.h>
763         ])
764
765 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
766 [#if HAVE_STDINT_H
767 # include <stdint.h>
768 #endif
769 #if HAVE_SYS_TYPES_H
770 # include <sys/types.h>
771 #endif
772 #if HAVE_NETINET_IN_SYSTM_H
773 # include <netinet/in_systm.h>
774 #endif
775 #if HAVE_NETINET_IN_H
776 # include <netinet/in.h>
777 #endif
778 #if HAVE_NETINET_IP_H
779 # include <netinet/ip.h>
780 #endif
781 #if HAVE_NETINET_UDP_H
782 # include <netinet/udp.h>
783 #endif
784 ])
785 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
786 [#if HAVE_STDINT_H
787 # include <stdint.h>
788 #endif
789 #if HAVE_SYS_TYPES_H
790 # include <sys/types.h>
791 #endif
792 #if HAVE_NETINET_IN_SYSTM_H
793 # include <netinet/in_systm.h>
794 #endif
795 #if HAVE_NETINET_IN_H
796 # include <netinet/in.h>
797 #endif
798 #if HAVE_NETINET_IP_H
799 # include <netinet/ip.h>
800 #endif
801 #if HAVE_NETINET_UDP_H
802 # include <netinet/udp.h>
803 #endif
804 ])
805
806 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
807         [],
808         [],
809         [
810 #if HAVE_KSTAT_H
811 # include <kstat.h>
812 #endif
813         ])
814
815 #
816 # Checks for libraries begin here
817 #
818 with_libresolv="yes"
819 AC_CHECK_LIB(resolv, res_search,
820 [
821         AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
822 ],
823 [with_libresolv="no"])
824 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
825
826 dnl Check for HAL (hardware abstraction library)
827 with_libhal="yes"
828 AC_CHECK_LIB(hal,libhal_device_property_exists,
829              [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
830              [with_libhal="no"])
831 if test "x$with_libhal" = "xyes"; then
832         PKG_PROG_PKG_CONFIG
833         if test "x$PKG_CONFIG" != "x"; then
834                 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
835                 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
836                 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
837                 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
838         fi
839 fi
840
841 m4_divert_once([HELP_WITH], [
842 collectd additional packages:])
843
844 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
845 librrd_cflags=""
846 librrd_ldflags=""
847 librrd_threadsafe="yes"
848 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
849 [       if test "x$withval" != "xno" && test "x$withval" != "xyes"
850         then
851                 librrd_cflags="-I$withval/include"
852                 librrd_ldflags="-L$withval/lib"
853                 with_rrdtool="yes"
854         else
855                 with_rrdtool="$withval"
856         fi
857 ], [with_rrdtool="yes"])
858 if test "x$with_rrdtool" = "xyes"
859 then
860         SAVE_CPPFLAGS="$CPPFLAGS"
861         SAVE_LDFLAGS="$LDFLAGS"
862
863         CPPFLAGS="$CPPFLAGS $librrd_cflags"
864         LDFLAGS="$LDFLAGS $librrd_ldflags"
865
866         AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
867
868         CPPFLAGS="$SAVE_CPPFLAGS"
869         LDFLAGS="$SAVE_LDFLAGS"
870 fi
871 if test "x$with_rrdtool" = "xyes"
872 then
873         SAVE_CPPFLAGS="$CPPFLAGS"
874         SAVE_LDFLAGS="$LDFLAGS"
875
876         CPPFLAGS="$CPPFLAGS $librrd_cflags"
877         LDFLAGS="$LDFLAGS $librrd_ldflags"
878
879         AC_CHECK_LIB(rrd_th, rrd_update_r,
880         [with_rrdtool="yes"
881          librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
882         ],
883         [librrd_threadsafe="no"
884          AC_CHECK_LIB(rrd, rrd_update,
885          [with_rrdtool="yes"
886           librrd_ldflags="$librrd_ldflags -lrrd -lm"
887          ],
888          [with_rrdtool="no (symbol 'rrd_update' not found)"],
889          [-lm])
890         ],
891         [-lm])
892
893         CPPFLAGS="$SAVE_CPPFLAGS"
894         LDFLAGS="$SAVE_LDFLAGS"
895 fi
896 if test "x$with_rrdtool" = "xyes"
897 then
898         BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
899         BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
900         AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
901         AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
902 fi
903 if test "x$librrd_threadsafe" = "xyes"
904 then
905         AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
906 fi
907
908 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
909 [       if test "x$withval" != "xno" -a "x$withval" != "xyes"
910         then
911                 LDFLAGS="$LDFLAGS -L$withval/lib"
912                 CPPFLAGS="$CPPFLAGS -I$withval/include"
913                 with_libpthread="yes"
914         else
915                 if test "x$withval" = "xno"
916                 then
917                         with_libpthread="no (disabled)"
918                 fi
919         fi
920 ], [with_libpthread="yes"])
921 if test "x$with_libpthread" = "xyes"
922 then
923         AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
924 fi
925 if test "x$with_libpthread" = "xyes"
926 then
927         AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
928 fi
929 if test "x$with_libpthread" = "xyes"
930 then
931         collect_pthread=1
932 else
933         collect_pthread=0
934 fi
935 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
936         [Wether or not to use pthread (POSIX threads) library])
937 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
938
939 if test "x$ac_system" = "xSolaris"
940 then
941         with_kstat="yes"
942         with_devinfo="yes"
943 else
944         with_kstat="no (Solaris only)"
945         with_devinfo="no (Solaris only)"
946 fi
947
948 if test "x$with_kstat" = "xyes"
949 then
950         AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
951 fi
952 if test "x$with_kstat" = "xyes"
953 then
954         AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
955         AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
956 fi
957 if test "x$with_kstat" = "xyes"
958 then
959         AC_DEFINE(HAVE_LIBKSTAT, 1,
960                   [Define to 1 if you have the 'kstat' library (-lkstat)])
961 fi
962 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
963 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
964
965 ### BEGIN of check for libcurl ###
966 with_curl_config="curl-config"
967 with_curl_cflags=""
968 with_curl_libs=""
969 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
970 [
971         if test "x$withval" = "xno"
972         then
973                 with_libcurl="no"
974         else if test "x$withval" = "xyes"
975         then
976                 with_libcurl="yes"
977         else
978                 if test -f "$withval" && test -x "$withval"
979                 then
980                         with_curl_config="$withval"
981                         with_libcurl="yes"
982                 else if test -x "$withval/bin/curl-config"
983                 then
984                         with_curl_config="$withval/bin/curl-config"
985                         with_libcurl="yes"
986                 fi; fi
987                 with_libcurl="yes"
988         fi; fi
989 ],
990 [
991         with_libcurl="yes"
992 ])
993 if test "x$with_libcurl" = "xyes"
994 then
995         with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
996         curl_config_status=$?
997
998         if test $curl_config_status -ne 0
999         then
1000                 with_libcurl="no ($with_curl_config failed)"
1001         else
1002                 SAVE_CPPFLAGS="$CPPFLAGS"
1003                 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1004
1005                 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1006
1007                 CPPFLAGS="$SAVE_CPPFLAGS"
1008         fi
1009 fi
1010 if test "x$with_libcurl" = "xyes"
1011 then
1012         with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1013         curl_config_status=$?
1014
1015         if test $curl_config_status -ne 0
1016         then
1017                 with_libcurl="no ($with_curl_config failed)"
1018         else
1019                 AC_CHECK_LIB(curl, curl_easy_init,
1020                  [with_libcurl="yes"],
1021                  [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1022                  [$with_curl_libs])
1023         fi
1024 fi
1025 if test "x$with_libcurl" = "xyes"
1026 then
1027         BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1028         BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1029         AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1030         AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1031 fi
1032 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1033 ### END of check for libcurl ###
1034
1035 with_libiokit="no"
1036 collectd_libiokit=0
1037 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1038 [
1039         with_libiokit="yes"
1040         collectd_libiokit=1
1041 ],
1042 [
1043         with_libiokit="no"
1044         collectd_libiokit=0
1045 ])
1046 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
1047 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1048
1049 with_libstatgrab_cflags=""
1050 with_libstatgrab_ldflags=""
1051 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
1052 [
1053         if test "x$withval" != "xno" -a "x$withval" != "xyes"
1054         then
1055                 with_libstatgrab_cflags="-I$withval/include"
1056                 with_libstatgrab_ldflags="-L$withval/lib"
1057                 with_libstatgrab="yes"
1058         else
1059                 with_libstatgrab="$withval"
1060         fi
1061 ],
1062 [
1063         if test "x$ac_system" == "xunknown"
1064         then
1065                 with_libstatgrab="yes"
1066         else
1067                 with_libstatgrab="no"
1068         fi
1069 ])
1070 with_libstatgrab_pkg_config="yes"
1071 if test "x$with_libstatgrab" = "xyes" \
1072   && test "x$PKG_CONFIG" != "x"
1073 then
1074   AC_MSG_CHECKING([pkg-config for libstatgrab])
1075   temp_result="found"
1076   $PKG_CONFIG --exists libstatgrab 2>/dev/null
1077   if test "$?" != "0"
1078   then
1079     with_libstatgrab_pkg_config="no"
1080     temp_result="not found"
1081   fi
1082   AC_MSG_RESULT([$temp_result])
1083 else
1084   AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
1085   with_libstatgrab_pkg_config="no"
1086   with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
1087 fi
1088
1089 if test "x$with_libstatgrab" = "xyes" \
1090   && test "x$with_libstatgrab_pkg_config" = "xyes" \
1091   && test "x$with_libstatgrab_cflags" = "x"
1092 then
1093   AC_MSG_CHECKING([for libstatgrab CFLAGS])
1094   temp_result="`$PKG_CONFIG --cflags libstatgrab`"
1095   if test "$?" = "0"
1096   then
1097     with_libstatgrab_cflags="$temp_result"
1098   else
1099     with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
1100     temp_result="$PKG_CONFIG --cflags libstatgrab failed"
1101   fi
1102   AC_MSG_RESULT([$temp_result])
1103 fi
1104
1105 if test "x$with_libstatgrab" = "xyes" \
1106   && test "x$with_libstatgrab_pkg_config" = "xyes" \
1107   && test "x$with_libstatgrab_ldflags" = "x"
1108 then
1109   AC_MSG_CHECKING([for libstatgrab LDFLAGS])
1110   temp_result="`$PKG_CONFIG --libs libstatgrab`"
1111   if test "$?" = "0"
1112   then
1113     with_libstatgrab_ldflags="$temp_result"
1114   else
1115     with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
1116     temp_result="$PKG_CONFIG --libs libstatgrab failed"
1117   fi
1118   AC_MSG_RESULT([$temp_result])
1119 fi
1120
1121 if test "x$with_libstatgrab" = "xyes"
1122 then
1123   SAVE_CPPFLAGS="$CPPFLAGS"
1124   CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
1125
1126   AC_CHECK_HEADERS(statgrab.h,
1127                    [with_libstatgrab="yes"],
1128                    [with_libstatgrab="no (statgrab.h not found)"])
1129
1130   CPPFLAGS="$SAVE_CPPFLAGS"
1131 fi
1132
1133 if test "x$with_libstatgrab" = "xyes"
1134 then
1135   SAVE_CFLAGS="$CFLAGS"
1136   SAVE_LDFLAGS="$LDFLAGS"
1137
1138   CFLAGS="$CFLAGS $with_libstatgrab_cflags"
1139   LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
1140
1141   AC_CHECK_LIB(statgrab, sg_init,
1142                [with_libstatgrab="yes"],
1143                [with_libstatgrab="no (symbol sg_init not found)"])
1144
1145   CFLAGS="$SAVE_CFLAGS"
1146   LDFLAGS="$SAVE_LDFLAGS"
1147 fi
1148
1149 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
1150 if test "x$with_libstatgrab" = "xyes"
1151 then
1152   BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
1153   BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
1154   AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1155   AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1156 fi
1157
1158 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
1159 if test "x$with_libkvm" = "xyes"
1160 then
1161         AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
1162 fi
1163 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
1164
1165 with_sensors_cflags=""
1166 with_sensors_ldflags=""
1167 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
1168 [
1169         if test "x$withval" = "xno"
1170         then
1171                 with_lm_sensors="no"
1172         else
1173                 with_lm_sensors="yes"
1174                 if test "x$withval" != "xyes"
1175                 then
1176                         with_sensors_cflags="-I$withval/include"
1177                         with_sensors_ldflags="-L$withval/lib"
1178                         with_lm_sensors="yes"
1179                 fi
1180         fi
1181 ],
1182 [
1183         if test "x$ac_system" = "xLinux"
1184         then
1185                 with_lm_sensors="yes"
1186         else
1187                 with_lm_sensors="no (Linux only library)"
1188         fi
1189 ])
1190 if test "x$with_lm_sensors" = "xyes"
1191 then
1192         SAVE_CPPFLAGS="$CPPFLAGS"
1193         CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
1194
1195 #       AC_CHECK_HEADERS(sensors/sensors.h,
1196 #       [
1197 #               AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
1198 #       ],
1199 #       [with_lm_sensors="no (sensors/sensors.h not found)"])
1200         AC_CHECK_HEADERS(sensors/sensors.h, [], [with_lm_sensors="no (sensors/sensors.h not found)"])
1201
1202         CPPFLAGS="$SAVE_CPPFLAGS"
1203 fi
1204 if test "x$with_lm_sensors" = "xyes"
1205 then
1206         SAVE_CPPFLAGS="$CPPFLAGS"
1207         SAVE_LDFLAGS="$LDFLAGS"
1208         CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
1209         LDFLAGS="$LDFLAGS $with_sensors_ldflags"
1210
1211         AC_CHECK_LIB(sensors, sensors_init,
1212         [
1213                 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
1214         ],
1215         [with_lm_sensors="no (libsensors not found)"])
1216
1217         CPPFLAGS="$SAVE_CPPFLAGS"
1218         LDFLAGS="$SAVE_LDFLAGS"
1219 fi
1220 if test "x$with_lm_sensors" = "xyes"
1221 then
1222         BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
1223         BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
1224         AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
1225         AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
1226 fi
1227 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
1228
1229 with_mysql_config="mysql_config"
1230 with_mysql_cflags=""
1231 with_mysql_libs=""
1232 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1233 [
1234         if test "x$withval" = "xno"
1235         then
1236                 with_libmysql="no"
1237         else if test "x$withval" = "xyes"
1238         then
1239                 with_libmysql="yes"
1240         else
1241                 if test -f "$withval" && test -x "$withval";
1242                 then
1243                         with_mysql_config="$withval"
1244                 else if test -x "$withval/bin/mysql_config"
1245                 then
1246                         with_mysql_config="$withval/bin/mysql_config"
1247                 fi; fi
1248                 with_libmysql="yes"
1249         fi; fi
1250 ],
1251 [
1252         with_libmysql="yes"
1253 ])
1254 if test "x$with_libmysql" = "xyes"
1255 then
1256         with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1257         mysql_config_status=$?
1258
1259         if test $mysql_config_status -ne 0
1260         then
1261                 with_libmysql="no"
1262         else
1263                 SAVE_CPPFLAGS="$CPPFLAGS"
1264                 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1265
1266                 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
1267
1268                 CPPFLAGS="$SAVE_CPPFLAGS"
1269         fi
1270 fi
1271 if test "x$with_libmysql" = "xyes"
1272 then
1273         with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1274         mysql_config_status=$?
1275
1276         if test $mysql_config_status -ne 0
1277         then
1278                 with_libmysql="no"
1279         else
1280                 AC_CHECK_LIB(mysqlclient, mysql_init,
1281                  [with_libmysql="yes"],
1282                  [with_libmysql="no (symbol 'mysql_init' not found)"],
1283                  [$with_mysql_libs])
1284         fi
1285 fi
1286 if test "x$with_libmysql" = "xyes"
1287 then
1288         BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1289         BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1290         AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1291         AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1292 fi
1293 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1294
1295 with_own_liboconfig="no"
1296 liboconfig_LDFLAGS="$LDFLAGS"
1297 liboconfig_CPPFLAGS="$CPPFLAGS"
1298 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1299 [
1300         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1301         then
1302                 if test -d "$withval/lib"
1303                 then
1304                         liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1305                 fi
1306                 if test -d "$withval/include"
1307                 then
1308                         liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1309                 fi
1310         fi
1311         if test "x$withval" = "xno"
1312         then
1313                 AC_MSG_ERROR("liboconfig is required")
1314         fi
1315 ],
1316 [
1317         with_liboconfig="yes"
1318 ])
1319
1320 save_LDFLAGS="$LDFLAGS"
1321 save_CPPFLAGS="$CPPFLAGS"
1322 LDFLAGS="$liboconfig_LDFLAGS"
1323 CPPFLAGS="$liboconfig_CPPFLAGS"
1324 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1325 [
1326         with_liboconfig="yes"
1327         with_own_liboconfig="no"
1328 ],
1329 [
1330         with_liboconfig="yes"
1331         with_own_liboconfig="yes"
1332         LDFLAGS="$save_LDFLAGS"
1333         CPPFLAGS="$save_CPPFLAGS"
1334 ])
1335
1336 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1337 if test "x$with_own_liboconfig" = "xyes"
1338 then
1339         with_liboconfig="yes (shipped version)"
1340 fi
1341
1342 #with_liboping="yes"
1343 with_own_liboping="no"
1344 liboping_LDFLAGS="$LDFLAGS"
1345 liboping_CPPFLAGS="$CPPFLAGS"
1346 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1347 [
1348         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1349         then
1350                 if test -d "$withval/lib"
1351                 then
1352                         liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1353                 fi
1354                 if test -d "$withval/include"
1355                 then
1356                         liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1357                 fi
1358         fi
1359         if test "x$withval" = "xno"
1360         then
1361                 with_liboping="no"
1362                 with_own_liboping="no"
1363         else if test "x$withval" = "xyes"
1364         then
1365                 with_liboping="yes"
1366         fi; fi
1367 ],
1368 [
1369         with_liboping="yes"
1370 ])
1371
1372 if test "x$with_liboping" = "xyes"
1373 then
1374         save_LDFLAGS="$LDFLAGS"
1375         save_CPPFLAGS="$CPPFLAGS"
1376         LDFLAGS="$liboping_LDFLAGS"
1377         CPPFLAGS="$liboping_CPPFLAGS"
1378         AC_CHECK_LIB(oping, ping_construct,
1379         [
1380                 with_liboping="yes"
1381                 with_own_liboping="no"
1382         ],
1383         [
1384                 with_liboping="yes"
1385                 with_own_liboping="yes"
1386                 LDFLAGS="$save_LDFLAGS"
1387                 CPPFLAGS="$save_CPPFLAGS"
1388         ])
1389 fi
1390 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1391 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1392
1393 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1394 [
1395         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1396         then
1397                 LDFLAGS="$LDFLAGS -L$withval/lib"
1398                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1399                 with_libpcap="yes"
1400         else
1401                 with_libpcap="$withval"
1402         fi
1403 ],
1404 [
1405         with_libpcap="yes"
1406 ])
1407 if test "x$with_libpcap" = "xyes"
1408 then
1409         AC_CHECK_LIB(pcap, pcap_open_live,
1410         [
1411                 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1412         ], [with_libpcap="no (libpcap not found)"])
1413 fi
1414 if test "x$with_libpcap" = "xyes"
1415 then
1416         AC_CHECK_HEADERS(pcap.h,
1417         [
1418                 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1419         ], [with_libpcap="no (pcap.h not found)"])
1420 fi
1421 if test "x$with_libpcap" = "xyes"
1422 then
1423         collect_libpcap=1
1424 else
1425         collect_libpcap=0
1426 fi
1427 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1428         [Wether or not to use the pcap library])
1429 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1430
1431 perl_interpreter="perl"
1432 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1433 [
1434         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1435         then
1436                 LDFLAGS="$LDFLAGS -L$withval/lib"
1437                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1438                 perl_interpreter="$withval/bin/perl"
1439                 with_libperl="yes"
1440         else
1441                 with_libperl="$withval"
1442         fi
1443 ],
1444 [
1445         with_libperl="yes"
1446 ])
1447
1448 AC_SUBST(PERL, "$perl_interpreter")
1449
1450 if test "x$with_libperl" = "xyes"
1451 then
1452   SAVE_CFLAGS=$CFLAGS
1453   SAVE_LDFLAGS=$LDFLAGS
1454   PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1455   PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1456   CFLAGS="$CFLAGS $PERL_CFLAGS"
1457   LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1458
1459   AC_CACHE_CHECK([for libperl],
1460     [have_libperl],
1461     AC_LINK_IFELSE(
1462       AC_LANG_PROGRAM(
1463       [[
1464 #include <EXTERN.h>
1465 #include <perl.h>
1466 #include <XSUB.h>
1467       ]],
1468       [[
1469        PerlInterpreter *perl = NULL;
1470        Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1471                          newSVpv ("Collectd::Plugin::FooBar", 24),
1472                          Nullsv);
1473       ]]),
1474       [have_libperl="yes"],
1475       [have_libperl="no"]
1476     )
1477   )
1478
1479   if test "x$have_libperl" = "xyes"
1480   then
1481           AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1482           AC_SUBST(PERL_CFLAGS)
1483           AC_SUBST(PERL_LDFLAGS)
1484   else
1485           with_libperl="no"
1486   fi
1487
1488   CFLAGS=$SAVE_CFLAGS
1489   LDFLAGS=$SAVE_LDFLAGS
1490 fi
1491 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1492
1493 if test "x$with_libperl" = "xyes"
1494 then
1495         SAVE_CFLAGS=$CFLAGS
1496         SAVE_LDFLAGS=$LDFLAGS
1497         CFLAGS="$CFLAGS $PERL_CFLAGS"
1498         LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1499
1500         AC_CACHE_CHECK([if perl supports ithreads],
1501                 [have_perl_ithreads],
1502                 AC_LINK_IFELSE(
1503                         AC_LANG_PROGRAM(
1504                         [[
1505 #include <EXTERN.h>
1506 #include <perl.h>
1507 #include <XSUB.h>
1508
1509 #if !defined(USE_ITHREADS)
1510 # error "Perl does not support ithreads!"
1511 #endif /* !defined(USE_ITHREADS) */
1512                         ]],
1513                         [[ ]]),
1514                         [have_perl_ithreads="yes"],
1515                         [have_perl_ithreads="no"]
1516                 )
1517         )
1518
1519         if test "x$have_perl_ithreads" = "xyes"
1520         then
1521                 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1522         fi
1523
1524         CFLAGS=$SAVE_CFLAGS
1525         LDFLAGS=$SAVE_LDFLAGS
1526 fi
1527
1528 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1529 [
1530         if test "x$withval" != "xno" && test "x$withval" != "xyes"
1531         then
1532                 LDFLAGS="$LDFLAGS -L$withval/lib"
1533                 CPPFLAGS="$CPPFLAGS -I$withval/include"
1534                 with_libiptc="yes"
1535         else
1536                 with_libiptc="$withval"
1537         fi
1538 ],
1539 [
1540         if test "x$ac_system" = "xLinux"
1541         then
1542                 with_libiptc="yes"
1543         else
1544                 with_libiptc="no (Linux only)"
1545         fi
1546 ])
1547 if test "x$with_libiptc" = "xyes"
1548 then
1549         AC_CHECK_LIB(iptc, iptc_init,
1550         [
1551                 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1552         ], [with_libiptc="no (libiptc not found)"])
1553 fi
1554 if test "x$with_libiptc" = "xyes"
1555 then
1556         AC_CHECK_HEADERS(libiptc/libiptc.h,
1557         [
1558                 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1559         ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1560 fi
1561 if test "x$with_libiptc" = "xyes"
1562 then
1563         collect_libiptc=1
1564 else
1565         collect_libiptc=0
1566 fi
1567 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1568
1569 with_snmp_config="net-snmp-config"
1570 with_snmp_cflags=""
1571 with_snmp_libs=""
1572 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1573 [
1574         if test "x$withval" = "xno"
1575         then
1576                 with_libnetsnmp="no"
1577         else if test "x$withval" = "xyes"
1578         then
1579                 with_libnetsnmp="yes"
1580         else
1581                 if test -x "$withval"
1582                 then
1583                         with_snmp_config="$withval"
1584                         with_libnetsnmp="yes"
1585                 else
1586                         with_snmp_config="$withval/bin/net-snmp-config"
1587                         with_libnetsnmp="yes"
1588                 fi
1589         fi; fi
1590 ],
1591 [with_libnetsnmp="yes"])
1592 if test "x$with_libnetsnmp" = "xyes"
1593 then
1594         with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1595         snmp_config_status=$?
1596
1597         if test $snmp_config_status -ne 0
1598         then
1599                 with_libnetsnmp="no ($with_snmp_config failed)"
1600         else
1601                 SAVE_CPPFLAGS="$CPPFLAGS"
1602                 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1603                 
1604                 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1605
1606                 CPPFLAGS="$SAVE_CPPFLAGS"
1607         fi
1608 fi
1609 if test "x$with_libnetsnmp" = "xyes"
1610 then
1611         with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1612         snmp_config_status=$?
1613
1614         if test $snmp_config_status -ne 0
1615         then
1616                 with_libnetsnmp="no ($with_snmp_config failed)"
1617         else
1618                 AC_CHECK_LIB(netsnmp, init_snmp,
1619                 [with_libnetsnmp="yes"],
1620                 [with_libnetsnmp="no (libnetsnmp not found)"],
1621                 [$with_snmp_libs])
1622         fi
1623 fi
1624 if test "x$with_libnetsnmp" = "xyes"
1625 then
1626         BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1627         BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1628         AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1629         AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1630 fi
1631 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1632
1633 with_upsclient_config="libupsclient-config"
1634 with_upsclient_cflags=""
1635 with_upsclient_libs=""
1636 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1637 [
1638         if test "x$withval" = "xno"
1639         then
1640                 with_libupsclient="no"
1641         else
1642                 if test "x$withval" != "xyes"
1643                 then
1644                         if test -f "$withval" && test -x "$withval";
1645                         then
1646                                 with_upsclient_config="$withval"
1647                         else
1648                                 with_upsclient_config="$withval/bin/libupsclient-config"
1649                         fi
1650                 fi
1651                 with_libupsclient="yes"
1652         fi
1653 ],
1654 [
1655         with_libupsclient="yes"
1656 ])
1657 if test "x$with_libupsclient" = "xyes"
1658 then
1659         with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1660         upsclient_config_status=$?
1661
1662         if test $upsclient_config_status -ne 0
1663         then
1664                 with_libupsclient="no ($with_upsclient_config failed)"
1665         fi
1666 fi
1667 if test "x$with_libupsclient" = "xyes"
1668 then
1669         SAVE_CPPFLAGS="$CPPFLAGS"
1670         CPPFLAGS="$CPPFLAGS $with_upsclient_cflags"
1671
1672         AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1673
1674         CPPFLAGS="$SAVE_CPPFLAGS"
1675 fi
1676 if test "x$with_libupsclient" = "xyes"
1677 then
1678         with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1679         upsclient_config_status=$?
1680
1681         if test $upsclient_config_status -ne 0
1682         then
1683                 with_libupsclient="no ($with_upsclient_config failed)"
1684         fi
1685 fi
1686 if test "x$with_libupsclient" = "xyes"
1687 then
1688         AC_CHECK_LIB(upsclient, upscli_connect,
1689         [
1690                 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1691                 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1692                 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1693                 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1694         ],
1695         [
1696                 with_libupsclient="no (symbol 'upscli_connect' not found)"
1697         ], [$with_upsclient_libs])
1698 fi
1699 if test "x$with_libupsclient" = "xyes"
1700 then
1701         SAVE_CPPFLAGS="$CPPFLAGS"
1702         CPPFLAGS="$CPPFLAGS $with_upsclient_cflags"
1703
1704         AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1705 [#include <stdlib.h>
1706 #include <stdio.h>
1707 #include <upsclient.h>])
1708
1709         CPPFLAGS="$SAVE_CPPFLAGS"
1710 fi
1711 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1712
1713 ### BEGIN of check for libxmms ###
1714 with_xmms_config="xmms-config"
1715 with_xmms_cflags=""
1716 with_xmms_libs=""
1717 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1718 [
1719         if test "x$withval" != "xno" -a "x$withval" != "xyes"
1720         then
1721                 if test -f "$withval" && test -x "$withval";
1722                 then
1723                         with_xmms_config="$withval"
1724                 else if test -x "$withval/bin/xmms-config"
1725                 then
1726                         with_xmms_config="$withval/bin/xmms-config"
1727                 fi; fi
1728                 with_libxmms="yes"
1729         else if test "x$withval" = "xno"
1730         then
1731                 with_libxmms="no"
1732         else
1733                 with_libxmms="yes"
1734         fi; fi
1735 ],
1736 [
1737         with_libxmms="yes"
1738 ])
1739 if test "x$with_libxmms" = "xyes"
1740 then
1741         with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1742         xmms_config_status=$?
1743
1744         if test $xmms_config_status -ne 0
1745         then
1746                 with_libxmms="no"
1747         fi
1748 fi
1749 if test "x$with_libxmms" = "xyes"
1750 then
1751         with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1752         xmms_config_status=$?
1753
1754         if test $xmms_config_status -ne 0
1755         then
1756                 with_libxmms="no"
1757         fi
1758 fi
1759 if test "x$with_libxmms" = "xyes"
1760 then
1761         AC_CHECK_LIB(xmms, xmms_remote_get_info,
1762         [
1763                 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1764                 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1765                 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1766                 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1767         ],
1768         [
1769                 with_libxmms="no"
1770         ],
1771         [$with_xmms_libs])
1772 fi
1773 with_libxmms_numeric=0
1774 if test "x$with_libxmms" = "xyes"
1775 then
1776         with_libxmms_numeric=1
1777 fi
1778 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1779 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1780 ### END of check for libxmms ###
1781
1782 with_libnetlink_cflags=""
1783 with_libnetlink_libs="-lnetlink"
1784 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1785 [
1786  echo "libnetlink: withval = $withval"
1787  if test "x$withval" = "xyes"
1788  then
1789          with_libnetlink="yes"
1790  else if test "x$withval" = "xno"
1791  then
1792          with_libnetlink="no"
1793  else
1794          if test -d "$withval/include"
1795          then
1796                  with_libnetlink_cflags="-I$withval/include"
1797                  with_libnetlink_libs="-L$withval/lib -lnetlink"
1798                  with_libnetlink="yes"
1799          else
1800                  AC_MSG_ERROR("no such directory: $withval/include")
1801          fi
1802  fi; fi
1803 ],
1804 [
1805  if test "x$ac_system" = "xLinux"
1806  then
1807          with_libnetlink="yes"
1808  else
1809          with_libnetlink="no (Linux only library)"
1810  fi
1811 ])
1812 if test "x$with_libnetlink" = "xyes"
1813 then
1814         SAVE_CFLAGS=$CFLAGS
1815         CFLAGS="$CFLAGS $with_libnetlink_cflags"
1816
1817         with_libnetlink="no (libnetlink.h not found)"
1818
1819         AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1820         [
1821          with_libnetlink="yes"
1822          break
1823         ], [],
1824 [#include <stdio.h>
1825 #include <sys/types.h>
1826 #include <asm/types.h>
1827 #include <sys/socket.h>
1828 #include <linux/netlink.h>
1829 #include <linux/rtnetlink.h>])
1830         AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1831 [#include <stdio.h>
1832 #include <sys/types.h>
1833 #include <asm/types.h>
1834 #include <sys/socket.h>])
1835
1836         AC_COMPILE_IFELSE(
1837 [#include <stdio.h>
1838 #include <sys/types.h>
1839 #include <asm/types.h>
1840 #include <sys/socket.h>
1841 #include <linux/netlink.h>
1842 #include <linux/rtnetlink.h>
1843
1844 int main (void)
1845 {
1846         int retval = TCA_STATS2;
1847         return (retval);
1848 }],
1849         [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1850         []);
1851
1852         AC_COMPILE_IFELSE(
1853 [#include <stdio.h>
1854 #include <sys/types.h>
1855 #include <asm/types.h>
1856 #include <sys/socket.h>
1857 #include <linux/netlink.h>
1858 #include <linux/rtnetlink.h>
1859
1860 int main (void)
1861 {
1862         int retval = TCA_STATS;
1863         return (retval);
1864 }],
1865         [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1866         []);
1867
1868         CFLAGS="$SAVE_CFLAGS"
1869 fi
1870 if test "x$with_libnetlink" = "xyes"
1871 then
1872         AC_CHECK_LIB(netlink, rtnl_open,
1873                      [with_libnetlink="yes"],
1874                      [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1875                      [$with_libnetlink_libs])
1876 fi
1877 if test "x$with_libnetlink" = "xyes"
1878 then
1879         BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1880         BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1881         AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1882         AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1883 fi
1884 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1885
1886 dnl Check for libvirt and libxml2 libraries.
1887 with_libxml2="no (pkg-config isn't available)"
1888 with_libxml2_cflags=""
1889 with_libxml2_ldflags=""
1890 with_libvirt="no (pkg-config isn't available)"
1891 with_libvirt_cflags=""
1892 with_libvirt_ldflags=""
1893 PKG_PROG_PKG_CONFIG
1894 if test "x$PKG_CONFIG" != "x"
1895 then
1896         pkg-config --exists 'libxml-2.0' 2>/dev/null
1897         if test "$?" = "0"
1898         then
1899                 with_libxml2="yes"
1900         else
1901                 with_libxml2="no (pkg-config doesn't know library)"
1902         fi
1903
1904         pkg-config --exists libvirt 2>/dev/null
1905         if test "$?" = "0"
1906         then
1907                 with_libvirt="yes"
1908         else
1909                 with_libvirt="no (pkg-config doesn't know library)"
1910         fi
1911 fi
1912 if test "x$with_libxml2" = "xyes"
1913 then
1914         with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
1915         if test $? -ne 0
1916         then
1917                 with_libxml2="no"
1918         fi
1919         with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
1920         if test $? -ne 0
1921         then
1922                 with_libxml2="no"
1923         fi
1924 fi
1925 if test "x$with_libxml2" = "xyes"
1926 then
1927         SAVE_CPPFLAGS="$CPPFLAGS"
1928         CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
1929
1930         AC_CHECK_HEADERS(libxml/parser.h, [],
1931                       [with_libxml2="no (libxml/parser.h not found)"])
1932
1933         CPPFLAGS="$SAVE_CPPFLAGS"
1934 fi
1935 if test "x$with_libxml2" = "xyes"
1936 then
1937         SAVE_CFLAGS="$CFLAGS"
1938         SAVE_LDFLAGS="$LDFLAGS"
1939
1940         CFLAGS="$CFLAGS $with_libxml2_cflags"
1941         LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
1942
1943         AC_CHECK_LIB(xml2, xmlXPathEval,
1944                      [with_libxml2="yes"],
1945                      [with_libxml2="no (symbol xmlXPathEval not found)"])
1946
1947         CFLAGS="$SAVE_CFLAGS"
1948         LDFLAGS="$SAVE_LDFLAGS"
1949 fi
1950 dnl Add the right compiler flags and libraries.
1951 if test "x$with_libxml2" = "xyes"; then
1952         BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
1953         BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
1954         AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
1955         AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
1956 fi
1957 if test "x$with_libvirt" = "xyes"
1958 then
1959         with_libvirt_cflags="`pkg-config --cflags libvirt`"
1960         if test $? -ne 0
1961         then
1962                 with_libvirt="no"
1963         fi
1964         with_libvirt_ldflags="`pkg-config --libs libvirt`"
1965         if test $? -ne 0
1966         then
1967                 with_libvirt="no"
1968         fi
1969 fi
1970 if test "x$with_libvirt" = "xyes"
1971 then
1972         SAVE_CPPFLAGS="$CPPFLAGS"
1973         CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
1974
1975         AC_CHECK_HEADERS(libvirt/libvirt.h, [],
1976                       [with_libvirt="no (libvirt/libvirt.h not found)"])
1977
1978         CPPFLAGS="$SAVE_CPPFLAGS"
1979 fi
1980 if test "x$with_libvirt" = "xyes"
1981 then
1982         SAVE_CFLAGS="$CFLAGS"
1983         SAVE_LDFLAGS="$LDFLAGS"
1984
1985         CFLAGS="$CFLAGS $with_libvirt_cflags"
1986         LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
1987
1988         AC_CHECK_LIB(virt, virDomainBlockStats,
1989                      [with_libvirt="yes"],
1990                      [with_libvirt="no (symbol virDomainBlockStats not found)"])
1991
1992         CFLAGS="$SAVE_CFLAGS"
1993         LDFLAGS="$SAVE_LDFLAGS"
1994 fi
1995 dnl Add the right compiler flags and libraries.
1996 if test "x$with_libvirt" = "xyes"; then
1997         BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
1998         BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
1999         AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2000         AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2001 fi
2002
2003 dnl End of check for libvirt and libxml2 libraries.
2004
2005 # Check for enabled/disabled features
2006 #
2007
2008 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2009 # ------------------------------------------------------------
2010 dnl
2011 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2012 dnl
2013 AC_DEFUN(
2014         [AC_COLLECTD],
2015         [
2016         m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2017         m4_if(
2018                 [$2],
2019                 [enable],
2020                 [dnl
2021                 m4_define([EnDis],[disabled])dnl
2022                 m4_define([YesNo],[no])dnl
2023                 ],dnl
2024                 [m4_if(
2025                         [$2],
2026                         [disable],
2027                         [dnl
2028                         m4_define([EnDis],[enabled])dnl
2029                         m4_define([YesNo],[yes])dnl
2030                         ],
2031                         [dnl
2032                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2033                         ]dnl
2034                 )]dnl
2035         )dnl
2036         m4_if([$3], [feature], [],
2037                 [m4_if(
2038                         [$3], [module], [],
2039                         [dnl
2040                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2041                         ]dnl
2042                 )]dnl
2043         )dnl
2044         AC_ARG_ENABLE(
2045                 [$1],
2046                 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2047                 [],
2048                 enable_$1='[YesNo]'dnl
2049         )# AC_ARG_ENABLE
2050 if test "x$enable_$1" = "xno"
2051 then
2052         collectd_$1=0
2053 else
2054         if test "x$enable_$1" = "xyes"
2055         then
2056                 collectd_$1=1
2057         else
2058                 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2059                 collectd_$1=1
2060                 enable_$1='yes'
2061         fi
2062 fi
2063         AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2064         AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2065         ]dnl
2066 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2067
2068 # AC_PLUGIN(name, default, info)
2069 # ------------------------------------------------------------
2070 dnl
2071 AC_DEFUN(
2072   [AC_PLUGIN],
2073   [
2074     enable_plugin="no"
2075     AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2076     [
2077      if test "x$enableval" = "xyes"
2078      then
2079              enable_plugin="yes"
2080      else
2081              enable_plugin="no"
2082      fi
2083     ],
2084     [
2085      if test "x$2" = "xyes"
2086      then
2087              enable_plugin="yes"
2088      else
2089              enable_plugin="no"
2090      fi
2091     ])
2092     if test "x$enable_plugin" = "xyes"
2093     then
2094             AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2095     fi
2096     AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2097     enable_$1="$enable_plugin"
2098   ]
2099 )# AC_PLUGIN(name, default, info)
2100
2101 m4_divert_once([HELP_ENABLE], [
2102 collectd features:])
2103 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2104 AC_COLLECTD([debug],     [enable],  [feature], [debugging])
2105 AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
2106 AC_COLLECTD([getifaddrs],[enable],  [feature], [getifaddrs under Linux])
2107
2108 plugin_battery="no"
2109 plugin_cpu="no"
2110 plugin_cpufreq="no"
2111 plugin_df="no"
2112 plugin_disk="no"
2113 plugin_entropy="no"
2114 plugin_interface="no"
2115 plugin_ipvs="no"
2116 plugin_irq="no"
2117 plugin_libvirt="no"
2118 plugin_load="no"
2119 plugin_memory="no"
2120 plugin_multimeter="no"
2121 plugin_nfs="no"
2122 plugin_perl="no"
2123 plugin_processes="no"
2124 plugin_serial="no"
2125 plugin_swap="no"
2126 plugin_tape="no"
2127 plugin_tcpconns="no"
2128 plugin_users="no"
2129 plugin_vserver="no"
2130 plugin_wireless="no"
2131
2132 # Linux
2133 if test "x$ac_system" = "xLinux"
2134 then
2135         plugin_battery="yes"
2136         plugin_cpu="yes"
2137         plugin_cpufreq="yes"
2138         plugin_disk="yes"
2139         plugin_entropy="yes"
2140         plugin_interface="yes"
2141         plugin_irq="yes"
2142         plugin_load="yes"
2143         plugin_memory="yes"
2144         plugin_nfs="yes"
2145         plugin_processes="yes"
2146         plugin_serial="yes"
2147         plugin_swap="yes"
2148         plugin_tcpconns="yes"
2149         plugin_vserver="yes"
2150         plugin_wireless="yes"
2151
2152         if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2153         then
2154                 plugin_ipvs="yes"
2155         fi
2156 fi
2157
2158 # Mac OS X devices
2159 if test "x$with_libiokit" = "xyes"
2160 then
2161         plugin_battery="yes"
2162         plugin_disk="yes"
2163 fi
2164
2165 # Solaris
2166 if test "x$with_devinfo$with_kstat" = "xyesyes"
2167 then
2168         plugin_cpu="yes"
2169         plugin_disk="yes"
2170         plugin_interface="yes"
2171         plugin_memory="yes"
2172         plugin_swap="yes"
2173         plugin_tape="yes"
2174 fi
2175
2176 # libstatgrab
2177 if test "x$with_libstatgrab" = "xyes"
2178 then
2179         plugin_interface="yes"
2180         plugin_load="yes"
2181         plugin_memory="yes"
2182         plugin_swap="yes"
2183 fi
2184
2185 if test "x$have_processor_info" = "xyes"
2186 then
2187         plugin_cpu="yes"
2188 fi
2189 if test "x$have_sysctlbyname" = "xyes"
2190 then
2191         plugin_cpu="yes"
2192         plugin_memory="yes"
2193         plugin_tcpconns="yes"
2194 fi
2195
2196 if test "x$have_statfs" = "xyes"
2197 then
2198         plugin_df="yes"
2199 fi
2200 if test "x$have_statvfs" = "xyes"
2201 then
2202         plugin_df="yes"
2203 fi
2204
2205 if test "x$have_getifaddrs" = "xyes"
2206 then
2207         plugin_interface="yes"
2208 fi
2209
2210 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
2211 then
2212         plugin_libvirt="yes"
2213 fi
2214
2215 if test "x$have_getloadavg" = "xyes"
2216 then
2217         plugin_load="yes"
2218 fi
2219
2220 if test "x$have_libperl$have_perl_ithreads" = "xyesyes"
2221 then
2222         plugin_perl="yes"
2223 fi
2224
2225 # Mac OS X memory interface
2226 if test "x$have_host_statistics" = "xyes"
2227 then
2228         plugin_memory="yes"
2229 fi
2230
2231 if test "x$have_termios_h" = "xyes"
2232 then
2233         plugin_multimeter="yes"
2234 fi
2235
2236 if test "x$have_thread_info" = "xyes"
2237 then
2238         plugin_processes="yes"
2239 fi
2240
2241 if test "x$with_libkvm" = "xyes"
2242 then
2243         plugin_swap="yes"
2244 fi
2245
2246 if test "x$have_getutent" = "xyes"
2247 then
2248         plugin_users="yes"
2249 fi
2250 if test "x$have_getutxent" = "xyes"
2251 then
2252         plugin_users="yes"
2253 fi
2254
2255 # FIXME: sysctl for swap plugin
2256
2257 m4_divert_once([HELP_ENABLE], [
2258 collectd plugins:])
2259
2260 AC_PLUGIN([apache],      [$with_libcurl],      [Apache httpd statistics])
2261 AC_PLUGIN([apcups],      [yes],                [Statistics of UPSes by APC])
2262 AC_PLUGIN([apple_sensors], [$with_libiokit],   [Apple's hardware sensors])
2263 AC_PLUGIN([battery],     [$plugin_battery],    [Battery statistics])
2264 AC_PLUGIN([cpu],         [$plugin_cpu],        [CPU usage statistics])
2265 AC_PLUGIN([cpufreq],     [$plugin_cpufreq],    [CPU frequency statistics])
2266 AC_PLUGIN([csv],         [yes],                [CSV output plugin])
2267 AC_PLUGIN([df],          [$plugin_df],         [Filesystem usage statistics])
2268 AC_PLUGIN([disk],        [$plugin_disk],       [Disk usage statistics])
2269 AC_PLUGIN([dns],         [$with_libpcap],      [DNS traffic analysis])
2270 AC_PLUGIN([email],       [yes],                [EMail statistics])
2271 AC_PLUGIN([entropy],     [$plugin_entropy],    [Entropy statistics])
2272 AC_PLUGIN([exec],        [yes],                [Execution of external programs])
2273 AC_PLUGIN([hddtemp],     [yes],                [Query hddtempd])
2274 AC_PLUGIN([interface],   [$plugin_interface],  [Interface traffic statistics])
2275 AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
2276 AC_PLUGIN([ipvs],        [$plugin_ipvs],       [IPVS connection statistics])
2277 AC_PLUGIN([irq],         [$plugin_irq],        [IRQ statistics])
2278 AC_PLUGIN([libvirt],     [$plugin_libvirt],    [Virtual machine statistics])
2279 AC_PLUGIN([load],        [$plugin_load],       [System load])
2280 AC_PLUGIN([logfile],     [yes],                [File logging plugin])
2281 AC_PLUGIN([mbmon],       [yes],                [Query mbmond])
2282 AC_PLUGIN([memcached],   [yes],                [memcached statistics])
2283 AC_PLUGIN([memory],      [$plugin_memory],     [Memory usage])
2284 AC_PLUGIN([multimeter],  [$plugin_multimeter], [Read multimeter values])
2285 AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
2286 AC_PLUGIN([netlink],     [$with_libnetlink],   [Enhanced Linux network statistics])
2287 AC_PLUGIN([network],     [yes],                [Network communication plugin])
2288 AC_PLUGIN([nfs],         [$plugin_nfs],        [NFS statistics])
2289 AC_PLUGIN([nginx],       [$with_libcurl],      [nginx statistics])
2290 AC_PLUGIN([ntpd],        [yes],                [NTPd statistics])
2291 AC_PLUGIN([nut],         [$with_libupsclient], [Network UPS tools statistics])
2292 AC_PLUGIN([perl],        [$plugin_perl],       [Embed a Perl interpreter])
2293 AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
2294 AC_PLUGIN([processes],   [$plugin_processes],  [Process statistics])
2295 AC_PLUGIN([rrdtool],     [$with_rrdtool],      [RRDTool output plugin])
2296 AC_PLUGIN([sensors],     [$with_lm_sensors],   [lm_sensors statistics])
2297 AC_PLUGIN([serial],      [$plugin_serial],     [serial port traffic])
2298 AC_PLUGIN([snmp],        [$with_libnetsnmp],   [SNMP querying plugin])
2299 AC_PLUGIN([swap],        [$plugin_swap],       [Swap usage statistics])
2300 AC_PLUGIN([syslog],      [$have_syslog],       [Syslog logging plugin])
2301 AC_PLUGIN([tape],        [$plugin_tape],       [Tape drive statistics])
2302 AC_PLUGIN([tcpconns],    [$plugin_tcpconns],   [TCP connection statistics])
2303 AC_PLUGIN([unixsock],    [yes],                [Unixsock communication plugin])
2304 AC_PLUGIN([users],       [$plugin_users],      [User statistics])
2305 AC_PLUGIN([uuid],        [yes],                [UUID as hostname plugin])
2306 AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
2307 AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
2308 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
2309
2310 dnl ip_vs.h
2311 if test "x$ac_system" = "xLinux" -a "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
2312 then
2313         enable_ipvs="$enable_ipvs (ip_vs.h not found)"
2314 fi
2315
2316 dnl Perl bindings
2317 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
2318 [
2319         if test "x$withval" != "xno" && test "x$withval" != "xyes"
2320         then
2321                 PERL_BINDINGS_OPTIONS="$withval"
2322                 with_perl_bindings="yes"
2323         else
2324                 PERL_BINDINGS_OPTIONS=""
2325                 with_perl_bindings="$withval"
2326         fi
2327 ],
2328 [
2329         PERL_BINDINGS_OPTIONS=""
2330         with_perl_bindings="yes"
2331 ])
2332 if test "x$with_perl_bindings" = "xyes"
2333 then
2334         PERL_BINDINGS="perl"
2335 else
2336         PERL_BINDINGS=""
2337 fi
2338 AC_SUBST(PERL_BINDINGS)
2339 AC_SUBST(PERL_BINDINGS_OPTIONS)
2340
2341 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
2342
2343 if test "x$with_rrdtool" = "xyes" -a "x$librrd_threadsafe" != "xyes"
2344 then
2345         with_rrdtool="yes (warning: librrd is not thread-safe)"
2346 fi
2347
2348 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
2349 then
2350         with_liboping="yes (shipped version)"
2351 fi
2352
2353 if test "x$with_libperl" = "xyes"
2354 then
2355         with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
2356 else
2357         enable_perl="no (needs libperl)"
2358 fi
2359
2360 if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x"
2361 then
2362         with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
2363 fi
2364
2365 cat <<EOF;
2366
2367 Configuration:
2368   Libraries:
2369     libcurl . . . . . . $with_libcurl
2370     libiokit  . . . . . $with_libiokit
2371     libiptc . . . . . . $with_libiptc
2372     libkstat  . . . . . $with_kstat
2373     libkvm  . . . . . . $with_libkvm
2374     libmysql  . . . . . $with_libmysql
2375     libnetlink  . . . . $with_libnetlink
2376     libnetsnmp  . . . . $with_libnetsnmp
2377     liboconfig  . . . . $with_liboconfig
2378     liboping  . . . . . $with_liboping
2379     libpcap . . . . . . $with_libpcap
2380     libperl . . . . . . $with_libperl
2381     libpthread  . . . . $with_libpthread
2382     librrd  . . . . . . $with_rrdtool
2383     libsensors  . . . . $with_lm_sensors
2384     libstatgrab . . . . $with_libstatgrab
2385     libupsclient  . . . $with_libupsclient
2386     libvirt . . . . . . $with_libvirt
2387     libxml2 . . . . . . $with_libxml2
2388     libxmms . . . . . . $with_libxmms
2389
2390   Features:
2391     daemon mode . . . . $enable_daemon
2392     debug . . . . . . . $enable_debug
2393
2394   Bindings:
2395     perl  . . . . . . . $with_perl_bindings
2396
2397   Modules:
2398     apache  . . . . . . $enable_apache
2399     apcups  . . . . . . $enable_apcups
2400     apple_sensors . . . $enable_apple_sensors
2401     battery . . . . . . $enable_battery
2402     cpu . . . . . . . . $enable_cpu
2403     cpufreq . . . . . . $enable_cpufreq
2404     csv . . . . . . . . $enable_csv
2405     df  . . . . . . . . $enable_df
2406     disk  . . . . . . . $enable_disk
2407     dns . . . . . . . . $enable_dns
2408     email . . . . . . . $enable_email
2409     entropy . . . . . . $enable_entropy
2410     exec  . . . . . . . $enable_exec
2411     hddtemp . . . . . . $enable_hddtemp
2412     interface . . . . . $enable_interface
2413     iptables  . . . . . $enable_iptables
2414     ipvs  . . . . . . . $enable_ipvs
2415     irq . . . . . . . . $enable_irq
2416     libvirt . . . . . . $enable_libvirt
2417     load  . . . . . . . $enable_load
2418     logfile . . . . . . $enable_logfile
2419     mbmon . . . . . . . $enable_mbmon
2420     memcached . . . . . $enable_memcached
2421     memory  . . . . . . $enable_memory
2422     multimeter  . . . . $enable_multimeter
2423     mysql . . . . . . . $enable_mysql
2424     netlink . . . . . . $enable_netlink
2425     network . . . . . . $enable_network
2426     nfs . . . . . . . . $enable_nfs
2427     nginx . . . . . . . $enable_nginx
2428     ntpd  . . . . . . . $enable_ntpd
2429     nut . . . . . . . . $enable_nut
2430     perl  . . . . . . . $enable_perl
2431     ping  . . . . . . . $enable_ping
2432     processes . . . . . $enable_processes
2433     rrdtool . . . . . . $enable_rrdtool
2434     sensors . . . . . . $enable_sensors
2435     serial  . . . . . . $enable_serial
2436     snmp  . . . . . . . $enable_snmp
2437     swap  . . . . . . . $enable_swap
2438     syslog  . . . . . . $enable_syslog
2439     tape  . . . . . . . $enable_tape
2440     tcpconns  . . . . . $enable_tcpconns
2441     unixsock  . . . . . $enable_unixsock
2442     users . . . . . . . $enable_users
2443     uuid  . . . . . . . $enable_uuid
2444     vserver . . . . . . $enable_vserver
2445     wireless  . . . . . $enable_wireless
2446     xmms  . . . . . . . $enable_xmms
2447
2448 EOF