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