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