Code

Readded getloadavg.m4 as using autoconf 2.50+. This fixes redhat 6.2 compiles
[nagiosplug.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION ($Revision$)
3 AC_PREREQ(2.50)
4 AC_INIT(nagios-plugins,1.3.99)
5 AC_CONFIG_SRCDIR(Helper.pm)
6 AM_INIT_AUTOMAKE
7 AM_CONFIG_HEADER(plugins/config.h)
8 AC_CANONICAL_HOST
10 RELEASE=1
11 AC_SUBST(RELEASE)
13 AC_PREFIX_DEFAULT(/usr/local/nagios)
15 dnl Figure out how to invoke "install" and what install options to use.
16 AC_PROG_INSTALL
17 AC_SUBST(INSTALL)
19 AC_GNU_SOURCE
20 AC_PROG_CC
21 AC_PROG_CPP
22 AC_PROG_GCC_TRADITIONAL
23 AC_PROG_RANLIB
24 AC_AIX
25 AC_MINIX
27 AC_PROG_MAKE_SET
28 AC_PROG_AWK
30 AC_FUNC_GETLOADAVG([lib])
32 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
33 dnl AM_WITH_REGEX
35 PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
36 AC_SUBST(PLUGIN_TEST)dnl
38 SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
39 AC_SUBST(SCRIPT_TEST)dnl
41 WARRANTY="The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
42 AC_SUBST(WARRANTY)
44 SUPPORT="Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n"
45 AC_SUBST(SUPPORT)
47 dnl CGIURL has changed for Nagios with 1.0 beta
48 AC_ARG_WITH(cgiurl,
49         ACX_HELP_STRING([--with-cgiurl=DIR],
50                 [sets URL for cgi programs]),
51         with_cgiurl=$withval,
52         with_cgiurl=/nagios/cgi-bin)
53 CGIURL="$with_cgiurl"
54 AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
56 AC_ARG_WITH(nagios_user,
57         ACX_HELP_STRING([--with-nagios-user=USER],
58                 [set user name to run nagios]),
59         with_nagios_user=$withval,
60         with_nagios_user=nagios)
61 AC_ARG_WITH(nagios_group,
62         ACX_HELP_STRING([--with-nagios-group=GROUP],
63                 [set group name to run nagios]),
64         with_nagios_group=$withval,
65         with_nagios_group=nagios)
66 AC_SUBST(with_nagios_user)
67 AC_SUBST(with_nagios_group)
68 INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group"
69 AC_SUBST(INSTALL_OPTS)
71 AC_ARG_WITH(trusted_path,
72         ACX_HELP_STRING([--with-trusted-path=PATH],
73                 [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
74         with_trusted_path=$withval,
75         with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
76 AC_SUBST(with_trusted_path)
78 EXTRAS=
79 dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
81 LDFLAGS="$LDFLAGS -L."
83 ac_cv_uname_m=`uname -m`
84 ac_cv_uname_s=`uname -s`
85 ac_cv_uname_r=`uname -r`
86 ac_cv_uname_v=`uname -v`
88 PKG_ARCH=`uname -p`
89 REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
90 REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
92 AC_SUBST(PKG_ARCH)
93 AC_SUBST(REV_DATESTAMP)
94 AC_SUBST(REV_TIMESTAMP)
96 dnl Checks for programs.
97 AC_PATH_PROG(PYTHON,python)
98 AC_PATH_PROG(PERL,perl)
99 AC_PATH_PROG(SH,sh)
101 AC_PATH_PROG(HOSTNAME,hostname)
102 AC_PATH_PROG(BASENAME,basename)
104 dnl
105 dnl Check for miscellaneous stuff
106 dnl 
108 case $host_vender-$host_os in
109 sun*)
110         AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
111         ;;
112 osf*)
113         AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
114         ;;
115 esac
117 dnl
118 dnl Checks for libraries.
119 dnl
121 AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
122 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
123 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
124 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
125 AC_SUBST(SOCKETLIBS)
127 dnl Check for PostgreSQL libraries
128 _SAVEDLIBS="$LIBS"
129 _SAVEDCPPFLAGS="$CPPFLAGS"
130 AC_ARG_WITH(pgsql,
131         ACX_HELP_STRING([--with-pgsql=DIR],
132                 [sets path to pgsql installation]),
133         PGSQL=$withval,)
134 AC_CHECK_LIB(crypt,main)
135 if test "$ac_cv_lib_crypt_main" = "yes"; then
136   if test -n "$PGSQL"; then
137     LDFLAGS="$LDFLAGS -L$PGSQL/lib"
138     CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
139   fi
140   AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
141   if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
142     AC_CHECK_HEADERS(pgsql/libpq-fe.h)
143     AC_CHECK_HEADERS(postgresql/libpq-fe.h)
144     AC_CHECK_HEADERS(libpq-fe.h)
145     if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
146       PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
147       PGINCLUDE="-I$PGSQL/include"
148     elif test  "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
149       PGLIBS="-lpq -lcrypt"
150       PGINCLUDE="-I/usr/include/pgsql"
151     elif test  "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
152       PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
153       PGINCLUDE="-I/usr/include/postgresql"
154     elif test  "$ac_cv_header_libpq_fe_h" = "yes"; then
155       PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
156       PGINCLUDE="-I$PGSQL/include"
157     fi
158     if test -z "$PGINCLUDE"; then
159       AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
160       AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
161     else
162       AC_SUBST(PGLIBS)
163       AC_SUBST(PGINCLUDE)
164       EXTRAS="$EXTRAS check_pgsql"
165     fi
166   else
167     AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
168     AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
169     AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
170   fi
171 else
172   AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
173   AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
174 fi
175 LIBS="$_SAVEDLIBS"
176 CPPFLAGS="$_SAVEDCPPFLAGS"
178 dnl Check for radius libraries
179 _SAVEDLIBS="$LIBS"
180 AC_CHECK_LIB(radiusclient,rc_read_config)
181 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
182   EXTRAS="$EXTRAS check_radius"
183         RADIUSLIBS="-lradiusclient"
184   AC_SUBST(RADIUSLIBS)
185 else
186   AC_MSG_WARN([Skipping radius plugin])
187   AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
188 fi
189 LIBS="$_SAVEDLIBS"
191 dnl Check for LDAP libraries
192 _SAVEDLIBS="$LIBS"
193 AC_CHECK_LIB(ldap,main,,,-llber)
194 if test "$ac_cv_lib_ldap_main" = "yes"; then
195   LDAPLIBS="-lldap -llber"\
196   LDAPINCLUDE="-I/usr/include/ldap"
197   AC_SUBST(LDAPLIBS)
198   AC_SUBST(LDAPINCLUDE)
199   AC_CHECK_FUNCS(ldap_set_option)
200   EXTRAS="$EXTRAS check_ldap"
201 else
202   AC_MSG_WARN([Skipping LDAP plugin])
203   AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
204 fi
205 LIBS="$_SAVEDLIBS"
208 dnl Check for mysql libraries
209 _SAVEDLIBS="$LIBS"
210 _SAVEDCPPFLAGS="$CPPFLAGS"
211 AC_ARG_WITH(mysql,
212         ACX_HELP_STRING([--with-mysql=DIR],
213                 [sets path to mysql installation (assumes lib/mysql and include subdirs]),
214         MYSQL=$withval,)
215 if test -n "$MYSQL"; then
216   MYSQLLIBDIR=$MYSQL/lib/mysql
217   CPPFLAGS="-I$MYSQL/include"
218   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
219   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
220 elif test -f /usr/lib/libmysqlclient.so; then
221   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
222   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
223 elif test -f /usr/lib/libmysqlclient.a; then
224   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
225   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
226 elif test -f /usr/lib/mysql/libmysqlclient.so; then
227   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
228   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
229 elif test -f /usr/lib/mysql/libmysqlclient.a; then
230   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
231   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
232 fi
233 if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
234   AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
235   if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
236     EXTRAS="$EXTRAS check_mysql"
237     AC_SUBST(MYSQLINCLUDE)
238     AC_SUBST(MYSQLLIBS)
239     AC_SUBST(check_mysql_LDFLAGS)
240   else
241     AC_MSG_WARN([Skipping mysql plugin])
242     AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
243   fi
244 else
245   AC_MSG_WARN([Skipping mysql plugin])
246   AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
247 fi
248 CPPFLAGS="$_SAVEDCPPFLAGS"
249 LIBS="$_SAVEDLIBS"
251 dnl Check for OpenSSL location
252 AC_PATH_PROG(OPENSSL,openssl)
253 if test "$OPENSSL" = "/usr/bin/openssl"; then
254   OPENSSL=/usr
255 elif test "$OPENSSL" = "/usr/sbin/openssl"; then
256   OPENSSL=/usr
257 elif test "$OPENSSL" = "/opt/bin/openssl"; then
258   OPENSSL=/opt
259 elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
260   OPENSSL=/opt/openssl
261 elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
262   OPENSSL=/usr/slocal
263 elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
264   OPENSSL=/usr/local
265 elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
266   OPENSSL=/usr/local/ssl
267 fi
268 AC_ARG_WITH(openssl,
269         ACX_HELP_STRING([--with-openssl=DIR],
270                 [sets path to openssl installation]),
271         OPENSSL=$withval,)
273 AC_CHECK_HEADERS(unistd.h)
275 dnl Check for AF_INET6 support - unistd.h required for Darwin
276 AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
277         AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
278                         #include <unistd.h>
279                         #endif
280                         #include <netinet/in.h>
281                         #include <sys/socket.h>],
282                         [struct sockaddr_in6 sin6;
283                         void *p;
285                         sin6.sin6_family = AF_INET6;
286                         sin6.sin6_port = 587;
287                         p = &sin6.sin6_addr;],
288                         [with_ipv6=yes], 
289                         [with_ipv6=no])
290         ])
292 if test x"$with_ipv6" != xno ; then
293         AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
294 fi
296 dnl #########################################################################
297 dnl Check if Posix getaddrinfo() is available.  It is also possible to use
298 dnl the version from the lwres library distributed with BIND.
299 dnl #########################################################################
300 AC_ARG_ENABLE([emulate-getaddrinfo],
301               ACX_HELP_STRING([--enable-emulate-getaddrinfo],
302                              [enable getaddrinfo emulation (default=no)]),
303               ,
304               enable_emulate_getaddrinfo=no)
306 AC_ARG_WITH(lwres,
307             ACX_HELP_STRING([--with-lwres=DIR],
308                            [use lwres library for getaddrinfo (default=no)]),
309             ,
310             with_lwres=no)
312 dnl ## enable force to test getaddrinfo.c
313 if test x$enable_emulate_getaddrinfo = xforce ; then
314         enable_emulate_getaddrinfo=yes
315         have_getaddrinfo=no
316 else
318 have_getaddrinfo=no
319 if test x$with_lwres != xno ; then
320         if test "$with_lwres" != yes ; then
321                    CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
322                    LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
323         fi
324         AC_CHECK_HEADERS(lwres/netdb.h, ,
325                         [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
326         AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
327                      [AC_MSG_ERROR([cannot find the lwres library])],
328                      -lnsl -lpthread)
329         have_getaddrinfo=yes
330 fi
332 if test x$have_getaddrinfo != xyes ; then
333         AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
334 fi
336 dnl # Special nonsense for systems that actually have getaddrinfo but
337 dnl # redefine the name to something else, e.g. OSF
338 if test x$have_getaddrinfo != xyes ; then
339         AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
340         AC_TRY_LINK([
341 #               include <netdb.h>
342         ], [
343                 struct addrinfo hints, *res;
344                 int err;
346                 err = getaddrinfo ("host", "service", &hints, &res);
347         ], [
348                 have_getaddrinfo=yes
349                 AC_MSG_RESULT(yes)
350         ], [AC_MSG_RESULT(no)])
351 fi
353 fi
355 if test x$have_getaddrinfo != xno ; then
356         if test x$enable_emulate_getaddrinfo != xno ; then
357                 AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
358         fi
359         AC_DEFINE(HAVE_GETADDRINFO, 1,
360                   [Does system provide RFC 2553/Posix getaddrinfo?])
361 else
362         if test x$enable_emulate_getaddrinfo != xyes ; then
363 dnl                AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
364                enable_emulate_getaddrinfo=yes
365                AC_MSG_WARN([enabling getaddrinfo emulation])
366         fi
367         EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
368 fi
370 if test x"$enable_emulate_getaddrinfo" != xno ; then
371     have_resolver=no
373   dnl  Try for getipnodebyname
374     AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
375     if test x"$have_resolver" != xno ; then
376          AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
377                    [Set when getipnodebyname is available])
378     fi
380   dnl  Try for gethostbyname_r
381     if test x"$have_resolver" = xno ; then
382         AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
383                        [have_resolver=yes
384                         ACX_WHICH_GETHOSTBYNAME_R])
385     fi
387   dnl  Try for gethostbyname
388     if test x"$have_resolver" = xno ; then
389         if test x"$enable_pthreads" != xno ; then
390             AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
391         fi
392         AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
393                        [AC_MSG_ERROR([cannot find gethostbyname])])
394     fi
395     EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
397 fi
399 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
400 if test "$FOUNDINCLUDE" = "no"; then
401   _SAVEDCPPFLAGS="$CPPFLAGS"
402   CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
403   unset ac_cv_header_krb5_h
404   AC_CHECK_HEADERS(krb5.h,
405                    KRB5INCLUDE="-I/usr/kerberos/include"
406                    FOUNDINCLUDE=yes,
407                    FOUNDINCLUDE=no)
408 fi
409 AC_SUBST(KRBINCLUDE)
410 if test "$FOUNDINCLUDE" = "no"; then
411   CPPFLAGS="$_SAVEDCPPFLAGS"
412 fi
414 dnl Check for OpenSSL header files
415 unset FOUNDINCLUDE
416 _SAVEDCPPFLAGS="$CPPFLAGS"
417 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
418 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
419                  SSLINCLUDE="-I$OPENSSL/include"
420                  FOUNDINCLUDE=yes,
421                  FOUNDINCLUDE=no)
422 if test "$FOUNDINCLUDE" = "no"; then
423   AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
424                    SSLINCLUDE="-I$OPENSSL/include"
425                    FOUNDINCLUDE=yes,
426                    FOUNDINCLUDE=no)
427 fi
428 AC_SUBST(SSLINCLUDE)
429 if test "$FOUNDINCLUDE" = "no"; then
430   CPPFLAGS="$_SAVEDCPPFLAGS"
431 fi
433 dnl Check for crypto lib
434 _SAVEDLIBS="$LIBS"
435 AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
436 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
437   dnl Check for SSL lib
438   AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto",AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto"),-L$OPENSSL/lib -lcrypto)
439 fi
440 LIBS="$_SAVEDLIBS"
442 dnl test headers and libs to decide whether check_http should use SSL
443 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
444   if test "$ac_cv_lib_ssl_main" = "yes"; then
445     if test "$FOUNDINCLUDE" = "yes"; then
446       check_tcp_ssl="check_simap check_spop"
447       AC_SUBST(check_tcp_ssl)
448       AC_SUBST(SSLLIBS)
449       AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
450     fi
451   fi
452 fi
453 CPPFLAGS="$_SAVEDCPPFLAGS"
455 dnl
456 dnl Checks for header files.
457 dnl
459 AC_HEADER_STDC
460 AC_HEADER_TIME
461 AC_HEADER_SYS_WAIT
462 AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h)
463 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h)
464 AC_CHECK_HEADERS(limits.h sys/param.h sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h fcntl.h sys/statfs.h sys/dustat.h sys/statvfs.h)
466 # Define HAVE_INTTYPES_H if <inttypes.h> exists,
467 # doesn't clash with <sys/types.h>, and declares uintmax_t.
469 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
470 [AC_TRY_COMPILE(
471   [#include <sys/types.h>
472 #include <inttypes.h>],
473   [uintmax_t i = (uintmax_t) -1;],
474   jm_ac_cv_header_inttypes_h=yes,
475   jm_ac_cv_header_inttypes_h=no)])
477 if test $jm_ac_cv_header_inttypes_h = yes; then
478   AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
479 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
480    and declares uintmax_t. ])
481 fi
483 # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
484 # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
485 # enable the work-around code in fsusage.c.
486 AC_MSG_CHECKING([for statfs that truncates block counts])
487 AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
488 [AC_TRY_COMPILE([
489 #if !defined(sun) && !defined(__sun)
490 choke -- this is a workaround for a Sun-specific problem
491 #endif
492 #include <sys/types.h>
493 #include <sys/vfs.h>],
494 [struct statfs t; long c = *(t.f_spare);],
495 fu_cv_sys_truncating_statfs=yes
496 AC_MSG_RESULT(yes),
497 fu_cv_sys_truncating_statfs=no
498 AC_MSG_RESULT(no),
499 )])
500 if test $fu_cv_sys_truncating_statfs = yes; then
501   AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
502 [  Define if the block counts reported by statfs may be truncated to 2GB
503    and the correct values may be stored in the f_spare array.
504    (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
505    SunOS 4.1.1 seems not to be affected.)])
506 fi
508 dnl Checks for typedefs, structures, and compiler characteristics.
509 AC_C_CONST
510 AC_STRUCT_TM
511 AC_TYPE_PID_T
512 AC_TYPE_SIZE_T
513 AC_TYPE_SIGNAL
515 AC_CHECK_SIZEOF(int,cross)
516 AC_CHECK_SIZEOF(long,cross)
517 AC_CHECK_SIZEOF(short,cross)
519 AC_CACHE_CHECK([for long long],ac_cv_have_longlong,[
520 AC_TRY_RUN([#include <stdio.h>
521 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
522 ac_cv_have_longlong=yes,ac_cv_have_longlong=no,ac_cv_have_longlong=cross)])
523 if test x"$ac_cv_have_longlong" = x"yes"; then
524     AC_DEFINE(HAVE_LONGLONG,1,[Define if system has long long type])
525 fi
528 # Check if the compiler supports the LL prefix on long long integers.
529 # AIX needs this.
531 AC_CACHE_CHECK([for LL suffix on long long integers],ac_cv_compiler_supports_ll, [
532     AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
533         ac_cv_compiler_supports_ll=yes,ac_cv_compiler_supports_ll=no)])
534 if test x"$ac_cv_compiler_supports_ll" = x"yes"; then
535    AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Define if compiler support long long])
536 fi
538 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE_VA_COPY,[
539 AC_TRY_LINK([#include <stdarg.h>
540 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
541 ac_cv_HAVE_VA_COPY=yes,ac_cv_HAVE_VA_COPY=no)])
542 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
543     AC_DEFINE(HAVE_VA_COPY,1,[Define if system has va_copy])
544 fi
546 AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
547 AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
548 AC_TRY_RUN([
549 #include <sys/types.h>
550 #include <stdarg.h>
551 void foo(const char *format, ...) { 
552        va_list ap;
553        int len;
554        char buf[5];
556        va_start(ap, format);
557        len = vsnprintf(buf, 0, format, ap);
558        va_end(ap);
559        if (len != 5) exit(1);
561        va_start(ap, format);
562        len = vsnprintf(0, 0, format, ap);
563        va_end(ap);
564        if (len != 5) exit(1);
566        if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
568        exit(0);
570 main() { foo("hello"); }
571 ],
572 ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
573 if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
574     AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
575 fi
577 AC_TRY_COMPILE([#include <sys/time.h>],
578                [struct timeval *tv;
579                 struct timezone *tz;],
580                AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
581                AC_TRY_COMPILE([#include <sys/time.h>],
582                               [struct timeval *tv;
583                                struct timezone *tz;
584                                gettimeofday(tv, tz);],
585                               AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
586                               AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
588 dnl Checks for library functions.
589 AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
591 AC_MSG_CHECKING(return type of socket size)
592 AC_TRY_COMPILE([#include <stdlib.h>
593                 #include <sys/types.h>
594                 #include <sys/socket.h>],
595                [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
596                ac_cv_socket_size_type=["size_t"]
597                 AC_MSG_RESULT(size_t),
598                ac_cv_socket_size_type=["int"]
599                 AC_MSG_RESULT(int))
601 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
602         [Define type of socket size])
604 if test -f "/proc/loadavg"
605 then
606   AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
607   AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
608 fi
610 dnl #### Process table test
612 AC_PATH_PROG(PATH_TO_PS,ps)
614 AC_MSG_CHECKING(for ps syntax)
615 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
616 dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
617 if ps -axwo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
618         egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
619 then
620         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
621         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid ppid vsz rss pcpu comm args'"
622         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
623         EXTRAS="$EXTRAS check_nagios"
624         AC_MSG_RESULT([$ac_cv_ps_command])
626 dnl  STAT UCOMM              VSZ   RSS USER       UID  PPID COMMAND
627 elif ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
628         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
629 then
630         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
631         ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid ppid vsz rss pcpu comm args'"
632         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
633         EXTRAS="$EXTRAS check_nagios"
634         AC_MSG_RESULT([$ac_cv_ps_command])
636 dnl FreeBSD
637 elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | \
638         egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"] >/dev/null
639 then
640         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
641         ac_cv_ps_command="$PATH_TO_PS waxco 'state uid ppid vsz rss pcpu command command'"
642         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
643         EXTRAS="$EXTRAS check_nagios"
644         AC_MSG_RESULT([$ac_cv_ps_command])
646 dnl BSD-like mode in RH 6.1
647 elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \
648         egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
649 then
650         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
651         ac_cv_ps_command="$PATH_TO_PS waxno 'state uid ppid vsz rss pcpu comm args'"
652         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
653         EXTRAS="$EXTRAS check_nagios"
654         AC_MSG_RESULT([$ac_cv_ps_command])
656 dnl SunOS 4.1.3:
657 dnl  F  UID  PID  PPID  CP  PRI  NI  SZ  RSS  WCHAN  STAT  TT  TIME  COMMAND
658 elif ps -laxnwww 2>/dev/null | \
659         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
660 then
661         ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
662         ac_cv_ps_command="$PATH_TO_PS -laxnwww"
663         ac_cv_ps_format="%*s %d %*s %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
664         EXTRAS="$EXTRAS check_nagios"
665         AC_MSG_RESULT([$ac_cv_ps_command])
667 dnl Debian Linux / procps v1.2.9:
668 dnl  FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
669 dnl    100     0     1     0   0   0    776    76  c0131c8c   S  ffff  0:11 init [2]
670 dnl
671 elif ps laxnwww 2>/dev/null | \
672         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
673 then
674         ac_cv_ps_varlist="[&procuid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
675         ac_cv_ps_command="$PATH_TO_PS laxnwww"
676         ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
677         EXTRAS="$EXTRAS check_nagios"
678         AC_MSG_RESULT([$ac_cv_ps_command])
680 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
681 elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
682         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
683 then
684         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
685         ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid ppid vsz rss pcpu comm args'"
686         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
687         EXTRAS="$EXTRAS check_nagios"
688         AC_MSG_RESULT([$ac_cv_ps_command])
690 dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT
691 elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
692         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
693 then
694         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
695         ac_cv_ps_command="$PATH_TO_PS -ao 'stat uid ppid vsz rss pcpu comm args'"
696         ac_cv_ps_format="[["%s%*[ +] %d %d %d %d %f %s %n"]]"
697         EXTRAS="$EXTRAS check_nagios"
698         AC_MSG_RESULT([$ac_cv_ps_command])
700 elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \
701         egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
702 then
703         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
704         ac_cv_ps_command="$PATH_TO_PS -eo 's uid ppid vsz rss pcpu comm args'"
705         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
706         EXTRAS="$EXTRAS check_nagios"
707         AC_MSG_RESULT([$ac_cv_ps_command])
709 elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \
710         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
711 then
712         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
713         ac_cv_ps_command="$PATH_TO_PS -Ao 's uid ppid vsz rss pcpu comm args'"
714         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
715         EXTRAS="$EXTRAS check_nagios"
716         AC_MSG_RESULT([$ac_cv_ps_command])
718 elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \
719         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
720 then
721         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
722         ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid ppid vsz rss pcpu comm args'"
723         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
724         EXTRAS="$EXTRAS check_nagios"
725         AC_MSG_RESULT([$ac_cv_ps_command])
727 elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \
728         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
729 then
730         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
731         ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid ppid vsz rss pcpu comm args'"
732         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
733         EXTRAS="$EXTRAS check_nagios"
734         AC_MSG_RESULT([$ac_cv_ps_command])
736 dnl wonder who takes state instead of stat
737 elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \
738         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
739 then
740         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
741         ac_cv_ps_command="$PATH_TO_PS -ao 'state uid ppid vsz rss pcpu command args'"
742         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
743         EXTRAS="$EXTRAS check_nagios"
744         AC_MSG_RESULT([$ac_cv_ps_command])
746 dnl IRIX 53
747 elif ps -el 2>/dev/null | \
748         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
749 then
750         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&pos,procprog]"
751         ac_cv_ps_command="$PATH_TO_PS -el"
752         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
753         AC_MSG_RESULT([$ac_cv_ps_command])
755 dnl IRIX 63
756 elif ps -el 2>/dev/null | \
757         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
758 then
759         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
760         ac_cv_ps_command="$PATH_TO_PS -el"
761         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
762         AC_MSG_RESULT([$ac_cv_ps_command])
764 dnl AIX 4.1:
765 dnl     F S      UID   PID  PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
766 dnl    303 A        0     0     0 120  16 -- 1c07  20   24              -  0:45 swapper
767 elif ps -el 2>/dev/null | \
768         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
769 then
770         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
771         ac_cv_ps_command="$PATH_TO_PS -el"
772         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
773         AC_MSG_RESULT([$ac_cv_ps_command])
775 dnl AIX?
776 elif ps glaxen 2>/dev/null | \
777         egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
778 then
779         ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
780         ac_cv_ps_command="$PATH_TO_PS glaxen"
781         ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
782         AC_MSG_RESULT([$ac_cv_ps_command])
784 dnl MacOSX / Darwin
785 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
786 dnl Some truncation will happen in UCOMM column
787 dnl STAT      VSZ    RSS   UID  PPID %CPU UCOMM            COMMAND
788 dnl Ss      52756  22496   501     1   6.9 Window Manager   /System/Library/CoreServices/WindowServer -daemon
789 elif ps wwaxo 'state vsz rss uid ppid pcpu ucomm command' 2>/dev/null | \
790         egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
791 then
792         ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid ppid pcpu ucomm command'"
793         ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procppid,&procpcpu,procprog,&pos]"
794         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
795         EXTRAS="$EXTRAS check_nagios"
796         AC_MSG_RESULT([$ac_cv_ps_command])
798 dnl UnixWare 
799 elif ps -Al 2>/dev/null | \
800         egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
801 then
802         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
803         ac_cv_ps_command="$PATH_TO_PS -Al"
804         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
805         #if ps -Ao 'vsz comm' 2>/dev/null | \
806         #       egrep -i ["^ *VSZ +COMMAND"] >/dev/null
807         #then
808         #       ac_cv_vsz_command="$PATH_TO_PS -Ao 'vsz comm'"
809         #       ac_cv_vsz_format="%*s %d"
810         #fi
811         AC_MSG_RESULT([$ac_cv_ps_command])
813 else
814         AC_MSG_WARN([unable to find usable ps syntax])
815 fi
817 AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
818         [Variable list for sscanf of 'ps' output])
819 AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
820         [Verbatim command to execute for ps in check_procs])
821 AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
822         [Format string for scanning ps output in check_procs])
824 AC_PATH_PROG(PATH_TO_DF,df)
825 AC_PATH_PROG(PATH_TO_BDF,bdf)
827 AC_ARG_WITH(df_command,
828         ACX_HELP_STRING([--with-df-command=SYNTAX],
829                 [sets syntax for df]),
830         with_df_command=$withval,)
832 AC_MSG_CHECKING(for df syntax)
833 if test -n "$with_df_command"
834 then
835         AC_MSG_RESULT([$with_df_command])
837 elif df -Pk 2>/dev/null | egrep -i ["^(/dev/|[a-zA-Z]:)[a-z0-9/\\]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/\\]*"] >/dev/null
838 then
839         with_df_command="$PATH_TO_DF -Pk"
840         AC_MSG_RESULT([$with_df_command])
842 elif df -k 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
843 then
844         with_df_command="$PATH_TO_DF -k"
845         AC_MSG_RESULT([$with_df_command])
847 elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
848 then
849         with_df_command="$PATH_TO_DF"
850         AC_MSG_RESULT([$with_df_command])
852 elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
853 then
854         with_df_command="$PATH_TO_BDF"
855         AC_MSG_RESULT([$with_df_command])
857 else
858         AC_MSG_WARN([unable to find usable df syntax])
859 fi
861 AC_DEFINE_UNQUOTED(DF_COMMAND,"$with_df_command",[path and args for df command])
863 dnl jm_AFS
864 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
865 jm_FSTYPENAME
866 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
868 AC_PATH_PROG(PATH_TO_PING,ping)
869 AC_PATH_PROG(PATH_TO_PING6,ping6)
871 AC_ARG_WITH(ping_command,
872         ACX_HELP_STRING([--with-ping-command=SYNTAX],
873                 [sets syntax for ICMP ping]),
874         with_ping_command=$withval,)
876 AC_MSG_CHECKING(for ICMP ping syntax)
877 ac_cv_ping_packets_first=no
878 if test -n "$with_ping_command"
879 then
880         AC_MSG_RESULT([(command-line) $with_ping_command])
881         if test -n "$ac_cv_ping_packets_first"
882         then
883                 ac_cv_ping_packets_first=yes
884         fi
886 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
887         $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
888         egrep -i "^round-trip|^rtt" >/dev/null
889 then
890         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
891         ac_cv_ping_packets_first=yes
892         AC_MSG_RESULT([$with_ping_command])
894 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
895         egrep -i "^round-trip|^rtt" >/dev/null
896 then
897         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
898         ac_cv_ping_packets_first=yes
899         AC_MSG_RESULT([$with_ping_command])
901 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
902         egrep -i "^round-trip|^rtt" >/dev/null
903 then
904         with_ping_command="$PATH_TO_PING -n -c %d %s"
905         ac_cv_ping_packets_first=yes
906         AC_MSG_RESULT([$with_ping_command])
908 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
909         egrep -i "^round-trip|^rtt" >/dev/null
910 then
911         with_ping_command="$PATH_TO_PING -n %s -c %d"
912         AC_MSG_RESULT([$with_ping_command])
914 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
915         egrep -i "^round-trip|^rtt" >/dev/null
916 then
917         with_ping_command="$PATH_TO_PING %s -n %d"
918         AC_MSG_RESULT([$with_ping_command])
920 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
921         egrep -i "^round-trip|^rtt" >/dev/null
922 then
923         with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
924         AC_MSG_RESULT([$with_ping_command])
926 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
927         egrep -i "^round-trip|^rtt" >/dev/null
928 then
929         with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
930         AC_MSG_RESULT([$with_ping_command])
932 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
933         egrep -i "^round-trip|^rtt" >/dev/null
934 then
935         with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
936         ac_cv_ping_packets_first=yes
937         AC_MSG_RESULT([$with_ping_command])
939 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
940         egrep -i "^round-trip|^rtt" >/dev/null
941 then
942         with_ping_command="$PATH_TO_PING -n -c %d %s"
943         ac_cv_ping_packets_first=yes
944         AC_MSG_RESULT([$with_ping_command])
946 else
947         AC_MSG_WARN([unable to find usable ping syntax])
948 fi
950 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
951         [path and args for ICMP ping command])
953 if test "x$ac_cv_ping_packets_first" != "xno"
954 then
955         AC_DEFINE(PING_PACKETS_FIRST,1,
956                 [Define if packet count must precede host])
957 fi
959 AC_ARG_WITH(ping6_command,
960         ACX_HELP_STRING([--with-ping6-command=SYNTAX],
961                 [sets syntax for ICMPv6 ping]),
962         with_ping6_command=$withval,)
964 if test x"$with_ipv6" != xno ; then
965 AC_MSG_CHECKING(for ICMPv6 ping syntax)
966 ac_cv_ping6_packets_first=no
967 if test -n "$with_ping6_command"
968 then
969         AC_MSG_RESULT([(command-line) $with_ping6_command])
970         if test -n "$ac_cv_ping6_packets_first"
971         then
972                 ac_cv_ping6_packets_first=yes
973         fi
975 elif test "x$PATH_TO_PING6" != "x"; then
976         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
977                 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
978                 egrep -i "^round-trip|^rtt" >/dev/null
979         then
980                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
981                 ac_cv_ping6_packets_first=yes
982                 AC_MSG_RESULT([$with_ping6_command])
984         elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
985                 egrep -i "^round-trip|^rtt" >/dev/null
986         then
987                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
988                 ac_cv_ping6_packets_first=yes
989                 AC_MSG_RESULT([$with_ping6_command])
991         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
992                 egrep -i "^round-trip|^rtt" >/dev/null
993         then
994                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
995                 ac_cv_ping6_packets_first=yes
996                 AC_MSG_RESULT([$with_ping6_command])
998         elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
999                 egrep -i "^round-trip|^rtt" >/dev/null
1000         then
1001                 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1002                 AC_MSG_RESULT([$with_ping6_command])
1004         elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1005                 egrep -i "^round-trip|^rtt" >/dev/null
1006         then
1007                 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1008                 AC_MSG_RESULT([$with_ping6_command])
1010         elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1011                 egrep -i "^round-trip|^rtt" >/dev/null
1012         then
1013                 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1014                 AC_MSG_RESULT([$with_ping6_command])
1016         elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1017                 egrep -i "^round-trip|^rtt" >/dev/null
1018         then
1019                 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1020                 AC_MSG_RESULT([$with_ping6_command])
1022         elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1023                 egrep -i "^round-trip|^rtt" >/dev/null
1024         then
1025                 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1026                 ac_cv_ping6_packets_first=yes
1027                 AC_MSG_RESULT([$with_ping_command])
1029         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1030                 egrep -i "^round-trip|^rtt" >/dev/null
1031         then
1032                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1033                 ac_cv_ping6_packets_first=yes
1034                 AC_MSG_RESULT([$with_ping6_command])
1036         fi
1038 elif test "x$PATH_TO_PING" != "x"; then
1039         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1040                 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1041                 egrep -i "^round-trip|^rtt" >/dev/null
1042         then
1043                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1044                 ac_cv_ping6_packets_first=yes
1045                 AC_MSG_RESULT([$with_ping6_command])
1047         elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1048                 egrep -i "^round-trip|^rtt" >/dev/null
1049         then
1050                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1051                 ac_cv_ping6_packets_first=yes
1052                 AC_MSG_RESULT([$with_ping6_command])
1054         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1055                 egrep -i "^round-trip|^rtt" >/dev/null
1056         then
1057                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1058                 ac_cv_ping6_packets_first=yes
1059                 AC_MSG_RESULT([$with_ping6_command])
1061         elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1062                 egrep -i "^round-trip|^rtt" >/dev/null
1063         then
1064                 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1065                 AC_MSG_RESULT([$with_ping6_command])
1067         elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1068                 egrep -i "^round-trip|^rtt" >/dev/null
1069         then
1070                 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1071                 AC_MSG_RESULT([$with_ping6_command])
1073         elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1074                 egrep -i "^round-trip|^rtt" >/dev/null
1075         then
1076                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1077                 AC_MSG_RESULT([$with_ping6_command])
1079         elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1080                 egrep -i "^round-trip|^rtt" >/dev/null
1081         then
1082                 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1083                 AC_MSG_RESULT([$with_ping6_command])
1085         elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1086                 egrep -i "^round-trip|^rtt" >/dev/null
1087         then
1088                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1089                 ac_cv_ping6_packets_first=yes
1090                 AC_MSG_RESULT([$with_ping_command])
1092         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1093                 egrep -i "^round-trip|^rtt" >/dev/null
1094         then
1095                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1096                 ac_cv_ping6_packets_first=yes
1097                 AC_MSG_RESULT([$with_ping6_command])
1099         fi
1101 fi
1103 if test "x$with_ping6_command" != "x"; then
1104         AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1105                 [path and args for ICMPv6 ping command])
1106 else
1107         AC_MSG_RESULT([none])
1108 fi
1110 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1111         AC_DEFINE(PING6_PACKETS_FIRST,1,
1112                 [Define if packet count must precede host])
1113 fi
1114 fi
1116 AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1118 AC_MSG_CHECKING(for nslookup syntax)
1119 if test -n "$PATH_TO_NSLOOKUP"
1120 then
1121         if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1122         then
1123                 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1124                 AC_MSG_RESULT([$ac_cv_nslookup_command])
1126         else
1127                 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1128                 AC_MSG_RESULT([$ac_cv_nslookup_command])
1130         fi
1131         EXTRAS="$EXTRAS check_dns"
1133 else
1134         AC_MSG_WARN([nslookup command not found])
1135 fi
1137 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command",
1138         [path and args for nslookup])
1140 AC_PATH_PROG(PATH_TO_HOST,host)
1141 if test -n "$ac_cv_path_PATH_TO_HOST"
1142 then
1143         EXTRAS="$EXTRAS check_dns"
1144 fi
1146 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1147 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1149 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1150 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1152 AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
1153 AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
1154 AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
1155 if (test -x "$PATH_TO_NTPDATE" || test -x "$PATH_TO_NTPQ")
1156 then
1157         AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
1158         AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
1159 else
1160         AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
1161 fi
1163 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1164 if test -x "$PATH_TO_LMSTAT"
1165 then
1166         AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1167 else
1168         AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1169 fi
1171 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1172 if test -x "$PATH_TO_SMBCLIENT"
1173 then
1174         AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1175 else
1176         AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1177 fi
1180 AC_PATH_PROG(PATH_TO_WHO,who)
1182 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1183 then
1184         ac_cv_path_to_who="$PATH_TO_WHO -q"
1185 else
1186         ac_cv_path_to_who="$PATH_TO_WHO"
1187 fi
1189 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1190         [path and arguments for invoking 'who'])
1192 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1193 if test -x "$PATH_TO_SNMPGET"
1194 then
1195         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1196         EXTRAS="$EXTRAS check_hpjd check_snmp"
1197 else
1198         AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1199 fi
1201 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1202 if test -x "$PATH_TO_SNMPGETNEXT"
1203 then
1204         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1205 fi
1207 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )
1208 then
1209         AC_MSG_CHECKING(for Net::SNMP perl module)
1210         AC_MSG_RESULT([found])
1211 else
1212         AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1213 fi
1215 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1216 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1218 if test -x "$PATH_TO_QUAKESTAT"
1219 then
1220         ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1221         EXTRAS="$EXTRAS check_game"
1223 elif test -x "$PATH_TO_QSTAT"
1224 then
1225         ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1226         EXTRAS="$EXTRAS check_game"
1227 else
1228         AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1229 fi
1231 if test $ac_cv_path_to_qstat 
1232 then
1233         AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1234                 [path to qstat/quakestat])
1235 fi
1237 AC_PATH_PROG(PATH_TO_FPING,fping)
1238 if test -x "$PATH_TO_FPING"
1239 then
1240         AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1241         EXTRAS="$EXTRAS check_fping"
1242 else
1243         AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1244 fi
1246 AC_PATH_PROG(PATH_TO_SSH,ssh)
1248 if test -x "$PATH_TO_SSH"
1249 then
1250         AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1251         EXTRAS="$EXTRAS check_by_ssh"
1252 else
1253         AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1254 fi
1257 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1258 if test -x "$PATH_TO_MAILQ"
1259 then
1260         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1261 else
1262         AC_MSG_WARN([Could not find mailq or eqivalent])
1263 fi
1265 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1266 if test -x "$PATH_TO_QMAIL_QSTAT"
1267 then
1268         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1269 else
1270         AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1271 fi
1273 dnl SWAP info required is amount allocated/available and amount free
1274 dnl The plugin works through all the swap devices and adds up the total swap
1275 dnl available.
1277 dnl dunno why this does not work below - use hack (kbd)
1278 dnl fine on linux, broken on solaris
1279 dnl if /bin/test -e "/proc/meminfo"
1281 AC_PATH_PROG(PATH_TO_SWAP,swap)
1282 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1284 AC_MSG_CHECKING(for how to check memory)
1285 if [cat /proc/meminfo > /dev/null 2>&1]
1286 then
1287         AC_MSG_RESULT([found /proc/meminfo])
1288         AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1289         AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo",[path to /proc/meminfo if name changes])
1290         EXTRAS="$EXTRAS check_swap"
1292 elif [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1293 then
1294         ac_cv_have_swap=yes
1295         ac_cv_swap_command="$PATH_TO_SWAP -l"
1296         if [$PATH_TO_SWAP -l 2>/dev/null | \
1297                 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1298                 >/dev/null]
1299         then
1300                 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %d %d"]
1301                 ac_cv_swap_conv=2048
1302                 AC_MSG_RESULT([using IRIX format swap])
1304         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
1305         then
1306                 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
1307                 ac_cv_swap_conv=2048
1308                 AC_MSG_RESULT([using Solaris format swap])
1310         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1311         then
1312                 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
1313                 ac_cv_swap_conv=2048
1314                 AC_MSG_RESULT([using Unixware format swap])
1316         fi
1317         EXTRAS="$EXTRAS check_swap"
1319 elif [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1320 then
1321         ac_cv_have_swap=yes
1322         ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1324         if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1325         then
1326                 ac_cv_swap_format=["%*s %d %*d %d"]
1327                 ac_cv_swap_conv=1024
1328                 AC_MSG_RESULT([using FreeBSD format swapinfo])
1329         fi
1330         EXTRAS="$EXTRAS check_swap"
1332 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1333 then
1334         ac_cv_have_swap=yes
1335         ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
1336         ac_cv_swap_format=["%*s %d %*d %d"]
1337         ac_cv_swap_conv=1024
1338         AC_MSG_RESULT([using HP-UX format swapinfo])
1339 fi
1341 if test "x$ac_cv_have_swap" != "x" 
1342 then
1343         AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1344 fi
1345 if test "x$ac_cv_swap_command" != "x" 
1346 then
1347         AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1348                 [Path to swap/swapinfo binary, with any args])
1349         AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1350                 [Format string for parsing swap output])
1351         AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1352                 [Conversion factor to MB])
1353 fi
1355 AC_PATH_PROG(PATH_TO_DIG,dig)
1356 AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1357 if test -n "$PATH_TO_DIG"; then
1358         EXTRAS="$EXTRAS check_dig"
1359 fi
1361 if test -f plugins/check_nt.c ; then
1362   EXTRAS="$EXTRAS check_nt"
1363 elif test -f ../plugins/check_nt.c ; then
1364   EXTRAS="$EXTRAS check_nt"
1365 fi
1367 AC_MSG_CHECKING(for va_list)
1368 AC_TRY_COMPILE([#ifdef __STDC__
1369                 #include <stdio.h>
1370                 #include <stdlib.h>
1371                 #include <stdarg.h>
1372                 #else
1373                 #include <sys/types.h>
1374                 #include <stdio.h>
1375                 #include <varargs.h>
1376                 #endif],
1377                 [va_list args;],
1378                 [AC_MSG_RESULT(yes)],
1379                 [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
1381 AC_SUBST(EXTRAS)
1382 AC_SUBST(EXTRA_NETOBJS)
1383 AC_SUBST(DEPLIBS)
1385 AM_GNU_GETTEXT_VERSION(0.11.4)
1386 AM_GNU_GETTEXT
1388 AC_OUTPUT(Makefile lib/Makefile plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl pkg/solaris/pkginfo intl/Makefile po/Makefile.in )
1390 ACX_FEATURE([with],[cgiurl])
1391 ACX_FEATURE([with],[nagios-user])
1392 ACX_FEATURE([with],[nagios-group])
1393 ACX_FEATURE([with],[trusted-path])
1394 ACX_FEATURE([with],[df-command])
1395 ACX_FEATURE([with],[ping-command])
1396 ACX_FEATURE([with],[ping6-command])
1397 ACX_FEATURE([with],[lwres])
1398 ACX_FEATURE([with],[ipv6])
1399 ACX_FEATURE([enable],[emulate-getaddrinfo])