ac48b82f5fca71269c0b573b35505a9765792c71
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 3.8.2)
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
6 AC_LANG(C)
8 AC_PREFIX_DEFAULT("/opt/collectd")
10 #
11 # Checks for programs.
12 #
13 AC_PROG_CC
14 AC_PROG_CPP
15 AC_PROG_INSTALL
16 AC_PROG_LN_S
17 AC_PROG_MAKE_SET
18 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
20 dnl configure libtool
21 AC_DISABLE_STATIC
22 AC_LIBLTDL_CONVENIENCE
23 AC_SUBST(LTDLINCL)
24 AC_SUBST(LIBLTDL)
25 AC_LIBTOOL_DLOPEN
26 AC_PROG_LIBTOOL
27 #AC_PROG_RANLIB
28 AC_CONFIG_SUBDIRS(libltdl src/libconfig)
30 #
31 # Checks for header files.
32 #
33 AC_HEADER_STDC
34 AC_HEADER_SYS_WAIT
35 AC_HEADER_DIRENT
36 AC_CHECK_HEADERS(stdint.h)
37 AC_CHECK_HEADERS(errno.h)
38 AC_CHECK_HEADERS(math.h)
39 AC_CHECK_HEADERS(syslog.h)
40 AC_CHECK_HEADERS(fcntl.h)
41 AC_CHECK_HEADERS(signal.h)
42 AC_CHECK_HEADERS(assert.h)
43 AC_CHECK_HEADERS(sys/types.h)
44 AC_CHECK_HEADERS(sys/socket.h)
45 AC_CHECK_HEADERS(sys/select.h)
46 AC_CHECK_HEADERS(netdb.h)
47 AC_CHECK_HEADERS(arpa/inet.h)
48 AC_CHECK_HEADERS(sys/resource.h)
49 AC_CHECK_HEADERS(sys/param.h)
51 # For ping library
52 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
53 [#if HAVE_STDINT_H
54 # include <stdint.h>
55 #endif
56 ])
57 AC_CHECK_HEADERS(netinet/in.h, [], [],
58 [#if HAVE_STDINT_H
59 # include <stdint.h>
60 #endif
61 #if HAVE_NETINET_IN_SYSTM_H
62 # include <netinet/in_systm.h>
63 #endif
64 ])
65 AC_CHECK_HEADERS(netinet/ip.h, [], [],
66 [#if HAVE_STDINT_H
67 # include <stdint.h>
68 #endif
69 #if HAVE_NETINET_IN_SYSTM_H
70 # include <netinet/in_systm.h>
71 #endif
72 #if HAVE_NETINET_IN_H
73 # include <netinet/in.h>
74 #endif
75 ])
76 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
77 [#if HAVE_STDINT_H
78 # include <stdint.h>
79 #endif
80 #if HAVE_NETINET_IN_SYSTM_H
81 # include <netinet/in_systm.h>
82 #endif
83 #if HAVE_NETINET_IN_H
84 # include <netinet/in.h>
85 #endif
86 #if HAVE_NETINET_IP_H
87 # include <netinet/ip.h>
88 #endif
89 ])
90 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
91 [#if HAVE_STDINT_H
92 # include <stdint.h>
93 #endif
94 #if HAVE_NETINET_IN_SYSTM_H
95 # include <netinet/in_systm.h>
96 #endif
97 #if HAVE_NETINET_IN_H
98 # include <netinet/in.h>
99 #endif
100 #if HAVE_NETINET_IP_H
101 # include <netinet/ip.h>
102 #endif
103 ])
104 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
105 [#if HAVE_STDINT_H
106 # include <stdint.h>
107 #endif
108 #if HAVE_SYS_TYPES_H
109 # include <sys/types.h>
110 #endif
111 #if HAVE_NETINET_IN_SYSTM_H
112 # include <netinet/in_systm.h>
113 #endif
114 #if HAVE_NETINET_IN_H
115 # include <netinet/in.h>
116 #endif
117 ])
118 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
119 [#if HAVE_STDINT_H
120 # include <stdint.h>
121 #endif
122 #if HAVE_SYS_TYPES_H
123 # include <sys/types.h>
124 #endif
125 #if HAVE_NETINET_IN_SYSTM_H
126 # include <netinet/in_systm.h>
127 #endif
128 #if HAVE_NETINET_IN_H
129 # include <netinet/in.h>
130 #endif
131 #if HAVE_NETINET_IP6_H
132 # include <netinet/ip6.h>
133 #endif
134 ])
136 # For cpu modules
137 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
139 # For load module
140 AC_CHECK_HEADERS(sys/loadavg.h)
142 # For users module
143 AC_CHECK_HEADERS(utmp.h)
144 AC_CHECK_HEADERS(utmpx.h)
146 # For apache plugin
147 AC_CHECK_HEADERS(curl/curl.h)
149 # For quota module
150 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
151 AC_CHECK_HEADERS(ctype.h)
152 AC_CHECK_HEADERS(limits.h)
153 AC_CHECK_HEADERS(sys/quota.h)
154 AC_CHECK_HEADERS(xfs/xqm.h)
156 # For mount interface
157 AC_CHECK_HEADERS(fs_info.h)
158 AC_CHECK_HEADERS(fshelp.h)
159 AC_CHECK_HEADERS(paths.h)
160 AC_CHECK_HEADERS(mntent.h)
161 AC_CHECK_HEADERS(mnttab.h)
162 AC_CHECK_HEADERS(sys/fstyp.h)
163 AC_CHECK_HEADERS(sys/fs_types.h)
164 AC_CHECK_HEADERS(sys/mntent.h)
165 AC_CHECK_HEADERS(sys/mnttab.h)
166 AC_CHECK_HEADERS(sys/mount.h)
167 AC_CHECK_HEADERS(sys/statfs.h)
168 AC_CHECK_HEADERS(sys/statvfs.h)
169 AC_CHECK_HEADERS(sys/vfs.h)
170 AC_CHECK_HEADERS(sys/vfstab.h)
172 # For debugging interface (variable number of arguments)
173 AC_CHECK_HEADERS(stdarg.h)
175 dnl Checking for libraries
176 AC_CHECK_LIB(m, ext)
178 #
179 # Checks for typedefs, structures, and compiler characteristics.
180 #
181 AC_C_CONST
182 AC_TYPE_PID_T
183 AC_TYPE_SIZE_T
184 AC_TYPE_UID_T
185 AC_HEADER_TIME
187 #
188 # Checks for library functions.
189 #
190 AC_PROG_GCC_TRADITIONAL
191 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
192 AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
193 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
194 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
195 AC_CHECK_FUNCS(strncasecmp strcasecmp)
196 AC_CHECK_FUNCS(openlog syslog closelog)
198 # For cpu module
199 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
201 # For df module
202 AC_CHECK_FUNCS(statfs statvfs)
204 # For load module
205 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
207 # For users module
208 AC_CHECK_FUNCS(getutent getutxent)
210 # For quota module
211 AC_CHECK_FUNCS(quotactl)
212 AC_CHECK_FUNCS(getgrgid getpwuid)
214 # For mount interface
215 AC_CHECK_FUNCS(getfsent getvfsent listmntent)
216 AC_CHECK_FUNCS(getfsstat)
218 # Check for different versions of `getmntent' here..
219 AC_FUNC_GETMNTENT
220 if test "x$ac_cv_lib_sun_getmntent" = "xyes"
221 then
222 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
223 [Define if the function getmntent exists. It's the version from libsun.])
224 fi
225 if test "x$ac_cv_lib_seq_getmntent" = "xyes"
226 then
227 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
228 [Define if the function getmntent exists. It's the version from libseq.])
229 fi
230 if test "x$ac_cv_lib_gen_getmntent" = "xyes"
231 then
232 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
233 [Define if the function getmntent exists. It's the version from libgen.])
234 fi
236 if test "x$ac_cv_func_getmntent" = "xyes"; then
237 saveCFLAGS="$CFLAGS"
238 CFLAGS="-Wall -Werror $CFLAGS"
239 AC_CACHE_CHECK([whether getmntent takes one argument],
240 [fu_cv_getmntent1],
241 AC_COMPILE_IFELSE(
242 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
243 #include "$srcdir/src/utils_mount.h"]],
244 [[(void)getmntent((FILE *)NULL);]]
245 ),
246 [fu_cv_getmntent1=yes],
247 [fu_cv_getmntent1=no]
248 )
249 )
250 if test "x$fu_cv_getmntent1" = "xno"; then
251 AC_CACHE_CHECK([whether getmntent takes two arguments],
252 [fu_cv_getmntent2],
253 AC_COMPILE_IFELSE(
254 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
255 #include "$srcdir/src/utils_mount.h"]],
256 [[(void)getmntent((FILE *)NULL,
257 (struct mnttab *)NULL);]]
258 ),
259 [fu_cv_getmntent2=yes],
260 [fu_cv_getmntent2=no]
261 )
262 )
263 fi
264 CFLAGS="$saveCFLAGS"
265 fi
266 if test "x$fu_cv_getmntent1" = "xyes"; then
267 AC_DEFINE(HAVE_GETMNTENT1,
268 1,
269 [Define if there is a function named getmntent
270 for reading the list of mounted filesystems, and
271 that function takes a single argument. (4.3BSD,
272 SunOS, HP-UX, Dynix, Irix, Linux)]
273 )
274 fi
275 if test "x$fu_cv_getmntent2" = "xyes"; then
276 AC_DEFINE(HAVE_GETMNTENT2,
277 1,
278 [Define if there is a function named getmntent
279 for reading the list of mounted filesystems, and
280 that function takes two arguments. (SVR4)]
281 )
282 fi
284 AC_MSG_CHECKING([for kernel type ($host_os)])
285 case $host_os in
286 *linux*)
287 AC_DEFINE([KERNEL_LINUX], [], [True if program is to be compiled for a Linux kernel])
288 ac_system="Linux"
289 ;;
290 *solaris*)
291 AC_DEFINE([KERNEL_SOLARIS], [], [True if program is to be compiled for a Solaris kernel])
292 ac_system="Solaris"
293 ;;
294 *)
295 ac_system="unknown"
296 esac
297 AC_MSG_RESULT([$ac_system])
299 with_libsocket="yes"
300 AC_CHECK_LIB(socket, socket,
301 [
302 AC_DEFINE(HAVE_LIBSOCKET, 1, [Define to 1 if you have the 'socket' library (-lsocket).])
303 ],
304 [with_libsocket="no"])
305 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$with_libsocket" = "xyes")
307 with_libresolv="yes"
308 AC_CHECK_LIB(resolv, res_search,
309 [
310 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
311 ],
312 [with_libresolv="no"])
313 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
315 with_libcurl="yes"
316 AC_CHECK_LIB(curl, curl_easy_init,
317 [
318 AC_DEFINE(HAVE_LIBCURL, 1, [Define to 1 if you have the 'curl' library (-lcurl).])
319 ],
320 [with_libcurl="no"])
321 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
323 if test "x$with_libcurl" = "xyes"
324 then
325 with_libcurl_libs=`curl-config --libs`
326 if test "x$with_libcurl_libs" != "x"
327 then
328 BUILD_WITH_LIBCURL_LIBS="$with_libcurl_libs";
329 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
330 fi
331 fi
333 m4_divert_once([HELP_WITH], [
334 collectd additional packages:])
336 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
337 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
338 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
339 then
340 LDFLAGS="$LDFLAGS -L$withval/lib"
341 CPPFLAGS="$CPPFLAGS -I$withval/include"
342 with_rrdtool="yes"
343 fi
344 ], [with_rrdtool="yes"])
345 if test "x$with_rrdtool" = "xyes"
346 then
347 AC_CHECK_LIB(rrd, rrd_update,
348 [
349 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
350 ],
351 [with_rrdtool="no (librrd not found)"], [-lm])
352 fi
353 if test "x$with_rrdtool" = "xyes"
354 then
355 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
356 fi
357 if test "x$with_rrdtool" = "xyes"
358 then
359 collect_rrdtool=1
360 else
361 collect_rrdtool=0
362 fi
363 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
364 [Wether or not to use rrdtool library])
365 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
367 #AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]),
368 #[ if test "x$withval" != "xno" && test "x$withval" != "xyes"
369 # then
370 # LDFLAGS="$LDFLAGS -L$withval/lib"
371 # CPPFLAGS="$CPPFLAGS -I$withval/include"
372 # with_pth="yes"
373 # fi
374 #], [with_pth="no"])
375 #if test "x$with_pth" = "xyes"
376 #then
377 # AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], [])
378 #fi
379 #if test "x$with_pth" = "xyes"
380 #then
381 # AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"])
382 #fi
383 #if test "x$with_pth" = "xyes"
384 #then
385 # collect_pth=1
386 #else
387 # collect_pth=0
388 #fi
389 #AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth],
390 # [Wether or not to use pth (portable threads) library])
391 #AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes")
393 if test "$ac_system" = "Solaris"
394 then
395 with_kstat="yes"
396 else
397 with_kstat="no (Solaris only)"
398 fi
399 if test "x$with_kstat" = "xyes"
400 then
401 AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"])
402 fi
403 if test "x$with_kstat" = "xyes"
404 then
405 AC_CHECK_LIB(devinfo, di_init)
406 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
407 fi
408 if test "x$with_kstat" = "xyes"
409 then
410 collect_kstat=1
411 else
412 collect_kstat=0
413 fi
414 AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat],
415 [Wether or not to use kstat library (Solaris)])
416 AM_CONDITIONAL(BUILD_WITH_KSTAT, test "x$with_kstat" = "xyes")
418 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
419 [
420 if test "x$withval" != "xno" && test "x$withval" != "xyes"
421 then
422 LDFLAGS="$LDFLAGS -L$withval/lib"
423 CPPFLAGS="$CPPFLAGS -I$withval/include"
424 with_libstatgrab="yes"
425 fi
426 ],
427 [
428 if test "x$ac_system" == "xunknown"
429 then
430 with_libstatgrab="yes"
431 else
432 with_libstatgrab="no"
433 fi
434 ])
435 if test "x$with_libstatgrab" = "xyes"
436 then
437 AC_CHECK_LIB(devstat, getdevs)
438 AC_CHECK_LIB(kvm, kvm_getargv)
439 AC_CHECK_LIB(statgrab, sg_init,, [with_libstatgrab="no (libstatgrab not found)"])
440 fi
441 if test "x$with_libstatgrab" = "xyes"
442 then
443 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
444 fi
445 if test "x$with_libstatgrab" = "xyes"
446 then
447 collect_libstatgrab=1
448 else
449 collect_libstatgrab=0
450 fi
451 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
452 [Wether or not to use statgrab library])
453 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
455 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
456 [
457 if test "x$withval" != "xno" && test "x$withval" != "xyes"
458 then
459 LDFLAGS="$LDFLAGS -L$withval/lib"
460 CPPFLAGS="$CPPFLAGS -I$withval/include"
461 with_lm_sensors="yes"
462 fi
463 ],
464 [
465 if test "x$ac_system" = "xLinux"
466 then
467 with_lm_sensors="yes"
468 else
469 with_lm_sensors="no"
470 fi
471 ])
472 if test "x$with_lm_sensors" = "xyes"
473 then
474 AC_CHECK_LIB(sensors, sensors_init,
475 [
476 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
477 ],
478 [with_lm_sensors="no (libsensors not found)"])
479 fi
480 if test "x$with_lm_sensors" = "xyes"
481 then
482 AC_CHECK_HEADERS(sensors/sensors.h,
483 [
484 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
485 ],
486 [with_lm_sensors="no (sensors/sensors.h not found)"])
487 fi
488 if test "x$with_lm_sensors" = "xyes"
489 then
490 collect_lm_sensors=1
491 else
492 collect_lm_sensors=0
493 fi
494 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
495 [Wether or not to use sensors library])
496 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
498 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
499 [
500 if test "x$withval" != "xno" && test "x$withval" != "xyes"
501 then
502 LDFLAGS="$LDFLAGS -L$withval/lib"
503 CPPFLAGS="$CPPFLAGS -I$withval/include"
504 with_libmysql="yes"
505 fi
506 ],
507 [
508 with_libmysql="yes"
509 ])
510 if test "x$with_libmysql" = "xyes"
511 then
512 AC_CHECK_LIB(mysqlclient, mysql_init,
513 [
514 AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
515 ], [with_libmysql="no (libmysql not found)"])
516 fi
517 if test "x$with_libmysql" = "xyes"
518 then
519 AC_CHECK_HEADERS(mysql/mysql.h,
520 [
521 AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
522 ], [with_libmysql="no (mysql/mysql.h not found)"])
523 fi
524 if test "x$with_libmysql" = "xyes"
525 then
526 collect_libmysql=1
527 else
528 collect_libmysql=0
529 fi
530 AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
531 [Wether or not to use mysql library])
532 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
534 # Define `step' and `hearbeat' values..
535 declare -i collectd_step=10
536 declare -i collectd_heartbeat=25
537 AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
538 [
539 if test "x$withval" != "xno" -a "x$withval" != "xyes"
540 then
541 declare -i tmp_collectd_step="$withval"
542 if test $tmp_collectd_step -gt 0
543 then
544 collectd_step=$tmp_collectd_step
545 let "collectd_heartbeat=$collectd_step*2"
546 fi
547 fi
548 ], [])
549 AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
550 [
551 if test "x$withval" != "xno" -a "x$withval" != "xyes"
552 then
553 declare -i tmp_collectd_heartbeat="$withval"
554 if test $tmp_collectd_heartbeat -gt 0
555 then
556 collectd_heartbeat=$tmp_collectd_heartbeat
557 fi
558 fi
559 ], [])
561 if test $collectd_step -ne 10
562 then
563 AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
564 fi
565 if test $collectd_heartbeat -ne 25
566 then
567 AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
568 fi
570 #
571 # Check for enabled/disabled features
572 #
574 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
575 # ------------------------------------------------------------
576 dnl
577 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
578 dnl
579 AC_DEFUN(
580 [AC_COLLECTD],
581 [
582 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
583 m4_if(
584 [$2],
585 [enable],
586 [dnl
587 m4_define([EnDis],[disabled])dnl
588 m4_define([YesNo],[no])dnl
589 ],dnl
590 [m4_if(
591 [$2],
592 [disable],
593 [dnl
594 m4_define([EnDis],[enabled])dnl
595 m4_define([YesNo],[yes])dnl
596 ],
597 [dnl
598 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
599 ]dnl
600 )]dnl
601 )dnl
602 m4_if([$3], [feature], [],
603 [m4_if(
604 [$3], [module], [],
605 [dnl
606 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
607 ]dnl
608 )]dnl
609 )dnl
610 AC_ARG_ENABLE(
611 [$1],
612 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
613 [],
614 enable_$1='[YesNo]'dnl
615 )# AC_ARG_ENABLE
616 if test "x$enable_$1" = "xno"
617 then
618 collectd_$1=0
619 else
620 if test "x$enable_$1" = "xyes"
621 then
622 collectd_$1=1
623 else
624 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
625 collectd_$1=1
626 enable_$1='yes'
627 fi
628 fi
629 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
630 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
631 ]dnl
632 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
634 m4_divert_once([HELP_ENABLE], [
635 collectd features:])
636 AC_COLLECTD([debug], [enable], [feature], [debugging])
637 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
639 m4_divert_once([HELP_ENABLE], [
640 collectd modules:])
641 AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics])
642 AC_COLLECTD([battery], [disable], [module], [battery statistics])
643 AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
644 AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
645 AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
646 AC_COLLECTD([df], [disable], [module], [df statistics])
647 AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
648 AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
649 AC_COLLECTD([load], [disable], [module], [system load statistics])
650 AC_COLLECTD([memory], [disable], [module], [memory statistics])
651 AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
652 AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
653 AC_COLLECTD([ping], [disable], [module], [ping statistics])
654 AC_COLLECTD([processes], [disable], [module], [processes statistics])
655 AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics])
656 AC_COLLECTD([serial], [disable], [module], [serial statistics])
657 AC_COLLECTD([swap], [disable], [module], [swap statistics])
658 AC_COLLECTD([tape], [disable], [module], [tape statistics])
659 AC_COLLECTD([traffic], [disable], [module], [system traffic statistics])
660 AC_COLLECTD([users], [disable], [module], [user count statistics])
661 AC_COLLECTD([vserver], [disable], [module], [vserver statistics])
662 AC_COLLECTD([wireless], [disable], [module], [wireless link statistics])
664 #m4_divert_once([HELP_ENABLE], [
665 #collectd modules:])
666 #AC_ARG_ENABLE(cpu, AC_HELP_STRING([--disable-cpu], [Disable CPU usage statistics]),, [enable_cpu="yes"])
667 #if test "x$enable_cpu" != "xno"
668 #then
669 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$have_sysctlbyname" = "xyes"
670 # then
671 # enable_cpu="yes"
672 # else
673 # enable_cpu="no"
674 # fi
675 #fi
676 #if test "x$enable_cpu" = "xno"
677 #then
678 # AC_DEFINE(COLLECT_CPU, 0, [Wether or not to collect CPU usage statistics])
679 #fi
680 #AM_CONDITIONAL(BUILD_MODULE_CPU, test "x$enable_cpu" = "xyes")
682 #AC_ARG_ENABLE(cpufreq, AC_HELP_STRING([--disable-cpufreq], [Disable system cpu frequency statistics]),, [enable_cpufreq="yes"])
683 #if test "x$enable_cpufreq" != "xno"
684 #then
685 # if test "x$ac_system" = "xLinux"
686 # then
687 # enable_cpufreq="yes"
688 # else
689 # enable_cpufreq="no"
690 # fi
691 #fi
692 #if test "x$enable_cpufreq" = "xno"
693 #then
694 # AC_DEFINE(COLLECT_CPUFREQ, 0, [Wether or not to collect cpu frequency statistics])
695 #fi
696 #AM_CONDITIONAL(BUILD_MODULE_CPUFREQ, test "x$enable_cpufreq" = "xyes")
698 #AC_ARG_ENABLE(disk, AC_HELP_STRING([--disable-disk], [Disable disk/partition statistics]),, [enable_disk="yes"])
699 #if test "x$enable_disk" != "xno"
700 #then
701 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes"
702 # then
703 # enable_disk="yes"
704 # else
705 # enable_disk="no"
706 # fi
707 #fi
708 #if test "x$enable_disk" = "xno"
709 #then
710 # AC_DEFINE(COLLECT_DISK, 0, [Wether or not to collect diskstats])
711 #fi
712 #AM_CONDITIONAL(BUILD_MODULE_DISK, test "x$enable_disk" = "xyes")
714 #AC_ARG_ENABLE(hddtemp, AC_HELP_STRING([--disable-hddtemp], [Disable hdd temperature statistics]),, [enable_hddtemp="yes"])
715 #if test "x$enable_hddtemp" = "xno"
716 #then
717 # AC_DEFINE(COLLECT_HDDTEMP, 0, [Wether or not to collect hdd temperature statistics])
718 #fi
719 #AM_CONDITIONAL(BUILD_MODULE_HDDTEMP, test "x$enable_hddtemp" = "xyes")
721 #AC_ARG_ENABLE(load, AC_HELP_STRING([--disable-load], [Disable system load statistics]),, [enable_load="yes"])
722 #if test "x$enable_load" != "xno"
723 #then
724 # if test "x$have_getloadavg" = "xyes" -o "x$ac_system" = "xLinux" -o "x$with_libstatgrab" = "xyes"
725 # then
726 # enable_load="yes"
727 # else
728 # enable_load="no"
729 # fi
730 #fi
731 #if test "x$enable_load" = "xno"
732 #then
733 # AC_DEFINE(COLLECT_LOAD, 0, [Wether or not to collect system load statistics])
734 #fi
735 #AM_CONDITIONAL(BUILD_MODULE_LOAD, test "x$enable_load" = "xyes")
737 #AC_ARG_ENABLE(memory, AC_HELP_STRING([--disable-memory], [Disable memory statistics]),, [enable_memory="yes"])
738 #if test "x$enable_memory" != "xno"
739 #then
740 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
741 # then
742 # enable_memory="yes"
743 # else
744 # enable_memory="no"
745 # fi
746 #fi
747 #if test "x$enable_memory" = "xno"
748 #then
749 # AC_DEFINE(COLLECT_MEMORY, 0, [Wether or not to collect memory statistics])
750 #fi
751 #AM_CONDITIONAL(BUILD_MODULE_MEMORY, test "x$enable_memory" = "xyes")
753 #AC_ARG_ENABLE(nfs, AC_HELP_STRING([--disable-nfs], [Disable nfs statistics]),, [enable_nfs="yes"])
754 #if test "x$enable_nfs" != "xno"
755 #then
756 # if test "x$ac_system" = "xLinux"
757 # then
758 # enable_nfs="yes"
759 # else
760 # enable_nfs="no"
761 # fi
762 #fi
763 #if test "x$enable_nfs" = "xno"
764 #then
765 # AC_DEFINE(COLLECT_NFS, 0, [Wether or not to collect nfs statistics])
766 #fi
767 #AM_CONDITIONAL(BUILD_MODULE_NFS, test "x$enable_nfs" = "xyes")
769 #AC_ARG_ENABLE(ping, AC_HELP_STRING([--disable-ping], [Disable ping statistics]),, [enable_ping="yes"])
770 #if test "x$enable_ping" != "xno"
771 #then
772 # enable_ping="yes"
773 #fi
774 #if test "x$enable_ping" = "xno"
775 #then
776 # AC_DEFINE(COLLECT_PING, 0, [Wether or not to collect ping statistics])
777 #fi
778 #AM_CONDITIONAL(BUILD_MODULE_PING, test "x$enable_ping" = "xyes")
780 #AC_ARG_ENABLE(processes, AC_HELP_STRING([--disable-processes], [Disable processes statistics]),, [enable_processes="yes"])
781 #if test "x$enable_processes" != "xno"
782 #then
783 # if test "x$ac_system" = "xLinux"
784 # then
785 # enable_processes="yes"
786 # else
787 # enable_processes="no"
788 # fi
789 #fi
790 #if test "x$enable_processes" = "xno"
791 #then
792 # AC_DEFINE(COLLECT_PROCESSES, 0, [Wether or not to collect processes statistics])
793 #fi
794 #AM_CONDITIONAL(BUILD_MODULE_PROCESSES, test "x$enable_processes" = "xyes")
796 ##AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
798 #AC_ARG_ENABLE(sensors, AC_HELP_STRING([--disable-sensors], [Disable lm_sensors statistics]),, [enable_sensors=$with_lm_sensors])
799 #if test "x$enable_sensors" != "xno"
800 #then
801 # if test "x$with_lm_sensors" = "xyes"
802 # then
803 # enable_sensors="yes"
804 # else
805 # enable_sensors="no"
806 # fi
807 #fi
808 #if test "x$enable_sensors" = "xno"
809 #then
810 # AC_DEFINE(COLLECT_SENSORS, 0, [Wether or not to collect lm_sensors statistics])
811 #fi
812 #AM_CONDITIONAL(BUILD_MODULE_SENSORS, test "x$enable_sensors" = "xyes")
814 #AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [Disable serial statistics]),, [enable_serial="yes"])
815 #if test "x$enable_serial" != "xno"
816 #then
817 # if test "x$ac_system" = "xLinux"
818 # then
819 # enable_serial="yes"
820 # else
821 # enable_serial="no"
822 # fi
823 #fi
824 #if test "x$enable_serial" = "xno"
825 #then
826 # AC_DEFINE(COLLECT_SERIAL, 0, [Wether or not to collect serial statistics])
827 #fi
828 #AM_CONDITIONAL(BUILD_MODULE_SERIAL, test "x$enable_serial" = "xyes")
830 #AC_ARG_ENABLE(swap, AC_HELP_STRING([--disable-swap], [Disable swap statistics]),, [enable_swap="yes"])
831 #if test "x$enable_swap" != "xno"
832 #then
833 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
834 # then
835 # enable_swap="yes"
836 # else
837 # enable_swap="no"
838 # fi
839 #fi
840 #if test "x$enable_swap" = "xno"
841 #then
842 # AC_DEFINE(COLLECT_SWAP, 0, [Wether or not to collect swap statistics])
843 #fi
844 #AM_CONDITIONAL(BUILD_MODULE_SWAP, test "x$enable_swap" = "xyes")
846 #AC_ARG_ENABLE(tape, AC_HELP_STRING([--disable-tape], [Disable tape statistics]),, [enable_tape="yes"])
847 #if test "x$enable_tape" != "xno"
848 #then
849 # if test "x$with_kstat" = "xyes"
850 # then
851 # enable_tape="yes"
852 # else
853 # enable_tape="no"
854 # fi
855 #fi
856 #if test "x$enable_tape" = "xno"
857 #then
858 # AC_DEFINE(COLLECT_TAPE, 0, [Wether or not to collect tape statistics])
859 #fi
860 #AM_CONDITIONAL(BUILD_MODULE_TAPE, test "x$enable_tape" = "xyes")
862 #AC_ARG_ENABLE(traffic, AC_HELP_STRING([--disable-traffic], [Disable system traffic statistics]),, [enable_traffic="yes"])
863 #if test "x$enable_traffic" != "xno"
864 #then
865 # if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
866 # then
867 # enable_traffic="yes"
868 # else
869 # enable_traffic="no"
870 # fi
871 #fi
872 #if test "x$enable_traffic" = "xno"
873 #then
874 # AC_DEFINE(COLLECT_TRAFFIC, 0, [Wether or not to collect network traffic statistics])
875 #fi
876 #AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes")
878 #AC_COLLECTD([users], [disable], [module], [user count statistics])
880 AC_OUTPUT(Makefile src/libconfig/Makefile src/liboping/Makefile src/Makefile)
882 cat <<EOF;
884 Configuration:
885 Libraries:
886 libcurl . . . . . . $with_libcurl
887 librrd . . . . . . $with_rrdtool
888 lm_sensors . . . . $with_lm_sensors
889 libstatgrab . . . . $with_libstatgrab
890 libkstat . . . . . $with_kstat
891 libmysql . . . . . $with_libmysql
893 Features:
894 debug . . . . . . . $enable_debug
895 daemon mode . . . . $enable_daemon
896 step . . . . . . . $collectd_step seconds
897 heartbeat . . . . . $collectd_heartbeat seconds
899 Modules:
900 battery . . . . . . $enable_battery
901 cpu . . . . . . . . $enable_cpu
902 cpufreq . . . . . . $enable_cpufreq
903 df . . . . . . . . $enable_df
904 disk . . . . . . . $enable_disk
905 hddtemp . . . . . . $enable_hddtemp
906 load . . . . . . . $enable_load
907 memory . . . . . . $enable_memory
908 mysql . . . . . . . $enable_mysql
909 nfs . . . . . . . . $enable_nfs
910 ping . . . . . . . $enable_ping
911 processes . . . . . $enable_processes
912 sensors . . . . . . $enable_sensors
913 serial . . . . . . $enable_serial
914 swap . . . . . . . $enable_swap
915 tape . . . . . . . $enable_tape
916 traffic . . . . . . $enable_traffic
917 users . . . . . . . $enable_users
918 vserver . . . . . . $enable_vserver
919 wireless . . . . . $enable_wireless
921 EOF