Code

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