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