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