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