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