Code

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