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