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