added conditions and implemented AC_COLLECTD() macro.
[collectd.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, 3.5.0)
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
6 AC_LANG(C)
7
8 AC_PREFIX_DEFAULT("/opt/collectd")
9
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
19 dnl configure libtool
20 AC_DISABLE_STATIC
21 AC_LIBLTDL_CONVENIENCE
22 AC_SUBST(LTDLINCL)
23 AC_SUBST(LIBLTDL)
24 AC_LIBTOOL_DLOPEN
25 AC_PROG_LIBTOOL
26 #AC_PROG_RANLIB
27 AC_CONFIG_SUBDIRS(libltdl)
28
29 #
30 # Checks for header files.
31 #
32 AC_HEADER_SYS_WAIT
33 AC_HEADER_DIRENT
34 AC_CHECK_HEADERS(fcntl.h)
35 AC_CHECK_HEADERS(signal.h)
36 AC_CHECK_HEADERS(sys/socket.h)
37 AC_CHECK_HEADERS(sys/select.h)
38 AC_CHECK_HEADERS(netdb.h)
39 AC_CHECK_HEADERS(sys/resource.h)
40 AC_CHECK_HEADERS(sys/param.h)
41 AC_CHECK_HEADERS(errno.h)
42 AC_CHECK_HEADERS(syslog.h)
43
44 # For cpu modules
45 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
46
47 # For load module
48 AC_CHECK_HEADERS(sys/loadavg.h)
49
50 # For ping module
51 AC_CHECK_HEADERS(arpa/inet.h)
52 AC_CHECK_HEADERS(netinet/in.h)
53
54 # For users module
55 AC_CHECK_HEADERS(utmp.h)
56 AC_CHECK_HEADERS(utmpx.h)
57
58 # For quota module
59 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
60 AC_CHECK_HEADERS(ctype.h)
61 AC_CHECK_HEADERS(limits.h)
62 AC_CHECK_HEADERS(sys/quota.h)
63 AC_CHECK_HEADERS(xfs/xqm.h)
64
65 # For mount interface
66 AC_CHECK_HEADERS(fs_info.h)
67 AC_CHECK_HEADERS(fshelp.h)
68 AC_CHECK_HEADERS(paths.h)
69 AC_CHECK_HEADERS(mntent.h)
70 AC_CHECK_HEADERS(mnttab.h)
71 AC_CHECK_HEADERS(sys/fstyp.h)
72 AC_CHECK_HEADERS(sys/fs_types.h)
73 AC_CHECK_HEADERS(sys/mntent.h)
74 AC_CHECK_HEADERS(sys/mnttab.h)
75 AC_CHECK_HEADERS(sys/mount.h)
76 AC_CHECK_HEADERS(sys/statfs.h)
77 AC_CHECK_HEADERS(sys/vfs.h)
78 AC_CHECK_HEADERS(sys/vfstab.h)
79
80 # For debugging interface (variable number of arguments)
81 AC_CHECK_HEADERS(stdarg.h)
82
83 dnl Checking for libraries
84 AC_CHECK_LIB(m, ext)
85
86 #
87 # Checks for typedefs, structures, and compiler characteristics.
88 #
89 AC_C_CONST
90 AC_TYPE_PID_T
91 AC_TYPE_SIZE_T
92 AC_HEADER_TIME
93
94 #
95 # Checks for library functions.
96 #
97 AC_PROG_GCC_TRADITIONAL
98 AC_CHECK_FUNCS(gettimeofday select strdup strtol)
99 AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
100 AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
101 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
102 AC_CHECK_FUNCS(strncasecmp strcasecmp)
103 AC_CHECK_FUNCS(openlog syslog closelog)
104
105 # For cpu module
106 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
107
108 # For load module
109 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
110
111 # For users module
112 AC_CHECK_FUNCS(getutent getutxent)
113
114 # For quota module
115 AC_CHECK_FUNCS(quotactl)
116 AC_CHECK_FUNCS(getgrgid getpwuid)
117
118 # For mount interface
119 AC_CHECK_FUNCS(getfsent getvfsent listmntent)
120 AC_FUNC_GETMNTENT
121 if test "x$ac_cv_func_getmntent" = "xyes"; then
122         saveCFLAGS="$CFLAGS"
123         CFLAGS="-Wall -Werror $CFLAGS"
124         AC_CACHE_CHECK([whether getmntent takes one argument],
125                 [fu_cv_getmntent1],
126                 AC_COMPILE_IFELSE(
127                         AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
128 #include "$srcdir/src/utils_mount.h"]],
129                                 [[(void)getmntent((FILE *)NULL);]]
130                         ),
131                         [fu_cv_getmntent1=yes],
132                         [fu_cv_getmntent1=no]
133                 )
134         )
135         if test "x$fu_cv_getmntent1" = "xno"; then
136                 AC_CACHE_CHECK([whether getmntent takes two arguments],
137                         [fu_cv_getmntent2],
138                         AC_COMPILE_IFELSE(
139                                 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
140 #include "$srcdir/src/utils_mount.h"]],
141                                         [[(void)getmntent((FILE *)NULL,
142                                                 (struct mnttab *)NULL);]]
143                                 ),
144                                 [fu_cv_getmntent2=yes],
145                                 [fu_cv_getmntent2=no]
146                         )
147                 )
148         fi
149         CFLAGS="$saveCFLAGS"
150 fi
151 if test "x$fu_cv_getmntent1" = "xyes"; then
152         AC_DEFINE(HAVE_GETMNTENT1,
153                 1,
154                 [Define if there is a function named getmntent
155                         for reading the list of mounted filesystems, and
156                         that function takes a single argument. (4.3BSD,
157                         SunOS, HP-UX, Dynix, Irix, Linux)]
158                 )
159 fi
160 if test "x$fu_cv_getmntent2" = "xyes"; then
161         AC_DEFINE(HAVE_GETMNTENT2,
162                 1,
163                 [Define if there is a function named getmntent
164                         for reading the list of mounted filesystems, and
165                         that function takes two arguments. (SVR4)]
166                 )
167 fi
168
169 AC_MSG_CHECKING([for kernel type ($host_os)])
170 case $host_os in
171         *linux*)
172         AC_DEFINE([KERNEL_LINUX], [], [True if program is to be compiled for a Linux kernel])
173         ac_system="Linux"
174         ;;
175         *solaris*)
176         AC_DEFINE([KERNEL_SOLARIS], [], [True if program is to be compiled for a Solaris kernel])
177         ac_system="Solaris"
178         ;;
179         *)
180         ac_system="unknown"
181 esac
182 AC_MSG_RESULT([$ac_system])
183
184 dnl Checks for libraries.
185 AC_CHECK_LIB(socket, socket)
186 AC_CHECK_LIB(resolv, res_search)
187
188 m4_divert_once([HELP_WITH], [
189 collectd additional packages:])
190
191 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
192 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
193 [       if test "x$withval" != "xno" && test "x$withval" != "xyes"
194         then
195                 LDFLAGS="$LDFLAGS -L$withval/lib"
196                 CPPFLAGS="$CPPFLAGS -I$withval/include"
197                 with_rrdtool="yes"
198         fi
199 ], [with_rrdtool="yes"])
200 if test "x$with_rrdtool" = "xyes"
201 then
202         AC_CHECK_LIB(rrd, rrd_update,, [with_rrdtool="no (librrd not found)"], [-lm])
203 fi
204 if test "x$with_rrdtool" = "xyes"
205 then
206         AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
207 fi
208 if test "x$with_rrdtool" = "xyes"
209 then
210         collect_rrdtool=1
211 else
212         collect_rrdtool=0
213 fi
214 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
215         [Wether or not to use rrdtool library])
216 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
217
218 #AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]),
219 #[      if test "x$withval" != "xno" && test "x$withval" != "xyes"
220 #       then
221 #               LDFLAGS="$LDFLAGS -L$withval/lib"
222 #               CPPFLAGS="$CPPFLAGS -I$withval/include"
223 #               with_pth="yes"
224 #       fi
225 #], [with_pth="no"])
226 #if test "x$with_pth" = "xyes"
227 #then
228 #       AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], [])
229 #fi
230 #if test "x$with_pth" = "xyes"
231 #then
232 #       AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"])
233 #fi
234 #if test "x$with_pth" = "xyes"
235 #then
236 #       collect_pth=1
237 #else
238 #       collect_pth=0
239 #fi
240 #AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth],
241 #       [Wether or not to use pth (portable threads) library])
242 #AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes")
243
244 if test "$ac_system" = "Solaris"
245 then
246         with_kstat="yes"
247 else
248         with_kstat="no (Solaris only)"
249 fi
250 if test "x$with_kstat" = "xyes"
251 then
252         AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"])
253 fi
254 if test "x$with_kstat" = "xyes"
255 then
256         AC_CHECK_LIB(devinfo, di_init)
257         AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
258 fi
259 if test "x$with_kstat" = "xyes"
260 then
261         collect_kstat=1
262 else
263         collect_kstat=0
264 fi
265 AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat],
266         [Wether or not to use kstat library (Solaris)])
267 AM_CONDITIONAL(BUILD_WITH_KSTAT, test "x$with_kstat" = "xyes")
268
269 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
270 [
271         if test "x$withval" != "xno" && test "x$withval" != "xyes"
272         then
273                 LDFLAGS="$LDFLAGS -L$withval/lib"
274                 CPPFLAGS="$CPPFLAGS -I$withval/include"
275                 with_libstatgrab="yes"
276         fi
277 ],
278 [
279         if test "x$ac_system" == "xunknown"
280         then
281                 with_libstatgrab="yes"
282         else
283                 with_libstatgrab="no"
284         fi
285 ])
286 if test "x$with_libstatgrab" = "xyes"
287 then
288         AC_CHECK_LIB(devstat, getdevs)
289         AC_CHECK_LIB(kvm, kvm_getargv)
290         AC_CHECK_LIB(statgrab, sg_init,, [with_libstatgrab="no (libstatgrab not found)"])
291 fi
292 if test "x$with_libstatgrab" = "xyes"
293 then
294         AC_CHECK_HEADERS(statgrab.h,,    [with_libstatgrab="no (statgrab.h not found)"])
295 fi
296 if test "x$with_libstatgrab" = "xyes"
297 then
298         collect_libstatgrab=1
299 else
300         collect_libstatgrab=0
301 fi
302 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
303         [Wether or not to use statgrab library])
304 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
305
306 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
307 [
308         if test "x$withval" != "xno" && test "x$withval" != "xyes"
309         then
310                 LDFLAGS="$LDFLAGS -L$withval/lib"
311                 CPPFLAGS="$CPPFLAGS -I$withval/include"
312                 with_lm_sensors="yes"
313         fi
314 ],
315 [
316         if test "x$ac_system" = "xLinux"
317         then
318                 with_lm_sensors="yes"
319         else
320                 with_lm_sensors="no"
321         fi
322 ])
323 if test "x$with_lm_sensors" = "xyes"
324 then
325         AC_CHECK_LIB(sensors, sensors_init,
326         [
327                 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
328         ],
329         [with_lm_sensors="no (libsensors not found)"])
330 fi
331 if test "x$with_lm_sensors" = "xyes"
332 then
333         AC_CHECK_HEADERS(sensors/sensors.h,
334         [
335                 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
336         ],
337         [with_lm_sensors="no (sensors/sensors.h not found)"])
338 fi
339 if test "x$with_lm_sensors" = "xyes"
340 then
341         collect_lm_sensors=1
342 else
343         collect_lm_sensors=0
344 fi
345 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
346         [Wether or not to use sensors library])
347 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
348
349
350
351 #
352 # Check for enabled/disabled features
353 #
354
355 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
356 # ------------------------------------------------------------
357 dnl
358 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
359 dnl
360 AC_DEFUN(
361         [AC_COLLECTD],
362         [
363         m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
364         m4_if(
365                 [$2],
366                 [enable],
367                 [dnl
368                 m4_define([EnDis],[disabled])dnl
369                 m4_define([YesNo],[no])dnl
370                 ],dnl
371                 [m4_if(
372                         [$2],
373                         [disable],
374                         [dnl
375                         m4_define([EnDis],[enabled])dnl
376                         m4_define([YesNo],[yes])dnl
377                         ],
378                         [dnl
379                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
380                         ]dnl
381                 )]dnl
382         )dnl
383         m4_if([$3], [feature], [],
384                 [m4_if(
385                         [$3], [module], [],
386                         [dnl
387                         AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
388                         ]dnl
389                 )]dnl
390         )dnl
391         AC_ARG_ENABLE(
392                 [$1],
393                 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
394                 [],
395                 enable_$1='[YesNo]'dnl
396         )# AC_ARG_ENABLE
397 if test "x$enable_$1" = "xno"
398 then
399         collectd_$1=0
400 else
401         if test "x$enable_$1" = "xyes"
402         then
403                 collectd_$1=1
404         else
405                 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
406                 collectd_$1=1
407                 enable_$1='yes'
408         fi
409 fi
410         AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
411         AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
412         ]dnl
413 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
414
415
416
417 #m4_divert_once([HELP_ENABLE], [
418 #collectd modules:])
419 #AC_COLLECTD([cpu],       [disable], [module], [cpu usage statistics])
420 #AC_COLLECTD([cpufreq],   [disable], [module], [system cpu frequency statistics])
421 #AC_COLLECTD([disk],      [disable], [module], [disk/partition statistics])
422 #AC_COLLECTD([quota],     [enable],  [module], [quota statistics (experimental)])
423 #AC_COLLECTD([hddtemp],   [disable], [module], [hdd temperature statistics])
424 #AC_COLLECTD([load],      [disable], [module], [system load statistics])
425 #AC_COLLECTD([memory],    [disable], [module], [memory statistics])
426 #AC_COLLECTD([nfs],       [disable], [module], [nfs statistics])
427 #AC_COLLECTD([ping],      [disable], [module], [ping statistics])
428 #AC_COLLECTD([processes], [disable], [module], [processes statistics])
429 #AC_COLLECTD([sensors],   [disable], [module], [lm_sensors statistics])
430 #AC_COLLECTD([serial],    [disable], [module], [serial statistics])
431 #AC_COLLECTD([swap],      [disable], [module], [swap statistics])
432 #AC_COLLECTD([tape],      [disable], [module], [tape statistics])
433 #AC_COLLECTD([traffic],   [disable], [module], [system traffic statistics])
434 #AC_COLLECTD([users],     [disable], [module], [user count statistics])
435
436
437
438 m4_divert_once([HELP_ENABLE], [
439 collectd features:])
440
441 AC_COLLECTD([debug],     [enable],  [feature], [debugging])
442 AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
443
444 m4_divert_once([HELP_ENABLE], [
445 collectd modules:])
446 AC_ARG_ENABLE(cpu, AC_HELP_STRING([--disable-cpu], [Disable CPU usage statistics]),, [enable_cpu="yes"])
447 if test "x$enable_cpu" != "xno"
448 then
449         if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$have_sysctlbyname" = "xyes"
450         then
451                 enable_cpu="yes"
452         else
453                 enable_cpu="no"
454         fi
455 fi
456 if test "x$enable_cpu" = "xno"
457 then
458         AC_DEFINE(COLLECT_CPU, 0, [Wether or not to collect CPU usage statistics])
459 fi
460 AM_CONDITIONAL(BUILD_MODULE_CPU, test "x$enable_cpu" = "xyes")
461
462 AC_ARG_ENABLE(cpufreq, AC_HELP_STRING([--disable-cpufreq], [Disable system cpu frequency statistics]),, [enable_cpufreq="yes"])
463 if test "x$enable_cpufreq" != "xno"
464 then
465         if test "x$ac_system" = "xLinux"
466         then
467                 enable_cpufreq="yes"
468         else
469                 enable_cpufreq="no"
470         fi
471 fi
472 if test "x$enable_cpufreq" = "xno"
473 then
474         AC_DEFINE(COLLECT_CPUFREQ, 0, [Wether or not to collect cpu frequency statistics])
475 fi
476 AM_CONDITIONAL(BUILD_MODULE_CPUFREQ, test "x$enable_cpufreq" = "xyes")
477
478 AC_ARG_ENABLE(disk, AC_HELP_STRING([--disable-disk], [Disable disk/partition statistics]),, [enable_disk="yes"])
479 if test "x$enable_disk" != "xno"
480 then
481         if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes"
482         then
483                 enable_disk="yes"
484         else
485                 enable_disk="no"
486         fi
487 fi
488 if test "x$enable_disk" = "xno"
489 then
490         AC_DEFINE(COLLECT_DISK, 0, [Wether or not to collect diskstats])
491 fi
492 AM_CONDITIONAL(BUILD_MODULE_DISK, test "x$enable_disk" = "xyes")
493
494 AC_ARG_ENABLE(hddtemp, AC_HELP_STRING([--disable-hddtemp], [Disable hdd temperature statistics]),, [enable_hddtemp="yes"])
495 if test "x$enable_hddtemp" = "xno"
496 then
497         AC_DEFINE(COLLECT_HDDTEMP, 0, [Wether or not to collect hdd temperature statistics])
498 fi
499 AM_CONDITIONAL(BUILD_MODULE_HDDTEMP, test "x$enable_hddtemp" = "xyes")
500
501 AC_ARG_ENABLE(load, AC_HELP_STRING([--disable-load], [Disable system load statistics]),, [enable_load="yes"])
502 if test "x$enable_load" != "xno"
503 then
504         if test "x$have_getloadavg" = "xyes" -o "x$ac_system" = "xLinux" -o "x$with_libstatgrab" = "xyes"
505         then
506                 enable_load="yes"
507         else
508                 enable_load="no"
509         fi
510 fi
511 if test "x$enable_load" = "xno"
512 then
513         AC_DEFINE(COLLECT_LOAD, 0, [Wether or not to collect system load statistics])
514 fi
515 AM_CONDITIONAL(BUILD_MODULE_LOAD, test "x$enable_load" = "xyes")
516
517 AC_ARG_ENABLE(memory, AC_HELP_STRING([--disable-memory], [Disable memory statistics]),, [enable_memory="yes"])
518 if test "x$enable_memory" != "xno"
519 then
520         if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
521         then
522                 enable_memory="yes"
523         else
524                 enable_memory="no"
525         fi
526 fi
527 if test "x$enable_memory" = "xno"
528 then
529         AC_DEFINE(COLLECT_MEMORY, 0, [Wether or not to collect memory statistics])
530 fi
531 AM_CONDITIONAL(BUILD_MODULE_MEMORY, test "x$enable_memory" = "xyes")
532
533 AC_ARG_ENABLE(nfs, AC_HELP_STRING([--disable-nfs], [Disable nfs statistics]),, [enable_nfs="yes"])
534 if test "x$enable_nfs" != "xno"
535 then
536         if test "x$ac_system" = "xLinux"
537         then
538                 enable_nfs="yes"
539         else
540                 enable_nfs="no"
541         fi
542 fi
543 if test "x$enable_nfs" = "xno"
544 then
545         AC_DEFINE(COLLECT_NFS, 0, [Wether or not to collect nfs statistics])
546 fi
547 AM_CONDITIONAL(BUILD_MODULE_NFS, test "x$enable_nfs" = "xyes")
548
549 AC_ARG_ENABLE(ping, AC_HELP_STRING([--disable-ping], [Disable ping statistics]),, [enable_ping="yes"])
550 if test "x$enable_ping" != "xno"
551 then
552         enable_ping="yes"
553 fi
554 if test "x$enable_ping" = "xno"
555 then
556         AC_DEFINE(COLLECT_PING, 0, [Wether or not to collect ping statistics])
557 fi
558 AM_CONDITIONAL(BUILD_MODULE_PING, test "x$enable_ping" = "xyes")
559
560 AC_ARG_ENABLE(processes, AC_HELP_STRING([--disable-processes], [Disable processes statistics]),, [enable_processes="yes"])
561 if test "x$enable_processes" != "xno"
562 then
563         if test "x$ac_system" = "xLinux" 
564         then
565                 enable_processes="yes"
566         else
567                 enable_processes="no"
568         fi
569 fi
570 if test "x$enable_processes" = "xno"
571 then
572         AC_DEFINE(COLLECT_PROCESSES, 0, [Wether or not to collect processes statistics])
573 fi
574 AM_CONDITIONAL(BUILD_MODULE_PROCESSES, test "x$enable_processes" = "xyes")
575
576 #AC_COLLECTD([quota],     [enable],  [module], [quota statistics (experimental)])
577
578 AC_ARG_ENABLE(sensors, AC_HELP_STRING([--disable-sensors], [Disable lm_sensors statistics]),, [enable_sensors=$with_lm_sensors])
579 if test "x$enable_sensors" != "xno"
580 then
581         if test "x$with_lm_sensors" = "xyes"
582         then
583                 enable_sensors="yes"
584         else
585                 enable_sensors="no"
586         fi
587 fi
588 if test "x$enable_sensors" = "xno"
589 then
590         AC_DEFINE(COLLECT_SENSORS, 0, [Wether or not to collect lm_sensors statistics])
591 fi
592 AM_CONDITIONAL(BUILD_MODULE_SENSORS, test "x$enable_sensors" = "xyes")
593
594 AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [Disable serial statistics]),, [enable_serial="yes"])
595 if test "x$enable_serial" != "xno"
596 then
597         if test "x$ac_system" = "xLinux"
598         then
599                 enable_serial="yes"
600         else
601                 enable_serial="no"
602         fi
603 fi
604 if test "x$enable_serial" = "xno"
605 then
606         AC_DEFINE(COLLECT_SERIAL, 0, [Wether or not to collect serial statistics])
607 fi
608 AM_CONDITIONAL(BUILD_MODULE_SERIAL, test "x$enable_serial" = "xyes")
609
610 AC_ARG_ENABLE(swap, AC_HELP_STRING([--disable-swap], [Disable swap statistics]),, [enable_swap="yes"])
611 if test "x$enable_swap" != "xno"
612 then
613         if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
614         then
615                 enable_swap="yes"
616         else
617                 enable_swap="no"
618         fi
619 fi
620 if test "x$enable_swap" = "xno"
621 then
622         AC_DEFINE(COLLECT_SWAP, 0, [Wether or not to collect swap statistics])
623 fi
624 AM_CONDITIONAL(BUILD_MODULE_SWAP, test "x$enable_swap" = "xyes")
625
626 AC_ARG_ENABLE(tape, AC_HELP_STRING([--disable-tape], [Disable tape statistics]),, [enable_tape="yes"])
627 if test "x$enable_tape" != "xno"
628 then
629         if test "x$with_kstat" = "xyes"
630         then
631                 enable_tape="yes"
632         else
633                 enable_tape="no"
634         fi
635 fi
636 if test "x$enable_tape" = "xno"
637 then
638         AC_DEFINE(COLLECT_TAPE, 0, [Wether or not to collect tape statistics])
639 fi
640 AM_CONDITIONAL(BUILD_MODULE_TAPE, test "x$enable_tape" = "xyes")
641
642 AC_ARG_ENABLE(traffic, AC_HELP_STRING([--disable-traffic], [Disable system traffic statistics]),, [enable_traffic="yes"])
643 if test "x$enable_traffic" != "xno"
644 then
645         if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
646         then
647                 enable_traffic="yes"
648         else
649                 enable_traffic="no"
650         fi
651 fi
652 if test "x$enable_traffic" = "xno"
653 then
654         AC_DEFINE(COLLECT_TRAFFIC, 0, [Wether or not to collect network traffic statistics])
655 fi
656 AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes")
657
658 AC_COLLECTD([users],     [disable], [module], [user count statistics])
659
660 AC_OUTPUT(Makefile src/libping/Makefile src/Makefile)
661
662 cat <<EOF;
663
664 Configuration:
665   Libraries:
666     librrd  . . . . . . $with_rrdtool
667     lm_sensors  . . . . $with_lm_sensors
668     libstatgrab . . . . $with_libstatgrab
669     libkstat  . . . . . $with_kstat
670
671   Features:
672     debug . . . . . . . $enable_debug
673     daemon mode . . . . $enable_daemon
674
675   Modules:
676     cpu . . . . . . . . $enable_cpu
677     cpufreq . . . . . . $enable_cpufreq
678     disk  . . . . . . . $enable_disk
679     hddtemp . . . . . . $enable_hddtemp
680     load  . . . . . . . $enable_load
681     memory  . . . . . . $enable_memory
682     nfs . . . . . . . . $enable_nfs
683     ping  . . . . . . . $enable_ping
684     processes . . . . . $enable_processes
685     sensors . . . . . . $enable_sensors
686     serial  . . . . . . $enable_serial
687     swap  . . . . . . . $enable_swap
688     tape  . . . . . . . $enable_tape
689     traffic . . . . . . $enable_traffic
690     users . . . . . . . $enable_users
691
692 EOF