]>
Commit | Line | Data |
---|---|---|
86ca149a | 1 | dnl Process this file with autoconf to produce a configure script. |
005b6639 | 2 | AC_INIT(collectd, 3.11.3) |
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 | ||
15996f86 FF |
10 | # |
11 | # Checks for programs. | |
12 | # | |
86ca149a FF |
13 | AC_PROG_CC |
14 | AC_PROG_CPP | |
15 | AC_PROG_INSTALL | |
16 | AC_PROG_LN_S | |
17 | AC_PROG_MAKE_SET | |
586eed68 | 18 | AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes") |
86ca149a FF |
19 | |
20 | dnl configure libtool | |
21 | AC_DISABLE_STATIC | |
6e765a02 FF |
22 | AC_LIBLTDL_CONVENIENCE |
23 | AC_SUBST(LTDLINCL) | |
24 | AC_SUBST(LIBLTDL) | |
86ca149a FF |
25 | AC_LIBTOOL_DLOPEN |
26 | AC_PROG_LIBTOOL | |
108c20b2 FF |
27 | AC_PROG_LEX |
28 | AC_PROG_YACC | |
bcd78ed9 | 29 | AC_CONFIG_SUBDIRS(libltdl) |
86ca149a | 30 | |
15996f86 FF |
31 | # |
32 | # Checks for header files. | |
33 | # | |
e708ae9b | 34 | AC_HEADER_STDC |
86ca149a | 35 | AC_HEADER_SYS_WAIT |
6e765a02 | 36 | AC_HEADER_DIRENT |
6934b3d0 | 37 | AC_CHECK_HEADERS(stdint.h) |
1842a7a7 | 38 | AC_CHECK_HEADERS(stdio.h) |
586eed68 | 39 | AC_CHECK_HEADERS(errno.h) |
3e481d27 | 40 | AC_CHECK_HEADERS(math.h) |
586eed68 | 41 | AC_CHECK_HEADERS(syslog.h) |
6e765a02 | 42 | AC_CHECK_HEADERS(fcntl.h) |
86ca149a | 43 | AC_CHECK_HEADERS(signal.h) |
586eed68 FF |
44 | AC_CHECK_HEADERS(assert.h) |
45 | AC_CHECK_HEADERS(sys/types.h) | |
86ca149a FF |
46 | AC_CHECK_HEADERS(sys/socket.h) |
47 | AC_CHECK_HEADERS(sys/select.h) | |
63450476 | 48 | AC_CHECK_HEADERS(poll.h) |
86ca149a | 49 | AC_CHECK_HEADERS(netdb.h) |
586eed68 | 50 | AC_CHECK_HEADERS(arpa/inet.h) |
86ca149a | 51 | AC_CHECK_HEADERS(sys/resource.h) |
c988f52c | 52 | AC_CHECK_HEADERS(sys/param.h) |
15996f86 | 53 | |
c9a5b034 | 54 | # For ping library |
6934b3d0 FF |
55 | AC_CHECK_HEADERS(netinet/in_systm.h, [], [], |
56 | [#if HAVE_STDINT_H | |
57 | # include <stdint.h> | |
58 | #endif | |
ac491e03 FF |
59 | #if HAVE_SYS_TYPES_H |
60 | # include <sys/types.h> | |
61 | #endif | |
6934b3d0 | 62 | ]) |
c9a5b034 | 63 | AC_CHECK_HEADERS(netinet/in.h, [], [], |
6934b3d0 FF |
64 | [#if HAVE_STDINT_H |
65 | # include <stdint.h> | |
66 | #endif | |
ac491e03 FF |
67 | #if HAVE_SYS_TYPES_H |
68 | # include <sys/types.h> | |
69 | #endif | |
6934b3d0 | 70 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
71 | # include <netinet/in_systm.h> |
72 | #endif | |
73 | ]) | |
74 | AC_CHECK_HEADERS(netinet/ip.h, [], [], | |
6934b3d0 FF |
75 | [#if HAVE_STDINT_H |
76 | # include <stdint.h> | |
77 | #endif | |
ac491e03 FF |
78 | #if HAVE_SYS_TYPES_H |
79 | # include <sys/types.h> | |
80 | #endif | |
6934b3d0 | 81 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
82 | # include <netinet/in_systm.h> |
83 | #endif | |
84 | #if HAVE_NETINET_IN_H | |
85 | # include <netinet/in.h> | |
86 | #endif | |
87 | ]) | |
88 | AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], | |
6934b3d0 FF |
89 | [#if HAVE_STDINT_H |
90 | # include <stdint.h> | |
91 | #endif | |
ac491e03 FF |
92 | #if HAVE_SYS_TYPES_H |
93 | # include <sys/types.h> | |
94 | #endif | |
6934b3d0 | 95 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
96 | # include <netinet/in_systm.h> |
97 | #endif | |
98 | #if HAVE_NETINET_IN_H | |
99 | # include <netinet/in.h> | |
100 | #endif | |
101 | #if HAVE_NETINET_IP_H | |
102 | # include <netinet/ip.h> | |
103 | #endif | |
104 | ]) | |
105 | AC_CHECK_HEADERS(netinet/ip_var.h, [], [], | |
6934b3d0 FF |
106 | [#if HAVE_STDINT_H |
107 | # include <stdint.h> | |
108 | #endif | |
ac491e03 FF |
109 | #if HAVE_SYS_TYPES_H |
110 | # include <sys/types.h> | |
111 | #endif | |
6934b3d0 | 112 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
113 | # include <netinet/in_systm.h> |
114 | #endif | |
115 | #if HAVE_NETINET_IN_H | |
116 | # include <netinet/in.h> | |
117 | #endif | |
118 | #if HAVE_NETINET_IP_H | |
119 | # include <netinet/ip.h> | |
120 | #endif | |
121 | ]) | |
122 | AC_CHECK_HEADERS(netinet/ip6.h, [], [], | |
6934b3d0 FF |
123 | [#if HAVE_STDINT_H |
124 | # include <stdint.h> | |
125 | #endif | |
6fe07031 FF |
126 | #if HAVE_SYS_TYPES_H |
127 | # include <sys/types.h> | |
128 | #endif | |
6934b3d0 | 129 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
130 | # include <netinet/in_systm.h> |
131 | #endif | |
132 | #if HAVE_NETINET_IN_H | |
133 | # include <netinet/in.h> | |
134 | #endif | |
135 | ]) | |
136 | AC_CHECK_HEADERS(netinet/icmp6.h, [], [], | |
6934b3d0 FF |
137 | [#if HAVE_STDINT_H |
138 | # include <stdint.h> | |
139 | #endif | |
6fe07031 FF |
140 | #if HAVE_SYS_TYPES_H |
141 | # include <sys/types.h> | |
142 | #endif | |
6934b3d0 | 143 | #if HAVE_NETINET_IN_SYSTM_H |
c9a5b034 FF |
144 | # include <netinet/in_systm.h> |
145 | #endif | |
146 | #if HAVE_NETINET_IN_H | |
147 | # include <netinet/in.h> | |
148 | #endif | |
149 | #if HAVE_NETINET_IP6_H | |
150 | # include <netinet/ip6.h> | |
151 | #endif | |
152 | ]) | |
79d36d9e FF |
153 | AC_CHECK_HEADERS(netinet/tcp.h, [], [], |
154 | [#if HAVE_STDINT_H | |
155 | # include <stdint.h> | |
156 | #endif | |
157 | #if HAVE_SYS_TYPES_H | |
158 | # include <sys/types.h> | |
159 | #endif | |
160 | #if HAVE_NETINET_IN_SYSTM_H | |
161 | # include <netinet/in_systm.h> | |
162 | #endif | |
163 | #if HAVE_NETINET_IN_H | |
164 | # include <netinet/in.h> | |
165 | #endif | |
166 | #if HAVE_NETINET_IP_H | |
167 | # include <netinet/ip.h> | |
168 | #endif | |
169 | ]) | |
5b9d0a2b FF |
170 | AC_CHECK_HEADERS(netinet/udp.h, [], [], |
171 | [#if HAVE_STDINT_H | |
172 | # include <stdint.h> | |
173 | #endif | |
174 | #if HAVE_SYS_TYPES_H | |
175 | # include <sys/types.h> | |
176 | #endif | |
177 | #if HAVE_NETINET_IN_SYSTM_H | |
178 | # include <netinet/in_systm.h> | |
179 | #endif | |
180 | #if HAVE_NETINET_IN_H | |
181 | # include <netinet/in.h> | |
182 | #endif | |
183 | #if HAVE_NETINET_IP_H | |
184 | # include <netinet/ip.h> | |
185 | #endif | |
186 | ]) | |
c9a5b034 | 187 | |
e1d497b7 FF |
188 | # For cpu modules |
189 | AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) | |
daf3a589 FF |
190 | AC_CHECK_HEADERS(mach/mach_init.h) |
191 | AC_CHECK_HEADERS(mach/host_priv.h) | |
a0d73172 | 192 | AC_CHECK_HEADERS(mach/mach_error.h) |
907f1439 FF |
193 | AC_CHECK_HEADERS(mach/mach_host.h) |
194 | AC_CHECK_HEADERS(mach/mach_port.h) | |
195 | AC_CHECK_HEADERS(mach/mach_types.h) | |
196 | AC_CHECK_HEADERS(mach/message.h) | |
197 | AC_CHECK_HEADERS(mach/processor_set.h) | |
daf3a589 | 198 | AC_CHECK_HEADERS(mach/processor.h) |
907f1439 FF |
199 | AC_CHECK_HEADERS(mach/processor_info.h) |
200 | AC_CHECK_HEADERS(mach/task.h) | |
201 | AC_CHECK_HEADERS(mach/thread_act.h) | |
202 | AC_CHECK_HEADERS(mach/vm_region.h) | |
203 | AC_CHECK_HEADERS(mach/vm_map.h) | |
204 | AC_CHECK_HEADERS(mach/vm_prot.h) | |
54800675 | 205 | AC_CHECK_HEADERS(mach/vm_statistics.h) |
907f1439 | 206 | AC_CHECK_HEADERS(mach/kern_return.h) |
e1d497b7 | 207 | |
46ed2804 FF |
208 | # For hddtemp module |
209 | AC_CHECK_HEADERS(linux/major.h) | |
210 | ||
dc42e3e0 | 211 | # For the apple_sensors module |
adaf6ca0 FF |
212 | AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h) |
213 | AC_CHECK_HEADERS(IOKit/IOKitLib.h) | |
214 | AC_CHECK_HEADERS(IOKit/IOTypes.h) | |
215 | ||
11265296 FF |
216 | # For the battery plugin |
217 | AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], | |
218 | [ | |
219 | #if HAVE_IOKIT_IOKITLIB_H | |
220 | # include <IOKit/IOKitLib.h> | |
221 | #endif | |
222 | #if HAVE_IOKIT_IOTYPES_H | |
223 | # include <IOKit/IOTypes.h> | |
224 | #endif | |
225 | ]) | |
226 | AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h) | |
227 | ||
ce5ce8ad FF |
228 | # For the `disk' plugin |
229 | AC_CHECK_HEADERS(IOKit/IOBSD.h) | |
230 | AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h) | |
231 | ||
15996f86 FF |
232 | # For load module |
233 | AC_CHECK_HEADERS(sys/loadavg.h) | |
234 | ||
44a3f33a FF |
235 | # For the processes plugin |
236 | AC_CHECK_HEADERS(linux/config.h) | |
237 | ||
daedf582 FF |
238 | # For the swap module |
239 | AC_CHECK_HEADERS(sys/swap.h) | |
240 | ||
15996f86 | 241 | # For users module |
82d65d87 | 242 | AC_CHECK_HEADERS(utmp.h) |
6e481905 | 243 | AC_CHECK_HEADERS(utmpx.h) |
86ca149a | 244 | |
3268a333 | 245 | # For interface plugin |
a05e34a0 | 246 | AC_CHECK_HEADERS(ifaddrs.h) |
cd377858 FF |
247 | AC_CHECK_HEADERS(net/if.h, [], [], |
248 | [ | |
249 | #if HAVE_SYS_TYPES_H | |
250 | # include <sys/types.h> | |
251 | #endif | |
252 | #if HAVE_SYS_SOCKET_H | |
253 | # include <sys/socket.h> | |
254 | #endif | |
255 | ]) | |
a05e34a0 FF |
256 | AC_CHECK_HEADERS(linux/if.h, [], [], |
257 | [ | |
258 | #if HAVE_SYS_TYPES_H | |
259 | # include <sys/types.h> | |
260 | #endif | |
261 | #if HAVE_SYS_SOCKET_H | |
262 | # include <sys/socket.h> | |
263 | #endif | |
264 | ]) | |
265 | AC_CHECK_HEADERS(linux/netdevice.h, [], [], | |
266 | [ | |
267 | #if HAVE_SYS_TYPES_H | |
268 | # include <sys/types.h> | |
269 | #endif | |
270 | #if HAVE_SYS_SOCKET_H | |
271 | # include <sys/socket.h> | |
272 | #endif | |
273 | #if HAVE_LINUX_IF_H | |
274 | # include <linux/if.h> | |
275 | #endif | |
276 | ]) | |
277 | ||
a8025575 FF |
278 | # For apache plugin |
279 | AC_CHECK_HEADERS(curl/curl.h) | |
280 | ||
6e765a02 FF |
281 | # For quota module |
282 | AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h) | |
283 | AC_CHECK_HEADERS(ctype.h) | |
284 | AC_CHECK_HEADERS(limits.h) | |
285 | AC_CHECK_HEADERS(sys/quota.h) | |
286 | AC_CHECK_HEADERS(xfs/xqm.h) | |
287 | ||
288 | # For mount interface | |
289 | AC_CHECK_HEADERS(fs_info.h) | |
290 | AC_CHECK_HEADERS(fshelp.h) | |
291 | AC_CHECK_HEADERS(paths.h) | |
292 | AC_CHECK_HEADERS(mntent.h) | |
293 | AC_CHECK_HEADERS(mnttab.h) | |
294 | AC_CHECK_HEADERS(sys/fstyp.h) | |
295 | AC_CHECK_HEADERS(sys/fs_types.h) | |
296 | AC_CHECK_HEADERS(sys/mntent.h) | |
297 | AC_CHECK_HEADERS(sys/mnttab.h) | |
298 | AC_CHECK_HEADERS(sys/mount.h) | |
299 | AC_CHECK_HEADERS(sys/statfs.h) | |
2d03e4e3 | 300 | AC_CHECK_HEADERS(sys/statvfs.h) |
6e765a02 FF |
301 | AC_CHECK_HEADERS(sys/vfs.h) |
302 | AC_CHECK_HEADERS(sys/vfstab.h) | |
303 | ||
28c5e282 FF |
304 | # For the swap plugin, FreeBSD |
305 | AC_CHECK_HEADERS(kvm.h) | |
306 | ||
fc257d86 SH |
307 | # For the email plugin |
308 | AC_CHECK_HEADERS(linux/un.h, [], [], | |
309 | [ | |
310 | #if HAVE_SYS_SOCKET_H | |
311 | # include <sys/socket.h> | |
312 | #endif | |
313 | ]) | |
314 | AC_CHECK_HEADERS(sys/un.h) | |
8389947b | 315 | AC_CHECK_HEADERS(grp.h) |
fc257d86 | 316 | |
6e765a02 FF |
317 | # For debugging interface (variable number of arguments) |
318 | AC_CHECK_HEADERS(stdarg.h) | |
319 | ||
ec88fb0e FF |
320 | # Regular expressions for the ignorelist. |
321 | AC_CHECK_HEADERS(regex.h) | |
322 | ||
fdfbf887 | 323 | # For the dns plugin |
c4377c1e | 324 | AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h) |
c4377c1e FF |
325 | |
326 | AC_CHECK_HEADERS(net/if_arp.h) | |
9e137cdb | 327 | AC_CHECK_HEADERS(net/if_ppp.h) |
c4377c1e | 328 | AC_CHECK_HEADERS(netinet/if_ether.h) |
dd7a9bc9 | 329 | |
51e70a99 FF |
330 | # For the multimeter plugin |
331 | AC_CHECK_HEADERS(termios.h) | |
332 | AC_CHECK_HEADERS(sys/ioctl.h) | |
333 | ||
8de91034 FF |
334 | # |
335 | # Checking for libraries | |
336 | # | |
86ca149a FF |
337 | AC_CHECK_LIB(m, ext) |
338 | ||
15996f86 FF |
339 | # |
340 | # Checks for typedefs, structures, and compiler characteristics. | |
341 | # | |
86ca149a FF |
342 | AC_C_CONST |
343 | AC_TYPE_PID_T | |
344 | AC_TYPE_SIZE_T | |
7df03651 | 345 | AC_TYPE_UID_T |
86ca149a FF |
346 | AC_HEADER_TIME |
347 | ||
15996f86 FF |
348 | # |
349 | # Checks for library functions. | |
350 | # | |
86ca149a | 351 | AC_PROG_GCC_TRADITIONAL |
6e765a02 | 352 | AC_CHECK_FUNCS(gettimeofday select strdup strtol) |
586eed68 | 353 | AC_CHECK_FUNCS(getaddrinfo getnameinfo) |
86ca149a | 354 | AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen) |
6e765a02 | 355 | AC_CHECK_FUNCS(strncasecmp strcasecmp) |
c988f52c | 356 | AC_CHECK_FUNCS(openlog syslog closelog) |
15996f86 | 357 | |
d89f6dc3 FF |
358 | socket_needs_socket="no" |
359 | AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket))) | |
360 | AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes") | |
361 | ||
4ca5457f FF |
362 | nanosleep_needs_rt="no" |
363 | AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) | |
364 | AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") | |
365 | ||
ec88fb0e FF |
366 | # Regular expressions for the ignorelist. |
367 | AC_CHECK_FUNCS(regcomp regerror regexec regfree) | |
368 | ||
e1d497b7 FF |
369 | # For cpu module |
370 | AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) | |
371 | ||
2d03e4e3 FF |
372 | # For df module |
373 | AC_CHECK_FUNCS(statfs statvfs) | |
374 | ||
15996f86 FF |
375 | # For load module |
376 | AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"]) | |
377 | ||
256810b6 FF |
378 | # For the `processes' plugin |
379 | AC_CHECK_FUNCS(thread_info) | |
380 | ||
15996f86 | 381 | # For users module |
b898eac6 | 382 | AC_CHECK_FUNCS(getutent getutxent) |
86ca149a | 383 | |
6e765a02 FF |
384 | # For quota module |
385 | AC_CHECK_FUNCS(quotactl) | |
386 | AC_CHECK_FUNCS(getgrgid getpwuid) | |
387 | ||
3268a333 | 388 | # For interface module |
a05e34a0 FF |
389 | AC_CHECK_FUNCS(getifaddrs) |
390 | ||
e91c40b8 FF |
391 | # Check for NAN |
392 | nan_type="none" | |
393 | if test "x$nan_type" = "xnone"; then | |
394 | AC_CACHE_CHECK([whether NAN is defined by default], | |
395 | [have_nan_default], | |
396 | AC_COMPILE_IFELSE( | |
397 | AC_LANG_PROGRAM( | |
398 | [[ | |
399 | #include <stdlib.h> | |
400 | #include <math.h> | |
401 | static float foo = NAN; | |
402 | ]], | |
403 | [[ | |
404 | if (isnan (foo)) | |
405 | return 0; | |
406 | else | |
407 | return 1; | |
408 | ]]), | |
409 | [have_nan_default="yes"], | |
410 | [have_nan_default="no"] | |
411 | ) | |
412 | ) | |
413 | if test "x$have_nan_default" = "xyes" | |
414 | then | |
415 | nan_type="default" | |
416 | AC_DEFINE(NAN_STATIC_DEFAULT, 1, | |
417 | [Define if NAN is defined by default and can initialize static variables.]) | |
418 | fi | |
419 | fi | |
420 | if test "x$nan_type" = "xnone"; then | |
421 | AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99], | |
422 | [have_nan_isoc], | |
423 | AC_COMPILE_IFELSE( | |
424 | AC_LANG_PROGRAM( | |
425 | [[ | |
426 | #include <stdlib.h> | |
427 | #define __USE_ISOC99 1 | |
428 | #include <math.h> | |
429 | static float foo = NAN; | |
430 | ]], | |
431 | [[ | |
432 | if (isnan (foo)) | |
433 | return 0; | |
434 | else | |
435 | return 1; | |
436 | ]]), | |
437 | [have_nan_isoc="yes"], | |
438 | [have_nan_isoc="no"] | |
439 | ) | |
440 | ) | |
441 | if test "x$have_nan_isoc" = "xyes" | |
442 | then | |
443 | nan_type="isoc99" | |
444 | AC_DEFINE(NAN_STATIC_ISOC, 1, | |
445 | [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]) | |
446 | fi | |
447 | fi | |
448 | if test "x$nan_type" = "xnone"; then | |
449 | AC_CACHE_CHECK([whether NAN can be defined by 0/0], | |
450 | [have_nan_zero], | |
451 | AC_RUN_IFELSE( | |
452 | AC_LANG_PROGRAM( | |
453 | [[ | |
454 | #include <stdlib.h> | |
455 | #include <math.h> | |
456 | #define NAN (0.0 / 0.0) | |
457 | #ifndef isnan | |
458 | # define isnan(f) ((f) != (f)) | |
459 | #endif | |
460 | static float foo = NAN; | |
461 | ]], | |
462 | [[ | |
463 | if (isnan (foo)) | |
464 | return 0; | |
465 | else | |
466 | return 1; | |
467 | ]]), | |
468 | [have_nan_zero="yes"], | |
469 | [have_nan_zero="no"] | |
470 | ) | |
471 | ) | |
472 | if test "x$have_nan_zero" = "xyes" | |
473 | then | |
474 | nan_type="zero" | |
475 | AC_DEFINE(NAN_ZERO_ZERO, 1, | |
476 | [Define if NAN can be defined as (0.0 / 0.0)]) | |
477 | fi | |
478 | fi | |
479 | if test "x$nan_type" = "xnone"; then | |
480 | AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.]) | |
481 | fi | |
482 | ||
6e765a02 | 483 | # For mount interface |
2dc3f07b FF |
484 | #AC_CHECK_FUNCS(getfsent getvfsent) |
485 | ||
486 | have_getfsstat="no" | |
487 | AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"]) | |
488 | have_getvfsstat="no" | |
489 | AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"]) | |
490 | have_listmntent="no" | |
491 | AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"]) | |
492 | ||
493 | have_getmntent="no" | |
494 | AC_CHECK_FUNCS(getmntent, [have_getmntent="c"]) | |
495 | if test "x$have_getmntent" = "xno"; then | |
496 | AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"]) | |
c9a5b034 | 497 | fi |
2dc3f07b FF |
498 | if test "x$have_getmntent" = "xno"; then |
499 | AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"]) | |
c9a5b034 | 500 | fi |
2dc3f07b FF |
501 | if test "x$have_getmntent" = "xno"; then |
502 | AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"]) | |
c9a5b034 FF |
503 | fi |
504 | ||
2dc3f07b | 505 | if test "x$have_getmntent" = "xc"; then |
6e765a02 | 506 | AC_CACHE_CHECK([whether getmntent takes one argument], |
2dc3f07b | 507 | [have_one_getmntent], |
6e765a02 FF |
508 | AC_COMPILE_IFELSE( |
509 | AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT | |
2dc3f07b | 510 | #include <mntent.h> |
6e765a02 | 511 | #include "$srcdir/src/utils_mount.h"]], |
2dc3f07b FF |
512 | [[ |
513 | FILE *fh; | |
514 | struct mntent *me; | |
515 | fh = setmntent ("/etc/mtab", "r"); | |
516 | me = getmntent (fh); | |
517 | ]] | |
6e765a02 | 518 | ), |
2dc3f07b FF |
519 | [have_one_getmntent="yes"], |
520 | [have_one_getmntent="no"] | |
6e765a02 FF |
521 | ) |
522 | ) | |
2dc3f07b FF |
523 | AC_CACHE_CHECK([whether getmntent takes two arguments], |
524 | [have_two_getmntent], | |
525 | AC_COMPILE_IFELSE( | |
526 | AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT | |
527 | #include <sys/mnttab.h> | |
6e765a02 | 528 | #include "$srcdir/src/utils_mount.h"]], |
2dc3f07b FF |
529 | [[ |
530 | FILE *fh; | |
531 | struct mnttab mt; | |
532 | int status; | |
533 | fh = fopen ("/etc/mnttab", "r"); | |
534 | status = getmntent (fh, &mt); | |
535 | ]] | |
536 | ), | |
537 | [have_two_getmntent="yes"], | |
538 | [have_two_getmntent="no"] | |
6e765a02 | 539 | ) |
2dc3f07b FF |
540 | ) |
541 | fi | |
542 | ||
543 | # Check for different versions of `getmntent' here.. | |
544 | ||
545 | if test "x$have_getmntent" = "xc"; then | |
546 | if test "x$have_one_getmntent" = "xyes"; then | |
547 | AC_DEFINE(HAVE_ONE_GETMNTENT, 1, | |
548 | [Define if the function getmntent exists and takes one argument.]) | |
549 | fi | |
550 | if test "x$have_two_getmntent" = "xyes"; then | |
551 | AC_DEFINE(HAVE_TWO_GETMNTENT, 1, | |
552 | [Define if the function getmntent exists and takes two arguments.]) | |
6e765a02 | 553 | fi |
6e765a02 | 554 | fi |
2dc3f07b FF |
555 | if test "x$have_getmntent" = "xsun"; then |
556 | AC_DEFINE(HAVE_SUN_GETMNTENT, 1, | |
557 | [Define if the function getmntent exists. It's the version from libsun.]) | |
6e765a02 | 558 | fi |
2dc3f07b FF |
559 | if test "x$have_getmntent" = "xseq"; then |
560 | AC_DEFINE(HAVE_SEQ_GETMNTENT, 1, | |
561 | [Define if the function getmntent exists. It's the version from libseq.]) | |
562 | fi | |
563 | if test "x$have_getmntent" = "xgen"; then | |
564 | AC_DEFINE(HAVE_GEN_GETMNTENT, 1, | |
565 | [Define if the function getmntent exists. It's the version from libgen.]) | |
6e765a02 FF |
566 | fi |
567 | ||
a05e34a0 | 568 | # Check for structures |
906bea76 | 569 | AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors], |
a05e34a0 FF |
570 | [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])], |
571 | [], | |
cd377858 FF |
572 | [ |
573 | #include <sys/types.h> | |
574 | #include <sys/socket.h> | |
575 | #include <net/if.h> | |
576 | ]) | |
906bea76 | 577 | AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors], |
a05e34a0 FF |
578 | [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])], |
579 | [], | |
580 | [ | |
581 | #include <sys/types.h> | |
582 | #include <sys/socket.h> | |
583 | #include <linux/if.h> | |
584 | #include <linux/netdevice.h> | |
585 | ]) | |
586 | ||
5b9d0a2b FF |
587 | AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], |
588 | [#if HAVE_STDINT_H | |
589 | # include <stdint.h> | |
590 | #endif | |
591 | #if HAVE_SYS_TYPES_H | |
592 | # include <sys/types.h> | |
593 | #endif | |
594 | #if HAVE_NETINET_IN_SYSTM_H | |
595 | # include <netinet/in_systm.h> | |
596 | #endif | |
597 | #if HAVE_NETINET_IN_H | |
598 | # include <netinet/in.h> | |
599 | #endif | |
600 | #if HAVE_NETINET_IP_H | |
601 | # include <netinet/ip.h> | |
602 | #endif | |
603 | #if HAVE_NETINET_UDP_H | |
604 | # include <netinet/udp.h> | |
605 | #endif | |
606 | ]) | |
607 | AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], | |
608 | [#if HAVE_STDINT_H | |
609 | # include <stdint.h> | |
610 | #endif | |
611 | #if HAVE_SYS_TYPES_H | |
612 | # include <sys/types.h> | |
613 | #endif | |
614 | #if HAVE_NETINET_IN_SYSTM_H | |
615 | # include <netinet/in_systm.h> | |
616 | #endif | |
617 | #if HAVE_NETINET_IN_H | |
618 | # include <netinet/in.h> | |
619 | #endif | |
620 | #if HAVE_NETINET_IP_H | |
621 | # include <netinet/ip.h> | |
622 | #endif | |
623 | #if HAVE_NETINET_UDP_H | |
624 | # include <netinet/udp.h> | |
625 | #endif | |
626 | ]) | |
2aff261d | 627 | |
86ca149a FF |
628 | AC_MSG_CHECKING([for kernel type ($host_os)]) |
629 | case $host_os in | |
630 | *linux*) | |
256810b6 | 631 | AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel]) |
86ca149a FF |
632 | ac_system="Linux" |
633 | ;; | |
634 | *solaris*) | |
256810b6 | 635 | AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel]) |
86ca149a FF |
636 | ac_system="Solaris" |
637 | ;; | |
638 | *) | |
639 | ac_system="unknown" | |
640 | esac | |
641 | AC_MSG_RESULT([$ac_system]) | |
642 | ||
a58af051 FF |
643 | with_libresolv="yes" |
644 | AC_CHECK_LIB(resolv, res_search, | |
645 | [ | |
646 | AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).]) | |
647 | ], | |
648 | [with_libresolv="no"]) | |
649 | AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes") | |
86ca149a | 650 | |
125bdc00 | 651 | |
c27cdba8 NW |
652 | m4_divert_once([HELP_WITH], [ |
653 | collectd additional packages:]) | |
654 | ||
86ca149a | 655 | # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given]) |
3c12e8a6 | 656 | AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])], |
42e281c5 | 657 | [ if test "x$withval" != "xno" && test "x$withval" != "xyes" |
86ca149a FF |
658 | then |
659 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
660 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
661 | with_rrdtool="yes" | |
662 | fi | |
663 | ], [with_rrdtool="yes"]) | |
664 | if test "x$with_rrdtool" = "xyes" | |
665 | then | |
a58af051 FF |
666 | AC_CHECK_LIB(rrd, rrd_update, |
667 | [ | |
668 | AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).]) | |
669 | ], | |
670 | [with_rrdtool="no (librrd not found)"], [-lm]) | |
86ca149a FF |
671 | fi |
672 | if test "x$with_rrdtool" = "xyes" | |
673 | then | |
3c12e8a6 | 674 | AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"]) |
86ca149a | 675 | fi |
b898eac6 NW |
676 | if test "x$with_rrdtool" = "xyes" |
677 | then | |
678 | collect_rrdtool=1 | |
679 | else | |
680 | collect_rrdtool=0 | |
681 | fi | |
682 | AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool], | |
683 | [Wether or not to use rrdtool library]) | |
86ca149a FF |
684 | AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes") |
685 | ||
c4377c1e FF |
686 | AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])], |
687 | [ if test "x$withval" != "xno" -a "x$withval" != "xyes" | |
9e137cdb FF |
688 | then |
689 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
690 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
c4377c1e FF |
691 | with_libpthread="yes" |
692 | else | |
693 | if test "x$withval" = "xno" | |
694 | then | |
695 | with_libpthread="no (disabled)" | |
696 | fi | |
9e137cdb | 697 | fi |
06bafec5 | 698 | ], [with_libpthread="yes"]) |
c4377c1e | 699 | if test "x$with_libpthread" = "xyes" |
9e137cdb | 700 | then |
c4377c1e | 701 | AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], []) |
9e137cdb | 702 | fi |
c4377c1e | 703 | if test "x$with_libpthread" = "xyes" |
9e137cdb | 704 | then |
c4377c1e | 705 | AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"]) |
9e137cdb | 706 | fi |
c4377c1e | 707 | if test "x$with_libpthread" = "xyes" |
9e137cdb FF |
708 | then |
709 | collect_pthread=1 | |
710 | else | |
711 | collect_pthread=0 | |
712 | fi | |
713 | AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], | |
714 | [Wether or not to use pthread (POSIX threads) library]) | |
c4377c1e | 715 | AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") |
6e765a02 | 716 | |
86ca149a FF |
717 | if test "$ac_system" = "Solaris" |
718 | then | |
719 | with_kstat="yes" | |
d89f6dc3 | 720 | with_devinfo="yes" |
3c12e8a6 NW |
721 | else |
722 | with_kstat="no (Solaris only)" | |
d89f6dc3 | 723 | with_devinfo="no (Solaris only)" |
3c12e8a6 | 724 | fi |
d89f6dc3 | 725 | |
3c12e8a6 NW |
726 | if test "x$with_kstat" = "xyes" |
727 | then | |
080df026 | 728 | AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], []) |
3c12e8a6 NW |
729 | fi |
730 | if test "x$with_kstat" = "xyes" | |
731 | then | |
080df026 | 732 | AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], []) |
86ca149a | 733 | AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"]) |
86ca149a | 734 | fi |
b898eac6 NW |
735 | if test "x$with_kstat" = "xyes" |
736 | then | |
27adc320 FF |
737 | AC_DEFINE(HAVE_LIBKSTAT, 1, |
738 | [Define to 1 if you have the 'kstat' library (-lkstat)]) | |
b898eac6 | 739 | fi |
d89f6dc3 FF |
740 | AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") |
741 | AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes") | |
86ca149a | 742 | |
1842a7a7 FF |
743 | ### BEGIN of check for libcurl ### |
744 | with_curl_config="curl-config" | |
745 | with_curl_prefix=0 | |
746 | with_curl_libs="" | |
747 | AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])], | |
748 | [ | |
749 | if test "x$withval" != "xno" -a "x$withval" != "xyes" | |
750 | then | |
751 | if test -x "$withval/bin/curl-config" | |
752 | then | |
753 | with_curl_config="$withval/bin/curl-config" | |
754 | with_curl_prefix=1 | |
755 | fi | |
756 | fi | |
757 | if test "x$withval" = "xno" | |
758 | then | |
759 | with_libcurl="no" | |
760 | else | |
761 | with_libcurl="yes" | |
762 | fi | |
763 | ], | |
764 | [ | |
765 | with_libcurl="yes" | |
766 | ]) | |
767 | if test "x$with_libcurl" = "xyes" | |
768 | then | |
769 | with_curl_libs=`$with_curl_config --libs 2>/dev/null` | |
770 | curl_config_status=$? | |
771 | ||
772 | if test $curl_config_status -ne 0 | |
773 | then | |
774 | with_libcurl="no" | |
775 | else | |
776 | AC_CHECK_LIB(curl, curl_easy_init, | |
777 | [ | |
778 | BUILD_WITH_LIBCURL_LIBS="$with_curl_libs" | |
779 | AC_SUBST(BUILD_WITH_LIBCURL_LIBS) | |
780 | ], | |
781 | [ | |
782 | with_libcurl="no" | |
783 | ], | |
784 | [$with_curl_libs]) | |
785 | fi | |
786 | fi | |
787 | if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0 | |
788 | then | |
789 | with_curl_prefix=`$with_curl_config --libs 2>/dev/null` | |
790 | curl_config_status=$? | |
791 | ||
792 | if test $curl_config_status -ne 0 | |
793 | then | |
794 | with_libcurl="no" | |
795 | else | |
796 | if test -d "$with_curl_prefix/include" | |
797 | then | |
798 | CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include" | |
799 | fi | |
800 | fi | |
801 | fi | |
802 | ||
803 | with_libcurl_numeric=0 | |
804 | if test "x$with_libcurl" = "xyes" | |
805 | then | |
806 | with_libcurl_numeric=1 | |
807 | fi | |
808 | AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).]) | |
809 | AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes") | |
810 | ### END of check for libcurl ### | |
811 | ||
adaf6ca0 FF |
812 | with_libiokit="no" |
813 | collectd_libiokit=0 | |
814 | AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices, | |
815 | [ | |
816 | with_libiokit="yes" | |
817 | collectd_libiokit=1 | |
818 | ], | |
819 | [ | |
820 | with_libiokit="no" | |
821 | collectd_libiokit=0 | |
822 | ]) | |
823 | AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library]) | |
824 | AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes") | |
825 | ||
0aa63f0c FF |
826 | with_libstatgrab="yes" |
827 | with_libdevstat="no" | |
3c12e8a6 | 828 | AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])], |
86ca149a | 829 | [ |
1842a7a7 | 830 | if test "x$withval" != "xno" -a "x$withval" != "xyes" |
86ca149a | 831 | then |
42e281c5 NW |
832 | LDFLAGS="$LDFLAGS -L$withval/lib" |
833 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
834 | with_libstatgrab="yes" | |
86ca149a FF |
835 | fi |
836 | ], | |
837 | [ | |
f830bd02 | 838 | if test "x$ac_system" == "xunknown" |
86ca149a | 839 | then |
86ca149a | 840 | with_libstatgrab="yes" |
f830bd02 NW |
841 | else |
842 | with_libstatgrab="no" | |
86ca149a FF |
843 | fi |
844 | ]) | |
845 | if test "x$with_libstatgrab" = "xyes" | |
846 | then | |
0aa63f0c | 847 | AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"]) |
3c12e8a6 NW |
848 | fi |
849 | if test "x$with_libstatgrab" = "xyes" | |
850 | then | |
176d5f79 | 851 | AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"]) |
86ca149a | 852 | fi |
176d5f79 | 853 | if test "x$with_libstatgrab" = "xyes" |
0aa63f0c FF |
854 | then |
855 | AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"]) | |
0aa63f0c FF |
856 | fi |
857 | if test "x$with_libstatgrab" = "xyes" | |
176d5f79 NW |
858 | then |
859 | collect_libstatgrab=1 | |
860 | else | |
861 | collect_libstatgrab=0 | |
862 | fi | |
863 | AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab], | |
864 | [Wether or not to use statgrab library]) | |
865 | AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes") | |
0aa63f0c | 866 | AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes") |
28c5e282 FF |
867 | |
868 | AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"]) | |
869 | if test "x$with_libkvm" = "xyes" | |
870 | then | |
871 | AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)]) | |
872 | fi | |
873 | AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes") | |
86ca149a | 874 | |
3c12e8a6 | 875 | AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])], |
86ca149a | 876 | [ |
56a554e8 | 877 | if test "x$withval" != "xno" && test "x$withval" != "xyes" |
86ca149a | 878 | then |
56a554e8 NW |
879 | LDFLAGS="$LDFLAGS -L$withval/lib" |
880 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
881 | with_lm_sensors="yes" | |
86ca149a FF |
882 | fi |
883 | ], | |
884 | [ | |
86ca149a FF |
885 | if test "x$ac_system" = "xLinux" |
886 | then | |
887 | with_lm_sensors="yes" | |
888 | else | |
889 | with_lm_sensors="no" | |
890 | fi | |
891 | ]) | |
892 | if test "x$with_lm_sensors" = "xyes" | |
893 | then | |
894 | AC_CHECK_LIB(sensors, sensors_init, | |
895 | [ | |
86ca149a FF |
896 | AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).]) |
897 | ], | |
56a554e8 | 898 | [with_lm_sensors="no (libsensors not found)"]) |
3c12e8a6 NW |
899 | fi |
900 | if test "x$with_lm_sensors" = "xyes" | |
901 | then | |
86ca149a FF |
902 | AC_CHECK_HEADERS(sensors/sensors.h, |
903 | [ | |
86ca149a FF |
904 | AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.]) |
905 | ], | |
56a554e8 NW |
906 | [with_lm_sensors="no (sensors/sensors.h not found)"]) |
907 | fi | |
908 | if test "x$with_lm_sensors" = "xyes" | |
909 | then | |
910 | collect_lm_sensors=1 | |
911 | else | |
912 | collect_lm_sensors=0 | |
86ca149a | 913 | fi |
56a554e8 NW |
914 | AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors], |
915 | [Wether or not to use sensors library]) | |
916 | AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes") | |
86ca149a | 917 | |
e4303e15 FF |
918 | AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])], |
919 | [ | |
920 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
921 | then | |
922 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
923 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
924 | with_libmysql="yes" | |
925 | fi | |
926 | ], | |
927 | [ | |
928 | with_libmysql="yes" | |
929 | ]) | |
930 | if test "x$with_libmysql" = "xyes" | |
931 | then | |
2bb1a064 FF |
932 | AC_CHECK_LIB(mysqlclient, mysql_init, |
933 | [ | |
934 | AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).]) | |
935 | ], [with_libmysql="no (libmysql not found)"]) | |
e4303e15 FF |
936 | fi |
937 | if test "x$with_libmysql" = "xyes" | |
938 | then | |
2bb1a064 FF |
939 | AC_CHECK_HEADERS(mysql/mysql.h, |
940 | [ | |
941 | AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.]) | |
942 | ], [with_libmysql="no (mysql/mysql.h not found)"]) | |
e4303e15 FF |
943 | fi |
944 | if test "x$with_libmysql" = "xyes" | |
945 | then | |
946 | collect_libmysql=1 | |
947 | else | |
948 | collect_libmysql=0 | |
949 | fi | |
950 | AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql], | |
951 | [Wether or not to use mysql library]) | |
952 | AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes") | |
86ca149a | 953 | |
6997fb33 FF |
954 | #with_liboping="yes" |
955 | with_own_liboping="no" | |
956 | liboping_LDFLAGS="$LDFLAGS" | |
957 | liboping_CPPFLAGS="$CPPFLAGS" | |
958 | AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])], | |
959 | [ | |
960 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
961 | then | |
962 | if test -d "$withval/lib" | |
963 | then | |
964 | liboping_LDFLAGS="$LDFLAGS -L$withval/lib" | |
965 | fi | |
966 | if test -d "$withval/include" | |
967 | then | |
968 | liboping_CPPFLAGS="$CPPFLAGS -I$withval/include" | |
969 | fi | |
970 | fi | |
971 | if test "x$withval" = "xno" | |
972 | then | |
973 | with_liboping="no" | |
974 | with_own_liboping="no" | |
975 | fi | |
976 | ], | |
977 | [ | |
978 | #753 | |
979 | with_liboping="yes" | |
980 | ]) | |
981 | ||
982 | if test "x$with_liboping" = "xyes" | |
983 | then | |
984 | save_LDFLAGS="$LDFLAGS" | |
985 | save_CPPFLAGS="$CPPFLAGS" | |
986 | LDFLAGS="$liboping_LDFLAGS" | |
987 | CPPFLAGS="$liboping_CPPFLAGS" | |
988 | AC_CHECK_LIB(oping, ping_construct, | |
989 | [ | |
990 | with_liboping="yes" | |
991 | with_own_liboping="no" | |
992 | ], | |
993 | [ | |
994 | with_liboping="yes" | |
995 | with_own_liboping="yes" | |
996 | LDFLAGS="$save_LDFLAGS" | |
997 | CPPFLAGS="$save_CPPFLAGS" | |
998 | ]) | |
999 | fi | |
1000 | AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes") | |
1001 | AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes") | |
1002 | if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes" | |
1003 | then | |
1004 | with_liboping="yes (shipped version)" | |
1005 | fi | |
1006 | ||
dd7a9bc9 FF |
1007 | AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])], |
1008 | [ | |
1009 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1010 | then | |
1011 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
1012 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1013 | with_libpcap="yes" | |
1014 | fi | |
1015 | ], | |
1016 | [ | |
1017 | with_libpcap="yes" | |
1018 | ]) | |
1019 | if test "x$with_libpcap" = "xyes" | |
1020 | then | |
1021 | AC_CHECK_LIB(pcap, pcap_open_live, | |
1022 | [ | |
1023 | AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).]) | |
1024 | ], [with_libpcap="no (libpcap not found)"]) | |
1025 | fi | |
1026 | if test "x$with_libpcap" = "xyes" | |
1027 | then | |
1028 | AC_CHECK_HEADERS(pcap.h, | |
1029 | [ | |
1030 | AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.]) | |
1031 | ], [with_libpcap="no (pcap.h not found)"]) | |
1032 | fi | |
1033 | if test "x$with_libpcap" = "xyes" | |
1034 | then | |
1035 | collect_libpcap=1 | |
1036 | else | |
1037 | collect_libpcap=0 | |
1038 | fi | |
92f43553 | 1039 | AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap], |
dd7a9bc9 | 1040 | [Wether or not to use the pcap library]) |
92f43553 | 1041 | AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes") |
dd7a9bc9 | 1042 | |
8de91034 FF |
1043 | AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], |
1044 | [ | |
1045 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1046 | then | |
1047 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
1048 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1049 | with_libiptc="yes" | |
1050 | fi | |
1051 | ], | |
1052 | [ | |
1053 | if test "x$ac_system" = "xLinux" | |
1054 | then | |
1055 | with_libiptc="yes" | |
1056 | else | |
1057 | with_libiptc="no (Linux only)" | |
1058 | fi | |
1059 | ]) | |
1060 | if test "x$with_libiptc" = "xyes" | |
1061 | then | |
1062 | AC_CHECK_LIB(iptc, iptc_init, | |
1063 | [ | |
1064 | AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) | |
1065 | ], [with_libiptc="no (libiptc not found)"]) | |
1066 | fi | |
1067 | if test "x$with_libiptc" = "xyes" | |
1068 | then | |
1069 | AC_CHECK_HEADERS(libiptc/libiptc.h, | |
1070 | [ | |
1071 | AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.]) | |
1072 | ], [with_libiptc="no (libiptc/libiptc.h not found)"]) | |
1073 | fi | |
1074 | if test "x$with_libiptc" = "xyes" | |
1075 | then | |
1076 | collect_libiptc=1 | |
1077 | else | |
1078 | collect_libiptc=0 | |
1079 | fi | |
1080 | AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") | |
1081 | ||
bc2d9402 FF |
1082 | AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])], |
1083 | [ | |
1084 | if test "x$withval" != "xno" && test "x$withval" != "xyes" | |
1085 | then | |
1086 | LDFLAGS="$LDFLAGS -L$withval/lib" | |
1087 | CPPFLAGS="$CPPFLAGS -I$withval/include" | |
1088 | with_libupsclient="yes" | |
1089 | fi | |
1090 | ], | |
1091 | [ | |
1092 | with_libupsclient="yes" | |
1093 | ]) | |
1094 | if test "x$with_libupsclient" = "xyes" | |
1095 | then | |
1096 | AC_CHECK_LIB(upsclient, upscli_connect, | |
1097 | [ | |
1098 | AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).]) | |
1099 | ], [with_libupsclient="no (libupsclient not found)"]) | |
1100 | fi | |
1101 | if test "x$with_libupsclient" = "xyes" | |
1102 | then | |
1103 | AC_CHECK_HEADERS(upsclient.h, | |
1104 | [ | |
1105 | AC_DEFINE(HAVE_UPSCLIENT_H, 1, [Define to 1 if you have the <upsclient.h> header file.]) | |
1106 | ], [with_libupsclient="no (upsclient.h not found)"]) | |
1107 | fi | |
1108 | AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes") | |
1109 | ||
86ca149a FF |
1110 | # Check for enabled/disabled features |
1111 | # | |
6e765a02 | 1112 | |
3c12e8a6 NW |
1113 | # AC_COLLECTD(name, enable/disable, info-text, feature/module) |
1114 | # ------------------------------------------------------------ | |
1115 | dnl | |
1116 | m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))]) | |
1117 | dnl | |
1118 | AC_DEFUN( | |
1119 | [AC_COLLECTD], | |
1120 | [ | |
1121 | m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl | |
1122 | m4_if( | |
1123 | [$2], | |
1124 | [enable], | |
1125 | [dnl | |
1126 | m4_define([EnDis],[disabled])dnl | |
1127 | m4_define([YesNo],[no])dnl | |
1128 | ],dnl | |
1129 | [m4_if( | |
1130 | [$2], | |
1131 | [disable], | |
1132 | [dnl | |
1133 | m4_define([EnDis],[enabled])dnl | |
1134 | m4_define([YesNo],[yes])dnl | |
1135 | ], | |
1136 | [dnl | |
1137 | AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl | |
1138 | ]dnl | |
1139 | )]dnl | |
1140 | )dnl | |
1141 | m4_if([$3], [feature], [], | |
1142 | [m4_if( | |
1143 | [$3], [module], [], | |
1144 | [dnl | |
1145 | AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl | |
1146 | ]dnl | |
1147 | )]dnl | |
1148 | )dnl | |
1149 | AC_ARG_ENABLE( | |
1150 | [$1], | |
1151 | AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]), | |
1152 | [], | |
1153 | enable_$1='[YesNo]'dnl | |
1154 | )# AC_ARG_ENABLE | |
1155 | if test "x$enable_$1" = "xno" | |
1156 | then | |
1157 | collectd_$1=0 | |
6e765a02 | 1158 | else |
3c12e8a6 | 1159 | if test "x$enable_$1" = "xyes" |
6e765a02 | 1160 | then |
3c12e8a6 | 1161 | collectd_$1=1 |
6e765a02 | 1162 | else |
3c12e8a6 NW |
1163 | AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.]) |
1164 | collectd_$1=1 | |
1165 | enable_$1='yes' | |
6e765a02 FF |
1166 | fi |
1167 | fi | |
3c12e8a6 NW |
1168 | AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4]) |
1169 | AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl | |
1170 | ]dnl | |
1171 | )# AC_COLLECTD(name, enable/disable, info-text, feature/module) | |
1172 | ||
3c12e8a6 NW |
1173 | m4_divert_once([HELP_ENABLE], [ |
1174 | collectd features:]) | |
3c12e8a6 NW |
1175 | AC_COLLECTD([debug], [enable], [feature], [debugging]) |
1176 | AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) | |
14740db4 | 1177 | AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux]) |
6e765a02 | 1178 | |
f9ee71b2 NW |
1179 | m4_divert_once([HELP_ENABLE], [ |
1180 | collectd modules:]) | |
a8025575 | 1181 | AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics]) |
bfec4e6f | 1182 | AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC]) |
dc42e3e0 | 1183 | AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors]) |
84b0b421 | 1184 | AC_COLLECTD([battery], [disable], [module], [battery statistics]) |
96cf2ccb | 1185 | AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics]) |
55b43947 FF |
1186 | AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics]) |
1187 | AC_COLLECTD([disk], [disable], [module], [disk/partition statistics]) | |
f5b4f424 | 1188 | AC_COLLECTD([csv], [disable], [module], [csv output plugin]) |
2d03e4e3 | 1189 | AC_COLLECTD([df], [disable], [module], [df statistics]) |
fdfbf887 | 1190 | AC_COLLECTD([dns], [disable], [module], [dns statistics]) |
fc257d86 | 1191 | AC_COLLECTD([email], [disable], [module], [email statistics]) |
1cc2a825 | 1192 | AC_COLLECTD([entropy], [disable], [module], [entropy statistics]) |
11770688 | 1193 | AC_COLLECTD([exec], [disable], [module], [exec of external programs]) |
55b43947 | 1194 | AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics]) |
3268a333 | 1195 | AC_COLLECTD([interface], [disable], [module], [interface statistics]) |
863dfcdf | 1196 | AC_COLLECTD([iptables], [disable], [module], [IPtables statistics]) |
f21bcfdc | 1197 | AC_COLLECTD([irq], [disable], [module], [irq statistics]) |
55b43947 | 1198 | AC_COLLECTD([load], [disable], [module], [system load statistics]) |
c8e76316 | 1199 | AC_COLLECTD([mbmon], [disable], [module], [motherboard monitor statistics]) |
55b43947 | 1200 | AC_COLLECTD([memory], [disable], [module], [memory statistics]) |
9a5e1523 | 1201 | AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics]) |
e4303e15 | 1202 | AC_COLLECTD([mysql], [disable], [module], [mysql statistics]) |
63450476 | 1203 | AC_COLLECTD([network], [disable], [module], [network functionality]) |
55b43947 | 1204 | AC_COLLECTD([nfs], [disable], [module], [nfs statistics]) |
ab71d6d2 | 1205 | AC_COLLECTD([ntpd], [disable], [module], [ntpd statistics]) |
bc2d9402 | 1206 | AC_COLLECTD([nut], [disable], [module], [network UPS tools statistics]) |
55b43947 FF |
1207 | AC_COLLECTD([ping], [disable], [module], [ping statistics]) |
1208 | AC_COLLECTD([processes], [disable], [module], [processes statistics]) | |
1209 | AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics]) | |
1210 | AC_COLLECTD([serial], [disable], [module], [serial statistics]) | |
1edbe3e5 | 1211 | AC_COLLECTD([logfile], [disable], [module], [logfile log facility]) |
55b43947 | 1212 | AC_COLLECTD([swap], [disable], [module], [swap statistics]) |
5bc935fb | 1213 | AC_COLLECTD([syslog], [disable], [module], [syslog log facility]) |
55b43947 | 1214 | AC_COLLECTD([tape], [disable], [module], [tape statistics]) |
86090b3d | 1215 | AC_COLLECTD([unixsock], [disable], [module], [UNIX socket plugin]) |
55b43947 | 1216 | AC_COLLECTD([users], [disable], [module], [user count statistics]) |
5e70f2e0 | 1217 | AC_COLLECTD([vserver], [disable], [module], [vserver statistics]) |
08037975 | 1218 | AC_COLLECTD([wireless], [disable], [module], [wireless link statistics]) |
55b43947 | 1219 | |
108c20b2 | 1220 | AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile) |
86ca149a FF |
1221 | |
1222 | cat <<EOF; | |
1223 | ||
1224 | Configuration: | |
1225 | Libraries: | |
a8025575 | 1226 | libcurl . . . . . . $with_libcurl |
adaf6ca0 | 1227 | libiokit . . . . . $with_libiokit |
86ccc162 | 1228 | libiptc . . . . . . $with_libiptc |
86ca149a | 1229 | libkstat . . . . . $with_kstat |
e4303e15 | 1230 | libmysql . . . . . $with_libmysql |
86ccc162 | 1231 | liboping . . . . . $with_liboping |
dd7a9bc9 | 1232 | libpcap . . . . . . $with_libpcap |
c4377c1e | 1233 | libpthread . . . . $with_libpthread |
86ccc162 FF |
1234 | librrd . . . . . . $with_rrdtool |
1235 | libsensors . . . . $with_lm_sensors | |
1236 | libstatgrab . . . . $with_libstatgrab | |
1237 | libupsclient . . . $with_libupsclient | |
86ca149a FF |
1238 | |
1239 | Features: | |
6e765a02 | 1240 | daemon mode . . . . $enable_daemon |
86ccc162 | 1241 | debug . . . . . . . $enable_debug |
6e765a02 FF |
1242 | |
1243 | Modules: | |
11265296 | 1244 | apache . . . . . . $enable_apache |
bfec4e6f | 1245 | apcups . . . . . . $enable_apcups |
11265296 | 1246 | apple_sensors . . . $enable_apple_sensors |
84b0b421 | 1247 | battery . . . . . . $enable_battery |
86ca149a FF |
1248 | cpu . . . . . . . . $enable_cpu |
1249 | cpufreq . . . . . . $enable_cpufreq | |
f5b4f424 | 1250 | csv . . . . . . . . $enable_csv |
2d03e4e3 | 1251 | df . . . . . . . . $enable_df |
86ca149a | 1252 | disk . . . . . . . $enable_disk |
fdfbf887 | 1253 | dns . . . . . . . . $enable_dns |
fc257d86 | 1254 | email . . . . . . . $enable_email |
1cc2a825 | 1255 | entropy . . . . . . $enable_entropy |
11770688 | 1256 | exec . . . . . . . $enable_exec |
86ca149a | 1257 | hddtemp . . . . . . $enable_hddtemp |
3268a333 | 1258 | interface . . . . . $enable_interface |
35248bcc | 1259 | iptables . . . . . $enable_iptables |
3268a333 | 1260 | irq . . . . . . . . $enable_irq |
86ca149a | 1261 | load . . . . . . . $enable_load |
05b7b7e3 | 1262 | logfile . . . . . . $enable_logfile |
c8e76316 | 1263 | mbmon . . . . . . . $enable_mbmon |
86ca149a | 1264 | memory . . . . . . $enable_memory |
9a5e1523 | 1265 | multimeter . . . . $enable_multimeter |
1f2a5bff | 1266 | mysql . . . . . . . $enable_mysql |
63450476 | 1267 | network . . . . . . $enable_network |
86ca149a | 1268 | nfs . . . . . . . . $enable_nfs |
2fa44680 | 1269 | ntpd . . . . . . . $enable_ntpd |
bc2d9402 | 1270 | nut . . . . . . . . $enable_nut |
86ca149a FF |
1271 | ping . . . . . . . $enable_ping |
1272 | processes . . . . . $enable_processes | |
1273 | sensors . . . . . . $enable_sensors | |
1274 | serial . . . . . . $enable_serial | |
1275 | swap . . . . . . . $enable_swap | |
5bc935fb | 1276 | syslog . . . . . . $enable_syslog |
86ca149a | 1277 | tape . . . . . . . $enable_tape |
86090b3d | 1278 | unixsock . . . . . $enable_unixsock |
0127d402 | 1279 | users . . . . . . . $enable_users |
5e70f2e0 | 1280 | vserver . . . . . . $enable_vserver |
08037975 | 1281 | wireless . . . . . $enable_wireless |
86ca149a FF |
1282 | |
1283 | EOF |