Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.60])
3 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
4 AC_CONFIG_SRCDIR(src/target_set.c)
5 AC_CONFIG_HEADERS(src/config.h)
6 AC_CONFIG_AUX_DIR([build-aux])
7 AC_CONFIG_MACRO_DIR([m4])
8
9 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
10 dnl we don't really need the 'u' even in older toolchains. Then there is
11 dnl older libtool, which spelled it AR_FLAGS
12 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
13
14 LT_INIT([dlopen disable-static])
15
16 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
17 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
18 AC_LANG(C)
19
20 AC_PREFIX_DEFAULT("/opt/collectd")
21
22 AC_SYS_LARGEFILE
23
24 #
25 # Checks for programs.
26 #
27 AC_PROG_CC_C99([],
28 [AC_MSG_ERROR([No compiler found that supports C99])]
29 )
30
31 AX_COMPILER_VENDOR
32
33 AC_PROG_CXX
34 AC_PROG_CPP
35 AC_PROG_EGREP
36 AC_PROG_INSTALL
37 AC_PROG_LN_S
38 AC_PROG_MAKE_SET
39 AM_PROG_CC_C_O
40
41 AC_PROG_LEX
42 AC_PROG_YACC
43
44 AC_PATH_PROG([VALGRIND], [valgrind])
45
46 # Warn when pkg.m4 is missing
47 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
48
49 PKG_PROG_PKG_CONFIG
50
51 AC_CACHE_CHECK([if Bison is the parser generator],
52 [collectd_cv_prog_bison],
53 [
54 AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
55 [collectd_cv_prog_bison=yes],
56 [collectd_cv_prog_bison=no]
57 )
58 ]
59 )
60
61 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"; then
62 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
63 fi
64
65 if test "x$lt_cv_dlopen" = "xno"; then
66 AC_MSG_ERROR([Your system does not support dlopen])
67 fi
68
69 AC_SUBST([DLOPEN_LIBS], [$lt_cv_dlopen_libs])
70
71
72 AC_MSG_CHECKING([for kernel type ($host_os)])
73 case $host_os in
74 *aix*)
75 AC_DEFINE([KERNEL_AIX], [1], [True if program is to be compiled for a AIX kernel])
76 ac_system="AIX"
77 ;;
78 *darwin*)
79 AC_DEFINE([KERNEL_DARWIN], [1], [True if program is to be compiled for a Darwin kernel])
80 ac_system="Darwin"
81 ;;
82 *freebsd*)
83 AC_DEFINE([KERNEL_FREEBSD], [1], [True if program is to be compiled for a FreeBSD kernel])
84 ac_system="FreeBSD"
85 ;;
86 *linux*)
87 AC_DEFINE([KERNEL_LINUX], [1], [True if program is to be compiled for a Linux kernel])
88 ac_system="Linux"
89 ;;
90 *netbsd*)
91 AC_DEFINE([KERNEL_NETBSD], [1], [True if program is to be compiled for a NetBSD kernel])
92 ac_system="NetBSD"
93 ;;
94 *openbsd*)
95 AC_DEFINE([KERNEL_OPENBSD], [1], [True if program is to be compiled for an OpenBSD kernel])
96 ac_system="OpenBSD"
97 ;;
98 *solaris*)
99 AC_DEFINE([KERNEL_SOLARIS], [1], [True if program is to be compiled for a Solaris kernel])
100 ac_system="Solaris"
101 ;;
102 *mingw32*)
103 AC_DEFINE([KERNEL_WIN32], [1], [True if program is to be compiled for a Windows kernel])
104 ac_system="Windows"
105 ;;
106 *)
107 ac_system="unknown"
108 ;;
109 esac
110 AC_MSG_RESULT([$ac_system])
111
112 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
113 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
114 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
115 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
116 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
117 AM_CONDITIONAL([BUILD_NETBSD], [test "x$ac_system" = "xNetBSD"])
118 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
119 AM_CONDITIONAL([BUILD_WIN32], [test "x$ac_system" = "xWindows"])
120
121 if test "x$ac_system" = "xSolaris"; then
122 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Define to enforce POSIX thread semantics under Solaris.])
123 AC_DEFINE([_REENTRANT], [1], [Define to enable reentrancy interfaces.])
124
125 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
126 AC_COMPILE_IFELSE(
127 [
128 AC_LANG_PROGRAM(
129 [
130 #ifndef _LP64
131 # error "Compiler not in 64bit mode."
132 #endif
133 ]
134 )
135 ],
136 [AC_MSG_RESULT([yes])],
137 [
138 AC_MSG_RESULT([no])
139 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
140 ]
141 )
142 fi
143
144 if test "x$ac_system" = "xAIX"; then
145 AC_DEFINE([_THREAD_SAFE_ERRNO], [1], [Define to use the thread-safe version of errno under AIX.])
146 fi
147
148 # Where to install .pc files.
149 pkgconfigdir="${libdir}/pkgconfig"
150 AC_SUBST([pkgconfigdir])
151
152 #
153 # Checks for header files.
154 #
155 AC_HEADER_SYS_WAIT
156 AC_HEADER_DIRENT
157
158 AC_CHECK_HEADERS_ONCE([ \
159 arpa/inet.h \
160 endian.h \
161 fcntl.h \
162 fnmatch.h \
163 fs_info.h \
164 fshelp.h \
165 grp.h \
166 kstat.h \
167 kvm.h \
168 libgen.h \
169 locale.h \
170 mntent.h \
171 mnttab.h \
172 netdb.h \
173 paths.h \
174 poll.h \
175 pthread_np.h \
176 pwd.h \
177 regex.h \
178 sys/endian.h \
179 sys/fs_types.h \
180 sys/fstyp.h \
181 sys/ioctl.h \
182 sys/isa_defs.h \
183 sys/mntent.h \
184 sys/mnttab.h \
185 sys/param.h \
186 sys/resource.h \
187 sys/select.h \
188 sys/socket.h \
189 sys/statfs.h \
190 sys/statvfs.h \
191 sys/types.h \
192 sys/un.h \
193 sys/vfs.h \
194 sys/vfstab.h \
195 sys/vmmeter.h \
196 syslog.h \
197 wordexp.h
198 ])
199
200 if test "x$ac_system" = "xNetBSD"; then
201 # For entropy plugin on newer NetBSD
202 AC_CHECK_HEADERS([sys/rndio.h], [], [],
203 [[
204 #if HAVE_SYS_TYPES_H
205 # include <sys/types.h>
206 #endif
207 #if HAVE_SYS_IOCTL_H
208 # include <sys/ioctl.h>
209 #endif
210 #if HAVE_SYS_PARAM_H
211 # include <sys/param.h>
212 #endif
213 ]]
214 )
215 fi
216
217 # For ping library
218 AC_CHECK_HEADERS([netinet/in_systm.h], [], [],
219 [[
220 #include <stdint.h>
221 #if HAVE_SYS_TYPES_H
222 # include <sys/types.h>
223 #endif
224 ]]
225 )
226
227 AC_CHECK_HEADERS([netinet/in.h], [], [],
228 [[
229 #include <stdint.h>
230 #if HAVE_SYS_TYPES_H
231 # include <sys/types.h>
232 #endif
233 #if HAVE_NETINET_IN_SYSTM_H
234 # include <netinet/in_systm.h>
235 #endif
236 ]]
237 )
238
239 AC_CHECK_HEADERS([netinet/ip.h], [], [],
240 [[
241 #include <stdint.h>
242 #if HAVE_SYS_TYPES_H
243 # include <sys/types.h>
244 #endif
245 #if HAVE_NETINET_IN_SYSTM_H
246 # include <netinet/in_systm.h>
247 #endif
248 #if HAVE_NETINET_IN_H
249 # include <netinet/in.h>
250 #endif
251 ]]
252 )
253
254 AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [],
255 [[
256 #include <stdint.h>
257 #if HAVE_SYS_TYPES_H
258 # include <sys/types.h>
259 #endif
260 #if HAVE_NETINET_IN_SYSTM_H
261 # include <netinet/in_systm.h>
262 #endif
263 #if HAVE_NETINET_IN_H
264 # include <netinet/in.h>
265 #endif
266 #if HAVE_NETINET_IP_H
267 # include <netinet/ip.h>
268 #endif
269 ]]
270 )
271
272 AC_CHECK_HEADERS([netinet/ip_var.h], [], [],
273 [[
274 #include <stdint.h>
275 #if HAVE_SYS_TYPES_H
276 # include <sys/types.h>
277 #endif
278 #if HAVE_NETINET_IN_SYSTM_H
279 # include <netinet/in_systm.h>
280 #endif
281 #if HAVE_NETINET_IN_H
282 # include <netinet/in.h>
283 #endif
284 #if HAVE_NETINET_IP_H
285 # include <netinet/ip.h>
286 #endif
287 ]]
288 )
289
290 AC_CHECK_HEADERS([netinet/ip6.h], [], [],
291 [[
292 #include <stdint.h>
293 #if HAVE_SYS_TYPES_H
294 # include <sys/types.h>
295 #endif
296 #if HAVE_NETINET_IN_SYSTM_H
297 # include <netinet/in_systm.h>
298 #endif
299 #if HAVE_NETINET_IN_H
300 # include <netinet/in.h>
301 #endif
302 ]]
303 )
304
305 AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
306 [[
307 #include <stdint.h>
308 #if HAVE_SYS_TYPES_H
309 # include <sys/types.h>
310 #endif
311 #if HAVE_NETINET_IN_SYSTM_H
312 # include <netinet/in_systm.h>
313 #endif
314 #if HAVE_NETINET_IN_H
315 # include <netinet/in.h>
316 #endif
317 #if HAVE_NETINET_IP6_H
318 # include <netinet/ip6.h>
319 #endif
320 ]]
321 )
322
323 AC_CHECK_HEADERS([netinet/tcp.h], [], [],
324 [[
325 #include <stdint.h>
326 #if HAVE_SYS_TYPES_H
327 # include <sys/types.h>
328 #endif
329 #if HAVE_NETINET_IN_SYSTM_H
330 # include <netinet/in_systm.h>
331 #endif
332 #if HAVE_NETINET_IN_H
333 # include <netinet/in.h>
334 #endif
335 #if HAVE_NETINET_IP_H
336 # include <netinet/ip.h>
337 #endif
338 ]]
339 )
340
341 AC_CHECK_HEADERS([netinet/udp.h], [], [],
342 [[
343 #include <stdint.h>
344 #if HAVE_SYS_TYPES_H
345 # include <sys/types.h>
346 #endif
347 #if HAVE_NETINET_IN_SYSTM_H
348 # include <netinet/in_systm.h>
349 #endif
350 #if HAVE_NETINET_IN_H
351 # include <netinet/in.h>
352 #endif
353 #if HAVE_NETINET_IP_H
354 # include <netinet/ip.h>
355 #endif
356 ]]
357 )
358
359 # For cpu modules
360 AC_CHECK_HEADERS([sys/dkstat.h])
361 if test "x$ac_system" = "xDarwin"; then
362 AC_CHECK_HEADERS(
363 [ \
364 mach/mach_init.h \
365 mach/host_priv.h \
366 mach/mach_error.h \
367 mach/mach_host.h \
368 mach/mach_port.h \
369 mach/mach_types.h \
370 mach/message.h \
371 mach/processor_set.h \
372 mach/processor.h \
373 mach/processor_info.h \
374 mach/task.h \
375 mach/thread_act.h \
376 mach/vm_region.h \
377 mach/vm_map.h \
378 mach/vm_prot.h \
379 mach/vm_statistics.h \
380 mach/kern_return.h \
381 CoreFoundation/CoreFoundation.h \
382 IOKit/IOKitLib.h \
383 IOKit/IOTypes.h \
384 IOKit/ps/IOPSKeys.h \
385 IOKit/IOBSD.h \
386 IOKit/storage/IOBlockStorageDriver.h
387 ]
388 )
389
390 # For the battery plugin
391 AC_CHECK_HEADERS([IOKit/ps/IOPowerSources.h], [], [],
392 [[
393 #if HAVE_IOKIT_IOKITLIB_H
394 # include <IOKit/IOKitLib.h>
395 #endif
396 #if HAVE_IOKIT_IOTYPES_H
397 # include <IOKit/IOTypes.h>
398 #endif
399 ]]
400 )
401 fi
402
403 AC_CHECK_HEADERS([sys/sysctl.h], [], [],
404 [[
405 #if HAVE_SYS_TYPES_H
406 # include <sys/types.h>
407 #endif
408 #if HAVE_SYS_PARAM_H
409 # include <sys/param.h>
410 #endif
411 ]]
412 )
413
414 # For interface plugin
415 AC_CHECK_HEADERS([ifaddrs.h])
416 AC_CHECK_HEADERS([net/if.h], [], [],
417 [[
418 #if HAVE_SYS_TYPES_H
419 # include <sys/types.h>
420 #endif
421 #if HAVE_SYS_SOCKET_H
422 # include <sys/socket.h>
423 #endif
424 ]]
425 )
426
427 if test "x$ac_system" = "xLinux"; then
428 # For hddtemp module
429 AC_CHECK_HEADERS([linux/major.h])
430
431 # For md module (Linux only)
432 AC_CHECK_HEADERS([linux/raid/md_u.h],
433 [have_linux_raid_md_u_h="yes"],
434 [have_linux_raid_md_u_h="no"],
435 [[
436 #include <sys/ioctl.h>
437 #include <linux/major.h>
438 #include <linux/types.h>
439 ]]
440 )
441 AC_CHECK_HEADERS([sys/sysmacros.h])
442
443 AC_CHECK_HEADERS([linux/wireless.h],
444 [have_linux_wireless_h="yes"],
445 [have_linux_wireless_h="no"],
446 [[
447 #include <dirent.h>
448 #include <sys/ioctl.h>
449 #include <sys/socket.h>
450 ]]
451 )
452
453 AC_CHECK_HEADERS([linux/if.h], [], [],
454 [[
455 #if HAVE_SYS_TYPES_H
456 # include <sys/types.h>
457 #endif
458 #if HAVE_SYS_SOCKET_H
459 # include <sys/socket.h>
460 #endif
461 ]]
462 )
463
464 AC_CHECK_HEADERS([linux/inet_diag.h], [], [],
465 [[
466 #if HAVE_SYS_TYPES_H
467 # include <sys/types.h>
468 #endif
469 #if HAVE_SYS_SOCKET_H
470 # include <sys/socket.h>
471 #endif
472 ]]
473 )
474
475 AC_CHECK_HEADERS([linux/netdevice.h], [], [],
476 [[
477 #if HAVE_SYS_TYPES_H
478 # include <sys/types.h>
479 #endif
480 #if HAVE_SYS_SOCKET_H
481 # include <sys/socket.h>
482 #endif
483 #if HAVE_LINUX_IF_H
484 # include <linux/if.h>
485 #endif
486 ]]
487 )
488
489 # For ethstat module
490 AC_CHECK_HEADERS([linux/sockios.h],
491 [have_linux_sockios_h="yes"],
492 [have_linux_sockios_h="no"],
493 [[
494 #if HAVE_SYS_IOCTL_H
495 # include <sys/ioctl.h>
496 #endif
497 #if HAVE_NET_IF_H
498 # include <net/if.h>
499 #endif
500 ]]
501 )
502
503 AC_CHECK_HEADERS([linux/ethtool.h],
504 [have_linux_ethtool_h="yes"],
505 [have_linux_ethtool_h="no"],
506 [[
507 #if HAVE_SYS_IOCTL_H
508 # include <sys/ioctl.h>
509 #endif
510 #if HAVE_NET_IF_H
511 # include <net/if.h>
512 #endif
513 #if HAVE_LINUX_SOCKIOS_H
514 # include <linux/sockios.h>
515 #endif
516 ]]
517 )
518
519 # For ipvs module
520 AC_CHECK_HEADERS_ONCE([linux/ip_vs.h])
521
522 # For the email plugin
523 AC_CHECK_HEADERS([linux/un.h], [], [],
524 [[
525 #if HAVE_SYS_SOCKET_H
526 # include <sys/socket.h>
527 #endif
528 ]]
529 )
530 # For the turbostat plugin
531 AC_CHECK_HEADERS([cpuid.h],
532 [have_cpuid_h="yes"],
533 [have_cpuid_h="no (cpuid.h not found)"]
534 )
535
536 AC_CHECK_HEADERS([sys/capability.h],
537 [have_capability="yes"],
538 [have_capability="no (<sys/capability.h> not found)"]
539 )
540
541 if test "x$have_capability" = "xyes"; then
542 AC_CHECK_LIB([cap], [cap_get_proc],
543 [have_capability="yes"],
544 [have_capability="no (cap_get_proc() not found)"]
545 )
546 fi
547
548 if test "x$have_capability" = "xyes"; then
549 AC_CHECK_DECL([CAP_IS_SUPPORTED],
550 [have_capability="yes"],
551 [have_capability="no (CAP_IS_SUPPORTED not found)"],
552 [[#include <sys/capability.h>]]
553 )
554 fi
555
556 if test "x$have_capability" = "xyes"; then
557 AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
558 fi
559
560 # For pcie_errors plugin
561 AC_CHECK_HEADERS([linux/pci_regs.h],
562 [have_pci_regs_h="yes"],
563 [have_pci_regs_h="no (linux/pci_regs.h not found)"]
564 )
565
566 else
567 have_linux_raid_md_u_h="no"
568 have_linux_wireless_h="no"
569 fi
570
571 AM_CONDITIONAL([BUILD_WITH_CAPABILITY], [test "x$have_capability" = "xyes"])
572
573 # For the swap module
574 have_sys_swap_h="yes"
575 AC_CHECK_HEADERS([sys/swap.h vm/anon.h],
576 [],
577 [have_sys_swap_h="no"],
578 [[
579 #undef _FILE_OFFSET_BITS
580 #undef _LARGEFILE64_SOURCE
581 #if HAVE_SYS_TYPES_H
582 # include <sys/types.h>
583 #endif
584 #if HAVE_SYS_PARAM_H
585 # include <sys/param.h>
586 #endif
587 ]]
588 )
589
590 # For load module
591 # For the processes plugin
592 # For users module
593 AC_CHECK_HEADERS([sys/loadavg.h linux/config.h utmp.h utmpx.h])
594
595 # For quota module
596 AC_CHECK_HEADERS([sys/ucred.h], [], [],
597 [[
598 #if HAVE_SYS_TYPES_H
599 # include <sys/types.h>
600 #endif
601 #if HAVE_SYS_PARAM_H
602 # include <sys/param.h>
603 #endif
604 ]]
605 )
606
607 # For mount interface
608 AC_CHECK_HEADERS([sys/mount.h], [], [],
609 [[
610 #if HAVE_SYS_TYPES_H
611 # include <sys/types.h>
612 #endif
613 #if HAVE_SYS_PARAM_H
614 # include <sys/param.h>
615 #endif
616 ]]
617 )
618
619 # --enable-xfs {{{
620 AC_ARG_ENABLE([xfs],
621 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
622 [],
623 [enable_xfs="auto"]
624 )
625
626 if test "x$enable_xfs" != "xno"; then
627 AC_CHECK_HEADERS([xfs/xqm.h],
628 [],
629 [
630 if test "x$enable_xfs" = "xyes"; then
631 AC_MSG_ERROR([xfs/xqm.h not found])
632 fi
633 ],
634 [[#define _GNU_SOURCE]]
635 )
636 fi
637
638 # }}}
639
640 AC_CHECK_HEADERS([net/if_arp.h], [], [],
641 [[
642 #if HAVE_SYS_SOCKET_H
643 # include <sys/socket.h>
644 #endif
645 ]]
646 )
647
648 AC_CHECK_HEADERS([net/ppp_defs.h])
649 AC_CHECK_HEADERS([net/if_ppp.h], [], [],
650 [[
651 #if HAVE_NET_PPP_DEFS_H
652 # include <net/ppp_defs.h>
653 #endif
654 ]]
655 )
656
657 AC_CHECK_HEADERS([netinet/if_ether.h], [], [],
658 [[
659 #include <stdint.h>
660 #if HAVE_SYS_TYPES_H
661 # include <sys/types.h>
662 #endif
663 #if HAVE_SYS_SOCKET_H
664 # include <sys/socket.h>
665 #endif
666 #if HAVE_NET_IF_H
667 # include <net/if.h>
668 #endif
669 #if HAVE_NETINET_IN_H
670 # include <netinet/in.h>
671 #endif
672 ]]
673 )
674
675 AC_CHECK_HEADERS([net/pfvar.h],
676 [have_net_pfvar_h="yes"],
677 [have_net_pfvar_h="no"],
678 [[
679 #if HAVE_SYS_IOCTL_H
680 # include <sys/ioctl.h>
681 #endif
682 #if HAVE_SYS_SOCKET_H
683 # include <sys/socket.h>
684 #endif
685 #if HAVE_NET_IF_H
686 # include <net/if.h>
687 #endif
688 #if HAVE_NETINET_IN_H
689 # include <netinet/in.h>
690 #endif
691 ]]
692 )
693
694 # For the multimeter plugin
695 AC_CHECK_HEADERS([termios.h],
696 [have_termios_h="yes"],
697 [have_termios_h="no"]
698 )
699
700 # For cpusleep plugin
701 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
702 [c_cv_have_clock_boottime_monotonic],
703 [
704 AC_COMPILE_IFELSE(
705 [AC_LANG_PROGRAM(
706 [[#include <time.h>]],
707 [[
708 struct timespec b, m;
709 clock_gettime(CLOCK_BOOTTIME, &b );
710 clock_gettime(CLOCK_MONOTONIC, &m );
711 ]]
712 )
713 ],
714 [c_cv_have_clock_boottime_monotonic="yes"],
715 [c_cv_have_clock_boottime_monotonic="no"]
716 )
717 ]
718 )
719
720
721 #
722 # Checks for typedefs, structures, and compiler characteristics.
723 #
724 AC_C_CONST
725 AC_TYPE_PID_T
726 AC_TYPE_SIZE_T
727 AC_TYPE_UID_T
728 AC_HEADER_TIME
729
730 test_cxx_flags() {
731 AC_LANG_PUSH([C++])
732 AC_LANG_CONFTEST(
733 [AC_LANG_SOURCE([[int main(void){}]]) ]
734 )
735 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
736 ret=$?
737 rm -f conftest.o
738 AC_LANG_POP([C++])
739 return $ret
740 }
741
742 #
743 # Checks for library functions.
744 #
745 AC_CHECK_FUNCS_ONCE([ \
746 asprintf \
747 execvpe \
748 getpwnam \
749 getpwnam_r \
750 if_indextoname \
751 setgroups \
752 setlocale
753 ]
754 )
755
756 AC_FUNC_STRERROR_R
757
758 if test "x$GCC" = "xyes"; then
759 SAVE_CFLAGS="$CFLAGS"
760 CFLAGS="$CFLAGS -Wall -Werror"
761 fi
762 SAVE_LDFLAGS="$LDFLAGS"
763 LDFLAGS=""
764 if test "x$ac_system" = "xWindows"; then
765 # This is exported from build.sh
766 LDFLAGS="$LDFLAGS -L${GNULIB_DIR}"
767 fi
768
769 AC_CACHE_CHECK([for strtok_r],
770 [c_cv_have_strtok_r_default],
771 [
772 AC_LINK_IFELSE(
773 [
774 AC_LANG_PROGRAM(
775 [[
776 #include <stdlib.h>
777 #include <stdio.h>
778 #include <string.h>
779 ]],
780 [[
781 char buffer[] = "foo,bar,baz";
782 char *token;
783 char *dummy;
784 char *saveptr;
785
786 dummy = buffer;
787 saveptr = NULL;
788 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
789 {
790 dummy = NULL;
791 printf ("token = %s;\n", token);
792 }
793 ]]
794 )
795 ],
796 [c_cv_have_strtok_r_default="yes"],
797 [c_cv_have_strtok_r_default="no"]
798 )
799 ]
800 )
801
802 if test "x$c_cv_have_strtok_r_default" = "xno"; then
803 CFLAGS="$CFLAGS -D_REENTRANT=1"
804
805 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
806 [c_cv_have_strtok_r_reentrant],
807 [
808 AC_LINK_IFELSE(
809 [
810 AC_LANG_PROGRAM(
811 [[
812 #include <stdlib.h>
813 #include <stdio.h>
814 #include <string.h>
815 ]],
816 [[
817 char buffer[] = "foo,bar,baz";
818 char *token;
819 char *dummy;
820 char *saveptr;
821
822 dummy = buffer;
823 saveptr = NULL;
824 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
825 {
826 dummy = NULL;
827 printf ("token = %s;\n", token);
828 }
829 ]]
830 )
831 ],
832 [c_cv_have_strtok_r_reentrant="yes"],
833 [AC_MSG_FAILURE([strtok_r is not available. Please file a bugreport!])]
834 )
835 ]
836 )
837 fi
838
839 CFLAGS="$SAVE_CFLAGS"
840 LDFLAGS="$SAVE_LDFLAGS"
841 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"; then
842 CFLAGS="$CFLAGS -D_REENTRANT=1"
843 fi
844
845 AC_CHECK_FUNCS([socket],
846 [],
847 [
848 AC_CHECK_LIB([socket], [socket],
849 [socket_needs_socket="yes"],
850 [
851 AC_CHECK_LIB([gnu], [rpl_socket],
852 [socket_needs_gnulib="yes"],
853 [AC_MSG_ERROR([cannot find socket() in libsocket])]
854 )
855 ]
856 )
857 ]
858 )
859 AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
860 AM_CONDITIONAL([BUILD_WITH_GNULIB], [test "x$socket_needs_gnulib" = "xyes"])
861
862 AC_CHECK_FUNCS([inet_ntop],
863 [],
864 [
865 AC_CHECK_LIB([nsl], [inet_ntop],
866 [inet_ntop_needs_nsl="yes"],
867 [AC_MSG_ERROR([cannot find inet_ntop() in libnsl])]
868 )
869 ]
870 )
871 AM_CONDITIONAL([BUILD_WITH_LIBNSL], [test "x$inet_ntop_needs_nsl" = "xyes"])
872
873 clock_gettime_needs_posix4="no"
874 AC_CHECK_FUNCS([clock_gettime],
875 [have_clock_gettime="yes"],
876 [have_clock_gettime="no"]
877 )
878
879 if test "x$have_clock_gettime" = "xno"; then
880 AC_CHECK_LIB([rt], [clock_gettime],
881 [
882 clock_gettime_needs_rt="yes"
883 have_clock_gettime="yes"
884 ]
885 )
886 fi
887
888 if test "x$have_clock_gettime" = "xno"; then
889 AC_CHECK_LIB([posix4], [clock_gettime],
890 [
891 clock_gettime_needs_posix4="yes"
892 have_clock_gettime="yes"
893 ]
894 )
895 fi
896
897 if test "x$have_clock_gettime" = "xyes"; then
898 AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if the clock_gettime(2) function is available.])
899 fi
900
901 AC_CHECK_FUNCS([nanosleep], [],
902 AC_CHECK_LIB([rt], [nanosleep],
903 [nanosleep_needs_rt="yes"],
904 [
905 AC_CHECK_LIB([posix4], [nanosleep],
906 [nanosleep_needs_posix4="yes"],
907 [AC_MSG_ERROR([cannot find nanosleep])]
908 )
909 ]
910 )
911 )
912
913 AM_CONDITIONAL([BUILD_WITH_LIBRT], [test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes"])
914 AM_CONDITIONAL([BUILD_WITH_LIBPOSIX4], [test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes"])
915
916 AC_CHECK_FUNCS([getifaddrs], [have_getifaddrs="yes"], [have_getifaddrs="no"])
917 AC_CHECK_FUNCS([getloadavg], [have_getloadavg="yes"], [have_getloadavg="no"])
918 AC_CHECK_FUNCS([getutent], [have_getutent="yes"], [have_getutent="no"])
919 AC_CHECK_FUNCS([getutxent], [have_getutxent="yes"], [have_getutxent="no"])
920 AC_CHECK_FUNCS([host_statistics], [have_host_statistics="yes"], [have_host_statistics="no"])
921 AC_CHECK_FUNCS([processor_info], [have_processor_info="yes"], [have_processor_info="no"])
922 AC_CHECK_FUNCS([statfs], [have_statfs="yes"], [have_statfs="no"])
923 AC_CHECK_FUNCS([statvfs], [have_statvfs="yes"], [have_statvfs="no"])
924 AC_CHECK_FUNCS([sysctl], [have_sysctl="yes"], [have_sysctl="no"])
925 AC_CHECK_FUNCS([sysctlbyname], [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
926 AC_CHECK_FUNCS([syslog], [have_syslog="yes"], [have_syslog="no"])
927 AC_CHECK_FUNCS([thread_info], [have_thread_info="yes"], [have_thread_info="no"])
928
929 # Check for strptime {{{
930 if test "x$GCC" = "xyes"; then
931 SAVE_CFLAGS="$CFLAGS"
932 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
933 fi
934
935 AC_CHECK_FUNCS([strptime], [have_strptime="yes"], [have_strptime="no"])
936 if test "x$have_strptime" = "xyes"; then
937 AC_CACHE_CHECK([whether strptime is exported by default],
938 [c_cv_have_strptime_default],
939 [
940 AC_COMPILE_IFELSE(
941 [
942 AC_LANG_PROGRAM(
943 [[#include <time.h>]],
944 [[
945 struct tm stm;
946 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
947 ]]
948 )
949 ],
950 [c_cv_have_strptime_default="yes"],
951 [c_cv_have_strptime_default="no"])
952 ]
953 )
954 fi
955
956 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"; then
957 AC_CACHE_CHECK([whether strptime needs standards mode],
958 [c_cv_have_strptime_standards],
959 [
960 AC_COMPILE_IFELSE(
961 [
962 AC_LANG_PROGRAM(
963 [[
964 #ifndef _ISOC99_SOURCE
965 # define _ISOC99_SOURCE 1
966 #endif
967 #ifndef _POSIX_C_SOURCE
968 # define _POSIX_C_SOURCE 200112L
969 #endif
970 #ifndef _XOPEN_SOURCE
971 # define _XOPEN_SOURCE 500
972 #endif
973 #include <time.h>
974 ]],
975 [[
976 struct tm stm;
977 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
978 ]]
979 )
980 ],
981 [c_cv_have_strptime_standards="yes"],
982 [c_cv_have_strptime_standards="no"]
983 )
984 ]
985 )
986
987 if test "x$c_cv_have_strptime_standards" = "xyes"; then
988 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], [1],
989 [Set to true if strptime is only exported in X/Open mode (GNU libc).]
990 )
991 else
992 have_strptime="no"
993 fi
994 fi
995
996 if test "x$GCC" = "xyes"; then
997 CFLAGS="$SAVE_CFLAGS"
998 fi
999 # }}} Check for strptime
1000
1001 # Check for timegm {{{
1002
1003 # These checks need -Werror because implicit function declarations are only a
1004 # warning ...
1005 SAVE_CFLAGS="$CFLAGS"
1006 CFLAGS="$CFLAGS -Werror"
1007
1008 AC_CACHE_CHECK([for timegm],
1009 [c_cv_have_timegm],
1010 AC_LINK_IFELSE(
1011 [AC_LANG_PROGRAM(
1012 [[[
1013 #if STRPTIME_NEEDS_STANDARDS
1014 # ifndef _ISOC99_SOURCE
1015 # define _ISOC99_SOURCE 1
1016 # endif
1017 # ifndef _POSIX_C_SOURCE
1018 # define _POSIX_C_SOURCE 200112L
1019 # endif
1020 # ifndef _XOPEN_SOURCE
1021 # define _XOPEN_SOURCE 500
1022 # endif
1023 #endif
1024 #include <time.h>
1025 ]]],
1026 [[[
1027 time_t t = timegm(&(struct tm){0});
1028 if (t == ((time_t) -1)) {
1029 return 1;
1030 }
1031 ]]]
1032 )],
1033 [c_cv_have_timegm="yes"],
1034 [c_cv_have_timegm="no"]
1035 )
1036 )
1037
1038 if test "x$c_cv_have_timegm" != "xyes"
1039 then
1040 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1041 [c_cv_have_timegm_bsd],
1042 AC_LINK_IFELSE(
1043 [AC_LANG_PROGRAM(
1044 [[[
1045 #if STRPTIME_NEEDS_STANDARDS
1046 # ifndef _ISOC99_SOURCE
1047 # define _ISOC99_SOURCE 1
1048 # endif
1049 # ifndef _POSIX_C_SOURCE
1050 # define _POSIX_C_SOURCE 200112L
1051 # endif
1052 # ifndef _XOPEN_SOURCE
1053 # define _XOPEN_SOURCE 500
1054 # endif
1055 #endif
1056 #ifndef _BSD_SOURCE
1057 # define _BSD_SOURCE 1
1058 #endif
1059 #include <time.h>
1060 ]]],
1061 [[[
1062 time_t t = timegm(&(struct tm){0});
1063 if (t == ((time_t) -1)) {
1064 return 1;
1065 }
1066 ]]]
1067 )],
1068 [c_cv_have_timegm_bsd="yes"
1069 c_cv_have_timegm="yes"],
1070 [c_cv_have_timegm_bsd="no"]
1071 )
1072 )
1073 fi
1074
1075 if test "x$c_cv_have_timegm" = "xyes"
1076 then
1077 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1078 if test "x$c_cv_have_timegm_bsd" = "xyes"
1079 then
1080 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1081 fi
1082 fi
1083
1084 CFLAGS="$SAVE_CFLAGS"
1085 # }}} Check for timegm
1086
1087 AC_MSG_CHECKING([for sysctl kern.cp_times])
1088 if test -x /sbin/sysctl; then
1089 /sbin/sysctl kern.cp_times >/dev/null 2>&1
1090 if test $? -eq 0; then
1091 AC_MSG_RESULT([yes])
1092 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIMES], [1], [Define if sysctl supports kern.cp_times])
1093 else
1094 AC_MSG_RESULT([no])
1095 fi
1096 else
1097 AC_MSG_RESULT([no])
1098 fi
1099
1100 AC_MSG_CHECKING([for sysctl kern.cp_time])
1101 if test -x /sbin/sysctl; then
1102 /sbin/sysctl kern.cp_time >/dev/null 2>&1
1103 if test $? -eq 0
1104 then
1105 AC_MSG_RESULT([yes])
1106 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIME], [1], [Define if sysctl supports kern.cp_time])
1107 else
1108 AC_MSG_RESULT([no])
1109 fi
1110 else
1111 AC_MSG_RESULT([no])
1112 fi
1113
1114 AC_CHECK_FUNCS([swapctl], [have_swapctl="yes"], [have_swapctl="no"])
1115 if test "x$have_swapctl" = "xyes"; then
1116 AC_CACHE_CHECK([whether swapctl takes two arguments],
1117 [c_cv_have_swapctl_two_args],
1118 [
1119 AC_COMPILE_IFELSE(
1120 [
1121 AC_LANG_PROGRAM(
1122 [[
1123 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1124 # undef _FILE_OFFSET_BITS
1125 # undef _LARGEFILE64_SOURCE
1126 #endif
1127 #include <sys/stat.h>
1128 #include <sys/param.h>
1129 #include <sys/swap.h>
1130 #include <unistd.h>
1131 ]],
1132 [[int num = swapctl(0, NULL);]]
1133 )
1134 ],
1135 [c_cv_have_swapctl_two_args="yes"],
1136 [c_cv_have_swapctl_two_args="no"]
1137 )
1138 ]
1139 )
1140
1141 AC_CACHE_CHECK([whether swapctl takes three arguments],
1142 [c_cv_have_swapctl_three_args],
1143 [
1144 AC_COMPILE_IFELSE(
1145 [
1146 AC_LANG_PROGRAM(
1147 [[
1148 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1149 # undef _FILE_OFFSET_BITS
1150 # undef _LARGEFILE64_SOURCE
1151 #endif
1152 #include <sys/stat.h>
1153 #include <sys/param.h>
1154 #include <sys/swap.h>
1155 #include <unistd.h>
1156 ]],
1157 [[int num = swapctl(0, NULL, 0);]]
1158 )
1159 ],
1160 [c_cv_have_swapctl_three_args="yes"],
1161 [c_cv_have_swapctl_three_args="no"]
1162 )
1163 ]
1164 )
1165 fi
1166
1167 # Check for different versions of `swapctl' here..
1168 if test "x$have_swapctl" = "xyes"; then
1169 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1170 AC_DEFINE([HAVE_SWAPCTL_TWO_ARGS], [1], [Define if the function swapctl exists and takes two arguments.])
1171 fi
1172
1173 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1174 AC_DEFINE([HAVE_SWAPCTL_THREE_ARGS], [1], [Define if the function swapctl exists and takes three arguments.])
1175 fi
1176 fi
1177
1178 # Check for NAN
1179 AC_ARG_WITH([nan-emulation],
1180 [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1181 [
1182 if test "x$withval" = "xno"; then
1183 nan_type="none"
1184 else if test "x$withval" = "xyes"; then
1185 nan_type="zero"
1186 else
1187 nan_type="$withval"
1188 fi; fi
1189 ],
1190 [nan_type="none"]
1191 )
1192
1193 if test "x$nan_type" = "xnone"; then
1194 AC_CACHE_CHECK([whether NAN is defined by default],
1195 [c_cv_have_nan_default],
1196 [
1197 AC_COMPILE_IFELSE(
1198 [
1199 AC_LANG_PROGRAM(
1200 [[
1201 #include <stdlib.h>
1202 #include <math.h>
1203 static double foo = NAN;
1204 ]],
1205 [[
1206 if (isnan (foo))
1207 return 0;
1208 return 1;
1209 ]]
1210 )
1211 ],
1212 [c_cv_have_nan_default="yes"],
1213 [c_cv_have_nan_default="no"]
1214 )
1215 ]
1216 )
1217 fi
1218
1219 if test "x$c_cv_have_nan_default" = "xyes"; then
1220 nan_type="default"
1221 fi
1222
1223 if test "x$nan_type" = "xnone"; then
1224 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1225 [c_cv_have_nan_isoc],
1226 [
1227 AC_COMPILE_IFELSE(
1228 [
1229 AC_LANG_PROGRAM(
1230 [[
1231 #include <stdlib.h>
1232 #define __USE_ISOC99 1
1233 #include <math.h>
1234 static double foo = NAN;
1235 ]],
1236 [[
1237 if (isnan (foo))
1238 return 0;
1239 return 1;
1240 ]]
1241 )
1242 ],
1243 [c_cv_have_nan_isoc="yes"],
1244 [c_cv_have_nan_isoc="no"]
1245 )
1246 ]
1247 )
1248 fi
1249
1250 if test "x$c_cv_have_nan_isoc" = "xyes"; then
1251 nan_type="isoc99"
1252 fi
1253
1254 if test "x$nan_type" = "xnone"; then
1255 SAVE_LDFLAGS="$LDFLAGS"
1256 LDFLAGS="$LDFLAGS -lm"
1257 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1258 [c_cv_have_nan_zero],
1259 [
1260 AC_RUN_IFELSE(
1261 [
1262 AC_LANG_PROGRAM(
1263 [[
1264 #include <stdlib.h>
1265 #include <math.h>
1266 #ifdef NAN
1267 # undef NAN
1268 #endif
1269 #define NAN (0.0 / 0.0)
1270 #ifndef isnan
1271 # define isnan(f) ((f) != (f))
1272 #endif
1273 static double foo = NAN;
1274 ]],
1275 [[
1276 if (isnan (foo))
1277 return 0;
1278 return 1;
1279 ]]
1280 )
1281 ],
1282 [c_cv_have_nan_zero="yes"],
1283 [c_cv_have_nan_zero="no"]
1284 )
1285 ]
1286 )
1287 LDFLAGS=$SAVE_LDFLAGS
1288 fi
1289
1290 if test "x$c_cv_have_nan_zero" = "xyes"; then
1291 nan_type="zero"
1292 fi
1293
1294 if test "x$nan_type" = "xdefault"; then
1295 AC_DEFINE([NAN_STATIC_DEFAULT], [1],
1296 [Define if NAN is defined by default and can initialize static variables.]
1297 )
1298 else if test "x$nan_type" = "xisoc99"; then
1299 AC_DEFINE([NAN_STATIC_ISOC], [1],
1300 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]
1301 )
1302 else if test "x$nan_type" = "xzero"; then
1303 AC_DEFINE([NAN_ZERO_ZERO], [1],
1304 [Define if NAN can be defined as (0.0 / 0.0)]
1305 )
1306 else
1307 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1308 fi; fi; fi
1309
1310 AC_ARG_WITH([fp-layout],
1311 [
1312 AS_HELP_STRING([--with-fp-layout],
1313 [set the memory layout of doubles. For crosscompiling only.]
1314 )
1315 ],
1316 [
1317 if test "x$withval" = "xnothing"; then
1318 fp_layout_type="nothing"
1319 else if test "x$withval" = "xendianflip"; then
1320 fp_layout_type="endianflip"
1321 else if test "x$withval" = "xintswap"; then
1322 fp_layout_type="intswap"
1323 else
1324 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1325 fi; fi; fi
1326 ],
1327 [fp_layout_type="unknown"]
1328 )
1329
1330 if test "x$fp_layout_type" = "xunknown"; then
1331 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1332 [c_cv_fp_layout_need_nothing],
1333 [
1334 AC_RUN_IFELSE(
1335 [
1336 AC_LANG_PROGRAM(
1337 [[
1338 #include <stdlib.h>
1339 #include <stdio.h>
1340 #include <string.h>
1341 #include <stdint.h>
1342 #include <inttypes.h>
1343 #include <stdbool.h>
1344 ]],
1345 [[
1346 uint64_t i0;
1347 uint64_t i1;
1348 uint8_t c[8];
1349 double d;
1350
1351 d = 8.642135e130;
1352 memcpy ((void *) &i0, (void *) &d, 8);
1353
1354 i1 = i0;
1355 memcpy ((void *) c, (void *) &i1, 8);
1356
1357 if ((c[0] == 0x2f) && (c[1] == 0x25)
1358 && (c[2] == 0xc0) && (c[3] == 0xc7)
1359 && (c[4] == 0x43) && (c[5] == 0x2b)
1360 && (c[6] == 0x1f) && (c[7] == 0x5b))
1361 return 0;
1362 return 1;
1363 ]]
1364 )
1365 ],
1366 [c_cv_fp_layout_need_nothing="yes"],
1367 [c_cv_fp_layout_need_nothing="no"]
1368 )
1369 ]
1370 )
1371 fi
1372
1373 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1374 fp_layout_type="nothing"
1375 fi
1376
1377 if test "x$fp_layout_type" = "xunknown"; then
1378 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1379 [c_cv_fp_layout_need_endianflip],
1380 [
1381 AC_RUN_IFELSE(
1382 [
1383 AC_LANG_PROGRAM(
1384 [[
1385 #include <stdlib.h>
1386 #include <stdio.h>
1387 #include <string.h>
1388 #include <stdint.h>
1389 #include <inttypes.h>
1390 #include <stdbool.h>
1391 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1392 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1393 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1394 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1395 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1396 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1397 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1398 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1399 ]],
1400 [[
1401 uint64_t i0;
1402 uint64_t i1;
1403 uint8_t c[8];
1404 double d;
1405
1406 d = 8.642135e130;
1407 memcpy ((void *) &i0, (void *) &d, 8);
1408
1409 i1 = endianflip (i0);
1410 memcpy ((void *) c, (void *) &i1, 8);
1411
1412 if ((c[0] == 0x2f) && (c[1] == 0x25)
1413 && (c[2] == 0xc0) && (c[3] == 0xc7)
1414 && (c[4] == 0x43) && (c[5] == 0x2b)
1415 && (c[6] == 0x1f) && (c[7] == 0x5b))
1416 return 0;
1417 return 1;
1418 ]]
1419 )
1420 ],
1421 [c_cv_fp_layout_need_endianflip="yes"],
1422 [c_cv_fp_layout_need_endianflip="no"]
1423 ]
1424 )
1425 )
1426 fi
1427
1428 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1429 fp_layout_type="endianflip"
1430 fi
1431
1432 if test "x$fp_layout_type" = "xunknown"; then
1433 AC_CACHE_CHECK([if intswap converts to x86 representation],
1434 [c_cv_fp_layout_need_intswap],
1435 [
1436 AC_RUN_IFELSE(
1437 [
1438 AC_LANG_PROGRAM(
1439 [[
1440 #include <stdlib.h>
1441 #include <stdio.h>
1442 #include <string.h>
1443 #include <stdint.h>
1444 #include <inttypes.h>
1445 #include <stdbool.h>
1446 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1447 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1448 ]],
1449 [[
1450 uint64_t i0;
1451 uint64_t i1;
1452 uint8_t c[8];
1453 double d;
1454
1455 d = 8.642135e130;
1456 memcpy ((void *) &i0, (void *) &d, 8);
1457
1458 i1 = intswap (i0);
1459 memcpy ((void *) c, (void *) &i1, 8);
1460
1461 if ((c[0] == 0x2f) && (c[1] == 0x25)
1462 && (c[2] == 0xc0) && (c[3] == 0xc7)
1463 && (c[4] == 0x43) && (c[5] == 0x2b)
1464 && (c[6] == 0x1f) && (c[7] == 0x5b))
1465 return 0;
1466 return 1;
1467 ]]
1468 )
1469 ],
1470 [c_cv_fp_layout_need_intswap="yes"],
1471 [c_cv_fp_layout_need_intswap="no"]
1472 )
1473 ]
1474 )
1475 fi
1476
1477 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1478 fp_layout_type="intswap"
1479 fi
1480
1481 if test "x$fp_layout_type" = "xnothing"; then
1482 AC_DEFINE([FP_LAYOUT_NEED_NOTHING], [1],
1483 [Define if doubles are stored in x86 representation.]
1484 )
1485 else if test "x$fp_layout_type" = "xendianflip"; then
1486 AC_DEFINE([FP_LAYOUT_NEED_ENDIANFLIP], [1],
1487 [Define if endianflip is needed to convert to x86 representation.]
1488 )
1489 else if test "x$fp_layout_type" = "xintswap"; then
1490 AC_DEFINE([FP_LAYOUT_NEED_INTSWAP], [1],
1491 [Define if intswap is needed to convert to x86 representation.]
1492 )
1493 else
1494 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1495 fi; fi; fi
1496
1497 # For cpusleep plugin
1498 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
1499 [c_cv_have_clock_boottime_monotonic],
1500 [
1501 AC_COMPILE_IFELSE(
1502 [AC_LANG_PROGRAM(
1503 [[#include <time.h>]],
1504 [[
1505 struct timespec b, m;
1506 clock_gettime(CLOCK_BOOTTIME, &b );
1507 clock_gettime(CLOCK_MONOTONIC, &m );
1508 ]]
1509 )
1510 ],
1511 [c_cv_have_clock_boottime_monotonic="yes"],
1512 [c_cv_have_clock_boottime_monotonic="no"]
1513 )
1514 ]
1515 )
1516
1517 # --with-useragent {{{
1518 AC_ARG_WITH([useragent],
1519 [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1520 [
1521 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
1522 AC_DEFINE_UNQUOTED([COLLECTD_USERAGENT], ["$withval"], [User agent for http requests])
1523 fi
1524 ]
1525 )
1526
1527 # }}}
1528
1529 # --with-data-max-name-len {{{
1530 AC_ARG_WITH([data-max-name-len],
1531 [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1532 [
1533 if test "x$withval" != "x" && test $withval -gt 0; then
1534 AC_DEFINE_UNQUOTED([DATA_MAX_NAME_LEN], [$withval], [Maximum length of data buffers])
1535 else
1536 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1537 fi
1538 ],
1539 [AC_DEFINE([DATA_MAX_NAME_LEN], [128], [Maximum length of data buffers])]
1540 )
1541 # }}}
1542
1543 AC_CHECK_FUNCS([getfsstat], [have_getfsstat="yes"], [have_getfsstat="no"])
1544 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"], [have_getvfsstat="no"])
1545 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"], [have_listmntent="no"])
1546 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"], [have_getmntent_r="no"])
1547
1548 AC_CHECK_FUNCS(getmntent, [have_getmntent="libc"], [have_getmntent="no"])
1549 if test "x$have_getmntent" = "xno"; then
1550 AC_CHECK_LIB([sun], [getmntent],
1551 [have_getmntent="sun"],
1552 [have_gemntent="no"]
1553 )
1554 fi
1555
1556 if test "x$have_getmntent" = "xno"; then
1557 AC_CHECK_LIB([seq], [getmntent],
1558 [have_getmntent="seq"],
1559 [have_getmntent="no"]
1560 )
1561 fi
1562
1563 if test "x$have_getmntent" = "xno"; then
1564 AC_CHECK_LIB([gen], [getmntent],
1565 [have_getmntent="gen"],
1566 [have_getmntent="no"]
1567 )
1568 fi
1569
1570 if test "x$have_getmntent" = "xlibc"; then
1571 AC_CACHE_CHECK([whether getmntent takes one argument],
1572 [c_cv_have_one_getmntent],
1573 [
1574 AC_COMPILE_IFELSE(
1575 [
1576 AC_LANG_PROGRAM(
1577 [[#include "$srcdir/src/utils/mount/mount.h"]],
1578 [[
1579 FILE *fh;
1580 struct mntent *me;
1581 fh = setmntent ("/etc/mtab", "r");
1582 me = getmntent (fh);
1583 return me->mnt_passno;
1584 ]]
1585 )
1586 ],
1587 [c_cv_have_one_getmntent="yes"],
1588 [c_cv_have_one_getmntent="no"]
1589 )
1590 ]
1591 )
1592
1593 AC_CACHE_CHECK([whether getmntent takes two arguments],
1594 [c_cv_have_two_getmntent],
1595 [
1596 AC_COMPILE_IFELSE(
1597 [
1598 AC_LANG_PROGRAM(
1599 [[#include "$srcdir/src/utils/mount/mount.h"]],
1600 [[
1601 FILE *fh;
1602 struct mnttab mt;
1603 int status;
1604 fh = fopen ("/etc/mnttab", "r");
1605 status = getmntent (fh, &mt);
1606 return status;
1607 ]]
1608 )
1609 ],
1610 [c_cv_have_two_getmntent="yes"],
1611 [c_cv_have_two_getmntent="no"]
1612 )
1613 ]
1614 )
1615 fi
1616
1617 # Check for different versions of `getmntent' here..
1618
1619 if test "x$have_getmntent" = "xlibc"; then
1620 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1621 AC_DEFINE([HAVE_ONE_GETMNTENT], [1],
1622 [Define if the function getmntent exists and takes one argument.]
1623 )
1624 fi
1625
1626 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1627 AC_DEFINE([HAVE_TWO_GETMNTENT], [1],
1628 [Define if the function getmntent exists and takes two arguments.]
1629 )
1630 fi
1631 fi
1632
1633 if test "x$have_getmntent" = "xsun"; then
1634 AC_DEFINE([HAVE_SUN_GETMNTENT], [1],
1635 [Define if the function getmntent exists. It is the version from libsun.]
1636 )
1637 fi
1638
1639 if test "x$have_getmntent" = "xgen"; then
1640 AC_DEFINE([HAVE_GEN_GETMNTENT], [1],
1641 [Define if the function getmntent exists. It is the version from libgen.]
1642 )
1643 fi
1644
1645 # Check for htonll
1646 AC_CACHE_CHECK([whether htonll is defined],
1647 [c_cv_have_htonll],
1648 [
1649 AC_LINK_IFELSE(
1650 [
1651 AC_LANG_PROGRAM(
1652 [[
1653 #include <inttypes.h>
1654 #include <sys/types.h>
1655 #include <netinet/in.h>
1656 ]],
1657 [[return htonll(0);]]
1658 )
1659 ],
1660 [c_cv_have_htonll="yes"],
1661 [c_cv_have_htonll="no"]
1662 )
1663 ]
1664 )
1665
1666 if test "x$c_cv_have_htonll" = "xyes"; then
1667 AC_DEFINE([HAVE_HTONLL], [1], [Define if the function htonll exists.])
1668 fi
1669
1670 # Check for structures
1671 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1672 [AC_DEFINE([HAVE_STRUCT_IF_DATA], [1], [Define if struct if_data exists and is usable.])],
1673 [],
1674 [[
1675 #include <sys/types.h>
1676 #include <sys/socket.h>
1677 #include <net/if.h>
1678 ]]
1679 )
1680
1681 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1682 [AC_DEFINE([HAVE_STRUCT_NET_DEVICE_STATS], [1], [Define if struct net_device_stats exists and is usable.])],
1683 [],
1684 [[
1685 #include <sys/types.h>
1686 #include <sys/socket.h>
1687 #include <linux/if.h>
1688 #include <linux/netdevice.h>
1689 ]]
1690 )
1691
1692 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1693 [AC_DEFINE([HAVE_STRUCT_LINUX_INET_DIAG_REQ], [1], [Define if struct inet_diag_req exists and is usable.])],
1694 [],
1695 [[#include <linux/inet_diag.h>]]
1696 )
1697
1698 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1699 [],
1700 [[
1701 #include <netinet/in.h>
1702 #include <net/if.h>
1703 ]]
1704 )
1705
1706 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1707 [
1708 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_FREEBSD], [1], [Define if struct kinfo_proc exists in the FreeBSD variant.])
1709 have_struct_kinfo_proc_freebsd="yes"
1710 ],
1711 [],
1712 [[
1713 #include <kvm.h>
1714 #include <sys/param.h>
1715 #include <sys/sysctl.h>
1716 #include <sys/user.h>
1717 ]]
1718 )
1719
1720 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1721 [
1722 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_OPENBSD], [1], [Define if struct kinfo_proc exists in the OpenBSD variant.])
1723 have_struct_kinfo_proc_openbsd="yes"
1724 ],
1725 [],
1726 [[
1727 #include <sys/param.h>
1728 #include <sys/sysctl.h>
1729 #include <kvm.h>
1730 ]]
1731 )
1732
1733 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1734 [
1735 AC_DEFINE([HAVE_STRUCT_KINFO_PROC2_NETBSD], [1], [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1736 have_struct_kinfo_proc2_netbsd="yes"
1737 ],
1738 [],
1739 [[
1740 #include <sys/param.h>
1741 #include <sys/sysctl.h>
1742 #include <kvm.h>
1743 ]]
1744 )
1745
1746 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport],
1747 [],
1748 [],
1749 [[
1750 #define _BSD_SOURCE
1751 #define _DEFAULT_SOURCE
1752 #include <stdint.h>
1753 #if HAVE_SYS_TYPES_H
1754 # include <sys/types.h>
1755 #endif
1756 #if HAVE_NETINET_IN_SYSTM_H
1757 # include <netinet/in_systm.h>
1758 #endif
1759 #if HAVE_NETINET_IN_H
1760 # include <netinet/in.h>
1761 #endif
1762 #if HAVE_NETINET_IP_H
1763 # include <netinet/ip.h>
1764 #endif
1765 #if HAVE_NETINET_UDP_H
1766 # include <netinet/udp.h>
1767 #endif
1768 ]]
1769 )
1770
1771 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source],
1772 [],
1773 [],
1774 [[
1775 #define _BSD_SOURCE
1776 #define _DEFAULT_SOURCE
1777 #include <stdint.h>
1778 #if HAVE_SYS_TYPES_H
1779 # include <sys/types.h>
1780 #endif
1781 #if HAVE_NETINET_IN_SYSTM_H
1782 # include <netinet/in_systm.h>
1783 #endif
1784 #if HAVE_NETINET_IN_H
1785 # include <netinet/in.h>
1786 #endif
1787 #if HAVE_NETINET_IP_H
1788 # include <netinet/ip.h>
1789 #endif
1790 #if HAVE_NETINET_UDP_H
1791 # include <netinet/udp.h>
1792 #endif
1793 ]]
1794 )
1795
1796 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1797 [],
1798 [],
1799 [[# include <kstat.h>]]
1800 )
1801
1802 # check for pthread_setname_np
1803 SAVE_LDFLAGS="$LDFLAGS"
1804 LDFLAGS="$LDFLAGS -lpthread"
1805
1806 AC_MSG_CHECKING([for pthread_setname_np])
1807 have_pthread_setname_np="no"
1808 AC_LINK_IFELSE(
1809 [
1810 AC_LANG_PROGRAM(
1811 [[
1812 #define _GNU_SOURCE
1813 #include <pthread.h>
1814 ]],
1815 [[pthread_setname_np((pthread_t) {0}, "conftest");]]
1816 )
1817 ],
1818 [
1819 have_pthread_setname_np="yes"
1820 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1821 ]
1822 )
1823
1824 AC_MSG_RESULT([$have_pthread_setname_np])
1825
1826 # check for pthread_set_name_np(3) (FreeBSD)
1827 AC_MSG_CHECKING([for pthread_set_name_np])
1828 have_pthread_set_name_np="no"
1829 AC_LINK_IFELSE(
1830 [
1831 AC_LANG_PROGRAM(
1832 [[#include <pthread_np.h>]],
1833 [[pthread_set_name_np((pthread_t) {0}, "conftest");]]
1834 )
1835 ],
1836 [
1837 have_pthread_set_name_np="yes"
1838 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1839 ]
1840 )
1841 AC_MSG_RESULT([$have_pthread_set_name_np])
1842
1843 LDFLAGS="$SAVE_LDFLAGS"
1844
1845 AC_CHECK_TYPES([struct ip6_ext],
1846 [have_ip6_ext="yes"],
1847 [have_ip6_ext="no"],
1848 [[
1849 #include <stdint.h>
1850 #if HAVE_SYS_TYPES_H
1851 # include <sys/types.h>
1852 #endif
1853 #if HAVE_NETINET_IN_SYSTM_H
1854 # include <netinet/in_systm.h>
1855 #endif
1856 #if HAVE_NETINET_IN_H
1857 # include <netinet/in.h>
1858 #endif
1859 #if HAVE_NETINET_IP6_H
1860 # include <netinet/ip6.h>
1861 #endif
1862 ]]
1863 )
1864
1865 if test "x$have_ip6_ext" = "xno"; then
1866 SAVE_CFLAGS="$CFLAGS"
1867 CFLAGS="$CFLAGS -DSOLARIS2=8"
1868 AC_CHECK_TYPES([struct ip6_ext],
1869 [have_ip6_ext="yes, with -DSOLARIS2=8"],
1870 [have_ip6_ext="no"],
1871 [[
1872 #include <stdint.h>
1873 #if HAVE_SYS_TYPES_H
1874 # include <sys/types.h>
1875 #endif
1876 #if HAVE_NETINET_IN_SYSTM_H
1877 # include <netinet/in_systm.h>
1878 #endif
1879 #if HAVE_NETINET_IN_H
1880 # include <netinet/in.h>
1881 #endif
1882 #if HAVE_NETINET_IP6_H
1883 # include <netinet/ip6.h>
1884 #endif
1885 ]]
1886 )
1887 if test "x$have_ip6_ext" = "xno"; then
1888 CFLAGS="$SAVE_CFLAGS"
1889 fi
1890 fi
1891
1892 # libi2c-dev
1893 if test "x$ac_system" = "xLinux"; then
1894 with_libi2c_libs=""
1895 AC_CHECK_HEADERS([i2c/smbus.h],
1896 [with_libi2c_libs="-li2c"]
1897 )
1898 AC_CHECK_DECL([i2c_smbus_read_i2c_block_data],
1899 [with_libi2c="yes"],
1900 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
1901 [[
1902 #include <stdlib.h>
1903 #include <linux/i2c-dev.h>
1904 #if HAVE_I2C_SMBUS_H
1905 # include <i2c/smbus.h>
1906 #endif
1907 ]]
1908 )
1909 BUILD_WITH_LIBI2C_LIBS="$with_libi2c_libs"
1910 AC_SUBST([BUILD_WITH_LIBI2C_LIBS])
1911 else
1912 with_libi2c="no (Linux only)"
1913 fi
1914
1915 #
1916 # Checks for libraries begin here
1917 #
1918
1919 # Check for libpthread
1920 SAVE_LIBS="$LIBS"
1921 AC_CHECK_LIB([pthread],
1922 [pthread_create],
1923 [],
1924 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread])],
1925 []
1926 )
1927 PTHREAD_LIBS="$LIBS"
1928 LIBS="$SAVE_LIBS"
1929 AC_SUBST([PTHREAD_LIBS])
1930
1931 AC_CHECK_HEADERS([pthread.h],
1932 [],
1933 [AC_MSG_ERROR([pthread.h not found])]
1934 )
1935
1936 m4_divert_once([HELP_WITH], [
1937 Collectd additional packages:])
1938
1939 if test "x$ac_system" = "xAIX"; then
1940 with_perfstat="yes"
1941 with_procinfo="yes"
1942 else
1943 with_perfstat="no (AIX only)"
1944 with_procinfo="no (AIX only)"
1945 fi
1946
1947 if test "x$with_perfstat" = "xyes"; then
1948 AC_CHECK_LIB([perfstat], [perfstat_reset],
1949 [with_perfstat="yes"],
1950 [with_perfstat="no (perfstat not found)"]
1951 )
1952 fi
1953
1954 if test "x$with_perfstat" = "xyes"; then
1955 AC_DEFINE([HAVE_PERFSTAT], [1], [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1956 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1957 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled],
1958 [],
1959 [],
1960 [[#include <libperfstat.h]]
1961 )
1962 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"; then
1963 AC_DEFINE([PERFSTAT_SUPPORTS_DONATION], [1], [Define to 1 if your version of the 'perfstat' library supports donation])
1964 fi
1965 fi
1966 AM_CONDITIONAL([BUILD_WITH_PERFSTAT], [test "x$with_perfstat" = "xyes"])
1967
1968 # Processes plugin under AIX.
1969 if test "x$with_procinfo" = "xyes"; then
1970 AC_CHECK_HEADERS([procinfo.h],
1971 [AC_DEFINE([HAVE_PROCINFO_H], [1], [Define to 1 if you have the procinfo.h])],
1972 [with_procinfo="no (procinfo.h not found)"]
1973 )
1974 fi
1975
1976 if test "x$ac_system" = "xSolaris"; then
1977 with_kstat="yes"
1978 with_devinfo="yes"
1979 else
1980 with_kstat="no (Solaris only)"
1981 with_devinfo="no (Solaris only)"
1982 fi
1983
1984 if test "x$with_kstat" = "xyes"; then
1985 AC_CHECK_LIB([kstat], [kstat_open],
1986 [with_kstat="yes"],
1987 [with_kstat="no (libkstat not found)"]
1988 )
1989 fi
1990
1991 if test "x$with_kstat" = "xyes"; then
1992 AC_CHECK_LIB([devinfo], [di_init],
1993 [with_devinfo="yes"],
1994 [with_devinfo="no (not found)"]
1995 )
1996 AC_CHECK_HEADERS([kstat.h],
1997 [AC_DEFINE(HAVE_LIBKSTAT, [1], [Define to 1 if you have the 'kstat' library (-lkstat)])],
1998 [with_kstat="no (kstat.h not found)"]
1999 )
2000 fi
2001
2002 AM_CONDITIONAL([BUILD_WITH_LIBDEVINFO], [test "x$with_devinfo" = "xyes"])
2003 AM_CONDITIONAL([BUILD_WITH_LIBKSTAT], [test "x$with_kstat" = "xyes"])
2004
2005 if test "x$ac_system" = "xDarwin"; then
2006 with_libiokit="yes"
2007 else
2008 with_libiokit="no"
2009 fi
2010 AM_CONDITIONAL([BUILD_WITH_LIBIOKIT], [test "x$with_libiokit" = "xyes"])
2011
2012 with_libkvm="no"
2013 AC_CHECK_LIB([kvm], [kvm_getprocs],
2014 [with_kvm_getprocs="yes"],
2015 [with_kvm_getprocs="no"]
2016 )
2017
2018 if test "x$with_kvm_getprocs" = "xyes"; then
2019 AC_DEFINE([HAVE_LIBKVM_GETPROCS], [1],
2020 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)]
2021 )
2022 with_libkvm="yes"
2023 fi
2024
2025 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETPROCS], [test "x$with_kvm_getprocs" = "xyes"])
2026
2027 AC_CHECK_LIB([kvm], [kvm_getswapinfo],
2028 [with_kvm_getswapinfo="yes"],
2029 [with_kvm_getswapinfo="no"]
2030 )
2031
2032 if test "x$with_kvm_getswapinfo" = "xyes"; then
2033 AC_DEFINE([HAVE_LIBKVM_GETSWAPINFO], [1],
2034 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)]
2035 )
2036 with_libkvm="yes"
2037 fi
2038
2039 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETSWAPINFO], [test "x$with_kvm_getswapinfo" = "xyes"])
2040
2041 AC_CHECK_LIB([kvm], [kvm_nlist],
2042 [with_kvm_nlist="yes"],
2043 [with_kvm_nlist="no"]
2044 )
2045
2046 if test "x$with_kvm_nlist" = "xyes"; then
2047 AC_CHECK_HEADERS([bsd/nlist.h nlist.h])
2048 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2049 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)]
2050 )
2051 with_libkvm="yes"
2052 fi
2053
2054 AM_CONDITIONAL([BUILD_WITH_LIBKVM_NLIST], [test "x$with_kvm_nlist" = "xyes"])
2055
2056 AC_CHECK_LIB([kvm], [kvm_openfiles],
2057 [with_kvm_openfiles="yes"],
2058 [with_kvm_openfiles="no"]
2059 )
2060
2061 if test "x$with_kvm_openfiles" = "xyes"; then
2062 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2063 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)]
2064 )
2065 with_libkvm="yes"
2066 fi
2067
2068 # --with-cuda {{{
2069 AC_ARG_WITH([cuda],
2070 [AS_HELP_STRING([--with-cuda@<:@=PREFIX@:>@], [Path to cuda.])],
2071 [
2072 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2073 with_cuda_cppflags="-I$withval/include"
2074 with_cuda_ldflags="-I$withval/lib"
2075 with_cuda="yes"
2076 else
2077 with_cuda="$withval"
2078 fi
2079 ],
2080 [with_cuda="no"]
2081 )
2082
2083 if test "x$with_cuda" = "xyes"; then
2084 SAVE_CPPFLAGS="$CPPFLAGS"
2085 CPPFLAGS="$CPPFLAGS $with_cuda_cppflags"
2086
2087 AC_CHECK_HEADERS([nvml.h],
2088 [with_cuda="yes"],
2089 [with_cuda="no (nvml.h not found)"]
2090 )
2091
2092 CPPFLAGS="$SAVE_CPPFLAGS"
2093 fi
2094
2095 if test "x$with_cuda" = "xyes"; then
2096 BUILD_WITH_CUDA_CPPFLAGS="$with_cuda_cppflags"
2097 BUILD_WITH_CUDA_LDFLAGS="$with_cuda_ldflags"
2098 BUILD_WITH_CUDA_LIBS="-lnvidia-ml"
2099 fi
2100
2101 AC_SUBST([BUILD_WITH_CUDA_CPPFLAGS])
2102 AC_SUBST([BUILD_WITH_CUDA_LDFLAGS])
2103 AC_SUBST([BUILD_WITH_CUDA_LIBS])
2104
2105 # }}}
2106
2107 # --with-libaquaero5 {{{
2108 AC_ARG_WITH([libaquaero5],
2109 [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
2110 [
2111 if test "x$withval" = "xyes"; then
2112 with_libaquaero5="yes"
2113 else if test "x$withval" = "xno"; then
2114 with_libaquaero5="no"
2115 else
2116 with_libaquaero5="yes"
2117 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
2118 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
2119 fi; fi
2120 ],
2121 [with_libaquaero5="yes"]
2122 )
2123
2124 SAVE_CPPFLAGS="$CPPFLAGS"
2125 SAVE_LDFLAGS="$LDFLAGS"
2126 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
2127 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
2128
2129 if test "x$with_libaquaero5" = "xyes"; then
2130 AC_CHECK_HEADERS([libaquaero5.h],
2131 [with_libaquaero5="yes"],
2132 [with_libaquaero5="no (libaquaero5.h not found)"]
2133 )
2134 fi
2135
2136 if test "x$with_libaquaero5" = "xyes"; then
2137 AC_CHECK_LIB([aquaero5], libaquaero5_poll,
2138 [with_libaquaero5="yes"],
2139 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"]
2140 )
2141 fi
2142
2143 CPPFLAGS="$SAVE_CPPFLAGS"
2144 LDFLAGS="$SAVE_LDFLAGS"
2145
2146 if test "x$with_libaquaero5" = "xyes"; then
2147 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2148 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2149 fi
2150 AC_SUBST([BUILD_WITH_LIBAQUAERO5_CFLAGS])
2151 AC_SUBST([BUILD_WITH_LIBAQUAERO5_LDFLAGS])
2152 # }}}
2153
2154 # --with-libhiredis {{{
2155 AC_ARG_WITH([libhiredis],
2156 [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@], [Path to libhiredis.])],
2157 [
2158 if test "x$withval" = "xyes"; then
2159 with_libhiredis="yes"
2160 else if test "x$withval" = "xno"; then
2161 with_libhiredis="no"
2162 else
2163 with_libhiredis="yes"
2164 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2165 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2166 fi; fi
2167 ],
2168 [with_libhiredis="yes"]
2169 )
2170
2171 SAVE_CPPFLAGS="$CPPFLAGS"
2172 SAVE_LDFLAGS="$LDFLAGS"
2173 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2174 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2175
2176 if test "x$with_libhiredis" = "xyes"; then
2177 AC_CHECK_HEADERS([hiredis/hiredis.h],
2178 [with_libhiredis="yes"],
2179 [with_libhiredis="no (hiredis.h not found)"]
2180 )
2181 fi
2182
2183 if test "x$with_libhiredis" = "xyes"; then
2184 AC_CHECK_LIB([hiredis], [redisCommand],
2185 [with_libhiredis="yes"],
2186 [with_libhiredis="no (symbol 'redisCommand' not found)"]
2187 )
2188 fi
2189
2190 CPPFLAGS="$SAVE_CPPFLAGS"
2191 LDFLAGS="$SAVE_LDFLAGS"
2192
2193 if test "x$with_libhiredis" = "xyes"; then
2194 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2195 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2196 fi
2197
2198 AC_SUBST([BUILD_WITH_LIBHIREDIS_CPPFLAGS])
2199 AC_SUBST([BUILD_WITH_LIBHIREDIS_LDFLAGS])
2200 # }}}
2201
2202 # --with-libredfish {{{
2203 AC_ARG_WITH([libredfish],
2204 [AS_HELP_STRING([--with-libredfish@<:@=PREFIX@:>@], [Path to libredfish.])],
2205 [
2206 if test "x$withval" = "xyes"; then
2207 with_libredfish="yes"
2208 else if test "x$withval" = "xno"; then
2209 with_libredfish="no"
2210 else
2211 with_libredfish="yes"
2212 LIBREDFISH_CPPFLAGS="$LIBREDFISH_CPPFLAGS -I$withval/include"
2213 LIBREDFISH_LDFLAGS="$LIBREDFISH_LDFLAGS -L$withval/lib"
2214 fi; fi
2215 ],
2216 [with_libredfish="yes"]
2217 )
2218
2219 SAVE_CPPFLAGS="$CPPFLAGS"
2220 SAVE_LDFLAGS="$LDFLAGS"
2221 CPPFLAGS="$CPPFLAGS $LIBREDFISH_CPPFLAGS"
2222 LDFLAGS="$LDFLAGS $LIBREDFISH_LDFLAGS"
2223
2224 if test "x$with_libredfish" = "xyes"; then
2225 if test "x$LIBREDFISH_CPPFLAGS" != "x"; then
2226 AC_MSG_NOTICE([libredfish CPPFLAGS: $LIBHIREDFISH_CPPFLAGS])
2227 fi
2228 AC_CHECK_HEADERS([redfish.h],
2229 [with_libredfish="yes"],
2230 [with_libredfish="no (redfish.h not found)"]
2231 )
2232 fi
2233
2234 if test "x$with_libredfish" = "xyes"; then
2235 if test "x$LIBREDFISH_LDFLAGS" != "x"; then
2236 AC_MSG_NOTICE([libredfish LDFLAGS: $LIBREDFISH_LDFLAGS])
2237 fi
2238 AC_CHECK_LIB([redfish], [createServiceEnumerator],
2239 [with_libredfish="yes"],
2240 [with_libredfish="no (symbol 'createServiceEnumerator' not found)"]
2241 )
2242 fi
2243
2244 CPPFLAGS="$SAVE_CPPFLAGS"
2245 LDFLAGS="$SAVE_LDFLAGS"
2246
2247 if test "x$with_libredfish" = "xyes"; then
2248 BUILD_WITH_LIBREDFISH_CPPFLAGS="$LIBREDFISH_CPPFLAGS"
2249 BUILD_WITH_LIBREDFISH_LDFLAGS="$LIBREDFISH_LDFLAGS"
2250 fi
2251
2252 AC_SUBST([BUILD_WITH_LIBREDFISH_CPPFLAGS])
2253 AC_SUBST([BUILD_WITH_LIBREDFISH_LDFLAGS])
2254
2255 # }}}
2256
2257 # --with-libcurl {{{
2258 with_curl_config="curl-config"
2259 with_curl_cflags=""
2260 with_curl_libs=""
2261 AC_ARG_WITH(libcurl,
2262 [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2263 [
2264 if test "x$withval" = "xno"; then
2265 with_libcurl="no"
2266 else if test "x$withval" = "xyes"; then
2267 with_libcurl="yes"
2268 else
2269 if test -f "$withval" && test -x "$withval"; then
2270 with_curl_config="$withval"
2271 with_libcurl="yes"
2272 else if test -x "$withval/bin/curl-config"; then
2273 with_curl_config="$withval/bin/curl-config"
2274 with_libcurl="yes"
2275 fi; fi
2276 with_libcurl="yes"
2277 fi; fi
2278 ],
2279 [with_libcurl="yes"]
2280 )
2281
2282 if test "x$with_libcurl" = "xyes"; then
2283 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2284 curl_config_status=$?
2285
2286 if test $curl_config_status -ne 0; then
2287 with_libcurl="no ($with_curl_config failed)"
2288 else
2289 SAVE_CPPFLAGS="$CPPFLAGS"
2290 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2291
2292 AC_CHECK_HEADERS([curl/curl.h],
2293 [with_libcurl="yes"],
2294 [with_libcurl="no (curl/curl.h not found)"]
2295 )
2296
2297 CPPFLAGS="$SAVE_CPPFLAGS"
2298 fi
2299 fi
2300
2301 if test "x$with_libcurl" = "xyes"; then
2302 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2303 curl_config_status=$?
2304
2305 if test $curl_config_status -ne 0; then
2306 with_libcurl="no ($with_curl_config failed)"
2307 else
2308 AC_CHECK_LIB([curl], [curl_easy_init],
2309 [with_libcurl="yes"],
2310 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2311 [$with_curl_libs]
2312 )
2313
2314 AC_CHECK_DECL([CURLOPT_USERNAME],
2315 [have_curlopt_username="yes"],
2316 [have_curlopt_username="no"],
2317 [[#include <curl/curl.h>]]
2318 )
2319
2320 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2321 [have_curlopt_timeout="yes"],
2322 [have_curlopt_timeout="no"],
2323 [[#include <curl/curl.h>]]
2324 )
2325 fi
2326 fi
2327
2328 if test "x$with_libcurl" = "xyes"; then
2329 SAVE_CPPFLAGS="$CPPFLAGS"
2330 SAVE_LDFLAGS="$LDFLAGS"
2331 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2332 LDFLAGS="$LDFLAGS $with_curl_libs"
2333 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2334 [c_cv_have_curlinfo_appconnect_time],
2335 [
2336 AC_LINK_IFELSE(
2337 [
2338 AC_LANG_PROGRAM(
2339 [[#include <curl/curl.h>]],
2340 [[
2341 int val = CURLINFO_APPCONNECT_TIME;
2342 return val;
2343 ]]
2344 )
2345 ],
2346 [c_cv_have_curlinfo_appconnect_time="yes"],
2347 [c_cv_have_curlinfo_appconnect_time="no"]
2348 )
2349 ]
2350 )
2351 CPPFLAGS="$SAVE_CPPFLAGS"
2352 LDFLAGS="$SAVE_LDFLAGS"
2353 fi
2354
2355 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"; then
2356 AC_DEFINE([HAVE_CURLINFO_APPCONNECT_TIME], [1],
2357 [Define if curl.h defines CURLINFO_APPCONNECT_TIME.]
2358 )
2359 fi
2360
2361 if test "x$with_libcurl" = "xyes"; then
2362 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2363 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2364
2365 if test "x$have_curlopt_username" = "xyes"; then
2366 AC_DEFINE([HAVE_CURLOPT_USERNAME], [1],
2367 [Define if libcurl supports CURLOPT_USERNAME option.]
2368 )
2369 fi
2370
2371 if test "x$have_curlopt_timeout" = "xyes"; then
2372 AC_DEFINE([HAVE_CURLOPT_TIMEOUT_MS], [1],
2373 [Define if libcurl supports CURLOPT_TIMEOUT_MS option.]
2374 )
2375 fi
2376 fi
2377
2378 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2379 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2380
2381 AM_CONDITIONAL([BUILD_WITH_LIBCURL], [test "x$with_libcurl" = "xyes"])
2382 # }}}
2383
2384 # --with-libdbi {{{
2385 AC_ARG_WITH([libdbi],
2386 [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2387 [
2388 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2389 with_libdbi_cppflags="-I$withval/include"
2390 with_libdbi_ldflags="-L$withval/lib"
2391 with_libdbi="yes"
2392 else
2393 with_libdbi="$withval"
2394 fi
2395 ],
2396 [with_libdbi="yes"]
2397 )
2398
2399 if test "x$with_libdbi" = "xyes"; then
2400 SAVE_CPPFLAGS="$CPPFLAGS"
2401 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2402
2403 AC_CHECK_HEADERS([dbi/dbi.h],
2404 [with_libdbi="yes"],
2405 [with_libdbi="no (dbi/dbi.h not found)"]
2406 )
2407
2408 CPPFLAGS="$SAVE_CPPFLAGS"
2409 fi
2410
2411 if test "x$with_libdbi" = "xyes"; then
2412 SAVE_LDFLAGS="$LDFLAGS"
2413 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2414
2415 AC_CHECK_LIB([dbi], [dbi_initialize],
2416 [with_libdbi="yes"],
2417 [with_libdbi="no (Symbol 'dbi_initialize' not found)"]
2418 )
2419
2420 LDFLAGS="$SAVE_LDFLAGS"
2421 fi
2422
2423 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2424 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2425 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2426 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2427 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2428 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2429 # }}}
2430
2431 # --with-libdpdk {{{
2432 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2433 AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
2434 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2435 AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
2436
2437 AC_ARG_WITH([libdpdk],
2438 [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
2439 [with_libdpdk="$withval"],
2440 [with_libdpdk="yes"]
2441 )
2442
2443 if test "x$with_libdpdk" != "xno"; then
2444 PKG_CHECK_MODULES([DPDK], [libdpdk], [],
2445 [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
2446 if test "x$LIBDPDK_CPPFLAGS" = "x"; then
2447 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2448 fi
2449 if test "x$LIBDPDK_CFLAGS" = "x"; then
2450 LIBDPDK_CFLAGS="$DPDK_CFLAGS"
2451 LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
2452 fi
2453 if test "x$LIBDPDK_LIBS" = "x"; then
2454 if test "x$DPDK_LIBS" != "x"; then
2455 LIBDPDK_LIBS="$DPDK_LIBS"
2456 else
2457 LIBDPDK_LIBS="-ldpdk"
2458 fi
2459 fi
2460 SAVE_CPPFLAGS="$CPPFLAGS"
2461 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2462 SAVE_CFLAGS="$CFLAGS"
2463 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2464 AC_CHECK_HEADERS([rte_config.h],
2465 [
2466 with_libdpdk="yes"
2467 AC_PREPROC_IFELSE(
2468 [
2469 AC_LANG_SOURCE(
2470 [[
2471 #include <rte_version.h>
2472 #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
2473 #error "required DPDK >= 16.07"
2474 #endif
2475 ]]
2476 )
2477 ],
2478 [dpdk_keepalive="yes"],
2479 [dpdk_keepalive="no (DPDK version < 16.07)"]
2480 )
2481 ],
2482 [with_libdpdk="no (rte_config.h not found)"]
2483 )
2484 CPPFLAGS="$SAVE_CPPFLAGS"
2485 CFLAGS="$SAVE_CFLAGS"
2486 fi
2487
2488 if test "x$with_libdpdk" = "xyes"; then
2489 SAVE_LIBS="$LIBS"
2490 LIBS="$LIBDPDK_LIBS $LIBS"
2491 SAVE_LDFLAGS="$LDFLAGS"
2492 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2493 SAVE_CPPFLAGS="$CPPFLAGS"
2494 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2495 SAVE_CFLAGS="$CFLAGS"
2496 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2497 AC_LINK_IFELSE(
2498 [
2499 AC_LANG_PROGRAM(
2500 [[
2501 #include <rte_eal.h>
2502 ]],
2503 [[return rte_eal_init(0, NULL);]]
2504 )
2505 ],
2506 [with_libdpdk="yes"],
2507 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2508 )
2509 LIBS="$SAVE_LIBS"
2510 LDFLAGS="$SAVE_LDFLAGS"
2511 CPPFLAGS="$SAVE_CPPFLAGS"
2512 CFLAGS="$SAVE_CFLAGS"
2513 fi
2514
2515 # }}}
2516
2517 # --with-libesmtp {{{
2518 AC_ARG_WITH([libesmtp],
2519 [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2520 [
2521 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2522 with_libesmtp_cppflags="-I$withval/include"
2523 with_libesmtp_ldflags="-L$withval/lib"
2524 with_libesmtp="yes"
2525 else
2526 with_libesmtp="$withval"
2527 fi
2528 ],
2529 [with_libesmtp="yes"]
2530 )
2531
2532 if test "x$with_libesmtp" = "xyes"; then
2533 SAVE_CPPFLAGS="$CPPFLAGS"
2534 CPPFLAGS="$CPPFLAGS $with_libesmtp_cppflags"
2535
2536 AC_CHECK_HEADERS([libesmtp.h],
2537 [with_libesmtp="yes"],
2538 [with_libesmtp="no (libesmtp.h not found)"]
2539 )
2540
2541 CPPFLAGS="$SAVE_CPPFLAGS"
2542 fi
2543
2544 if test "x$with_libesmtp" = "xyes"; then
2545 SAVE_LDFLAGS="$LDFLAGS"
2546 LDFLAGS="$LDFLAGS $with_esmtp_ldflags"
2547
2548 AC_CHECK_LIB([esmtp], [smtp_create_session],
2549 [with_libesmtp="yes"],
2550 [with_libesmtp="no (Symbol 'smtp_create_session' not found)"]
2551 )
2552
2553 LDFLAGS="$SAVE_LDFLAGS"
2554 fi
2555
2556 BUILD_WITH_LIBESMTP_CPPFLAGS="$with_libesmtp_cppflags"
2557 BUILD_WITH_LIBESMTP_LDFLAGS="$with_libesmtp_ldflags"
2558 BUILD_WITH_LIBESMTP_LIBS="-lesmtp"
2559 AC_SUBST(BUILD_WITH_LIBESMTP_CPPFLAGS)
2560 AC_SUBST(BUILD_WITH_LIBESMTP_LDFLAGS)
2561 AC_SUBST(BUILD_WITH_LIBESMTP_LIBS)
2562 # }}}
2563
2564 # --with-libganglia {{{
2565 AC_ARG_WITH([libganglia],
2566 [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2567 [
2568 if test -f "$withval" && test -x "$withval"; then
2569 with_libganglia_config="$withval"
2570 with_libganglia="yes"
2571 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"; then
2572 with_libganglia_config="$withval/bin/ganglia-config"
2573 with_libganglia="yes"
2574 else if test -d "$withval"; then
2575 GANGLIA_CPPFLAGS="-I$withval/include"
2576 GANGLIA_LDFLAGS="-L$withval/lib"
2577 with_libganglia="yes"
2578 else
2579 with_libganglia="$withval"
2580 fi; fi; fi
2581 ],
2582 [with_libganglia="yes"]
2583 )
2584
2585 if test "x$with_libganglia" = "xyes"; then
2586 if test "x$with_libganglia_config" != "x"; then
2587 if test "x$GANGLIA_CPPFLAGS" = "x"; then
2588 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2589 fi
2590
2591 if test "x$GANGLIA_LDFLAGS" = "x"; then
2592 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2593 fi
2594
2595 if test "x$GANGLIA_LIBS" = "x"; then
2596 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2597 fi
2598 else
2599 GANGLIA_LIBS="-lganglia"
2600 fi
2601 fi
2602
2603 SAVE_CPPFLAGS="$CPPFLAGS"
2604 SAVE_LDFLAGS="$LDFLAGS"
2605 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2606 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2607
2608 if test "x$with_libganglia" = "xyes"; then
2609 AC_CHECK_HEADERS([gm_protocol.h],
2610 [with_libganglia="yes"],
2611 [with_libganglia="no (gm_protocol.h not found)"]
2612 )
2613 fi
2614
2615 if test "x$with_libganglia" = "xyes"; then
2616 AC_CHECK_LIB([ganglia], [xdr_Ganglia_value_msg],
2617 [with_libganglia="yes"],
2618 [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"]
2619 )
2620 fi
2621
2622 CPPFLAGS="$SAVE_CPPFLAGS"
2623 LDFLAGS="$SAVE_LDFLAGS"
2624
2625 AC_SUBST(GANGLIA_CPPFLAGS)
2626 AC_SUBST(GANGLIA_LDFLAGS)
2627 AC_SUBST(GANGLIA_LIBS)
2628 # }}}
2629
2630 # --with-libgcrypt {{{
2631 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2632 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2633 GCRYPT_LIBS="$GCRYPT_LIBS"
2634 AC_ARG_WITH([libgcrypt],
2635 [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2636 [
2637 if test -f "$withval" && test -x "$withval"; then
2638 with_libgcrypt_config="$withval"
2639 with_libgcrypt="yes"
2640 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"; then
2641 with_libgcrypt_config="$withval/bin/gcrypt-config"
2642 with_libgcrypt="yes"
2643 else if test -d "$withval"; then
2644 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2645 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2646 with_libgcrypt="yes"
2647 else
2648 with_libgcrypt_config="gcrypt-config"
2649 with_libgcrypt="$withval"
2650 fi; fi; fi
2651 ],
2652 [
2653 with_libgcrypt_config="libgcrypt-config"
2654 with_libgcrypt="yes"
2655 ]
2656 )
2657
2658 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"; then
2659 if test "x$GCRYPT_CPPFLAGS" = "x"; then
2660 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2661 fi
2662
2663 if test "x$GCRYPT_LIBS" = "x"; then
2664 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2665 fi
2666 fi
2667
2668 SAVE_CPPFLAGS="$CPPFLAGS"
2669 SAVE_LDFLAGS="$LDFLAGS"
2670 SAVE_LIBS="$LIBS"
2671 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2672 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2673 LIBS="$LIBS $GCRYPT_LIBS"
2674
2675 if test "x$with_libgcrypt" = "xyes"; then
2676 AC_CHECK_HEADERS([gcrypt.h],
2677 [with_libgcrypt="yes"],
2678 [with_libgcrypt="no (gcrypt.h not found)"]
2679 )
2680 fi
2681
2682 if test "x$with_libgcrypt" = "xyes"; then
2683 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2684 [with_libgcrypt="yes"],
2685 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"]
2686 )
2687 fi
2688
2689 CPPFLAGS="$SAVE_CPPFLAGS"
2690 LDFLAGS="$SAVE_LDFLAGS"
2691 LIBS="$SAVE_LIBS"
2692
2693 AC_SUBST([GCRYPT_CPPFLAGS])
2694 AC_SUBST([GCRYPT_LDFLAGS])
2695 AC_SUBST([GCRYPT_LIBS])
2696 AM_CONDITIONAL([BUILD_WITH_LIBGCRYPT], [test "x$with_libgcrypt" = "xyes"])
2697 # }}}
2698
2699 # --with-libgps {{{
2700 AC_ARG_WITH([libgps],
2701 [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2702 [
2703 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2704 with_libgps_cflags="-I$withval/include"
2705 with_libgps_ldflags="-L$withval/lib"
2706 with_libgps="yes"
2707 else
2708 with_libgps="$withval"
2709 fi
2710 ],
2711 [with_libgps="yes"]
2712 )
2713
2714 if test "x$with_libgps" = "xyes"; then
2715 SAVE_CFLAGS="$CFLAGS"
2716 CFLAGS="$CFLAGS $with_libgps_cflags"
2717
2718 AC_CHECK_HEADERS([gps.h],
2719 [with_libgps="yes"],
2720 [with_libgps="no (gps.h not found)"]
2721 )
2722
2723 CFLAGS="$SAVE_CFLAGS"
2724 fi
2725
2726 if test "x$with_libgps" = "xyes"; then
2727 SAVE_LDFLAGS="$LDFLAGS"
2728 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2729
2730 AC_CHECK_LIB([gps], [gps_open],
2731 [with_libgps="yes"],
2732 [with_libgps="no (symbol gps_open not found)"]
2733 )
2734
2735 LDFLAGS="$SAVE_LDFLAGS"
2736 fi
2737
2738 if test "x$with_libgps" = "xyes"; then
2739 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2740 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2741 BUILD_WITH_LIBGPS_LIBS="-lgps"
2742 fi
2743
2744 AC_SUBST([BUILD_WITH_LIBGPS_CFLAGS])
2745 AC_SUBST([BUILD_WITH_LIBGPS_LDFLAGS])
2746 AC_SUBST([BUILD_WITH_LIBGPS_LIBS])
2747
2748 # }}}
2749
2750 # --with-libgrpc++ {{{
2751 AC_ARG_WITH([libgrpc++],
2752 [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2753 [
2754 with_grpcpp="$withval"
2755 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2756 with_libgrpcpp_cppflags="-I$withval/include"
2757 with_libgrpcpp_ldflags="-L$withval/lib"
2758 with_libgrpcpp_bin="$withval/bin"
2759 with_libgrpcpp="yes"
2760 fi
2761 if test "x$withval" = "xno"; then
2762 with_libgrpcpp="no (disabled on command line)"
2763 fi
2764 ],
2765 [withval="yes"]
2766 )
2767 if test "x$withval" = "xyes"; then
2768 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2769 [with_libgrpcpp="yes"],
2770 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2771 )
2772 fi
2773
2774 if test "x$withval" != "xno"; then
2775 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2776 if test_cxx_flags -std=c++11; then
2777 AC_MSG_RESULT([yes])
2778 else
2779 AC_MSG_RESULT([no])
2780 with_libgrpcpp="no (requires C++11 support)"
2781 with_libprotobuf="no (<google/protobuf/util/time_util.h> requires C++11 support)"
2782 fi
2783 fi
2784
2785 if test "x$with_libgrpcpp" = "xyes"; then
2786 AC_LANG_PUSH(C++)
2787 SAVE_CPPFLAGS="$CPPFLAGS"
2788 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2789 AC_CHECK_HEADERS([grpc++/grpc++.h],
2790 [with_libgrpcpp="yes"],
2791 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2792 )
2793 CPPFLAGS="$SAVE_CPPFLAGS"
2794 AC_LANG_POP(C++)
2795 fi
2796
2797 if test "x$with_libgrpcpp" = "xyes"; then
2798 AC_LANG_PUSH(C++)
2799 SAVE_CPPFLAGS="$CPPFLAGS"
2800 SAVE_LDFLAGS="$LDFLAGS"
2801 SAVE_LIBS="$LIBS"
2802 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2803 LDFLAGS="$with_libgrpcpp_ldflags"
2804 if test "x$GRPCPP_LIBS" = "x"; then
2805 LIBS="-lgrpc++"
2806 else
2807 LIBS="$GRPCPP_LIBS"
2808 fi
2809 AC_LINK_IFELSE(
2810 [
2811 AC_LANG_PROGRAM(
2812 [[#include <grpc++/grpc++.h>]],
2813 [[grpc::ServerBuilder sb;]]
2814 )
2815 ],
2816 [
2817 with_libgrpcpp="yes"
2818 if test "x$GRPCPP_LIBS" = "x"; then
2819 GRPCPP_LIBS="-lgrpc++"
2820 fi
2821 ],
2822 [with_libgrpcpp="no (libgrpc++ not found)"]
2823 )
2824 CPPFLAGS="$SAVE_CPPFLAGS"
2825 LDFLAGS="$SAVE_LDFLAGS"
2826 LIBS="$SAVE_LIBS"
2827 AC_LANG_POP(C++)
2828 fi
2829
2830 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2831 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2832 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2833 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2834 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2835 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2836 # }}}
2837
2838 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
2839 if test "x$with_libgrpcpp_bin" = "x"; then
2840 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
2841 else
2842 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin], [], "$with_libgrpcpp_bin:$PATH")
2843 fi
2844 AM_CONDITIONAL([HAVE_GRPC_CPP], [test "x$GRPC_CPP_PLUGIN" != "x"])
2845
2846 # --with-libiptc {{{
2847 AC_ARG_WITH([libiptc],
2848 [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2849 [
2850 if test "x$withval" = "xyes"; then
2851 with_libiptc="pkgconfig"
2852 else if test "x$withval" = "xno"; then
2853 with_libiptc="no"
2854 else
2855 with_libiptc="yes"
2856 with_libiptc_cflags="-I$withval/include"
2857 with_libiptc_libs="-L$withval/lib"
2858 fi; fi
2859 ],
2860 [
2861 if test "x$ac_system" = "xLinux"; then
2862 with_libiptc="pkgconfig"
2863 else
2864 with_libiptc="no (Linux only)"
2865 fi
2866 ]
2867 )
2868
2869 if test "x$with_libiptc" = "xpkgconfig"; then
2870 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2871 if test $? -ne 0; then
2872 with_libiptc="no (pkg-config doesn't know libiptc)"
2873 fi
2874 fi
2875
2876 if test "x$with_libiptc" = "xpkgconfig"; then
2877 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2878 if test $? -ne 0; then
2879 with_libiptc="no ($PKG_CONFIG failed)"
2880 fi
2881
2882 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2883 if test $? -ne 0; then
2884 with_libiptc="no ($PKG_CONFIG failed)"
2885 fi
2886 fi
2887
2888 SAVE_CPPFLAGS="$CPPFLAGS"
2889 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2890
2891 # check whether the header file for libiptc is available.
2892 if test "x$with_libiptc" = "xpkgconfig"; then
2893 AC_CHECK_HEADERS([libiptc/libiptc.h libiptc/libip6tc.h],
2894 [],
2895 [with_libiptc="no (header file missing)"]
2896 )
2897 fi
2898
2899 # If the header file is available, check for the required type declaractions.
2900 # They may be missing in old versions of libiptc. In that case, they will be
2901 # declared in the iptables plugin.
2902 if test "x$with_libiptc" = "xpkgconfig"; then
2903 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2904 fi
2905
2906 # Check for the iptc_init symbol in the library.
2907 # This could be in iptc or ip4tc
2908 if test "x$with_libiptc" = "xpkgconfig"; then
2909 SAVE_LIBS="$LIBS"
2910 AC_SEARCH_LIBS([iptc_init], [iptc ip4tc],
2911 [with_libiptc="pkgconfig"],
2912 [with_libiptc="no"],
2913 [$with_libiptc_libs]
2914 )
2915 LIBS="$SAVE_LIBS"
2916 fi
2917
2918 if test "x$with_libiptc" = "xpkgconfig"; then
2919 with_libiptc="yes"
2920 fi
2921
2922 CPPFLAGS="$SAVE_CPPFLAGS"
2923
2924 if test "x$with_libiptc" = "xyes"; then
2925 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2926 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2927 fi
2928 AC_SUBST([BUILD_WITH_LIBIPTC_CPPFLAGS])
2929 AC_SUBST([BUILD_WITH_LIBIPTC_LDFLAGS])
2930 # }}}
2931
2932 # --with-java {{{
2933 with_java_home="$JAVA_HOME"
2934 if test "x$with_java_home" = "x"; then
2935 with_java_home="/usr/lib/jvm"
2936 fi
2937
2938 JAVAC="$JAVAC"
2939 JAR="$JAR"
2940 AC_ARG_WITH([java],
2941 [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2942 [
2943 if test "x$withval" = "xno"; then
2944 with_java="no"
2945 else if test "x$withval" = "xyes"; then
2946 with_java="yes"
2947 else
2948 with_java_home="$withval"
2949 with_java="yes"
2950 fi; fi
2951 ],
2952 [with_java="yes"]
2953 )
2954
2955 AX_COMPARE_VERSION([$am__api_version],[lt],[1.12],
2956 [JAVA_TIMESTAMP_FILE="classdist_noinst.stamp"],
2957 [JAVA_TIMESTAMP_FILE="classnoinst.stamp"])
2958 if test "x$with_java" = "xyes"; then
2959 if test -d "$with_java_home"; then
2960 AC_MSG_CHECKING([for jni.h])
2961 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2962 if test "x$TMPVAR" != "x"; then
2963 AC_MSG_RESULT([found in $TMPVAR])
2964 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2965 else
2966 AC_MSG_RESULT([not found])
2967 fi
2968
2969 AC_MSG_CHECKING([for jni_md.h])
2970 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2971 if test "x$TMPVAR" != "x"; then
2972 AC_MSG_RESULT([found in $TMPVAR])
2973 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2974 else
2975 AC_MSG_RESULT([not found])
2976 fi
2977
2978 AC_MSG_CHECKING([for libjvm.so])
2979 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2980 if test "x$TMPVAR" != "x"; then
2981 AC_MSG_RESULT([found in $TMPVAR])
2982 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2983 else
2984 AC_MSG_RESULT([not found])
2985 fi
2986
2987 if test "x$JAVAC" = "x"; then
2988 AC_MSG_CHECKING([for javac])
2989 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2990 if test "x$TMPVAR" != "x"; then
2991 JAVAC="$TMPVAR"
2992 AC_MSG_RESULT([$JAVAC])
2993 else
2994 AC_MSG_RESULT([not found])
2995 fi
2996 fi
2997
2998 if test "x$JAR" = "x"; then
2999 AC_MSG_CHECKING([for jar])
3000 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
3001 if test "x$TMPVAR" != "x"; then
3002 JAR="$TMPVAR"
3003 AC_MSG_RESULT([$JAR])
3004 else
3005 AC_MSG_RESULT([not found])
3006 fi
3007 fi
3008 else if test "x$with_java_home" != "x"; then
3009 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
3010 fi; fi
3011 fi
3012
3013 if test "x$JAVAC" = "x"; then
3014 with_javac_path="$PATH"
3015 if test "x$with_java_home" != "x"; then
3016 with_javac_path="$with_java_home:with_javac_path"
3017 if test -d "$with_java_home/bin"; then
3018 with_javac_path="$with_java_home/bin:with_javac_path"
3019 fi
3020 fi
3021
3022 AC_PATH_PROG([JAVAC], [javac], [], "$with_javac_path")
3023 fi
3024
3025 if test "x$JAVAC" = "x"; then
3026 with_java="no (javac not found)"
3027 fi
3028
3029 if test "x$JAR" = "x"; then
3030 with_jar_path="$PATH"
3031 if test "x$with_java_home" != "x"; then
3032 with_jar_path="$with_java_home:$with_jar_path"
3033 if test -d "$with_java_home/bin"; then
3034 with_jar_path="$with_java_home/bin:$with_jar_path"
3035 fi
3036 fi
3037
3038 AC_PATH_PROG([JAR], [jar], [], "$with_jar_path")
3039 fi
3040
3041 if test "x$JAR" = "x"; then
3042 with_java="no (jar not found)"
3043 fi
3044
3045 SAVE_CPPFLAGS="$CPPFLAGS"
3046 SAVE_CFLAGS="$CFLAGS"
3047 SAVE_LDFLAGS="$LDFLAGS"
3048 SAVE_LIBS="$LIBS"
3049 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
3050 CFLAGS="$CFLAGS $JAVA_CFLAGS"
3051 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
3052 LIBS="$LIBS $JAVA_LIBS"
3053
3054 if test "x$with_java" = "xyes"; then
3055 AC_CHECK_HEADERS([jni.h],
3056 [with_jave="yes"],
3057 [with_java="no (jni.h not found)"])
3058 fi
3059
3060 if test "x$with_java" = "xyes"; then
3061 AC_CHECK_LIB([jvm], [JNI_CreateJavaVM],
3062 [with_java="yes"],
3063 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
3064 [$JAVA_LIBS $PTHREAD_LIBS]
3065 )
3066 fi
3067
3068 if test "x$with_java" = "xyes"; then
3069 JAVA_LIBS="$JAVA_LIBS -ljvm"
3070 fi
3071
3072 CPPFLAGS="$SAVE_CPPFLAGS"
3073 CFLAGS="$SAVE_CFLAGS"
3074 LDFLAGS="$SAVE_LDFLAGS"
3075 LIBS="$SAVE_LIBS"
3076
3077 AC_SUBST([JAVA_CPPFLAGS])
3078 AC_SUBST([JAVA_CFLAGS])
3079 AC_SUBST([JAVA_LDFLAGS])
3080 AC_SUBST([JAVA_LIBS])
3081 AC_SUBST([JAVA_TIMESTAMP_FILE])
3082 AM_CONDITIONAL([BUILD_WITH_JAVA], [test "x$with_java" = "xyes"])
3083 # }}}
3084
3085 # --with-libldap {{{
3086 AC_ARG_WITH([libldap],
3087 [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
3088 [
3089 if test "x$withval" = "xyes"; then
3090 with_libldap="yes"
3091 else if test "x$withval" = "xno"; then
3092 with_libldap="no"
3093 else
3094 with_libldap="yes"
3095 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
3096 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
3097 fi; fi
3098 ],
3099 [with_libldap="yes"]
3100 )
3101
3102 SAVE_CPPFLAGS="$CPPFLAGS"
3103 SAVE_LDFLAGS="$LDFLAGS"
3104
3105 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
3106 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
3107
3108 if test "x$with_libldap" = "xyes"; then
3109 AC_CHECK_HEADERS([ldap.h],
3110 [with_libldap="yes"],
3111 [with_libldap="no ('ldap.h' not found)"]
3112 )
3113 fi
3114
3115 if test "x$with_libldap" = "xyes"; then
3116 AC_CHECK_LIB([ldap], [ldap_initialize],
3117 [with_libldap="yes"],
3118 [with_libldap="no (symbol 'ldap_initialize' not found)"]
3119 )
3120 fi
3121
3122 CPPFLAGS="$SAVE_CPPFLAGS"
3123 LDFLAGS="$SAVE_LDFLAGS"
3124
3125 if test "x$with_libldap" = "xyes"
3126 then
3127 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
3128 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
3129 fi
3130 AC_SUBST([BUILD_WITH_LIBLDAP_CPPFLAGS])
3131 AC_SUBST([BUILD_WITH_LIBLDAP_LDFLAGS])
3132 # }}}
3133
3134 # --with-liblua {{{
3135 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
3136 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
3137 then
3138 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
3139 [with_liblua="yes"],
3140 [with_liblua="no"]
3141 )
3142 else
3143 PKG_CHECK_MODULES([LUA], [lua],
3144 [with_liblua="yes"],
3145 [
3146 PKG_CHECK_MODULES([LUA], [lua-5.3],
3147 [with_liblua="yes"],
3148 [
3149 PKG_CHECK_MODULES([LUA], [lua5.3],
3150 [with_liblua="yes"],
3151 [
3152 PKG_CHECK_MODULES([LUA], [lua53],
3153 [with_liblua="yes"],
3154 [
3155 PKG_CHECK_MODULES([LUA], [lua-5.2],
3156 [with_liblua="yes"],
3157 [
3158 PKG_CHECK_MODULES([LUA], [lua5.2],
3159 [with_liblua="yes"],
3160 [
3161 PKG_CHECK_MODULES([LUA], [lua52],
3162 [with_liblua="yes"],
3163 [
3164 PKG_CHECK_MODULES([LUA], [lua-5.1],
3165 [with_liblua="yes"],
3166 [
3167 PKG_CHECK_MODULES([LUA], [lua5.1],
3168 [with_liblua="yes"],
3169 [
3170 PKG_CHECK_MODULES([LUA], [lua51],
3171 [with_liblua="yes"],
3172 [with_liblua="no (pkg-config cannot find liblua)"]
3173 )
3174 ]
3175 )
3176 ]
3177 )
3178 ]
3179 )
3180 ]
3181 )
3182 ]
3183 )
3184 ]
3185 )
3186 ]
3187 )
3188 ]
3189 )
3190 ]
3191 )
3192 fi
3193
3194 if test "x$with_liblua" = "xyes"
3195 then
3196 SAVE_CPPFLAGS="$CPPFLAGS"
3197 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
3198
3199 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
3200 [with_liblua="yes"],
3201 [with_liblua="no (header not found)"]
3202 )
3203
3204 CPPFLAGS="$SAVE_CPPFLAGS"
3205 fi
3206
3207 if test "x$with_liblua" = "xyes"
3208 then
3209 SAVE_LIBS="$LIBS"
3210 LIBS="$LIBS $LUA_LIBS"
3211
3212 AC_CHECK_FUNC([lua_settop],
3213 [with_liblua="yes"],
3214 [with_liblua="no (symbol 'lua_settop' not found)"]
3215 )
3216
3217 LIBS="$SAVE_LIBS"
3218 fi
3219
3220 if test "x$with_liblua" = "xyes"
3221 then
3222 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
3223 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
3224 fi
3225 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
3226 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
3227 # }}}
3228
3229 # --with-libmemcached {{{
3230 AC_ARG_WITH([libmemcached],
3231 [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3232 [
3233 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3234 with_libmemcached_cppflags="-I$withval/include"
3235 with_libmemcached_ldflags="-L$withval/lib"
3236 with_libmemcached="yes"
3237 else
3238 with_libmemcached="$withval"
3239 fi
3240 ],
3241 [with_libmemcached="yes"]
3242 )
3243
3244 if test "x$with_libmemcached" = "xyes"; then
3245 SAVE_CPPFLAGS="$CPPFLAGS"
3246 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3247
3248 AC_CHECK_HEADERS([libmemcached/memcached.h],
3249 [with_libmemcached="yes"],
3250 [with_libmemcached="no (libmemcached/memcached.h not found)"]
3251 )
3252
3253 CPPFLAGS="$SAVE_CPPFLAGS"
3254 fi
3255
3256 if test "x$with_libmemcached" = "xyes"; then
3257 SAVE_CPPFLAGS="$CPPFLAGS"
3258 SAVE_LDFLAGS="$LDFLAGS"
3259 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3260 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3261
3262 AC_CHECK_LIB([memcached], [memcached_create],
3263 [with_libmemcached="yes"],
3264 [with_libmemcached="no (Symbol 'memcached_create' not found)"]
3265 )
3266
3267 CPPFLAGS="$SAVE_CPPFLAGS"
3268 LDFLAGS="$SAVE_LDFLAGS"
3269 fi
3270
3271 if test "x$with_libmemcached" = "xyes"; then
3272 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3273 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3274 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3275 fi
3276
3277 AC_SUBST([BUILD_WITH_LIBMEMCACHED_CPPFLAGS])
3278 AC_SUBST([BUILD_WITH_LIBMEMCACHED_LDFLAGS])
3279 AC_SUBST([BUILD_WITH_LIBMEMCACHED_LIBS])
3280 # }}}
3281
3282 # --with-libmicrohttpd {{{
3283 with_libmicrohttpd_cppflags=""
3284 with_libmicrohttpd_ldflags=""
3285 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3286 [
3287 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3288 with_libmicrohttpd_cppflags="-I$withval/include"
3289 with_libmicrohttpd_ldflags="-L$withval/lib"
3290 with_libmicrohttpd="yes"
3291 fi
3292 if test "x$withval" = "xno"; then
3293 with_libmicrohttpd="no (disabled on command line)"
3294 fi
3295 ],
3296 [withval="yes"]
3297 )
3298 if test "x$withval" = "xyes"; then
3299 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3300 [with_libmicrohttpd="yes"],
3301 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3302 )
3303 fi
3304
3305 if test "x$MICROHTTPD_LIBS" = "x"; then
3306 MICROHTTPD_LIBS="-lmicrohttpd"
3307 fi
3308
3309 SAVE_CPPFLAGS="$CPPFLAGS"
3310 SAVE_LDFLAGS="$LDFLAGS"
3311 SAVE_LIBS="$LIBS"
3312 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3313 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3314 LIBS="$LIBS $MICROHTTPD_LIBS"
3315
3316 if test "x$with_libmicrohttpd" = "xyes"; then
3317 AC_CHECK_HEADERS([microhttpd.h],
3318 [with_libmicrohttpd="yes"],
3319 [with_libmicrohttpd="no (<microhttpd.h> not found)"]
3320 )
3321 fi
3322
3323 if test "x$with_libmicrohttpd" = "xyes"; then
3324 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3325 [with_libmicrohttpd="yes"],
3326 [with_libmicrohttpd="no (libmicrohttpd not found)"]
3327 )
3328 fi
3329
3330 CPPFLAGS="$SAVE_CPPFLAGS"
3331 LDFLAGS="$SAVE_LDFLAGS"
3332 LIBS="$SAVE_LIBS"
3333
3334 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3335 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3336 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3337 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3338 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3339 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3340 # }}}
3341
3342 # --with-libmodbus {{{
3343 AC_ARG_WITH([libmodbus],
3344 [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3345 [
3346 if test "x$withval" = "xno"; then
3347 with_libmodbus="no"
3348 else if test "x$withval" = "xyes"; then
3349 with_libmodbus="use_pkgconfig"
3350 else if test -d "$with_libmodbus/lib"; then
3351 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3352 with_libmodbus_cflags="-I$withval/include"
3353 with_libmodbus_libs="-L$withval/lib -lmodbus"
3354 with_libmodbus="yes"
3355 fi; fi; fi
3356 ],
3357 [with_libmodbus="use_pkgconfig"]
3358 )
3359
3360 # configure using pkg-config
3361 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3362 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3363 if test $? -ne 0; then
3364 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3365 fi
3366 fi
3367
3368 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3369 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3370 if test $? -ne 0; then
3371 with_libmodbus="no ($PKG_CONFIG failed)"
3372 fi
3373
3374 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3375 if test $? -ne 0; then
3376 with_libmodbus="no ($PKG_CONFIG failed)"
3377 fi
3378 fi
3379
3380 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3381 with_libmodbus="yes"
3382 fi
3383
3384 if test "x$with_libmodbus" = "xyes"; then
3385 SAVE_CPPFLAGS="$CPPFLAGS"
3386 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3387
3388 AC_CHECK_HEADERS([modbus.h],
3389 [with_libmodbus="yes"],
3390 [with_libmodbus="no (modbus.h not found)"]
3391 )
3392
3393 CPPFLAGS="$SAVE_CPPFLAGS"
3394 fi
3395
3396 if test "x$with_libmodbus" = "xyes"; then
3397 SAVE_LDFLAGS="$LDFLAGS"
3398 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3399
3400 AC_CHECK_LIB([modbus], [modbus_connect],
3401 [with_libmodbus="yes"],
3402 [with_libmodbus="no (symbol modbus_connect not found)"]
3403 )
3404
3405 LDFLAGS="$SAVE_LDFLAGS"
3406 fi
3407
3408 if test "x$with_libmodbus" = "xyes"; then
3409 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3410 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3411 fi
3412
3413 AC_SUBST([BUILD_WITH_LIBMODBUS_CFLAGS])
3414 AC_SUBST([BUILD_WITH_LIBMODBUS_LIBS])
3415 # }}}
3416
3417 # --with-libmongoc {{{
3418 AC_ARG_WITH([libmongoc],
3419 [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3420 [
3421 if test "x$withval" = "xyes"; then
3422 with_libmongoc="yes"
3423 else if test "x$withval" = "xno"; then
3424 with_libmongoc="no"
3425 else
3426 with_libmongoc="no"
3427 fi; fi
3428 ],
3429 [with_libmongoc="yes"]
3430 )
3431
3432 if test "x$with_libmongoc" = "xyes"; then
3433 PKG_CHECK_MODULES([LIBMONGOC], [libmongoc-1.0],
3434 [with_libmongoc="yes"],
3435 [with_libmongoc="no (pkg-config could not find libmongoc)"]
3436 )
3437 fi
3438
3439 if test "x$with_libmongoc" = "xyes"; then
3440 SAVE_CPPFLAGS="$CPPFLAGS"
3441
3442 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS"
3443
3444 AC_CHECK_HEADERS([mongoc.h],
3445 [with_libmongoc="yes"],
3446 [with_libmongoc="no ('mongoc.h' not found)"]
3447 )
3448
3449 CPPFLAGS="$SAVE_CPPFLAGS"
3450 fi
3451
3452 if test "x$with_libmongoc" = "xyes"; then
3453 SAVE_CPPFLAGS="$CPPFLAGS"
3454 SAVE_LDFLAGS="$LDFLAGS"
3455
3456 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS"
3457 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3458
3459 AC_CHECK_LIB([mongoc-1.0], [mongoc_init],
3460 [with_libmongoc="yes"],
3461 [with_libmongoc="no (symbol 'mongoc_init' not found)"]
3462 )
3463
3464 CPPFLAGS="$SAVE_CPPFLAGS"
3465 LDFLAGS="$SAVE_LDFLAGS"
3466 fi
3467
3468 if test "x$with_libmongoc" = "xyes"; then
3469 BUILD_WITH_LIBMONGOC_CFLAGS="$LIBMONGOC_CFLAGS"
3470 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3471 BUILD_WITH_LIBMONGOC_LIBS="$LIBMONGOC_LIBS"
3472 fi
3473
3474 AC_SUBST([BUILD_WITH_LIBMONGOC_CFLAGS])
3475 AC_SUBST([BUILD_WITH_LIBMONGOC_LDFLAGS])
3476 AC_SUBST([BUILD_WITH_LIBMONGOC_LIBS])
3477 # }}}
3478
3479 # --with-libmosquitto {{{
3480 AC_ARG_WITH([libmosquitto],
3481 [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3482 [
3483 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3484 with_libmosquitto_cppflags="-I$withval/include"
3485 with_libmosquitto_ldflags="-L$withval/lib"
3486 with_libmosquitto="yes"
3487 else
3488 with_libmosquitto="$withval"
3489 fi
3490 ],
3491 [with_libmosquitto="yes"]
3492 )
3493
3494 if test "x$with_libmosquitto" = "xyes"; then
3495 SAVE_CPPFLAGS="$CPPFLAGS"
3496 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3497
3498 AC_CHECK_HEADERS([mosquitto.h],
3499 [with_libmosquitto="yes"],
3500 [with_libmosquitto="no (mosquitto.h not found)"]
3501 )
3502
3503 CPPFLAGS="$SAVE_CPPFLAGS"
3504 fi
3505
3506 if test "x$with_libmosquitto" = "xyes"; then
3507 SAVE_LDFLAGS="$LDFLAGS"
3508 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3509
3510 AC_CHECK_LIB([mosquitto], [mosquitto_connect],
3511 [with_libmosquitto="yes"],
3512 [with_libmosquitto="no (libmosquitto not found)"]
3513 )
3514
3515 LDFLAGS="$SAVE_LDFLAGS"
3516 fi
3517
3518 if test "x$with_libmosquitto" = "xyes"; then
3519 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3520 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3521 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3522 fi
3523
3524 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_CPPFLAGS])
3525 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_LDFLAGS])
3526 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_LIBS])
3527 # }}}
3528
3529 # --with-libmysql {{{
3530 with_mysql_config="mysql_config"
3531 AC_ARG_WITH([libmysql],
3532 [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3533 [
3534 if test "x$withval" = "xno"; then
3535 with_libmysql="no"
3536 else if test "x$withval" = "xyes"; then
3537 with_libmysql="yes"
3538 else
3539 if test -f "$withval" && test -x "$withval"; then
3540 with_mysql_config="$withval"
3541 else if test -x "$withval/bin/mysql_config"; then
3542 with_mysql_config="$withval/bin/mysql_config"
3543 fi; fi
3544 with_libmysql="yes"
3545 fi; fi
3546 ],
3547 [with_libmysql="yes"]
3548 )
3549
3550 if test "x$with_libmysql" = "xyes"; then
3551 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3552 if test $? -ne 0; then
3553 with_libmysql="no ($with_mysql_config failed)"
3554 else
3555 SAVE_CPPFLAGS="$CPPFLAGS"
3556 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3557
3558 AC_CHECK_HEADERS([mysql.h],
3559 [have_mysql_h="yes"],
3560 [have_mysql_h="no"]
3561 )
3562
3563 if test "x$have_mysql_h" != "xyes"; then
3564 AC_CHECK_HEADERS([mysql/mysql.h],
3565 [have_mysql_mysql_h="yes"],
3566 [],
3567 )
3568 fi
3569
3570 if test "x$have_mysql_h" != "xyes" && test "x$have_mysql_mysql_h" != "xyes"; then
3571 with_libmysql="no (mysql.h not found)"
3572 fi
3573
3574 CPPFLAGS="$SAVE_CPPFLAGS"
3575 fi
3576 fi
3577
3578 if test "x$with_libmysql" = "xyes"; then
3579 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3580 if test $? -ne 0; then
3581 with_libmysql="no ($with_mysql_config failed)"
3582 else
3583 SAVE_LIBS="$LIBS"
3584 LIBS="$with_mysql_libs"
3585
3586 AC_SEARCH_LIBS([mysql_get_server_version],
3587 [],
3588 [with_libmysql="yes"],
3589 [with_libmysql="no (symbol 'mysql_get_server_version' not found in ${LIBS})"],
3590 []
3591 )
3592 LIBS="$SAVE_LIBS"
3593 fi
3594 fi
3595
3596 if test "x$with_libmysql" = "xyes"; then
3597 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3598 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3599 fi
3600
3601 AC_SUBST([BUILD_WITH_LIBMYSQL_CFLAGS])
3602 AC_SUBST([BUILD_WITH_LIBMYSQL_LIBS])
3603 # }}}
3604
3605 # --with-libmnl {{{
3606 AC_ARG_WITH([libmnl],
3607 [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3608 [
3609 if test "x$withval" = "xyes"; then
3610 with_libmnl="yes"
3611 else if test "x$withval" = "xno"; then
3612 with_libmnl="no"
3613 else
3614 if test -d "$withval/include"; then
3615 with_libmnl_cflags="-I$withval/include"
3616 with_libmnl_libs="-L$withval/lib -lmnl"
3617 with_libmnl="yes"
3618 else
3619 AC_MSG_ERROR("no such directory: $withval/include")
3620 fi
3621 fi; fi
3622 ],
3623 [
3624 if test "x$ac_system" = "xLinux"; then
3625 with_libmnl="yes"
3626 else
3627 with_libmnl="no (Linux only library)"
3628 fi
3629 ]
3630 )
3631
3632 if test "x$with_libmnl" = "xyes"; then
3633 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3634 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3635 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3636 fi
3637
3638 AC_CHECK_HEADERS([libmnl.h libmnl/libmnl.h],
3639 [
3640 with_libmnl="yes"
3641 break
3642 ],
3643 [],
3644 [[
3645 #include <stdio.h>
3646 #include <sys/types.h>
3647 #include <asm/types.h>
3648 #include <sys/socket.h>
3649 #include <linux/netlink.h>
3650 #include <linux/rtnetlink.h>]]
3651 )
3652
3653 AC_CHECK_HEADERS([linux/gen_stats.h linux/pkt_sched.h],
3654 [],
3655 [],
3656 [[
3657 #include <stdio.h>
3658 #include <sys/types.h>
3659 #include <asm/types.h>
3660 #include <sys/socket.h>
3661 ]]
3662 )
3663
3664 AC_COMPILE_IFELSE(
3665 [
3666 AC_LANG_PROGRAM(
3667 [[
3668 #include <stdio.h>
3669 #include <sys/types.h>
3670 #include <asm/types.h>
3671 #include <sys/socket.h>
3672 #include <linux/netlink.h>
3673 #include <linux/rtnetlink.h>
3674 ]],
3675 [[
3676 int retval = TCA_STATS2;
3677 return retval;
3678 ]]
3679 )
3680 ],
3681 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])]
3682 )
3683
3684 AC_COMPILE_IFELSE(
3685 [
3686 AC_LANG_PROGRAM(
3687 [[
3688 #include <stdio.h>
3689 #include <sys/types.h>
3690 #include <asm/types.h>
3691 #include <sys/socket.h>
3692 #include <linux/netlink.h>
3693 #include <linux/rtnetlink.h>
3694 ]],
3695 [[
3696 int retval = TCA_STATS;
3697 return retval;
3698 ]]
3699 )
3700 ],
3701 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
3702 )
3703
3704 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3705 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3706 [],
3707 [[#include <linux/if_link.h>]]
3708 )
3709
3710 AC_CHECK_MEMBERS([struct rtnl_link_stats.rx_nohandler],
3711 [],
3712 [],
3713 [[#include <linux/if_link.h>]]
3714 )
3715
3716 AC_CHECK_MEMBERS([struct rtnl_link_stats64.rx_nohandler],
3717 [],
3718 [],
3719 [[#include <linux/if_link.h>]]
3720 )
3721
3722 AC_CHECK_DECLS([IFLA_VF_STATS_RX_DROPPED],
3723 [AC_DEFINE(HAVE_IFLA_VF_STATS_RX_DROPPED, 1, [Define if IFLA_VF_STATS_RX_DROPPED exists.])],
3724 [],
3725 [[#include <linux/if_link.h>]]
3726 )
3727
3728 AC_CHECK_DECLS([IFLA_VF_STATS_TX_DROPPED],
3729 [AC_DEFINE(HAVE_IFLA_VF_STATS_TX_DROPPED, 1, [Define if IFLA_VF_STATS_TX_DROPPED exists.])],
3730 [],
3731 [[#include <linux/if_link.h>]]
3732 )
3733
3734 AC_CHECK_DECLS([IFLA_VF_STATS],
3735 [AC_DEFINE(HAVE_IFLA_VF_STATS, 1, [Define if IFLA_VF_STATS exists.])],
3736 [],
3737 [[#include <linux/if_link.h>]]
3738 )
3739
3740 AC_CHECK_LIB([mnl], [mnl_nlmsg_get_payload],
3741 [with_libmnl="yes"],
3742 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3743 [$with_libmnl_libs]
3744 )
3745 fi
3746
3747 if test "x$with_libmnl" = "xyes"; then
3748 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3749 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3750 fi
3751 AC_SUBST([BUILD_WITH_LIBMNL_CFLAGS])
3752 AC_SUBST([BUILD_WITH_LIBMNL_LIBS])
3753 AM_CONDITIONAL([HAVE_LIBMNL], [test "x$with_libmnl" = "xyes"])
3754 # }}}
3755
3756 # --with-libnetapp {{{
3757 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3758 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3759 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3760 AC_ARG_WITH([libnetapp],
3761 [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3762 [
3763 if test -d "$withval"; then
3764 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3765 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3766 with_libnetapp="yes"
3767 else
3768 with_libnetapp="$withval"
3769 fi
3770 ],
3771 [with_libnetapp="yes"]
3772 )
3773
3774 SAVE_CPPFLAGS="$CPPFLAGS"
3775 SAVE_LDFLAGS="$LDFLAGS"
3776 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3777 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3778
3779 if test "x$with_libnetapp" = "xyes"; then
3780 AC_CHECK_HEADERS([netapp_api.h],
3781 [with_libnetapp="yes"],
3782 [with_libnetapp="no (netapp_api.h not found)"]
3783 )
3784 fi
3785
3786 if test "x$with_libnetapp" = "xyes"; then
3787 if test "x$LIBNETAPP_LIBS" = "x"; then
3788 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3789 fi
3790
3791 AC_CHECK_LIB([netapp], [na_server_invoke_elem],
3792 [with_libnetapp="yes"],
3793 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3794 [$LIBNETAPP_LIBS]
3795 )
3796
3797 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3798 fi
3799
3800 CPPFLAGS="$SAVE_CPPFLAGS"
3801 LDFLAGS="$SAVE_LDFLAGS"
3802
3803 AC_SUBST([LIBNETAPP_CPPFLAGS])
3804 AC_SUBST([LIBNETAPP_LDFLAGS])
3805 AC_SUBST([LIBNETAPP_LIBS])
3806 # }}}
3807
3808 # --with-libnetsnmp {{{
3809 AC_ARG_WITH([libnetsnmp],
3810 [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to libnetsnmp.])],
3811 [
3812 if test "x$withval" = "xno"; then
3813 with_libnetsnmp="no"
3814 else if test "x$withval" = "xyes"; then
3815 with_libnetsnmp="yes"
3816 else
3817 with_libnetsnmp_cppflags="-I$withval/include"
3818 with_libnetsnmp_ldflags="-I$withval/lib"
3819 with_libnetsnmp="yes"
3820 fi; fi
3821 ],
3822 [with_libnetsnmp="yes"]
3823 )
3824
3825 if test "x$with_libnetsnmp" = "xyes"; then
3826 SAVE_CPPFLAGS="$CPPFLAGS"
3827 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3828
3829 AC_CHECK_HEADERS([net-snmp/net-snmp-config.h],
3830 [with_libnetsnmp="yes"],
3831 [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]
3832 )
3833
3834 AC_CHECK_HEADERS([net-snmp/net-snmp-includes.h],
3835 [with_libnetsnmp="yes"],
3836 [with_libnetsnmp="no (net-snmp/net-snmp-includes.h not found)"],
3837 [[
3838 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3839 # include <net-snmp/net-snmp-config.h>
3840 #endif
3841 ]]
3842 )
3843
3844 CPPFLAGS="$SAVE_CPPFLAGS"
3845 fi
3846
3847 if test "x$with_libnetsnmp" = "xyes"; then
3848 SAVE_LDFLAGS="$LDFLAGS"
3849 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3850
3851 AC_CHECK_LIB([netsnmp], [init_snmp],
3852 [with_libnetsnmp="yes"],
3853 [with_libnetsnmp="no (libnetsnmp not found)"]
3854 )
3855
3856 LDFLAGS="$SAVE_LDFLAGS"
3857 fi
3858
3859 if test "x$with_libnetsnmp" = "xyes"; then
3860 SAVE_LDFLAGS="$LDFLAGS"
3861 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3862
3863 AC_CHECK_LIB([netsnmp], [netsnmp_get_version],
3864 [with_libnetsnmp="yes"],
3865 [with_libnetsnmp="no (couldn't get libnetsnmp version)"]
3866 )
3867
3868 LDFLAGS="$SAVE_LDFLAGS"
3869 fi
3870
3871 if test "x$with_libnetsnmp" = "xyes"; then
3872 SAVE_CPPFLAGS="$CPPFLAGS"
3873 SAVE_LDFLAGS="$LDFLAGS"
3874 SAVE_LIBS="$LIBS"
3875 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3876 if test "x$GCC" = "xyes"; then
3877 CPPFLAGS="$CPPFLAGS -Wall -Werror"
3878 fi
3879 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3880 LIBS="$LIBS -lnetsnmp"
3881
3882 AC_CACHE_CHECK([whether netsnmp library has old API],
3883 [c_cv_have_netsnmp_old_api],
3884 [
3885 AC_LINK_IFELSE(
3886 [
3887 AC_LANG_PROGRAM(
3888 [[
3889 #include <net-snmp/net-snmp-config.h>
3890 #include <net-snmp/net-snmp-includes.h>
3891 ]],
3892 [[
3893 netsnmp_variable_list *key = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);;
3894 int val;
3895 u_char type = ASN_INTEGER;
3896 snmp_set_var_value(key, &val, sizeof(val));
3897 snmp_set_var_typed_value(key, type, &val, sizeof(val));
3898 return 0;
3899 ]]
3900 )
3901 ],
3902 [c_cv_have_netsnmp_old_api="no"],
3903 [c_cv_have_netsnmp_old_api="yes"]
3904 )
3905 ]
3906 )
3907
3908 if test "x$c_cv_have_netsnmp_old_api" = "xyes"; then
3909 AC_DEFINE([HAVE_NETSNMP_OLD_API], [1],
3910 ["Define 1 if you have old netsnmp API]")
3911 fi
3912
3913 CPPFLAGS="$SAVE_CPPFLAGS"
3914 LDFLAGS="$SAVE_LDFLAGS"
3915 LIBS="$SAVE_LIBS"
3916 fi
3917
3918 if test "x$with_libnetsnmp" = "xyes"; then
3919 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3920 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3921 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3922 fi
3923
3924 AC_SUBST([BUILD_WITH_LIBNETSNMP_CPPFLAGS])
3925 AC_SUBST([BUILD_WITH_LIBNETSNMP_LDFLAGS])
3926 AC_SUBST([BUILD_WITH_LIBNETSNMP_LIBS])
3927 # }}}
3928
3929 # --with-libnetsnmpagent {{{
3930 AC_ARG_WITH([libnetsnmpagent],
3931 [AS_HELP_STRING([--with-libnetsnmpagent@<:@=PREFIX@:>@], [Path to libnetsnmpagent.])],
3932 [
3933 if test "x$withval" = "xno"; then
3934 with_libnetsnmpagent="no"
3935 else if test "x$withval" = "xyes"; then
3936 with_libnetsnmpagent="yes"
3937 else
3938 with_libnetsnmpagent_cppflags="-I$withval/include"
3939 with_libnetsnmpagent_ldflags="-I$withval/lib"
3940 with_libnetsnmpagent="yes"
3941 fi; fi
3942 ],
3943 [with_libnetsnmpagent="yes"]
3944 )
3945
3946 if test "x$with_libnetsnmpagent" = "xyes"; then
3947 SAVE_CPPFLAGS="$CPPFLAGS"
3948 CPPFLAGS="$CPPFLAGS $with_libnetsnmpagent_cppflags"
3949
3950 AC_CHECK_HEADERS([net-snmp/agent/net-snmp-agent-includes.h],
3951 [],
3952 [with_libnetsnmpagent="no (net-snmp/agent/net-snmp-agent-includes.h not found)"],
3953 [[
3954 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3955 # include <net-snmp/net-snmp-config.h>
3956 #endif
3957 #if HAVE_NET_SNMP_NET_SNMP_INCLUDES_H
3958 # include <net-snmp/net-snmp-includes.h>
3959 #endif
3960 ]]
3961 )
3962
3963 CPPFLAGS="$SAVE_CPPFLAGS"
3964 fi
3965
3966 if test "x$with_libnetsnmpagent" = "xyes"; then
3967 SAVE_LDFLAGS="$LDFLAGS"
3968 LDFLAGS="$LDFLAGS $with_libnetsnmpagent_ldflags"
3969
3970 # older versions of libnetsnmpagent fail to link
3971 # against the helpers library, so do that explicitly
3972 AC_CHECK_LIB([netsnmphelpers], [netsnmp_init_helpers],
3973 [libnetsnmphelpers="-lnetsnmphelpers"],
3974 [libnetsnmphelpers=""]
3975 )
3976
3977 AC_CHECK_LIB([netsnmpagent], [init_agent],
3978 [
3979 # libnetsnmp can be built without mib loading support
3980 AC_CHECK_LIB([netsnmp], [get_tree],
3981 [with_libnetsnmpagent="yes"],
3982 [with_libnetsnmpagent="no (libnetsnmp doesn't support mib loading)"]
3983 )
3984 ],
3985 [with_libnetsnmpagent="no (libnetsnmpagent not found)"],
3986 [$libnetsnmphelpers]
3987 )
3988
3989 LDFLAGS="$SAVE_LDFLAGS"
3990 fi
3991
3992 if test "x$with_libnetsnmpagent" = "xyes"; then
3993 BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS="$with_libnetsnmpagent_cppflags"
3994 BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS="$with_libnetsnmpagent_ldflags"
3995 BUILD_WITH_LIBNETSNMPAGENT_LIBS="-lnetsnmpagent $libnetsnmphelpers"
3996 fi
3997
3998 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS])
3999 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS])
4000 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LIBS])
4001 # }}}
4002
4003 # --with-liboping {{{
4004 AC_ARG_WITH([liboping],
4005 [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
4006 [
4007 if test "x$withval" = "xyes"; then
4008 with_liboping="yes"
4009 else if test "x$withval" = "xno"; then
4010 with_liboping="no"
4011 else
4012 with_liboping="yes"
4013 LIBOPING_CPPFLAGS="-I$withval/include"
4014 LIBOPING_LDFLAGS="-L$withval/lib"
4015 fi; fi
4016 ],
4017 [with_liboping="yes"]
4018 )
4019
4020 SAVE_CPPFLAGS="$CPPFLAGS"
4021 SAVE_LDFLAGS="$LDFLAGS"
4022 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
4023 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
4024
4025 if test "x$with_liboping" = "xyes"; then
4026 AC_CHECK_HEADERS([oping.h],
4027 [with_liboping="yes"],
4028 [with_liboping="no (oping.h not found)"]
4029 )
4030 fi
4031
4032 if test "x$with_liboping" = "xyes"; then
4033 AC_CHECK_LIB([oping], [ping_construct],
4034 [with_liboping="yes"],
4035 [with_liboping="no (symbol 'ping_construct' not found)"]
4036 )
4037 fi
4038
4039 CPPFLAGS="$SAVE_CPPFLAGS"
4040 LDFLAGS="$SAVE_LDFLAGS"
4041
4042 if test "x$with_liboping" = "xyes"; then
4043 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
4044 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
4045 fi
4046
4047 AC_SUBST([BUILD_WITH_LIBOPING_CPPFLAGS])
4048 AC_SUBST([BUILD_WITH_LIBOPING_LDFLAGS])
4049 # }}}
4050
4051 # --with-oracle {{{
4052 AC_ARG_WITH([oracle],
4053 [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
4054 [
4055 if test "x$withval" = "xyes"; then
4056 if test "x$ORACLE_HOME" = "x"; then
4057 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
4058 fi
4059 with_oracle="yes"
4060 else if test "x$withval" = "xno"; then
4061 with_oracle="no"
4062 else
4063 with_oracle="yes"
4064 ORACLE_HOME="$withval"
4065 fi; fi
4066 ],
4067 [
4068 if test "x$ORACLE_HOME" = "x"; then
4069 with_oracle="no (ORACLE_HOME is not set)"
4070 else
4071 with_oracle="yes"
4072 fi
4073 ]
4074 )
4075
4076 if test "x$ORACLE_HOME" != "x"; then
4077 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
4078 if test -e "$ORACLE_HOME/lib/ldflags"; then
4079 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
4080 fi
4081 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
4082 fi
4083
4084 if test "x$with_oracle" = "xyes"; then
4085 SAVE_CPPFLAGS="$CPPFLAGS"
4086 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
4087
4088 AC_CHECK_HEADERS([oci.h],
4089 [with_oracle="yes"],
4090 [with_oracle="no (oci.h not found)"]
4091 )
4092
4093 CPPFLAGS="$SAVE_CPPFLAGS"
4094 fi
4095
4096 if test "x$with_oracle" = "xyes"; then
4097 SAVE_CPPFLAGS="$CPPFLAGS"
4098 SAVE_LIBS="$LIBS"
4099 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
4100 LIBS="$LIBS $with_oracle_libs"
4101
4102 AC_CHECK_FUNC([OCIEnvCreate],
4103 [with_oracle="yes"],
4104 [with_oracle="no (Symbol 'OCIEnvCreate' not found)"]
4105 )
4106
4107 CPPFLAGS="$SAVE_CPPFLAGS"
4108 LIBS="$SAVE_LIBS"
4109 fi
4110
4111 if test "x$with_oracle" = "xyes"; then
4112 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
4113 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
4114 fi
4115
4116 AC_SUBST([BUILD_WITH_ORACLE_CPPFLAGS])
4117 AC_SUBST([BUILD_WITH_ORACLE_LIBS])
4118 # }}}
4119
4120 # --with-libowcapi {{{
4121 AC_ARG_WITH([libowcapi],
4122 [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
4123 [
4124 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4125 with_libowcapi_cppflags="-I$withval/include"
4126 with_libowcapi_ldflags="-L$withval/lib"
4127 with_libowcapi="yes"
4128 else
4129 with_libowcapi="$withval"
4130 fi
4131 ],
4132 [with_libowcapi="yes"]
4133 )
4134
4135 if test "x$with_libowcapi" = "xyes"; then
4136 SAVE_CPPFLAGS="$CPPFLAGS"
4137 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
4138
4139 AC_CHECK_HEADERS([owcapi.h],
4140 [with_libowcapi="yes"],
4141 [with_libowcapi="no (owcapi.h not found)"]
4142 )
4143
4144 CPPFLAGS="$SAVE_CPPFLAGS"
4145 fi
4146
4147 if test "x$with_libowcapi" = "xyes"; then
4148 SAVE_LDFLAGS="$LDFLAGS"
4149 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
4150
4151 AC_CHECK_LIB([owcapi], [OW_get],
4152 [with_libowcapi="yes"],
4153 [with_libowcapi="no (libowcapi not found)"]
4154 )
4155
4156 LDFLAGS="$SAVE_LDFLAGS"
4157 fi
4158
4159 if test "x$with_libowcapi" = "xyes"; then
4160 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
4161 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
4162 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
4163 fi
4164
4165 AC_SUBST([BUILD_WITH_LIBOWCAPI_CPPFLAGS])
4166 AC_SUBST([BUILD_WITH_LIBOWCAPI_LDFLAGS])
4167 AC_SUBST([BUILD_WITH_LIBOWCAPI_LIBS])
4168 # }}}
4169
4170 # --with-libpcap {{{
4171 AC_ARG_WITH([libpcap],
4172 [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
4173 [
4174 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4175 with_libpcap_cppflags="-I$withval/include"
4176 with_libpcap_ldflags="$LDFLAGS -L$withval/lib"
4177 with_libpcap="yes"
4178 else
4179 with_libpcap="$withval"
4180 fi
4181 ],
4182 [with_libpcap="yes"]
4183 )
4184
4185 if test "x$with_libpcap" = "xyes"; then
4186 SAVE_CPPFLAGS="$CPPFLAGS"
4187 CPPFLAGS="$CPPFLAGS $with_libpcap_cppflags"
4188
4189 AC_CHECK_HEADERS([pcap.h],
4190 [with_libpcap="yes"],
4191 [with_libpcap="no (pcap.h not found)"]
4192 )
4193
4194 CPPFLAGS="$SAVE_CPPFLAGS"
4195 fi
4196
4197 if test "x$with_libpcap" = "xyes"; then
4198 SAVE_LDFLAGS="$LDFLAGS"
4199 LDFLAGS="$LDFLAGS $with_libpcap_ldflags"
4200
4201 AC_CHECK_LIB([pcap], [pcap_open_live],
4202 [with_libpcap="yes"],
4203 [with_libpcap="no (libpcap not found)"]
4204 )
4205
4206 LDFLAGS="$SAVE_LDFLAGS"
4207 fi
4208
4209 if test "x$with_libpcap" = "xyes"; then
4210 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
4211 [c_cv_libpcap_have_pcap_error_iface_not_up],
4212 [
4213 AC_COMPILE_IFELSE(
4214 [
4215 AC_LANG_PROGRAM(
4216 [[#include <pcap.h>]],
4217 [[
4218 int val = PCAP_ERROR_IFACE_NOT_UP;
4219 return val;
4220 ]]
4221 )
4222 ],
4223 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
4224 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]
4225 )
4226 ]
4227 )
4228 fi
4229
4230 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"; then
4231 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
4232 fi
4233
4234 if test "x$with_libpcap" = "xyes"; then
4235 BUILD_WITH_LIBPCAP_CPPFLAGS="$with_libpcap_cppflags"
4236 BUILD_WITH_LIBPCAP_LDFLAGS="$with_libpcap_ldflags"
4237 BUILD_WITH_LIBPCAP_LIBS="-lpcap"
4238 fi
4239
4240 AC_SUBST([BUILD_WITH_LIBPCAP_CPPFLAGS])
4241 AC_SUBST([BUILD_WITH_LIBPCAP_LDFLAGS])
4242 AC_SUBST([BUILD_WITH_LIBPCAP_LIBS])
4243 # }}}
4244
4245 # --with-libperl {{{
4246 AC_ARG_WITH([libperl],
4247 [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
4248 [
4249 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4250 LDFLAGS="$LDFLAGS -L$withval/lib"
4251 CPPFLAGS="$CPPFLAGS -I$withval/include"
4252 with_libperl="yes"
4253 else
4254 with_libperl="$withval"
4255 fi
4256 ],
4257 [with_libperl="yes"]
4258 )
4259
4260 AC_ARG_VAR([PERL], [path to Perl interpreter])
4261 AC_PATH_PROG([PERL], [perl])
4262
4263 if test "x$PERL" = "x"; then
4264 with_libperl="no (no Perl interpreter found)"
4265 fi
4266
4267 if test "x$with_libperl" = "xyes"; then
4268 SAVE_CFLAGS="$CFLAGS"
4269 SAVE_LIBS="$LIBS"
4270 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4271 PERL_CFLAGS=`ARCHFLAGS="" $PERL -MExtUtils::Embed -e perl_inc`
4272 PERL_LIBS=`ARCHFLAGS="" $PERL -MExtUtils::Embed -e ldopts`
4273 CFLAGS="$CFLAGS $PERL_CFLAGS"
4274 LIBS="$LIBS $PERL_LIBS"
4275
4276 AC_CACHE_CHECK([for libperl],
4277 [c_cv_have_libperl],
4278 [
4279 AC_LINK_IFELSE(
4280 [
4281 AC_LANG_PROGRAM(
4282 [[
4283 #define PERL_NO_GET_CONTEXT
4284 #include <EXTERN.h>
4285 #include <perl.h>
4286 #include <XSUB.h>
4287 ]],
4288 [[
4289 dTHX;
4290 load_module (PERL_LOADMOD_NOIMPORT,
4291 newSVpv ("Collectd::Plugin::FooBar", 24),
4292 Nullsv);
4293 ]]
4294 )
4295 ],
4296 [c_cv_have_libperl="yes"],
4297 [c_cv_have_libperl="no"]
4298 )
4299 ]
4300 )
4301
4302 CFLAGS="$SAVE_CFLAGS"
4303 LIBS="$SAVE_LIBS"
4304
4305 if test "x$c_cv_have_libperl" = "xno"; then
4306 with_libperl="no"
4307 fi
4308 fi
4309
4310 if test "x$with_libperl" = "xyes"; then
4311 SAVE_CFLAGS="$CFLAGS"
4312 SAVE_LIBS="$LIBS"
4313 CFLAGS="$CFLAGS $PERL_CFLAGS"
4314 LIBS="$LIBS $PERL_LIBS"
4315
4316 AC_CACHE_CHECK([if Perl supports ithreads],
4317 [c_cv_have_perl_ithreads],
4318 [
4319 AC_LINK_IFELSE(
4320 [
4321 AC_LANG_PROGRAM(
4322 [[
4323 #include <EXTERN.h>
4324 #include <perl.h>
4325 #include <XSUB.h>
4326
4327 #if !defined(USE_ITHREADS)
4328 # error "Perl does not support ithreads!"
4329 #endif /* !defined(USE_ITHREADS) */
4330 ]],
4331 []
4332 )
4333 ],
4334 [c_cv_have_perl_ithreads="yes"],
4335 [c_cv_have_perl_ithreads="no"]
4336 )
4337 ]
4338 )
4339
4340 CFLAGS="$SAVE_CFLAGS"
4341 LIBS="$SAVE_LIBS"
4342 fi
4343
4344 if test "x$with_libperl" = "xyes"; then
4345 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4346 # (see issues #41 and #42)
4347 SAVE_CFLAGS="$CFLAGS"
4348 SAVE_LIBS="$LIBS"
4349 CFLAGS="$CFLAGS $PERL_CFLAGS"
4350 if test "x$GCC" = "xyes"; then
4351 CFLAGS="$CFLAGS -Wall -Werror"
4352 fi
4353 LIBS="$LIBS $PERL_LIBS"
4354
4355 AC_CACHE_CHECK([for broken Perl_load_module()],
4356 [c_cv_have_broken_perl_load_module],
4357 [
4358 AC_LINK_IFELSE(
4359 [
4360 AC_LANG_PROGRAM(
4361 [[
4362 #define PERL_NO_GET_CONTEXT
4363 #include <EXTERN.h>
4364 #include <perl.h>
4365 #include <XSUB.h>
4366 ]],
4367 [[
4368 dTHX;
4369 load_module (PERL_LOADMOD_NOIMPORT,
4370 newSVpv ("Collectd::Plugin::FooBar", 24),
4371 Nullsv);
4372 ]]
4373 )
4374 ],
4375 [c_cv_have_broken_perl_load_module="no"],
4376 [c_cv_have_broken_perl_load_module="yes"]
4377 )
4378 ]
4379 )
4380
4381 CFLAGS="$SAVE_CFLAGS"
4382 LIBS="$SAVE_LIBS"
4383 fi
4384
4385 if test "x$c_cv_have_broken_perl_load_module" = "xyes"; then
4386 PERL_CFLAGS="$PERL_CFLAGS -Wno-nonnull"
4387 fi
4388
4389 if test "x$with_libperl" = "xyes"; then
4390 SAVE_CFLAGS="$CFLAGS"
4391 SAVE_LIBS="$LIBS"
4392 CFLAGS="$CFLAGS $PERL_CFLAGS"
4393 LIBS="$LIBS $PERL_LIBS"
4394
4395 AC_CHECK_MEMBER(
4396 [struct mgvtbl.svt_local],
4397 [have_struct_mgvtbl_svt_local="yes"],
4398 [have_struct_mgvtbl_svt_local="no"],
4399 [[
4400 #include <EXTERN.h>
4401 #include <perl.h>
4402 #include <XSUB.h>
4403 ]]
4404 )
4405
4406 if test "x$have_struct_mgvtbl_svt_local" = "xyes"; then
4407 AC_DEFINE([HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL], [1], [Define if Perls struct mgvtbl has member svt_local.])
4408 fi
4409
4410 CFLAGS="$SAVE_CFLAGS"
4411 LIBS="$SAVE_LIBS"
4412 fi
4413 AC_SUBST([PERL_CFLAGS])
4414 AC_SUBST([PERL_LIBS])
4415
4416 # }}}
4417
4418
4419 # --with-libpmwapi {{{
4420 AC_ARG_WITH([libpmwapi],
4421 [AS_HELP_STRING([--with-libpmwapi@<:@=PREFIX@:>@], [Path to libpmwapi.])],
4422 [
4423 if test "x$withval" = "xyes" || test "x$withval" = "xno"; then
4424 with_libpmwapi="$withval"
4425 else
4426 with_libpmwapi_cppflags="-I$withval/include"
4427 with_libpmwapi_ldflags="-L$withval/lib64"
4428 with_libpmwapi="yes"
4429 fi
4430 ],
4431 [with_libpmwapi="yes"]
4432 )
4433
4434 if test "x$with_libpmwapi" = "xyes"; then
4435 SAVE_CPPFLAGS="$CPPFLAGS"
4436 CPPFLAGS="$CPPFLAGS $with_libpmwapi_cppflags"
4437
4438 AC_CHECK_HEADERS([pmw_api.h],
4439 [with_libpmwapi="yes"],
4440 [with_libpmwapi="no (pmw_api.h not found)"]
4441 )
4442
4443 CPPFLAGS="$SAVE_CPPFLAGS"
4444 fi
4445
4446 if test "x$with_libpmwapi" = "xyes"; then
4447 SAVE_LDFLAGS="$LDFLAGS"
4448 LDFLAGS="$LDFLAGS $with_libpmwapi_ldflags"
4449
4450 AC_CHECK_LIB([pmwapi], [PMWAPIGetDIMMCount],
4451 [with_libpmwapis="yes"],
4452 [with_libpmwapi="no (symbol 'PMWAPIGetDIMMCount' not found)"],
4453 [-lpmwcollect]
4454 )
4455
4456 AC_CHECK_LIB([pmwapi], [PMWAPIStart],
4457 [with_libpmwapi="yes"],
4458 [with_libpmwapi="no (symbol 'PMWAPIStart' not found)"],
4459 [-lpmwcollect]
4460 )
4461
4462 AC_CHECK_LIB([pmwapi], [PMWAPIStop],
4463 [with_libpmwapi="yes"],
4464 [with_libpmwapi="no (symbol 'PMWAPIStop' not found)"],
4465 [-lpmwcollect]
4466 )
4467
4468 AC_CHECK_LIB([pmwapi], [PMWAPIRead],
4469 [with_libpmwapi="yes"],
4470 [with_libpmwapi="no (symbol 'PMWAPIRead' not found)"],
4471 [-lpmwcollect]
4472 )
4473
4474 LDFLAGS="$SAVE_LDFLAGS"
4475 fi
4476
4477 if test "x$with_libpmwapi" = "xyes"; then
4478 BUILD_WITH_LIBPMWAPI_CPPFLAGS="$with_libpmwapi_cppflags"
4479 BUILD_WITH_LIBPMWAPI_LDFLAGS="$with_libpmwapi_ldflags"
4480 fi
4481
4482 AC_SUBST([BUILD_WITH_LIBPMWAPI_CPPFLAGS])
4483 AC_SUBST([BUILD_WITH_LIBPMWAPI_LDFLAGS])
4484 # }}}
4485
4486 # --with-libpq {{{
4487 with_pg_config="pg_config"
4488 AC_ARG_WITH([libpq],
4489 [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@], [Path to libpq.])],
4490 [
4491 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
4492 with_libpq="$withval"
4493 else
4494 if test -f "$withval" && test -x "$withval"; then
4495 with_pg_config="$withval"
4496 else if test -x "$withval/bin/pg_config"; then
4497 with_pg_config="$withval/bin/pg_config"
4498 fi; fi
4499 with_libpq="yes"
4500 fi
4501 ],
4502 [with_libpq="yes"]
4503 )
4504
4505 if test "x$with_libpq" = "xyes"; then
4506 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4507 pg_config_status=$?
4508
4509 if test $pg_config_status -eq 0; then
4510 if test -n "$with_libpq_includedir"; then
4511 for dir in $with_libpq_includedir; do
4512 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4513 done
4514 fi
4515 else
4516 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4517 fi
4518
4519 SAVE_CPPFLAGS="$CPPFLAGS"
4520 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4521
4522 AC_CHECK_HEADERS([libpq-fe.h],
4523 [with_libpq="yes"],
4524 [with_libpq="no (libpq-fe.h not found)"]
4525 )
4526
4527 CPPFLAGS="$SAVE_CPPFLAGS"
4528 fi
4529
4530 if test "x$with_libpq" = "xyes"; then
4531 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4532 pg_config_status=$?
4533
4534 if test $pg_config_status -eq 0
4535 then
4536 if test -n "$with_libpq_libdir"; then
4537 for dir in $with_libpq_libdir; do
4538 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4539 done
4540 fi
4541 else
4542 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4543 fi
4544
4545 SAVE_LDFLAGS="$LDFLAGS"
4546 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4547
4548 AC_CHECK_LIB([pq], [PQserverVersion],
4549 [with_libpq="yes"],
4550 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4551
4552 LDFLAGS="$SAVE_LDFLAGS"
4553 fi
4554
4555 if test "x$with_libpq" = "xyes"; then
4556 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4557 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4558 BUILD_WITH_LIBPQ_LIBS="-lpq"
4559 fi
4560
4561 AC_SUBST([BUILD_WITH_LIBPQ_CPPFLAGS])
4562 AC_SUBST([BUILD_WITH_LIBPQ_LDFLAGS])
4563 AC_SUBST([BUILD_WITH_LIBPQ_LIBS])
4564 # }}}
4565
4566 # --with-libpqos {{{
4567 AC_ARG_WITH([libpqos],
4568 [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4569 [
4570 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4571 with_libpqos_cppflags="-I$withval/include"
4572 with_libpqos_ldflags="-L$withval/lib"
4573 with_libpqos="yes"
4574 else
4575 with_libpqos="$withval"
4576 fi
4577 ],
4578 [with_libpqos="yes"]
4579 )
4580
4581 if test "x$with_libpqos" = "xyes"; then
4582 SAVE_CPPFLAGS="$CPPFLAGS"
4583 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4584
4585 AC_CHECK_HEADERS([pqos.h],
4586 [with_libpqos="yes"],
4587 [with_libpqos="no (pqos.h not found)"]
4588 )
4589
4590 CPPFLAGS="$SAVE_CPPFLAGS"
4591 fi
4592
4593 if test "x$with_libpqos" = "xyes"; then
4594 SAVE_LDFLAGS="$LDFLAGS"
4595 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4596
4597 AC_CHECK_LIB([pqos], [pqos_init],
4598 [with_libpqos="yes"],
4599 [with_libpqos="no (Can't find libpqos)"]
4600 )
4601
4602 LDFLAGS="$SAVE_LDFLAGS"
4603 fi
4604
4605 if test "x$with_libpqos" = "xyes"; then
4606 SAVE_CPPFLAGS="$CPPFLAGS"
4607 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4608 AC_PREPROC_IFELSE(
4609 [
4610 AC_LANG_SOURCE(
4611 [[
4612 #include <pqos.h>
4613 #if PQOS_VERSION < 106
4614 #error "required PQOS version >= 1.06"
4615 #endif
4616 ]]
4617 )
4618 ],
4619 [with_libpqos="yes"],
4620 [with_libpqos="no (pqos library version 1.06 or higher is required)"]
4621 )
4622
4623 CPPFLAGS="$SAVE_CPPFLAGS"
4624 fi
4625
4626 if test "x$with_libpqos" = "xyes"; then
4627 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4628 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4629 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4630 fi
4631
4632 AC_SUBST([BUILD_WITH_LIBPQOS_CPPFLAGS])
4633 AC_SUBST([BUILD_WITH_LIBPQOS_LDFLAGS])
4634 AC_SUBST([BUILD_WITH_LIBPQOS_LIBS])
4635 # }}}
4636
4637 # --with-libjansson {{{
4638 AC_ARG_WITH([libjansson],
4639 [AS_HELP_STRING([--with-libjansson@<:@=PREFIX@:>@], [Path to libjansson.])],
4640 [
4641 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4642 with_libjansson_cppflags="-I$withval/include"
4643 with_libjansson_ldflags="-L$withval/lib"
4644 with_libjansson="yes"
4645 else
4646 with_libjansson="$withval"
4647 fi
4648 ],
4649 [with_libjansson="yes"]
4650 )
4651
4652 if test "x$with_libjansson" = "xyes"; then
4653 SAVE_CPPFLAGS="$CPPFLAGS"
4654 CPPFLAGS="$CPPFLAGS $with_libjansson_cppflags"
4655
4656 AC_CHECK_HEADERS([jansson.h],
4657 [with_libjansson="yes"],
4658 [with_libjansson="no (jansson.h not found)"]
4659 )
4660 CPPFLAGS="$SAVE_CPPFLAGS"
4661 fi
4662 if test "x$with_libjansson" = "xyes"; then
4663 SAVE_LDFLAGS="$LDFLAGS"
4664 LDFLAGS="$LDFLAGS $with_libjansson_ldflags"
4665
4666 AC_CHECK_LIB([jansson], [json_loads],
4667 [with_libjansson="yes"],
4668 [with_libjansson="no (symbol 'json_loads' not found)"]
4669 )
4670
4671 LDFLAGS="$SAVE_LDFLAGS"
4672 fi
4673
4674 BUILD_WITH_LIBJANSSON_CPPFLAGS="$with_libjansson_cppflags"
4675 BUILD_WITH_LIBJANSSON_LDFLAGS="$with_libjansson_ldflags"
4676 BUILD_WITH_LIBJANSSON_LIBS="-ljansson"
4677 AC_SUBST(BUILD_WITH_LIBJANSSON_CPPFLAGS)
4678 AC_SUBST(BUILD_WITH_LIBJANSSON_LDFLAGS)
4679 AC_SUBST(BUILD_WITH_LIBJANSSON_LIBS)
4680 # }}}
4681
4682 # --with-libjevents {{{
4683 with_libjevents_cppflags=""
4684 with_libjevents_ldflags=""
4685 AC_ARG_WITH([libjevents],
4686 [AS_HELP_STRING([--with-libjevents@<:@=PREFIX@:>@], [Path to libjevents.])],
4687 [
4688 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4689 with_libjevents_cppflags="-I$withval/include"
4690 with_libjevents_ldflags="-L$withval/lib"
4691 with_libjevents="yes"
4692 else
4693 with_libjevents="$withval"
4694 fi
4695 ],
4696 [with_libjevents="yes"]
4697 )
4698
4699 if test "x$with_libjevents" = "xyes"; then
4700 SAVE_CPPFLAGS="$CPPFLAGS"
4701 CPPFLAGS="$CPPFLAGS $with_libjevents_cppflags"
4702
4703 AC_CHECK_HEADERS([jevents.h], [with_libjevents="yes"], [with_libjevents="no (jevents.h not found)"])
4704
4705 CPPFLAGS="$SAVE_CPPFLAGS"
4706 fi
4707 if test "x$with_libjevents" = "xyes"; then
4708 SAVE_LDFLAGS="$LDFLAGS"
4709 LDFLAGS="$LDFLAGS $with_libjevents_ldflags"
4710
4711 AC_CHECK_LIB([jevents], [json_events], [with_libjevents="yes"], [with_libjevents="no (Can't find libjevents)"])
4712
4713 LDFLAGS="$SAVE_LDFLAGS"
4714 fi
4715 if test "x$with_libjevents" = "xyes"; then
4716 SAVE_LDFLAGS="$LDFLAGS"
4717 LDFLAGS="$LDFLAGS $with_libjevents_ldflags"
4718
4719 AC_CHECK_LIB([jevents], [event_scaled_value_sum], [with_libjevents="yes"], [with_libjevents="no (libjevents is too old)"])
4720
4721 LDFLAGS="$SAVE_LDFLAGS"
4722 fi
4723 if test "x$with_libjevents" = "xyes"; then
4724 BUILD_WITH_LIBJEVENTS_CPPFLAGS="$with_libjevents_cppflags"
4725 BUILD_WITH_LIBJEVENTS_LDFLAGS="$with_libjevents_ldflags"
4726 BUILD_WITH_LIBJEVENTS_LIBS="-ljevents"
4727 fi
4728 AC_SUBST([BUILD_WITH_LIBJEVENTS_CPPFLAGS])
4729 AC_SUBST([BUILD_WITH_LIBJEVENTS_LDFLAGS])
4730 AC_SUBST([BUILD_WITH_LIBJEVENTS_LIBS])
4731 # }}}
4732
4733 # --with-libprotobuf {{{
4734 with_libprotobuf_cppflags=""
4735 with_libprotobuf_ldflags=""
4736 AC_ARG_WITH([libprotobuf],
4737 [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4738 [
4739 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4740 with_libprotobuf_cppflags="-I$withval/include"
4741 with_libprotobuf_ldflags="-L$withval/lib"
4742 with_libprotobuf="yes"
4743 fi
4744 if test "x$withval" = "xno"; then
4745 with_libprotobuf="no (disabled on command line)"
4746 fi
4747 ],
4748 [withval="yes"]
4749 )
4750
4751 if test "x$withval" = "xyes"; then
4752 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4753 [with_libprotobuf="yes"],
4754 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4755 )
4756 fi
4757
4758 if test "x$withval" != "xno"; then
4759 SAVE_LDFLAGS="$LDFLAGS"
4760 SAVE_LIBS="$LIBS"
4761 LDFLAGS="$with_libprotobuf_ldflags"
4762 LIBS="$PROTOBUF_LIBS $LIBS"
4763 AC_LANG_PUSH([C++])
4764 AC_CHECK_LIB([protobuf], [main],
4765 [
4766 SAVE_CPPFLAGS="$CPPFLAGS"
4767 CPPFLAGS="-std=c++11 $with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4768 if test "x$PROTOBUF_LIBS" = "x"
4769 then
4770 PROTOBUF_LIBS="-lprotobuf"
4771 fi
4772 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4773 [with_libprotobuf="yes"],
4774 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4775 )
4776 CPPFLAGS="$SAVE_CPPFLAGS"
4777 ],
4778 [with_libprotobuf="no (libprotobuf not found)"]
4779 )
4780 AC_LANG_POP([C++])
4781 LDFLAGS="$SAVE_LDFLAGS"
4782 LIBS="$SAVE_LIBS"
4783 fi
4784
4785 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4786 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4787 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4788 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4789 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4790 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4791 # }}}
4792
4793 AC_ARG_VAR([PROTOC], [path to the protoc binary])
4794 AC_PATH_PROG([PROTOC], [protoc])
4795 have_protoc3="no"
4796 if test "x$PROTOC" != "x"; then
4797 AC_MSG_CHECKING([for protoc 3.0.0+])
4798 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
4799 protoc3="yes (`$PROTOC --version`)"
4800 have_protoc3="yes"
4801 else
4802 protoc3="no (`$PROTOC --version`)"
4803 fi
4804 AC_MSG_RESULT([$protoc3])
4805 fi
4806 AM_CONDITIONAL([HAVE_PROTOC3], [test "x$have_protoc3" = "xyes"])
4807
4808 # --with-libprotobuf-c {{{
4809 AC_ARG_WITH([libprotobuf-c],
4810 [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4811 [
4812 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4813 with_libprotobuf_c_cppflags="-I$withval/include"
4814 with_libprotobuf_c_ldflags="-L$withval/lib"
4815 with_libprotobuf_c="yes"
4816 fi
4817
4818 if test "x$withval" = "xno"; then
4819 with_libprotobuf_c="no (disabled on command line)"
4820 fi
4821 ],
4822 [withval="yes"]
4823 )
4824
4825 if test "x$withval" = "xyes"; then
4826 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4827 [with_libprotobuf_c="yes"],
4828 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4829 )
4830 fi
4831
4832 if test "x$withval" != "xno"; then
4833 SAVE_LDFLAGS="$LDFLAGS"
4834 SAVE_LIBS="$LIBS"
4835 LDFLAGS="$with_libprotobuf_c_ldflags"
4836 LIBS="$PROTOBUF_C_LIBS $LIBS"
4837 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4838 [
4839 SAVE_CPPFLAGS="$CPPFLAGS"
4840 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4841 if test "x$PROTOBUF_C_LIBS" = "x"; then
4842 PROTOBUF_C_LIBS="-lprotobuf-c"
4843 fi
4844
4845 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4846 [
4847 with_libprotobuf_c="yes"
4848 break
4849 ],
4850 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4851 )
4852
4853 CPPFLAGS="$SAVE_CPPFLAGS"
4854 ],
4855 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4856 )
4857 LDFLAGS="$SAVE_LDFLAGS"
4858 LIBS="$SAVE_LIBS"
4859 fi
4860
4861 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4862 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4863 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4864 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4865 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4866 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4867 # }}}
4868
4869 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
4870 AC_PATH_PROG([PROTOC_C], [protoc-c])
4871 if test "x$PROTOC_C" = "x"
4872 then
4873 have_protoc_c="no (protoc-c compiler not found)"
4874 else
4875 have_protoc_c="yes"
4876 fi
4877
4878 # --with-libpython {{{
4879 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4880 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4881 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4882
4883 AC_ARG_WITH([libpython],
4884 [AS_HELP_STRING([--with-libpython], [if we should build with libpython @<:@default=yes@:>@])],
4885 [with_libpython="$withval"],
4886 [with_libpython="check"]
4887 )
4888
4889 if test "$with_libpython" != "no"; then
4890 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4891 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4892 AC_PATH_PROGS([PYTHON_CONFIG],
4893 [python3-config python2-config python-config]
4894 )
4895 if test "$PYTHON_CONFIG" = ""; then
4896 if test "$with_libpython" = "yes"; then
4897 AC_MSG_ERROR([Unable to find python-config])
4898 fi
4899 with_libpython="no"
4900 fi
4901 fi
4902 fi
4903
4904 if test "$PYTHON_CONFIG" != ""; then
4905 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4906 if test $? -ne 0; then
4907 with_libpython="no"
4908 fi
4909 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags --embed`" || LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4910 if test $? -ne 0; then
4911 with_libpython="no"
4912 fi
4913 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs --embed`" || LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4914 if test $? -ne 0; then
4915 with_libpython="no"
4916 fi
4917 fi
4918
4919 if test "$with_libpython" != "xno"; then
4920 SAVE_CPPFLAGS="$CPPFLAGS"
4921 SAVE_LDFLAGS="$LDFLAGS"
4922 SAVE_LIBS="$LIBS"
4923 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4924 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4925 LIBS="$LIBPYTHON_LIBS $LIBS"
4926
4927 AC_CHECK_HEADERS([Python.h],
4928 [
4929 AC_MSG_CHECKING([for libpython])
4930 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4931 [[#include <Python.h>]],
4932 [[Py_Initialize();]])
4933 ],
4934 [with_libpython="yes"],
4935 [with_libpython="no"]
4936 )
4937 AC_MSG_RESULT([$with_libpython])
4938 ],
4939 [with_libpython="no"]
4940 )
4941
4942 CPPFLAGS="$SAVE_CPPFLAGS"
4943 LDFLAGS="$SAVE_LDFLAGS"
4944 LIBS="$SAVE_LIBS"
4945 fi
4946 # }}} --with-libpython
4947
4948 # --with-libqpid_proton {{{
4949 AC_ARG_WITH([libqpid_proton],
4950 [AS_HELP_STRING([--with-libqpid_proton@<:@=PREFIX@:>@], [Path to libqpid_proton.])],
4951 [
4952 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4953 with_libqpid_proton_cppflags="-I$withval/include"
4954 with_libqpid_proton_ldflags="-L$withval/lib"
4955 with_libqpid_proton="yes"
4956 else
4957 with_libqpid_proton="$withval"
4958 fi
4959 ],
4960 [with_libqpid_proton="yes"]
4961 )
4962
4963 if test "x$with_libqpid_proton" = "xyes"; then
4964 SAVE_CPPFLAGS="$CPPFLAGS"
4965 CPPFLAGS="$CPPFLAGS $with_libqpid_proton_cppflags"
4966
4967 AC_CHECK_HEADERS([proton/proactor.h],
4968 [with_libqpid_proton="yes"],
4969 [with_libqpid_proton="no (proton/proactor.h not found)"]
4970 )
4971
4972 CPPFLAGS="$SAVE_CPPFLAGS"
4973 fi
4974
4975 if test "x$with_libqpid_proton" = "xyes"; then
4976 SAVE_LDFLAGS="$LDFLAGS"
4977 LDFLAGS="$LDFLAGS $with_libqpid_proton_ldflags"
4978
4979 AC_CHECK_LIB([qpid-proton], [pn_connection],
4980 [with_libqpid_proton="yes"],
4981 [with_libqpid_proton="no (Symbol 'pn_connection' not found)"])
4982
4983 LDFLAGS="$SAVE_LDFLAGS"
4984 fi
4985
4986 if test "x$with_libqpid_proton" = "xyes"; then
4987 BUILD_WITH_LIBQPIDPROTON_CPPFLAGS="$with_libqpid_proton_cppflags"
4988 BUILD_WITH_LIBQPIDPROTON_LDFLAGS="$with_libqpid_proton_ldflags"
4989 BUILD_WITH_LIBQPIDPROTON_LIBS="-lqpid-proton"
4990 fi
4991
4992 AC_SUBST(BUILD_WITH_LIBQPIDPROTON_CPPFLAGS)
4993 AC_SUBST(BUILD_WITH_LIBQPIDPROTON_LDFLAGS)
4994 AC_SUBST(BUILD_WITH_LIBQPIDPROTON_LIBS)
4995
4996 # }}}
4997
4998 # --with-librabbitmq {{{
4999 AC_ARG_WITH([librabbitmq],
5000 [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
5001 [
5002 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5003 with_librabbitmq_cppflags="-I$withval/include"
5004 with_librabbitmq_ldflags="-L$withval/lib"
5005 with_librabbitmq="yes"
5006 else
5007 with_librabbitmq="$withval"
5008 fi
5009 ],
5010 [with_librabbitmq="yes"]
5011 )
5012
5013 if test "x$with_librabbitmq" = "xyes"; then
5014 SAVE_CPPFLAGS="$CPPFLAGS"
5015 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
5016
5017 AC_CHECK_HEADERS([amqp.h],
5018 [with_librabbitmq="yes"],
5019 [with_librabbitmq="no (amqp.h not found)"]
5020 )
5021
5022 CPPFLAGS="$SAVE_CPPFLAGS"
5023 fi
5024
5025 if test "x$with_librabbitmq" = "xyes"; then
5026 # librabbitmq up to version 0.9.1 provides "library_errno", later
5027 # versions use "library_error". The library does not provide a version
5028 # macro :(.
5029
5030 SAVE_CPPFLAGS="$CPPFLAGS"
5031 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
5032
5033 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],
5034 [],
5035 [],
5036 [[
5037 #include <stdlib.h>
5038 #include <stdio.h>
5039 #include <stdint.h>
5040 #include <inttypes.h>
5041 #include <amqp.h>
5042 ]]
5043 )
5044 CPPFLAGS="$SAVE_CPPFLAGS"
5045
5046 SAVE_LDFLAGS="$LDFLAGS"
5047 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
5048
5049 AC_CHECK_LIB([rabbitmq], [amqp_basic_publish],
5050 [with_librabbitmq="yes"],
5051 [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"]
5052 )
5053
5054 LDFLAGS="$SAVE_LDFLAGS"
5055 fi
5056
5057 if test "x$with_librabbitmq" = "xyes"; then
5058 SAVE_CPPFLAGS="$CPPFLAGS"
5059 SAVE_LDFLAGS="$LDFLAGS"
5060 SAVE_LIBS="$LIBS"
5061 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
5062 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
5063 LIBS="-lrabbitmq"
5064
5065 AC_CHECK_HEADERS([amqp_tcp_socket.h amqp_socket.h])
5066 AC_CHECK_FUNC([amqp_tcp_socket_new],
5067 [
5068 AC_DEFINE([HAVE_AMQP_TCP_SOCKET], [1],
5069 [Define if librabbitmq provides the new TCP socket interface.])
5070 ]
5071 )
5072
5073 AC_CHECK_DECLS([amqp_socket_close],
5074 [],
5075 [],
5076 [[
5077 #include <amqp.h>
5078 #ifdef HAVE_AMQP_TCP_SOCKET_H
5079 # include <amqp_tcp_socket.h>
5080 #endif
5081 #ifdef HAVE_AMQP_SOCKET_H
5082 # include <amqp_socket.h>
5083 #endif
5084 ]]
5085 )
5086
5087 CPPFLAGS="$SAVE_CPPFLAGS"
5088 LDFLAGS="$SAVE_LDFLAGS"
5089 LIBS="$SAVE_LIBS"
5090 fi
5091
5092 if test "x$with_librabbitmq" = "xyes"; then
5093 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
5094 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
5095 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
5096 fi
5097
5098 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
5099 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
5100 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
5101
5102 # }}}
5103
5104 # --with-librdkafka {{{
5105 AC_ARG_WITH([librdkafka],
5106 [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
5107 [
5108 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5109 with_librdkafka_cppflags="-I$withval/include"
5110 with_librdkafka_ldflags="-L$withval/lib"
5111 with_librdkafka_rpath="$withval/lib"
5112 with_librdkafka="yes"
5113 else
5114 with_librdkafka="$withval"
5115 fi
5116 ],
5117 [with_librdkafka="yes"]
5118 )
5119
5120 if test "x$with_librdkafka" = "xyes"; then
5121 SAVE_CPPFLAGS="$CPPFLAGS"
5122 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
5123
5124 AC_CHECK_HEADERS([librdkafka/rdkafka.h],
5125 [with_librdkafka="yes"],
5126 [with_librdkafka="no (librdkafka/rdkafka.h not found)"]
5127 )
5128
5129 CPPFLAGS="$SAVE_CPPFLAGS"
5130 fi
5131
5132 if test "x$with_librdkafka" = "xyes"; then
5133 SAVE_LDFLAGS="$LDFLAGS"
5134 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
5135
5136 AC_CHECK_LIB([rdkafka], [rd_kafka_new],
5137 [with_librdkafka="yes"],
5138 [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
5139
5140 AC_CHECK_LIB([rdkafka], [rd_kafka_conf_set_log_cb],
5141 [with_librdkafka_log_cb="yes"],
5142 [with_librdkafka_log_cb="no"])
5143
5144 AC_CHECK_LIB([rdkafka], [rd_kafka_set_logger],
5145 [with_librdkafka_logger="yes"],
5146 [with_librdkafka_logger="no"]
5147 )
5148
5149 LDFLAGS="$SAVE_LDFLAGS"
5150 fi
5151
5152 if test "x$with_librdkafka" = "xyes"; then
5153 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
5154 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
5155
5156 if test "x$with_librdkafka_rpath" != "x"; then
5157 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
5158 else
5159 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
5160 fi
5161
5162 if test "x$with_librdkafka_log_cb" = "xyes"; then
5163 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
5164 else if test "x$with_librdkafka_logger" = "xyes"; then
5165 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
5166 fi; fi
5167 fi
5168
5169 AC_SUBST([BUILD_WITH_LIBRDKAFKA_CPPFLAGS])
5170 AC_SUBST([BUILD_WITH_LIBRDKAFKA_LDFLAGS])
5171 AC_SUBST([BUILD_WITH_LIBRDKAFKA_LIBS])
5172 # }}}
5173
5174 # --with-librouteros {{{
5175 AC_ARG_WITH([librouteros],
5176 [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
5177 [
5178 if test "x$withval" = "xyes" || test "x$withval" = "xno"; then
5179 with_librouteros="$witval"
5180 else
5181 with_librouteros_cppflags="-I$withval/include"
5182 with_librouteros_ldflags="-L$withval/lib"
5183 with_librouteros="yes"
5184 fi
5185 ],
5186 [with_librouteros="yes"]
5187 )
5188
5189 if test "x$with_librouteros" = "xyes"; then
5190 SAVE_CPPFLAGS="$CPPFLAGS"
5191 CPPFLAGS="$CPPFLAGS $with_librouteros_cppflags"
5192
5193 AC_CHECK_HEADERS([routeros_api.h],
5194 [with_librouteros="yes"],
5195 [with_librouteros="no (routeros_api.h not found)"]
5196 )
5197
5198 CPPFLAGS="$SAVE_CPPFLAGS"
5199 fi
5200
5201 if test "x$with_librouteros" = "xyes"; then
5202 SAVE_LDFLAGS="$LDFLAGS"
5203 LDFLAGS="$LDFLAGS $with_librouteros_ldflags"
5204
5205 AC_CHECK_LIB([routeros], [ros_interface],
5206 [with_librouteros="yes"],
5207 [with_librouteros="no (symbol 'ros_interface' not found)"]
5208 )
5209
5210 LDFLAGS="$SAVE_LDFLAGS"
5211 fi
5212
5213 if test "x$with_librouteros" = "xyes"; then
5214 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$with_librouteros_cppflags"
5215 BUILD_WITH_LIBROUTEROS_LDFLAGS="$with_librouteros_ldflags"
5216 fi
5217
5218 AC_SUBST([BUILD_WITH_LIBROUTEROS_CPPFLAGS])
5219 AC_SUBST([BUILD_WITH_LIBROUTEROS_LDFLAGS])
5220 # }}}
5221
5222 # --with-librrd {{{
5223 librrd_threadsafe="no"
5224 librrd_rrdc_update="no"
5225 AC_ARG_WITH([librrd],
5226 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
5227 [
5228 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5229 librrd_cflags="-I$withval/include"
5230 librrd_ldflags="-L$withval/lib"
5231 with_librrd="yes"
5232 else
5233 with_librrd="$withval"
5234 fi
5235 ],
5236 [with_librrd="yes"]
5237 )
5238
5239 if test "x$with_librrd" = "xyes"; then
5240 SAVE_LDFLAGS="$LDFLAGS"
5241 LDFLAGS="$LDFLAGS $librrd_ldflags"
5242 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
5243 [
5244 AC_CHECK_LIB([rrd], [rrd_update_r],
5245 [librrd_threadsafe="yes"],
5246 [:]
5247 )
5248 AC_CHECK_LIB([rrd], [rrdc_update],
5249 [librrd_rrdc_update="yes"],
5250 [:]
5251 )
5252 ],[:]
5253 )
5254 LDFLAGS="$SAVE_LDFLAGS"
5255
5256 SAVE_CPPFLAGS="$CPPFLAGS"
5257 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
5258
5259 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
5260
5261 CPPFLAGS="$SAVE_CPPFLAGS"
5262 fi
5263
5264 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"; then
5265 SAVE_LDFLAGS="$LDFLAGS"
5266 LDFLAGS="$LDFLAGS $librrd_ldflags"
5267
5268 AC_CHECK_LIB([rrd_th], [rrd_update_r],
5269 [
5270 librrd_ldflags="$librrd_ldflags -lrrd_th"
5271 librrd_threadsafe="yes"
5272 AC_CHECK_LIB([rrd_th], [rrdc_update],
5273 [librrd_rrdc_update="yes"],
5274 [:],
5275 )
5276 ],
5277 [:]
5278 )
5279 LDFLAGS="$SAVE_LDFLAGS"
5280 fi
5281
5282 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"; then
5283 SAVE_LDFLAGS="$LDFLAGS"
5284 LDFLAGS="$LDFLAGS $librrd_ldflags"
5285
5286 AC_CHECK_LIB([rrd], [rrd_update],
5287 [
5288 librrd_ldflags="$librrd_ldflags -lrrd"
5289 AC_CHECK_LIB([rrd], [rrdc_update],
5290 [librrd_rrdc_update="yes"],
5291 [:]
5292 )
5293 ],
5294 [with_librrd="no (symbol 'rrd_update' not found)"]
5295 )
5296 LDFLAGS="$SAVE_LDFLAGS"
5297 fi
5298
5299 if test "x$with_librrd" = "xyes"; then
5300 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
5301 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
5302 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
5303 fi
5304
5305 if test "x$librrd_threadsafe" = "xyes"; then
5306 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
5307 [Define to 1 if the rrd library is thread-safe]
5308 )
5309 fi
5310
5311 AC_SUBST([BUILD_WITH_LIBRRD_CFLAGS])
5312 AC_SUBST([BUILD_WITH_LIBRRD_LDFLAGS])
5313 AC_SUBST([BUILD_WITH_LIBRRD_LIBS])
5314 # }}}
5315
5316 # --with-libsensors {{{
5317 AC_ARG_WITH([libsensors],
5318 [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
5319 [
5320 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5321 with_libsensors="$withval"
5322 else
5323 with_sensors_cppflags="-I$withval/include"
5324 with_sensors_ldflags="-L$withval/lib"
5325 with_libsensors="yes"
5326 fi
5327 ],
5328 [
5329 if test "x$ac_system" = "xLinux"; then
5330 with_libsensors="yes"
5331 else
5332 with_libsensors="no (Linux only library)"
5333 fi
5334 ]
5335 )
5336
5337 if test "x$with_libsensors" = "xyes"; then
5338 SAVE_CPPFLAGS="$CPPFLAGS"
5339 CPPFLAGS="$CPPFLAGS $with_sensors_cppflags"
5340
5341 AC_CHECK_HEADERS([sensors/sensors.h],
5342 [with_libsensors="yes"],
5343 [with_libsensors="no (sensors/sensors.h not found)"]
5344 )
5345
5346 CPPFLAGS="$SAVE_CPPFLAGS"
5347 fi
5348
5349 if test "x$with_libsensors" = "xyes"; then
5350 SAVE_LDFLAGS="$LDFLAGS"
5351 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
5352
5353 AC_CHECK_LIB([sensors], [sensors_init],
5354 [with_libsensors="yes"],
5355 [with_libsensors="no (libsensors not found)"]
5356 )
5357
5358 LDFLAGS="$SAVE_LDFLAGS"
5359 fi
5360
5361 if test "x$with_libsensors" = "xyes"; then
5362 SAVE_CPPFLAGS="$CPPFLAGS"
5363 CPPFLAGS="$CPPFLAGS $with_sensors_cppflags"
5364 AC_PREPROC_IFELSE(
5365 [
5366 AC_LANG_SOURCE(
5367 [[
5368 #include <sensors/sensors.h>
5369 #if SENSORS_API_VERSION < 0x400
5370 #error "required libsensors version >= 3.0"
5371 #endif
5372 ]]
5373 )
5374 ],
5375 [with_libsensors="yes"],
5376 [with_libsensors="no (sensors library version 3.0.0 or higher is required)"]
5377 )
5378
5379 CPPFLAGS="$SAVE_CPPFLAGS"
5380 fi
5381
5382 if test "x$with_libsensors" = "xyes"; then
5383 BUILD_WITH_LIBSENSORS_CPPFLAGS="$with_sensors_cppflags"
5384 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
5385 BUILD_WITH_LIBSENSORS_LIBS="-lsensors"
5386 fi
5387
5388 AC_SUBST([BUILD_WITH_LIBSENSORS_CPPFLAGS])
5389 AC_SUBST([BUILD_WITH_LIBSENSORS_LDFLAGS])
5390 AC_SUBST([BUILD_WITH_LIBSENSORS_LIBS])
5391
5392 # }}}
5393
5394 # libsigrok {{{
5395 AC_SUBST([LIBSIGROK_CFLAGS])
5396 AC_SUBST([LIBSIGROK_LIBS])
5397 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
5398 [with_libsigrok="yes"],
5399 [with_libsigrok="no (pkg-config could not find libsigrok)"]
5400 )
5401 # }}}
5402
5403 # --with-libssl {{{
5404 with_libssl_cflags=""
5405 with_libssl_ldflags=""
5406 AC_ARG_WITH([libssl], [AS_HELP_STRING([--with-libssl@<:@=PREFIX@:>@], [Path to libssl.])],
5407 [
5408 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5409 with_libssl_cppflags="-I$withval/include"
5410 with_libssl_ldflags="-L$withval/lib"
5411 with_libssl="yes"
5412 else
5413 with_libssl="$withval"
5414 fi
5415 ],
5416 [
5417 with_libssl="yes"
5418 ])
5419 if test "x$with_libssl" = "xyes"; then
5420 SAVE_CPPFLAGS="$CPPFLAGS"
5421 CPPFLAGS="$CPPFLAGS $with_libssl_cppflags"
5422
5423 AC_CHECK_HEADERS([openssl/sha.h openssl/blowfish.h openssl/rand.h],
5424 [with_libssl="yes"],
5425 [with_libssl="no (ssl header not found)"])
5426
5427 CPPFLAGS="$SAVE_CPPFLAGS"
5428 fi
5429 if test "x$with_libssl" = "xyes"; then
5430 SAVE_CPPFLAGS="$CPPFLAGS"
5431 SAVE_LDFLAGS="$LDFLAGS"
5432 CPPFLAGS="$CPPFLAGS $with_libssl_cppflags"
5433 LDFLAGS="$LDFLAGS $with_libssl_ldflags"
5434
5435 AC_CHECK_LIB([ssl], [OPENSSL_init_ssl], [with_libssl="yes"], [with_libssl="no (Symbol 'SSL_library_init' not found)"])
5436
5437 CPPFLAGS="$SAVE_CPPFLAGS"
5438 LDFLAGS="$SAVE_LDFLAGS"
5439 fi
5440 if test "x$with_libssl" = "xyes"; then
5441 BUILD_WITH_LIBSSL_CFLAGS="$with_libssl_cflags"
5442 BUILD_WITH_LIBSSL_LDFLAGS="$with_libssl_ldflags"
5443 BUILD_WITH_LIBSSL_LIBS="-lssl -lcrypto"
5444 AC_SUBST([BUILD_WITH_LIBSSL_CFLAGS])
5445 AC_SUBST([BUILD_WITH_LIBSSL_LDFLAGS])
5446 AC_SUBST([BUILD_WITH_LIBSSL_LIBS])
5447 AC_DEFINE([HAVE_LIBSSL], [1], [Define if libssl is present and usable.])
5448 fi
5449 AM_CONDITIONAL(BUILD_WITH_LIBSSL, test "x$with_libssl" = "xyes")
5450 # }}}
5451
5452 # --with-libstatgrab {{{
5453 AC_ARG_WITH([libstatgrab],
5454 [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
5455 [
5456 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5457 with_libstatgrab_cflags="-I$withval/include"
5458 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
5459 with_libstatgrab="yes"
5460 with_libstatgrab_pkg_config="no"
5461 else
5462 with_libstatgrab="$withval"
5463 with_libstatgrab_pkg_config="yes"
5464 fi
5465 ],
5466 [
5467 with_libstatgrab="yes"
5468 with_libstatgrab_pkg_config="yes"
5469 ])
5470
5471 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes"; then
5472 AC_MSG_CHECKING([pkg-config for libstatgrab])
5473 temp_result="found"
5474 $PKG_CONFIG --exists libstatgrab 2>/dev/null
5475 if test "$?" != "0"; then
5476 with_libstatgrab_pkg_config="no"
5477 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
5478 temp_result="not found"
5479 fi
5480 AC_MSG_RESULT([$temp_result])
5481 fi
5482
5483 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes" && test "x$with_libstatgrab_cflags" = "x"; then
5484 AC_MSG_CHECKING([for libstatgrab CFLAGS])
5485 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
5486 if test "$?" = "0"; then
5487 with_libstatgrab_cflags="$temp_result"
5488 else
5489 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
5490 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
5491 fi
5492 AC_MSG_RESULT([$temp_result])
5493 fi
5494
5495 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes" && test "x$with_libstatgrab_ldflags" = "x"; then
5496 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
5497 temp_result="`$PKG_CONFIG --libs libstatgrab`"
5498 if test "$?" = "0"
5499 then
5500 with_libstatgrab_ldflags="$temp_result"
5501 else
5502 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
5503 temp_result="$PKG_CONFIG --libs libstatgrab failed"
5504 fi
5505 AC_MSG_RESULT([$temp_result])
5506 fi
5507
5508 if test "x$with_libstatgrab" = "xyes"; then
5509 SAVE_CPPFLAGS="$CPPFLAGS"
5510 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
5511
5512 AC_CHECK_HEADERS([statgrab.h],
5513 [with_libstatgrab="yes"],
5514 [with_libstatgrab="no (statgrab.h not found)"]
5515 )
5516
5517 CPPFLAGS="$SAVE_CPPFLAGS"
5518 fi
5519
5520 if test "x$with_libstatgrab" = "xyes"; then
5521 SAVE_LDFLAGS="$LDFLAGS"
5522 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5523
5524 AC_CHECK_LIB([statgrab], [sg_init],
5525 [with_libstatgrab="yes"],
5526 [with_libstatgrab="no (symbol sg_init not found)"]
5527 )
5528
5529 LDFLAGS="$SAVE_LDFLAGS"
5530 fi
5531
5532 if test "x$with_libstatgrab" = "xyes"; then
5533 SAVE_CFLAGS="$CFLAGS"
5534 SAVE_LDFLAGS="$LDFLAGS"
5535 SAVE_LIBS="$LIBS"
5536
5537 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5538 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5539 LIBS="-lstatgrab $LIBS"
5540
5541 AC_CACHE_CHECK([if libstatgrab >= 0.90],
5542 [c_cv_have_libstatgrab_0_90],
5543 [
5544 AC_LINK_IFELSE(
5545 [
5546 AC_LANG_PROGRAM(
5547 [[
5548 #include <stdio.h>
5549 #include <statgrab.h>
5550 ]],
5551 [[
5552 if (sg_init()) return 0;
5553 ]]
5554 )
5555 ],
5556 [c_cv_have_libstatgrab_0_90="no"],
5557 [c_cv_have_libstatgrab_0_90="yes"]
5558 )
5559 ]
5560 )
5561
5562 CFLAGS="$SAVE_CFLAGS"
5563 LDFLAGS="$SAVE_LDFLAGS"
5564 LIBS="$SAVE_LIBS"
5565 fi
5566
5567 AM_CONDITIONAL([BUILD_WITH_LIBSTATGRAB], [test "x$with_libstatgrab" = "xyes"])
5568
5569 if test "x$with_libstatgrab" = "xyes"; then
5570 AC_DEFINE([HAVE_LIBSTATGRAB], [1],
5571 [Define to 1 if you have the 'statgrab' library (-lstatgrab)]
5572 )
5573
5574 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"; then
5575 AC_DEFINE([HAVE_LIBSTATGRAB_0_90], [1],
5576 [Define to 1 if libstatgrab version >= 0.90]
5577 )
5578 fi
5579
5580 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5581 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5582
5583 fi
5584
5585 AC_SUBST([BUILD_WITH_LIBSTATGRAB_CFLAGS])
5586 AC_SUBST([BUILD_WITH_LIBSTATGRAB_LDFLAGS])
5587 # }}}
5588
5589 # --with-libtokyotyrant {{{
5590 AC_ARG_WITH([libtokyotyrant],
5591 [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5592 [
5593 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5594 with_libtokyotyrant="$withval"
5595 else
5596 with_libtokyotyrant_cppflags="-I$withval/include"
5597 with_libtokyotyrant_ldflags="-L$withval/lib"
5598 with_libtokyotyrant_libs="-ltokyotyrant"
5599 with_libtokyotyrant="yes"
5600 fi
5601 ],
5602 [with_libtokyotyrant="yes"]
5603 )
5604
5605 if test "x$with_libtokyotyrant" = "xyes"; then
5606 if $PKG_CONFIG --exists tokyotyrant; then
5607 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5608 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5609 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5610 fi
5611 fi
5612
5613 if test "x$with_libtokyotyrant" = "xyes"; then
5614 SAVE_CPPFLAGS="$CPPFLAGS"
5615 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5616
5617 AC_CHECK_HEADERS([tcrdb.h],
5618 [with_libtokyotyrant="yes"],
5619 [with_libtokyotyrant="no (tcrdb.h not found)"]
5620 )
5621
5622 CPPFLAGS="$SAVE_CPPFLAGS"
5623 fi
5624
5625 if test "x$with_libtokyotyrant" = "xyes"; then
5626 SAVE_LDFLAGS="$LDFLAGS"
5627 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5628
5629 AC_CHECK_LIB([tokyotyrant], [tcrdbrnum],
5630 [with_libtokyotyrant="yes"],
5631 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5632 [$with_libtokyotyrant_libs]
5633 )
5634
5635 LDFLAGS="$SAVE_LDFLAGS"
5636 fi
5637
5638 if test "x$with_libtokyotyrant" = "xyes"; then
5639 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5640 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5641 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5642 fi
5643 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS])
5644 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS])
5645 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_LIBS])
5646 # }}}
5647
5648 # --with-libudev {{{
5649 AC_ARG_WITH([libudev],
5650 [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5651 [
5652 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5653 with_libudev="$withval"
5654 else
5655 with_libudev_cppflags="-I$withval/include"
5656 with_libudev_ldflags="-L$withval/lib"
5657 with_libudev="yes"
5658 fi
5659 ],
5660 [
5661 if test "x$ac_system" = "xLinux"; then
5662 with_libudev="yes"
5663 else
5664 with_libudev="no (Linux only library)"
5665 fi
5666 ]
5667 )
5668
5669 if test "x$with_libudev" = "xyes"; then
5670 SAVE_CPPFLAGS="$CPPFLAGS"
5671 CPPFLAGS="$CPPFLAGS $with_libudev_cppflags"
5672
5673 AC_CHECK_HEADERS([libudev.h],
5674 [with_libudev="yes"],
5675 [with_libudev="no (libudev.h not found)"]
5676 )
5677
5678 CPPFLAGS="$SAVE_CPPFLAGS"
5679 fi
5680
5681 if test "x$with_libudev" = "xyes"; then
5682 SAVE_LDFLAGS="$LDFLAGS"
5683 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5684
5685 AC_CHECK_LIB([udev], [udev_new],
5686 [with_libudev="yes"],
5687 [with_libudev="no (libudev not found)"]
5688 )
5689
5690 LDFLAGS="$SAVE_LDFLAGS"
5691 fi
5692
5693 if test "x$with_libudev" = "xyes"; then
5694 BUILD_WITH_LIBUDEV_CPPFLAGS="$with_libudev_cppflags"
5695 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5696 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5697 fi
5698
5699 AC_SUBST([BUILD_WITH_LIBUDEV_CPPFLAGS])
5700 AC_SUBST([BUILD_WITH_LIBUDEV_LDFLAGS])
5701 AC_SUBST([BUILD_WITH_LIBUDEV_LIBS])
5702
5703 AM_CONDITIONAL([BUILD_WITH_LIBUDEV], [test "x$with_libudev" = "xyes"])
5704 # }}}
5705
5706 # --with-libupsclient {{{
5707 with_libupsclient_config=""
5708 AC_ARG_WITH([libupsclient],
5709 [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5710 [
5711 if test "x$withval" = "xno"; then
5712 with_libupsclient="no"
5713 else if test "x$withval" = "xyes"; then
5714 with_libupsclient="use_pkgconfig"
5715 else
5716 if test -f "$withval" && test -x "$withval"; then
5717 with_libupsclient_config="$withval"
5718 with_libupsclient="use_libupsclient_config"
5719 else if test -x "$withval/bin/libupsclient-config"; then
5720 with_libupsclient_config="$withval/bin/libupsclient-config"
5721 with_libupsclient="use_libupsclient_config"
5722 else
5723 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5724 with_libupsclient_cflags="-I$withval/include"
5725 with_libupsclient_libs="-L$withval/lib -lupsclient"
5726 with_libupsclient="yes"
5727 fi; fi
5728 fi; fi
5729 ],
5730 [with_libupsclient="use_pkgconfig"]
5731 )
5732
5733 # configure using libupsclient-config
5734 if test "x$with_libupsclient" = "xuse_libupsclient_config"; then
5735 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5736 if test $? -ne 0; then
5737 with_libupsclient="no ($with_libupsclient_config failed)"
5738 fi
5739 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5740 if test $? -ne 0; then
5741 with_libupsclient="no ($with_libupsclient_config failed)"
5742 fi
5743 fi
5744
5745 if test "x$with_libupsclient" = "xuse_libupsclient_config"; then
5746 with_libupsclient="yes"
5747 fi
5748
5749 # configure using pkg-config
5750 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5751 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5752 if test $? -ne 0; then
5753 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5754 fi
5755 fi
5756
5757 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5758 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5759 if test $? -ne 0; then
5760 with_libupsclient="no ($PKG_CONFIG failed)"
5761 fi
5762
5763 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5764 if test $? -ne 0; then
5765 with_libupsclient="no ($PKG_CONFIG failed)"
5766 fi
5767 fi
5768
5769 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5770 with_libupsclient="yes"
5771 fi
5772
5773 if test "x$with_libupsclient" = "xyes"; then
5774 SAVE_CPPFLAGS="$CPPFLAGS"
5775 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5776
5777 AC_CHECK_HEADERS([upsclient.h],
5778 [with_libupsclient="yes"],
5779 [with_libupsclient="no (upsclient.h not found)"]
5780 )
5781
5782 CPPFLAGS="$SAVE_CPPFLAGS"
5783 fi
5784
5785 if test "x$with_libupsclient" = "xyes"; then
5786 SAVE_LDFLAGS="$LDFLAGS"
5787 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5788
5789 AC_CHECK_LIB([upsclient], [upscli_connect],
5790 [with_libupsclient="yes"],
5791 [with_libupsclient="no (symbol upscli_connect not found)"]
5792 )
5793
5794 AC_CHECK_LIB([upsclient], [upscli_init],
5795 [AC_DEFINE([HAVE_UPSCLI_INIT], [1], [Define when upscli_init() (since version 2-7) is available.])]
5796 )
5797
5798 AC_CHECK_LIB([upsclient], [upscli_tryconnect],
5799 [AC_DEFINE([HAVE_UPSCLI_TRYCONNECT], [1], [Define when upscli_tryconnect() (since version 2.6.2) is available.])]
5800 )
5801
5802 LDFLAGS="$SAVE_LDFLAGS"
5803 fi
5804
5805 if test "x$with_libupsclient" = "xyes"; then
5806 SAVE_CPPFLAGS="$CPPFLAGS"
5807 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5808
5809 AC_CHECK_TYPES([UPSCONN_t, UPSCONN],
5810 [],
5811 [],
5812 [[
5813 #include <stdlib.h>
5814 #include <stdio.h>
5815 #include <upsclient.h>
5816 ]]
5817 )
5818
5819 CPPFLAGS="$SAVE_CPPFLAGS"
5820 fi
5821
5822 if test "x$with_libupsclient" = "xyes"; then
5823 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5824 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5825 fi
5826
5827 AC_SUBST([BUILD_WITH_LIBUPSCLIENT_CFLAGS])
5828 AC_SUBST([BUILD_WITH_LIBUPSCLIENT_LIBS])
5829 # }}}
5830
5831 # --with-libxenctrl {{{
5832 AC_ARG_WITH([libxenctrl],
5833 [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5834 [
5835 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5836 with_libxenctrl_cppflags="-I$withval/include"
5837 with_libxenctrl_ldflags="-L$withval/lib"
5838 with_libxenctrl="yes"
5839 else
5840 with_libxenctrl="$withval"
5841 fi
5842 ],
5843 [with_libxenctrl="yes"]
5844 )
5845
5846 if test "x$with_libxenctrl" = "xyes"; then
5847 SAVE_CPPFLAGS="$CPPFLAGS"
5848 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5849
5850 AC_CHECK_HEADERS([xenctrl.h],
5851 [with_libxenctrl="yes"],
5852 [with_libxenctrl="no (xenctrl.h not found)"]
5853 )
5854
5855 CPPFLAGS="$SAVE_CPPFLAGS"
5856 fi
5857
5858 if test "x$with_libxenctrl" = "xyes"; then
5859 SAVE_LDFLAGS="$LDFLAGS"
5860 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5861
5862 #Xen versions older than 3.4 has no xc_getcpuinfo()
5863 AC_CHECK_LIB([xenctrl], [xc_getcpuinfo],
5864 [with_libxenctrl="yes"],
5865 [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"]
5866 )
5867
5868 LDFLAGS="$SAVE_LDFLAGS"
5869 fi
5870
5871 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5872 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5873 AC_SUBST([LIBXENCTL_CPPFLAGS])
5874 AC_SUBST([LIBXENCTL_LDFLAGS])
5875 # }}}
5876
5877 # --with-libxmms {{{
5878 with_xmms_config="xmms-config"
5879 AC_ARG_WITH([libxmms],
5880 [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5881 [
5882 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5883 with_libxmms="$withval"
5884 else
5885 if test -f "$withval" && test -x "$withval"; then
5886 with_xmms_config="$withval"
5887 else if test -x "$withval/bin/xmms-config"; then
5888 with_xmms_config="$withval/bin/xmms-config"
5889 fi; fi
5890 with_libxmms="yes"
5891 fi
5892 ],
5893 [with_libxmms="yes"]
5894 )
5895
5896 if test "x$with_libxmms" = "xyes"; then
5897 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5898 if test $? -ne 0; then
5899 with_libxmms="no"
5900 fi
5901 fi
5902
5903 if test "x$with_libxmms" = "xyes"; then
5904 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5905 if test $? -ne 0; then
5906 with_libxmms="no"
5907 fi
5908 fi
5909
5910 if test "x$with_libxmms" = "xyes"; then
5911 SAVE_CPPFLAGS="$CPPFLAGS"
5912 CPPFLAGS="$with_xmms_cflags"
5913
5914 AC_CHECK_HEADER([xmmsctrl.h],
5915 [with_libxmms="yes"],
5916 [with_libxmms="no"],
5917 )
5918
5919 CPPFLAGS="$SAVE_CPPFLAGS"
5920 fi
5921
5922 if test "x$with_libxmms" = "xyes"; then
5923 SAVE_LIBS="$LIBS"
5924 LIBS="$with_xmms_libs"
5925
5926 AC_CHECK_LIB([xmms], [xmms_remote_get_info],
5927 [with_libxmss="yes"],
5928 [with_libxmms="no"],
5929 [$with_xmms_libs]
5930
5931 )
5932
5933 LIBS="$SAVE_LIBS"
5934 fi
5935
5936 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5937 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5938
5939 AC_SUBST([BUILD_WITH_LIBXMMS_CFLAGS])
5940 AC_SUBST([BUILD_WITH_LIBXMMS_LIBS])
5941 # }}}
5942
5943 # --with-libyajl {{{
5944 AC_ARG_WITH([libyajl],
5945 [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5946 [
5947 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5948 with_libyajl_cppflags="-I$withval/include"
5949 with_libyajl_ldflags="-L$withval/lib"
5950 with_libyajl="yes"
5951 else
5952 with_libyajl="$withval"
5953 fi
5954 ],
5955 [with_libyajl="yes"]
5956 )
5957
5958 if test "x$with_libyajl" = "xyes"; then
5959 SAVE_CPPFLAGS="$CPPFLAGS"
5960 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5961
5962 AC_CHECK_HEADERS([yajl/yajl_parse.h],
5963 [with_libyajl="yes"],
5964 [with_libyajl="no (yajl/yajl_parse.h not found)"]
5965 )
5966
5967 AC_CHECK_HEADERS([yajl/yajl_tree.h],
5968 [with_libyajl2="yes"],
5969 [with_libyajl2="no (yajl/yajl_tree.h not found)"]
5970 )
5971
5972 AC_CHECK_HEADERS([yajl/yajl_version.h])
5973
5974 CPPFLAGS="$SAVE_CPPFLAGS"
5975 fi
5976
5977 if test "x$with_libyajl" = "xyes"; then
5978 SAVE_LDFLAGS="$LDFLAGS"
5979 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5980
5981 AC_CHECK_LIB([yajl], [yajl_alloc],
5982 [with_libyajl="yes"],
5983 [with_libyajl="no (Symbol 'yajl_alloc' not found)"]
5984 )
5985
5986 AC_CHECK_LIB([yajl], [yajl_tree_parse],
5987 [with_libyajl2="yes"],
5988 [with_libyajl2="no (Symbol 'yajl_tree_parse' not found)"]
5989 )
5990
5991 LDFLAGS="$SAVE_LDFLAGS"
5992 fi
5993
5994 if test "x$with_libyajl" = "xyes"; then
5995 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5996 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5997 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5998 AC_DEFINE([HAVE_LIBYAJL], [1], [Define if libyajl is present and usable.])
5999 fi
6000
6001 AC_SUBST([BUILD_WITH_LIBYAJL_CPPFLAGS])
6002 AC_SUBST([BUILD_WITH_LIBYAJL_LDFLAGS])
6003 AC_SUBST([BUILD_WITH_LIBYAJL_LIBS])
6004
6005 AM_CONDITIONAL([BUILD_WITH_LIBYAJL], [test "x$with_libyajl" = "xyes"])
6006 AM_CONDITIONAL([BUILD_WITH_LIBYAJL2], [test "x$with_libyajl$with_libyajl2" = "xyesyes"])
6007 # }}}
6008
6009 # --with-mic {{{
6010 with_mic_cppflags="-I/opt/intel/mic/sysmgmt/sdk/include"
6011 with_mic_ldflags="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
6012 with_mic_libs="-lMicAccessSDK -scif"
6013 AC_ARG_WITH([mic],
6014 [AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
6015 [
6016 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
6017 with_mic="$withval"
6018 else if test -d "$with_mic/lib"; then
6019 with_mic_cppflags="-I$withval/include"
6020 with_mic_ldflags="-L$withval/lib/Linux"
6021 with_mic="yes"
6022 fi; fi
6023 ],
6024 [with_mic="yes"]
6025 )
6026
6027 if test "x$with_mic" = "xyes"; then
6028 SAVE_CPPFLAGS="$CPPFLAGS"
6029 CPPFLAGS="$CPPFLAGS $with_mic_cppflags"
6030
6031 AC_CHECK_HEADERS([MicAccessApi.h],
6032 [with_mic="yes"],
6033 [with_mic="no (MicAccessApi not found)"]
6034 )
6035
6036 CPPFLAGS="$SAVE_CPPFLAGS"
6037 fi
6038
6039 if test "x$with_mic" = "xyes"; then
6040 SAVE_LDFLAGS="$LDFLAGS"
6041 LDFLAGS="$LDFLAGS $with_mic_ldflags"
6042
6043 AC_CHECK_LIB([MicAccessSDK], [MicInitAPI],
6044 [with_mic="yes"],
6045 [with_mic="no (symbol MicInitAPI not found)"],
6046 [$PTHREAD_LIBS -lscif]
6047 )
6048
6049 LDFLAGS="$SAVE_LDFLAGS"
6050 fi
6051
6052 if test "x$with_mic" = "xyes"; then
6053 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cppflags"
6054 BUILD_WITH_MIC_LDFLAGS="$with_mic_ldflags"
6055 BUILD_WITH_MIC_LIBS="$with_mic_libs"
6056 fi
6057 AC_SUBST([BUILD_WITH_MIC_CPPFLAGS])
6058 AC_SUBST([BUILD_WITH_MIC_LDFLAGS])
6059 AC_SUBST([BUILD_WITH_MIC_LIBS])
6060 #}}}
6061
6062 # --with-libvarnish {{{
6063 AC_ARG_WITH([libvarnish],
6064 [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
6065 [
6066 if test "x$withval" = "xno"; then
6067 with_libvarnish="no"
6068 else if test "x$withval" = "xyes"; then
6069 with_libvarnish="use_pkgconfig"
6070 else if test -d "$with_libvarnish/lib"; then
6071 with_libvarnish_cflags="-I$withval/include"
6072 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
6073 with_libvarnish="yes"
6074 fi; fi; fi
6075 ],
6076 [with_libvarnish="use_pkgconfig"]
6077 )
6078
6079 # configure using pkg-config
6080 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
6081 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
6082 if test $? -ne 0; then
6083 with_libvarnish="no (pkg-config doesn't know varnishapi)"
6084 fi
6085 fi
6086
6087 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
6088 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
6089 if test $? -ne 0; then
6090 with_libvarnish="no ($PKG_CONFIG failed)"
6091 fi
6092
6093 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
6094 if test $? -ne 0; then
6095 with_libvarnish="no ($PKG_CONFIG failed)"
6096 fi
6097 fi
6098 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
6099 with_libvarnish="yes"
6100 fi
6101
6102 if test "x$with_libvarnish" = "xyes"; then
6103 SAVE_CPPFLAGS="$CPPFLAGS"
6104 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
6105
6106 $PKG_CONFIG --atleast-version=6 'varnishapi' 2>/dev/null
6107 if test $? -eq 0; then
6108 AC_DEFINE([HAVE_VARNISH_V6], [1], [Varnish 6 API support])
6109 else
6110 $PKG_CONFIG --atleast-version=5.2 'varnishapi' 2>/dev/null
6111 if test $? -eq 0; then
6112 AC_DEFINE([HAVE_VARNISH_V5], [1], [Varnish 5 API support])
6113 else
6114 AC_CHECK_HEADERS([vapi/vsc.h],
6115 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
6116 [
6117 AC_CHECK_HEADERS([vsc.h],
6118 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support]) ],
6119 [
6120 AC_CHECK_HEADERS([varnishapi.h],
6121 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
6122 [with_libvarnish="no (found none of the varnish header files)"]
6123 )
6124 ]
6125 )
6126 ]
6127 )
6128 fi
6129 fi
6130
6131 CPPFLAGS="$SAVE_CPPFLAGS"
6132 fi
6133
6134 if test "x$with_libvarnish" = "xyes"; then
6135 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
6136 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
6137 fi
6138
6139 AC_SUBST([BUILD_WITH_LIBVARNISH_CFLAGS])
6140 AC_SUBST([BUILD_WITH_LIBVARNISH_LIBS])
6141 # }}}
6142
6143 # --with-libxml2 {{{
6144 AC_ARG_WITH(libxml2,
6145 [AS_HELP_STRING([--with-libxml2@<:@=PREFIX@:>@], [Path to libxml2.])],
6146 [
6147 if test "x$withval" = "xno"; then
6148 with_libxml2="no"
6149 else if test "x$withval" = "xyes"; then
6150 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
6151 if test $? -eq 0; then
6152 with_libxml2="yes"
6153 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
6154 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
6155 else
6156 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
6157 fi
6158 else
6159 with_libxml2="yes"
6160 with_libxml2_cflags="-I$withval/include"
6161 with_libxml2_ldflags="-L$withval/lib"
6162 fi; fi
6163 ],
6164 dnl if no argument --with-libxml2 was passed, find the library locations
6165 dnl with pkg-config just like above, when --with-libxml2=yes.
6166 [
6167 with_libxml2="yes"
6168 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
6169 if test $? -eq 0; then
6170 with_libxml2="yes"
6171 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
6172 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
6173 else
6174 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
6175 fi
6176 ]
6177 )
6178
6179 if test "x$with_libxml2" = "xyes"; then
6180 SAVE_CPPFLAGS="$CPPFLAGS"
6181 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
6182
6183 AC_CHECK_HEADERS([libxml/parser.h],
6184 [with_libxml2="yes"],
6185 [with_libxml2="no (libxml/parser.h not found)"]
6186 )
6187
6188 CPPFLAGS="$SAVE_CPPFLAGS"
6189 fi
6190
6191 if test "x$with_libxml2" = "xyes"; then
6192 SAVE_LDFLAGS="$LDFLAGS"
6193 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
6194
6195 AC_CHECK_LIB([xml2], [xmlXPathEval],
6196 [with_libxml2="yes"],
6197 [with_libxml2="no (symbol xmlXPathEval not found)"]
6198 )
6199
6200 LDFLAGS="$SAVE_LDFLAGS"
6201 fi
6202
6203 if test "x$with_libxml2" = "xyes"; then
6204 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
6205 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
6206 fi
6207
6208 AC_SUBST([BUILD_WITH_LIBXML2_CFLAGS])
6209 AC_SUBST([BUILD_WITH_LIBXML2_LIBS])
6210 # }}}
6211
6212 # pkg-config --exists libvirt {{{
6213 $PKG_CONFIG --exists libvirt 2>/dev/null
6214 if test $? = 0; then
6215 with_libvirt="yes"
6216 else
6217 with_libvirt="no (pkg-config doesn't know libvirt)"
6218 fi
6219
6220 if test "x$with_libvirt" = "xyes"; then
6221 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
6222 if test $? -ne 0; then
6223 with_libvirt="no"
6224 fi
6225
6226 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
6227 if test $? -ne 0; then
6228 with_libvirt="no"
6229 fi
6230 fi
6231
6232 if test "x$with_libvirt" = "xyes"; then
6233 SAVE_CPPFLAGS="$CPPFLAGS"
6234 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
6235
6236 AC_CHECK_HEADERS([libvirt/libvirt.h],
6237 [with_libvirt="yes"],
6238 [with_libvirt="no (libvirt/libvirt.h not found)"]
6239 )
6240
6241 CPPFLAGS="$SAVE_CPPFLAGS"
6242 fi
6243
6244 if test "x$with_libvirt" = "xyes"; then
6245 SAVE_LDFLAGS="$LDFLAGS"
6246 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
6247
6248 AC_CHECK_LIB([virt], [virDomainBlockStats],
6249 [with_libvirt="yes"],
6250 [with_libvirt="no (symbol virDomainBlockStats not found)"]
6251 )
6252
6253 LDFLAGS="$SAVE_LDFLAGS"
6254 fi
6255
6256 if test "x$with_libvirt" = "xyes"; then
6257 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
6258 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
6259 fi
6260
6261 AC_SUBST([BUILD_WITH_LIBVIRT_CFLAGS])
6262 AC_SUBST([BUILD_WITH_LIBVIRT_LIBS])
6263 # }}}
6264
6265 # $PKG_CONFIG --exists OpenIPMIpthread {{{
6266 with_libopenipmipthread="yes"
6267 AC_MSG_CHECKING([for libOpenIPMIpthread])
6268 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
6269 if test $? -ne 0; then
6270 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
6271 fi
6272 AC_MSG_RESULT([$with_libopenipmipthread])
6273
6274 if test "x$with_libopenipmipthread" = "xyes"; then
6275 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
6276 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
6277 if test $? -eq 0; then
6278 with_libopenipmipthread_cflags="$temp_result"
6279 else
6280 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
6281 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
6282 fi
6283 AC_MSG_RESULT([$temp_result])
6284 fi
6285
6286 if test "x$with_libopenipmipthread" = "xyes"; then
6287 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
6288 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
6289 if test $? -eq 0; then
6290 with_libopenipmipthread_ldflags="$temp_result"
6291 else
6292 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
6293 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
6294 fi
6295 AC_MSG_RESULT([$temp_result])
6296 fi
6297
6298 if test "x$with_libopenipmipthread" = "xyes"; then
6299 SAVE_CPPFLAGS="$CPPFLAGS"
6300 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
6301
6302 AC_CHECK_HEADERS([OpenIPMI/ipmi_smi.h],
6303 [with_libopenipmipthread="yes"],
6304 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
6305 [[
6306 #include <OpenIPMI/ipmiif.h>
6307 #include <OpenIPMI/ipmi_err.h>
6308 #include <OpenIPMI/ipmi_posix.h>
6309 #include <OpenIPMI/ipmi_conn.h>
6310 ]]
6311 )
6312
6313 CPPFLAGS="$SAVE_CPPFLAGS"
6314 fi
6315
6316 if test "x$with_libopenipmipthread" = "xyes"; then
6317 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
6318 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
6319 fi
6320
6321 AC_SUBST([BUILD_WITH_OPENIPMI_CFLAGS])
6322 AC_SUBST([BUILD_WITH_OPENIPMI_LIBS])
6323 # }}}
6324
6325 # --with-libatasmart {{{
6326 AC_ARG_WITH([libatasmart],
6327 [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
6328 [
6329 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
6330 with_libatasmart_cppflags="-I$withval/include"
6331 with_libatasmart_ldflags="-L$withval/lib"
6332 with_libatasmart="yes"
6333 else
6334 with_libatasmart="$withval"
6335 fi
6336 ],
6337 [
6338 if test "x$ac_system" = "xLinux"; then
6339 with_libatasmart="yes"
6340 else
6341 with_libatasmart="no (Linux only library)"
6342 fi
6343 ]
6344 )
6345
6346 if test "x$with_libatasmart" = "xyes"; then
6347 SAVE_CPPFLAGS="$CPPFLAGS"
6348 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
6349
6350 AC_CHECK_HEADERS([atasmart.h],
6351 [with_libatasmart="yes"],
6352 [with_libatasmart="no (atasmart.h not found)"])
6353
6354 CPPFLAGS="$SAVE_CPPFLAGS"
6355 fi
6356
6357 if test "x$with_libatasmart" = "xyes"; then
6358 SAVE_LDFLAGS="$LDFLAGS"
6359 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
6360
6361 AC_CHECK_LIB([atasmart], [sk_disk_open],
6362 [with_libatasmart="yes"],
6363 [with_libatasmart="no (Symbol 'sk_disk_open' not found)"]
6364 )
6365
6366 LDFLAGS="$SAVE_LDFLAGS"
6367 fi
6368
6369 if test "x$with_libatasmart" = "xyes"; then
6370 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
6371 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
6372 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
6373 fi
6374
6375 AC_SUBST([BUILD_WITH_LIBATASMART_CPPFLAGS])
6376 AC_SUBST([BUILD_WITH_LIBATASMART_LDFLAGS])
6377 AC_SUBST([BUILD_WITH_LIBATASMART_LIBS])
6378 # }}}
6379
6380 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
6381 [with_libnotify="yes"],
6382 [with_libnotify="no (pkg-config doesn't know libnotify)"]
6383 )
6384
6385 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
6386 [with_libriemann_client="yes"],
6387 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"]
6388 )
6389
6390 # Check for enabled/disabled features
6391 #
6392
6393 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
6394 # ------------------------------------------------------------
6395 dnl
6396 m4_define([my_toupper],[m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
6397 dnl
6398 AC_DEFUN(
6399 [AC_COLLECTD],
6400 [
6401 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
6402 m4_if(
6403 [$2],
6404 [enable],
6405 [dnl
6406 m4_define([EnDis],[disabled])dnl
6407 m4_define([YesNo],[no])dnl
6408 ],dnl
6409 [m4_if(
6410 [$2],
6411 [disable],
6412 [dnl
6413 m4_define([EnDis],[enabled])dnl
6414 m4_define([YesNo],[yes])dnl
6415 ],
6416 [dnl
6417 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
6418 ]dnl
6419 )]dnl
6420 )dnl
6421 m4_if([$3], [feature], [],
6422 [m4_if(
6423 [$3], [module], [],
6424 [dnl
6425 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
6426 ]dnl
6427 )]dnl
6428 )dnl
6429 AC_ARG_ENABLE(
6430 [$1],
6431 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
6432 [],
6433 enable_$1='[YesNo]'dnl
6434 )# AC_ARG_ENABLE
6435 if test "x$enable_$1" = "xno"; then
6436 collectd_$1=0
6437 else
6438 if test "x$enable_$1" = "xyes"; then
6439 collectd_$1=1
6440 else
6441 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
6442 collectd_$1=1
6443 enable_$1='yes'
6444 fi
6445 fi
6446 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [whether or not to enable $3 $4])
6447 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
6448 ]dnl
6449 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
6450
6451 # AC_PLUGIN(name, default, info)
6452 # ------------------------------------------------------------
6453 dnl
6454 AC_DEFUN(
6455 [AC_PLUGIN],
6456 [
6457 enable_plugin="no"
6458 force="no"
6459 AC_ARG_ENABLE([$1],
6460 [AS_HELP_STRING([--enable-$1],[$3])],
6461 [
6462 if test "x$enableval" = "xyes"; then
6463 enable_plugin="yes"
6464 else if test "x$enableval" = "xforce"; then
6465 enable_plugin="yes"
6466 force="yes"
6467 else
6468 enable_plugin="no (disabled on command line)"
6469 fi; fi
6470 ],
6471 [
6472 if test "x$enable_all_plugins" = "xauto"; then
6473 if test "x$2" = "xyes"; then
6474 enable_plugin="yes"
6475 else
6476 enable_plugin="$2"
6477 fi
6478 else
6479 enable_plugin="$enable_all_plugins"
6480 fi
6481 ]
6482 )
6483 if test "x$enable_plugin" = "xyes"; then
6484 if test "x$2" = "xyes" || test "x$force" = "xyes"; then
6485 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
6486 if test "x$2" != "xyes"; then
6487 dependency_warning="yes"
6488 fi
6489 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
6490 dependency_error="yes"
6491 enable_plugin="$2 (dependency error)"
6492 fi
6493 fi
6494 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), [test "x$enable_plugin" = "xyes"])
6495 enable_$1="$enable_plugin"
6496 ]
6497 )# AC_PLUGIN(name, default, info)
6498
6499 # --with-libslurm {{{
6500 AC_ARG_WITH([libslurm],
6501 [AS_HELP_STRING([--with-libslurm@<:@=PREFIX@:>@], [Path to the libslurm library.])],
6502 [
6503 if test "x$withval" = "xno"; then
6504 with_libslurm="no"
6505 else if test "x$withval" = "xyes"; then
6506 with_libslurm="use_pkgconfig"
6507 else if test -d "$with_libslurm/lib"; then
6508 AC_MSG_NOTICE([Not checking for libslurm: Manually configured])
6509 with_libslurm_cflags="-I$withval/include"
6510 with_libslurm_libs="-L$withval/lib -llibslurm"
6511 with_libslurm="yes"
6512 fi; fi; fi
6513 ],
6514 [with_libslurm="use_pkgconfig"]
6515 )
6516
6517 # configure using pkg-config
6518 if test "x$with_libslurm" = "xuse_pkgconfig"; then
6519 AC_MSG_NOTICE([Checking for libslurm using $PKG_CONFIG])
6520 $PKG_CONFIG --exists 'slurm' 2>/dev/null
6521 if test $? -ne 0; then
6522 with_libslurm="no (pkg-config doesn't know libslurm)"
6523 fi
6524 fi
6525
6526 if test "x$with_libslurm" = "xuse_pkgconfig"; then
6527 with_libslurm_cflags="`$PKG_CONFIG --cflags 'slurm'`"
6528 if test $? -ne 0; then
6529 with_libslurm="no ($PKG_CONFIG failed)"
6530 fi
6531
6532 with_libslurm_libs="`$PKG_CONFIG --libs 'slurm'`"
6533 if test $? -ne 0; then
6534 with_libslurm="no ($PKG_CONFIG failed)"
6535 fi
6536 fi
6537
6538 if test "x$with_libslurm" = "xuse_pkgconfig"; then
6539 with_libslurm="yes"
6540 fi
6541
6542 if test "x$with_libslurm" = "xyes"; then
6543 SAVE_CPPFLAGS="$CPPFLAGS"
6544 CPPFLAGS="$CPPFLAGS $with_libslurm_cflags"
6545
6546 AC_CHECK_HEADERS([slurm/slurm.h],
6547 [with_libslurm="yes"],
6548 [with_libslurm="no (slurm/slurm.h not found)"]
6549 )
6550
6551 CPPFLAGS="$SAVE_CPPFLAGS"
6552 fi
6553
6554 if test "x$with_libslurm" = "xyes"; then
6555 SAVE_LDFLAGS="$LDFLAGS"
6556 LDFLAGS="$LDFLAGS $with_libslurm_libs"
6557
6558 AC_CHECK_LIB([slurm], [slurm_load_jobs],
6559 [with_libslurm="yes"],
6560 [with_libslurm="no (symbol slurm_load_jobs not found)"]
6561 )
6562
6563 LDFLAGS="$SAVE_LDFLAGS"
6564 fi
6565
6566 if test "x$with_libslurm" = "xyes"; then
6567 BUILD_WITH_LIBSLURM_CFLAGS="$with_libslurm_cflags"
6568 BUILD_WITH_LIBSLURM_LIBS="$with_libslurm_libs"
6569 fi
6570
6571 AC_SUBST([BUILD_WITH_LIBSLURM_CFLAGS])
6572 AC_SUBST([BUILD_WITH_LIBSLURM_LIBS])
6573 # }}}
6574
6575
6576 m4_divert_once([HELP_ENABLE], [
6577 collectd features:])
6578 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
6579 AC_COLLECTD([debug], [enable], [feature], [debugging])
6580 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
6581 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
6582 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
6583
6584 dependency_warning="no"
6585 dependency_error="no"
6586
6587 plugin_ascent="no"
6588 plugin_barometer="no"
6589 plugin_battery="no"
6590 plugin_bind="no"
6591 plugin_buddyinfo="no"
6592 plugin_capabilities="no"
6593 plugin_ceph="no"
6594 plugin_cgroups="no"
6595 plugin_connectivity="no"
6596 plugin_conntrack="no"
6597 plugin_contextswitch="no"
6598 plugin_cpu="no"
6599 plugin_cpufreq="no"
6600 plugin_cpusleep="no"
6601 plugin_curl_json="no"
6602 plugin_curl_xml="no"
6603 plugin_df="no"
6604 plugin_disk="no"
6605 plugin_drbd="no"
6606 plugin_dpdkevents="no"
6607 plugin_dpdkstat="no"
6608 plugin_dpdk_telemetry="no"
6609 plugin_entropy="no"
6610 plugin_ethstat="no"
6611 plugin_fhcount="no"
6612 plugin_fscache="no"
6613 plugin_gps="no"
6614 plugin_gpu_nvidia="no"
6615 plugin_grpc="no"
6616 plugin_hugepages="no"
6617 plugin_infiniband="no"
6618 plugin_intel_pmu="no"
6619 plugin_intel_rdt="no"
6620 plugin_interface="no"
6621 plugin_ipc="no"
6622 plugin_ipmi="no"
6623 plugin_ipstats="no"
6624 plugin_ipvs="no"
6625 plugin_irq="no"
6626 plugin_load="no"
6627 plugin_log_logstash="no"
6628 plugin_mcelog="no"
6629 plugin_mdevents="no"
6630 plugin_memory="no"
6631 plugin_multimeter="no"
6632 plugin_netstat_udp="no"
6633 plugin_nfs="no"
6634 plugin_numa="no"
6635 plugin_ovs_events="no"
6636 plugin_ovs_stats="no"
6637 plugin_pcie_errors="no"
6638 plugin_perl="no"
6639 plugin_pinba="no"
6640 plugin_processes="no"
6641 plugin_procevent="no"
6642 plugin_protocols="no"
6643 plugin_python="no"
6644 plugin_serial="no"
6645 plugin_smart="no"
6646 plugin_swap="no"
6647 plugin_synproxy="no"
6648 plugin_sysevent="no"
6649 plugin_tape="no"
6650 plugin_tcpconns="no"
6651 plugin_ted="no"
6652 plugin_thermal="no"
6653 plugin_turbostat="no"
6654 plugin_ubi="no"
6655 plugin_uptime="no"
6656 plugin_users="no"
6657 plugin_virt="no"
6658 plugin_vmem="no"
6659 plugin_vserver="no"
6660 plugin_wireless="no"
6661 plugin_write_prometheus="no"
6662 plugin_write_stackdriver="no"
6663 plugin_xencpu="no"
6664 plugin_zfs_arc="no"
6665 plugin_zone="no"
6666 plugin_zookeeper="no"
6667
6668 # Linux
6669 if test "x$ac_system" = "xLinux"; then
6670 plugin_battery="yes"
6671 plugin_buddyinfo="yes"
6672 plugin_cgroups="yes"
6673 plugin_conntrack="yes"
6674 plugin_contextswitch="yes"
6675 plugin_cpu="yes"
6676 plugin_cpufreq="yes"
6677 plugin_disk="yes"
6678 plugin_drbd="yes"
6679 plugin_entropy="yes"
6680 plugin_fhcount="yes"
6681 plugin_fscache="yes"
6682 plugin_hugepages="yes"
6683 plugin_infiniband="yes"
6684 plugin_interface="yes"
6685 plugin_ipc="yes"
6686 plugin_irq="yes"
6687 plugin_load="yes"
6688 plugin_mcelog="yes"
6689 plugin_mdevents="yes"
6690 plugin_memory="yes"
6691 plugin_nfs="yes"
6692 plugin_numa="yes"
6693 plugin_processes="yes"
6694 plugin_protocols="yes"
6695 plugin_serial="yes"
6696 plugin_swap="yes"
6697 plugin_synproxy="yes"
6698 plugin_tcpconns="yes"
6699 plugin_thermal="yes"
6700 plugin_ubi="yes"
6701 plugin_uptime="yes"
6702 plugin_vmem="yes"
6703 plugin_vserver="yes"
6704 plugin_wireless="yes"
6705 plugin_zfs_arc="yes"
6706
6707 if test "x$ac_cv_header_linux_ip_vs_h" = "xyes"; then
6708 plugin_ipvs="yes"
6709 fi
6710
6711 if test "x$have_cpuid_h" = "xyes"; then
6712 plugin_turbostat="yes"
6713 fi
6714
6715 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"; then
6716 plugin_cpusleep="yes"
6717 fi
6718
6719 if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
6720 plugin_ovs_events="yes"
6721 plugin_ovs_stats="yes"
6722 plugin_procevent="yes"
6723
6724 if test "x$with_libmnl" = "xyes"; then
6725 plugin_connectivity="yes"
6726 fi
6727 fi
6728
6729 if test "x$have_pci_regs_h" = "xyes"; then
6730 plugin_pcie_errors="yes"
6731 fi
6732
6733 if test "x$with_libmicrohttpd" = "xyes" && test "x$with_libjansson" = "xyes"; then
6734 plugin_capabilities="yes"
6735 fi
6736 fi
6737
6738 if test "x$ac_system" = "xOpenBSD"; then
6739 plugin_tcpconns="yes"
6740 fi
6741
6742 if test "x$ac_system" = "xNetBSD"; then
6743 plugin_disk="yes"
6744 plugin_entropy="yes"
6745 plugin_irq="yes"
6746 plugin_nfs="yes"
6747 plugin_processes="yes"
6748 plugin_netstat_udp="yes"
6749 fi
6750
6751 # Mac OS X devices
6752 if test "x$with_libiokit" = "xyes"; then
6753 plugin_battery="yes"
6754 plugin_disk="yes"
6755 fi
6756
6757 # AIX
6758
6759 if test "x$ac_system" = "xAIX"; then
6760 plugin_ipc="yes"
6761 plugin_tcpconns="yes"
6762 fi
6763
6764 # FreeBSD
6765
6766 if test "x$ac_system" = "xFreeBSD"; then
6767 plugin_cpufreq="yes"
6768 plugin_disk="yes"
6769 plugin_ipstats="yes"
6770 plugin_zfs_arc="yes"
6771 fi
6772
6773
6774 if test "x$with_perfstat" = "xyes"; then
6775 plugin_contextswitch="yes"
6776 plugin_cpu="yes"
6777 plugin_disk="yes"
6778 plugin_interface="yes"
6779 plugin_load="yes"
6780 plugin_memory="yes"
6781 plugin_swap="yes"
6782 plugin_uptime="yes"
6783 fi
6784
6785 if test "x$with_procinfo" = "xyes"; then
6786 plugin_processes="yes"
6787 fi
6788
6789 # Solaris
6790 if test "x$with_kstat" = "xyes"; then
6791 plugin_nfs="yes"
6792 plugin_processes="yes"
6793 plugin_uptime="yes"
6794 plugin_zfs_arc="yes"
6795 plugin_zone="yes"
6796 fi
6797
6798 if test "x$with_devinfo" = "xyes" && test "x$with_kstat" = "xyes"; then
6799 plugin_cpu="yes"
6800 plugin_disk="yes"
6801 plugin_interface="yes"
6802 plugin_memory="yes"
6803 plugin_tape="yes"
6804 fi
6805
6806 if test "x$with_libi2c" = "xyes"; then
6807 plugin_barometer="yes"
6808 fi
6809
6810
6811 # libstatgrab
6812 if test "x$with_libstatgrab" = "xyes"; then
6813 plugin_cpu="yes"
6814 plugin_disk="yes"
6815 plugin_interface="yes"
6816 plugin_load="yes"
6817 plugin_memory="yes"
6818 plugin_swap="yes"
6819 plugin_users="yes"
6820 fi
6821
6822 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
6823 plugin_ascent="yes"
6824 if test "x$have_strptime" = "xyes"; then
6825 plugin_bind="yes"
6826 fi
6827 fi
6828
6829 if test "x$with_libopenipmipthread" = "xyes"; then
6830 plugin_ipmi="yes"
6831 fi
6832
6833 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"; then
6834 plugin_curl_json="yes"
6835 fi
6836
6837 if test "x$with_libcurl" = "xyes" && test "x$with_libssl" = "xyes" && test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
6838 plugin_write_stackdriver="yes"
6839 fi
6840
6841 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
6842 plugin_curl_xml="yes"
6843 fi
6844
6845 if test "x$with_libyajl" = "xyes"; then
6846 plugin_ceph="yes"
6847 plugin_sysevent="yes"
6848 fi
6849
6850 if test "x$have_processor_info" = "xyes"; then
6851 plugin_cpu="yes"
6852 fi
6853
6854 if test "x$have_sysctl" = "xyes"; then
6855 plugin_cpu="yes"
6856 plugin_memory="yes"
6857 plugin_uptime="yes"
6858 if test "x$ac_system" = "xDarwin"; then
6859 plugin_swap="yes"
6860 fi
6861 fi
6862
6863 if test "x$have_sysctlbyname" = "xyes"; then
6864 plugin_contextswitch="yes"
6865 plugin_cpu="yes"
6866 plugin_memory="yes"
6867 plugin_tcpconns="yes"
6868 fi
6869
6870 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"; then
6871 plugin_df="yes"
6872 fi
6873
6874 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"; then
6875 plugin_df="yes"
6876 fi
6877
6878 if test "x$c_cv_have_one_getmntent" = "xyes"; then
6879 plugin_df="yes"
6880 fi
6881
6882 if test "x$have_getmntent_r" = "xyes"; then
6883 plugin_df="yes"
6884 fi
6885
6886 if test "x$plugin_df" = "xyes"; then
6887 plugin_df="no"
6888 if test "x$have_statfs" = "xyes"; then
6889 plugin_df="yes"
6890 fi
6891
6892 if test "x$have_statvfs" = "xyes"; then
6893 plugin_df="yes"
6894 fi
6895 fi
6896
6897 if test "x$have_linux_sockios_h" = "xyes" && test "x$have_linux_ethtool_h" = "xyes"; then
6898 plugin_ethstat="yes"
6899 fi
6900
6901 if test "x$with_libgps" = "xyes"; then
6902 plugin_gps="yes"
6903 fi
6904
6905 plugin_grpc="yes"
6906 if test "x$GRPC_CPP_PLUGIN" = "x"; then
6907 plugin_grpc="no (grpc_cpp_plugin not found)"
6908 fi
6909 if test "x$have_protoc3" != "xyes"; then
6910 plugin_grpc="no (protoc3 not found)"
6911 fi
6912 if test "x$with_libprotobuf" != "xyes"; then
6913 plugin_grpc="no (libprotobuf not found)"
6914 fi
6915 if test "x$with_libgrpcpp" != "xyes"; then
6916 plugin_grpc="no (libgrpc++ not found)"
6917 fi
6918
6919 if test "x$have_getifaddrs" = "xyes"; then
6920 plugin_interface="yes"
6921 fi
6922
6923 if test "x$have_getloadavg" = "xyes"; then
6924 plugin_load="yes"
6925 fi
6926
6927 if test "x$with_libyajl" = "xyes"; then
6928 plugin_log_logstash="yes"
6929 fi
6930
6931 if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then
6932 plugin_perl="yes"
6933 fi
6934
6935 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"; then
6936 plugin_pinba="yes"
6937 if test "x$with_libmicrohttpd" = "xyes"; then
6938 plugin_write_prometheus="yes"
6939 fi
6940 fi
6941
6942 # Mac OS X memory interface
6943 if test "x$have_host_statistics" = "xyes"; then
6944 plugin_memory="yes"
6945 fi
6946
6947 if test "x$have_termios_h" = "xyes"; then
6948 if test "x$ac_system" != "xAIX"; then
6949 plugin_multimeter="yes"
6950 fi
6951 plugin_ted="yes"
6952 fi
6953
6954 if test "x$have_thread_info" = "xyes"; then
6955 plugin_processes="yes"
6956 fi
6957
6958 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"; then
6959 plugin_processes="yes"
6960 fi
6961
6962 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"; then
6963 plugin_processes="yes"
6964 fi
6965
6966 if test "x$with_libpython" != "xno"; then
6967 plugin_python="yes"
6968 fi
6969
6970 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"; then
6971 plugin_smart="yes"
6972 fi
6973
6974 if test "x$with_kvm_getswapinfo" = "xyes"; then
6975 plugin_swap="yes"
6976 fi
6977
6978 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"; then
6979 plugin_swap="yes"
6980 fi
6981
6982 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"; then
6983 plugin_swap="yes"
6984 fi
6985
6986 if test "x$with_kvm_openfiles = "xyes" && $with_kvm_nlist" = "xyes"; then
6987 plugin_tcpconns="yes"
6988 fi
6989
6990 if test "x$have_getutent" = "xyes"; then
6991 plugin_users="yes"
6992 fi
6993
6994 if test "x$have_getutxent" = "xyes"; then
6995 plugin_users="yes"
6996 fi
6997
6998 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"; then
6999 plugin_virt="yes"
7000 fi
7001
7002 if test "x$with_libxenctrl" = "xyes"; then
7003 plugin_xencpu="yes"
7004 fi
7005
7006 if test "x$with_libdpdk" = "xyes"; then
7007 plugin_dpdkevents="$dpdk_keepalive"
7008 plugin_dpdkstat="yes"
7009 fi
7010
7011 if test "x$with_libjansson" = "xyes"; then
7012 plugin_dpdk_telemetry="yes"
7013 fi
7014
7015 m4_divert_once([HELP_ENABLE], [
7016 collectd plugins:])
7017
7018 AC_ARG_ENABLE([all-plugins],
7019 [AS_HELP_STRING([--enable-all-plugins], [enable all plugins @<:@default=yes@:>@])],
7020 [
7021 if test "x$enableval" = "xyes"; then
7022 enable_all_plugins="yes"
7023 else if test "x$enableval" = "xauto"; then
7024 enable_all_plugins="auto"
7025 else
7026 enable_all_plugins="no"
7027 fi; fi
7028 ],
7029 [enable_all_plugins="auto"]
7030 )
7031
7032 m4_divert_once([HELP_ENABLE], [])
7033
7034 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
7035 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
7036 AC_PLUGIN([amqp1], [$with_libqpid_proton], [AMQP 1.0 output plugin])
7037 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
7038 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
7039 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
7040 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
7041 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
7042 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
7043 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
7044 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
7045 AC_PLUGIN([buddyinfo], [$plugin_buddyinfo], [buddyinfo statistics])
7046 AC_PLUGIN([capabilities], [$plugin_capabilities], [Platform static capabilities])
7047 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
7048 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
7049 AC_PLUGIN([chrony], [yes], [Chrony statistics])
7050 AC_PLUGIN([check_uptime], [yes], [Notify about uptime reset])
7051 AC_PLUGIN([connectivity], [$plugin_connectivity], [Network interface up/down events])
7052 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
7053 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
7054 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
7055 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
7056 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
7057 AC_PLUGIN([csv], [yes], [CSV output plugin])
7058 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
7059 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
7060 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
7061 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
7062 AC_PLUGIN([dcpmm], [$with_libpmwapi], [Intel(R) Optane(TM) DC Persistent Memory performance and health statistics])
7063 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
7064 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
7065 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
7066 AC_PLUGIN([dpdkevents], [$plugin_dpdkevents], [Events from DPDK])
7067 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats from DPDK])
7068 AC_PLUGIN([dpdk_telemetry], [$plugin_dpdk_telemetry], [Metrics from DPDK Telemetry])
7069 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
7070 AC_PLUGIN([email], [yes], [EMail statistics])
7071 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
7072 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
7073 AC_PLUGIN([exec], [yes], [Execution of external programs])
7074 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
7075 AC_PLUGIN([filecount], [yes], [Count files in directories])
7076 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
7077 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
7078 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
7079 AC_PLUGIN([gpu_nvidia], [$with_cuda], [NVIDIA GPU plugin])
7080 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
7081 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
7082 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
7083 AC_PLUGIN([infiniband], [$plugin_infiniband], [Infiniband statistics])
7084 AC_PLUGIN([intel_pmu], [$with_libjevents], [Intel performance monitor plugin])
7085 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
7086 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
7087 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
7088 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
7089 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
7090 AC_PLUGIN([ipstats], [$plugin_ipstats], [IP packet statistics])
7091 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
7092 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
7093 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
7094 AC_PLUGIN([load], [$plugin_load], [System load])
7095 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
7096 AC_PLUGIN([logfile], [yes], [File logging plugin])
7097 AC_PLUGIN([logparser], [yes], [Log parsing plugin])
7098 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
7099 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
7100 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
7101 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
7102 AC_PLUGIN([match_hashed], [yes], [The hashed match])
7103 AC_PLUGIN([match_regex], [yes], [The regex match])
7104 AC_PLUGIN([match_timediff], [yes], [The timediff match])
7105 AC_PLUGIN([match_value], [yes], [The value match])
7106 AC_PLUGIN([mbmon], [yes], [Query mbmond])
7107 AC_PLUGIN([mcelog], [$plugin_mcelog], [Machine Check Exceptions notifications])
7108 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
7109 AC_PLUGIN([mdevents], [$plugin_mdevents], [Events from md (Linux Software RAID) devices])
7110 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
7111 AC_PLUGIN([memcached], [yes], [memcached statistics])
7112 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
7113 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
7114 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
7115 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
7116 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
7117 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
7118 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
7119 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
7120 AC_PLUGIN([netstat_udp], [$plugin_netstat_udp], [UDP network statistics])
7121 AC_PLUGIN([network], [yes], [Network communication plugin])
7122 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
7123 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
7124 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
7125 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
7126 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
7127 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
7128 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
7129 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
7130 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
7131 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
7132 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
7133 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
7134 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
7135 AC_PLUGIN([ovs_events], [$plugin_ovs_events], [OVS events plugin])
7136 AC_PLUGIN([ovs_stats], [$plugin_ovs_stats], [OVS statistics plugin])
7137 AC_PLUGIN([pcie_errors], [$plugin_pcie_errors], [PCIe errors plugin])
7138 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
7139 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
7140 # FIXME: Check for libevent, too.
7141 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
7142 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
7143 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
7144 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
7145 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
7146 AC_PLUGIN([procevent], [$plugin_procevent], [Process event (start, stop) statistics])
7147 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
7148 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
7149 AC_PLUGIN([redfish], [$with_libredfish], [Redfish plugin])
7150 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
7151 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
7152 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
7153 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
7154 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
7155 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
7156 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
7157 AC_PLUGIN([slurm], [$with_libslurm], [SLURM jobs and nodes status])
7158 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
7159 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
7160 AC_PLUGIN([snmp_agent], [$with_libnetsnmpagent], [SNMP agent plugin])
7161 AC_PLUGIN([statsd], [yes], [StatsD plugin])
7162 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
7163 AC_PLUGIN([synproxy], [$plugin_synproxy], [Synproxy stats plugin])
7164 AC_PLUGIN([sysevent], [$plugin_sysevent], [rsyslog events])
7165 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
7166 AC_PLUGIN([table], [yes], [Parsing of tabular data])
7167 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
7168 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
7169 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
7170 AC_PLUGIN([target_notification], [yes], [The notification target])
7171 AC_PLUGIN([target_replace], [yes], [The replace target])
7172 AC_PLUGIN([target_scale], [yes], [The scale target])
7173 AC_PLUGIN([target_set], [yes], [The set target])
7174 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
7175 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
7176 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
7177 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
7178 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
7179 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
7180 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
7181 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
7182 AC_PLUGIN([ubi], [$plugin_ubi], [UBIFS statistics])
7183 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
7184 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
7185 AC_PLUGIN([users], [$plugin_users], [User statistics])
7186 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
7187 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
7188 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
7189 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
7190 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
7191 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
7192 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
7193 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
7194 AC_PLUGIN([write_influxdb_udp], [yes], [Influxdb udp output plugin])
7195 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
7196 AC_PLUGIN([write_log], [yes], [Log output plugin])
7197 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
7198 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
7199 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
7200 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
7201 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
7202 AC_PLUGIN([write_stackdriver], [$plugin_write_stackdriver], [Google Stackdriver Monitoring output plugin])
7203 AC_PLUGIN([write_syslog], [yes], [Syslog output plugin])
7204 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
7205 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
7206 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
7207 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
7208 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
7209 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
7210
7211 dnl Default configuration file
7212 # Load either syslog or logfile
7213 LOAD_PLUGIN_SYSLOG=""
7214 LOAD_PLUGIN_LOGFILE=""
7215 LOAD_PLUGIN_LOG_LOGSTASH=""
7216
7217 AC_MSG_CHECKING([which default log plugin to load])
7218 default_log_plugin="none"
7219 if test "x$enable_syslog" = "xyes"; then
7220 default_log_plugin="syslog"
7221 else
7222 LOAD_PLUGIN_SYSLOG="##"
7223 fi
7224
7225 if test "x$enable_logfile" = "xyes"; then
7226 if test "x$default_log_plugin" = "xnone"; then
7227 default_log_plugin="logfile"
7228 else
7229 LOAD_PLUGIN_LOGFILE="#"
7230 fi
7231 else
7232 LOAD_PLUGIN_LOGFILE="##"
7233 fi
7234
7235 if test "x$enable_log_logstash" = "xyes"; then
7236 LOAD_PLUGIN_LOG_LOGSTASH="#"
7237 else
7238 LOAD_PLUGIN_LOG_LOGSTASH="##"
7239 fi
7240
7241 AC_MSG_RESULT([$default_log_plugin])
7242
7243 AC_SUBST([LOAD_PLUGIN_SYSLOG])
7244 AC_SUBST([LOAD_PLUGIN_LOGFILE])
7245 AC_SUBST([LOAD_PLUGIN_LOG_LOGSTASH])
7246
7247 if test "x$enable_debug" = "xyes"; then
7248 DEFAULT_LOG_LEVEL="debug"
7249 else
7250 DEFAULT_LOG_LEVEL="info"
7251 fi
7252 AC_SUBST([DEFAULT_LOG_LEVEL])
7253
7254 # Load only one of rrdtool, network, csv in the default config.
7255 LOAD_PLUGIN_RRDTOOL=""
7256 LOAD_PLUGIN_NETWORK=""
7257 LOAD_PLUGIN_CSV=""
7258
7259 AC_MSG_CHECKING([which default write plugin to load])
7260 default_write_plugin="none"
7261 if test "x$enable_rrdtool" = "xyes"; then
7262 default_write_plugin="rrdtool"
7263 else
7264 LOAD_PLUGIN_RRDTOOL="##"
7265 fi
7266
7267 if test "x$enable_network" = "xyes"; then
7268 if test "x$default_write_plugin" = "xnone"; then
7269 default_write_plugin="network"
7270 else
7271 LOAD_PLUGIN_NETWORK="#"
7272 fi
7273 else
7274 LOAD_PLUGIN_NETWORK="##"
7275 fi
7276
7277 if test "x$enable_csv" = "xyes"; then
7278 if test "x$default_write_plugin" = "xnone"; then
7279 default_write_plugin="csv"
7280 else
7281 LOAD_PLUGIN_CSV="#"
7282 fi
7283 else
7284 LOAD_PLUGIN_CSV="##"
7285 fi
7286 AC_MSG_RESULT([$default_write_plugin])
7287
7288 AC_SUBST([LOAD_PLUGIN_RRDTOOL])
7289 AC_SUBST([LOAD_PLUGIN_NETWORK])
7290 AC_SUBST([LOAD_PLUGIN_CSV])
7291
7292 dnl Perl bindings
7293 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
7294 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
7295 [
7296 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
7297 PERL_BINDINGS_OPTIONS="$withval"
7298 with_perl_bindings="yes"
7299 else
7300 with_perl_bindings="$withval"
7301 fi
7302 ],
7303 [
7304 if test "x$PERL" != "x"; then
7305 with_perl_bindings="yes"
7306 else
7307 with_perl_bindings="no (no perl interpreter found)"
7308 fi
7309 ])
7310
7311 if test "x$with_perl_bindings" = "xyes"; then
7312 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
7313 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
7314 AC_MSG_RESULT([yes])
7315 else
7316 AC_MSG_RESULT([no])
7317 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
7318 fi
7319 fi
7320
7321 if test "x$with_perl_bindings" = "xyes"; then
7322 PERL_BINDINGS="perl"
7323 else
7324 PERL_BINDINGS=""
7325 fi
7326
7327 AC_SUBST([PERL_BINDINGS])
7328 AC_SUBST([PERL_BINDINGS_OPTIONS])
7329
7330 dnl libcollectdclient
7331 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
7332 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
7333 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
7334
7335 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
7336
7337 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
7338
7339 AC_SUBST([LCC_VERSION_MAJOR])
7340 AC_SUBST([LCC_VERSION_MINOR])
7341 AC_SUBST([LCC_VERSION_PATCH])
7342 AC_SUBST([LCC_VERSION_EXTRA])
7343 AC_SUBST([LCC_VERSION_STRING])
7344
7345 AC_CONFIG_FILES([src/libcollectdclient/collectd/lcc_features.h])
7346
7347 if test "x$GCC" = "xyes"; then
7348 AM_CFLAGS="-Wall"
7349 AM_CXXFLAGS="-Wall"
7350 if test "x$enable_werror" != "xno"; then
7351 AM_CFLAGS="$AM_CFLAGS -Werror"
7352 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
7353 fi
7354 fi
7355
7356 AC_SUBST([AM_CFLAGS])
7357 AC_SUBST([AM_CXXFLAGS])
7358
7359 AC_CONFIG_FILES([ \
7360 Makefile \
7361 src/collectd.conf \
7362 src/libcollectdclient/libcollectdclient.pc \
7363 ])
7364
7365 AC_OUTPUT
7366
7367 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" != "xyes"; then
7368 with_librrd="yes (warning: librrd is not thread-safe)"
7369 fi
7370
7371 if test "x$with_libperl" = "xyes"; then
7372 with_libperl="yes (version `$PERL -MConfig -e 'print $Config{version};'`)"
7373 else
7374 enable_perl="no (needs libperl)"
7375 fi
7376
7377 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"; then
7378 enable_perl="no (libperl doesn't support ithreads)"
7379 fi
7380
7381 if test "x$with_perl_bindings" = "xyes" && test "x$PERL_BINDINGS_OPTIONS" != "x"; then
7382 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
7383 fi
7384
7385 AC_MSG_RESULT()
7386 AC_MSG_RESULT([Configuration:])
7387 AC_MSG_RESULT([ Build:])
7388 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
7389 AC_MSG_RESULT([ Compiler vendor . . . $ax_cv_c_compiler_vendor])
7390 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
7391 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
7392 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
7393 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
7394 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
7395 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
7396 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
7397 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
7398 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
7399 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
7400 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
7401 AC_MSG_RESULT()
7402 AC_MSG_RESULT([ Libraries:])
7403 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
7404 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
7405 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
7406 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
7407 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
7408 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
7409 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
7410 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
7411 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
7412 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
7413 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
7414 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
7415 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
7416 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
7417 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
7418 AC_MSG_RESULT([ libjansson . . . . . $with_libjansson])
7419 AC_MSG_RESULT([ libjevents . . . . . $with_libjevents])
7420 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
7421 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
7422 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
7423 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
7424 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
7425 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
7426 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
7427 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
7428 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
7429 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
7430 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
7431 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
7432 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
7433 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
7434 AC_MSG_RESULT([ libnetsnmpagent . . . $with_libnetsnmpagent])
7435 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
7436 AC_MSG_RESULT([ libnvidia-ml . . . . $with_cuda])
7437 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
7438 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
7439 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
7440 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
7441 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
7442 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
7443 AC_MSG_RESULT([ libpmwapi . . . . . . $with_libpmwapi])
7444 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
7445 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
7446 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
7447 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
7448 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
7449 AC_MSG_RESULT([ libqpid-proton . . . $with_libqpid_proton])
7450 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
7451 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
7452 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
7453 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
7454 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
7455 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
7456 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
7457 AC_MSG_RESULT([ libssl . . . . . . . $with_libssl])
7458 AC_MSG_RESULT([ libslurm . . . . . . $with_libslurm])
7459 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
7460 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
7461 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
7462 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
7463 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
7464 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
7465 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
7466 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
7467 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
7468 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
7469 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
7470 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
7471 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
7472 AC_MSG_RESULT()
7473 AC_MSG_RESULT([ Features:])
7474 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
7475 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
7476 AC_MSG_RESULT()
7477 AC_MSG_RESULT([ Bindings:])
7478 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
7479 AC_MSG_RESULT()
7480 AC_MSG_RESULT([ Modules:])
7481 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
7482 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
7483 AC_MSG_RESULT([ amqp1 . . . . . . . $enable_amqp1])
7484 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
7485 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
7486 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
7487 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
7488 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
7489 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
7490 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
7491 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
7492 AC_MSG_RESULT([ buddyinfo . . . . . . $enable_buddyinfo])
7493 AC_MSG_RESULT([ capabilities . . . . $enable_capabilities])
7494 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
7495 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
7496 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
7497 AC_MSG_RESULT([ check_uptime. . . . . $enable_check_uptime])
7498 AC_MSG_RESULT([ connectivity. . . . . $enable_connectivity])
7499 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
7500 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
7501 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
7502 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
7503 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
7504 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
7505 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
7506 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
7507 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
7508 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
7509 AC_MSG_RESULT([ dcpmm . . . . . . . $enable_dcpmm])
7510 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
7511 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
7512 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
7513 AC_MSG_RESULT([ dpdkevents. . . . . . $enable_dpdkevents])
7514 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
7515 AC_MSG_RESULT([ dpdk_telemetry. . . . $enable_dpdk_telemetry])
7516 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
7517 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
7518 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
7519 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
7520 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
7521 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
7522 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
7523 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
7524 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
7525 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
7526 AC_MSG_RESULT([ gpu_nvidia . . . . . $enable_gpu_nvidia])
7527 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
7528 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
7529 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
7530 AC_MSG_RESULT([ infiniband . . . . . $enable_infiniband])
7531 AC_MSG_RESULT([ intel_pmu . . . . . . $enable_intel_pmu])
7532 AC_MSG_RESULT([ intel_rdt . . . . . . $enable_intel_rdt])
7533 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
7534 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
7535 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
7536 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
7537 AC_MSG_RESULT([ ipstats . . . . . . . $enable_ipstats])
7538 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
7539 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
7540 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
7541 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
7542 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
7543 AC_MSG_RESULT([ logparser . . . . . . $enable_logparser])
7544 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
7545 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
7546 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
7547 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
7548 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
7549 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
7550 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
7551 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
7552 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
7553 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
7554 AC_MSG_RESULT([ mcelog . . . . . . . $enable_mcelog])
7555 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
7556 AC_MSG_RESULT([ mdevents . . . . . . $enable_mdevents])
7557 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
7558 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
7559 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
7560 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
7561 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
7562 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
7563 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
7564 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
7565 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
7566 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
7567 AC_MSG_RESULT([ netstat_udp . . . . . $enable_netstat_udp])
7568 AC_MSG_RESULT([ network . . . . . . . $enable_network])
7569 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
7570 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
7571 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
7572 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
7573 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
7574 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
7575 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
7576 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
7577 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
7578 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
7579 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
7580 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
7581 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
7582 AC_MSG_RESULT([ ovs_events . . . . . $enable_ovs_events])
7583 AC_MSG_RESULT([ ovs_stats . . . . . . $enable_ovs_stats])
7584 AC_MSG_RESULT([ pcie_errors . . . . . $enable_pcie_errors])
7585 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
7586 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
7587 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
7588 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
7589 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
7590 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
7591 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
7592 AC_MSG_RESULT([ procevent . . . . . . $enable_procevent])
7593 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
7594 AC_MSG_RESULT([ python . . . . . . . $enable_python])
7595 AC_MSG_RESULT([ redfish . . . . . . . $enable_redfish])
7596 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
7597 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
7598 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
7599 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
7600 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
7601 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
7602 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
7603 AC_MSG_RESULT([ slurm . . . . . . . . $enable_slurm])
7604 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
7605 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
7606 AC_MSG_RESULT([ snmp_agent . . . . . $enable_snmp_agent])
7607 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
7608 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
7609 AC_MSG_RESULT([ synproxy . . . . . . $enable_synproxy])
7610 AC_MSG_RESULT([ sysevent. . . . . . . $enable_sysevent])
7611 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
7612 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
7613 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
7614 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
7615 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
7616 AC_MSG_RESULT([ target_notification . $enable_target_notification])
7617 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
7618 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
7619 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
7620 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
7621 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
7622 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
7623 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
7624 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
7625 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
7626 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
7627 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
7628 AC_MSG_RESULT([ ubi . . . . . . . . . $enable_ubi])
7629 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
7630 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
7631 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
7632 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
7633 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
7634 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
7635 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
7636 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
7637 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
7638 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
7639 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
7640 AC_MSG_RESULT([ write_influxdb_udp. . $enable_write_influxdb_udp])
7641 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
7642 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
7643 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
7644 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
7645 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
7646 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
7647 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
7648 AC_MSG_RESULT([ write_stackdriver . . $enable_write_stackdriver])
7649 AC_MSG_RESULT([ write_syslog . . . . $enable_write_syslog])
7650 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
7651 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
7652 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
7653 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
7654 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
7655 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
7656 AC_MSG_RESULT()
7657
7658 if test "x$dependency_error" = "xyes"; then
7659 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
7660 fi
7661
7662 if test "x$dependency_warning" = "xyes"; then
7663 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
7664 fi
7665
7666 # vim: set fdm=marker sw=2 sts=2 ts=2 et :
7667