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 AC_CONFIG_AUX_DIR([libltdl/config])
7 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
8 dnl we don't really need the 'u' even in older toolchains. Then there is
9 dnl older libtool, which spelled it AR_FLAGS
10 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
12 m4_ifdef([LT_PACKAGE_VERSION],
13 # libtool >= 2.2
14 [
15 LT_CONFIG_LTDL_DIR([libltdl])
16 LT_INIT([dlopen])
17 LTDL_INIT([convenience])
18 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
19 ]
20 ,
21 # libtool <= 1.5
22 [
23 AC_LIBLTDL_CONVENIENCE
24 AC_SUBST(LTDLINCL)
25 AC_SUBST(LIBLTDL)
26 AC_LIBTOOL_DLOPEN
27 AC_CONFIG_SUBDIRS(libltdl)
28 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
29 ]
30 )
32 AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
34 AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
35 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
36 AC_LANG(C)
38 AC_PREFIX_DEFAULT("/opt/collectd")
40 AC_SYS_LARGEFILE
42 #
43 # Checks for programs.
44 #
45 AC_PROG_CC
46 AC_PROG_CPP
47 AC_PROG_EGREP
48 AC_PROG_INSTALL
49 AC_PROG_LN_S
50 AC_PROG_MAKE_SET
51 AM_PROG_CC_C_O
52 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
54 AC_DISABLE_STATIC
55 AC_PROG_LIBTOOL
56 AC_PROG_LEX
57 AC_PROG_YACC
59 # Warn when pkg.m4 is missing
60 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
62 PKG_PROG_PKG_CONFIG
64 AC_CACHE_CHECK([if bison is the parser generator],
65 [collectd_cv_prog_bison],
66 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
67 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
68 )]
69 )
71 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
72 then
73 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
74 fi
76 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
77 if test "x$have_protoc_c" = "xno"
78 then
79 have_protoc_c="no (protoc-c compiler not found)"
80 fi
82 if test "x$have_protoc_c" = "xyes"
83 then
84 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
85 [have_protoc_c="yes"; break],
86 [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
87 fi
88 if test "x$have_protoc_c" = "xyes"
89 then
90 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
91 [have_protoc_c="yes"],
92 [have_protoc_c="no (libprotobuf-c not found)"])
94 fi
95 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
97 AC_MSG_CHECKING([for kernel type ($host_os)])
98 case $host_os in
99 *linux*)
100 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
101 ac_system="Linux"
102 ;;
103 *solaris*)
104 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
105 ac_system="Solaris"
106 ;;
107 *darwin*)
108 ac_system="Darwin"
109 ;;
110 *openbsd*)
111 ac_system="OpenBSD"
112 ;;
113 *aix*)
114 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
115 ac_system="AIX"
116 ;;
117 *freebsd*)
118 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
119 ac_system="FreeBSD"
120 ;;
121 *)
122 ac_system="unknown"
123 esac
124 AC_MSG_RESULT([$ac_system])
126 if test "x$ac_system" = "xLinux"
127 then
128 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
129 if test -z "$KERNEL_DIR"
130 then
131 KERNEL_DIR="/lib/modules/`uname -r`/source"
132 fi
134 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
135 AC_SUBST(KERNEL_CFLAGS)
136 fi
138 if test "x$ac_system" = "xSolaris"
139 then
140 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
141 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
142 fi
143 if test "x$ac_system" = "xAIX"
144 then
145 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
146 fi
148 # Where to install .pc files.
149 pkgconfigdir="${libdir}/pkgconfig"
150 AC_SUBST(pkgconfigdir)
152 # Check for standards compliance mode
153 AC_ARG_ENABLE(standards,
154 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
155 [enable_standards="$enableval"],
156 [enable_standards="no"])
157 if test "x$enable_standards" = "xyes"
158 then
159 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
160 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
161 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
162 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
163 if test "x$GCC" = "xyes"
164 then
165 CFLAGS="$CFLAGS -std=c99"
166 fi
167 fi
168 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
170 #
171 # Checks for header files.
172 #
173 AC_HEADER_STDC
174 AC_HEADER_SYS_WAIT
175 AC_HEADER_DIRENT
176 AC_HEADER_STDBOOL
178 AC_CHECK_HEADERS(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 sys/isa_defs.h fnmatch.h libgen.h)
180 # For ping library
181 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
182 [#if HAVE_STDINT_H
183 # include <stdint.h>
184 #endif
185 #if HAVE_SYS_TYPES_H
186 # include <sys/types.h>
187 #endif
188 ])
189 AC_CHECK_HEADERS(netinet/in.h, [], [],
190 [#if HAVE_STDINT_H
191 # include <stdint.h>
192 #endif
193 #if HAVE_SYS_TYPES_H
194 # include <sys/types.h>
195 #endif
196 #if HAVE_NETINET_IN_SYSTM_H
197 # include <netinet/in_systm.h>
198 #endif
199 ])
200 AC_CHECK_HEADERS(netinet/ip.h, [], [],
201 [#if HAVE_STDINT_H
202 # include <stdint.h>
203 #endif
204 #if HAVE_SYS_TYPES_H
205 # include <sys/types.h>
206 #endif
207 #if HAVE_NETINET_IN_SYSTM_H
208 # include <netinet/in_systm.h>
209 #endif
210 #if HAVE_NETINET_IN_H
211 # include <netinet/in.h>
212 #endif
213 ])
214 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
215 [#if HAVE_STDINT_H
216 # include <stdint.h>
217 #endif
218 #if HAVE_SYS_TYPES_H
219 # include <sys/types.h>
220 #endif
221 #if HAVE_NETINET_IN_SYSTM_H
222 # include <netinet/in_systm.h>
223 #endif
224 #if HAVE_NETINET_IN_H
225 # include <netinet/in.h>
226 #endif
227 #if HAVE_NETINET_IP_H
228 # include <netinet/ip.h>
229 #endif
230 ])
231 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
232 [#if HAVE_STDINT_H
233 # include <stdint.h>
234 #endif
235 #if HAVE_SYS_TYPES_H
236 # include <sys/types.h>
237 #endif
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
240 #endif
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
243 #endif
244 #if HAVE_NETINET_IP_H
245 # include <netinet/ip.h>
246 #endif
247 ])
248 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
249 [#if HAVE_STDINT_H
250 # include <stdint.h>
251 #endif
252 #if HAVE_SYS_TYPES_H
253 # include <sys/types.h>
254 #endif
255 #if HAVE_NETINET_IN_SYSTM_H
256 # include <netinet/in_systm.h>
257 #endif
258 #if HAVE_NETINET_IN_H
259 # include <netinet/in.h>
260 #endif
261 ])
262 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
263 [#if HAVE_STDINT_H
264 # include <stdint.h>
265 #endif
266 #if HAVE_SYS_TYPES_H
267 # include <sys/types.h>
268 #endif
269 #if HAVE_NETINET_IN_SYSTM_H
270 # include <netinet/in_systm.h>
271 #endif
272 #if HAVE_NETINET_IN_H
273 # include <netinet/in.h>
274 #endif
275 #if HAVE_NETINET_IP6_H
276 # include <netinet/ip6.h>
277 #endif
278 ])
279 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
280 [#if HAVE_STDINT_H
281 # include <stdint.h>
282 #endif
283 #if HAVE_SYS_TYPES_H
284 # include <sys/types.h>
285 #endif
286 #if HAVE_NETINET_IN_SYSTM_H
287 # include <netinet/in_systm.h>
288 #endif
289 #if HAVE_NETINET_IN_H
290 # include <netinet/in.h>
291 #endif
292 #if HAVE_NETINET_IP_H
293 # include <netinet/ip.h>
294 #endif
295 ])
296 AC_CHECK_HEADERS(netinet/udp.h, [], [],
297 [#if HAVE_STDINT_H
298 # include <stdint.h>
299 #endif
300 #if HAVE_SYS_TYPES_H
301 # include <sys/types.h>
302 #endif
303 #if HAVE_NETINET_IN_SYSTM_H
304 # include <netinet/in_systm.h>
305 #endif
306 #if HAVE_NETINET_IN_H
307 # include <netinet/in.h>
308 #endif
309 #if HAVE_NETINET_IP_H
310 # include <netinet/ip.h>
311 #endif
312 ])
314 have_ip6_ext="no"
315 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
316 [#if HAVE_STDINT_H
317 # include <stdint.h>
318 #endif
319 #if HAVE_SYS_TYPES_H
320 # include <sys/types.h>
321 #endif
322 #if HAVE_NETINET_IN_SYSTM_H
323 # include <netinet/in_systm.h>
324 #endif
325 #if HAVE_NETINET_IN_H
326 # include <netinet/in.h>
327 #endif
328 #if HAVE_NETINET_IP6_H
329 # include <netinet/ip6.h>
330 #endif
331 ])
333 if test "x$have_ip6_ext" = "xno"; then
334 SAVE_CFLAGS="$CFLAGS"
335 CFLAGS="$CFLAGS -DSOLARIS2=8"
337 AC_CHECK_TYPES([struct ip6_ext],
338 [have_ip6_ext="yes, with -DSOLARIS2=8"],
339 [have_ip6_ext="no"],
340 [#if HAVE_STDINT_H
341 # include <stdint.h>
342 #endif
343 #if HAVE_SYS_TYPES_H
344 # include <sys/types.h>
345 #endif
346 #if HAVE_NETINET_IN_SYSTM_H
347 # include <netinet/in_systm.h>
348 #endif
349 #if HAVE_NETINET_IN_H
350 # include <netinet/in.h>
351 #endif
352 #if HAVE_NETINET_IP6_H
353 # include <netinet/ip6.h>
354 #endif
355 ])
357 if test "x$have_ip6_ext" = "xno"; then
358 CFLAGS="$SAVE_CFLAGS"
359 fi
360 fi
362 # For cpu modules
363 AC_CHECK_HEADERS(sys/dkstat.h)
364 if test "x$ac_system" = "xDarwin"
365 then
366 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)
367 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
368 # For the battery plugin
369 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
370 [
371 #if HAVE_IOKIT_IOKITLIB_H
372 # include <IOKit/IOKitLib.h>
373 #endif
374 #if HAVE_IOKIT_IOTYPES_H
375 # include <IOKit/IOTypes.h>
376 #endif
377 ])
379 fi
381 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
382 [
383 #if HAVE_SYS_TYPES_H
384 # include <sys/types.h>
385 #endif
386 #if HAVE_SYS_PARAM_H
387 # include <sys/param.h>
388 #endif
389 ])
391 AC_MSG_CHECKING([for sysctl kern.cp_times])
392 if test -x /sbin/sysctl
393 then
394 /sbin/sysctl kern.cp_times 2>/dev/null
395 if test $? -eq 0
396 then
397 AC_MSG_RESULT([yes])
398 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
399 [Define if sysctl supports kern.cp_times])
400 else
401 AC_MSG_RESULT([no])
402 fi
403 else
404 AC_MSG_RESULT([no])
405 fi
407 # For hddtemp module
408 AC_CHECK_HEADERS(linux/major.h)
410 # For md module (Linux only)
411 if test "x$ac_system" = "xLinux"
412 then
413 AC_CHECK_HEADERS(linux/raid/md_u.h,
414 [have_linux_raid_md_u_h="yes"],
415 [have_linux_raid_md_u_h="no"],
416 [
417 #include <sys/ioctl.h>
418 #include <linux/major.h>
419 #include <linux/types.h>
420 ])
421 else
422 have_linux_raid_md_u_h="no"
423 fi
425 # For the swap module
426 have_linux_wireless_h="no"
427 if test "x$ac_system" = "xLinux"
428 then
429 AC_CHECK_HEADERS(linux/wireless.h,
430 [have_linux_wireless_h="yes"],
431 [have_linux_wireless_h="no"],
432 [
433 #include <dirent.h>
434 #include <sys/ioctl.h>
435 #include <sys/socket.h>
436 ])
437 fi
439 # For the swap module
440 have_sys_swap_h="yes"
441 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
442 [
443 #undef _FILE_OFFSET_BITS
444 #undef _LARGEFILE64_SOURCE
445 #if HAVE_SYS_TYPES_H
446 # include <sys/types.h>
447 #endif
448 #if HAVE_SYS_PARAM_H
449 # include <sys/param.h>
450 #endif
451 ])
453 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
454 then
455 hint_64=""
456 if test "x$GCC" = "xyes"
457 then
458 hint_64="CFLAGS='-m64'"
459 else
460 hint_64="CFLAGS='-xarch=v9'"
461 fi
462 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
463 fi
465 # For load module
466 # For the processes plugin
467 # For users module
468 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
470 # For interface plugin
471 AC_CHECK_HEADERS(ifaddrs.h)
472 AC_CHECK_HEADERS(net/if.h, [], [],
473 [
474 #if HAVE_SYS_TYPES_H
475 # include <sys/types.h>
476 #endif
477 #if HAVE_SYS_SOCKET_H
478 # include <sys/socket.h>
479 #endif
480 ])
481 AC_CHECK_HEADERS(linux/if.h, [], [],
482 [
483 #if HAVE_SYS_TYPES_H
484 # include <sys/types.h>
485 #endif
486 #if HAVE_SYS_SOCKET_H
487 # include <sys/socket.h>
488 #endif
489 ])
490 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
491 [
492 #if HAVE_SYS_TYPES_H
493 # include <sys/types.h>
494 #endif
495 #if HAVE_SYS_SOCKET_H
496 # include <sys/socket.h>
497 #endif
498 #if HAVE_LINUX_INET_DIAG_H
499 # include <linux/inet_diag.h>
500 #endif
501 ])
502 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
503 [
504 #if HAVE_SYS_TYPES_H
505 # include <sys/types.h>
506 #endif
507 #if HAVE_SYS_SOCKET_H
508 # include <sys/socket.h>
509 #endif
510 #if HAVE_LINUX_IF_H
511 # include <linux/if.h>
512 #endif
513 ])
515 # For ethstat module
516 AC_CHECK_HEADERS(linux/sockios.h,
517 [have_linux_sockios_h="yes"],
518 [have_linux_sockios_h="no"],
519 [
520 #if HAVE_SYS_IOCTL_H
521 # include <sys/ioctl.h>
522 #endif
523 #if HAVE_NET_IF_H
524 # include <net/if.h>
525 #endif
526 ])
527 AC_CHECK_HEADERS(linux/ethtool.h,
528 [have_linux_ethtool_h="yes"],
529 [have_linux_ethtool_h="no"],
530 [
531 #if HAVE_SYS_IOCTL_H
532 # include <sys/ioctl.h>
533 #endif
534 #if HAVE_NET_IF_H
535 # include <net/if.h>
536 #endif
537 #if HAVE_LINUX_SOCKIOS_H
538 # include <linux/sockios.h>
539 #endif
540 ])
542 # For ipvs module
543 have_linux_ip_vs_h="no"
544 have_net_ip_vs_h="no"
545 have_ip_vs_h="no"
546 ip_vs_h_needs_kernel_cflags="no"
547 if test "x$ac_system" = "xLinux"
548 then
549 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
550 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
551 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
553 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
554 then
555 SAVE_CFLAGS="$CFLAGS"
556 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
558 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
560 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
561 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
562 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
564 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
565 then
566 ip_vs_h_needs_kernel_cflags="yes"
567 fi
569 CFLAGS="$SAVE_CFLAGS"
570 fi
571 fi
572 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
574 # For quota module
575 AC_CHECK_HEADERS(sys/ucred.h, [], [],
576 [
577 #if HAVE_SYS_TYPES_H
578 # include <sys/types.h>
579 #endif
580 #if HAVE_SYS_PARAM_H
581 # include <sys/param.h>
582 #endif
583 ])
585 # For mount interface
586 AC_CHECK_HEADERS(sys/mount.h, [], [],
587 [
588 #if HAVE_SYS_TYPES_H
589 # include <sys/types.h>
590 #endif
591 #if HAVE_SYS_PARAM_H
592 # include <sys/param.h>
593 #endif
594 ])
596 # For the email plugin
597 AC_CHECK_HEADERS(linux/un.h, [], [],
598 [
599 #if HAVE_SYS_SOCKET_H
600 # include <sys/socket.h>
601 #endif
602 ])
604 AC_CHECK_HEADERS([ \
605 ctype.h \
606 fs_info.h \
607 fshelp.h \
608 grp.h \
609 kvm.h \
610 limits.h \
611 mntent.h \
612 mnttab.h \
613 paths.h \
614 pwd.h \
615 sys/fs_types.h \
616 sys/fstyp.h \
617 sys/mntent.h \
618 sys/mnttab.h \
619 sys/statfs.h \
620 sys/statvfs.h \
621 sys/un.h \
622 sys/vfs.h \
623 sys/vfstab.h \
624 wordexp.h \
625 ])
627 AC_CHECK_HEADERS([xfs/xqm.h], [], [],
628 [
629 #define _GNU_SOURCE
630 ])
632 # For the dns plugin
633 AC_CHECK_HEADERS(arpa/nameser.h)
634 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
635 [
636 #if HAVE_ARPA_NAMESER_H
637 # include <arpa/nameser.h>
638 #endif
639 ])
641 AC_CHECK_HEADERS(net/if_arp.h, [], [],
642 [#if HAVE_SYS_SOCKET_H
643 # include <sys/socket.h>
644 #endif
645 ])
646 AC_CHECK_HEADERS(net/ppp_defs.h)
647 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
648 [#if HAVE_NET_PPP_DEFS_H
649 # include <net/ppp_defs.h>
650 #endif
651 ])
652 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
653 [#if HAVE_STDINT_H
654 # include <stdint.h>
655 #endif
656 #if HAVE_SYS_TYPES_H
657 # include <sys/types.h>
658 #endif
659 #if HAVE_SYS_SOCKET_H
660 # include <sys/socket.h>
661 #endif
662 #if HAVE_NET_IF_H
663 # include <net/if.h>
664 #endif
665 #if HAVE_NETINET_IN_H
666 # include <netinet/in.h>
667 #endif
668 ])
670 AC_CHECK_HEADERS(netinet/ip_compat.h)
672 have_net_pfvar_h="no"
673 AC_CHECK_HEADERS(net/pfvar.h,
674 [have_net_pfvar_h="yes"],
675 [have_net_pfvar_h="no"],
676 [
677 #if HAVE_SYS_IOCTL_H
678 # include <sys/ioctl.h>
679 #endif
680 #if HAVE_SYS_SOCKET_H
681 # include <sys/socket.h>
682 #endif
683 #if HAVE_NET_IF_H
684 # include <net/if.h>
685 #endif
686 #if HAVE_NETINET_IN_H
687 # include <netinet/in.h>
688 #endif
689 ])
691 # For the multimeter plugin
692 have_termios_h="no"
693 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
695 #
696 # Checks for typedefs, structures, and compiler characteristics.
697 #
698 AC_C_CONST
699 AC_TYPE_PID_T
700 AC_TYPE_SIZE_T
701 AC_TYPE_UID_T
702 AC_HEADER_TIME
704 #
705 # Checks for library functions.
706 #
707 AC_PROG_GCC_TRADITIONAL
708 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
710 AC_FUNC_STRERROR_R
712 SAVE_CFLAGS="$CFLAGS"
713 # Emulate behavior of src/Makefile.am
714 if test "x$GCC" = "xyes"
715 then
716 CFLAGS="$CFLAGS -Wall -Werror"
717 fi
719 AC_CACHE_CHECK([for strtok_r],
720 [c_cv_have_strtok_r_default],
721 AC_LINK_IFELSE(
722 [AC_LANG_PROGRAM(
723 [[[
724 #include <stdlib.h>
725 #include <stdio.h>
726 #include <string.h>
727 ]]],
728 [[[
729 char buffer[] = "foo,bar,baz";
730 char *token;
731 char *dummy;
732 char *saveptr;
734 dummy = buffer;
735 saveptr = NULL;
736 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
737 {
738 dummy = NULL;
739 printf ("token = %s;\n", token);
740 }
741 ]]]
742 )],
743 [c_cv_have_strtok_r_default="yes"],
744 [c_cv_have_strtok_r_default="no"]
745 )
746 )
748 if test "x$c_cv_have_strtok_r_default" = "xno"
749 then
750 CFLAGS="$CFLAGS -D_REENTRANT=1"
752 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
753 [c_cv_have_strtok_r_reentrant],
754 AC_LINK_IFELSE(
755 [AC_LANG_PROGRAM(
756 [[[
757 #include <stdlib.h>
758 #include <stdio.h>
759 #include <string.h>
760 ]]],
761 [[[
762 char buffer[] = "foo,bar,baz";
763 char *token;
764 char *dummy;
765 char *saveptr;
767 dummy = buffer;
768 saveptr = NULL;
769 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
770 {
771 dummy = NULL;
772 printf ("token = %s;\n", token);
773 }
774 ]]]
775 )],
776 [c_cv_have_strtok_r_reentrant="yes"],
777 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
778 )
779 )
780 fi
782 CFLAGS="$SAVE_CFLAGS"
783 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
784 then
785 CFLAGS="$CFLAGS -D_REENTRANT=1"
786 fi
788 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
790 socket_needs_socket="no"
791 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
792 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
794 clock_gettime_needs_rt="no"
795 clock_gettime_needs_posix4="no"
796 have_clock_gettime="no"
797 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
798 if test "x$have_clock_gettime" = "xno"
799 then
800 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
801 have_clock_gettime="yes"])
802 fi
803 if test "x$have_clock_gettime" = "xno"
804 then
805 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
806 have_clock_gettime="yes"])
807 fi
808 if test "x$have_clock_gettime" = "xyes"
809 then
810 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
811 else
812 AC_MSG_WARN(cannot find clock_gettime)
813 fi
815 nanosleep_needs_rt="no"
816 nanosleep_needs_posix4="no"
817 AC_CHECK_FUNCS(nanosleep,
818 [],
819 AC_CHECK_LIB(rt, nanosleep,
820 [nanosleep_needs_rt="yes"],
821 AC_CHECK_LIB(posix4, nanosleep,
822 [nanosleep_needs_posix4="yes"],
823 AC_MSG_ERROR(cannot find nanosleep))))
825 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
826 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
828 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
829 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
830 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
831 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
832 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
833 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
834 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
835 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
836 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
837 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
838 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
839 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
841 # Check for strptime {{{
842 if test "x$GCC" = "xyes"
843 then
844 SAVE_CFLAGS="$CFLAGS"
845 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
846 fi
848 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
849 if test "x$have_strptime" = "xyes"
850 then
851 AC_CACHE_CHECK([whether strptime is exported by default],
852 [c_cv_have_strptime_default],
853 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
854 [[[
855 #include <time.h>
856 ]]],
857 [[[
858 struct tm stm;
859 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
860 ]]]
861 )],
862 [c_cv_have_strptime_default="yes"],
863 [c_cv_have_strptime_default="no"]))
864 fi
865 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
866 then
867 AC_CACHE_CHECK([whether strptime needs standards mode],
868 [c_cv_have_strptime_standards],
869 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
870 [[[
871 #ifndef _ISOC99_SOURCE
872 # define _ISOC99_SOURCE 1
873 #endif
874 #ifndef _POSIX_C_SOURCE
875 # define _POSIX_C_SOURCE 200112L
876 #endif
877 #ifndef _XOPEN_SOURCE
878 # define _XOPEN_SOURCE 500
879 #endif
880 #include <time.h>
881 ]]],
882 [[[
883 struct tm stm;
884 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
885 ]]]
886 )],
887 [c_cv_have_strptime_standards="yes"],
888 [c_cv_have_strptime_standards="no"]))
890 if test "x$c_cv_have_strptime_standards" = "xyes"
891 then
892 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
893 else
894 have_strptime="no"
895 fi
896 fi
898 if test "x$GCC" = "xyes"
899 then
900 CFLAGS="$SAVE_CFLAGS"
901 fi
902 # }}} Check for strptime
904 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
905 if test "x$have_swapctl" = "xyes"; then
906 AC_CACHE_CHECK([whether swapctl takes two arguments],
907 [c_cv_have_swapctl_two_args],
908 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
909 [[[
910 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
911 # undef _FILE_OFFSET_BITS
912 # undef _LARGEFILE64_SOURCE
913 #endif
914 #include <sys/stat.h>
915 #include <sys/swap.h>
916 ]]],
917 [[[
918 int num = swapctl(0, NULL);
919 ]]]
920 )],
921 [c_cv_have_swapctl_two_args="yes"],
922 [c_cv_have_swapctl_two_args="no"]
923 )
924 )
925 AC_CACHE_CHECK([whether swapctl takes three arguments],
926 [c_cv_have_swapctl_three_args],
927 AC_COMPILE_IFELSE(
928 [AC_LANG_PROGRAM(
929 [[[
930 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
931 # undef _FILE_OFFSET_BITS
932 # undef _LARGEFILE64_SOURCE
933 #endif
934 #include <sys/stat.h>
935 #include <sys/swap.h>
936 ]]],
937 [[[
938 int num = swapctl(0, NULL, 0);
939 ]]]
940 )],
941 [c_cv_have_swapctl_three_args="yes"],
942 [c_cv_have_swapctl_three_args="no"]
943 )
944 )
945 fi
946 # Check for different versions of `swapctl' here..
947 if test "x$have_swapctl" = "xyes"; then
948 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
949 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
950 [Define if the function swapctl exists and takes two arguments.])
951 fi
952 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
953 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
954 [Define if the function swapctl exists and takes three arguments.])
955 fi
956 fi
958 # Check for NAN
959 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
960 [
961 if test "x$withval" = "xno"; then
962 nan_type="none"
963 else if test "x$withval" = "xyes"; then
964 nan_type="zero"
965 else
966 nan_type="$withval"
967 fi; fi
968 ],
969 [nan_type="none"])
970 if test "x$nan_type" = "xnone"; then
971 AC_CACHE_CHECK([whether NAN is defined by default],
972 [c_cv_have_nan_default],
973 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
974 [[[
975 #include <stdlib.h>
976 #include <math.h>
977 static double foo = NAN;
978 ]]],
979 [[[
980 if (isnan (foo))
981 return 0;
982 else
983 return 1;
984 ]]]
985 )],
986 [c_cv_have_nan_default="yes"],
987 [c_cv_have_nan_default="no"]
988 )
989 )
990 if test "x$c_cv_have_nan_default" = "xyes"
991 then
992 nan_type="default"
993 fi
994 fi
995 if test "x$nan_type" = "xnone"; then
996 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
997 [c_cv_have_nan_isoc],
998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
999 [[[
1000 #include <stdlib.h>
1001 #define __USE_ISOC99 1
1002 #include <math.h>
1003 static double foo = NAN;
1004 ]]],
1005 [[[
1006 if (isnan (foo))
1007 return 0;
1008 else
1009 return 1;
1010 ]]]
1011 )],
1012 [c_cv_have_nan_isoc="yes"],
1013 [c_cv_have_nan_isoc="no"]
1014 )
1015 )
1016 if test "x$c_cv_have_nan_isoc" = "xyes"
1017 then
1018 nan_type="isoc99"
1019 fi
1020 fi
1021 if test "x$nan_type" = "xnone"; then
1022 SAVE_LDFLAGS=$LDFLAGS
1023 LDFLAGS="$LDFLAGS -lm"
1024 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1025 [c_cv_have_nan_zero],
1026 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1027 [[[
1028 #include <stdlib.h>
1029 #include <math.h>
1030 #ifdef NAN
1031 # undef NAN
1032 #endif
1033 #define NAN (0.0 / 0.0)
1034 #ifndef isnan
1035 # define isnan(f) ((f) != (f))
1036 #endif
1037 static double foo = NAN;
1038 ]]],
1039 [[[
1040 if (isnan (foo))
1041 return 0;
1042 else
1043 return 1;
1044 ]]]
1045 )],
1046 [c_cv_have_nan_zero="yes"],
1047 [c_cv_have_nan_zero="no"]
1048 )
1049 )
1050 LDFLAGS=$SAVE_LDFLAGS
1051 if test "x$c_cv_have_nan_zero" = "xyes"
1052 then
1053 nan_type="zero"
1054 fi
1055 fi
1057 if test "x$nan_type" = "xdefault"; then
1058 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1059 [Define if NAN is defined by default and can initialize static variables.])
1060 else if test "x$nan_type" = "xisoc99"; then
1061 AC_DEFINE(NAN_STATIC_ISOC, 1,
1062 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1063 else if test "x$nan_type" = "xzero"; then
1064 AC_DEFINE(NAN_ZERO_ZERO, 1,
1065 [Define if NAN can be defined as (0.0 / 0.0)])
1066 else
1067 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1068 fi; fi; fi
1070 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1071 [
1072 if test "x$withval" = "xnothing"; then
1073 fp_layout_type="nothing"
1074 else if test "x$withval" = "xendianflip"; then
1075 fp_layout_type="endianflip"
1076 else if test "x$withval" = "xintswap"; then
1077 fp_layout_type="intswap"
1078 else
1079 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1080 fi; fi; fi
1081 ],
1082 [fp_layout_type="unknown"])
1084 if test "x$fp_layout_type" = "xunknown"; then
1085 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1086 [c_cv_fp_layout_need_nothing],
1087 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1088 [[[
1089 #include <stdlib.h>
1090 #include <stdio.h>
1091 #include <string.h>
1092 #if HAVE_STDINT_H
1093 # include <stdint.h>
1094 #endif
1095 #if HAVE_INTTYPES_H
1096 # include <inttypes.h>
1097 #endif
1098 #if HAVE_STDBOOL_H
1099 # include <stdbool.h>
1100 #endif
1101 ]]],
1102 [[[
1103 uint64_t i0;
1104 uint64_t i1;
1105 uint8_t c[8];
1106 double d;
1108 d = 8.642135e130;
1109 memcpy ((void *) &i0, (void *) &d, 8);
1111 i1 = i0;
1112 memcpy ((void *) c, (void *) &i1, 8);
1114 if ((c[0] == 0x2f) && (c[1] == 0x25)
1115 && (c[2] == 0xc0) && (c[3] == 0xc7)
1116 && (c[4] == 0x43) && (c[5] == 0x2b)
1117 && (c[6] == 0x1f) && (c[7] == 0x5b))
1118 return (0);
1119 else
1120 return (1);
1121 ]]]
1122 )],
1123 [c_cv_fp_layout_need_nothing="yes"],
1124 [c_cv_fp_layout_need_nothing="no"]
1125 )
1126 )
1127 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1128 fp_layout_type="nothing"
1129 fi
1130 fi
1131 if test "x$fp_layout_type" = "xunknown"; then
1132 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1133 [c_cv_fp_layout_need_endianflip],
1134 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1135 [[[
1136 #include <stdlib.h>
1137 #include <stdio.h>
1138 #include <string.h>
1139 #if HAVE_STDINT_H
1140 # include <stdint.h>
1141 #endif
1142 #if HAVE_INTTYPES_H
1143 # include <inttypes.h>
1144 #endif
1145 #if HAVE_STDBOOL_H
1146 # include <stdbool.h>
1147 #endif
1148 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1149 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1150 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1151 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1152 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1153 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1154 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1155 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1156 ]]],
1157 [[[
1158 uint64_t i0;
1159 uint64_t i1;
1160 uint8_t c[8];
1161 double d;
1163 d = 8.642135e130;
1164 memcpy ((void *) &i0, (void *) &d, 8);
1166 i1 = endianflip (i0);
1167 memcpy ((void *) c, (void *) &i1, 8);
1169 if ((c[0] == 0x2f) && (c[1] == 0x25)
1170 && (c[2] == 0xc0) && (c[3] == 0xc7)
1171 && (c[4] == 0x43) && (c[5] == 0x2b)
1172 && (c[6] == 0x1f) && (c[7] == 0x5b))
1173 return (0);
1174 else
1175 return (1);
1176 ]]]
1177 )],
1178 [c_cv_fp_layout_need_endianflip="yes"],
1179 [c_cv_fp_layout_need_endianflip="no"]
1180 )
1181 )
1182 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1183 fp_layout_type="endianflip"
1184 fi
1185 fi
1186 if test "x$fp_layout_type" = "xunknown"; then
1187 AC_CACHE_CHECK([if intswap converts to x86 representation],
1188 [c_cv_fp_layout_need_intswap],
1189 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1190 [[[
1191 #include <stdlib.h>
1192 #include <stdio.h>
1193 #include <string.h>
1194 #if HAVE_STDINT_H
1195 # include <stdint.h>
1196 #endif
1197 #if HAVE_INTTYPES_H
1198 # include <inttypes.h>
1199 #endif
1200 #if HAVE_STDBOOL_H
1201 # include <stdbool.h>
1202 #endif
1203 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1204 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1205 ]]],
1206 [[[
1207 uint64_t i0;
1208 uint64_t i1;
1209 uint8_t c[8];
1210 double d;
1212 d = 8.642135e130;
1213 memcpy ((void *) &i0, (void *) &d, 8);
1215 i1 = intswap (i0);
1216 memcpy ((void *) c, (void *) &i1, 8);
1218 if ((c[0] == 0x2f) && (c[1] == 0x25)
1219 && (c[2] == 0xc0) && (c[3] == 0xc7)
1220 && (c[4] == 0x43) && (c[5] == 0x2b)
1221 && (c[6] == 0x1f) && (c[7] == 0x5b))
1222 return (0);
1223 else
1224 return (1);
1225 ]]]
1226 )],
1227 [c_cv_fp_layout_need_intswap="yes"],
1228 [c_cv_fp_layout_need_intswap="no"]
1229 )
1230 )
1231 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1232 fp_layout_type="intswap"
1233 fi
1234 fi
1236 if test "x$fp_layout_type" = "xnothing"; then
1237 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1238 [Define if doubles are stored in x86 representation.])
1239 else if test "x$fp_layout_type" = "xendianflip"; then
1240 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1241 [Define if endianflip is needed to convert to x86 representation.])
1242 else if test "x$fp_layout_type" = "xintswap"; then
1243 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1244 [Define if intswap is needed to convert to x86 representation.])
1245 else
1246 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1247 fi; fi; fi
1249 have_getfsstat="no"
1250 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1251 have_getvfsstat="no"
1252 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1253 have_listmntent="no"
1254 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1255 have_getmntent_r="no"
1256 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1258 have_getmntent="no"
1259 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1260 if test "x$have_getmntent" = "xno"; then
1261 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1262 fi
1263 if test "x$have_getmntent" = "xno"; then
1264 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1265 fi
1266 if test "x$have_getmntent" = "xno"; then
1267 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1268 fi
1270 if test "x$have_getmntent" = "xc"; then
1271 AC_CACHE_CHECK([whether getmntent takes one argument],
1272 [c_cv_have_one_getmntent],
1273 AC_COMPILE_IFELSE(
1274 [AC_LANG_PROGRAM(
1275 [[[
1276 #include "$srcdir/src/utils_mount.h"
1277 ]]],
1278 [[[
1279 FILE *fh;
1280 struct mntent *me;
1281 fh = setmntent ("/etc/mtab", "r");
1282 me = getmntent (fh);
1283 return(me->mnt_passno);
1284 ]]]
1285 )],
1286 [c_cv_have_one_getmntent="yes"],
1287 [c_cv_have_one_getmntent="no"]
1288 )
1289 )
1290 AC_CACHE_CHECK([whether getmntent takes two arguments],
1291 [c_cv_have_two_getmntent],
1292 AC_COMPILE_IFELSE(
1293 [AC_LANG_PROGRAM(
1294 [[[
1295 #include "$srcdir/src/utils_mount.h"
1296 ]]],
1297 [[[
1298 FILE *fh;
1299 struct mnttab mt;
1300 int status;
1301 fh = fopen ("/etc/mnttab", "r");
1302 status = getmntent (fh, &mt);
1303 return(status);
1304 ]]]
1305 )],
1306 [c_cv_have_two_getmntent="yes"],
1307 [c_cv_have_two_getmntent="no"]
1308 )
1309 )
1310 fi
1312 # Check for different versions of `getmntent' here..
1314 if test "x$have_getmntent" = "xc"; then
1315 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1316 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1317 [Define if the function getmntent exists and takes one argument.])
1318 fi
1319 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1320 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1321 [Define if the function getmntent exists and takes two arguments.])
1322 fi
1323 fi
1324 if test "x$have_getmntent" = "xsun"; then
1325 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1326 [Define if the function getmntent exists. It's the version from libsun.])
1327 fi
1328 if test "x$have_getmntent" = "xseq"; then
1329 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1330 [Define if the function getmntent exists. It's the version from libseq.])
1331 fi
1332 if test "x$have_getmntent" = "xgen"; then
1333 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1334 [Define if the function getmntent exists. It's the version from libgen.])
1335 fi
1337 # Check for htonll
1338 AC_CACHE_CHECK([if have htonll defined],
1339 [c_cv_have_htonll],
1340 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1341 [[[
1342 #include <sys/types.h>
1343 #include <netinet/in.h>
1344 #if HAVE_INTTYPES_H
1345 # include <inttypes.h>
1346 #endif
1347 ]]],
1348 [[[
1349 return htonll(0);
1350 ]]]
1351 )],
1352 [c_cv_have_htonll="yes"],
1353 [c_cv_have_htonll="no"]
1354 )
1355 )
1356 if test "x$c_cv_have_htonll" = "xyes"
1357 then
1358 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1359 fi
1361 # Check for structures
1362 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1363 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1364 [],
1365 [
1366 #include <sys/types.h>
1367 #include <sys/socket.h>
1368 #include <net/if.h>
1369 ])
1370 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1371 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1372 [],
1373 [
1374 #include <sys/types.h>
1375 #include <sys/socket.h>
1376 #include <linux/if.h>
1377 #include <linux/netdevice.h>
1378 ])
1379 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1380 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1381 [],
1382 [
1383 #include <linux/inet_diag.h>
1384 ])
1387 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1388 [],
1389 [
1390 #include <netinet/in.h>
1391 #include <net/if.h>
1392 ])
1394 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1395 [
1396 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1397 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1398 have_struct_kinfo_proc_freebsd="yes"
1399 ],
1400 [
1401 have_struct_kinfo_proc_freebsd="no"
1402 ],
1403 [
1404 #include <kvm.h>
1405 #include <sys/param.h>
1406 #include <sys/sysctl.h>
1407 #include <sys/user.h>
1408 ])
1410 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1411 [
1412 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1413 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1414 have_struct_kinfo_proc_openbsd="yes"
1415 ],
1416 [
1417 have_struct_kinfo_proc_openbsd="no"
1418 ],
1419 [
1420 #include <sys/param.h>
1421 #include <sys/sysctl.h>
1422 #include <kvm.h>
1423 ])
1425 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1426 [#define _BSD_SOURCE
1427 #define _DEFAULT_SOURCE
1428 #if HAVE_STDINT_H
1429 # include <stdint.h>
1430 #endif
1431 #if HAVE_SYS_TYPES_H
1432 # include <sys/types.h>
1433 #endif
1434 #if HAVE_NETINET_IN_SYSTM_H
1435 # include <netinet/in_systm.h>
1436 #endif
1437 #if HAVE_NETINET_IN_H
1438 # include <netinet/in.h>
1439 #endif
1440 #if HAVE_NETINET_IP_H
1441 # include <netinet/ip.h>
1442 #endif
1443 #if HAVE_NETINET_UDP_H
1444 # include <netinet/udp.h>
1445 #endif
1446 ])
1447 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1448 [#define _BSD_SOURCE
1449 #define _DEFAULT_SOURCE
1450 #if HAVE_STDINT_H
1451 # include <stdint.h>
1452 #endif
1453 #if HAVE_SYS_TYPES_H
1454 # include <sys/types.h>
1455 #endif
1456 #if HAVE_NETINET_IN_SYSTM_H
1457 # include <netinet/in_systm.h>
1458 #endif
1459 #if HAVE_NETINET_IN_H
1460 # include <netinet/in.h>
1461 #endif
1462 #if HAVE_NETINET_IP_H
1463 # include <netinet/ip.h>
1464 #endif
1465 #if HAVE_NETINET_UDP_H
1466 # include <netinet/udp.h>
1467 #endif
1468 ])
1470 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1471 [],
1472 [],
1473 [
1474 #if HAVE_KSTAT_H
1475 # include <kstat.h>
1476 #endif
1477 ])
1479 #
1480 # Checks for libraries begin here
1481 #
1483 with_libresolv="yes"
1484 AC_CHECK_LIB(resolv, res_search,
1485 [
1486 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1487 ],
1488 [with_libresolv="no"])
1489 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1491 dnl Check for HAL (hardware abstraction library)
1492 with_libhal="yes"
1493 AC_CHECK_LIB(hal,libhal_device_property_exists,
1494 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1495 [with_libhal="no"])
1496 if test "x$with_libhal" = "xyes"; then
1497 if test "x$PKG_CONFIG" != "x"; then
1498 BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
1499 BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
1500 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1501 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1502 fi
1503 fi
1505 m4_divert_once([HELP_WITH], [
1506 collectd additional packages:])
1508 AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
1510 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1512 if test "x$ac_system" = "xAIX"
1513 then
1514 with_perfstat="yes"
1515 with_procinfo="yes"
1516 else
1517 with_perfstat="no (AIX only)"
1518 with_procinfo="no (AIX only)"
1519 fi
1521 if test "x$with_perfstat" = "xyes"
1522 then
1523 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1524 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1525 fi
1526 if test "x$with_perfstat" = "xyes"
1527 then
1528 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1529 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1530 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1531 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1532 then
1533 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1534 fi
1535 fi
1536 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1538 # Processes plugin under AIX.
1539 if test "x$with_procinfo" = "xyes"
1540 then
1541 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1542 fi
1543 if test "x$with_procinfo" = "xyes"
1544 then
1545 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1546 fi
1548 if test "x$ac_system" = "xSolaris"
1549 then
1550 with_kstat="yes"
1551 with_devinfo="yes"
1552 else
1553 with_kstat="no (Solaris only)"
1554 with_devinfo="no (Solaris only)"
1555 fi
1557 if test "x$with_kstat" = "xyes"
1558 then
1559 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1560 fi
1561 if test "x$with_kstat" = "xyes"
1562 then
1563 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1564 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1565 fi
1566 if test "x$with_kstat" = "xyes"
1567 then
1568 AC_DEFINE(HAVE_LIBKSTAT, 1,
1569 [Define to 1 if you have the 'kstat' library (-lkstat)])
1570 fi
1571 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1572 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1574 with_libiokit="no"
1575 if test "x$ac_system" = "xDarwin"
1576 then
1577 with_libiokit="yes"
1578 else
1579 with_libiokit="no"
1580 fi
1581 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1583 with_libkvm="no"
1584 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1585 if test "x$with_kvm_getprocs" = "xyes"
1586 then
1587 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1588 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1589 with_libkvm="yes"
1590 fi
1591 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1593 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1594 if test "x$with_kvm_getswapinfo" = "xyes"
1595 then
1596 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1597 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1598 with_libkvm="yes"
1599 fi
1600 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1602 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1603 if test "x$with_kvm_nlist" = "xyes"
1604 then
1605 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1606 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1607 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1608 with_libkvm="yes"
1609 fi
1610 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1612 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1613 if test "x$with_kvm_openfiles" = "xyes"
1614 then
1615 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1616 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1617 with_libkvm="yes"
1618 fi
1619 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1621 # --with-libaquaero5 {{{
1622 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1623 [
1624 if test "x$withval" = "xyes"
1625 then
1626 with_libaquaero5="yes"
1627 else if test "x$withval" = "xno"
1628 then
1629 with_libaquaero5="no"
1630 else
1631 with_libaquaero5="yes"
1632 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1633 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1634 fi; fi
1635 ],
1636 [with_libaquaero5="yes"])
1638 SAVE_CPPFLAGS="$CPPFLAGS"
1639 SAVE_LDFLAGS="$LDFLAGS"
1641 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1642 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1644 if test "x$with_libaquaero5" = "xyes"
1645 then
1646 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1647 then
1648 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1649 fi
1650 AC_CHECK_HEADERS(libaquaero5.h,
1651 [with_libaquaero5="yes"],
1652 [with_libaquaero5="no (libaquaero5.h not found)"])
1653 fi
1654 if test "x$with_libaquaero5" = "xyes"
1655 then
1656 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1657 then
1658 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1659 fi
1660 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1661 [with_libaquaero5="yes"],
1662 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1663 fi
1665 CPPFLAGS="$SAVE_CPPFLAGS"
1666 LDFLAGS="$SAVE_LDFLAGS"
1668 if test "x$with_libaquaero5" = "xyes"
1669 then
1670 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1671 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1672 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1673 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1674 fi
1675 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1676 # }}}
1678 # --with-libcredis {{{
1679 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1680 [
1681 if test "x$withval" = "xyes"
1682 then
1683 with_libcredis="yes"
1684 else if test "x$withval" = "xno"
1685 then
1686 with_libcredis="no"
1687 else
1688 with_libcredis="yes"
1689 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1690 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1691 fi; fi
1692 ],
1693 [with_libcredis="yes"])
1695 SAVE_CPPFLAGS="$CPPFLAGS"
1696 SAVE_LDFLAGS="$LDFLAGS"
1698 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1699 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1701 if test "x$with_libcredis" = "xyes"
1702 then
1703 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1704 then
1705 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1706 fi
1707 AC_CHECK_HEADERS(credis.h,
1708 [with_libcredis="yes"],
1709 [with_libcredis="no (credis.h not found)"])
1710 fi
1711 if test "x$with_libcredis" = "xyes"
1712 then
1713 if test "x$LIBCREDIS_LDFLAGS" != "x"
1714 then
1715 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1716 fi
1717 AC_CHECK_LIB(credis, credis_info,
1718 [with_libcredis="yes"],
1719 [with_libcredis="no (symbol 'credis_info' not found)"])
1721 fi
1723 CPPFLAGS="$SAVE_CPPFLAGS"
1724 LDFLAGS="$SAVE_LDFLAGS"
1726 if test "x$with_libcredis" = "xyes"
1727 then
1728 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1729 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1730 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1731 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1732 fi
1733 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1734 # }}}
1736 # --with-libcurl {{{
1737 with_curl_config="curl-config"
1738 with_curl_cflags=""
1739 with_curl_libs=""
1740 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1741 [
1742 if test "x$withval" = "xno"
1743 then
1744 with_libcurl="no"
1745 else if test "x$withval" = "xyes"
1746 then
1747 with_libcurl="yes"
1748 else
1749 if test -f "$withval" && test -x "$withval"
1750 then
1751 with_curl_config="$withval"
1752 with_libcurl="yes"
1753 else if test -x "$withval/bin/curl-config"
1754 then
1755 with_curl_config="$withval/bin/curl-config"
1756 with_libcurl="yes"
1757 fi; fi
1758 with_libcurl="yes"
1759 fi; fi
1760 ],
1761 [
1762 with_libcurl="yes"
1763 ])
1764 if test "x$with_libcurl" = "xyes"
1765 then
1766 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1767 curl_config_status=$?
1769 if test $curl_config_status -ne 0
1770 then
1771 with_libcurl="no ($with_curl_config failed)"
1772 else
1773 SAVE_CPPFLAGS="$CPPFLAGS"
1774 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1776 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1778 CPPFLAGS="$SAVE_CPPFLAGS"
1779 fi
1780 fi
1781 if test "x$with_libcurl" = "xyes"
1782 then
1783 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1784 curl_config_status=$?
1786 if test $curl_config_status -ne 0
1787 then
1788 with_libcurl="no ($with_curl_config failed)"
1789 else
1790 AC_CHECK_LIB(curl, curl_easy_init,
1791 [with_libcurl="yes"],
1792 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1793 [$with_curl_libs])
1794 fi
1795 fi
1796 if test "x$with_libcurl" = "xyes"
1797 then
1798 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1799 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1800 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1801 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1802 fi
1803 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1804 # }}}
1806 # --with-libdbi {{{
1807 with_libdbi_cppflags=""
1808 with_libdbi_ldflags=""
1809 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1810 [
1811 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1812 then
1813 with_libdbi_cppflags="-I$withval/include"
1814 with_libdbi_ldflags="-L$withval/lib"
1815 with_libdbi="yes"
1816 else
1817 with_libdbi="$withval"
1818 fi
1819 ],
1820 [
1821 with_libdbi="yes"
1822 ])
1823 if test "x$with_libdbi" = "xyes"
1824 then
1825 SAVE_CPPFLAGS="$CPPFLAGS"
1826 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1828 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1830 CPPFLAGS="$SAVE_CPPFLAGS"
1831 fi
1832 if test "x$with_libdbi" = "xyes"
1833 then
1834 SAVE_CPPFLAGS="$CPPFLAGS"
1835 SAVE_LDFLAGS="$LDFLAGS"
1836 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1837 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1839 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1841 CPPFLAGS="$SAVE_CPPFLAGS"
1842 LDFLAGS="$SAVE_LDFLAGS"
1843 fi
1844 if test "x$with_libdbi" = "xyes"
1845 then
1846 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1847 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1848 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1849 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1850 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1851 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1852 fi
1853 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1854 # }}}
1856 # --with-libesmtp {{{
1857 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1858 [
1859 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1860 then
1861 LDFLAGS="$LDFLAGS -L$withval/lib"
1862 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1863 with_libesmtp="yes"
1864 else
1865 with_libesmtp="$withval"
1866 fi
1867 ],
1868 [
1869 with_libesmtp="yes"
1870 ])
1871 if test "x$with_libesmtp" = "xyes"
1872 then
1873 AC_CHECK_LIB(esmtp, smtp_create_session,
1874 [
1875 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1876 ], [with_libesmtp="no (libesmtp not found)"])
1877 fi
1878 if test "x$with_libesmtp" = "xyes"
1879 then
1880 AC_CHECK_HEADERS(libesmtp.h,
1881 [
1882 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1883 ], [with_libesmtp="no (libesmtp.h not found)"])
1884 fi
1885 if test "x$with_libesmtp" = "xyes"
1886 then
1887 collect_libesmtp=1
1888 else
1889 collect_libesmtp=0
1890 fi
1891 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1892 [Wether or not to use the esmtp library])
1893 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1894 # }}}
1896 # --with-libganglia {{{
1897 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1898 [
1899 if test -f "$withval" && test -x "$withval"
1900 then
1901 with_libganglia_config="$withval"
1902 with_libganglia="yes"
1903 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1904 then
1905 with_libganglia_config="$withval/bin/ganglia-config"
1906 with_libganglia="yes"
1907 else if test -d "$withval"
1908 then
1909 GANGLIA_CPPFLAGS="-I$withval/include"
1910 GANGLIA_LDFLAGS="-L$withval/lib"
1911 with_libganglia="yes"
1912 else
1913 with_libganglia="$withval"
1914 fi; fi; fi
1915 ],
1916 [
1917 with_libganglia="yes"
1918 ])
1920 if test "x$with_libganglia" = "xyes"
1921 then
1922 if test "x$with_libganglia_config" != "x"
1923 then
1924 if test "x$GANGLIA_CPPFLAGS" = "x"
1925 then
1926 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1927 fi
1929 if test "x$GANGLIA_LDFLAGS" = "x"
1930 then
1931 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1932 fi
1934 if test "x$GANGLIA_LIBS" = "x"
1935 then
1936 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1937 fi
1938 else
1939 GANGLIA_LIBS="-lganglia"
1940 fi
1941 fi
1943 SAVE_CPPFLAGS="$CPPFLAGS"
1944 SAVE_LDFLAGS="$LDFLAGS"
1945 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1946 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1948 if test "x$with_libganglia" = "xyes"
1949 then
1950 AC_CHECK_HEADERS(gm_protocol.h,
1951 [
1952 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1953 [Define to 1 if you have the <gm_protocol.h> header file.])
1954 ], [with_libganglia="no (gm_protocol.h not found)"])
1955 fi
1957 if test "x$with_libganglia" = "xyes"
1958 then
1959 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1960 [
1961 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1962 [Define to 1 if you have the ganglia library (-lganglia).])
1963 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1964 fi
1966 CPPFLAGS="$SAVE_CPPFLAGS"
1967 LDFLAGS="$SAVE_LDFLAGS"
1969 AC_SUBST(GANGLIA_CPPFLAGS)
1970 AC_SUBST(GANGLIA_LDFLAGS)
1971 AC_SUBST(GANGLIA_LIBS)
1972 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1973 # }}}
1975 # --with-libgcrypt {{{
1976 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1977 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1978 GCRYPT_LIBS="$GCRYPT_LIBS"
1979 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1980 [
1981 if test -f "$withval" && test -x "$withval"
1982 then
1983 with_libgcrypt_config="$withval"
1984 with_libgcrypt="yes"
1985 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1986 then
1987 with_libgcrypt_config="$withval/bin/gcrypt-config"
1988 with_libgcrypt="yes"
1989 else if test -d "$withval"
1990 then
1991 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1992 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1993 with_libgcrypt="yes"
1994 else
1995 with_libgcrypt_config="gcrypt-config"
1996 with_libgcrypt="$withval"
1997 fi; fi; fi
1998 ],
1999 [
2000 with_libgcrypt_config="libgcrypt-config"
2001 with_libgcrypt="yes"
2002 ])
2004 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2005 then
2006 if test "x$GCRYPT_CPPFLAGS" = "x"
2007 then
2008 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2009 fi
2011 if test "x$GCRYPT_LIBS" = "x"
2012 then
2013 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2014 fi
2015 fi
2017 SAVE_CPPFLAGS="$CPPFLAGS"
2018 SAVE_LDFLAGS="$LDFLAGS"
2019 SAVE_LIBS="$LIBS"
2020 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2021 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2022 LIBS="$LIBS $GCRYPT_LIBS"
2024 if test "x$with_libgcrypt" = "xyes"
2025 then
2026 if test "x$GCRYPT_CPPFLAGS" != "x"
2027 then
2028 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2029 fi
2030 AC_CHECK_HEADERS(gcrypt.h,
2031 [with_libgcrypt="yes"],
2032 [with_libgcrypt="no (gcrypt.h not found)"])
2033 fi
2035 if test "x$with_libgcrypt" = "xyes"
2036 then
2037 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2038 [with_libgcrypt="yes"],
2039 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2041 if test "$with_libgcrypt" != "no"; then
2042 m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
2043 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
2044 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
2045 fi
2046 fi
2048 CPPFLAGS="$SAVE_CPPFLAGS"
2049 LDFLAGS="$SAVE_LDFLAGS"
2050 LIBS="$SAVE_LIBS"
2052 if test "x$with_libgcrypt" = "xyes"
2053 then
2054 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2055 fi
2057 AC_SUBST(GCRYPT_CPPFLAGS)
2058 AC_SUBST(GCRYPT_LDFLAGS)
2059 AC_SUBST(GCRYPT_LIBS)
2060 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2061 # }}}
2063 # --with-libiptc {{{
2064 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2065 [
2066 if test "x$withval" = "xshipped"
2067 then
2068 with_libiptc="own"
2069 else if test "x$withval" = "xyes"
2070 then
2071 with_libiptc="pkgconfig"
2072 else if test "x$withval" = "xno"
2073 then
2074 with_libiptc="no"
2075 else
2076 with_libiptc="yes"
2077 with_libiptc_cflags="-I$withval/include"
2078 with_libiptc_libs="-L$withval/lib"
2079 fi; fi; fi
2080 ],
2081 [
2082 if test "x$ac_system" = "xLinux"
2083 then
2084 with_libiptc="pkgconfig"
2085 else
2086 with_libiptc="no (Linux only)"
2087 fi
2088 ])
2090 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
2091 then
2092 with_libiptc="no (Don't have pkg-config)"
2093 fi
2095 if test "x$with_libiptc" = "xpkgconfig"
2096 then
2097 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2098 if test $? -ne 0
2099 then
2100 with_libiptc="no (pkg-config doesn't know libiptc)"
2101 fi
2102 fi
2103 if test "x$with_libiptc" = "xpkgconfig"
2104 then
2105 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2106 if test $? -ne 0
2107 then
2108 with_libiptc="no ($PKG_CONFIG failed)"
2109 fi
2110 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2111 if test $? -ne 0
2112 then
2113 with_libiptc="no ($PKG_CONFIG failed)"
2114 fi
2115 fi
2117 SAVE_CPPFLAGS="$CPPFLAGS"
2118 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2120 # check whether the header file for libiptc is available.
2121 if test "x$with_libiptc" = "xpkgconfig"
2122 then
2123 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2124 [with_libiptc="no (header file missing)"])
2125 fi
2126 # If the header file is available, check for the required type declaractions.
2127 # They may be missing in old versions of libiptc. In that case, they will be
2128 # declared in the iptables plugin.
2129 if test "x$with_libiptc" = "xpkgconfig"
2130 then
2131 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2132 fi
2133 # Check for the iptc_init symbol in the library.
2134 # This could be in iptc or ip4tc
2135 if test "x$with_libiptc" = "xpkgconfig"
2136 then
2137 SAVE_LIBS="$LIBS"
2138 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2139 [with_libiptc="pkgconfig"],
2140 [with_libiptc="no"],
2141 [$with_libiptc_libs])
2142 LIBS="$SAVE_LIBS"
2143 fi
2144 if test "x$with_libiptc" = "xpkgconfig"
2145 then
2146 with_libiptc="yes"
2147 fi
2149 CPPFLAGS="$SAVE_CPPFLAGS"
2151 if test "x$with_libiptc" = "xown"
2152 then
2153 with_libiptc_cflags=""
2154 with_libiptc_libs=""
2155 fi
2156 if test "x$with_libiptc" = "xown"
2157 then
2158 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
2159 [
2160 with_libiptc="no (Linux iptables headers not found)"
2161 ],
2162 [
2163 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
2164 ])
2165 fi
2166 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
2167 if test "x$with_libiptc" = "xown"
2168 then
2169 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
2170 with_libiptc="yes"
2171 fi
2173 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2174 if test "x$with_libiptc" = "xyes"
2175 then
2176 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2177 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2178 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2179 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2180 fi
2181 # }}}
2183 # --with-java {{{
2184 with_java_home="$JAVA_HOME"
2185 if test "x$with_java_home" = "x"
2186 then
2187 with_java_home="/usr/lib/jvm"
2188 fi
2189 with_java_vmtype="client"
2190 with_java_cflags=""
2191 with_java_libs=""
2192 JAVAC="$JAVAC"
2193 JAR="$JAR"
2194 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2195 [
2196 if test "x$withval" = "xno"
2197 then
2198 with_java="no"
2199 else if test "x$withval" = "xyes"
2200 then
2201 with_java="yes"
2202 else
2203 with_java_home="$withval"
2204 with_java="yes"
2205 fi; fi
2206 ],
2207 [with_java="yes"])
2208 if test "x$with_java" = "xyes"
2209 then
2210 if test -d "$with_java_home"
2211 then
2212 AC_MSG_CHECKING([for jni.h])
2213 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2214 if test "x$TMPVAR" != "x"
2215 then
2216 AC_MSG_RESULT([found in $TMPVAR])
2217 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2218 else
2219 AC_MSG_RESULT([not found])
2220 fi
2222 AC_MSG_CHECKING([for jni_md.h])
2223 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2224 if test "x$TMPVAR" != "x"
2225 then
2226 AC_MSG_RESULT([found in $TMPVAR])
2227 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2228 else
2229 AC_MSG_RESULT([not found])
2230 fi
2232 AC_MSG_CHECKING([for libjvm.so])
2233 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2234 if test "x$TMPVAR" != "x"
2235 then
2236 AC_MSG_RESULT([found in $TMPVAR])
2237 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2238 else
2239 AC_MSG_RESULT([not found])
2240 fi
2242 if test "x$JAVAC" = "x"
2243 then
2244 AC_MSG_CHECKING([for javac])
2245 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2246 if test "x$TMPVAR" != "x"
2247 then
2248 JAVAC="$TMPVAR"
2249 AC_MSG_RESULT([$JAVAC])
2250 else
2251 AC_MSG_RESULT([not found])
2252 fi
2253 fi
2254 if test "x$JAR" = "x"
2255 then
2256 AC_MSG_CHECKING([for jar])
2257 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2258 if test "x$TMPVAR" != "x"
2259 then
2260 JAR="$TMPVAR"
2261 AC_MSG_RESULT([$JAR])
2262 else
2263 AC_MSG_RESULT([not found])
2264 fi
2265 fi
2266 else if test "x$with_java_home" != "x"
2267 then
2268 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2269 fi; fi
2270 fi
2272 if test "x$JAVA_CPPFLAGS" != "x"
2273 then
2274 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2275 fi
2276 if test "x$JAVA_CFLAGS" != "x"
2277 then
2278 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2279 fi
2280 if test "x$JAVA_LDFLAGS" != "x"
2281 then
2282 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2283 fi
2284 if test "x$JAVAC" = "x"
2285 then
2286 with_javac_path="$PATH"
2287 if test "x$with_java_home" != "x"
2288 then
2289 with_javac_path="$with_java_home:with_javac_path"
2290 if test -d "$with_java_home/bin"
2291 then
2292 with_javac_path="$with_java_home/bin:with_javac_path"
2293 fi
2294 fi
2296 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2297 fi
2298 if test "x$JAVAC" = "x"
2299 then
2300 with_java="no (javac not found)"
2301 fi
2302 if test "x$JAR" = "x"
2303 then
2304 with_jar_path="$PATH"
2305 if test "x$with_java_home" != "x"
2306 then
2307 with_jar_path="$with_java_home:$with_jar_path"
2308 if test -d "$with_java_home/bin"
2309 then
2310 with_jar_path="$with_java_home/bin:$with_jar_path"
2311 fi
2312 fi
2314 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2315 fi
2316 if test "x$JAR" = "x"
2317 then
2318 with_java="no (jar not found)"
2319 fi
2321 SAVE_CPPFLAGS="$CPPFLAGS"
2322 SAVE_CFLAGS="$CFLAGS"
2323 SAVE_LDFLAGS="$LDFLAGS"
2324 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2325 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2326 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2328 if test "x$with_java" = "xyes"
2329 then
2330 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2331 fi
2332 if test "x$with_java" = "xyes"
2333 then
2334 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2335 [with_java="yes"],
2336 [with_java="no (libjvm not found)"],
2337 [$JAVA_LIBS])
2338 fi
2339 if test "x$with_java" = "xyes"
2340 then
2341 JAVA_LIBS="$JAVA_LIBS -ljvm"
2342 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2343 fi
2345 CPPFLAGS="$SAVE_CPPFLAGS"
2346 CFLAGS="$SAVE_CFLAGS"
2347 LDFLAGS="$SAVE_LDFLAGS"
2349 AC_SUBST(JAVA_CPPFLAGS)
2350 AC_SUBST(JAVA_CFLAGS)
2351 AC_SUBST(JAVA_LDFLAGS)
2352 AC_SUBST(JAVA_LIBS)
2353 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2354 # }}}
2356 # --with-liblvm2app {{{
2357 with_liblvm2app_cppflags=""
2358 with_liblvm2app_ldflags=""
2359 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2360 [
2361 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2362 then
2363 with_liblvm2app_cppflags="-I$withval/include"
2364 with_liblvm2app_ldflags="-L$withval/lib"
2365 with_liblvm2app="yes"
2366 else
2367 with_liblvm2app="$withval"
2368 fi
2369 ],
2370 [
2371 with_liblvm2app="yes"
2372 ])
2373 if test "x$with_liblvm2app" = "xyes"
2374 then
2375 SAVE_CPPFLAGS="$CPPFLAGS"
2376 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2378 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2380 CPPFLAGS="$SAVE_CPPFLAGS"
2381 fi
2383 if test "x$with_liblvm2app" = "xyes"
2384 then
2385 SAVE_CPPFLAGS="$CPPFLAGS"
2386 SAVE_LDFLAGS="$LDFLAGS"
2387 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2388 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2390 AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2392 CPPFLAGS="$SAVE_CPPFLAGS"
2393 LDFLAGS="$SAVE_LDFLAGS"
2394 fi
2395 if test "x$with_liblvm2app" = "xyes"
2396 then
2397 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2398 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2399 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2400 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2401 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2402 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2403 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2404 fi
2405 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2406 # }}}
2408 # --with-libmemcached {{{
2409 with_libmemcached_cppflags=""
2410 with_libmemcached_ldflags=""
2411 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2412 [
2413 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2414 then
2415 with_libmemcached_cppflags="-I$withval/include"
2416 with_libmemcached_ldflags="-L$withval/lib"
2417 with_libmemcached="yes"
2418 else
2419 with_libmemcached="$withval"
2420 fi
2421 ],
2422 [
2423 with_libmemcached="yes"
2424 ])
2425 if test "x$with_libmemcached" = "xyes"
2426 then
2427 SAVE_CPPFLAGS="$CPPFLAGS"
2428 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2430 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2432 CPPFLAGS="$SAVE_CPPFLAGS"
2433 fi
2434 if test "x$with_libmemcached" = "xyes"
2435 then
2436 SAVE_CPPFLAGS="$CPPFLAGS"
2437 SAVE_LDFLAGS="$LDFLAGS"
2438 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2439 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2441 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2443 CPPFLAGS="$SAVE_CPPFLAGS"
2444 LDFLAGS="$SAVE_LDFLAGS"
2445 fi
2446 if test "x$with_libmemcached" = "xyes"
2447 then
2448 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2449 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2450 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2451 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2452 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2453 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2454 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2455 fi
2456 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2457 # }}}
2459 # --with-libmodbus {{{
2460 with_libmodbus_config=""
2461 with_libmodbus_cflags=""
2462 with_libmodbus_libs=""
2463 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2464 [
2465 if test "x$withval" = "xno"
2466 then
2467 with_libmodbus="no"
2468 else if test "x$withval" = "xyes"
2469 then
2470 with_libmodbus="use_pkgconfig"
2471 else if test -d "$with_libmodbus/lib"
2472 then
2473 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2474 with_libmodbus_cflags="-I$withval/include"
2475 with_libmodbus_libs="-L$withval/lib -lmodbus"
2476 with_libmodbus="yes"
2477 fi; fi; fi
2478 ],
2479 [with_libmodbus="use_pkgconfig"])
2481 # configure using pkg-config
2482 if test "x$with_libmodbus" = "xuse_pkgconfig"
2483 then
2484 if test "x$PKG_CONFIG" = "x"
2485 then
2486 with_libmodbus="no (Don't have pkg-config)"
2487 fi
2488 fi
2489 if test "x$with_libmodbus" = "xuse_pkgconfig"
2490 then
2491 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2492 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2493 if test $? -ne 0
2494 then
2495 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2496 fi
2497 fi
2498 if test "x$with_libmodbus" = "xuse_pkgconfig"
2499 then
2500 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2501 if test $? -ne 0
2502 then
2503 with_libmodbus="no ($PKG_CONFIG failed)"
2504 fi
2505 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2506 if test $? -ne 0
2507 then
2508 with_libmodbus="no ($PKG_CONFIG failed)"
2509 fi
2510 fi
2511 if test "x$with_libmodbus" = "xuse_pkgconfig"
2512 then
2513 with_libmodbus="yes"
2514 fi
2516 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2517 # the actual checks.
2518 if test "x$with_libmodbus" = "xyes"
2519 then
2520 SAVE_CPPFLAGS="$CPPFLAGS"
2521 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2523 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
2525 CPPFLAGS="$SAVE_CPPFLAGS"
2526 fi
2527 if test "x$with_libmodbus" = "xyes"
2528 then
2529 SAVE_CPPFLAGS="$CPPFLAGS"
2530 SAVE_LDFLAGS="$LDFLAGS"
2532 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2533 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2535 AC_CHECK_LIB(modbus, modbus_connect,
2536 [with_libmodbus="yes"],
2537 [with_libmodbus="no (symbol modbus_connect not found)"])
2539 CPPFLAGS="$SAVE_CPPFLAGS"
2540 LDFLAGS="$SAVE_LDFLAGS"
2541 fi
2542 if test "x$with_libmodbus" = "xyes"
2543 then
2544 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2545 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2546 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2547 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2548 fi
2549 # }}}
2551 # --with-libmongoc {{{
2552 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2553 [
2554 if test "x$withval" = "xyes"
2555 then
2556 with_libmongoc="yes"
2557 else if test "x$withval" = "xno"
2558 then
2559 with_libmongoc="no"
2560 else
2561 with_libmongoc="yes"
2562 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2563 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2564 fi; fi
2565 ],
2566 [with_libmongoc="yes"])
2568 SAVE_CPPFLAGS="$CPPFLAGS"
2569 SAVE_LDFLAGS="$LDFLAGS"
2571 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2572 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2574 if test "x$with_libmongoc" = "xyes"
2575 then
2576 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2577 then
2578 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2579 fi
2580 AC_CHECK_HEADERS(mongo.h,
2581 [with_libmongoc="yes"],
2582 [with_libmongoc="no ('mongo.h' not found)"],
2583 [#if HAVE_STDINT_H
2584 # define MONGO_HAVE_STDINT 1
2585 #else
2586 # define MONGO_USE_LONG_LONG_INT 1
2587 #endif
2588 ])
2589 fi
2590 if test "x$with_libmongoc" = "xyes"
2591 then
2592 if test "x$LIBMONGOC_LDFLAGS" != "x"
2593 then
2594 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2595 fi
2596 AC_CHECK_LIB(mongoc, mongo_run_command,
2597 [with_libmongoc="yes"],
2598 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2599 fi
2601 CPPFLAGS="$SAVE_CPPFLAGS"
2602 LDFLAGS="$SAVE_LDFLAGS"
2604 if test "x$with_libmongoc" = "xyes"
2605 then
2606 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2607 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2608 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2609 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2610 fi
2611 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2612 # }}}
2614 # --with-libmysql {{{
2615 with_mysql_config="mysql_config"
2616 with_mysql_cflags=""
2617 with_mysql_libs=""
2618 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2619 [
2620 if test "x$withval" = "xno"
2621 then
2622 with_libmysql="no"
2623 else if test "x$withval" = "xyes"
2624 then
2625 with_libmysql="yes"
2626 else
2627 if test -f "$withval" && test -x "$withval";
2628 then
2629 with_mysql_config="$withval"
2630 else if test -x "$withval/bin/mysql_config"
2631 then
2632 with_mysql_config="$withval/bin/mysql_config"
2633 fi; fi
2634 with_libmysql="yes"
2635 fi; fi
2636 ],
2637 [
2638 with_libmysql="yes"
2639 ])
2640 if test "x$with_libmysql" = "xyes"
2641 then
2642 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
2643 mysql_config_status=$?
2645 if test $mysql_config_status -ne 0
2646 then
2647 with_libmysql="no ($with_mysql_config failed)"
2648 else
2649 SAVE_CPPFLAGS="$CPPFLAGS"
2650 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2652 have_mysql_h="no"
2653 have_mysql_mysql_h="no"
2654 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2656 if test "x$have_mysql_h" = "xno"
2657 then
2658 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2659 fi
2661 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2662 then
2663 with_libmysql="no (mysql.h not found)"
2664 fi
2666 CPPFLAGS="$SAVE_CPPFLAGS"
2667 fi
2668 fi
2669 if test "x$with_libmysql" = "xyes"
2670 then
2671 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2672 mysql_config_status=$?
2674 if test $mysql_config_status -ne 0
2675 then
2676 with_libmysql="no ($with_mysql_config failed)"
2677 else
2678 SAVE_CPPFLAGS="$CPPFLAGS"
2679 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2680 SAVE_LIBS="$LIBS"
2681 LIBS="$with_mysql_libs"
2682 AC_SEARCH_LIBS([mysql_get_server_version],
2683 [],
2684 [with_libmysql="yes"],
2685 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2686 [])
2687 CPPFLAGS="$SAVE_CPPFLAGS"
2688 LIBS="$SAVE_LIBS"
2689 fi
2690 fi
2691 if test "x$with_libmysql" = "xyes"
2692 then
2693 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2694 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2695 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2696 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2697 fi
2698 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2699 # }}}
2701 # --with-libmnl {{{
2702 with_libmnl_cflags=""
2703 with_libmnl_libs=""
2704 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
2705 [
2706 echo "libmnl: withval = $withval"
2707 if test "x$withval" = "xyes"
2708 then
2709 with_libmnl="yes"
2710 else if test "x$withval" = "xno"
2711 then
2712 with_libmnl="no"
2713 else
2714 if test -d "$withval/include"
2715 then
2716 with_libmnl_cflags="-I$withval/include"
2717 with_libmnl_libs="-L$withval/lib -lmnl"
2718 with_libmnl="yes"
2719 else
2720 AC_MSG_ERROR("no such directory: $withval/include")
2721 fi
2722 fi; fi
2723 ],
2724 [
2725 if test "x$ac_system" = "xLinux"
2726 then
2727 with_libmnl="yes"
2728 else
2729 with_libmnl="no (Linux only library)"
2730 fi
2731 ])
2732 if test "x$PKG_CONFIG" = "x"
2733 then
2734 with_libmnl="no (Don't have pkg-config)"
2735 fi
2736 if test "x$with_libmnl" = "xyes"
2737 then
2738 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
2739 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
2740 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
2741 fi
2743 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
2744 [
2745 with_libmnl="yes"
2746 break
2747 ], [],
2748 [#include <stdio.h>
2749 #include <sys/types.h>
2750 #include <asm/types.h>
2751 #include <sys/socket.h>
2752 #include <linux/netlink.h>
2753 #include <linux/rtnetlink.h>])
2754 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2755 [#include <stdio.h>
2756 #include <sys/types.h>
2757 #include <asm/types.h>
2758 #include <sys/socket.h>])
2760 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2761 [[
2762 #include <stdio.h>
2763 #include <sys/types.h>
2764 #include <asm/types.h>
2765 #include <sys/socket.h>
2766 #include <linux/netlink.h>
2767 #include <linux/rtnetlink.h>
2768 ]],
2769 [[
2770 int retval = TCA_STATS2;
2771 return (retval);
2772 ]]
2773 )],
2774 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2776 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2777 [[
2778 #include <stdio.h>
2779 #include <sys/types.h>
2780 #include <asm/types.h>
2781 #include <sys/socket.h>
2782 #include <linux/netlink.h>
2783 #include <linux/rtnetlink.h>
2784 ]],
2785 [[
2786 int retval = TCA_STATS;
2787 return (retval);
2788 ]]
2789 )],
2790 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2791 fi
2792 if test "x$with_libmnl" = "xyes"
2793 then
2794 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
2795 [with_libmnl="yes"],
2796 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
2797 [$with_libmnl_libs])
2798 fi
2799 if test "x$with_libmnl" = "xyes"
2800 then
2801 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
2802 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
2803 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
2804 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
2805 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
2806 fi
2807 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
2808 # }}}
2810 # --with-libnetapp {{{
2811 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2812 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2813 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2814 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2815 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2816 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2817 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2818 [
2819 if test -d "$withval"
2820 then
2821 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2822 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2823 with_libnetapp="yes"
2824 else
2825 with_libnetapp="$withval"
2826 fi
2827 ],
2828 [
2829 with_libnetapp="yes"
2830 ])
2832 SAVE_CPPFLAGS="$CPPFLAGS"
2833 SAVE_LDFLAGS="$LDFLAGS"
2834 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2835 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2837 if test "x$with_libnetapp" = "xyes"
2838 then
2839 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2840 then
2841 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2842 fi
2843 AC_CHECK_HEADERS(netapp_api.h,
2844 [with_libnetapp="yes"],
2845 [with_libnetapp="no (netapp_api.h not found)"])
2846 fi
2848 if test "x$with_libnetapp" = "xyes"
2849 then
2850 if test "x$LIBNETAPP_LDFLAGS" != "x"
2851 then
2852 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2853 fi
2855 if test "x$LIBNETAPP_LIBS" = "x"
2856 then
2857 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2858 fi
2859 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2861 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2862 [with_libnetapp="yes"],
2863 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2864 [$LIBNETAPP_LIBS])
2865 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2866 fi
2868 CPPFLAGS="$SAVE_CPPFLAGS"
2869 LDFLAGS="$SAVE_LDFLAGS"
2871 if test "x$with_libnetapp" = "xyes"
2872 then
2873 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2874 fi
2876 AC_SUBST(LIBNETAPP_CPPFLAGS)
2877 AC_SUBST(LIBNETAPP_LDFLAGS)
2878 AC_SUBST(LIBNETAPP_LIBS)
2879 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2880 # }}}
2882 # --with-libnetsnmp {{{
2883 with_snmp_config="net-snmp-config"
2884 with_snmp_cflags=""
2885 with_snmp_libs=""
2886 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2887 [
2888 if test "x$withval" = "xno"
2889 then
2890 with_libnetsnmp="no"
2891 else if test "x$withval" = "xyes"
2892 then
2893 with_libnetsnmp="yes"
2894 else
2895 if test -x "$withval"
2896 then
2897 with_snmp_config="$withval"
2898 with_libnetsnmp="yes"
2899 else
2900 with_snmp_config="$withval/bin/net-snmp-config"
2901 with_libnetsnmp="yes"
2902 fi
2903 fi; fi
2904 ],
2905 [with_libnetsnmp="yes"])
2906 if test "x$with_libnetsnmp" = "xyes"
2907 then
2908 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2909 snmp_config_status=$?
2911 if test $snmp_config_status -ne 0
2912 then
2913 with_libnetsnmp="no ($with_snmp_config failed)"
2914 else
2915 SAVE_CPPFLAGS="$CPPFLAGS"
2916 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2918 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2920 CPPFLAGS="$SAVE_CPPFLAGS"
2921 fi
2922 fi
2923 if test "x$with_libnetsnmp" = "xyes"
2924 then
2925 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2926 snmp_config_status=$?
2928 if test $snmp_config_status -ne 0
2929 then
2930 with_libnetsnmp="no ($with_snmp_config failed)"
2931 else
2932 AC_CHECK_LIB(netsnmp, init_snmp,
2933 [with_libnetsnmp="yes"],
2934 [with_libnetsnmp="no (libnetsnmp not found)"],
2935 [$with_snmp_libs])
2936 fi
2937 fi
2938 if test "x$with_libnetsnmp" = "xyes"
2939 then
2940 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2941 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2942 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2943 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2944 fi
2945 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2946 # }}}
2948 # --with-liboconfig {{{
2949 with_own_liboconfig="no"
2950 liboconfig_LDFLAGS="$LDFLAGS"
2951 liboconfig_CPPFLAGS="$CPPFLAGS"
2952 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2953 [
2954 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2955 then
2956 if test -d "$withval/lib"
2957 then
2958 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2959 fi
2960 if test -d "$withval/include"
2961 then
2962 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2963 fi
2964 fi
2965 if test "x$withval" = "xno"
2966 then
2967 AC_MSG_ERROR("liboconfig is required")
2968 fi
2969 ],
2970 [
2971 with_liboconfig="yes"
2972 ])
2974 save_LDFLAGS="$LDFLAGS"
2975 save_CPPFLAGS="$CPPFLAGS"
2976 LDFLAGS="$liboconfig_LDFLAGS"
2977 CPPFLAGS="$liboconfig_CPPFLAGS"
2978 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2979 [
2980 with_liboconfig="yes"
2981 with_own_liboconfig="no"
2982 ],
2983 [
2984 with_liboconfig="yes"
2985 with_own_liboconfig="yes"
2986 LDFLAGS="$save_LDFLAGS"
2987 CPPFLAGS="$save_CPPFLAGS"
2988 ])
2990 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2991 if test "x$with_own_liboconfig" = "xyes"
2992 then
2993 with_liboconfig="yes (shipped version)"
2994 fi
2995 # }}}
2997 # --with-liboping {{{
2998 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2999 [
3000 if test "x$withval" = "xyes"
3001 then
3002 with_liboping="yes"
3003 else if test "x$withval" = "xno"
3004 then
3005 with_liboping="no"
3006 else
3007 with_liboping="yes"
3008 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3009 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3010 fi; fi
3011 ],
3012 [with_liboping="yes"])
3014 SAVE_CPPFLAGS="$CPPFLAGS"
3015 SAVE_LDFLAGS="$LDFLAGS"
3017 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3018 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3020 if test "x$with_liboping" = "xyes"
3021 then
3022 if test "x$LIBOPING_CPPFLAGS" != "x"
3023 then
3024 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3025 fi
3026 AC_CHECK_HEADERS(oping.h,
3027 [with_liboping="yes"],
3028 [with_liboping="no (oping.h not found)"])
3029 fi
3030 if test "x$with_liboping" = "xyes"
3031 then
3032 if test "x$LIBOPING_LDFLAGS" != "x"
3033 then
3034 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3035 fi
3036 AC_CHECK_LIB(oping, ping_construct,
3037 [with_liboping="yes"],
3038 [with_liboping="no (symbol 'ping_construct' not found)"])
3039 fi
3041 CPPFLAGS="$SAVE_CPPFLAGS"
3042 LDFLAGS="$SAVE_LDFLAGS"
3044 if test "x$with_liboping" = "xyes"
3045 then
3046 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3047 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3048 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3049 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3050 fi
3051 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3052 # }}}
3054 # --with-oracle {{{
3055 with_oracle_cppflags=""
3056 with_oracle_libs=""
3057 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3058 [
3059 if test "x$withval" = "xyes"
3060 then
3061 if test "x$ORACLE_HOME" = "x"
3062 then
3063 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3064 fi
3065 with_oracle="yes"
3066 else if test "x$withval" = "xno"
3067 then
3068 with_oracle="no"
3069 else
3070 with_oracle="yes"
3071 ORACLE_HOME="$withval"
3072 fi; fi
3073 ],
3074 [
3075 if test "x$ORACLE_HOME" = "x"
3076 then
3077 with_oracle="no (ORACLE_HOME is not set)"
3078 else
3079 with_oracle="yes"
3080 fi
3081 ])
3082 if test "x$ORACLE_HOME" != "x"
3083 then
3084 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3086 if test -e "$ORACLE_HOME/lib/ldflags"
3087 then
3088 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3089 fi
3090 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3091 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3092 fi
3093 if test "x$with_oracle" = "xyes"
3094 then
3095 SAVE_CPPFLAGS="$CPPFLAGS"
3096 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3098 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3100 CPPFLAGS="$SAVE_CPPFLAGS"
3101 fi
3102 if test "x$with_oracle" = "xyes"
3103 then
3104 SAVE_CPPFLAGS="$CPPFLAGS"
3105 SAVE_LIBS="$LIBS"
3106 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3107 LIBS="$LIBS $with_oracle_libs"
3109 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3111 CPPFLAGS="$SAVE_CPPFLAGS"
3112 LIBS="$SAVE_LIBS"
3113 fi
3114 if test "x$with_oracle" = "xyes"
3115 then
3116 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
3117 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3118 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
3119 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3120 fi
3121 # }}}
3123 # --with-libowcapi {{{
3124 with_libowcapi_cppflags=""
3125 with_libowcapi_libs="-lowcapi"
3126 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3127 [
3128 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3129 then
3130 with_libowcapi_cppflags="-I$withval/include"
3131 with_libowcapi_libs="-L$withval/lib -lowcapi"
3132 with_libowcapi="yes"
3133 else
3134 with_libowcapi="$withval"
3135 fi
3136 ],
3137 [
3138 with_libowcapi="yes"
3139 ])
3140 if test "x$with_libowcapi" = "xyes"
3141 then
3142 SAVE_CPPFLAGS="$CPPFLAGS"
3143 CPPFLAGS="$with_libowcapi_cppflags"
3145 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3147 CPPFLAGS="$SAVE_CPPFLAGS"
3148 fi
3149 if test "x$with_libowcapi" = "xyes"
3150 then
3151 SAVE_LDFLAGS="$LDFLAGS"
3152 SAVE_CPPFLAGS="$CPPFLAGS"
3153 LDFLAGS="$with_libowcapi_libs"
3154 CPPFLAGS="$with_libowcapi_cppflags"
3156 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3158 LDFLAGS="$SAVE_LDFLAGS"
3159 CPPFLAGS="$SAVE_CPPFLAGS"
3160 fi
3161 if test "x$with_libowcapi" = "xyes"
3162 then
3163 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3164 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3165 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3166 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3167 fi
3168 # }}}
3170 # --with-libpcap {{{
3171 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3172 [
3173 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3174 then
3175 LDFLAGS="$LDFLAGS -L$withval/lib"
3176 CPPFLAGS="$CPPFLAGS -I$withval/include"
3177 with_libpcap="yes"
3178 else
3179 with_libpcap="$withval"
3180 fi
3181 ],
3182 [
3183 with_libpcap="yes"
3184 ])
3185 if test "x$with_libpcap" = "xyes"
3186 then
3187 AC_CHECK_LIB(pcap, pcap_open_live,
3188 [
3189 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3190 ], [with_libpcap="no (libpcap not found)"])
3191 fi
3192 if test "x$with_libpcap" = "xyes"
3193 then
3194 AC_CHECK_HEADERS(pcap.h,,
3195 [with_libpcap="no (pcap.h not found)"])
3196 fi
3197 if test "x$with_libpcap" = "xyes"
3198 then
3199 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3200 [c_cv_libpcap_have_pcap_error_iface_not_up],
3201 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3202 [[[
3203 #include <pcap.h>
3204 ]]],
3205 [[[
3206 int val = PCAP_ERROR_IFACE_NOT_UP;
3207 return(val);
3208 ]]]
3209 )],
3210 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3211 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3212 fi
3213 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3214 then
3215 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3216 fi
3217 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3218 # }}}
3220 # --with-libperl {{{
3221 perl_interpreter="perl"
3222 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3223 [
3224 if test -f "$withval" && test -x "$withval"
3225 then
3226 perl_interpreter="$withval"
3227 with_libperl="yes"
3228 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3229 then
3230 LDFLAGS="$LDFLAGS -L$withval/lib"
3231 CPPFLAGS="$CPPFLAGS -I$withval/include"
3232 perl_interpreter="$withval/bin/perl"
3233 with_libperl="yes"
3234 else
3235 with_libperl="$withval"
3236 fi; fi
3237 ],
3238 [
3239 with_libperl="yes"
3240 ])
3242 AC_MSG_CHECKING([for perl])
3243 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3244 if test -x "$perl_interpreter"
3245 then
3246 AC_MSG_RESULT([yes ($perl_interpreter)])
3247 else
3248 perl_interpreter=""
3249 AC_MSG_RESULT([no])
3250 fi
3252 AC_SUBST(PERL, "$perl_interpreter")
3254 if test "x$with_libperl" = "xyes" \
3255 && test -n "$perl_interpreter"
3256 then
3257 SAVE_CFLAGS="$CFLAGS"
3258 SAVE_LIBS="$LIBS"
3259 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3260 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3261 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3262 CFLAGS="$CFLAGS $PERL_CFLAGS"
3263 LIBS="$LIBS $PERL_LIBS"
3265 AC_CACHE_CHECK([for libperl],
3266 [c_cv_have_libperl],
3267 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3268 [[[
3269 #define PERL_NO_GET_CONTEXT
3270 #include <EXTERN.h>
3271 #include <perl.h>
3272 #include <XSUB.h>
3273 ]]],
3274 [[[
3275 dTHX;
3276 load_module (PERL_LOADMOD_NOIMPORT,
3277 newSVpv ("Collectd::Plugin::FooBar", 24),
3278 Nullsv);
3279 ]]]
3280 )],
3281 [c_cv_have_libperl="yes"],
3282 [c_cv_have_libperl="no"]
3283 )
3284 )
3286 if test "x$c_cv_have_libperl" = "xyes"
3287 then
3288 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3289 AC_SUBST(PERL_CFLAGS)
3290 AC_SUBST(PERL_LIBS)
3291 else
3292 with_libperl="no"
3293 fi
3295 CFLAGS="$SAVE_CFLAGS"
3296 LIBS="$SAVE_LIBS"
3297 else if test -z "$perl_interpreter"; then
3298 with_libperl="no (no perl interpreter found)"
3299 c_cv_have_libperl="no"
3300 fi; fi
3301 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3303 if test "x$with_libperl" = "xyes"
3304 then
3305 SAVE_CFLAGS="$CFLAGS"
3306 SAVE_LIBS="$LIBS"
3307 CFLAGS="$CFLAGS $PERL_CFLAGS"
3308 LIBS="$LIBS $PERL_LIBS"
3310 AC_CACHE_CHECK([if perl supports ithreads],
3311 [c_cv_have_perl_ithreads],
3312 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3313 [[[
3314 #include <EXTERN.h>
3315 #include <perl.h>
3316 #include <XSUB.h>
3318 #if !defined(USE_ITHREADS)
3319 # error "Perl does not support ithreads!"
3320 #endif /* !defined(USE_ITHREADS) */
3321 ]]],
3322 [[[ ]]]
3323 )],
3324 [c_cv_have_perl_ithreads="yes"],
3325 [c_cv_have_perl_ithreads="no"]
3326 )
3327 )
3329 if test "x$c_cv_have_perl_ithreads" = "xyes"
3330 then
3331 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3332 fi
3334 CFLAGS="$SAVE_CFLAGS"
3335 LIBS="$SAVE_LIBS"
3336 fi
3338 if test "x$with_libperl" = "xyes"
3339 then
3340 SAVE_CFLAGS="$CFLAGS"
3341 SAVE_LIBS="$LIBS"
3342 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3343 # (see issues #41 and #42)
3344 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3345 LIBS="$LIBS $PERL_LIBS"
3347 AC_CACHE_CHECK([for broken Perl_load_module()],
3348 [c_cv_have_broken_perl_load_module],
3349 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3350 [[[
3351 #define PERL_NO_GET_CONTEXT
3352 #include <EXTERN.h>
3353 #include <perl.h>
3354 #include <XSUB.h>
3355 ]]],
3356 [[[
3357 dTHX;
3358 load_module (PERL_LOADMOD_NOIMPORT,
3359 newSVpv ("Collectd::Plugin::FooBar", 24),
3360 Nullsv);
3361 ]]]
3362 )],
3363 [c_cv_have_broken_perl_load_module="no"],
3364 [c_cv_have_broken_perl_load_module="yes"]
3365 )
3366 )
3368 CFLAGS="$SAVE_CFLAGS"
3369 LIBS="$SAVE_LIBS"
3370 fi
3371 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3372 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3374 if test "x$with_libperl" = "xyes"
3375 then
3376 SAVE_CFLAGS="$CFLAGS"
3377 SAVE_LIBS="$LIBS"
3378 CFLAGS="$CFLAGS $PERL_CFLAGS"
3379 LIBS="$LIBS $PERL_LIBS"
3381 AC_CHECK_MEMBER(
3382 [struct mgvtbl.svt_local],
3383 [have_struct_mgvtbl_svt_local="yes"],
3384 [have_struct_mgvtbl_svt_local="no"],
3385 [
3386 #include <EXTERN.h>
3387 #include <perl.h>
3388 #include <XSUB.h>
3389 ])
3391 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3392 then
3393 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3394 [Define if Perl's struct mgvtbl has member svt_local.])
3395 fi
3397 CFLAGS="$SAVE_CFLAGS"
3398 LIBS="$SAVE_LIBS"
3399 fi
3400 # }}}
3402 # --with-libpq {{{
3403 with_pg_config="pg_config"
3404 with_libpq_includedir=""
3405 with_libpq_libdir=""
3406 with_libpq_cppflags=""
3407 with_libpq_ldflags=""
3408 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3409 [Path to libpq.])],
3410 [
3411 if test "x$withval" = "xno"
3412 then
3413 with_libpq="no"
3414 else if test "x$withval" = "xyes"
3415 then
3416 with_libpq="yes"
3417 else
3418 if test -f "$withval" && test -x "$withval";
3419 then
3420 with_pg_config="$withval"
3421 else if test -x "$withval/bin/pg_config"
3422 then
3423 with_pg_config="$withval/bin/pg_config"
3424 fi; fi
3425 with_libpq="yes"
3426 fi; fi
3427 ],
3428 [
3429 with_libpq="yes"
3430 ])
3431 if test "x$with_libpq" = "xyes"
3432 then
3433 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3434 pg_config_status=$?
3436 if test $pg_config_status -eq 0
3437 then
3438 if test -n "$with_libpq_includedir"; then
3439 for dir in $with_libpq_includedir; do
3440 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3441 done
3442 fi
3443 else
3444 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3445 fi
3447 SAVE_CPPFLAGS="$CPPFLAGS"
3448 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3450 AC_CHECK_HEADERS(libpq-fe.h, [],
3451 [with_libpq="no (libpq-fe.h not found)"], [])
3453 CPPFLAGS="$SAVE_CPPFLAGS"
3454 fi
3455 if test "x$with_libpq" = "xyes"
3456 then
3457 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3458 pg_config_status=$?
3460 if test $pg_config_status -eq 0
3461 then
3462 if test -n "$with_libpq_libdir"; then
3463 for dir in $with_libpq_libdir; do
3464 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3465 done
3466 fi
3467 else
3468 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3469 fi
3471 SAVE_LDFLAGS="$LDFLAGS"
3472 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3474 AC_CHECK_LIB(pq, PQconnectdb,
3475 [with_libpq="yes"],
3476 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3478 AC_CHECK_LIB(pq, PQserverVersion,
3479 [with_libpq="yes"],
3480 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3482 LDFLAGS="$SAVE_LDFLAGS"
3483 fi
3484 if test "x$with_libpq" = "xyes"
3485 then
3486 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3487 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3488 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3489 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3490 fi
3491 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3492 # }}}
3494 # --with-libpthread {{{
3495 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3496 [ if test "x$withval" != "xno" \
3497 && test "x$withval" != "xyes"
3498 then
3499 LDFLAGS="$LDFLAGS -L$withval/lib"
3500 CPPFLAGS="$CPPFLAGS -I$withval/include"
3501 with_libpthread="yes"
3502 else
3503 if test "x$withval" = "xno"
3504 then
3505 with_libpthread="no (disabled)"
3506 fi
3507 fi
3508 ], [with_libpthread="yes"])
3509 if test "x$with_libpthread" = "xyes"
3510 then
3511 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3512 fi
3514 if test "x$with_libpthread" = "xyes"
3515 then
3516 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3517 fi
3518 if test "x$with_libpthread" = "xyes"
3519 then
3520 collect_pthread=1
3521 else
3522 collect_pthread=0
3523 fi
3524 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3525 [Wether or not to use pthread (POSIX threads) library])
3526 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3527 # }}}
3529 # --with-python {{{
3530 with_python_prog=""
3531 with_python_path="$PATH"
3532 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3533 [
3534 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3535 then
3536 with_python="$withval"
3537 else if test -x "$withval"
3538 then
3539 with_python_prog="$withval"
3540 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3541 with_python="yes"
3542 else if test -d "$withval"
3543 then
3544 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3545 with_python="yes"
3546 else
3547 AC_MSG_WARN([Argument not recognized: $withval])
3548 fi; fi; fi
3549 ], [with_python="yes"])
3551 SAVE_PATH="$PATH"
3552 SAVE_CPPFLAGS="$CPPFLAGS"
3553 SAVE_LDFLAGS="$LDFLAGS"
3554 SAVE_LIBS="$LIBS"
3556 PATH="$with_python_path"
3558 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3559 then
3560 AC_MSG_CHECKING([for python])
3561 with_python_prog="`which python 2>/dev/null`"
3562 if test "x$with_python_prog" = "x"
3563 then
3564 AC_MSG_RESULT([not found])
3565 with_python="no (interpreter not found)"
3566 else
3567 AC_MSG_RESULT([$with_python_prog])
3568 fi
3569 fi
3571 if test "x$with_python" = "xyes"
3572 then
3573 AC_MSG_CHECKING([for Python CPPFLAGS])
3574 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3575 python_config_status=$?
3577 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3578 then
3579 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3580 with_python="no"
3581 else
3582 AC_MSG_RESULT([$python_include_path])
3583 fi
3584 fi
3586 if test "x$with_python" = "xyes"
3587 then
3588 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3589 AC_CHECK_HEADERS(Python.h,
3590 [with_python="yes"],
3591 [with_python="no ('Python.h' not found)"])
3592 fi
3594 if test "x$with_python" = "xyes"
3595 then
3596 AC_MSG_CHECKING([for Python LDFLAGS])
3597 python_library_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0))" | "$with_python_prog" 2>&1`
3598 python_config_status=$?
3600 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3601 then
3602 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3603 with_python="no"
3604 else
3605 AC_MSG_RESULT([$python_library_path])
3606 fi
3607 fi
3609 if test "x$with_python" = "xyes"
3610 then
3611 AC_MSG_CHECKING([for Python LIBS])
3612 python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>&1`
3613 python_config_status=$?
3615 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3616 then
3617 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3618 with_python="no"
3619 else
3620 AC_MSG_RESULT([$python_library_flags])
3621 fi
3622 fi
3624 if test "x$with_python" = "xyes"
3625 then
3626 LDFLAGS="-L$python_library_path $LDFLAGS"
3627 LIBS="$python_library_flags $LIBS"
3629 AC_CHECK_FUNC(PyObject_CallFunction,
3630 [with_python="yes"],
3631 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3632 fi
3634 PATH="$SAVE_PATH"
3635 CPPFLAGS="$SAVE_CPPFLAGS"
3636 LDFLAGS="$SAVE_LDFLAGS"
3637 LIBS="$SAVE_LIBS"
3639 if test "x$with_python" = "xyes"
3640 then
3641 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3642 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3643 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3644 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3645 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3646 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3647 fi
3648 # }}} --with-python
3650 # --with-librabbitmq {{{
3651 with_librabbitmq_cppflags=""
3652 with_librabbitmq_ldflags=""
3653 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3654 [
3655 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3656 then
3657 with_librabbitmq_cppflags="-I$withval/include"
3658 with_librabbitmq_ldflags="-L$withval/lib"
3659 with_librabbitmq="yes"
3660 else
3661 with_librabbitmq="$withval"
3662 fi
3663 ],
3664 [
3665 with_librabbitmq="yes"
3666 ])
3667 SAVE_CPPFLAGS="$CPPFLAGS"
3668 SAVE_LDFLAGS="$LDFLAGS"
3669 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3670 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3671 if test "x$with_librabbitmq" = "xyes"
3672 then
3673 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3674 fi
3675 if test "x$with_librabbitmq" = "xyes"
3676 then
3677 # librabbitmq up to version 0.9.1 provides "library_errno", later
3678 # versions use "library_error". The library does not provide a version
3679 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3680 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3681 [
3682 #if HAVE_STDLIB_H
3683 # include <stdlib.h>
3684 #endif
3685 #if HAVE_STDIO_H
3686 # include <stdio.h>
3687 #endif
3688 #if HAVE_STDINT_H
3689 # include <stdint.h>
3690 #endif
3691 #if HAVE_INTTYPES_H
3692 # include <inttypes.h>
3693 #endif
3694 #include <amqp.h>
3695 ])
3696 fi
3697 if test "x$with_librabbitmq" = "xyes"
3698 then
3699 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3700 fi
3701 if test "x$with_librabbitmq" = "xyes"
3702 then
3703 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3704 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3705 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3706 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3707 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3708 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3709 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3710 fi
3711 CPPFLAGS="$SAVE_CPPFLAGS"
3712 LDFLAGS="$SAVE_LDFLAGS"
3713 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3715 with_amqp_tcp_socket="no"
3716 if test "x$with_librabbitmq" = "xyes"
3717 then
3718 SAVE_CPPFLAGS="$CPPFLAGS"
3719 SAVE_LDFLAGS="$LDFLAGS"
3720 SAVE_LIBS="$LIBS"
3721 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3722 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3723 LIBS="-lrabbitmq"
3725 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
3726 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
3727 if test "x$with_amqp_tcp_socket" = "xyes"
3728 then
3729 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
3730 [Define if librabbitmq provides the new TCP socket interface.])
3731 fi
3733 AC_CHECK_DECLS(amqp_socket_close,
3734 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
3735 [[
3736 #include <amqp.h>
3737 #ifdef HAVE_AMQP_TCP_SOCKET_H
3738 # include <amqp_tcp_socket.h>
3739 #endif
3740 #ifdef HAVE_AMQP_SOCKET_H
3741 # include <amqp_socket.h>
3742 #endif
3743 ]])
3745 CPPFLAGS="$SAVE_CPPFLAGS"
3746 LDFLAGS="$SAVE_LDFLAGS"
3747 LIBS="$SAVE_LIBS"
3748 fi
3749 # }}}
3751 # --with-librouteros {{{
3752 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3753 [
3754 if test "x$withval" = "xyes"
3755 then
3756 with_librouteros="yes"
3757 else if test "x$withval" = "xno"
3758 then
3759 with_librouteros="no"
3760 else
3761 with_librouteros="yes"
3762 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3763 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3764 fi; fi
3765 ],
3766 [with_librouteros="yes"])
3768 SAVE_CPPFLAGS="$CPPFLAGS"
3769 SAVE_LDFLAGS="$LDFLAGS"
3771 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3772 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3774 if test "x$with_librouteros" = "xyes"
3775 then
3776 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3777 then
3778 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3779 fi
3780 AC_CHECK_HEADERS(routeros_api.h,
3781 [with_librouteros="yes"],
3782 [with_librouteros="no (routeros_api.h not found)"])
3783 fi
3784 if test "x$with_librouteros" = "xyes"
3785 then
3786 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3787 then
3788 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3789 fi
3790 AC_CHECK_LIB(routeros, ros_interface,
3791 [with_librouteros="yes"],
3792 [with_librouteros="no (symbol 'ros_interface' not found)"])
3793 fi
3795 CPPFLAGS="$SAVE_CPPFLAGS"
3796 LDFLAGS="$SAVE_LDFLAGS"
3798 if test "x$with_librouteros" = "xyes"
3799 then
3800 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3801 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3802 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3803 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3804 fi
3805 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3806 # }}}
3808 # --with-librrd {{{
3809 librrd_cflags=""
3810 librrd_ldflags=""
3811 librrd_threadsafe="no"
3812 librrd_rrdc_update="no"
3813 AC_ARG_WITH(librrd,
3814 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3815 [
3816 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3817 then
3818 librrd_cflags="-I$withval/include"
3819 librrd_ldflags="-L$withval/lib"
3820 with_librrd="yes"
3821 else
3822 with_librrd="$withval"
3823 fi
3824 ],
3825 [with_librrd="yes"]
3826 )
3828 if test "x$with_librrd" = "xyes"
3829 then
3830 SAVE_LDFLAGS="$LDFLAGS"
3831 LDFLAGS="$LDFLAGS $librrd_ldflags"
3832 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
3833 [
3834 AC_CHECK_LIB([rrd], [rrd_update_r],
3835 [librrd_threadsafe="yes"],
3836 [:]
3837 )
3838 AC_CHECK_LIB([rrd], [rrdc_update],
3839 [librrd_rrdc_update="yes"],
3840 [:]
3841 )
3842 ],[:]
3843 )
3844 LDFLAGS="$SAVE_LDFLAGS"
3846 SAVE_CPPFLAGS="$CPPFLAGS"
3847 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
3849 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
3851 CPPFLAGS="$SAVE_CPPFLAGS"
3852 fi
3854 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
3855 then
3856 SAVE_LDFLAGS="$LDFLAGS"
3857 LDFLAGS="$LDFLAGS $librrd_ldflags"
3859 AC_CHECK_LIB([rrd_th], [rrd_update_r],
3860 [
3861 librrd_ldflags="$librrd_ldflags -lrrd_th"
3862 librrd_threadsafe="yes"
3863 AC_CHECK_LIB([rrd_th], [rrdc_update],
3864 [librrd_rrdc_update="yes"],
3865 [:],
3866 )
3867 ],
3868 [:]
3869 )
3870 LDFLAGS="$SAVE_LDFLAGS"
3871 fi
3873 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
3874 then
3875 SAVE_LDFLAGS="$LDFLAGS"
3876 LDFLAGS="$LDFLAGS $librrd_ldflags"
3878 AC_CHECK_LIB([rrd], [rrd_update],
3879 [
3880 librrd_ldflags="$librrd_ldflags -lrrd"
3881 AC_CHECK_LIB([rrd], [rrdc_update],
3882 [librrd_rrdc_update="yes"],
3883 [:]
3884 )
3885 ],
3886 [with_librrd="no (symbol 'rrd_update' not found)"]
3887 )
3888 LDFLAGS="$SAVE_LDFLAGS"
3889 fi
3891 if test "x$with_librrd" = "xyes"
3892 then
3893 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
3894 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3895 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
3896 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3897 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3898 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
3899 fi
3900 if test "x$librrd_threadsafe" = "xyes"
3901 then
3902 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
3903 [Define to 1 if the rrd library is thread-safe]
3904 )
3905 fi
3906 # }}}
3908 # --with-libsensors {{{
3909 with_sensors_cflags=""
3910 with_sensors_ldflags=""
3911 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3912 [
3913 if test "x$withval" = "xno"
3914 then
3915 with_libsensors="no"
3916 else
3917 with_libsensors="yes"
3918 if test "x$withval" != "xyes"
3919 then
3920 with_sensors_cflags="-I$withval/include"
3921 with_sensors_ldflags="-L$withval/lib"
3922 with_libsensors="yes"
3923 fi
3924 fi
3925 ],
3926 [
3927 if test "x$ac_system" = "xLinux"
3928 then
3929 with_libsensors="yes"
3930 else
3931 with_libsensors="no (Linux only library)"
3932 fi
3933 ])
3934 if test "x$with_libsensors" = "xyes"
3935 then
3936 SAVE_CPPFLAGS="$CPPFLAGS"
3937 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3939 # AC_CHECK_HEADERS(sensors/sensors.h,
3940 # [
3941 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3942 # ],
3943 # [with_libsensors="no (sensors/sensors.h not found)"])
3944 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3946 CPPFLAGS="$SAVE_CPPFLAGS"
3947 fi
3948 if test "x$with_libsensors" = "xyes"
3949 then
3950 SAVE_CPPFLAGS="$CPPFLAGS"
3951 SAVE_LDFLAGS="$LDFLAGS"
3952 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3953 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3955 AC_CHECK_LIB(sensors, sensors_init,
3956 [
3957 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3958 ],
3959 [with_libsensors="no (libsensors not found)"])
3961 CPPFLAGS="$SAVE_CPPFLAGS"
3962 LDFLAGS="$SAVE_LDFLAGS"
3963 fi
3964 if test "x$with_libsensors" = "xyes"
3965 then
3966 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3967 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3968 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3969 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3970 fi
3971 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3972 # }}}
3974 # --with-libsigrok {{{
3975 with_libsigrok_cflags=""
3976 with_libsigrok_ldflags=""
3977 AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
3978 [
3979 if test "x$withval" = "xno"
3980 then
3981 with_libsigrok="no"
3982 else
3983 with_libsigrok="yes"
3984 if test "x$withval" != "xyes"
3985 then
3986 with_libsigrok_cflags="-I$withval/include"
3987 with_libsigrok_ldflags="-L$withval/lib"
3988 fi
3989 fi
3990 ],[with_libsigrok="yes"])
3992 # libsigrok has a glib dependency
3993 if test "x$with_libsigrok" = "xyes"
3994 then
3995 m4_ifdef([AM_PATH_GLIB_2_0],
3996 [
3997 AM_PATH_GLIB_2_0([2.28.0],
3998 [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
3999 ],
4000 [
4001 with_libsigrok="no (glib not available)"
4002 ]
4003 )
4004 fi
4006 # libsigrok headers
4007 if test "x$with_libsigrok" = "xyes"
4008 then
4009 SAVE_CPPFLAGS="$CPPFLAGS"
4010 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
4012 AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
4014 CPPFLAGS="$SAVE_CPPFLAGS"
4015 fi
4017 # libsigrok library
4018 if test "x$with_libsigrok" = "xyes"
4019 then
4020 SAVE_CPPFLAGS="$CPPFLAGS"
4021 SAVE_LDFLAGS="$LDFLAGS"
4022 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
4023 LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
4025 AC_CHECK_LIB(sigrok, sr_init,
4026 [
4027 AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
4028 ],
4029 [with_libsigrok="no (libsigrok not found)"])
4031 CPPFLAGS="$SAVE_CPPFLAGS"
4032 LDFLAGS="$SAVE_LDFLAGS"
4033 fi
4034 if test "x$with_libsigrok" = "xyes"
4035 then
4036 BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
4037 BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
4038 AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
4039 AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
4040 fi
4041 AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
4042 # }}}
4044 # --with-libstatgrab {{{
4045 with_libstatgrab_cflags=""
4046 with_libstatgrab_ldflags=""
4047 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4048 [
4049 if test "x$withval" != "xno" \
4050 && test "x$withval" != "xyes"
4051 then
4052 with_libstatgrab_cflags="-I$withval/include"
4053 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4054 with_libstatgrab="yes"
4055 with_libstatgrab_pkg_config="no"
4056 else
4057 with_libstatgrab="$withval"
4058 with_libstatgrab_pkg_config="yes"
4059 fi
4060 ],
4061 [
4062 with_libstatgrab="yes"
4063 with_libstatgrab_pkg_config="yes"
4064 ])
4066 if test "x$with_libstatgrab" = "xyes" \
4067 && test "x$with_libstatgrab_pkg_config" = "xyes"
4068 then
4069 if test "x$PKG_CONFIG" != "x"
4070 then
4071 AC_MSG_CHECKING([pkg-config for libstatgrab])
4072 temp_result="found"
4073 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4074 if test "$?" != "0"
4075 then
4076 with_libstatgrab_pkg_config="no"
4077 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4078 temp_result="not found"
4079 fi
4080 AC_MSG_RESULT([$temp_result])
4081 else
4082 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
4083 with_libstatgrab_pkg_config="no"
4084 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
4085 fi
4086 fi
4088 if test "x$with_libstatgrab" = "xyes" \
4089 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4090 && test "x$with_libstatgrab_cflags" = "x"
4091 then
4092 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4093 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4094 if test "$?" = "0"
4095 then
4096 with_libstatgrab_cflags="$temp_result"
4097 else
4098 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4099 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4100 fi
4101 AC_MSG_RESULT([$temp_result])
4102 fi
4104 if test "x$with_libstatgrab" = "xyes" \
4105 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4106 && test "x$with_libstatgrab_ldflags" = "x"
4107 then
4108 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4109 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4110 if test "$?" = "0"
4111 then
4112 with_libstatgrab_ldflags="$temp_result"
4113 else
4114 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4115 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4116 fi
4117 AC_MSG_RESULT([$temp_result])
4118 fi
4120 if test "x$with_libstatgrab" = "xyes"
4121 then
4122 SAVE_CPPFLAGS="$CPPFLAGS"
4123 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4125 AC_CHECK_HEADERS(statgrab.h,
4126 [with_libstatgrab="yes"],
4127 [with_libstatgrab="no (statgrab.h not found)"])
4129 CPPFLAGS="$SAVE_CPPFLAGS"
4130 fi
4132 if test "x$with_libstatgrab" = "xyes"
4133 then
4134 SAVE_CFLAGS="$CFLAGS"
4135 SAVE_LDFLAGS="$LDFLAGS"
4137 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4138 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4140 AC_CHECK_LIB(statgrab, sg_init,
4141 [with_libstatgrab="yes"],
4142 [with_libstatgrab="no (symbol sg_init not found)"])
4144 CFLAGS="$SAVE_CFLAGS"
4145 LDFLAGS="$SAVE_LDFLAGS"
4146 fi
4148 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4149 if test "x$with_libstatgrab" = "xyes"
4150 then
4151 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4152 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4153 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4154 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4155 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4156 fi
4157 # }}}
4159 # --with-libtokyotyrant {{{
4160 with_libtokyotyrant_cppflags=""
4161 with_libtokyotyrant_ldflags=""
4162 with_libtokyotyrant_libs=""
4163 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4164 [
4165 if test "x$withval" = "xno"
4166 then
4167 with_libtokyotyrant="no"
4168 else if test "x$withval" = "xyes"
4169 then
4170 with_libtokyotyrant="yes"
4171 else
4172 with_libtokyotyrant_cppflags="-I$withval/include"
4173 with_libtokyotyrant_ldflags="-L$withval/include"
4174 with_libtokyotyrant_libs="-ltokyotyrant"
4175 with_libtokyotyrant="yes"
4176 fi; fi
4177 ],
4178 [
4179 with_libtokyotyrant="yes"
4180 ])
4182 if test "x$with_libtokyotyrant" = "xyes"
4183 then
4184 if $PKG_CONFIG --exists tokyotyrant
4185 then
4186 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4187 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4188 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4189 fi
4190 fi
4192 SAVE_CPPFLAGS="$CPPFLAGS"
4193 SAVE_LDFLAGS="$LDFLAGS"
4194 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4195 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4197 if test "x$with_libtokyotyrant" = "xyes"
4198 then
4199 AC_CHECK_HEADERS(tcrdb.h,
4200 [
4201 AC_DEFINE(HAVE_TCRDB_H, 1,
4202 [Define to 1 if you have the <tcrdb.h> header file.])
4203 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
4204 fi
4206 if test "x$with_libtokyotyrant" = "xyes"
4207 then
4208 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
4209 [
4210 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
4211 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
4212 ],
4213 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
4214 [$with_libtokyotyrant_libs])
4215 fi
4217 CPPFLAGS="$SAVE_CPPFLAGS"
4218 LDFLAGS="$SAVE_LDFLAGS"
4220 if test "x$with_libtokyotyrant" = "xyes"
4221 then
4222 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
4223 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
4224 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
4225 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
4226 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
4227 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
4228 fi
4229 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
4230 # }}}
4232 # --with-libupsclient {{{
4233 with_libupsclient_config=""
4234 with_libupsclient_cflags=""
4235 with_libupsclient_libs=""
4236 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
4237 [
4238 if test "x$withval" = "xno"
4239 then
4240 with_libupsclient="no"
4241 else if test "x$withval" = "xyes"
4242 then
4243 with_libupsclient="use_pkgconfig"
4244 else
4245 if test -x "$withval"
4246 then
4247 with_libupsclient_config="$withval"
4248 with_libupsclient="use_libupsclient_config"
4249 else if test -x "$withval/bin/libupsclient-config"
4250 then
4251 with_libupsclient_config="$withval/bin/libupsclient-config"
4252 with_libupsclient="use_libupsclient_config"
4253 else
4254 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
4255 with_libupsclient_cflags="-I$withval/include"
4256 with_libupsclient_libs="-L$withval/lib -lupsclient"
4257 with_libupsclient="yes"
4258 fi; fi
4259 fi; fi
4260 ],
4261 [with_libupsclient="use_pkgconfig"])
4263 # configure using libupsclient-config
4264 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4265 then
4266 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
4267 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
4268 if test $? -ne 0
4269 then
4270 with_libupsclient="no ($with_libupsclient_config failed)"
4271 fi
4272 with_libupsclient_libs="`$with_libupsclient_config --libs`"
4273 if test $? -ne 0
4274 then
4275 with_libupsclient="no ($with_libupsclient_config failed)"
4276 fi
4277 fi
4278 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4279 then
4280 with_libupsclient="yes"
4281 fi
4283 # configure using pkg-config
4284 if test "x$with_libupsclient" = "xuse_pkgconfig"
4285 then
4286 if test "x$PKG_CONFIG" = "x"
4287 then
4288 with_libupsclient="no (Don't have pkg-config)"
4289 fi
4290 fi
4291 if test "x$with_libupsclient" = "xuse_pkgconfig"
4292 then
4293 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4294 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4295 if test $? -ne 0
4296 then
4297 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4298 fi
4299 fi
4300 if test "x$with_libupsclient" = "xuse_pkgconfig"
4301 then
4302 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4303 if test $? -ne 0
4304 then
4305 with_libupsclient="no ($PKG_CONFIG failed)"
4306 fi
4307 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4308 if test $? -ne 0
4309 then
4310 with_libupsclient="no ($PKG_CONFIG failed)"
4311 fi
4312 fi
4313 if test "x$with_libupsclient" = "xuse_pkgconfig"
4314 then
4315 with_libupsclient="yes"
4316 fi
4318 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4319 # the actual checks.
4320 if test "x$with_libupsclient" = "xyes"
4321 then
4322 SAVE_CPPFLAGS="$CPPFLAGS"
4323 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4325 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4327 CPPFLAGS="$SAVE_CPPFLAGS"
4328 fi
4329 if test "x$with_libupsclient" = "xyes"
4330 then
4331 SAVE_CPPFLAGS="$CPPFLAGS"
4332 SAVE_LDFLAGS="$LDFLAGS"
4334 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4335 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4337 AC_CHECK_LIB(upsclient, upscli_connect,
4338 [with_libupsclient="yes"],
4339 [with_libupsclient="no (symbol upscli_connect not found)"])
4341 CPPFLAGS="$SAVE_CPPFLAGS"
4342 LDFLAGS="$SAVE_LDFLAGS"
4343 fi
4344 if test "x$with_libupsclient" = "xyes"
4345 then
4346 SAVE_CPPFLAGS="$CPPFLAGS"
4347 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4349 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4350 [#include <stdlib.h>
4351 #include <stdio.h>
4352 #include <upsclient.h>])
4354 CPPFLAGS="$SAVE_CPPFLAGS"
4355 fi
4356 if test "x$with_libupsclient" = "xyes"
4357 then
4358 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4359 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4360 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4361 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4362 fi
4363 # }}}
4365 # --with-libxmms {{{
4366 with_xmms_config="xmms-config"
4367 with_xmms_cflags=""
4368 with_xmms_libs=""
4369 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4370 [
4371 if test "x$withval" != "xno" \
4372 && test "x$withval" != "xyes"
4373 then
4374 if test -f "$withval" && test -x "$withval";
4375 then
4376 with_xmms_config="$withval"
4377 else if test -x "$withval/bin/xmms-config"
4378 then
4379 with_xmms_config="$withval/bin/xmms-config"
4380 fi; fi
4381 with_libxmms="yes"
4382 else if test "x$withval" = "xno"
4383 then
4384 with_libxmms="no"
4385 else
4386 with_libxmms="yes"
4387 fi; fi
4388 ],
4389 [
4390 with_libxmms="yes"
4391 ])
4392 if test "x$with_libxmms" = "xyes"
4393 then
4394 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4395 xmms_config_status=$?
4397 if test $xmms_config_status -ne 0
4398 then
4399 with_libxmms="no"
4400 fi
4401 fi
4402 if test "x$with_libxmms" = "xyes"
4403 then
4404 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4405 xmms_config_status=$?
4407 if test $xmms_config_status -ne 0
4408 then
4409 with_libxmms="no"
4410 fi
4411 fi
4412 if test "x$with_libxmms" = "xyes"
4413 then
4414 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4415 [
4416 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4417 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4418 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4419 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4420 ],
4421 [
4422 with_libxmms="no"
4423 ],
4424 [$with_xmms_libs])
4425 fi
4426 with_libxmms_numeric=0
4427 if test "x$with_libxmms" = "xyes"
4428 then
4429 with_libxmms_numeric=1
4430 fi
4431 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4432 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4433 # }}}
4435 # --with-libyajl {{{
4436 with_libyajl_cppflags=""
4437 with_libyajl_ldflags=""
4438 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4439 [
4440 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4441 then
4442 with_libyajl_cppflags="-I$withval/include"
4443 with_libyajl_ldflags="-L$withval/lib"
4444 with_libyajl="yes"
4445 else
4446 with_libyajl="$withval"
4447 fi
4448 ],
4449 [
4450 with_libyajl="yes"
4451 ])
4452 if test "x$with_libyajl" = "xyes"
4453 then
4454 SAVE_CPPFLAGS="$CPPFLAGS"
4455 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4457 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4458 AC_CHECK_HEADERS(yajl/yajl_version.h)
4460 CPPFLAGS="$SAVE_CPPFLAGS"
4461 fi
4462 if test "x$with_libyajl" = "xyes"
4463 then
4464 SAVE_CPPFLAGS="$CPPFLAGS"
4465 SAVE_LDFLAGS="$LDFLAGS"
4466 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4467 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4469 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4471 CPPFLAGS="$SAVE_CPPFLAGS"
4472 LDFLAGS="$SAVE_LDFLAGS"
4473 fi
4474 if test "x$with_libyajl" = "xyes"
4475 then
4476 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4477 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4478 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4479 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4480 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4481 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4482 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4483 fi
4484 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4485 # }}}
4487 # --with-mic {{{
4488 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
4489 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
4490 with_mic_libs=""
4491 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
4492 [
4493 if test "x$withval" = "xno"
4494 then
4495 with_mic="no"
4496 else if test "x$withval" = "xyes"
4497 then
4498 with_mic="yes"
4499 else if test -d "$with_mic/lib"
4500 then
4501 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
4502 with_mic_cflags="-I$withval/include"
4503 with_mic_ldpath="-L$withval/lib/Linux"
4504 with_mic_libs="-lMicAccessSDK -lscif -lpthread"
4505 with_mic="yes"
4506 fi; fi; fi
4507 ],
4508 [with_mic="yes"])
4509 if test "x$with_mic" = "xyes"
4510 then
4511 SAVE_CPPFLAGS="$CPPFLAGS"
4512 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4513 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
4514 CPPFLAGS="$SAVE_CPPFLAGS"
4515 fi
4516 if test "x$with_mic" = "xyes"
4517 then
4518 SAVE_CPPFLAGS="$CPPFLAGS"
4519 SAVE_LDFLAGS="$LDFLAGS"
4521 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4522 LDFLAGS="$LDFLAGS $with_mic_ldpath"
4524 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
4525 [with_mic_ldpath="$with_mic_ldpath"
4526 with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
4527 [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
4529 CPPFLAGS="$SAVE_CPPFLAGS"
4530 LDFLAGS="$SAVE_LDFLAGS"
4531 fi
4533 if test "x$with_mic" = "xyes"
4534 then
4535 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
4536 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
4537 BUILD_WITH_MIC_LDADD="$with_mic_libs"
4538 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
4539 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
4540 AC_SUBST(BUILD_WITH_MIC_LDADD)
4541 fi
4542 #}}}
4544 # --with-libvarnish {{{
4545 with_libvarnish_cppflags=""
4546 with_libvarnish_cflags=""
4547 with_libvarnish_libs=""
4548 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4549 [
4550 if test "x$withval" = "xno"
4551 then
4552 with_libvarnish="no"
4553 else if test "x$withval" = "xyes"
4554 then
4555 with_libvarnish="use_pkgconfig"
4556 else if test -d "$with_libvarnish/lib"
4557 then
4558 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4559 with_libvarnish_cflags="-I$withval/include"
4560 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4561 with_libvarnish="yes"
4562 fi; fi; fi
4563 ],
4564 [with_libvarnish="use_pkgconfig"])
4566 # configure using pkg-config
4567 if test "x$with_libvarnish" = "xuse_pkgconfig"
4568 then
4569 if test "x$PKG_CONFIG" = "x"
4570 then
4571 with_libvarnish="no (Don't have pkg-config)"
4572 fi
4573 fi
4574 if test "x$with_libvarnish" = "xuse_pkgconfig"
4575 then
4576 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4577 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4578 if test $? -ne 0
4579 then
4580 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4581 fi
4582 fi
4583 if test "x$with_libvarnish" = "xuse_pkgconfig"
4584 then
4585 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4586 if test $? -ne 0
4587 then
4588 with_libvarnish="no ($PKG_CONFIG failed)"
4589 fi
4590 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4591 if test $? -ne 0
4592 then
4593 with_libvarnish="no ($PKG_CONFIG failed)"
4594 fi
4595 fi
4596 if test "x$with_libvarnish" = "xuse_pkgconfig"
4597 then
4598 with_libvarnish="yes"
4599 fi
4601 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4602 # the actual checks.
4603 if test "x$with_libvarnish" = "xyes"
4604 then
4605 SAVE_CPPFLAGS="$CPPFLAGS"
4606 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4607 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4609 CPPFLAGS="$SAVE_CPPFLAGS"
4610 fi
4611 if test "x$with_libvarnish" = "xyes"
4612 then
4613 SAVE_CPPFLAGS="$CPPFLAGS"
4614 #SAVE_LDFLAGS="$LDFLAGS"
4616 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4617 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4619 AC_CHECK_HEADERS(varnish/vsc.h,
4620 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4621 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4623 CPPFLAGS="$SAVE_CPPFLAGS"
4624 #LDFLAGS="$SAVE_LDFLAGS"
4625 fi
4626 if test "x$with_libvarnish" = "xyes"
4627 then
4628 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4629 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4630 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4631 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4632 fi
4633 # }}}
4635 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4636 with_libxml2="no (pkg-config isn't available)"
4637 with_libxml2_cflags=""
4638 with_libxml2_ldflags=""
4639 with_libvirt="no (pkg-config isn't available)"
4640 with_libvirt_cflags=""
4641 with_libvirt_ldflags=""
4642 if test "x$PKG_CONFIG" != "x"
4643 then
4644 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
4645 if test "$?" = "0"
4646 then
4647 with_libxml2="yes"
4648 else
4649 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4650 fi
4652 $PKG_CONFIG --exists libvirt 2>/dev/null
4653 if test "$?" = "0"
4654 then
4655 with_libvirt="yes"
4656 else
4657 with_libvirt="no (pkg-config doesn't know libvirt)"
4658 fi
4659 fi
4660 if test "x$with_libxml2" = "xyes"
4661 then
4662 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
4663 if test $? -ne 0
4664 then
4665 with_libxml2="no"
4666 fi
4667 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
4668 if test $? -ne 0
4669 then
4670 with_libxml2="no"
4671 fi
4672 fi
4673 if test "x$with_libxml2" = "xyes"
4674 then
4675 SAVE_CPPFLAGS="$CPPFLAGS"
4676 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4678 AC_CHECK_HEADERS(libxml/parser.h, [],
4679 [with_libxml2="no (libxml/parser.h not found)"])
4681 CPPFLAGS="$SAVE_CPPFLAGS"
4682 fi
4683 if test "x$with_libxml2" = "xyes"
4684 then
4685 SAVE_CFLAGS="$CFLAGS"
4686 SAVE_LDFLAGS="$LDFLAGS"
4688 CFLAGS="$CFLAGS $with_libxml2_cflags"
4689 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4691 AC_CHECK_LIB(xml2, xmlXPathEval,
4692 [with_libxml2="yes"],
4693 [with_libxml2="no (symbol xmlXPathEval not found)"])
4695 CFLAGS="$SAVE_CFLAGS"
4696 LDFLAGS="$SAVE_LDFLAGS"
4697 fi
4698 dnl Add the right compiler flags and libraries.
4699 if test "x$with_libxml2" = "xyes"; then
4700 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4701 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4702 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4703 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4704 fi
4705 if test "x$with_libvirt" = "xyes"
4706 then
4707 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
4708 if test $? -ne 0
4709 then
4710 with_libvirt="no"
4711 fi
4712 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
4713 if test $? -ne 0
4714 then
4715 with_libvirt="no"
4716 fi
4717 fi
4718 if test "x$with_libvirt" = "xyes"
4719 then
4720 SAVE_CPPFLAGS="$CPPFLAGS"
4721 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4723 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4724 [with_libvirt="no (libvirt/libvirt.h not found)"])
4726 CPPFLAGS="$SAVE_CPPFLAGS"
4727 fi
4728 if test "x$with_libvirt" = "xyes"
4729 then
4730 SAVE_CFLAGS="$CFLAGS"
4731 SAVE_LDFLAGS="$LDFLAGS"
4733 CFLAGS="$CFLAGS $with_libvirt_cflags"
4734 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4736 AC_CHECK_LIB(virt, virDomainBlockStats,
4737 [with_libvirt="yes"],
4738 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4740 CFLAGS="$SAVE_CFLAGS"
4741 LDFLAGS="$SAVE_LDFLAGS"
4742 fi
4743 dnl Add the right compiler flags and libraries.
4744 if test "x$with_libvirt" = "xyes"; then
4745 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4746 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4747 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4748 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4749 fi
4750 # }}}
4752 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4753 with_libopenipmipthread="yes"
4754 with_libopenipmipthread_cflags=""
4755 with_libopenipmipthread_libs=""
4757 AC_MSG_CHECKING([for pkg-config])
4758 temp_result="no"
4759 if test "x$PKG_CONFIG" = "x"
4760 then
4761 with_libopenipmipthread="no"
4762 temp_result="no"
4763 else
4764 temp_result="$PKG_CONFIG"
4765 fi
4766 AC_MSG_RESULT([$temp_result])
4768 if test "x$with_libopenipmipthread" = "xyes"
4769 then
4770 AC_MSG_CHECKING([for libOpenIPMIpthread])
4771 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4772 if test "$?" != "0"
4773 then
4774 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4775 fi
4776 AC_MSG_RESULT([$with_libopenipmipthread])
4777 fi
4779 if test "x$with_libopenipmipthread" = "xyes"
4780 then
4781 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4782 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4783 if test "$?" = "0"
4784 then
4785 with_libopenipmipthread_cflags="$temp_result"
4786 else
4787 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4788 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4789 fi
4790 AC_MSG_RESULT([$temp_result])
4791 fi
4793 if test "x$with_libopenipmipthread" = "xyes"
4794 then
4795 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4796 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4797 if test "$?" = "0"
4798 then
4799 with_libopenipmipthread_ldflags="$temp_result"
4800 else
4801 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4802 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4803 fi
4804 AC_MSG_RESULT([$temp_result])
4805 fi
4807 if test "x$with_libopenipmipthread" = "xyes"
4808 then
4809 SAVE_CPPFLAGS="$CPPFLAGS"
4810 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4812 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4813 [with_libopenipmipthread="yes"],
4814 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4815 [#include <OpenIPMI/ipmiif.h>
4816 #include <OpenIPMI/ipmi_err.h>
4817 #include <OpenIPMI/ipmi_posix.h>
4818 #include <OpenIPMI/ipmi_conn.h>
4819 ])
4821 CPPFLAGS="$SAVE_CPPFLAGS"
4822 fi
4824 if test "x$with_libopenipmipthread" = "xyes"
4825 then
4826 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4827 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4828 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4829 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4830 fi
4831 # }}}
4833 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4834 [with_libnotify="yes"],
4835 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4836 with_libnotify="no"
4837 else
4838 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4839 fi])
4841 # Check for enabled/disabled features
4842 #
4844 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4845 # ------------------------------------------------------------
4846 dnl
4847 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4848 dnl
4849 AC_DEFUN(
4850 [AC_COLLECTD],
4851 [
4852 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4853 m4_if(
4854 [$2],
4855 [enable],
4856 [dnl
4857 m4_define([EnDis],[disabled])dnl
4858 m4_define([YesNo],[no])dnl
4859 ],dnl
4860 [m4_if(
4861 [$2],
4862 [disable],
4863 [dnl
4864 m4_define([EnDis],[enabled])dnl
4865 m4_define([YesNo],[yes])dnl
4866 ],
4867 [dnl
4868 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4869 ]dnl
4870 )]dnl
4871 )dnl
4872 m4_if([$3], [feature], [],
4873 [m4_if(
4874 [$3], [module], [],
4875 [dnl
4876 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4877 ]dnl
4878 )]dnl
4879 )dnl
4880 AC_ARG_ENABLE(
4881 [$1],
4882 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4883 [],
4884 enable_$1='[YesNo]'dnl
4885 )# AC_ARG_ENABLE
4886 if test "x$enable_$1" = "xno"
4887 then
4888 collectd_$1=0
4889 else
4890 if test "x$enable_$1" = "xyes"
4891 then
4892 collectd_$1=1
4893 else
4894 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4895 collectd_$1=1
4896 enable_$1='yes'
4897 fi
4898 fi
4899 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4900 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4901 ]dnl
4902 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4904 # AC_PLUGIN(name, default, info)
4905 # ------------------------------------------------------------
4906 dnl
4907 AC_DEFUN(
4908 [AC_PLUGIN],
4909 [
4910 enable_plugin="no"
4911 force="no"
4912 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
4913 [
4914 if test "x$enableval" = "xyes"
4915 then
4916 enable_plugin="yes"
4917 else if test "x$enableval" = "xforce"
4918 then
4919 enable_plugin="yes"
4920 force="yes"
4921 else
4922 enable_plugin="no (disabled on command line)"
4923 fi; fi
4924 ],
4925 [
4926 if test "x$enable_all_plugins" = "xauto"
4927 then
4928 if test "x$2" = "xyes"
4929 then
4930 enable_plugin="yes"
4931 else
4932 enable_plugin="no"
4933 fi
4934 else
4935 enable_plugin="$enable_all_plugins"
4936 fi
4937 ])
4938 if test "x$enable_plugin" = "xyes"
4939 then
4940 if test "x$2" = "xyes" || test "x$force" = "xyes"
4941 then
4942 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4943 if test "x$2" != "xyes"
4944 then
4945 dependency_warning="yes"
4946 fi
4947 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4948 dependency_error="yes"
4949 enable_plugin="no (dependency error)"
4950 fi
4951 fi
4952 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4953 enable_$1="$enable_plugin"
4954 ]
4955 )# AC_PLUGIN(name, default, info)
4957 m4_divert_once([HELP_ENABLE], [
4958 collectd features:])
4959 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4960 AC_COLLECTD([debug], [enable], [feature], [debugging])
4961 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4962 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4964 dependency_warning="no"
4965 dependency_error="no"
4967 plugin_ascent="no"
4968 plugin_battery="no"
4969 plugin_bind="no"
4970 plugin_cgroups="no"
4971 plugin_conntrack="no"
4972 plugin_contextswitch="no"
4973 plugin_cpu="no"
4974 plugin_cpufreq="no"
4975 plugin_curl_json="no"
4976 plugin_curl_xml="no"
4977 plugin_df="no"
4978 plugin_disk="no"
4979 plugin_entropy="no"
4980 plugin_ethstat="no"
4981 plugin_fscache="no"
4982 plugin_interface="no"
4983 plugin_ipmi="no"
4984 plugin_ipvs="no"
4985 plugin_irq="no"
4986 plugin_libvirt="no"
4987 plugin_load="no"
4988 plugin_memory="no"
4989 plugin_multimeter="no"
4990 plugin_nfs="no"
4991 plugin_numa="no"
4992 plugin_perl="no"
4993 plugin_processes="no"
4994 plugin_protocols="no"
4995 plugin_serial="no"
4996 plugin_swap="no"
4997 plugin_tape="no"
4998 plugin_tcpconns="no"
4999 plugin_ted="no"
5000 plugin_thermal="no"
5001 plugin_users="no"
5002 plugin_uptime="no"
5003 plugin_vmem="no"
5004 plugin_vserver="no"
5005 plugin_wireless="no"
5006 plugin_zfs_arc="no"
5008 # Linux
5009 if test "x$ac_system" = "xLinux"
5010 then
5011 plugin_battery="yes"
5012 plugin_conntrack="yes"
5013 plugin_contextswitch="yes"
5014 plugin_cgroups="yes"
5015 plugin_cpu="yes"
5016 plugin_cpufreq="yes"
5017 plugin_disk="yes"
5018 plugin_entropy="yes"
5019 plugin_fscache="yes"
5020 plugin_interface="yes"
5021 plugin_irq="yes"
5022 plugin_load="yes"
5023 plugin_lvm="yes"
5024 plugin_memory="yes"
5025 plugin_nfs="yes"
5026 plugin_numa="yes"
5027 plugin_processes="yes"
5028 plugin_protocols="yes"
5029 plugin_serial="yes"
5030 plugin_swap="yes"
5031 plugin_tcpconns="yes"
5032 plugin_thermal="yes"
5033 plugin_uptime="yes"
5034 plugin_vmem="yes"
5035 plugin_vserver="yes"
5036 plugin_wireless="yes"
5038 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
5039 then
5040 plugin_ipvs="yes"
5041 fi
5042 fi
5044 if test "x$ac_system" = "xOpenBSD"
5045 then
5046 plugin_tcpconns="yes"
5047 fi
5049 # Mac OS X devices
5050 if test "x$with_libiokit" = "xyes"
5051 then
5052 plugin_battery="yes"
5053 plugin_disk="yes"
5054 fi
5056 # AIX
5058 if test "x$ac_system" = "xAIX"
5059 then
5060 plugin_tcpconns="yes"
5061 fi
5063 # FreeBSD
5065 if test "x$ac_system" = "xFreeBSD"
5066 then
5067 plugin_zfs_arc="yes"
5068 fi
5071 if test "x$with_perfstat" = "xyes"
5072 then
5073 plugin_cpu="yes"
5074 plugin_contextswitch="yes"
5075 plugin_disk="yes"
5076 plugin_memory="yes"
5077 plugin_swap="yes"
5078 plugin_interface="yes"
5079 plugin_load="yes"
5080 plugin_uptime="yes"
5081 fi
5083 if test "x$with_procinfo" = "xyes"
5084 then
5085 plugin_processes="yes"
5086 fi
5088 # Solaris
5089 if test "x$with_kstat" = "xyes"
5090 then
5091 plugin_nfs="yes"
5092 plugin_processes="yes"
5093 plugin_uptime="yes"
5094 plugin_zfs_arc="yes"
5095 fi
5097 if test "x$with_devinfo$with_kstat" = "xyesyes"
5098 then
5099 plugin_cpu="yes"
5100 plugin_disk="yes"
5101 plugin_interface="yes"
5102 plugin_memory="yes"
5103 plugin_tape="yes"
5104 fi
5106 # libstatgrab
5107 if test "x$with_libstatgrab" = "xyes"
5108 then
5109 plugin_cpu="yes"
5110 plugin_disk="yes"
5111 plugin_interface="yes"
5112 plugin_load="yes"
5113 plugin_memory="yes"
5114 plugin_swap="yes"
5115 plugin_users="yes"
5116 fi
5118 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5119 then
5120 plugin_ascent="yes"
5121 if test "x$have_strptime" = "xyes"
5122 then
5123 plugin_bind="yes"
5124 fi
5125 fi
5127 if test "x$with_libopenipmipthread" = "xyes"
5128 then
5129 plugin_ipmi="yes"
5130 fi
5132 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
5133 then
5134 plugin_curl_json="yes"
5135 fi
5137 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5138 then
5139 plugin_curl_xml="yes"
5140 fi
5142 if test "x$have_processor_info" = "xyes"
5143 then
5144 plugin_cpu="yes"
5145 fi
5146 if test "x$have_sysctl" = "xyes"
5147 then
5148 plugin_cpu="yes"
5149 plugin_memory="yes"
5150 plugin_uptime="yes"
5151 if test "x$ac_system" = "xDarwin"
5152 then
5153 plugin_swap="yes"
5154 fi
5155 fi
5156 if test "x$have_sysctlbyname" = "xyes"
5157 then
5158 plugin_contextswitch="yes"
5159 plugin_cpu="yes"
5160 plugin_memory="yes"
5161 plugin_tcpconns="yes"
5162 fi
5164 # Df plugin: Check if we know how to determine mount points first.
5165 #if test "x$have_listmntent" = "xyes"; then
5166 # plugin_df="yes"
5167 #fi
5168 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
5169 then
5170 plugin_df="yes"
5171 fi
5172 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
5173 then
5174 plugin_df="yes"
5175 fi
5176 #if test "x$have_getmntent" = "xseq"
5177 #then
5178 # plugin_df="yes"
5179 #fi
5180 if test "x$c_cv_have_one_getmntent" = "xyes"
5181 then
5182 plugin_df="yes"
5183 fi
5185 if test "x$c_cv_have_getmntent_r" = "xyes"
5186 then
5187 plugin_df="yes"
5188 fi
5190 # Df plugin: Check if we have either `statfs' or `statvfs' second.
5191 if test "x$plugin_df" = "xyes"
5192 then
5193 plugin_df="no"
5194 if test "x$have_statfs" = "xyes"
5195 then
5196 plugin_df="yes"
5197 fi
5198 if test "x$have_statvfs" = "xyes"
5199 then
5200 plugin_df="yes"
5201 fi
5202 fi
5204 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
5205 then
5206 plugin_ethstat="yes"
5207 fi
5209 if test "x$have_getifaddrs" = "xyes"
5210 then
5211 plugin_interface="yes"
5212 fi
5214 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
5215 then
5216 plugin_libvirt="yes"
5217 fi
5219 if test "x$have_getloadavg" = "xyes"
5220 then
5221 plugin_load="yes"
5222 fi
5224 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
5225 then
5226 plugin_perl="yes"
5227 fi
5229 # Mac OS X memory interface
5230 if test "x$have_host_statistics" = "xyes"
5231 then
5232 plugin_memory="yes"
5233 fi
5235 if test "x$have_termios_h" = "xyes"
5236 then
5237 plugin_multimeter="yes"
5238 plugin_ted="yes"
5239 fi
5241 if test "x$have_thread_info" = "xyes"
5242 then
5243 plugin_processes="yes"
5244 fi
5246 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
5247 then
5248 plugin_processes="yes"
5249 fi
5251 if test "x$with_kvm_getswapinfo" = "xyes"
5252 then
5253 plugin_swap="yes"
5254 fi
5256 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
5257 then
5258 plugin_swap="yes"
5259 fi
5261 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
5262 then
5263 plugin_tcpconns="yes"
5264 fi
5266 if test "x$have_getutent" = "xyes"
5267 then
5268 plugin_users="yes"
5269 fi
5270 if test "x$have_getutxent" = "xyes"
5271 then
5272 plugin_users="yes"
5273 fi
5275 m4_divert_once([HELP_ENABLE], [
5276 collectd plugins:])
5278 AC_ARG_ENABLE([all-plugins],
5279 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
5280 [
5281 if test "x$enableval" = "xyes"
5282 then
5283 enable_all_plugins="yes"
5284 else if test "x$enableval" = "xauto"
5285 then
5286 enable_all_plugins="auto"
5287 else
5288 enable_all_plugins="no"
5289 fi; fi
5290 ],
5291 [enable_all_plugins="auto"])
5293 m4_divert_once([HELP_ENABLE], [])
5295 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
5296 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
5297 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
5298 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
5299 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
5300 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero's hardware sensors])
5301 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
5302 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
5303 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
5304 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
5305 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
5306 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
5307 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
5308 AC_PLUGIN([csv], [yes], [CSV output plugin])
5309 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
5310 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
5311 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
5312 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
5313 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
5314 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
5315 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
5316 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
5317 AC_PLUGIN([email], [yes], [EMail statistics])
5318 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
5319 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
5320 AC_PLUGIN([exec], [yes], [Execution of external programs])
5321 AC_PLUGIN([filecount], [yes], [Count files in directories])
5322 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
5323 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
5324 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
5325 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
5326 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
5327 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
5328 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
5329 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
5330 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
5331 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
5332 AC_PLUGIN([load], [$plugin_load], [System load])
5333 AC_PLUGIN([logfile], [yes], [File logging plugin])
5334 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
5335 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
5336 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
5337 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
5338 AC_PLUGIN([match_hashed], [yes], [The hashed match])
5339 AC_PLUGIN([match_regex], [yes], [The regex match])
5340 AC_PLUGIN([match_timediff], [yes], [The timediff match])
5341 AC_PLUGIN([match_value], [yes], [The value match])
5342 AC_PLUGIN([mbmon], [yes], [Query mbmond])
5343 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
5344 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
5345 AC_PLUGIN([memcached], [yes], [memcached statistics])
5346 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
5347 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
5348 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
5349 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
5350 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
5351 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
5352 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
5353 AC_PLUGIN([network], [yes], [Network communication plugin])
5354 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5355 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5356 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5357 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5358 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5359 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5360 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5361 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5362 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5363 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5364 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5365 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5366 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5367 # FIXME: Check for libevent, too.
5368 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5369 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5370 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5371 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5372 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5373 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5374 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5375 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5376 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5377 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5378 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5379 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5380 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5381 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
5382 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5383 AC_PLUGIN([statsd], [yes], [StatsD plugin])
5384 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5385 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5386 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5387 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5388 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5389 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5390 AC_PLUGIN([target_notification], [yes], [The notification target])
5391 AC_PLUGIN([target_replace], [yes], [The replace target])
5392 AC_PLUGIN([target_scale],[yes], [The scale target])
5393 AC_PLUGIN([target_set], [yes], [The set target])
5394 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5395 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5396 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5397 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5398 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5399 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5400 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5401 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5402 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5403 AC_PLUGIN([users], [$plugin_users], [User statistics])
5404 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5405 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5406 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5407 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5408 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5409 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5410 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5411 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5412 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5413 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5414 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5415 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5417 dnl Default configuration file
5418 # Load either syslog or logfile
5419 LOAD_PLUGIN_SYSLOG=""
5420 LOAD_PLUGIN_LOGFILE=""
5422 AC_MSG_CHECKING([which default log plugin to load])
5423 default_log_plugin="none"
5424 if test "x$enable_syslog" = "xyes"
5425 then
5426 default_log_plugin="syslog"
5427 else
5428 LOAD_PLUGIN_SYSLOG="##"
5429 fi
5431 if test "x$enable_logfile" = "xyes"
5432 then
5433 if test "x$default_log_plugin" = "xnone"
5434 then
5435 default_log_plugin="logfile"
5436 else
5437 LOAD_PLUGIN_LOGFILE="#"
5438 fi
5439 else
5440 LOAD_PLUGIN_LOGFILE="##"
5441 fi
5442 AC_MSG_RESULT([$default_log_plugin])
5444 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5445 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5447 DEFAULT_LOG_LEVEL="info"
5448 if test "x$enable_debug" = "xyes"
5449 then
5450 DEFAULT_LOG_LEVEL="debug"
5451 fi
5452 AC_SUBST(DEFAULT_LOG_LEVEL)
5454 # Load only one of rrdtool, network, csv in the default config.
5455 LOAD_PLUGIN_RRDTOOL=""
5456 LOAD_PLUGIN_NETWORK=""
5457 LOAD_PLUGIN_CSV=""
5459 AC_MSG_CHECKING([which default write plugin to load])
5460 default_write_plugin="none"
5461 if test "x$enable_rrdtool" = "xyes"
5462 then
5463 default_write_plugin="rrdtool"
5464 else
5465 LOAD_PLUGIN_RRDTOOL="##"
5466 fi
5468 if test "x$enable_network" = "xyes"
5469 then
5470 if test "x$default_write_plugin" = "xnone"
5471 then
5472 default_write_plugin="network"
5473 else
5474 LOAD_PLUGIN_NETWORK="#"
5475 fi
5476 else
5477 LOAD_PLUGIN_NETWORK="##"
5478 fi
5480 if test "x$enable_csv" = "xyes"
5481 then
5482 if test "x$default_write_plugin" = "xnone"
5483 then
5484 default_write_plugin="csv"
5485 else
5486 LOAD_PLUGIN_CSV="#"
5487 fi
5488 else
5489 LOAD_PLUGIN_CSV="##"
5490 fi
5491 AC_MSG_RESULT([$default_write_plugin])
5493 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5494 AC_SUBST(LOAD_PLUGIN_NETWORK)
5495 AC_SUBST(LOAD_PLUGIN_CSV)
5497 dnl ip_vs.h
5498 if test "x$ac_system" = "xLinux" \
5499 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5500 then
5501 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5502 fi
5504 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5505 then
5506 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5507 fi
5509 dnl Perl bindings
5510 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
5511 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5512 [
5513 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5514 then
5515 PERL_BINDINGS_OPTIONS="$withval"
5516 with_perl_bindings="yes"
5517 else
5518 with_perl_bindings="$withval"
5519 fi
5520 ],
5521 [
5522 if test -n "$perl_interpreter"
5523 then
5524 with_perl_bindings="yes"
5525 else
5526 with_perl_bindings="no (no perl interpreter found)"
5527 fi
5528 ])
5529 if test "x$with_perl_bindings" = "xyes"
5530 then
5531 PERL_BINDINGS="perl"
5532 else
5533 PERL_BINDINGS=""
5534 fi
5535 AC_SUBST(PERL_BINDINGS)
5536 AC_SUBST(PERL_BINDINGS_OPTIONS)
5538 dnl libcollectdclient
5539 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5540 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5541 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5543 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5545 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5547 AC_SUBST(LCC_VERSION_MAJOR)
5548 AC_SUBST(LCC_VERSION_MINOR)
5549 AC_SUBST(LCC_VERSION_PATCH)
5550 AC_SUBST(LCC_VERSION_EXTRA)
5551 AC_SUBST(LCC_VERSION_STRING)
5553 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5555 AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
5556 AC_OUTPUT
5558 if test "x$with_librrd" = "xyes" \
5559 && test "x$librrd_threadsafe" != "xyes"
5560 then
5561 with_librrd="yes (warning: librrd is not thread-safe)"
5562 fi
5564 if test "x$with_libperl" = "xyes"
5565 then
5566 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5567 else
5568 enable_perl="no (needs libperl)"
5569 fi
5571 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5572 then
5573 enable_perl="no (libperl doesn't support ithreads)"
5574 fi
5576 if test "x$with_perl_bindings" = "xyes" \
5577 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5578 then
5579 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5580 fi
5582 cat <<EOF;
5584 Configuration:
5585 Libraries:
5586 intel mic . . . . . . $with_mic
5587 libaquaero5 . . . . . $with_libaquaero5
5588 libcredis . . . . . . $with_libcredis
5589 libcurl . . . . . . . $with_libcurl
5590 libdbi . . . . . . . $with_libdbi
5591 libesmtp . . . . . . $with_libesmtp
5592 libganglia . . . . . $with_libganglia
5593 libgcrypt . . . . . . $with_libgcrypt
5594 libhal . . . . . . . $with_libhal
5595 libiokit . . . . . . $with_libiokit
5596 libiptc . . . . . . . $with_libiptc
5597 libjvm . . . . . . . $with_java
5598 libkstat . . . . . . $with_kstat
5599 libkvm . . . . . . . $with_libkvm
5600 liblvm2app . . . . . $with_liblvm2app
5601 libmemcached . . . . $with_libmemcached
5602 libmnl . . . . . . . $with_libmnl
5603 libmodbus . . . . . . $with_libmodbus
5604 libmongoc . . . . . . $with_libmongoc
5605 libmysql . . . . . . $with_libmysql
5606 libnetapp . . . . . . $with_libnetapp
5607 libnetsnmp . . . . . $with_libnetsnmp
5608 libnotify . . . . . . $with_libnotify
5609 liboconfig . . . . . $with_liboconfig
5610 libopenipmi . . . . . $with_libopenipmipthread
5611 liboping . . . . . . $with_liboping
5612 libowcapi . . . . . . $with_libowcapi
5613 libpcap . . . . . . . $with_libpcap
5614 libperfstat . . . . . $with_perfstat
5615 libperl . . . . . . . $with_libperl
5616 libpq . . . . . . . . $with_libpq
5617 libpthread . . . . . $with_libpthread
5618 librabbitmq . . . . . $with_librabbitmq
5619 librouteros . . . . . $with_librouteros
5620 librrd . . . . . . . $with_librrd
5621 libsensors . . . . . $with_libsensors
5622 libsigrok . . . . . $with_libsigrok
5623 libstatgrab . . . . . $with_libstatgrab
5624 libtokyotyrant . . . $with_libtokyotyrant
5625 libupsclient . . . . $with_libupsclient
5626 libvarnish . . . . . $with_libvarnish
5627 libvirt . . . . . . . $with_libvirt
5628 libxml2 . . . . . . . $with_libxml2
5629 libxmms . . . . . . . $with_libxmms
5630 libyajl . . . . . . . $with_libyajl
5631 oracle . . . . . . . $with_oracle
5632 protobuf-c . . . . . $have_protoc_c
5633 python . . . . . . . $with_python
5635 Features:
5636 daemon mode . . . . . $enable_daemon
5637 debug . . . . . . . . $enable_debug
5639 Bindings:
5640 perl . . . . . . . . $with_perl_bindings
5642 Modules:
5643 aggregation . . . . . $enable_aggregation
5644 amqp . . . . . . . $enable_amqp
5645 apache . . . . . . . $enable_apache
5646 apcups . . . . . . . $enable_apcups
5647 aquaero . . . . . . . $enable_aquaero
5648 apple_sensors . . . . $enable_apple_sensors
5649 ascent . . . . . . . $enable_ascent
5650 battery . . . . . . . $enable_battery
5651 bind . . . . . . . . $enable_bind
5652 conntrack . . . . . . $enable_conntrack
5653 contextswitch . . . . $enable_contextswitch
5654 cgroups . . . . . . . $enable_cgroups
5655 cpu . . . . . . . . . $enable_cpu
5656 cpufreq . . . . . . . $enable_cpufreq
5657 csv . . . . . . . . . $enable_csv
5658 curl . . . . . . . . $enable_curl
5659 curl_json . . . . . . $enable_curl_json
5660 curl_xml . . . . . . $enable_curl_xml
5661 dbi . . . . . . . . . $enable_dbi
5662 df . . . . . . . . . $enable_df
5663 disk . . . . . . . . $enable_disk
5664 dns . . . . . . . . . $enable_dns
5665 email . . . . . . . . $enable_email
5666 entropy . . . . . . . $enable_entropy
5667 ethstat . . . . . . . $enable_ethstat
5668 exec . . . . . . . . $enable_exec
5669 filecount . . . . . . $enable_filecount
5670 fscache . . . . . . . $enable_fscache
5671 gmond . . . . . . . . $enable_gmond
5672 hddtemp . . . . . . . $enable_hddtemp
5673 interface . . . . . . $enable_interface
5674 ipmi . . . . . . . . $enable_ipmi
5675 iptables . . . . . . $enable_iptables
5676 ipvs . . . . . . . . $enable_ipvs
5677 irq . . . . . . . . . $enable_irq
5678 java . . . . . . . . $enable_java
5679 libvirt . . . . . . . $enable_libvirt
5680 load . . . . . . . . $enable_load
5681 logfile . . . . . . . $enable_logfile
5682 lpar . . . . . . . . $enable_lpar
5683 lvm . . . . . . . . . $enable_lvm
5684 madwifi . . . . . . . $enable_madwifi
5685 match_empty_counter . $enable_match_empty_counter
5686 match_hashed . . . . $enable_match_hashed
5687 match_regex . . . . . $enable_match_regex
5688 match_timediff . . . $enable_match_timediff
5689 match_value . . . . . $enable_match_value
5690 mbmon . . . . . . . . $enable_mbmon
5691 md . . . . . . . . . $enable_md
5692 memcachec . . . . . . $enable_memcachec
5693 memcached . . . . . . $enable_memcached
5694 memory . . . . . . . $enable_memory
5695 mic . . . . . . . . . $enable_mic
5696 modbus . . . . . . . $enable_modbus
5697 multimeter . . . . . $enable_multimeter
5698 mysql . . . . . . . . $enable_mysql
5699 netapp . . . . . . . $enable_netapp
5700 netlink . . . . . . . $enable_netlink
5701 network . . . . . . . $enable_network
5702 nfs . . . . . . . . . $enable_nfs
5703 nginx . . . . . . . . $enable_nginx
5704 notify_desktop . . . $enable_notify_desktop
5705 notify_email . . . . $enable_notify_email
5706 ntpd . . . . . . . . $enable_ntpd
5707 numa . . . . . . . . $enable_numa
5708 nut . . . . . . . . . $enable_nut
5709 olsrd . . . . . . . . $enable_olsrd
5710 onewire . . . . . . . $enable_onewire
5711 openvpn . . . . . . . $enable_openvpn
5712 oracle . . . . . . . $enable_oracle
5713 perl . . . . . . . . $enable_perl
5714 pf . . . . . . . . . $enable_pf
5715 pinba . . . . . . . . $enable_pinba
5716 ping . . . . . . . . $enable_ping
5717 postgresql . . . . . $enable_postgresql
5718 powerdns . . . . . . $enable_powerdns
5719 processes . . . . . . $enable_processes
5720 protocols . . . . . . $enable_protocols
5721 python . . . . . . . $enable_python
5722 redis . . . . . . . . $enable_redis
5723 routeros . . . . . . $enable_routeros
5724 rrdcached . . . . . . $enable_rrdcached
5725 rrdtool . . . . . . . $enable_rrdtool
5726 sensors . . . . . . . $enable_sensors
5727 serial . . . . . . . $enable_serial
5728 sigrok . . . . . . . $enable_sigrok
5729 snmp . . . . . . . . $enable_snmp
5730 statsd . . . . . . . $enable_statsd
5731 swap . . . . . . . . $enable_swap
5732 syslog . . . . . . . $enable_syslog
5733 table . . . . . . . . $enable_table
5734 tail . . . . . . . . $enable_tail
5735 tail_csv . . . . . . $enable_tail_csv
5736 tape . . . . . . . . $enable_tape
5737 target_notification . $enable_target_notification
5738 target_replace . . . $enable_target_replace
5739 target_scale . . . . $enable_target_scale
5740 target_set . . . . . $enable_target_set
5741 target_v5upgrade . . $enable_target_v5upgrade
5742 tcpconns . . . . . . $enable_tcpconns
5743 teamspeak2 . . . . . $enable_teamspeak2
5744 ted . . . . . . . . . $enable_ted
5745 thermal . . . . . . . $enable_thermal
5746 threshold . . . . . . $enable_threshold
5747 tokyotyrant . . . . . $enable_tokyotyrant
5748 unixsock . . . . . . $enable_unixsock
5749 uptime . . . . . . . $enable_uptime
5750 users . . . . . . . . $enable_users
5751 uuid . . . . . . . . $enable_uuid
5752 varnish . . . . . . . $enable_varnish
5753 vmem . . . . . . . . $enable_vmem
5754 vserver . . . . . . . $enable_vserver
5755 wireless . . . . . . $enable_wireless
5756 write_graphite . . . $enable_write_graphite
5757 write_http . . . . . $enable_write_http
5758 write_mongodb . . . . $enable_write_mongodb
5759 write_redis . . . . . $enable_write_redis
5760 write_riemann . . . . $enable_write_riemann
5761 xmms . . . . . . . . $enable_xmms
5762 zfs_arc . . . . . . . $enable_zfs_arc
5764 EOF
5766 if test "x$dependency_error" = "xyes"; then
5767 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5768 fi
5770 if test "x$dependency_warning" = "xyes"; then
5771 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5772 fi
5774 # vim: set fdm=marker :