]>
Commit | Line | Data |
---|---|---|
86ca149a | 1 | dnl Process this file with autoconf to produce a configure script. |
1b739da9 | 2 | AC_INIT(collectd, m4_esyscmd(./version-gen.sh)) |
6e765a02 FF |
3 | AC_CONFIG_SRCDIR(src/collectd.c) |
4 | AC_CONFIG_HEADERS(src/config.h) | |
5 | AM_INIT_AUTOMAKE(dist-bzip2) | |
86ca149a FF |
6 | AC_LANG(C) |
7 | ||
8 | AC_PREFIX_DEFAULT("/opt/collectd") | |
9 | ||
9e7918de SH |
10 | AC_SYS_LARGEFILE |
11 | ||
15996f86 FF |
12 | # |
13 | # Checks for programs. | |
14 | # | |
86ca149a FF |
15 | AC_PROG_CC |
16 | AC_PROG_CPP | |
17 | AC_PROG_INSTALL | |
18 | AC_PROG_LN_S | |
19 | AC_PROG_MAKE_SET | |
30f3e7b8 | 20 | AM_PROG_CC_C_O |
586eed68 | 21 | AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes") |
86ca149a FF |
22 | |
23 | dnl configure libtool | |
24 | AC_DISABLE_STATIC | |
6e765a02 FF |
25 | AC_LIBLTDL_CONVENIENCE |
26 | AC_SUBST(LTDLINCL) | |
27 | AC_SUBST(LIBLTDL) | |
86ca149a FF |
28 | AC_LIBTOOL_DLOPEN |
29 | AC_PROG_LIBTOOL | |
108c20b2 FF |
30 | AC_PROG_LEX |
31 | AC_PROG_YACC | |
bcd78ed9 | 32 | AC_CONFIG_SUBDIRS(libltdl) |
86ca149a | 33 | |
af18c7e0 FF |
34 | AC_MSG_CHECKING([for kernel type ($host_os)]) |
35 | case $host_os in | |
36 | *linux*) | |
37 | AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel]) | |
38 | ac_system="Linux" | |
39 | ;; | |
40 | *solaris*) | |
41 | AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel]) | |
42 | ac_system="Solaris" | |
43 | ;; | |
29f72849 FF |
44 | *darwin*) |
45 | ac_system="Darwin" | |
af18c7e0 FF |
46 | ;; |
47 | *) | |
48 | ac_system="unknown" | |
49 | esac | |
50 | AC_MSG_RESULT([$ac_system]) | |
51 | ||
15996f86 FF |
52 | # |
53 | # Checks for header files. | |
54 | # | |
e708ae9b | 55 | AC_HEADER_STDC |
86ca149a | 56 | AC_HEADER_SYS_WAIT |
6e765a02 | 57 | AC_HEADER_DIRENT |
a905d397 | 58 | |
3fc0feb6 | 59 | AC_CHECK_HEADERS(stdint.h 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) |
15996f86 | 60 | |
c9a5b034 | 61 | # For ping library |
6934b3d0 FF |
62 | AC_CHECK_HEADERS(netinet/in_systm.h, [], [], |
63 | [#if HAVE_STDINT_H | |
64 | # include <stdint.h> | |
65 | #endif | |
ac491e03 FF |
66 | #if HAVE_SYS_TYPES_H |
67 | # include <sys/types.h> | |
68 | #endif | |
6934b3d0 | 69 | ]) |
c9a5b034 | 70 | AC_CHECK_HEADERS(netinet/in.h, [], [], |
6934b3d0 FF |
71 | [#if HAVE_STDINT_H |
72 | # include <stdint.h> | |
73 | #endif | |
ac491e03 FF |
74 | #if HAVE_SYS_TYPES_H |
75 | # include <sys/types.h> | |
76 | #endif | |
6934b3d0 | 77 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
78 | # include <netinet/in_systm.h> |
79 | #endif | |
80 | ]) | |
81 | AC_CHECK_HEADERS(netinet/ip.h, [], [], | |
6934b3d0 FF |
82 | [#if HAVE_STDINT_H |
83 | # include <stdint.h> | |
84 | #endif | |
ac491e03 FF |
85 | #if HAVE_SYS_TYPES_H |
86 | # include <sys/types.h> | |
87 | #endif | |
6934b3d0 | 88 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
89 | # include <netinet/in_systm.h> |
90 | #endif | |
91 | #if HAVE_NETINET_IN_H | |
92 | # include <netinet/in.h> | |
93 | #endif | |
94 | ]) | |
95 | AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], | |
6934b3d0 FF |
96 | [#if HAVE_STDINT_H |
97 | # include <stdint.h> | |
98 | #endif | |
ac491e03 FF |
99 | #if HAVE_SYS_TYPES_H |
100 | # include <sys/types.h> | |
101 | #endif | |
6934b3d0 | 102 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
103 | # include <netinet/in_systm.h> |
104 | #endif | |
105 | #if HAVE_NETINET_IN_H | |
106 | # include <netinet/in.h> | |
107 | #endif | |
108 | #if HAVE_NETINET_IP_H | |
109 | # include <netinet/ip.h> | |
110 | #endif | |
111 | ]) | |
112 | AC_CHECK_HEADERS(netinet/ip_var.h, [], [], | |
6934b3d0 FF |
113 | [#if HAVE_STDINT_H |
114 | # include <stdint.h> | |
115 | #endif | |
ac491e03 FF |
116 | #if HAVE_SYS_TYPES_H |
117 | # include <sys/types.h> | |
118 | #endif | |
6934b3d0 | 119 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
120 | # include <netinet/in_systm.h> |
121 | #endif | |
122 | #if HAVE_NETINET_IN_H | |
123 | # include <netinet/in.h> | |
124 | #endif | |
125 | #if HAVE_NETINET_IP_H | |
126 | # include <netinet/ip.h> | |
127 | #endif | |
128 | ]) | |
129 | AC_CHECK_HEADERS(netinet/ip6.h, [], [], | |
6934b3d0 FF |
130 | [#if HAVE_STDINT_H |
131 | # include <stdint.h> | |
132 | #endif | |
6fe07031 FF |
133 | #if HAVE_SYS_TYPES_H |
134 | # include <sys/types.h> | |
135 | #endif | |
6934b3d0 | 136 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
137 | # include <netinet/in_systm.h> |
138 | #endif | |
139 | #if HAVE_NETINET_IN_H | |
140 | # include <netinet/in.h> | |
141 | #endif | |
142 | ]) | |
143 | AC_CHECK_HEADERS(netinet/icmp6.h, [], [], | |
6934b3d0 FF |
144 | [#if HAVE_STDINT_H |
145 | # include <stdint.h> | |
146 | #endif | |
6fe07031 FF |
147 | #if HAVE_SYS_TYPES_H |
148 | # include <sys/types.h> | |
149 | #endif | |
6934b3d0 | 150 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
151 | # include <netinet/in_systm.h> |
152 | #endif | |
153 | #if HAVE_NETINET_IN_H | |
154 | # include <netinet/in.h> | |
155 | #endif | |
156 | #if HAVE_NETINET_IP6_H | |
157 | # include <netinet/ip6.h> | |
158 | #endif | |
159 | ]) | |
79d36d9e FF |
160 | AC_CHECK_HEADERS(netinet/tcp.h, [], [], |
161 | [#if HAVE_STDINT_H | |
162 | # include <stdint.h> | |
163 | #endif | |
164 | #if HAVE_SYS_TYPES_H | |
165 | # include <sys/types.h> | |
166 | #endif | |
167 | #if HAVE_NETINET_IN_SYSTM_H | |
168 | # include <netinet/in_systm.h> | |
169 | #endif | |
170 | #if HAVE_NETINET_IN_H | |
171 | # include <netinet/in.h> | |
172 | #endif | |
173 | #if HAVE_NETINET_IP_H | |
174 | # include <netinet/ip.h> | |
175 | #endif | |
176 | ]) | |
5b9d0a2b FF |
177 | AC_CHECK_HEADERS(netinet/udp.h, [], [], |
178 | [#if HAVE_STDINT_H | |
179 | # include <stdint.h> | |
180 | #endif | |
181 | #if HAVE_SYS_TYPES_H | |
182 | # include <sys/types.h> | |
183 | #endif | |
184 | #if HAVE_NETINET_IN_SYSTM_H | |
185 | # include <netinet/in_systm.h> | |
186 | #endif | |
187 | #if HAVE_NETINET_IN_H | |
188 | # include <netinet/in.h> | |
189 | #endif | |
190 | #if HAVE_NETINET_IP_H | |
191 | # include <netinet/ip.h> | |
192 | #endif | |
193 | ]) | |
c9a5b034 | 194 | |
e1d497b7 | 195 | # For cpu modules |
af18c7e0 | 196 | AC_CHECK_HEADERS(sys/dkstat.h) |
29f72849 | 197 | if test "x$ac_system" = "xDarwin" |
af18c7e0 FF |
198 | then |
199 | 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) | |
200 | AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h) | |
201 | fi | |
d4b36462 FF |
202 | AC_CHECK_HEADERS(sys/sysctl.h, [], [], |
203 | [ | |
204 | #if HAVE_SYS_TYPES_H | |
205 | # include <sys/types.h> | |
206 | #endif | |
207 | #if HAVE_SYS_PARAM_H | |
208 | # include <sys/param.h> | |
209 | #endif | |
210 | ]) | |
e1d497b7 | 211 | |
46ed2804 | 212 | # For hddtemp module |
a905d397 | 213 | AC_CHECK_HEADERS(linux/major.h libgen.h) |
46ed2804 | 214 | |
11265296 FF |
215 | # For the battery plugin |
216 | AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], | |
217 | [ | |
218 | #if HAVE_IOKIT_IOKITLIB_H | |
219 | # include <IOKit/IOKitLib.h> | |
220 | #endif | |
221 | #if HAVE_IOKIT_IOTYPES_H | |
222 | # include <IOKit/IOTypes.h> | |
223 | #endif | |
224 | ]) | |
ce5ce8ad | 225 | |
daedf582 | 226 | # For the swap module |
d4b36462 FF |
227 | AC_CHECK_HEADERS(sys/swap.h, [], [], |
228 | [ | |
229 | #if HAVE_SYS_TYPES_H | |
230 | # include <sys/types.h> | |
231 | #endif | |
232 | #if HAVE_SYS_PARAM_H | |
233 | # include <sys/param.h> | |
234 | #endif | |
235 | ]) | |
daedf582 | 236 | |
15996f86 | 237 | # For load module |
44a3f33a | 238 | # For the processes plugin |
15996f86 | 239 | # For users module |
e4080f7a | 240 | AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h) |
86ca149a | 241 | |
3268a333 | 242 | # For interface plugin |
a05e34a0 | 243 | AC_CHECK_HEADERS(ifaddrs.h) |
cd377858 FF |
244 | AC_CHECK_HEADERS(net/if.h, [], [], |
245 | [ | |
246 | #if HAVE_SYS_TYPES_H | |
247 | # include <sys/types.h> | |
248 | #endif | |
249 | #if HAVE_SYS_SOCKET_H | |
250 | # include <sys/socket.h> | |
251 | #endif | |
252 | ]) | |
a05e34a0 FF |
253 | AC_CHECK_HEADERS(linux/if.h, [], [], |
254 | [ | |
255 | #if HAVE_SYS_TYPES_H | |
256 | # include <sys/types.h> | |
257 | #endif | |
258 | #if HAVE_SYS_SOCKET_H | |
259 | # include <sys/socket.h> | |
260 | #endif | |
261 | ]) | |
262 | AC_CHECK_HEADERS(linux/netdevice.h, [], [], | |
263 | [ | |
264 | #if HAVE_SYS_TYPES_H | |
265 | # include <sys/types.h> | |
266 | #endif | |
267 | #if HAVE_SYS_SOCKET_H | |
268 | # include <sys/socket.h> | |
269 | #endif | |
270 | #if HAVE_LINUX_IF_H | |
271 | # include <linux/if.h> | |
272 | #endif | |
273 | ]) | |
274 | ||
fb3a07dc SH |
275 | # For ipvs module |
276 | have_net_ip_vs_h="no" | |
277 | have_ip_vs_h="no" | |
278 | if test "x$ac_system" = "xLinux" | |
279 | then | |
280 | AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"]) | |
281 | AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"]) | |
282 | fi | |
283 | ||
6e765a02 | 284 | # For quota module |
d4b36462 FF |
285 | AC_CHECK_HEADERS(sys/ucred.h, [], [], |
286 | [ | |
287 | #if HAVE_SYS_TYPES_H | |
288 | # include <sys/types.h> | |
289 | #endif | |
290 | #if HAVE_SYS_PARAM_H | |
291 | # include <sys/param.h> | |
292 | #endif | |
293 | ]) | |
6e765a02 FF |
294 | |
295 | # For mount interface | |
d4b36462 FF |
296 | AC_CHECK_HEADERS(sys/mount.h, [], [], |
297 | [ | |
298 | #if HAVE_SYS_TYPES_H | |
299 | # include <sys/types.h> | |
300 | #endif | |
301 | #if HAVE_SYS_PARAM_H | |
302 | # include <sys/param.h> | |
303 | #endif | |
304 | ]) | |
28c5e282 | 305 | |
fc257d86 SH |
306 | # For the email plugin |
307 | AC_CHECK_HEADERS(linux/un.h, [], [], | |
308 | [ | |
309 | #if HAVE_SYS_SOCKET_H | |
310 | # include <sys/socket.h> | |
311 | #endif | |
312 | ]) | |
fc257d86 | 313 | |
af18c7e0 | 314 | AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h) |
ec88fb0e | 315 | |
fdfbf887 | 316 | # For the dns plugin |
e0a11961 FF |
317 | AC_CHECK_HEADERS(arpa/nameser.h) |
318 | AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [], | |
319 | [ | |
320 | #if HAVE_ARPA_NAMESER_H | |
321 | # include <arpa/nameser.h> | |
322 | #endif | |
323 | ]) | |
c4377c1e | 324 | |
e94efcbe FF |
325 | AC_CHECK_HEADERS(net/if_arp.h, [], [], |
326 | [#if HAVE_SYS_SOCKET_H | |
327 | # include <sys/socket.h> | |
328 | #endif | |
329 | ]) | |
e40574f3 FF |
330 | AC_CHECK_HEADERS(net/ppp_defs.h) |
331 | AC_CHECK_HEADERS(net/if_ppp.h, [], [], | |
332 | [#if HAVE_NET_PPP_DEFS_H | |
333 | # include <net/ppp_defs.h> | |
334 | #endif | |
335 | ]) | |
e94efcbe FF |
336 | AC_CHECK_HEADERS(netinet/if_ether.h, [], [], |
337 | [#if HAVE_STDINT_H | |
338 | # include <stdint.h> | |
339 | #endif | |
340 | #if HAVE_SYS_TYPES_H | |
341 | # include <sys/types.h> | |
342 | #endif | |
343 | #if HAVE_SYS_SOCKET_H | |
344 | # include <sys/socket.h> | |
345 | #endif | |
346 | #if HAVE_NET_IF_H | |
347 | # include <net/if.h> | |
348 | #endif | |
349 | #if HAVE_NETINET_IN_H | |
350 | # include <netinet/in.h> | |
351 | #endif | |
352 | ]) | |
dd7a9bc9 | 353 | |
51e70a99 | 354 | # For the multimeter plugin |
3fc0feb6 FF |
355 | have_termios_h="no" |
356 | AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) | |
51e70a99 | 357 | |
15996f86 FF |
358 | # |
359 | # Checks for typedefs, structures, and compiler characteristics. | |
360 | # | |
86ca149a FF |
361 | AC_C_CONST |
362 | AC_TYPE_PID_T | |
363 | AC_TYPE_SIZE_T | |
7df03651 | 364 | AC_TYPE_UID_T |
86ca149a FF |
365 | AC_HEADER_TIME |
366 | ||
15996f86 FF |
367 | # |
368 | # Checks for library functions. | |
369 | # | |
86ca149a | 370 | AC_PROG_GCC_TRADITIONAL |
a905d397 | 371 | AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog) |
15996f86 | 372 | |
fa7db5e9 SH |
373 | AC_FUNC_STRERROR_R |
374 | ||
d6bb65ee FF |
375 | AC_CHECK_FUNCS(getpwnam_r) |
376 | AC_CHECK_FUNCS(getgrnam_r) | |
377 | ||
d89f6dc3 FF |
378 | socket_needs_socket="no" |
379 | AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket))) | |
380 | AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes") | |
381 | ||
4ca5457f FF |
382 | nanosleep_needs_rt="no" |
383 | AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) | |
384 | AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") | |
385 | ||
ec88fb0e FF |
386 | AC_CHECK_FUNCS(regcomp regerror regexec regfree) |
387 | ||
e1d497b7 | 388 | AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) |
a905d397 FF |
389 | AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"]) |
390 | AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"]) | |
391 | AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"]) | |
392 | AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"]) | |
393 | AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"]) | |
394 | AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"]) | |
395 | AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"]) | |
396 | AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"]) | |
397 | AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"]) | |
2d03e4e3 | 398 | |
15996f86 FF |
399 | # For load module |
400 | AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"]) | |
401 | ||
e91c40b8 | 402 | # Check for NAN |
18fdfeca FF |
403 | AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])], |
404 | [ | |
405 | if test "x$withval" = "xno"; then | |
406 | nan_type="none" | |
407 | else if test "x$withval" = "xyes"; then | |
408 | nan_type="zero" | |
409 | else | |
410 | nan_type="$withval" | |
411 | fi; fi | |
412 | ], | |
413 | [nan_type="none"]) | |
e91c40b8 FF |
414 | if test "x$nan_type" = "xnone"; then |
415 | AC_CACHE_CHECK([whether NAN is defined by default], | |
416 | [have_nan_default], | |
417 | AC_COMPILE_IFELSE( | |
418 | AC_LANG_PROGRAM( | |
419 | [[ | |
420 | #include <stdlib.h> | |
421 | #include <math.h> | |
422 | static float foo = NAN; | |
423 | ]], | |
424 | [[ | |
425 | if (isnan (foo)) | |
426 | return 0; | |
427 | else | |
428 | return 1; | |
429 | ]]), | |
430 | [have_nan_default="yes"], | |
431 | [have_nan_default="no"] | |
432 | ) | |
433 | ) | |
434 | if test "x$have_nan_default" = "xyes" | |
435 | then | |
18fdfeca | 436 | nan_type="default" |
e91c40b8 FF |
437 | fi |
438 | fi | |
439 | if test "x$nan_type" = "xnone"; then | |
440 | AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99], | |
441 | [have_nan_isoc], | |
442 | AC_COMPILE_IFELSE( | |
443 | AC_LANG_PROGRAM( | |
444 | [[ | |
445 | #include <stdlib.h> | |
446 | #define __USE_ISOC99 1 | |
447 | #include <math.h> | |
448 | static float foo = NAN; | |
449 | ]], | |
450 | [[ | |
451 | if (isnan (foo)) | |
452 | return 0; | |
453 | else | |
454 | return 1; | |
455 | ]]), | |
456 | [have_nan_isoc="yes"], | |
457 | [have_nan_isoc="no"] | |
458 | ) | |
459 | ) | |
460 | if test "x$have_nan_isoc" = "xyes" | |
461 | then | |
18fdfeca | 462 | nan_type="isoc99" |
e91c40b8 FF |
463 | fi |
464 | fi | |
465 | if test "x$nan_type" = "xnone"; then | |
466 | AC_CACHE_CHECK([whether NAN can be defined by 0/0], | |
467 | [have_nan_zero], | |
468 | AC_RUN_IFELSE( | |
469 | AC_LANG_PROGRAM( | |
470 | [[ | |
471 | #include <stdlib.h> | |
472 | #include <math.h> | |
dcc46cbc FF |
473 | #ifdef NAN |
474 | # undef NAN | |
475 | #endif | |
e91c40b8 FF |
476 | #define NAN (0.0 / 0.0) |
477 | #ifndef isnan | |
478 | # define isnan(f) ((f) != (f)) | |
479 | #endif | |
480 | static float foo = NAN; | |
481 | ]], | |
482 | [[ | |
483 | if (isnan (foo)) | |
484 | return 0; | |
485 | else | |
486 | return 1; | |
487 | ]]), | |
488 | [have_nan_zero="yes"], | |
489 | [have_nan_zero="no"] | |
490 | ) | |
491 | ) | |
492 | if test "x$have_nan_zero" = "xyes" | |
493 | then | |
18fdfeca | 494 | nan_type="zero" |
e91c40b8 FF |
495 | fi |
496 | fi | |
18fdfeca FF |
497 | |
498 | if test "x$nan_type" = "xdefault"; then | |
499 | AC_DEFINE(NAN_STATIC_DEFAULT, 1, | |
500 | [Define if NAN is defined by default and can initialize static variables.]) | |
501 | else if test "x$nan_type" = "xisoc99"; then | |
502 | AC_DEFINE(NAN_STATIC_ISOC, 1, | |
503 | [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]) | |
504 | else if test "x$nan_type" = "xzero"; then | |
505 | AC_DEFINE(NAN_ZERO_ZERO, 1, | |
506 | [Define if NAN can be defined as (0.0 / 0.0)]) | |
507 | else | |
e91c40b8 | 508 | AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.]) |
18fdfeca | 509 | fi; fi; fi |
e91c40b8 | 510 | |
6e765a02 | 511 | # For mount interface |
2dc3f07b FF |
512 | #AC_CHECK_FUNCS(getfsent getvfsent) |
513 | ||
514 | have_getfsstat="no" | |
515 | AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"]) | |
516 | have_getvfsstat="no" | |
517 | AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"]) | |
518 | have_listmntent="no" | |
519 | AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"]) | |
520 | ||
521 | have_getmntent="no" | |
522 | AC_CHECK_FUNCS(getmntent, [have_getmntent="c"]) | |
523 | if test "x$have_getmntent" = "xno"; then | |
524 | AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"]) | |
c9a5b034 | 525 | fi |
2dc3f07b FF |
526 | if test "x$have_getmntent" = "xno"; then |
527 | AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"]) | |
c9a5b034 | 528 | fi |
2dc3f07b FF |
529 | if test "x$have_getmntent" = "xno"; then |
530 | AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"]) | |
c9a5b034 FF |
531 | fi |
532 | ||
2dc3f07b | 533 | if test "x$have_getmntent" = "xc"; then |
6e765a02 | 534 | AC_CACHE_CHECK([whether getmntent takes one argument], |
2dc3f07b | 535 | [have_one_getmntent], |
6e765a02 FF |
536 | AC_COMPILE_IFELSE( |
537 | AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT | |
2dc3f07b | 538 | #include <mntent.h> |
6e765a02 | 539 | #include "$srcdir/src/utils_mount.h"]], |
2dc3f07b FF |
540 | [[ |
541 | FILE *fh; | |
542 | struct mntent *me; | |
543 | fh = setmntent ("/etc/mtab", "r"); | |
544 | me = getmntent (fh); | |
545 | ]] | |
6e765a02 | 546 | ), |
2dc3f07b FF |
547 | [have_one_getmntent="yes"], |
548 | [have_one_getmntent="no"] | |
6e765a02 FF |
549 | ) |
550 | ) | |
2dc3f07b FF |
551 | AC_CACHE_CHECK([whether getmntent takes two arguments], |
552 | [have_two_getmntent], | |
553 | AC_COMPILE_IFELSE( | |
554 | AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT | |
555 | #include <sys/mnttab.h> | |
6e765a02 | 556 | #include "$srcdir/src/utils_mount.h"]], |
2dc3f07b FF |
557 | [[ |
558 | FILE *fh; | |
559 | struct mnttab mt; | |
560 | int status; | |
561 | fh = fopen ("/etc/mnttab", "r"); | |
562 | status = getmntent (fh, &mt); | |
563 | ]] | |
564 | ), | |
565 | [have_two_getmntent="yes"], | |
566 | [have_two_getmntent="no"] | |
6e765a02 | 567 | ) |
2dc3f07b FF |
568 | ) |
569 | fi | |
570 | ||
571 | # Check for different versions of `getmntent' here.. | |
572 | ||
573 | if test "x$have_getmntent" = "xc"; then | |
574 | if test "x$have_one_getmntent" = "xyes"; then | |
575 | AC_DEFINE(HAVE_ONE_GETMNTENT, 1, | |
576 | [Define if the function getmntent exists and takes one argument.]) | |
577 | fi | |
578 | if test "x$have_two_getmntent" = "xyes"; then | |
579 | AC_DEFINE(HAVE_TWO_GETMNTENT, 1, | |
580 | [Define if the function getmntent exists and takes two arguments.]) | |
6e765a02 | 581 | fi |
6e765a02 | 582 | fi |
2dc3f07b FF |
583 | if test "x$have_getmntent" = "xsun"; then |
584 | AC_DEFINE(HAVE_SUN_GETMNTENT, 1, | |
585 | [Define if the function getmntent exists. It's the version from libsun.]) | |
6e765a02 | 586 | fi |
2dc3f07b FF |
587 | if test "x$have_getmntent" = "xseq"; then |
588 | AC_DEFINE(HAVE_SEQ_GETMNTENT, 1, | |
589 | [Define if the function getmntent exists. It's the version from libseq.]) | |
590 | fi | |
591 | if test "x$have_getmntent" = "xgen"; then | |
592 | AC_DEFINE(HAVE_GEN_GETMNTENT, 1, | |
593 | [Define if the function getmntent exists. It's the version from libgen.]) | |
6e765a02 FF |
594 | fi |
595 | ||
a05e34a0 | 596 | # Check for structures |
906bea76 | 597 | AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors], |
a05e34a0 FF |
598 | [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])], |
599 | [], | |
cd377858 FF |
600 | [ |
601 | #include <sys/types.h> | |
602 | #include <sys/socket.h> | |
603 | #include <net/if.h> | |
604 | ]) | |
906bea76 | 605 | AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors], |
a05e34a0 FF |
606 | [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])], |
607 | [], | |
608 | [ | |
609 | #include <sys/types.h> | |
610 | #include <sys/socket.h> | |
611 | #include <linux/if.h> | |
612 | #include <linux/netdevice.h> | |
613 | ]) | |
614 | ||
5b9d0a2b FF |
615 | AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], |
616 | [#if HAVE_STDINT_H | |
617 | # include <stdint.h> | |
618 | #endif | |
619 | #if HAVE_SYS_TYPES_H | |
620 | # include <sys/types.h> | |
621 | #endif | |
622 | #if HAVE_NETINET_IN_SYSTM_H | |
623 | # include <netinet/in_systm.h> | |
624 | #endif | |
625 | #if HAVE_NETINET_IN_H | |
626 | # include <netinet/in.h> | |
627 | #endif | |
628 | #if HAVE_NETINET_IP_H | |
629 | # include <netinet/ip.h> | |
630 | #endif | |
631 | #if HAVE_NETINET_UDP_H | |
632 | # include <netinet/udp.h> | |
633 | #endif | |
634 | ]) | |
635 | AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], | |
636 | [#if HAVE_STDINT_H | |
637 | # include <stdint.h> | |
638 | #endif | |
639 | #if HAVE_SYS_TYPES_H | |
640 | # include <sys/types.h> | |
641 | #endif | |
642 | #if HAVE_NETINET_IN_SYSTM_H | |
643 | # include <netinet/in_systm.h> | |
644 | #endif | |
645 | #if HAVE_NETINET_IN_H | |
646 | # include <netinet/in.h> | |
647 | #endif | |
648 | #if HAVE_NETINET_IP_H | |
649 | # include <netinet/ip.h> | |
650 | #endif | |
651 | #if HAVE_NETINET_UDP_H | |
652 | # include <netinet/udp.h> | |
653 | #endif | |
654 | ]) | |
2aff261d | 655 | |
e94efcbe FF |
656 | AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime], |
657 | [], | |
658 | [], | |
659 | [ | |
660 | #if HAVE_KSTAT_H | |
661 | # include <kstat.h> | |
662 | #endif | |
663 | ]) | |
664 | ||
a58af051 FF |
665 | with_libresolv="yes" |
666 | AC_CHECK_LIB(resolv, res_search, | |
667 | [ | |
668 | AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).]) | |
669 | ], | |
670 | [with_libresolv="no"]) | |
671 | AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes") | |
86ca149a | 672 | |
30f3e7b8 RJ |
673 | dnl Check for HAL (hardware abstraction library) |
674 | with_libhal="yes" | |
675 | AC_CHECK_LIB(hal,libhal_device_property_exists, | |
676 | [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])], | |
677 | [with_libhal="no"]) | |
678 | if test "x$with_libhal" = "xyes"; then | |
679 | PKG_PROG_PKG_CONFIG | |
680 | if test "x$PKG_CONFIG" != "x"; then | |
681 | BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`" | |
682 | BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`" | |
683 | AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS) | |
684 | AC_SUBST(BUILD_WITH_LIBHAL_LIBS) | |
685 | fi | |
686 | fi | |
125bdc00 | 687 | |
c27cdba8 NW |
688 | m4_divert_once([HELP_WITH], [ |
689 | collectd additional packages:]) | |
690 | ||
86ca149a | 691 | # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given]) |
ac9cdb55 FF |
692 | librrd_cflags="" |
693 | librrd_ldflags="" | |
694 | librrd_threadsafe="yes" | |
3c12e8a6 | 695 | AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])], |
42e281c5 | 696 | [ if test "x$withval" != "xno" && test "x$withval" != "xyes" |
86ca149a | 697 | then |
ac9cdb55 FF |
698 | librrd_cflags="-I$withval/include" |
699 | librrd_ldflags="-L$withval/lib" | |
86ca149a FF |
700 | with_rrdtool="yes" |
701 | fi | |
702 | ], [with_rrdtool="yes"]) | |
703 | if test "x$with_rrdtool" = "xyes" | |
704 | then | |
4c67453e | 705 | SAVE_CPPFLAGS="$CPPFLAGS" |
ac9cdb55 FF |
706 | SAVE_LDFLAGS="$LDFLAGS" |
707 | ||
4c67453e | 708 | CPPFLAGS="$CPPFLAGS $librrd_cflags" |
ac9cdb55 FF |
709 | LDFLAGS="$LDFLAGS $librrd_ldflags" |
710 | ||
711 | AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"]) | |
712 | ||
4c67453e | 713 | CPPFLAGS="$SAVE_CPPFLAGS" |
ac9cdb55 | 714 | LDFLAGS="$SAVE_LDFLAGS" |
86ca149a FF |
715 | fi |
716 | if test "x$with_rrdtool" = "xyes" | |
717 | then | |
4c67453e FF |
718 | SAVE_CPPFLAGS="$CPPFLAGS" |
719 | SAVE_LDFLAGS="$LDFLAGS" | |
720 | ||
721 | CPPFLAGS="$CPPFLAGS $librrd_cflags" | |
722 | LDFLAGS="$LDFLAGS $librrd_ldflags" | |
723 | ||
ac9cdb55 FF |
724 | AC_CHECK_LIB(rrd_th, rrd_update_r, |
725 | [with_rrdtool="yes" | |
726 | librrd_ldflags="$librrd_ldflags -lrrd_th -lm" | |
727 | ], | |
728 | [librrd_threadsafe="no" | |
729 | AC_CHECK_LIB(rrd, rrd_update, | |
730 | [with_rrdtool="yes" | |
731 | librrd_ldflags="$librrd_ldflags -lrrd -lm" | |
732 | ], | |
733 | [with_rrdtool="no (symbol 'rrd_update' not found)"], | |
734 | [-lm]) | |
735 | ] | |
736 | [-lm]) | |
4c67453e FF |
737 | |
738 | CPPFLAGS="$SAVE_CPPFLAGS" | |
739 | LDFLAGS="$SAVE_LDFLAGS" | |
86ca149a | 740 | fi |
b898eac6 NW |
741 | if test "x$with_rrdtool" = "xyes" |
742 | then | |
ac9cdb55 FF |
743 | BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags" |
744 | BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags" | |
745 | AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS) | |
746 | AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS) | |
747 | fi | |
748 | if test "x$librrd_threadsafe" = "xyes" | |
749 | then | |
750 | AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).]) | |
b898eac6 | 751 | fi |
86ca149a | 752 | |
c4377c1e FF |
753 | AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])], |
754 | [ if test "x$withval" != "xno" -a "x$withval" != "xyes" | |
9e137cdb FF |
755 | then |
756 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
757 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
c4377c1e FF |
758 | with_libpthread="yes" |
759 | else | |
760 | if test "x$withval" = "xno" | |
761 | then | |
762 | with_libpthread="no (disabled)" | |
763 | fi | |
9e137cdb | 764 | fi |
06bafec5 | 765 | ], [with_libpthread="yes"]) |
c4377c1e | 766 | if test "x$with_libpthread" = "xyes" |
9e137cdb | 767 | then |
c4377c1e | 768 | AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], []) |
9e137cdb | 769 | fi |
c4377c1e | 770 | if test "x$with_libpthread" = "xyes" |
9e137cdb | 771 | then |
c4377c1e | 772 | AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"]) |
9e137cdb | 773 | fi |
c4377c1e | 774 | if test "x$with_libpthread" = "xyes" |
9e137cdb FF |
775 | then |
776 | collect_pthread=1 | |
777 | else | |
778 | collect_pthread=0 | |
779 | fi | |
780 | AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], | |
781 | [Wether or not to use pthread (POSIX threads) library]) | |
c4377c1e | 782 | AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") |
6e765a02 | 783 | |
29f72849 | 784 | if test "x$ac_system" = "xSolaris" |
86ca149a FF |
785 | then |
786 | with_kstat="yes" | |
d89f6dc3 | 787 | with_devinfo="yes" |
3c12e8a6 NW |
788 | else |
789 | with_kstat="no (Solaris only)" | |
d89f6dc3 | 790 | with_devinfo="no (Solaris only)" |
3c12e8a6 | 791 | fi |
d89f6dc3 | 792 | |
3c12e8a6 NW |
793 | if test "x$with_kstat" = "xyes" |
794 | then | |
080df026 | 795 | AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], []) |
3c12e8a6 NW |
796 | fi |
797 | if test "x$with_kstat" = "xyes" | |
798 | then | |
080df026 | 799 | AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], []) |
86ca149a | 800 | AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"]) |
86ca149a | 801 | fi |
b898eac6 NW |
802 | if test "x$with_kstat" = "xyes" |
803 | then | |
27adc320 FF |
804 | AC_DEFINE(HAVE_LIBKSTAT, 1, |
805 | [Define to 1 if you have the 'kstat' library (-lkstat)]) | |
b898eac6 | 806 | fi |
d89f6dc3 FF |
807 | AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") |
808 | AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes") | |
86ca149a | 809 | |
1842a7a7 FF |
810 | ### BEGIN of check for libcurl ### |
811 | with_curl_config="curl-config" | |
8f6c03d5 | 812 | with_curl_cflags="" |
1842a7a7 FF |
813 | with_curl_libs="" |
814 | AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])], | |
815 | [ | |
1842a7a7 FF |
816 | if test "x$withval" = "xno" |
817 | then | |
818 | with_libcurl="no" | |
8f6c03d5 FF |
819 | else if test "x$withval" = "xyes" |
820 | then | |
1842a7a7 | 821 | with_libcurl="yes" |
8f6c03d5 | 822 | else |
a3cd4630 | 823 | if test -f "$withval" && test -x "$withval" |
8f6c03d5 FF |
824 | then |
825 | with_curl_config="$withval" | |
c39428ae | 826 | with_libcurl="yes" |
8f6c03d5 FF |
827 | else if test -x "$withval/bin/curl-config" |
828 | then | |
829 | with_curl_config="$withval/bin/curl-config" | |
c39428ae | 830 | with_libcurl="yes" |
8f6c03d5 | 831 | fi; fi |
a3cd4630 | 832 | with_libcurl="yes" |
8f6c03d5 | 833 | fi; fi |
1842a7a7 FF |
834 | ], |
835 | [ | |
836 | with_libcurl="yes" | |
837 | ]) | |
838 | if test "x$with_libcurl" = "xyes" | |
839 | then | |
8f6c03d5 | 840 | with_curl_cflags=`$with_curl_config --cflags 2>/dev/null` |
1842a7a7 FF |
841 | curl_config_status=$? |
842 | ||
843 | if test $curl_config_status -ne 0 | |
844 | then | |
48bc4be8 | 845 | with_libcurl="no ($with_curl_config failed)" |
1842a7a7 | 846 | else |
8f6c03d5 FF |
847 | SAVE_CFLAGS=$CFLAGS |
848 | CFLAGS="$CFLAGS $with_curl_cflags" | |
849 | ||
850 | AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], []) | |
851 | ||
852 | CFLAGS="$SAVE_CFLAGS" | |
1842a7a7 FF |
853 | fi |
854 | fi | |
8f6c03d5 | 855 | if test "x$with_libcurl" = "xyes" |
1842a7a7 | 856 | then |
8f6c03d5 | 857 | with_curl_libs=`$with_curl_config --libs 2>/dev/null` |
1842a7a7 FF |
858 | curl_config_status=$? |
859 | ||
860 | if test $curl_config_status -ne 0 | |
861 | then | |
48bc4be8 | 862 | with_libcurl="no ($with_curl_config failed)" |
1842a7a7 | 863 | else |
8f6c03d5 | 864 | AC_CHECK_LIB(curl, curl_easy_init, |
48bc4be8 | 865 | [with_libcurl="yes"], |
8f6c03d5 FF |
866 | [with_libcurl="no (symbol 'curl_easy_init' not found)"], |
867 | [$with_curl_libs]) | |
1842a7a7 FF |
868 | fi |
869 | fi | |
1842a7a7 FF |
870 | if test "x$with_libcurl" = "xyes" |
871 | then | |
8f6c03d5 FF |
872 | BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags" |
873 | BUILD_WITH_LIBCURL_LIBS="$with_curl_libs" | |
874 | AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS) | |
875 | AC_SUBST(BUILD_WITH_LIBCURL_LIBS) | |
1842a7a7 | 876 | fi |
1842a7a7 FF |
877 | AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes") |
878 | ### END of check for libcurl ### | |
879 | ||
adaf6ca0 FF |
880 | with_libiokit="no" |
881 | collectd_libiokit=0 | |
882 | AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices, | |
883 | [ | |
884 | with_libiokit="yes" | |
885 | collectd_libiokit=1 | |
7f45f5b3 | 886 | ], |
adaf6ca0 FF |
887 | [ |
888 | with_libiokit="no" | |
889 | collectd_libiokit=0 | |
890 | ]) | |
891 | AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library]) | |
892 | AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes") | |
893 | ||
0aa63f0c FF |
894 | with_libstatgrab="yes" |
895 | with_libdevstat="no" | |
3c12e8a6 | 896 | AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])], |
86ca149a | 897 | [ |
1842a7a7 | 898 | if test "x$withval" != "xno" -a "x$withval" != "xyes" |
86ca149a | 899 | then |
42e281c5 NW |
900 | LDFLAGS="$LDFLAGS -L$withval/lib" |
901 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
902 | with_libstatgrab="yes" | |
86ca149a FF |
903 | fi |
904 | ], | |
905 | [ | |
f830bd02 | 906 | if test "x$ac_system" == "xunknown" |
86ca149a | 907 | then |
86ca149a | 908 | with_libstatgrab="yes" |
f830bd02 NW |
909 | else |
910 | with_libstatgrab="no" | |
86ca149a FF |
911 | fi |
912 | ]) | |
913 | if test "x$with_libstatgrab" = "xyes" | |
914 | then | |
0aa63f0c | 915 | AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"]) |
3c12e8a6 NW |
916 | fi |
917 | if test "x$with_libstatgrab" = "xyes" | |
918 | then | |
176d5f79 | 919 | AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"]) |
86ca149a | 920 | fi |
176d5f79 | 921 | if test "x$with_libstatgrab" = "xyes" |
0aa63f0c FF |
922 | then |
923 | AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"]) | |
0aa63f0c FF |
924 | fi |
925 | if test "x$with_libstatgrab" = "xyes" | |
176d5f79 NW |
926 | then |
927 | collect_libstatgrab=1 | |
928 | else | |
929 | collect_libstatgrab=0 | |
930 | fi | |
931 | AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab], | |
932 | [Wether or not to use statgrab library]) | |
933 | AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes") | |
0aa63f0c | 934 | AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes") |
28c5e282 FF |
935 | |
936 | AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"]) | |
937 | if test "x$with_libkvm" = "xyes" | |
938 | then | |
939 | AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)]) | |
940 | fi | |
941 | AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes") | |
86ca149a | 942 | |
14ffdba9 FF |
943 | with_sensors_cflags="" |
944 | with_sensors_ldflags="" | |
3c12e8a6 | 945 | AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])], |
86ca149a | 946 | [ |
14ffdba9 | 947 | if test "x$withval" = "xno" |
86ca149a | 948 | then |
14ffdba9 FF |
949 | with_lm_sensors="no" |
950 | else | |
56a554e8 | 951 | with_lm_sensors="yes" |
14ffdba9 FF |
952 | if test "x$withval" != "xyes" |
953 | then | |
954 | with_sensors_cflags="-I$withval/include" | |
955 | with_sensors_ldflags="-L$withval/lib" | |
956 | with_lm_sensors="yes" | |
957 | fi | |
86ca149a FF |
958 | fi |
959 | ], | |
960 | [ | |
86ca149a FF |
961 | if test "x$ac_system" = "xLinux" |
962 | then | |
963 | with_lm_sensors="yes" | |
964 | else | |
af18c7e0 | 965 | with_lm_sensors="no (Linux only library)" |
86ca149a FF |
966 | fi |
967 | ]) | |
968 | if test "x$with_lm_sensors" = "xyes" | |
969 | then | |
14ffdba9 FF |
970 | SAVE_CPPFLAGS="$CPPFLAGS" |
971 | CPPFLAGS="$CPPFLAGS $with_sensors_cflags" | |
972 | ||
973 | # AC_CHECK_HEADERS(sensors/sensors.h, | |
974 | # [ | |
975 | # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.]) | |
976 | # ], | |
977 | # [with_lm_sensors="no (sensors/sensors.h not found)"]) | |
978 | AC_CHECK_HEADERS(sensors/sensors.h, [], [with_lm_sensors="no (sensors/sensors.h not found)"]) | |
979 | ||
980 | CPPFLAGS="$SAVE_CPPFLAGS" | |
3c12e8a6 NW |
981 | fi |
982 | if test "x$with_lm_sensors" = "xyes" | |
983 | then | |
14ffdba9 FF |
984 | SAVE_CPPFLAGS="$CPPFLAGS" |
985 | SAVE_LDFLAGS="$LDFLAGS" | |
986 | CPPFLAGS="$CPPFLAGS $with_sensors_cflags" | |
987 | LDFLAGS="$LDFLAGS $with_sensors_ldflags" | |
988 | ||
989 | AC_CHECK_LIB(sensors, sensors_init, | |
86ca149a | 990 | [ |
14ffdba9 | 991 | AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).]) |
86ca149a | 992 | ], |
14ffdba9 FF |
993 | [with_lm_sensors="no (libsensors not found)"]) |
994 | ||
995 | CPPFLAGS="$SAVE_CPPFLAGS" | |
996 | LDFLAGS="$SAVE_LDFLAGS" | |
56a554e8 NW |
997 | fi |
998 | if test "x$with_lm_sensors" = "xyes" | |
999 | then | |
14ffdba9 FF |
1000 | BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags" |
1001 | BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags" | |
1002 | AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS) | |
1003 | AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS) | |
86ca149a | 1004 | fi |
56a554e8 | 1005 | AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes") |
86ca149a | 1006 | |
805c4940 | 1007 | with_mysql_config="mysql_config" |
805c4940 FF |
1008 | with_mysql_cflags="" |
1009 | with_mysql_libs="" | |
e4303e15 FF |
1010 | AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])], |
1011 | [ | |
805c4940 FF |
1012 | if test "x$withval" = "xno" |
1013 | then | |
1014 | with_libmysql="no" | |
8f6c03d5 | 1015 | else if test "x$withval" = "xyes" |
e4303e15 | 1016 | then |
e4303e15 | 1017 | with_libmysql="yes" |
8f6c03d5 | 1018 | else |
a3cd4630 | 1019 | if test -f "$withval" && test -x "$withval"; |
8f6c03d5 FF |
1020 | then |
1021 | with_mysql_config="$withval" | |
1022 | else if test -x "$withval/bin/mysql_config" | |
1023 | then | |
1024 | with_mysql_config="$withval/bin/mysql_config" | |
1025 | fi; fi | |
a3cd4630 | 1026 | with_libmysql="yes" |
8f6c03d5 | 1027 | fi; fi |
e4303e15 FF |
1028 | ], |
1029 | [ | |
1030 | with_libmysql="yes" | |
1031 | ]) | |
1032 | if test "x$with_libmysql" = "xyes" | |
1033 | then | |
805c4940 FF |
1034 | with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null` |
1035 | mysql_config_status=$? | |
1036 | ||
1037 | if test $mysql_config_status -ne 0 | |
1038 | then | |
1039 | with_libmysql="no" | |
1040 | else | |
1041 | SAVE_CFLAGS=$CFLAGS | |
1042 | CFLAGS="$CFLAGS $with_mysql_cflags" | |
1043 | ||
1044 | AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], []) | |
1045 | ||
1046 | CFLAGS="$SAVE_CFLAGS" | |
1047 | fi | |
e4303e15 FF |
1048 | fi |
1049 | if test "x$with_libmysql" = "xyes" | |
1050 | then | |
805c4940 | 1051 | with_mysql_libs=`$with_mysql_config --libs 2>/dev/null` |
8f6c03d5 FF |
1052 | mysql_config_status=$? |
1053 | ||
1054 | if test $mysql_config_status -ne 0 | |
1055 | then | |
1056 | with_libmysql="no" | |
1057 | else | |
1058 | AC_CHECK_LIB(mysqlclient, mysql_init, | |
48bc4be8 FF |
1059 | [with_libmysql="yes"], |
1060 | [with_libmysql="no (symbol 'mysql_init' not found)"], | |
8f6c03d5 FF |
1061 | [$with_mysql_libs]) |
1062 | fi | |
e4303e15 FF |
1063 | fi |
1064 | if test "x$with_libmysql" = "xyes" | |
1065 | then | |
805c4940 FF |
1066 | BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags" |
1067 | BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs" | |
1068 | AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS) | |
1069 | AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS) | |
e4303e15 | 1070 | fi |
e4303e15 | 1071 | AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes") |
86ca149a | 1072 | |
c64b3f3b SH |
1073 | with_own_liboconfig="no" |
1074 | liboconfig_LDFLAGS="$LDFLAGS" | |
1075 | liboconfig_CPPFLAGS="$CPPFLAGS" | |
1076 | AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])], | |
1077 | [ | |
1078 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1079 | then | |
1080 | if test -d "$withval/lib" | |
1081 | then | |
1082 | liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib" | |
1083 | fi | |
1084 | if test -d "$withval/include" | |
1085 | then | |
1086 | liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1087 | fi | |
1088 | fi | |
1089 | if test "x$withval" = "xno" | |
1090 | then | |
1091 | AC_MSG_ERROR("liboconfig is required") | |
1092 | fi | |
1093 | ], | |
1094 | [ | |
1095 | with_liboconfig="yes" | |
1096 | ]) | |
1097 | ||
1098 | save_LDFLAGS="$LDFLAGS" | |
1099 | save_CPPFLAGS="$CPPFLAGS" | |
1100 | LDFLAGS="$liboconfig_LDFLAGS" | |
1101 | CPPFLAGS="$liboconfig_CPPFLAGS" | |
1102 | AC_CHECK_LIB(oconfig, oconfig_parse_fh, | |
1103 | [ | |
1104 | with_liboconfig="yes" | |
1105 | with_own_liboconfig="no" | |
1106 | ], | |
1107 | [ | |
1108 | with_liboconfig="yes" | |
1109 | with_own_liboconfig="yes" | |
1110 | LDFLAGS="$save_LDFLAGS" | |
1111 | CPPFLAGS="$save_CPPFLAGS" | |
1112 | ]) | |
1113 | ||
1114 | AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes") | |
1115 | if test "x$with_own_liboconfig" = "xyes" | |
1116 | then | |
1117 | with_liboconfig="yes (shipped version)" | |
1118 | fi | |
1119 | ||
6997fb33 FF |
1120 | #with_liboping="yes" |
1121 | with_own_liboping="no" | |
1122 | liboping_LDFLAGS="$LDFLAGS" | |
1123 | liboping_CPPFLAGS="$CPPFLAGS" | |
1124 | AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])], | |
1125 | [ | |
1126 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1127 | then | |
1128 | if test -d "$withval/lib" | |
1129 | then | |
1130 | liboping_LDFLAGS="$LDFLAGS -L$withval/lib" | |
1131 | fi | |
1132 | if test -d "$withval/include" | |
1133 | then | |
1134 | liboping_CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1135 | fi | |
1136 | fi | |
1137 | if test "x$withval" = "xno" | |
1138 | then | |
1139 | with_liboping="no" | |
1140 | with_own_liboping="no" | |
1141 | fi | |
1142 | ], | |
1143 | [ | |
6997fb33 FF |
1144 | with_liboping="yes" |
1145 | ]) | |
1146 | ||
1147 | if test "x$with_liboping" = "xyes" | |
1148 | then | |
1149 | save_LDFLAGS="$LDFLAGS" | |
1150 | save_CPPFLAGS="$CPPFLAGS" | |
1151 | LDFLAGS="$liboping_LDFLAGS" | |
1152 | CPPFLAGS="$liboping_CPPFLAGS" | |
1153 | AC_CHECK_LIB(oping, ping_construct, | |
1154 | [ | |
1155 | with_liboping="yes" | |
1156 | with_own_liboping="no" | |
1157 | ], | |
1158 | [ | |
1159 | with_liboping="yes" | |
1160 | with_own_liboping="yes" | |
1161 | LDFLAGS="$save_LDFLAGS" | |
1162 | CPPFLAGS="$save_CPPFLAGS" | |
1163 | ]) | |
1164 | fi | |
1165 | AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes") | |
1166 | AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes") | |
6997fb33 | 1167 | |
dd7a9bc9 FF |
1168 | AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])], |
1169 | [ | |
1170 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1171 | then | |
1172 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
1173 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1174 | with_libpcap="yes" | |
1175 | fi | |
1176 | ], | |
1177 | [ | |
1178 | with_libpcap="yes" | |
1179 | ]) | |
1180 | if test "x$with_libpcap" = "xyes" | |
1181 | then | |
1182 | AC_CHECK_LIB(pcap, pcap_open_live, | |
1183 | [ | |
1184 | AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).]) | |
1185 | ], [with_libpcap="no (libpcap not found)"]) | |
1186 | fi | |
1187 | if test "x$with_libpcap" = "xyes" | |
1188 | then | |
1189 | AC_CHECK_HEADERS(pcap.h, | |
1190 | [ | |
1191 | AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.]) | |
1192 | ], [with_libpcap="no (pcap.h not found)"]) | |
1193 | fi | |
1194 | if test "x$with_libpcap" = "xyes" | |
1195 | then | |
1196 | collect_libpcap=1 | |
1197 | else | |
1198 | collect_libpcap=0 | |
1199 | fi | |
92f43553 | 1200 | AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap], |
dd7a9bc9 | 1201 | [Wether or not to use the pcap library]) |
92f43553 | 1202 | AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes") |
dd7a9bc9 | 1203 | |
3acac9b0 | 1204 | perl_interpreter="perl" |
a432a981 FF |
1205 | AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])], |
1206 | [ | |
1207 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1208 | then | |
1209 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
1210 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
3acac9b0 | 1211 | perl_interpreter="$withval/bin/perl" |
a432a981 FF |
1212 | with_libperl="yes" |
1213 | fi | |
1214 | ], | |
1215 | [ | |
1216 | with_libperl="yes" | |
1217 | ]) | |
a459afe5 SH |
1218 | |
1219 | AC_SUBST(PERL, "$perl_interpreter") | |
1220 | ||
a432a981 FF |
1221 | if test "x$with_libperl" = "xyes" |
1222 | then | |
1223 | SAVE_CFLAGS=$CFLAGS | |
1224 | SAVE_LDFLAGS=$LDFLAGS | |
3acac9b0 FF |
1225 | PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts` |
1226 | PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts` | |
1227 | CFLAGS="$CFLAGS $PERL_CFLAGS" | |
1228 | LDFLAGS="$LDFLAGS $PERL_LDFLAGS" | |
a432a981 FF |
1229 | |
1230 | AC_CACHE_CHECK([for libperl], | |
1231 | [have_libperl], | |
1232 | AC_LINK_IFELSE( | |
1233 | AC_LANG_PROGRAM( | |
1234 | [[ | |
1235 | #include <EXTERN.h> | |
1236 | #include <perl.h> | |
1237 | #include <XSUB.h> | |
1238 | ]], | |
1239 | [[ | |
1240 | PerlInterpreter *perl = NULL; | |
1241 | Perl_load_module (perl, PERL_LOADMOD_NOIMPORT, | |
3acac9b0 | 1242 | newSVpv ("Collectd::Plugin::FooBar", 24), |
a432a981 FF |
1243 | Nullsv); |
1244 | ]]), | |
1245 | [have_libperl="yes"], | |
1246 | [have_libperl="no"] | |
1247 | ) | |
1248 | ) | |
1249 | ||
1250 | if test "x$have_libperl" = "xyes" | |
1251 | then | |
1252 | AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.]) | |
3acac9b0 FF |
1253 | AC_SUBST(PERL_CFLAGS) |
1254 | AC_SUBST(PERL_LDFLAGS) | |
a432a981 FF |
1255 | else |
1256 | with_libperl="no" | |
1257 | fi | |
1258 | ||
1259 | CFLAGS=$SAVE_CFLAGS | |
1260 | LDFLAGS=$SAVE_LDFLAGS | |
1261 | fi | |
1262 | AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes") | |
1263 | ||
8de91034 FF |
1264 | AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], |
1265 | [ | |
1266 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1267 | then | |
1268 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
1269 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1270 | with_libiptc="yes" | |
1271 | fi | |
1272 | ], | |
1273 | [ | |
7f45f5b3 | 1274 | if test "x$ac_system" = "xLinux" |
8de91034 FF |
1275 | then |
1276 | with_libiptc="yes" | |
1277 | else | |
1278 | with_libiptc="no (Linux only)" | |
1279 | fi | |
1280 | ]) | |
1281 | if test "x$with_libiptc" = "xyes" | |
1282 | then | |
1283 | AC_CHECK_LIB(iptc, iptc_init, | |
1284 | [ | |
1285 | AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) | |
1286 | ], [with_libiptc="no (libiptc not found)"]) | |
1287 | fi | |
1288 | if test "x$with_libiptc" = "xyes" | |
1289 | then | |
1290 | AC_CHECK_HEADERS(libiptc/libiptc.h, | |
1291 | [ | |
1292 | AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.]) | |
1293 | ], [with_libiptc="no (libiptc/libiptc.h not found)"]) | |
1294 | fi | |
1295 | if test "x$with_libiptc" = "xyes" | |
1296 | then | |
1297 | collect_libiptc=1 | |
1298 | else | |
1299 | collect_libiptc=0 | |
1300 | fi | |
1301 | AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") | |
1302 | ||
c39428ae FF |
1303 | with_snmp_config="net-snmp-config" |
1304 | with_snmp_cflags="" | |
1305 | with_snmp_libs="" | |
c02ba630 FF |
1306 | AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])], |
1307 | [ | |
7f45f5b3 | 1308 | if test "x$withval" = "xno" |
c39428ae FF |
1309 | then |
1310 | with_libnetsnmp="no" | |
ae03d749 | 1311 | else if test "x$withval" = "xyes" |
c02ba630 | 1312 | then |
c02ba630 | 1313 | with_libnetsnmp="yes" |
c39428ae | 1314 | else |
7f45f5b3 | 1315 | if test -x "$withval" |
c39428ae FF |
1316 | then |
1317 | with_snmp_config="$withval" | |
1318 | with_libnetsnmp="yes" | |
1319 | else | |
1320 | with_snmp_config="$withval/bin/net-snmp-config" | |
1321 | with_libnetsnmp="yes" | |
1322 | fi | |
1323 | fi; fi | |
c02ba630 FF |
1324 | ], |
1325 | [with_libnetsnmp="yes"]) | |
1326 | if test "x$with_libnetsnmp" = "xyes" | |
1327 | then | |
00ff99d8 | 1328 | with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null` |
c39428ae FF |
1329 | snmp_config_status=$? |
1330 | ||
1331 | if test $snmp_config_status -ne 0 | |
1332 | then | |
1333 | with_libnetsnmp="no ($with_snmp_config failed)" | |
1334 | else | |
1335 | SAVE_CFLAGS=$CFLAGS | |
1336 | CFLAGS="$CFLAGS $with_snmp_cflags" | |
1337 | ||
1338 | AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]) | |
1339 | ||
1340 | CFLAGS="$SAVE_CFLAGS" | |
1341 | fi | |
c02ba630 FF |
1342 | fi |
1343 | if test "x$with_libnetsnmp" = "xyes" | |
1344 | then | |
00ff99d8 | 1345 | with_snmp_libs=`$with_snmp_config --libs 2>/dev/null` |
c39428ae FF |
1346 | snmp_config_status=$? |
1347 | ||
1348 | if test $snmp_config_status -ne 0 | |
1349 | then | |
1350 | with_libnetsnmp="no ($with_snmp_config failed)" | |
1351 | else | |
1352 | AC_CHECK_LIB(netsnmp, init_snmp, | |
1353 | [with_libnetsnmp="yes"], | |
1354 | [with_libnetsnmp="no (libnetsnmp not found)"], | |
1355 | [$with_snmp_libs]) | |
1356 | fi | |
1357 | fi | |
00ff99d8 | 1358 | if test "x$with_libnetsnmp" = "xyes" |
c39428ae FF |
1359 | then |
1360 | BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags" | |
1361 | BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs" | |
1362 | AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS) | |
1363 | AC_SUBST(BUILD_WITH_LIBSNMP_LIBS) | |
c02ba630 FF |
1364 | fi |
1365 | AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes") | |
1366 | ||
3fc0feb6 FF |
1367 | with_upsclient_config="libupsclient-config" |
1368 | with_upsclient_cflags="" | |
1369 | with_upsclient_libs="" | |
bc2d9402 FF |
1370 | AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])], |
1371 | [ | |
3fc0feb6 | 1372 | if test "x$withval" = "xno" |
bc2d9402 | 1373 | then |
3fc0feb6 FF |
1374 | with_libupsclient="no" |
1375 | else | |
395e2cc2 | 1376 | if test "x$withval" != "xyes" |
3fc0feb6 | 1377 | then |
a3cd4630 | 1378 | if test -f "$withval" && test -x "$withval"; |
1398c68c FF |
1379 | then |
1380 | with_upsclient_config="$withval" | |
1381 | else | |
1382 | with_upsclient_config="$withval/bin/libupsclient-config" | |
1383 | fi | |
3fc0feb6 | 1384 | fi |
a3cd4630 | 1385 | with_libupsclient="yes" |
bc2d9402 FF |
1386 | fi |
1387 | ], | |
1388 | [ | |
1389 | with_libupsclient="yes" | |
1390 | ]) | |
1391 | if test "x$with_libupsclient" = "xyes" | |
3fc0feb6 FF |
1392 | then |
1393 | with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null` | |
1394 | upsclient_config_status=$? | |
1395 | ||
1396 | if test $upsclient_config_status -ne 0 | |
1397 | then | |
1398c68c | 1398 | with_libupsclient="no ($with_upsclient_config failed)" |
3fc0feb6 FF |
1399 | fi |
1400 | fi | |
1401 | if test "x$with_libupsclient" = "xyes" | |
1398c68c FF |
1402 | then |
1403 | SAVE_CFLAGS="$CFLAGS" | |
1404 | CFLAGS="$CFLAGS $with_upsclient_cflags" | |
1405 | ||
1406 | AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"]) | |
1407 | ||
1408 | CFLAGS="$SAVE_CFLAGS" | |
1409 | fi | |
1410 | if test "x$with_libupsclient" = "xyes" | |
3fc0feb6 FF |
1411 | then |
1412 | with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null` | |
1413 | upsclient_config_status=$? | |
1414 | ||
1415 | if test $upsclient_config_status -ne 0 | |
1416 | then | |
1398c68c | 1417 | with_libupsclient="no ($with_upsclient_config failed)" |
3fc0feb6 FF |
1418 | fi |
1419 | fi | |
1420 | if test "x$with_libupsclient" = "xyes" | |
bc2d9402 FF |
1421 | then |
1422 | AC_CHECK_LIB(upsclient, upscli_connect, | |
1423 | [ | |
3fc0feb6 FF |
1424 | BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags" |
1425 | BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs" | |
1426 | AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS) | |
1427 | AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS) | |
1428 | ], | |
1429 | [ | |
1398c68c FF |
1430 | with_libupsclient="no (symbol 'upscli_connect' not found)" |
1431 | ], [$with_upsclient_libs]) | |
bc2d9402 | 1432 | fi |
8f6c03d5 FF |
1433 | if test "x$with_libupsclient" = "xyes" |
1434 | then | |
7f45f5b3 | 1435 | AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [], |
8f6c03d5 FF |
1436 | [#include <stdlib.h> |
1437 | #include <stdio.h> | |
1438 | #include <upsclient.h>]) | |
1439 | fi | |
bc2d9402 FF |
1440 | AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes") |
1441 | ||
558a6a1c FF |
1442 | ### BEGIN of check for libxmms ### |
1443 | with_xmms_config="xmms-config" | |
558a6a1c FF |
1444 | with_xmms_cflags="" |
1445 | with_xmms_libs="" | |
1446 | AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])], | |
1447 | [ | |
1448 | if test "x$withval" != "xno" -a "x$withval" != "xyes" | |
1449 | then | |
a3cd4630 FF |
1450 | if test -f "$withval" && test -x "$withval"; |
1451 | then | |
1452 | with_xmms_config="$withval" | |
1453 | else if test -x "$withval/bin/xmms-config" | |
558a6a1c FF |
1454 | then |
1455 | with_xmms_config="$withval/bin/xmms-config" | |
a3cd4630 FF |
1456 | fi; fi |
1457 | with_libxmms="yes" | |
1458 | else if test "x$withval" = "xno" | |
558a6a1c FF |
1459 | then |
1460 | with_libxmms="no" | |
1461 | else | |
1462 | with_libxmms="yes" | |
a3cd4630 | 1463 | fi; fi |
558a6a1c FF |
1464 | ], |
1465 | [ | |
1466 | with_libxmms="yes" | |
1467 | ]) | |
1468 | if test "x$with_libxmms" = "xyes" | |
1469 | then | |
1470 | with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null` | |
1471 | xmms_config_status=$? | |
1472 | ||
1473 | if test $xmms_config_status -ne 0 | |
1474 | then | |
1475 | with_libxmms="no" | |
1476 | fi | |
1477 | fi | |
1478 | if test "x$with_libxmms" = "xyes" | |
1479 | then | |
1480 | with_xmms_libs=`$with_xmms_config --libs 2>/dev/null` | |
1481 | xmms_config_status=$? | |
1482 | ||
1483 | if test $xmms_config_status -ne 0 | |
1484 | then | |
1485 | with_libxmms="no" | |
1486 | fi | |
1487 | fi | |
1488 | if test "x$with_libxmms" = "xyes" | |
1489 | then | |
1490 | AC_CHECK_LIB(xmms, xmms_remote_get_info, | |
1491 | [ | |
1492 | BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags" | |
1493 | BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs" | |
1494 | AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS) | |
1495 | AC_SUBST(BUILD_WITH_LIBXMMS_LIBS) | |
1496 | ], | |
1497 | [ | |
1498 | with_libxmms="no" | |
1499 | ], | |
1500 | [$with_xmms_libs]) | |
1501 | fi | |
1502 | with_libxmms_numeric=0 | |
1503 | if test "x$with_libxmms" = "xyes" | |
1504 | then | |
1505 | with_libxmms_numeric=1 | |
1506 | fi | |
1507 | AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).]) | |
1508 | AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes") | |
1509 | ### END of check for libxmms ### | |
1510 | ||
c1406acc FF |
1511 | with_libnetlink_cflags="" |
1512 | with_libnetlink_libs="-lnetlink" | |
1513 | AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])], | |
1514 | [ | |
1515 | echo "libnetlink: withval = $withval" | |
1516 | if test "x$withval" = "xyes" | |
1517 | then | |
1518 | with_libnetlink="yes" | |
1519 | else if test "x$withval" = "xno" | |
1520 | then | |
1521 | with_libnetlink="no" | |
1522 | else | |
1523 | if test -d "$withval/include" | |
1524 | then | |
1525 | with_libnetlink_cflags="-I$withval/include" | |
1526 | with_libnetlink_libs="-L$withval/lib -lnetlink" | |
1527 | with_libnetlink="yes" | |
1528 | else | |
1529 | AC_MSG_ERROR("no such directory: $withval/include") | |
1530 | fi | |
1531 | fi; fi | |
1532 | ], | |
1533 | [ | |
1534 | if test "x$ac_system" = "xLinux" | |
1535 | then | |
1536 | with_libnetlink="yes" | |
1537 | else | |
1538 | with_libnetlink="no (Linux only library)" | |
1539 | fi | |
1540 | ]) | |
1541 | if test "x$with_libnetlink" = "xyes" | |
1542 | then | |
1543 | SAVE_CFLAGS=$CFLAGS | |
1544 | CFLAGS="$CFLAGS $with_libnetlink_cflags" | |
1545 | ||
48bc4be8 FF |
1546 | with_libnetlink="no (libnetlink.h not found)" |
1547 | ||
1548 | AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h, | |
1549 | [ | |
1550 | with_libnetlink="yes" | |
1551 | break | |
1552 | ], [], | |
c1406acc FF |
1553 | [#include <stdio.h> |
1554 | #include <sys/types.h> | |
57825ea7 | 1555 | #include <asm/types.h> |
c1406acc FF |
1556 | #include <sys/socket.h> |
1557 | #include <linux/netlink.h> | |
1558 | #include <linux/rtnetlink.h>]) | |
5d26a660 FF |
1559 | AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [], |
1560 | [#include <stdio.h> | |
1561 | #include <sys/types.h> | |
1562 | #include <asm/types.h> | |
1563 | #include <sys/socket.h>]) | |
1564 | ||
1565 | AC_COMPILE_IFELSE( | |
1566 | [#include <stdio.h> | |
1567 | #include <sys/types.h> | |
1568 | #include <asm/types.h> | |
1569 | #include <sys/socket.h> | |
1570 | #include <linux/netlink.h> | |
1571 | #include <linux/rtnetlink.h> | |
1572 | ||
1573 | int main (void) | |
1574 | { | |
1575 | int retval = TCA_STATS2; | |
1576 | return (retval); | |
1577 | }], | |
1578 | [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])] | |
1579 | []); | |
1580 | ||
1581 | AC_COMPILE_IFELSE( | |
1582 | [#include <stdio.h> | |
1583 | #include <sys/types.h> | |
1584 | #include <asm/types.h> | |
1585 | #include <sys/socket.h> | |
1586 | #include <linux/netlink.h> | |
1587 | #include <linux/rtnetlink.h> | |
1588 | ||
1589 | int main (void) | |
1590 | { | |
1591 | int retval = TCA_STATS; | |
1592 | return (retval); | |
1593 | }], | |
1594 | [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])] | |
1595 | []); | |
c1406acc FF |
1596 | |
1597 | CFLAGS="$SAVE_CFLAGS" | |
1598 | fi | |
1599 | if test "x$with_libnetlink" = "xyes" | |
1600 | then | |
1601 | AC_CHECK_LIB(netlink, rtnl_open, | |
1602 | [with_libnetlink="yes"], | |
1603 | [with_libnetlink="no (symbol 'rtnl_open' not found)"], | |
1604 | [$with_libnetlink_libs]) | |
1605 | fi | |
1606 | if test "x$with_libnetlink" = "xyes" | |
1607 | then | |
05ea4f3f FF |
1608 | BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags" |
1609 | BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs" | |
c1406acc FF |
1610 | AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS) |
1611 | AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS) | |
1612 | fi | |
1613 | AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes") | |
5d99fadf | 1614 | |
f69ce75e | 1615 | dnl Check for libvirt and libxml2 libraries. |
c6be63a7 FF |
1616 | with_libxml2="no (pkg-config isn't available)" |
1617 | with_libxml2_cflags="" | |
1618 | with_libxml2_ldflags="" | |
1619 | with_libvirt="no (pkg-config isn't available)" | |
df26df90 FF |
1620 | with_libvirt_cflags="" |
1621 | with_libvirt_ldflags="" | |
c6be63a7 FF |
1622 | PKG_PROG_PKG_CONFIG |
1623 | if test "x$PKG_CONFIG" != "x" | |
1624 | then | |
1625 | pkg-config --exists 'libxml-2.0' 2>/dev/null | |
1626 | if test "$?" = "0" | |
1627 | then | |
1628 | with_libxml2="yes" | |
1629 | else | |
1630 | with_libxml2="no (pkg-config doesn't know library)" | |
1631 | fi | |
1632 | ||
1633 | pkg-config --exists libvirt 2>/dev/null | |
1634 | if test "$?" = "0" | |
1635 | then | |
1636 | with_libvirt="yes" | |
1637 | else | |
1638 | with_libvirt="no (pkg-config doesn't know library)" | |
1639 | fi | |
1640 | fi | |
df26df90 FF |
1641 | if test "x$with_libxml2" = "xyes" |
1642 | then | |
c6be63a7 FF |
1643 | with_libxml2_cflags="`pkg-config --cflags libxml-2.0`" |
1644 | if test $? -ne 0 | |
1645 | then | |
1646 | with_libxml2="no" | |
1647 | fi | |
1648 | with_libxml2_ldflags="`pkg-config --libs libxml-2.0`" | |
1649 | if test $? -ne 0 | |
1650 | then | |
1651 | with_libxml2="no" | |
1652 | fi | |
1653 | fi | |
1654 | if test "x$with_libxml2" = "xyes" | |
1655 | then | |
1656 | SAVE_CPPFLAGS="$CPPFLAGS" | |
1657 | CPPFLAGS="$CPPFLAGS $with_libxml2_cflags" | |
1658 | ||
1659 | AC_CHECK_HEADERS(libxml/parser.h, [], | |
1660 | [with_libxml2="no (libxml/parser.h not found)"]) | |
1661 | ||
1662 | CPPFLAGS="$SAVE_CPPFLAGS" | |
1663 | fi | |
1664 | if test "x$with_libxml2" = "xyes" | |
1665 | then | |
1666 | SAVE_CFLAGS="$CFLAGS" | |
1667 | SAVE_LD_FLAGS="$LDFLAGS" | |
1668 | ||
1669 | CFLAGS="$CFLAGS $with_libxml2_cflags" | |
1670 | LDFLAGS="$LDFLAGS $with_libxml2_ldflags" | |
1671 | ||
1672 | AC_CHECK_LIB(xml2, xmlXPathEval, | |
1673 | [with_libxml2="yes"], | |
1674 | [with_libxml2="no (symbol xmlXPathEval not found)"]) | |
1675 | ||
1676 | CFLAGS="$SAVE_CFLAGS" | |
1677 | LDFLAGS="$SAVE_LDFLAGS" | |
1678 | fi | |
1679 | dnl Add the right compiler flags and libraries. | |
1680 | if test "x$with_libxml2" = "xyes"; then | |
1681 | BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags" | |
1682 | BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags" | |
1683 | AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS) | |
1684 | AC_SUBST(BUILD_WITH_LIBXML2_LIBS) | |
1685 | fi | |
1686 | if test "x$with_libvirt" = "xyes" | |
1687 | then | |
df26df90 FF |
1688 | with_libvirt_cflags="`pkg-config --cflags libvirt`" |
1689 | if test $? -ne 0 | |
1690 | then | |
1691 | with_libvirt="no" | |
1692 | fi | |
1693 | with_libvirt_ldflags="`pkg-config --libs libvirt`" | |
1694 | if test $? -ne 0 | |
1695 | then | |
1696 | with_libvirt="no" | |
1697 | fi | |
1698 | fi | |
1699 | if test "x$with_libvirt" = "xyes" | |
c6be63a7 FF |
1700 | then |
1701 | SAVE_CPPFLAGS="$CPPFLAGS" | |
1702 | CPPFLAGS="$CPPFLAGS $with_libvirt_cflags" | |
1703 | ||
1704 | AC_CHECK_HEADERS(libvirt/libvirt.h, [], | |
1705 | [with_libvirt="no (libvirt/libvirt.h not found)"]) | |
1706 | ||
1707 | CPPFLAGS="$SAVE_CPPFLAGS" | |
1708 | fi | |
1709 | if test "x$with_libvirt" = "xyes" | |
df26df90 FF |
1710 | then |
1711 | SAVE_CFLAGS="$CFLAGS" | |
1712 | SAVE_LD_FLAGS="$LDFLAGS" | |
1713 | ||
1714 | CFLAGS="$CFLAGS $with_libvirt_cflags" | |
1715 | LDFLAGS="$LDFLAGS $with_libvirt_ldflags" | |
1716 | ||
c6be63a7 | 1717 | AC_CHECK_LIB(virt, virDomainBlockStats, |
df26df90 FF |
1718 | [with_libvirt="yes"], |
1719 | [with_libvirt="no (symbol virDomainBlockStats not found)"]) | |
1720 | ||
1721 | CFLAGS="$SAVE_CFLAGS" | |
1722 | LDFLAGS="$SAVE_LDFLAGS" | |
f69ce75e RJ |
1723 | fi |
1724 | dnl Add the right compiler flags and libraries. | |
1725 | if test "x$with_libvirt" = "xyes"; then | |
c6be63a7 FF |
1726 | BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags" |
1727 | BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags" | |
1728 | AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS) | |
1729 | AC_SUBST(BUILD_WITH_LIBVIRT_LIBS) | |
f69ce75e RJ |
1730 | fi |
1731 | ||
1732 | dnl End of check for libvirt and libxml2 libraries. | |
1733 | ||
86ca149a FF |
1734 | # Check for enabled/disabled features |
1735 | # | |
6e765a02 | 1736 | |
3c12e8a6 NW |
1737 | # AC_COLLECTD(name, enable/disable, info-text, feature/module) |
1738 | # ------------------------------------------------------------ | |
1739 | dnl | |
1740 | m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))]) | |
1741 | dnl | |
1742 | AC_DEFUN( | |
1743 | [AC_COLLECTD], | |
1744 | [ | |
1745 | m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl | |
1746 | m4_if( | |
1747 | [$2], | |
1748 | [enable], | |
1749 | [dnl | |
1750 | m4_define([EnDis],[disabled])dnl | |
1751 | m4_define([YesNo],[no])dnl | |
1752 | ],dnl | |
1753 | [m4_if( | |
1754 | [$2], | |
1755 | [disable], | |
1756 | [dnl | |
1757 | m4_define([EnDis],[enabled])dnl | |
1758 | m4_define([YesNo],[yes])dnl | |
1759 | ], | |
1760 | [dnl | |
1761 | AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl | |
1762 | ]dnl | |
1763 | )]dnl | |
1764 | )dnl | |
1765 | m4_if([$3], [feature], [], | |
1766 | [m4_if( | |
1767 | [$3], [module], [], | |
1768 | [dnl | |
1769 | AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl | |
1770 | ]dnl | |
1771 | )]dnl | |
1772 | )dnl | |
1773 | AC_ARG_ENABLE( | |
1774 | [$1], | |
1775 | AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]), | |
1776 | [], | |
1777 | enable_$1='[YesNo]'dnl | |
1778 | )# AC_ARG_ENABLE | |
1779 | if test "x$enable_$1" = "xno" | |
1780 | then | |
1781 | collectd_$1=0 | |
6e765a02 | 1782 | else |
3c12e8a6 | 1783 | if test "x$enable_$1" = "xyes" |
6e765a02 | 1784 | then |
3c12e8a6 | 1785 | collectd_$1=1 |
6e765a02 | 1786 | else |
3c12e8a6 NW |
1787 | AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.]) |
1788 | collectd_$1=1 | |
1789 | enable_$1='yes' | |
6e765a02 FF |
1790 | fi |
1791 | fi | |
3c12e8a6 NW |
1792 | AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4]) |
1793 | AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl | |
1794 | ]dnl | |
1795 | )# AC_COLLECTD(name, enable/disable, info-text, feature/module) | |
1796 | ||
a905d397 FF |
1797 | # AC_PLUGIN(name, default, info) |
1798 | # ------------------------------------------------------------ | |
1799 | dnl | |
1800 | AC_DEFUN( | |
1801 | [AC_PLUGIN], | |
1802 | [ | |
1803 | enable_plugin="no" | |
1804 | AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]), | |
1805 | [ | |
1806 | if test "x$enableval" = "xyes" | |
1807 | then | |
1808 | enable_plugin="yes" | |
1809 | else | |
1810 | enable_plugin="no" | |
1811 | fi | |
1812 | ], | |
1813 | [ | |
1814 | if test "x$2" = "xyes" | |
1815 | then | |
1816 | enable_plugin="yes" | |
1817 | else | |
1818 | enable_plugin="no" | |
1819 | fi | |
1820 | ]) | |
1821 | if test "x$enable_plugin" = "xyes" | |
1822 | then | |
1823 | AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.]) | |
1824 | fi | |
1825 | AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes") | |
1826 | enable_$1="$enable_plugin" | |
1827 | ] | |
1828 | )# AC_PLUGIN(name, default, info) | |
1829 | ||
3c12e8a6 NW |
1830 | m4_divert_once([HELP_ENABLE], [ |
1831 | collectd features:]) | |
a905d397 | 1832 | # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro. |
3c12e8a6 NW |
1833 | AC_COLLECTD([debug], [enable], [feature], [debugging]) |
1834 | AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) | |
14740db4 | 1835 | AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux]) |
6e765a02 | 1836 | |
a905d397 FF |
1837 | plugin_battery="no" |
1838 | plugin_cpu="no" | |
1839 | plugin_cpufreq="no" | |
1840 | plugin_df="no" | |
1841 | plugin_disk="no" | |
1842 | plugin_entropy="no" | |
1843 | plugin_interface="no" | |
6d431b70 | 1844 | plugin_ipvs="no" |
a905d397 | 1845 | plugin_irq="no" |
553376a3 | 1846 | plugin_libvirt="no" |
a905d397 FF |
1847 | plugin_load="no" |
1848 | plugin_memory="no" | |
3fc0feb6 | 1849 | plugin_multimeter="no" |
a905d397 FF |
1850 | plugin_nfs="no" |
1851 | plugin_processes="no" | |
1852 | plugin_serial="no" | |
1853 | plugin_swap="no" | |
1854 | plugin_tape="no" | |
03b7ec00 | 1855 | plugin_tcpconns="no" |
a905d397 FF |
1856 | plugin_users="no" |
1857 | plugin_vserver="no" | |
1858 | plugin_wireless="no" | |
1859 | ||
1860 | # Linux | |
1861 | if test "x$ac_system" = "xLinux" | |
1862 | then | |
1863 | plugin_battery="yes" | |
1864 | plugin_cpu="yes" | |
1865 | plugin_cpufreq="yes" | |
1866 | plugin_disk="yes" | |
1867 | plugin_entropy="yes" | |
1868 | plugin_interface="yes" | |
1869 | plugin_irq="yes" | |
1870 | plugin_load="yes" | |
1871 | plugin_memory="yes" | |
1872 | plugin_nfs="yes" | |
1873 | plugin_processes="yes" | |
1874 | plugin_serial="yes" | |
1875 | plugin_swap="yes" | |
03b7ec00 | 1876 | plugin_tcpconns="yes" |
a905d397 FF |
1877 | plugin_vserver="yes" |
1878 | plugin_wireless="yes" | |
fb3a07dc SH |
1879 | |
1880 | if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes" | |
1881 | then | |
1882 | plugin_ipvs="yes" | |
1883 | fi | |
a905d397 FF |
1884 | fi |
1885 | ||
1886 | # Mac OS X devices | |
1887 | if test "x$with_libiokit" = "xyes" | |
1888 | then | |
1889 | plugin_battery="yes" | |
1890 | plugin_disk="yes" | |
1891 | fi | |
1892 | ||
1893 | # Solaris | |
1894 | if test "x$with_devinfo$with_kstat" = "xyesyes" | |
1895 | then | |
1896 | plugin_cpu="yes" | |
1897 | plugin_disk="yes" | |
1898 | plugin_interface="yes" | |
1899 | plugin_memory="yes" | |
1900 | plugin_swap="yes" | |
1901 | plugin_tape="yes" | |
1902 | fi | |
1903 | ||
1904 | # libstatgrab | |
1905 | if test "x$with_libstatgrab" = "xyes" | |
1906 | then | |
1907 | plugin_interface="yes" | |
1908 | plugin_load="yes" | |
1909 | plugin_memory="yes" | |
1910 | plugin_swap="yes" | |
1911 | fi | |
1912 | ||
1913 | if test "x$have_processor_info" = "xyes" | |
1914 | then | |
1915 | plugin_cpu="yes" | |
1916 | fi | |
1917 | if test "x$have_sysctlbyname" = "xyes" | |
1918 | then | |
1919 | plugin_cpu="yes" | |
1920 | plugin_memory="yes" | |
1695cd07 | 1921 | plugin_tcpconns="yes" |
a905d397 FF |
1922 | fi |
1923 | ||
1924 | if test "x$have_statfs" = "xyes" | |
1925 | then | |
1926 | plugin_df="yes" | |
1927 | fi | |
1928 | if test "x$have_statvfs" = "xyes" | |
1929 | then | |
1930 | plugin_df="yes" | |
1931 | fi | |
1932 | ||
1933 | if test "x$have_getifaddrs" = "xyes" | |
1934 | then | |
1935 | plugin_interface="yes" | |
1936 | fi | |
1937 | ||
c6be63a7 FF |
1938 | if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes" |
1939 | then | |
553376a3 | 1940 | plugin_libvirt="yes" |
c6be63a7 FF |
1941 | fi |
1942 | ||
a905d397 FF |
1943 | if test "x$have_getloadavg" = "xyes" |
1944 | then | |
1945 | plugin_load="yes" | |
1946 | fi | |
1947 | ||
1948 | # Mac OS X memory interface | |
1949 | if test "x$have_host_statistics" = "xyes" | |
1950 | then | |
1951 | plugin_memory="yes" | |
1952 | fi | |
1953 | ||
3fc0feb6 FF |
1954 | if test "x$have_termios_h" = "xyes" |
1955 | then | |
1956 | plugin_multimeter="yes" | |
1957 | fi | |
1958 | ||
a905d397 FF |
1959 | if test "x$have_thread_info" = "xyes" |
1960 | then | |
1961 | plugin_processes="yes" | |
1962 | fi | |
1963 | ||
1964 | if test "x$with_libkvm" = "xyes" | |
1965 | then | |
1966 | plugin_swap="yes" | |
1967 | fi | |
1968 | ||
1969 | if test "x$have_getutent" = "xyes" | |
1970 | then | |
1971 | plugin_users="yes" | |
1972 | fi | |
1973 | if test "x$have_getutxent" = "xyes" | |
1974 | then | |
1975 | plugin_users="yes" | |
1976 | fi | |
1977 | ||
1978 | # FIXME: sysctl for swap plugin | |
1979 | ||
f9ee71b2 | 1980 | m4_divert_once([HELP_ENABLE], [ |
a905d397 FF |
1981 | collectd plugins:]) |
1982 | ||
3fc0feb6 FF |
1983 | AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics]) |
1984 | AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC]) | |
1985 | AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors]) | |
1986 | AC_PLUGIN([battery], [$plugin_battery], [Battery statistics]) | |
1987 | AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics]) | |
1988 | AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics]) | |
1989 | AC_PLUGIN([csv], [yes], [CSV output plugin]) | |
1990 | AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) | |
1991 | AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) | |
1992 | AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis]) | |
1993 | AC_PLUGIN([email], [yes], [EMail statistics]) | |
1994 | AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) | |
1995 | AC_PLUGIN([exec], [yes], [Execution of external programs]) | |
1996 | AC_PLUGIN([hddtemp], [yes], [Query hddtempd]) | |
1997 | AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics]) | |
1998 | AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) | |
6d431b70 | 1999 | AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics]) |
3fc0feb6 | 2000 | AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics]) |
553376a3 | 2001 | AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) |
3fc0feb6 FF |
2002 | AC_PLUGIN([load], [$plugin_load], [System load]) |
2003 | AC_PLUGIN([logfile], [yes], [File logging plugin]) | |
2004 | AC_PLUGIN([mbmon], [yes], [Query mbmond]) | |
0735ed71 | 2005 | AC_PLUGIN([memcached], [yes], [memcached statistics]) |
3fc0feb6 FF |
2006 | AC_PLUGIN([memory], [$plugin_memory], [Memory usage]) |
2007 | AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values]) | |
2008 | AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics]) | |
5d99fadf | 2009 | AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics]) |
3fc0feb6 FF |
2010 | AC_PLUGIN([network], [yes], [Network communication plugin]) |
2011 | AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics]) | |
62b1cfdd | 2012 | AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics]) |
3fc0feb6 | 2013 | AC_PLUGIN([ntpd], [yes], [NTPd statistics]) |
a905d397 | 2014 | AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics]) |
3fc0feb6 FF |
2015 | AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter]) |
2016 | AC_PLUGIN([ping], [$with_liboping], [Network latency statistics]) | |
2017 | AC_PLUGIN([processes], [$plugin_processes], [Process statistics]) | |
2018 | AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin]) | |
2019 | AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics]) | |
2020 | AC_PLUGIN([serial], [$plugin_serial], [serial port traffic]) | |
2021 | AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin]) | |
2022 | AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics]) | |
2023 | AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin]) | |
2024 | AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics]) | |
03b7ec00 | 2025 | AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics]) |
3fc0feb6 FF |
2026 | AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin]) |
2027 | AC_PLUGIN([users], [$plugin_users], [User statistics]) | |
30f3e7b8 | 2028 | AC_PLUGIN([uuid], [yes], [UUID as hostname plugin]) |
3fc0feb6 FF |
2029 | AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics]) |
2030 | AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics]) | |
2031 | AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics]) | |
55b43947 | 2032 | |
fb3a07dc SH |
2033 | dnl ip_vs.h |
2034 | if test "x$ac_system" = "xLinux" -a "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono" | |
2035 | then | |
2036 | enable_ipvs="$enable_ipvs (ip_vs.h not found)" | |
2037 | fi | |
2038 | ||
a459afe5 SH |
2039 | dnl Perl bindings |
2040 | AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])], | |
2041 | [ | |
2042 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
2043 | then | |
2044 | PERL_BINDINGS_OPTIONS="$withval" | |
2045 | with_perl_bindings="yes" | |
2046 | fi | |
2047 | ], | |
2048 | [ | |
2049 | PERL_BINDINGS_OPTIONS="" | |
2050 | with_perl_bindings="yes" | |
2051 | ]) | |
2052 | if test "x$with_perl_bindings" = "xyes" | |
2053 | then | |
2054 | PERL_BINDINGS="perl" | |
2055 | else | |
2056 | PERL_BINDINGS="" | |
2057 | fi | |
2058 | AC_SUBST(PERL_BINDINGS) | |
2059 | AC_SUBST(PERL_BINDINGS_OPTIONS) | |
2060 | ||
2061 | AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile) | |
86ca149a | 2062 | |
a905d397 FF |
2063 | if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes" |
2064 | then | |
2065 | with_liboping="yes (shipped version)" | |
2066 | fi | |
2067 | ||
7d32c2bc | 2068 | if test "x$with_libperl" = "xyes" |
a432a981 | 2069 | then |
a459afe5 | 2070 | with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)" |
7d32c2bc | 2071 | else |
a432a981 FF |
2072 | enable_perl="no (needs libperl)" |
2073 | fi | |
2074 | ||
a459afe5 SH |
2075 | if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x" |
2076 | then | |
2077 | with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)" | |
2078 | fi | |
2079 | ||
86ca149a FF |
2080 | cat <<EOF; |
2081 | ||
2082 | Configuration: | |
2083 | Libraries: | |
a8025575 | 2084 | libcurl . . . . . . $with_libcurl |
adaf6ca0 | 2085 | libiokit . . . . . $with_libiokit |
86ccc162 | 2086 | libiptc . . . . . . $with_libiptc |
86ca149a | 2087 | libkstat . . . . . $with_kstat |
a905d397 | 2088 | libkvm . . . . . . $with_libkvm |
e4303e15 | 2089 | libmysql . . . . . $with_libmysql |
5ce6bf75 | 2090 | libnetlink . . . . $with_libnetlink |
c02ba630 | 2091 | libnetsnmp . . . . $with_libnetsnmp |
c64b3f3b | 2092 | liboconfig . . . . $with_liboconfig |
86ccc162 | 2093 | liboping . . . . . $with_liboping |
dd7a9bc9 | 2094 | libpcap . . . . . . $with_libpcap |
a432a981 | 2095 | libperl . . . . . . $with_libperl |
c4377c1e | 2096 | libpthread . . . . $with_libpthread |
86ccc162 FF |
2097 | librrd . . . . . . $with_rrdtool |
2098 | libsensors . . . . $with_lm_sensors | |
2099 | libstatgrab . . . . $with_libstatgrab | |
2100 | libupsclient . . . $with_libupsclient | |
f69ce75e RJ |
2101 | libvirt . . . . . . $with_libvirt |
2102 | libxml2 . . . . . . $with_libxml2 | |
558a6a1c | 2103 | libxmms . . . . . . $with_libxmms |
86ca149a FF |
2104 | |
2105 | Features: | |
6e765a02 | 2106 | daemon mode . . . . $enable_daemon |
86ccc162 | 2107 | debug . . . . . . . $enable_debug |
6e765a02 | 2108 | |
a459afe5 SH |
2109 | Bindings: |
2110 | perl . . . . . . . $with_perl_bindings | |
2111 | ||
6e765a02 | 2112 | Modules: |
11265296 | 2113 | apache . . . . . . $enable_apache |
bfec4e6f | 2114 | apcups . . . . . . $enable_apcups |
11265296 | 2115 | apple_sensors . . . $enable_apple_sensors |
84b0b421 | 2116 | battery . . . . . . $enable_battery |
86ca149a FF |
2117 | cpu . . . . . . . . $enable_cpu |
2118 | cpufreq . . . . . . $enable_cpufreq | |
f5b4f424 | 2119 | csv . . . . . . . . $enable_csv |
2d03e4e3 | 2120 | df . . . . . . . . $enable_df |
86ca149a | 2121 | disk . . . . . . . $enable_disk |
fdfbf887 | 2122 | dns . . . . . . . . $enable_dns |
fc257d86 | 2123 | email . . . . . . . $enable_email |
1cc2a825 | 2124 | entropy . . . . . . $enable_entropy |
11770688 | 2125 | exec . . . . . . . $enable_exec |
86ca149a | 2126 | hddtemp . . . . . . $enable_hddtemp |
3268a333 | 2127 | interface . . . . . $enable_interface |
35248bcc | 2128 | iptables . . . . . $enable_iptables |
6d431b70 | 2129 | ipvs . . . . . . . $enable_ipvs |
3268a333 | 2130 | irq . . . . . . . . $enable_irq |
553376a3 | 2131 | libvirt . . . . . . $enable_libvirt |
86ca149a | 2132 | load . . . . . . . $enable_load |
05b7b7e3 | 2133 | logfile . . . . . . $enable_logfile |
c8e76316 | 2134 | mbmon . . . . . . . $enable_mbmon |
0735ed71 | 2135 | memcached . . . . . $enable_memcached |
86ca149a | 2136 | memory . . . . . . $enable_memory |
9a5e1523 | 2137 | multimeter . . . . $enable_multimeter |
1f2a5bff | 2138 | mysql . . . . . . . $enable_mysql |
c1406acc | 2139 | netlink . . . . . . $enable_netlink |
63450476 | 2140 | network . . . . . . $enable_network |
86ca149a | 2141 | nfs . . . . . . . . $enable_nfs |
a3e863a5 | 2142 | nginx . . . . . . . $enable_nginx |
2fa44680 | 2143 | ntpd . . . . . . . $enable_ntpd |
bc2d9402 | 2144 | nut . . . . . . . . $enable_nut |
3f0a64bd | 2145 | perl . . . . . . . $enable_perl |
86ca149a FF |
2146 | ping . . . . . . . $enable_ping |
2147 | processes . . . . . $enable_processes | |
fd04dec3 | 2148 | rrdtool . . . . . . $enable_rrdtool |
86ca149a FF |
2149 | sensors . . . . . . $enable_sensors |
2150 | serial . . . . . . $enable_serial | |
2aafb6b9 | 2151 | snmp . . . . . . . $enable_snmp |
86ca149a | 2152 | swap . . . . . . . $enable_swap |
5bc935fb | 2153 | syslog . . . . . . $enable_syslog |
86ca149a | 2154 | tape . . . . . . . $enable_tape |
03b7ec00 | 2155 | tcpconns . . . . . $enable_tcpconns |
86090b3d | 2156 | unixsock . . . . . $enable_unixsock |
0127d402 | 2157 | users . . . . . . . $enable_users |
30f3e7b8 | 2158 | uuid . . . . . . . $enable_uuid |
5e70f2e0 | 2159 | vserver . . . . . . $enable_vserver |
08037975 | 2160 | wireless . . . . . $enable_wireless |
558a6a1c | 2161 | xmms . . . . . . . $enable_xmms |
86ca149a FF |
2162 | |
2163 | EOF |