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