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