Code

Fixed SUPPORT message
[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       AC_SUBST(SSLLIBS)
456       AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
457     fi
458   fi
459 fi
460 CPPFLAGS="$_SAVEDCPPFLAGS"
462 dnl
463 dnl Checks for header files.
464 dnl
466 AC_HEADER_STDC
467 AC_HEADER_TIME
468 AC_HEADER_SYS_WAIT
469 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)
470 AC_CHECK_HEADERS(stdarg.h sys/unistd.h ctype.h stdlib.h)
471 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)
473 # Define HAVE_INTTYPES_H if <inttypes.h> exists,
474 # doesn't clash with <sys/types.h>, and declares uintmax_t.
476 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
477 [AC_TRY_COMPILE(
478   [#include <sys/types.h>
479 #include <inttypes.h>],
480   [uintmax_t i = (uintmax_t) -1;],
481   jm_ac_cv_header_inttypes_h=yes,
482   jm_ac_cv_header_inttypes_h=no)])
484 if test $jm_ac_cv_header_inttypes_h = yes; then
485   AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
486 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
487    and declares uintmax_t. ])
488 fi
490 # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
491 # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
492 # enable the work-around code in fsusage.c.
493 AC_MSG_CHECKING([for statfs that truncates block counts])
494 AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
495 [AC_TRY_COMPILE([
496 #if !defined(sun) && !defined(__sun)
497 choke -- this is a workaround for a Sun-specific problem
498 #endif
499 #include <sys/types.h>
500 #include <sys/vfs.h>],
501 [struct statfs t; long c = *(t.f_spare);],
502 fu_cv_sys_truncating_statfs=yes
503 AC_MSG_RESULT(yes),
504 fu_cv_sys_truncating_statfs=no
505 AC_MSG_RESULT(no),
506 )])
507 if test $fu_cv_sys_truncating_statfs = yes; then
508   AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
509 [  Define if the block counts reported by statfs may be truncated to 2GB
510    and the correct values may be stored in the f_spare array.
511    (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
512    SunOS 4.1.1 seems not to be affected.)])
513 fi
515 dnl Checks for typedefs, structures, and compiler characteristics.
516 AC_C_CONST
517 AC_STRUCT_TM
518 AC_TYPE_PID_T
519 AC_TYPE_SIZE_T
520 AC_TYPE_SIGNAL
522 AC_CHECK_SIZEOF(int,cross)
523 AC_CHECK_SIZEOF(long,cross)
524 AC_CHECK_SIZEOF(short,cross)
526 AC_CACHE_CHECK([for long long],ac_cv_have_longlong,[
527 AC_TRY_RUN([#include <stdio.h>
528 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
529 ac_cv_have_longlong=yes,ac_cv_have_longlong=no,ac_cv_have_longlong=cross)])
530 if test x"$ac_cv_have_longlong" = x"yes"; then
531     AC_DEFINE(HAVE_LONGLONG,1,[Define if system has long long type])
532 fi
535 # Check if the compiler supports the LL prefix on long long integers.
536 # AIX needs this.
538 AC_CACHE_CHECK([for LL suffix on long long integers],ac_cv_compiler_supports_ll, [
539     AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
540         ac_cv_compiler_supports_ll=yes,ac_cv_compiler_supports_ll=no)])
541 if test x"$ac_cv_compiler_supports_ll" = x"yes"; then
542    AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Define if compiler support long long])
543 fi
545 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE_VA_COPY,[
546 AC_TRY_LINK([#include <stdarg.h>
547 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
548 ac_cv_HAVE_VA_COPY=yes,ac_cv_HAVE_VA_COPY=no)])
549 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
550     AC_DEFINE(HAVE_VA_COPY,1,[Define if system has va_copy])
551 fi
553 AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
554 AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
555 AC_TRY_RUN([
556 #include <sys/types.h>
557 #include <stdarg.h>
558 void foo(const char *format, ...) { 
559        va_list ap;
560        int len;
561        char buf[5];
563        va_start(ap, format);
564        len = vsnprintf(buf, 0, format, ap);
565        va_end(ap);
566        if (len != 5) exit(1);
568        va_start(ap, format);
569        len = vsnprintf(0, 0, format, ap);
570        va_end(ap);
571        if (len != 5) exit(1);
573        if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
575        exit(0);
577 main() { foo("hello"); }
578 ],
579 ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
580 if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
581     AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
582 fi
584 AC_TRY_COMPILE([#include <sys/time.h>],
585                [struct timeval *tv;
586                 struct timezone *tz;],
587                AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
588                AC_TRY_COMPILE([#include <sys/time.h>],
589                               [struct timeval *tv;
590                                struct timezone *tz;
591                                gettimeofday(tv, tz);],
592                               AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
593                               AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
595 dnl Checks for library functions.
596 AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
598 AC_MSG_CHECKING(return type of socket size)
599 AC_TRY_COMPILE([#include <stdlib.h>
600                 #include <sys/types.h>
601                 #include <sys/socket.h>],
602                [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
603                ac_cv_socket_size_type=["size_t"]
604                 AC_MSG_RESULT(size_t),
605                ac_cv_socket_size_type=["int"]
606                 AC_MSG_RESULT(int))
608 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
609         [Define type of socket size])
611 if test -f "/proc/loadavg"
612 then
613   AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
614   AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
615 fi
617 dnl #### Process table test
619 AC_PATH_PROG(PATH_TO_PS,ps)
621 AC_MSG_CHECKING(for ps syntax)
622 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
623 dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
624 if ps -axwo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
625         egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
626 then
627         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
628         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid ppid vsz rss pcpu comm args'"
629         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
630         EXTRAS="$EXTRAS check_nagios"
631         AC_MSG_RESULT([$ac_cv_ps_command])
633 dnl  STAT UCOMM              VSZ   RSS USER       UID  PPID COMMAND
634 elif ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
635         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
636 then
637         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
638         ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid ppid vsz rss pcpu comm args'"
639         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
640         EXTRAS="$EXTRAS check_nagios"
641         AC_MSG_RESULT([$ac_cv_ps_command])
643 dnl FreeBSD
644 elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | \
645         egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"] >/dev/null
646 then
647         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
648         ac_cv_ps_command="$PATH_TO_PS waxco 'state uid ppid vsz rss pcpu command command'"
649         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
650         EXTRAS="$EXTRAS check_nagios"
651         AC_MSG_RESULT([$ac_cv_ps_command])
653 dnl BSD-like mode in RH 6.1
654 elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \
655         egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
656 then
657         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
658         ac_cv_ps_command="$PATH_TO_PS waxno 'state uid ppid vsz rss pcpu comm args'"
659         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
660         EXTRAS="$EXTRAS check_nagios"
661         AC_MSG_RESULT([$ac_cv_ps_command])
663 dnl SunOS 4.1.3:
664 dnl  F  UID  PID  PPID  CP  PRI  NI  SZ  RSS  WCHAN  STAT  TT  TIME  COMMAND
665 elif ps -laxnwww 2>/dev/null | \
666         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
667 then
668         ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
669         ac_cv_ps_command="$PATH_TO_PS -laxnwww"
670         ac_cv_ps_format="%*s %d %*s %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
671         EXTRAS="$EXTRAS check_nagios"
672         AC_MSG_RESULT([$ac_cv_ps_command])
674 dnl Debian Linux / procps v1.2.9:
675 dnl  FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
676 dnl    100     0     1     0   0   0    776    76  c0131c8c   S  ffff  0:11 init [2]
677 dnl
678 elif ps laxnwww 2>/dev/null | \
679         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
680 then
681         ac_cv_ps_varlist="[&procuid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
682         ac_cv_ps_command="$PATH_TO_PS laxnwww"
683         ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
684         EXTRAS="$EXTRAS check_nagios"
685         AC_MSG_RESULT([$ac_cv_ps_command])
687 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
688 elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
689         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
690 then
691         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
692         ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid ppid vsz rss pcpu comm args'"
693         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
694         EXTRAS="$EXTRAS check_nagios"
695         AC_MSG_RESULT([$ac_cv_ps_command])
697 dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT
698 elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
699         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
700 then
701         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
702         ac_cv_ps_command="$PATH_TO_PS -ao 'stat uid ppid vsz rss pcpu comm args'"
703         ac_cv_ps_format="[["%s%*[ +] %d %d %d %d %f %s %n"]]"
704         EXTRAS="$EXTRAS check_nagios"
705         AC_MSG_RESULT([$ac_cv_ps_command])
707 elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \
708         egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
709 then
710         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
711         ac_cv_ps_command="$PATH_TO_PS -eo 's uid ppid vsz rss pcpu comm args'"
712         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
713         EXTRAS="$EXTRAS check_nagios"
714         AC_MSG_RESULT([$ac_cv_ps_command])
716 elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \
717         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
718 then
719         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
720         ac_cv_ps_command="$PATH_TO_PS -Ao 's uid ppid vsz rss pcpu comm args'"
721         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
722         EXTRAS="$EXTRAS check_nagios"
723         AC_MSG_RESULT([$ac_cv_ps_command])
725 elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \
726         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
727 then
728         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
729         ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid ppid vsz rss pcpu comm args'"
730         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
731         EXTRAS="$EXTRAS check_nagios"
732         AC_MSG_RESULT([$ac_cv_ps_command])
734 elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \
735         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
736 then
737         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
738         ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid ppid vsz rss pcpu comm args'"
739         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
740         EXTRAS="$EXTRAS check_nagios"
741         AC_MSG_RESULT([$ac_cv_ps_command])
743 dnl wonder who takes state instead of stat
744 elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \
745         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
746 then
747         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
748         ac_cv_ps_command="$PATH_TO_PS -ao 'state uid ppid vsz rss pcpu command args'"
749         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
750         EXTRAS="$EXTRAS check_nagios"
751         AC_MSG_RESULT([$ac_cv_ps_command])
753 dnl IRIX 53
754 elif ps -el 2>/dev/null | \
755         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
756 then
757         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&pos,procprog]"
758         ac_cv_ps_command="$PATH_TO_PS -el"
759         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
760         AC_MSG_RESULT([$ac_cv_ps_command])
762 dnl IRIX 63
763 elif ps -el 2>/dev/null | \
764         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
765 then
766         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
767         ac_cv_ps_command="$PATH_TO_PS -el"
768         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
769         AC_MSG_RESULT([$ac_cv_ps_command])
771 dnl AIX 4.1:
772 dnl     F S      UID   PID  PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
773 dnl    303 A        0     0     0 120  16 -- 1c07  20   24              -  0:45 swapper
774 elif ps -el 2>/dev/null | \
775         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
776 then
777         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
778         ac_cv_ps_command="$PATH_TO_PS -el"
779         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
780         AC_MSG_RESULT([$ac_cv_ps_command])
782 dnl AIX?
783 elif ps glaxen 2>/dev/null | \
784         egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
785 then
786         ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
787         ac_cv_ps_command="$PATH_TO_PS glaxen"
788         ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
789         AC_MSG_RESULT([$ac_cv_ps_command])
791 dnl MacOSX / Darwin
792 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
793 dnl Some truncation will happen in UCOMM column
794 dnl STAT      VSZ    RSS   UID  PPID %CPU UCOMM            COMMAND
795 dnl Ss      52756  22496   501     1   6.9 Window Manager   /System/Library/CoreServices/WindowServer -daemon
796 elif ps wwaxo 'state vsz rss uid ppid pcpu ucomm command' 2>/dev/null | \
797         egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
798 then
799         ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid ppid pcpu ucomm command'"
800         ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procppid,&procpcpu,procprog,&pos]"
801         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
802         EXTRAS="$EXTRAS check_nagios"
803         AC_MSG_RESULT([$ac_cv_ps_command])
805 dnl UnixWare 
806 elif ps -Al 2>/dev/null | \
807         egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
808 then
809         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
810         ac_cv_ps_command="$PATH_TO_PS -Al"
811         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
812         #if ps -Ao 'vsz comm' 2>/dev/null | \
813         #       egrep -i ["^ *VSZ +COMMAND"] >/dev/null
814         #then
815         #       ac_cv_vsz_command="$PATH_TO_PS -Ao 'vsz comm'"
816         #       ac_cv_vsz_format="%*s %d"
817         #fi
818         AC_MSG_RESULT([$ac_cv_ps_command])
820 else
821         AC_MSG_WARN([unable to find usable ps syntax])
822 fi
824 AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
825         [Variable list for sscanf of 'ps' output])
826 AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
827         [Verbatim command to execute for ps in check_procs])
828 AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
829         [Format string for scanning ps output in check_procs])
831 AC_PATH_PROG(PATH_TO_DF,df)
832 AC_PATH_PROG(PATH_TO_BDF,bdf)
834 AC_ARG_WITH(df_command,
835         ACX_HELP_STRING([--with-df-command=SYNTAX],
836                 [sets syntax for df]),
837         with_df_command=$withval,)
839 AC_MSG_CHECKING(for df syntax)
840 if test -n "$with_df_command"
841 then
842         AC_MSG_RESULT([$with_df_command])
844 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
845 then
846         with_df_command="$PATH_TO_DF -Pk"
847         AC_MSG_RESULT([$with_df_command])
849 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
850 then
851         with_df_command="$PATH_TO_DF -k"
852         AC_MSG_RESULT([$with_df_command])
854 elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
855 then
856         with_df_command="$PATH_TO_DF"
857         AC_MSG_RESULT([$with_df_command])
859 elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
860 then
861         with_df_command="$PATH_TO_BDF"
862         AC_MSG_RESULT([$with_df_command])
864 else
865         AC_MSG_WARN([unable to find usable df syntax])
866 fi
868 AC_DEFINE_UNQUOTED(DF_COMMAND,"$with_df_command",[path and args for df command])
870 dnl jm_AFS
871 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
872 jm_FSTYPENAME
873 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
875 AC_PATH_PROG(PATH_TO_PING,ping)
876 AC_PATH_PROG(PATH_TO_PING6,ping6)
878 AC_ARG_WITH(ping_command,
879         ACX_HELP_STRING([--with-ping-command=SYNTAX],
880                 [sets syntax for ICMP ping]),
881         with_ping_command=$withval,)
883 AC_MSG_CHECKING(for ICMP ping syntax)
884 ac_cv_ping_packets_first=no
885 if test -n "$with_ping_command"
886 then
887         AC_MSG_RESULT([(command-line) $with_ping_command])
888         if test -n "$ac_cv_ping_packets_first"
889         then
890                 ac_cv_ping_packets_first=yes
891         fi
893 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
894         $PATH_TO_PING -n -s 127.0.0.1 56 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 -U -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 -U -c %d %s"
905         ac_cv_ping_packets_first=yes
906         AC_MSG_RESULT([$with_ping_command])
908 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
909         egrep -i "^round-trip|^rtt" >/dev/null
910 then
911         with_ping_command="$PATH_TO_PING -n -c %d %s"
912         ac_cv_ping_packets_first=yes
913         AC_MSG_RESULT([$with_ping_command])
915 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
916         egrep -i "^round-trip|^rtt" >/dev/null
917 then
918         with_ping_command="$PATH_TO_PING -n %s -c %d"
919         AC_MSG_RESULT([$with_ping_command])
921 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
922         egrep -i "^round-trip|^rtt" >/dev/null
923 then
924         with_ping_command="$PATH_TO_PING %s -n %d"
925         AC_MSG_RESULT([$with_ping_command])
927 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
928         egrep -i "^round-trip|^rtt" >/dev/null
929 then
930         with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
931         AC_MSG_RESULT([$with_ping_command])
933 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
934         egrep -i "^round-trip|^rtt" >/dev/null
935 then
936         with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
937         AC_MSG_RESULT([$with_ping_command])
939 elif $PATH_TO_PING -n -s 56 -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 -s 56 -c %d %s"
943         ac_cv_ping_packets_first=yes
944         AC_MSG_RESULT([$with_ping_command])
946 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
947         egrep -i "^round-trip|^rtt" >/dev/null
948 then
949         with_ping_command="$PATH_TO_PING -n -c %d %s"
950         ac_cv_ping_packets_first=yes
951         AC_MSG_RESULT([$with_ping_command])
953 else
954         AC_MSG_WARN([unable to find usable ping syntax])
955 fi
957 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
958         [path and args for ICMP ping command])
960 if test "x$ac_cv_ping_packets_first" != "xno"
961 then
962         AC_DEFINE(PING_PACKETS_FIRST,1,
963                 [Define if packet count must precede host])
964 fi
966 AC_ARG_WITH(ping6_command,
967         ACX_HELP_STRING([--with-ping6-command=SYNTAX],
968                 [sets syntax for ICMPv6 ping]),
969         with_ping6_command=$withval,)
971 if test x"$with_ipv6" != xno ; then
972 AC_MSG_CHECKING(for ICMPv6 ping syntax)
973 ac_cv_ping6_packets_first=no
974 if test -n "$with_ping6_command"
975 then
976         AC_MSG_RESULT([(command-line) $with_ping6_command])
977         if test -n "$ac_cv_ping6_packets_first"
978         then
979                 ac_cv_ping6_packets_first=yes
980         fi
982 elif test "x$PATH_TO_PING6" != "x"; then
983         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
984                 $PATH_TO_PING6 -n -s ::1 56 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 -U -c 1 ::1 2>/dev/null | \
992                 egrep -i "^round-trip|^rtt" >/dev/null
993         then
994                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
995                 ac_cv_ping6_packets_first=yes
996                 AC_MSG_RESULT([$with_ping6_command])
998         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
999                 egrep -i "^round-trip|^rtt" >/dev/null
1000         then
1001                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1002                 ac_cv_ping6_packets_first=yes
1003                 AC_MSG_RESULT([$with_ping6_command])
1005         elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
1006                 egrep -i "^round-trip|^rtt" >/dev/null
1007         then
1008                 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1009                 AC_MSG_RESULT([$with_ping6_command])
1011         elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1012                 egrep -i "^round-trip|^rtt" >/dev/null
1013         then
1014                 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1015                 AC_MSG_RESULT([$with_ping6_command])
1017         elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1018                 egrep -i "^round-trip|^rtt" >/dev/null
1019         then
1020                 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1021                 AC_MSG_RESULT([$with_ping6_command])
1023         elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1024                 egrep -i "^round-trip|^rtt" >/dev/null
1025         then
1026                 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1027                 AC_MSG_RESULT([$with_ping6_command])
1029         elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1030                 egrep -i "^round-trip|^rtt" >/dev/null
1031         then
1032                 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1033                 ac_cv_ping6_packets_first=yes
1034                 AC_MSG_RESULT([$with_ping_command])
1036         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1037                 egrep -i "^round-trip|^rtt" >/dev/null
1038         then
1039                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1040                 ac_cv_ping6_packets_first=yes
1041                 AC_MSG_RESULT([$with_ping6_command])
1043         fi
1045 elif test "x$PATH_TO_PING" != "x"; then
1046         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1047                 $PATH_TO_PING -A inet6 -n -s ::1 56 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 -U -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 -U -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 -c 1 ::1 2>/dev/null | \
1062                 egrep -i "^round-trip|^rtt" >/dev/null
1063         then
1064                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1065                 ac_cv_ping6_packets_first=yes
1066                 AC_MSG_RESULT([$with_ping6_command])
1068         elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1069                 egrep -i "^round-trip|^rtt" >/dev/null
1070         then
1071                 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1072                 AC_MSG_RESULT([$with_ping6_command])
1074         elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1075                 egrep -i "^round-trip|^rtt" >/dev/null
1076         then
1077                 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1078                 AC_MSG_RESULT([$with_ping6_command])
1080         elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1081                 egrep -i "^round-trip|^rtt" >/dev/null
1082         then
1083                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1084                 AC_MSG_RESULT([$with_ping6_command])
1086         elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1087                 egrep -i "^round-trip|^rtt" >/dev/null
1088         then
1089                 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1090                 AC_MSG_RESULT([$with_ping6_command])
1092         elif $PATH_TO_PING -A inet6 -n -s 56 -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 -s 56 -c %d %s"
1096                 ac_cv_ping6_packets_first=yes
1097                 AC_MSG_RESULT([$with_ping_command])
1099         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1100                 egrep -i "^round-trip|^rtt" >/dev/null
1101         then
1102                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1103                 ac_cv_ping6_packets_first=yes
1104                 AC_MSG_RESULT([$with_ping6_command])
1106         fi
1108 fi
1110 if test "x$with_ping6_command" != "x"; then
1111         AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1112                 [path and args for ICMPv6 ping command])
1113 else
1114         AC_MSG_RESULT([none])
1115 fi
1117 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1118         AC_DEFINE(PING6_PACKETS_FIRST,1,
1119                 [Define if packet count must precede host])
1120 fi
1121 fi
1123 AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1125 AC_MSG_CHECKING(for nslookup syntax)
1126 if test -n "$PATH_TO_NSLOOKUP"
1127 then
1128         if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1129         then
1130                 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1131                 AC_MSG_RESULT([$ac_cv_nslookup_command])
1133         else
1134                 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1135                 AC_MSG_RESULT([$ac_cv_nslookup_command])
1137         fi
1138         EXTRAS="$EXTRAS check_dns"
1140 else
1141         AC_MSG_WARN([nslookup command not found])
1142 fi
1144 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command",
1145         [path and args for nslookup])
1147 AC_PATH_PROG(PATH_TO_HOST,host)
1148 if test -n "$ac_cv_path_PATH_TO_HOST"
1149 then
1150         EXTRAS="$EXTRAS check_dns"
1151 fi
1153 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1154 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1156 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1157 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1159 AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
1160 AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
1161 AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
1162 if (test -x "$PATH_TO_NTPDATE" || test -x "$PATH_TO_NTPQ")
1163 then
1164         AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
1165         AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
1166 else
1167         AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
1168 fi
1170 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1171 if test -x "$PATH_TO_LMSTAT"
1172 then
1173         AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1174 else
1175         AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1176 fi
1178 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1179 if test -x "$PATH_TO_SMBCLIENT"
1180 then
1181         AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1182 else
1183         AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1184 fi
1187 AC_PATH_PROG(PATH_TO_WHO,who)
1189 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1190 then
1191         ac_cv_path_to_who="$PATH_TO_WHO -q"
1192 else
1193         ac_cv_path_to_who="$PATH_TO_WHO"
1194 fi
1196 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1197         [path and arguments for invoking 'who'])
1199 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1200 if test -x "$PATH_TO_SNMPGET"
1201 then
1202         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1203         EXTRAS="$EXTRAS check_hpjd check_snmp"
1204 else
1205         AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1206 fi
1208 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1209 if test -x "$PATH_TO_SNMPGETNEXT"
1210 then
1211         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1212 fi
1214 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )
1215 then
1216         AC_MSG_CHECKING(for Net::SNMP perl module)
1217         AC_MSG_RESULT([found])
1218 else
1219         AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1220 fi
1222 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1223 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1225 if test -x "$PATH_TO_QUAKESTAT"
1226 then
1227         ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1228         EXTRAS="$EXTRAS check_game"
1230 elif test -x "$PATH_TO_QSTAT"
1231 then
1232         ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1233         EXTRAS="$EXTRAS check_game"
1234 else
1235         AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1236 fi
1238 if test $ac_cv_path_to_qstat 
1239 then
1240         AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1241                 [path to qstat/quakestat])
1242 fi
1244 AC_PATH_PROG(PATH_TO_FPING,fping)
1245 if test -x "$PATH_TO_FPING"
1246 then
1247         AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1248         EXTRAS="$EXTRAS check_fping"
1249 else
1250         AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1251 fi
1253 AC_PATH_PROG(PATH_TO_SSH,ssh)
1255 if test -x "$PATH_TO_SSH"
1256 then
1257         AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1258         EXTRAS="$EXTRAS check_by_ssh"
1259 else
1260         AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1261 fi
1264 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1265 if test -x "$PATH_TO_MAILQ"
1266 then
1267         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1268 else
1269         AC_MSG_WARN([Could not find mailq or eqivalent])
1270 fi
1272 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1273 if test -x "$PATH_TO_QMAIL_QSTAT"
1274 then
1275         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1276 else
1277         AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1278 fi
1280 dnl SWAP info required is amount allocated/available and amount free
1281 dnl The plugin works through all the swap devices and adds up the total swap
1282 dnl available.
1284 dnl dunno why this does not work below - use hack (kbd)
1285 dnl fine on linux, broken on solaris
1286 dnl if /bin/test -e "/proc/meminfo"
1288 AC_PATH_PROG(PATH_TO_SWAP,swap)
1289 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1291 AC_MSG_CHECKING(for how to check memory)
1292 if [cat /proc/meminfo > /dev/null 2>&1]
1293 then
1294         AC_MSG_RESULT([found /proc/meminfo])
1295         AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1296         AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo",[path to /proc/meminfo if name changes])
1297         EXTRAS="$EXTRAS check_swap"
1299 elif [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1300 then
1301         ac_cv_have_swap=yes
1302         ac_cv_swap_command="$PATH_TO_SWAP -l"
1303         if [$PATH_TO_SWAP -l 2>/dev/null | \
1304                 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1305                 >/dev/null]
1306         then
1307                 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %d %d"]
1308                 ac_cv_swap_conv=2048
1309                 AC_MSG_RESULT([using IRIX format swap])
1311         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
1312         then
1313                 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
1314                 ac_cv_swap_conv=2048
1315                 AC_MSG_RESULT([using Solaris format swap])
1317         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1318         then
1319                 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
1320                 ac_cv_swap_conv=2048
1321                 AC_MSG_RESULT([using Unixware format swap])
1323         fi
1324         EXTRAS="$EXTRAS check_swap"
1326 elif [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1327 then
1328         ac_cv_have_swap=yes
1329         ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1331         if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1332         then
1333                 ac_cv_swap_format=["%*s %d %*d %d"]
1334                 ac_cv_swap_conv=1024
1335                 AC_MSG_RESULT([using FreeBSD format swapinfo])
1336         fi
1337         EXTRAS="$EXTRAS check_swap"
1339 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1340 then
1341         ac_cv_have_swap=yes
1342         ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
1343         ac_cv_swap_format=["%*s %d %*d %d"]
1344         ac_cv_swap_conv=1024
1345         AC_MSG_RESULT([using HP-UX format swapinfo])
1346 fi
1348 if test "x$ac_cv_have_swap" != "x" 
1349 then
1350         AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1351 fi
1352 if test "x$ac_cv_swap_command" != "x" 
1353 then
1354         AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1355                 [Path to swap/swapinfo binary, with any args])
1356         AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1357                 [Format string for parsing swap output])
1358         AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1359                 [Conversion factor to MB])
1360 fi
1362 AC_PATH_PROG(PATH_TO_DIG,dig)
1363 AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1364 if test -n "$PATH_TO_DIG"; then
1365         EXTRAS="$EXTRAS check_dig"
1366 fi
1368 if test -f plugins/check_nt.c ; then
1369   EXTRAS="$EXTRAS check_nt"
1370 elif test -f ../plugins/check_nt.c ; then
1371   EXTRAS="$EXTRAS check_nt"
1372 fi
1374 AC_MSG_CHECKING(for va_list)
1375 AC_TRY_COMPILE([#ifdef __STDC__
1376                 #include <stdio.h>
1377                 #include <stdlib.h>
1378                 #include <stdarg.h>
1379                 #else
1380                 #include <sys/types.h>
1381                 #include <stdio.h>
1382                 #include <varargs.h>
1383                 #endif],
1384                 [va_list args;],
1385                 [AC_MSG_RESULT(yes)],
1386                 [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
1388 AC_SUBST(EXTRAS)
1389 AC_SUBST(EXTRA_NETOBJS)
1390 AC_SUBST(DEPLIBS)
1392 AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version])
1394 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)
1396 ACX_FEATURE([with],[cgiurl])
1397 ACX_FEATURE([with],[nagios-user])
1398 ACX_FEATURE([with],[nagios-group])
1399 ACX_FEATURE([with],[trusted-path])
1400 ACX_FEATURE([with],[df-command])
1401 ACX_FEATURE([with],[ping-command])
1402 ACX_FEATURE([with],[ping6-command])
1403 ACX_FEATURE([with],[lwres])
1404 ACX_FEATURE([with],[ipv6])
1405 ACX_FEATURE([enable],[emulate-getaddrinfo])