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