Code

Support for OpenBSD 3.2 & 3.3 ps (Julien Touche)
[nagiosplug.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION ($Revision$)
3 AC_INIT(Helper.pm)
4 VER=1.3.99
5 REL=1
6 AC_SUBST(VER)
7 AC_SUBST(REL)
8 PACKAGE_VERSION="${VER}"
9 AC_SUBST(PACKAGE_VERSION)
10 PACKAGE_RELEASE="${REL}"
11 AC_SUBST(PACKAGE_RELEASE)
12 AM_INIT_AUTOMAKE(nagios-plugins,${PACKAGE_VERSION})
13 AM_CONFIG_HEADER(plugins/config.h)
14 AC_CANONICAL_HOST
16 AC_PREFIX_DEFAULT(/usr/local/nagios)
18 dnl Figure out how to invoke "install" and what install options to use.
20 AC_PROG_INSTALL
21 AC_SUBST(INSTALL)
23 AC_PROG_CC
24 AC_PROG_CPP
25 AC_PROG_GCC_TRADITIONAL
26 AC_PROG_RANLIB
27 AC_AIX
28 AC_MINIX
30 AC_PROG_MAKE_SET
31 AC_PROG_AWK
33 saved_srcdir=$srcdir
34 srcdir=$srcdir/lib
35 test -f $srcdir/getloadavg.c \
36   || AC_MSG_ERROR([getloadavg.c is not in $srcdir])
37 AC_FUNC_GETLOADAVG
38 srcdir=$saved_srcdir
40 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
41 dnl AM_WITH_REGEX
42 AC_PROG_RANLIB
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, use output from the --version option of the plugin itself)."
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   EXTRAS="$EXTRAS check_ldap"
209 else
210   AC_MSG_WARN([Skipping LDAP plugin])
211   AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
212 fi
213 LIBS="$_SAVEDLIBS"
216 dnl Check for mysql libraries
217 _SAVEDLIBS="$LIBS"
218 _SAVEDCPPFLAGS="$CPPFLAGS"
219 AC_ARG_WITH(mysql,
220         ACX_HELP_STRING([--with-mysql=DIR],
221                 [sets path to mysql installation (assumes lib/mysql and include subdirs]),
222         MYSQL=$withval,)
223 if test -n "$MYSQL"; then
224   MYSQLLIBDIR=$MYSQL/lib/mysql
225   CPPFLAGS="-I$MYSQL/include"
226   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
227   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
228 elif test -f /usr/lib/libmysqlclient.so; then
229   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
230   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
231 elif test -f /usr/lib/libmysqlclient.a; then
232   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
233   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
234 elif test -f /usr/lib/mysql/libmysqlclient.so; then
235   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
236   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
237 elif test -f /usr/lib/mysql/libmysqlclient.a; then
238   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
239   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
240 fi
241 if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
242   AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
243   if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
244     EXTRAS="$EXTRAS check_mysql"
245     AC_SUBST(MYSQLINCLUDE)
246     AC_SUBST(MYSQLLIBS)
247     AC_SUBST(check_mysql_LDFLAGS)
248   else
249     AC_MSG_WARN([Skipping mysql plugin])
250     AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
251   fi
252 else
253   AC_MSG_WARN([Skipping mysql plugin])
254   AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
255 fi
256 CPPFLAGS="$_SAVEDCPPFLAGS"
257 LIBS="$_SAVEDLIBS"
259 dnl Check for OpenSSL location
260 AC_PATH_PROG(OPENSSL,openssl)
261 if test "$OPENSSL" = "/usr/bin/openssl"; then
262   OPENSSL=/usr
263 elif test "$OPENSSL" = "/usr/sbin/openssl"; then
264   OPENSSL=/usr
265 elif test "$OPENSSL" = "/opt/bin/openssl"; then
266   OPENSSL=/opt
267 elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
268   OPENSSL=/opt/openssl
269 elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
270   OPENSSL=/usr/slocal
271 elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
272   OPENSSL=/usr/local
273 elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
274   OPENSSL=/usr/local/ssl
275 fi
276 AC_ARG_WITH(openssl,
277         ACX_HELP_STRING([--with-openssl=DIR],
278                 [sets path to openssl installation]),
279         OPENSSL=$withval,)
281 AC_CHECK_HEADERS(unistd.h)
283 dnl Check for AF_INET6 support - unistd.h required for Darwin
284 AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
285         AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
286                         #include <unistd.h>
287                         #endif
288                         #include <netinet/in.h>
289                         #include <sys/socket.h>],
290                         [struct sockaddr_in6 sin6;
291                         void *p;
293                         sin6.sin6_family = AF_INET6;
294                         sin6.sin6_port = 587;
295                         p = &sin6.sin6_addr;],
296                         [with_ipv6=yes], 
297                         [with_ipv6=no])
298         ])
300 if test x"$with_ipv6" != xno ; then
301         AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
302 fi
304 dnl #########################################################################
305 dnl Check if Posix getaddrinfo() is available.  It is also possible to use
306 dnl the version from the lwres library distributed with BIND.
307 dnl #########################################################################
308 AC_ARG_ENABLE([emulate-getaddrinfo],
309               ACX_HELP_STRING([--enable-emulate-getaddrinfo],
310                              [enable getaddrinfo emulation (default=no)]),
311               ,
312               enable_emulate_getaddrinfo=no)
314 AC_ARG_WITH(lwres,
315             ACX_HELP_STRING([--with-lwres=DIR],
316                            [use lwres library for getaddrinfo (default=no)]),
317             ,
318             with_lwres=no)
320 dnl ## enable force to test getaddrinfo.c
321 if test x$enable_emulate_getaddrinfo = xforce ; then
322         enable_emulate_getaddrinfo=yes
323         have_getaddrinfo=no
324 else
326 have_getaddrinfo=no
327 if test x$with_lwres != xno ; then
328         if test "$with_lwres" != yes ; then
329                    CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
330                    LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
331         fi
332         AC_CHECK_HEADERS(lwres/netdb.h, ,
333                         [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
334         AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
335                      [AC_MSG_ERROR([cannot find the lwres library])],
336                      -lnsl -lpthread)
337         have_getaddrinfo=yes
338 fi
340 if test x$have_getaddrinfo != xyes ; then
341         AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
342 fi
344 dnl # Special nonsense for systems that actually have getaddrinfo but
345 dnl # redefine the name to something else, e.g. OSF
346 if test x$have_getaddrinfo != xyes ; then
347         AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
348         AC_TRY_LINK([
349 #               include <netdb.h>
350         ], [
351                 struct addrinfo hints, *res;
352                 int err;
354                 err = getaddrinfo ("host", "service", &hints, &res);
355         ], [
356                 have_getaddrinfo=yes
357                 AC_MSG_RESULT(yes)
358         ], [AC_MSG_RESULT(no)])
359 fi
361 fi
363 if test x$have_getaddrinfo != xno ; then
364         if test x$enable_emulate_getaddrinfo != xno ; then
365                 AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
366         fi
367         AC_DEFINE(HAVE_GETADDRINFO, 1,
368                   [Does system provide RFC 2553/Posix getaddrinfo?])
369 else
370         if test x$enable_emulate_getaddrinfo != xyes ; then
371 dnl                AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
372                enable_emulate_getaddrinfo=yes
373                AC_MSG_WARN([enabling getaddrinfo emulation])
374         fi
375         EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
376 fi
378 if test x"$enable_emulate_getaddrinfo" != xno ; then
379     have_resolver=no
381   dnl  Try for getipnodebyname
382     AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
383     if test x"$have_resolver" != xno ; then
384          AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
385                    [Set when getipnodebyname is available])
386     fi
388   dnl  Try for gethostbyname_r
389     if test x"$have_resolver" = xno ; then
390         AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
391                        [have_resolver=yes
392                         ACX_WHICH_GETHOSTBYNAME_R])
393     fi
395   dnl  Try for gethostbyname
396     if test x"$have_resolver" = xno ; then
397         if test x"$enable_pthreads" != xno ; then
398             AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
399         fi
400         AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
401                        [AC_MSG_ERROR([cannot find gethostbyname])])
402     fi
403     EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
405 fi
407 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
408 if test "$FOUNDINCLUDE" = "no"; then
409   _SAVEDCPPFLAGS="$CPPFLAGS"
410   CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
411   unset ac_cv_header_krb5_h
412   AC_CHECK_HEADERS(krb5.h,
413                    KRB5INCLUDE="-I/usr/kerberos/include"
414                    FOUNDINCLUDE=yes,
415                    FOUNDINCLUDE=no)
416 fi
417 AC_SUBST(KRBINCLUDE)
418 if test "$FOUNDINCLUDE" = "no"; then
419   CPPFLAGS="$_SAVEDCPPFLAGS"
420 fi
422 dnl Check for OpenSSL header files
423 unset FOUNDINCLUDE
424 _SAVEDCPPFLAGS="$CPPFLAGS"
425 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
426 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
427                  SSLINCLUDE="-I$OPENSSL/include"
428                  FOUNDINCLUDE=yes,
429                  FOUNDINCLUDE=no)
430 if test "$FOUNDINCLUDE" = "no"; then
431   AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
432                    SSLINCLUDE="-I$OPENSSL/include"
433                    FOUNDINCLUDE=yes,
434                    FOUNDINCLUDE=no)
435 fi
436 AC_SUBST(SSLINCLUDE)
437 if test "$FOUNDINCLUDE" = "no"; then
438   CPPFLAGS="$_SAVEDCPPFLAGS"
439 fi
441 dnl Check for crypto lib
442 _SAVEDLIBS="$LIBS"
443 AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
444 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
445   dnl Check for SSL lib
446   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)
447 fi
448 LIBS="$_SAVEDLIBS"
450 dnl test headers and libs to decide whether check_http should use SSL
451 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
452   if test "$ac_cv_lib_ssl_main" = "yes"; then
453     if test "$FOUNDINCLUDE" = "yes"; then
454       AC_SUBST(SSLLIBS)
455       AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
456     fi
457   fi
458 fi
459 CPPFLAGS="$_SAVEDCPPFLAGS"
461 dnl
462 dnl Checks for header files.
463 dnl
465 AC_HEADER_STDC
466 AC_HEADER_TIME
467 AC_HEADER_SYS_WAIT
468 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)
469 AC_CHECK_HEADERS(stdarg.h sys/unistd.h ctype.h stdlib.h)
470 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)
472 # Define HAVE_INTTYPES_H if <inttypes.h> exists,
473 # doesn't clash with <sys/types.h>, and declares uintmax_t.
475 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
476 [AC_TRY_COMPILE(
477   [#include <sys/types.h>
478 #include <inttypes.h>],
479   [uintmax_t i = (uintmax_t) -1;],
480   jm_ac_cv_header_inttypes_h=yes,
481   jm_ac_cv_header_inttypes_h=no)])
483 if test $jm_ac_cv_header_inttypes_h = yes; then
484   AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
485 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
486    and declares uintmax_t. ])
487 fi
489 # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
490 # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
491 # enable the work-around code in fsusage.c.
492 AC_MSG_CHECKING([for statfs that truncates block counts])
493 AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
494 [AC_TRY_COMPILE([
495 #if !defined(sun) && !defined(__sun)
496 choke -- this is a workaround for a Sun-specific problem
497 #endif
498 #include <sys/types.h>
499 #include <sys/vfs.h>],
500 [struct statfs t; long c = *(t.f_spare);],
501 fu_cv_sys_truncating_statfs=yes
502 AC_MSG_RESULT(yes),
503 fu_cv_sys_truncating_statfs=no
504 AC_MSG_RESULT(no),
505 )])
506 if test $fu_cv_sys_truncating_statfs = yes; then
507   AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
508 [  Define if the block counts reported by statfs may be truncated to 2GB
509    and the correct values may be stored in the f_spare array.
510    (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
511    SunOS 4.1.1 seems not to be affected.)])
512 fi
514 dnl Checks for typedefs, structures, and compiler characteristics.
515 AC_C_CONST
516 AC_STRUCT_TM
517 AC_TYPE_PID_T
518 AC_TYPE_SIZE_T
519 AC_TYPE_SIGNAL
521 AC_CHECK_SIZEOF(int,cross)
522 AC_CHECK_SIZEOF(long,cross)
523 AC_CHECK_SIZEOF(short,cross)
525 AC_CACHE_CHECK([for long long],ac_cv_have_longlong,[
526 AC_TRY_RUN([#include <stdio.h>
527 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
528 ac_cv_have_longlong=yes,ac_cv_have_longlong=no,ac_cv_have_longlong=cross)])
529 if test x"$ac_cv_have_longlong" = x"yes"; then
530     AC_DEFINE(HAVE_LONGLONG,1,[Define if system has long long type])
531 fi
534 # Check if the compiler supports the LL prefix on long long integers.
535 # AIX needs this.
537 AC_CACHE_CHECK([for LL suffix on long long integers],ac_cv_compiler_supports_ll, [
538     AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
539         ac_cv_compiler_supports_ll=yes,ac_cv_compiler_supports_ll=no)])
540 if test x"$ac_cv_compiler_supports_ll" = x"yes"; then
541    AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Define if compiler support long long])
542 fi
544 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE_VA_COPY,[
545 AC_TRY_LINK([#include <stdarg.h>
546 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
547 ac_cv_HAVE_VA_COPY=yes,ac_cv_HAVE_VA_COPY=no)])
548 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
549     AC_DEFINE(HAVE_VA_COPY,1,[Define if system has va_copy])
550 fi
552 AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
553 AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
554 AC_TRY_RUN([
555 #include <sys/types.h>
556 #include <stdarg.h>
557 void foo(const char *format, ...) { 
558        va_list ap;
559        int len;
560        char buf[5];
562        va_start(ap, format);
563        len = vsnprintf(buf, 0, format, ap);
564        va_end(ap);
565        if (len != 5) exit(1);
567        va_start(ap, format);
568        len = vsnprintf(0, 0, format, ap);
569        va_end(ap);
570        if (len != 5) exit(1);
572        if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
574        exit(0);
576 main() { foo("hello"); }
577 ],
578 ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
579 if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
580     AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
581 fi
583 AC_TRY_COMPILE([#include <sys/time.h>],
584                [struct timeval *tv;
585                 struct timezone *tz;],
586                AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
587                AC_TRY_COMPILE([#include <sys/time.h>],
588                               [struct timeval *tv;
589                                struct timezone *tz;
590                                gettimeofday(tv, tz);],
591                               AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
592                               AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
594 dnl Checks for library functions.
595 AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
597 AC_MSG_CHECKING(return type of socket size)
598 AC_TRY_COMPILE([#include <stdlib.h>
599                 #include <sys/types.h>
600                 #include <sys/socket.h>],
601                [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
602                ac_cv_socket_size_type=["size_t"]
603                 AC_MSG_RESULT(size_t),
604                ac_cv_socket_size_type=["int"]
605                 AC_MSG_RESULT(int))
607 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
608         [Define type of socket size])
610 if test -f "/proc/loadavg"
611 then
612   AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
613   AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
614 fi
616 dnl #### Process table test
618 AC_PATH_PROG(PATH_TO_PS,ps)
620 AC_MSG_CHECKING(for ps syntax)
621 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
622 dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
623 if ps -axwo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
624         egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
625 then
626         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
627         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid ppid vsz rss pcpu comm args'"
628         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
629         EXTRAS="$EXTRAS check_nagios"
630         AC_MSG_RESULT([$ac_cv_ps_command])
632 dnl  STAT UCOMM              VSZ   RSS USER       UID  PPID COMMAND
633 elif ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
634         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
635 then
636         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
637         ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid ppid vsz rss pcpu comm args'"
638         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
639         EXTRAS="$EXTRAS check_nagios"
640         AC_MSG_RESULT([$ac_cv_ps_command])
642 dnl FreeBSD
643 elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | \
644         egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"] >/dev/null
645 then
646         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
647         ac_cv_ps_command="$PATH_TO_PS waxco 'state uid ppid vsz rss pcpu command command'"
648         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
649         EXTRAS="$EXTRAS check_nagios"
650         AC_MSG_RESULT([$ac_cv_ps_command])
652 dnl BSD-like mode in RH 6.1
653 elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \
654         egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
655 then
656         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
657         ac_cv_ps_command="$PATH_TO_PS waxno 'state uid ppid vsz rss pcpu comm args'"
658         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
659         EXTRAS="$EXTRAS check_nagios"
660         AC_MSG_RESULT([$ac_cv_ps_command])
662 dnl SunOS 4.1.3:
663 dnl  F  UID  PID  PPID  CP  PRI  NI  SZ  RSS  WCHAN  STAT  TT  TIME  COMMAND
664 elif ps -laxnwww 2>/dev/null | \
665         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
666 then
667         ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
668         ac_cv_ps_command="$PATH_TO_PS -laxnwww"
669         ac_cv_ps_format="%*s %d %*s %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
670         EXTRAS="$EXTRAS check_nagios"
671         AC_MSG_RESULT([$ac_cv_ps_command])
673 dnl Debian Linux / procps v1.2.9:
674 dnl  FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
675 dnl    100     0     1     0   0   0    776    76  c0131c8c   S  ffff  0:11 init [2]
676 dnl
677 elif ps laxnwww 2>/dev/null | \
678         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
679 then
680         ac_cv_ps_varlist="[&procuid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
681         ac_cv_ps_command="$PATH_TO_PS laxnwww"
682         ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
683         EXTRAS="$EXTRAS check_nagios"
684         AC_MSG_RESULT([$ac_cv_ps_command])
686 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
687 elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
688         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
689 then
690         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
691         ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid ppid vsz rss pcpu comm args'"
692         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
693         EXTRAS="$EXTRAS check_nagios"
694         AC_MSG_RESULT([$ac_cv_ps_command])
696 dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT
697 elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
698         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
699 then
700         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
701         ac_cv_ps_command="$PATH_TO_PS -ao 'stat uid ppid vsz rss pcpu comm args'"
702         ac_cv_ps_format="[["%s%*[ +] %d %d %d %d %f %s %n"]]"
703         EXTRAS="$EXTRAS check_nagios"
704         AC_MSG_RESULT([$ac_cv_ps_command])
706 elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \
707         egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
708 then
709         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
710         ac_cv_ps_command="$PATH_TO_PS -eo 's uid ppid vsz rss pcpu comm args'"
711         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
712         EXTRAS="$EXTRAS check_nagios"
713         AC_MSG_RESULT([$ac_cv_ps_command])
715 elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \
716         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
717 then
718         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
719         ac_cv_ps_command="$PATH_TO_PS -Ao 's uid ppid vsz rss pcpu comm args'"
720         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
721         EXTRAS="$EXTRAS check_nagios"
722         AC_MSG_RESULT([$ac_cv_ps_command])
724 elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \
725         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
726 then
727         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
728         ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid ppid vsz rss pcpu comm args'"
729         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
730         EXTRAS="$EXTRAS check_nagios"
731         AC_MSG_RESULT([$ac_cv_ps_command])
733 elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \
734         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
735 then
736         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
737         ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid ppid vsz rss pcpu comm args'"
738         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
739         EXTRAS="$EXTRAS check_nagios"
740         AC_MSG_RESULT([$ac_cv_ps_command])
742 dnl wonder who takes state instead of stat
743 elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \
744         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
745 then
746         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
747         ac_cv_ps_command="$PATH_TO_PS -ao 'state uid ppid vsz rss pcpu command args'"
748         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
749         EXTRAS="$EXTRAS check_nagios"
750         AC_MSG_RESULT([$ac_cv_ps_command])
752 dnl IRIX 53
753 elif ps -el 2>/dev/null | \
754         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
755 then
756         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&pos,procprog]"
757         ac_cv_ps_command="$PATH_TO_PS -el"
758         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
759         AC_MSG_RESULT([$ac_cv_ps_command])
761 dnl IRIX 63
762 elif ps -el 2>/dev/null | \
763         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
764 then
765         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
766         ac_cv_ps_command="$PATH_TO_PS -el"
767         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
768         AC_MSG_RESULT([$ac_cv_ps_command])
770 dnl AIX 4.1:
771 dnl     F S      UID   PID  PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
772 dnl    303 A        0     0     0 120  16 -- 1c07  20   24              -  0:45 swapper
773 elif ps -el 2>/dev/null | \
774         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
775 then
776         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
777         ac_cv_ps_command="$PATH_TO_PS -el"
778         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
779         AC_MSG_RESULT([$ac_cv_ps_command])
781 dnl AIX?
782 elif ps glaxen 2>/dev/null | \
783         egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
784 then
785         ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
786         ac_cv_ps_command="$PATH_TO_PS glaxen"
787         ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
788         AC_MSG_RESULT([$ac_cv_ps_command])
790 dnl MacOSX / Darwin
791 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
792 dnl Some truncation will happen in UCOMM column
793 dnl STAT      VSZ    RSS   UID  PPID %CPU UCOMM            COMMAND
794 dnl Ss      52756  22496   501     1   6.9 Window Manager   /System/Library/CoreServices/WindowServer -daemon
795 elif ps wwaxo 'state vsz rss uid ppid pcpu ucomm command' 2>/dev/null | \
796         egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
797 then
798         ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid ppid pcpu ucomm command'"
799         ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procppid,&procpcpu,procprog,&pos]"
800         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
801         EXTRAS="$EXTRAS check_nagios"
802         AC_MSG_RESULT([$ac_cv_ps_command])
804 dnl UnixWare 
805 elif ps -Al 2>/dev/null | \
806         egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
807 then
808         ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
809         ac_cv_ps_command="$PATH_TO_PS -Al"
810         ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
811         #if ps -Ao 'vsz comm' 2>/dev/null | \
812         #       egrep -i ["^ *VSZ +COMMAND"] >/dev/null
813         #then
814         #       ac_cv_vsz_command="$PATH_TO_PS -Ao 'vsz comm'"
815         #       ac_cv_vsz_format="%*s %d"
816         #fi
817         AC_MSG_RESULT([$ac_cv_ps_command])
819 else
820         AC_MSG_WARN([unable to find usable ps syntax])
821 fi
823 AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
824         [Variable list for sscanf of 'ps' output])
825 AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
826         [Verbatim command to execute for ps in check_procs])
827 AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
828         [Format string for scanning ps output in check_procs])
830 AC_PATH_PROG(PATH_TO_DF,df)
831 AC_PATH_PROG(PATH_TO_BDF,bdf)
833 AC_ARG_WITH(df_command,
834         ACX_HELP_STRING([--with-df-command=SYNTAX],
835                 [sets syntax for df]),
836         with_df_command=$withval,)
838 AC_MSG_CHECKING(for df syntax)
839 if test -n "$with_df_command"
840 then
841         AC_MSG_RESULT([$with_df_command])
843 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
844 then
845         with_df_command="$PATH_TO_DF -Pk"
846         AC_MSG_RESULT([$with_df_command])
848 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
849 then
850         with_df_command="$PATH_TO_DF -k"
851         AC_MSG_RESULT([$with_df_command])
853 elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
854 then
855         with_df_command="$PATH_TO_DF"
856         AC_MSG_RESULT([$with_df_command])
858 elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
859 then
860         with_df_command="$PATH_TO_BDF"
861         AC_MSG_RESULT([$with_df_command])
863 else
864         AC_MSG_WARN([unable to find usable df syntax])
865 fi
867 AC_DEFINE_UNQUOTED(DF_COMMAND,"$with_df_command",[path and args for df command])
869 dnl jm_AFS
870 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
871 jm_FSTYPENAME
872 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
874 AC_PATH_PROG(PATH_TO_PING,ping)
875 AC_PATH_PROG(PATH_TO_PING6,ping6)
877 AC_ARG_WITH(ping_command,
878         ACX_HELP_STRING([--with-ping-command=SYNTAX],
879                 [sets syntax for ICMP ping]),
880         with_ping_command=$withval,)
882 AC_MSG_CHECKING(for ICMP ping syntax)
883 ac_cv_ping_packets_first=no
884 if test -n "$with_ping_command"
885 then
886         AC_MSG_RESULT([(command-line) $with_ping_command])
887         if test -n "$ac_cv_ping_packets_first"
888         then
889                 ac_cv_ping_packets_first=yes
890         fi
892 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
893         $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
894         egrep -i "^round-trip|^rtt" >/dev/null
895 then
896         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
897         ac_cv_ping_packets_first=yes
898         AC_MSG_RESULT([$with_ping_command])
900 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
901         egrep -i "^round-trip|^rtt" >/dev/null
902 then
903         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
904         ac_cv_ping_packets_first=yes
905         AC_MSG_RESULT([$with_ping_command])
907 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
908         egrep -i "^round-trip|^rtt" >/dev/null
909 then
910         with_ping_command="$PATH_TO_PING -n -c %d %s"
911         ac_cv_ping_packets_first=yes
912         AC_MSG_RESULT([$with_ping_command])
914 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
915         egrep -i "^round-trip|^rtt" >/dev/null
916 then
917         with_ping_command="$PATH_TO_PING -n %s -c %d"
918         AC_MSG_RESULT([$with_ping_command])
920 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
921         egrep -i "^round-trip|^rtt" >/dev/null
922 then
923         with_ping_command="$PATH_TO_PING %s -n %d"
924         AC_MSG_RESULT([$with_ping_command])
926 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
927         egrep -i "^round-trip|^rtt" >/dev/null
928 then
929         with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
930         AC_MSG_RESULT([$with_ping_command])
932 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
933         egrep -i "^round-trip|^rtt" >/dev/null
934 then
935         with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
936         AC_MSG_RESULT([$with_ping_command])
938 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
939         egrep -i "^round-trip|^rtt" >/dev/null
940 then
941         with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
942         ac_cv_ping_packets_first=yes
943         AC_MSG_RESULT([$with_ping_command])
945 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
946         egrep -i "^round-trip|^rtt" >/dev/null
947 then
948         with_ping_command="$PATH_TO_PING -n -c %d %s"
949         ac_cv_ping_packets_first=yes
950         AC_MSG_RESULT([$with_ping_command])
952 else
953         AC_MSG_WARN([unable to find usable ping syntax])
954 fi
956 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
957         [path and args for ICMP ping command])
959 if test "x$ac_cv_ping_packets_first" != "xno"
960 then
961         AC_DEFINE(PING_PACKETS_FIRST,1,
962                 [Define if packet count must precede host])
963 fi
965 AC_ARG_WITH(ping6_command,
966         ACX_HELP_STRING([--with-ping6-command=SYNTAX],
967                 [sets syntax for ICMPv6 ping]),
968         with_ping6_command=$withval,)
970 if test x"$with_ipv6" != xno ; then
971 AC_MSG_CHECKING(for ICMPv6 ping syntax)
972 ac_cv_ping6_packets_first=no
973 if test -n "$with_ping6_command"
974 then
975         AC_MSG_RESULT([(command-line) $with_ping6_command])
976         if test -n "$ac_cv_ping6_packets_first"
977         then
978                 ac_cv_ping6_packets_first=yes
979         fi
981 elif test "x$PATH_TO_PING6" != "x"; then
982         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
983                 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
984                 egrep -i "^round-trip|^rtt" >/dev/null
985         then
986                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
987                 ac_cv_ping6_packets_first=yes
988                 AC_MSG_RESULT([$with_ping6_command])
990         elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
991                 egrep -i "^round-trip|^rtt" >/dev/null
992         then
993                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
994                 ac_cv_ping6_packets_first=yes
995                 AC_MSG_RESULT([$with_ping6_command])
997         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
998                 egrep -i "^round-trip|^rtt" >/dev/null
999         then
1000                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1001                 ac_cv_ping6_packets_first=yes
1002                 AC_MSG_RESULT([$with_ping6_command])
1004         elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
1005                 egrep -i "^round-trip|^rtt" >/dev/null
1006         then
1007                 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1008                 AC_MSG_RESULT([$with_ping6_command])
1010         elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1011                 egrep -i "^round-trip|^rtt" >/dev/null
1012         then
1013                 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1014                 AC_MSG_RESULT([$with_ping6_command])
1016         elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1017                 egrep -i "^round-trip|^rtt" >/dev/null
1018         then
1019                 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1020                 AC_MSG_RESULT([$with_ping6_command])
1022         elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1023                 egrep -i "^round-trip|^rtt" >/dev/null
1024         then
1025                 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1026                 AC_MSG_RESULT([$with_ping6_command])
1028         elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1029                 egrep -i "^round-trip|^rtt" >/dev/null
1030         then
1031                 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1032                 ac_cv_ping6_packets_first=yes
1033                 AC_MSG_RESULT([$with_ping_command])
1035         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1036                 egrep -i "^round-trip|^rtt" >/dev/null
1037         then
1038                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1039                 ac_cv_ping6_packets_first=yes
1040                 AC_MSG_RESULT([$with_ping6_command])
1042         fi
1044 elif test "x$PATH_TO_PING" != "x"; then
1045         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1046                 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1047                 egrep -i "^round-trip|^rtt" >/dev/null
1048         then
1049                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1050                 ac_cv_ping6_packets_first=yes
1051                 AC_MSG_RESULT([$with_ping6_command])
1053         elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1054                 egrep -i "^round-trip|^rtt" >/dev/null
1055         then
1056                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1057                 ac_cv_ping6_packets_first=yes
1058                 AC_MSG_RESULT([$with_ping6_command])
1060         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1061                 egrep -i "^round-trip|^rtt" >/dev/null
1062         then
1063                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1064                 ac_cv_ping6_packets_first=yes
1065                 AC_MSG_RESULT([$with_ping6_command])
1067         elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1068                 egrep -i "^round-trip|^rtt" >/dev/null
1069         then
1070                 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1071                 AC_MSG_RESULT([$with_ping6_command])
1073         elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1074                 egrep -i "^round-trip|^rtt" >/dev/null
1075         then
1076                 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1077                 AC_MSG_RESULT([$with_ping6_command])
1079         elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1080                 egrep -i "^round-trip|^rtt" >/dev/null
1081         then
1082                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1083                 AC_MSG_RESULT([$with_ping6_command])
1085         elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1086                 egrep -i "^round-trip|^rtt" >/dev/null
1087         then
1088                 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1089                 AC_MSG_RESULT([$with_ping6_command])
1091         elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1092                 egrep -i "^round-trip|^rtt" >/dev/null
1093         then
1094                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1095                 ac_cv_ping6_packets_first=yes
1096                 AC_MSG_RESULT([$with_ping_command])
1098         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1099                 egrep -i "^round-trip|^rtt" >/dev/null
1100         then
1101                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1102                 ac_cv_ping6_packets_first=yes
1103                 AC_MSG_RESULT([$with_ping6_command])
1105         fi
1107 fi
1109 if test "x$with_ping6_command" != "x"; then
1110         AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1111                 [path and args for ICMPv6 ping command])
1112 else
1113         AC_MSG_RESULT([none])
1114 fi
1116 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1117         AC_DEFINE(PING6_PACKETS_FIRST,1,
1118                 [Define if packet count must precede host])
1119 fi
1120 fi
1122 AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1124 AC_MSG_CHECKING(for nslookup syntax)
1125 if test -n "$PATH_TO_NSLOOKUP"
1126 then
1127         if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1128         then
1129                 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1130                 AC_MSG_RESULT([$ac_cv_nslookup_command])
1132         else
1133                 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1134                 AC_MSG_RESULT([$ac_cv_nslookup_command])
1136         fi
1137         EXTRAS="$EXTRAS check_dns"
1139 else
1140         AC_MSG_WARN([nslookup command not found])
1141 fi
1143 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command",
1144         [path and args for nslookup])
1146 AC_PATH_PROG(PATH_TO_HOST,host)
1147 if test -n "$ac_cv_path_PATH_TO_HOST"
1148 then
1149         EXTRAS="$EXTRAS check_dns"
1150 fi
1152 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1153 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1155 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1156 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1158 AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
1159 AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
1160 AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
1161 if (test -x "$PATH_TO_NTPDATE" || test -x "$PATH_TO_NTPQ")
1162 then
1163         AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
1164         AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
1165 else
1166         AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
1167 fi
1169 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1170 if test -x "$PATH_TO_LMSTAT"
1171 then
1172         AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1173 else
1174         AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1175 fi
1177 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1178 if test -x "$PATH_TO_SMBCLIENT"
1179 then
1180         AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1181 else
1182         AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1183 fi
1186 AC_PATH_PROG(PATH_TO_WHO,who)
1188 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1189 then
1190         ac_cv_path_to_who="$PATH_TO_WHO -q"
1191 else
1192         ac_cv_path_to_who="$PATH_TO_WHO"
1193 fi
1195 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1196         [path and arguments for invoking 'who'])
1198 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1199 if test -x "$PATH_TO_SNMPGET"
1200 then
1201         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1202         EXTRAS="$EXTRAS check_hpjd check_snmp"
1203 else
1204         AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1205 fi
1207 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1208 if test -x "$PATH_TO_SNMPGETNEXT"
1209 then
1210         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1211 fi
1213 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )
1214 then
1215         AC_MSG_CHECKING(for Net::SNMP perl module)
1216         AC_MSG_RESULT([found])
1217 else
1218         AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1219 fi
1221 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1222 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1224 if test -x "$PATH_TO_QUAKESTAT"
1225 then
1226         ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1227         EXTRAS="$EXTRAS check_game"
1229 elif test -x "$PATH_TO_QSTAT"
1230 then
1231         ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1232         EXTRAS="$EXTRAS check_game"
1233 else
1234         AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1235 fi
1237 if test $ac_cv_path_to_qstat 
1238 then
1239         AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1240                 [path to qstat/quakestat])
1241 fi
1243 AC_PATH_PROG(PATH_TO_FPING,fping)
1244 if test -x "$PATH_TO_FPING"
1245 then
1246         AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1247         EXTRAS="$EXTRAS check_fping"
1248 else
1249         AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1250 fi
1252 AC_PATH_PROG(PATH_TO_SSH,ssh)
1254 if test -x "$PATH_TO_SSH"
1255 then
1256         AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1257         EXTRAS="$EXTRAS check_by_ssh"
1258 else
1259         AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1260 fi
1263 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1264 if test -x "$PATH_TO_MAILQ"
1265 then
1266         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1267 else
1268         AC_MSG_WARN([Could not find mailq or eqivalent])
1269 fi
1271 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1272 if test -x "$PATH_TO_QMAIL_QSTAT"
1273 then
1274         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1275 else
1276         AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1277 fi
1279 dnl SWAP info required is amount allocated/available and amount free
1280 dnl The plugin works through all the swap devices and adds up the total swap
1281 dnl available.
1283 dnl dunno why this does not work below - use hack (kbd)
1284 dnl fine on linux, broken on solaris
1285 dnl if /bin/test -e "/proc/meminfo"
1287 AC_PATH_PROG(PATH_TO_SWAP,swap)
1288 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1290 AC_MSG_CHECKING(for how to check memory)
1291 if [cat /proc/meminfo > /dev/null 2>&1]
1292 then
1293         AC_MSG_RESULT([found /proc/meminfo])
1294         AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1295         AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo",[path to /proc/meminfo if name changes])
1296         EXTRAS="$EXTRAS check_swap"
1298 elif [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1299 then
1300         ac_cv_have_swap=yes
1301         ac_cv_swap_command="$PATH_TO_SWAP -l"
1302         if [$PATH_TO_SWAP -l 2>/dev/null | \
1303                 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1304                 >/dev/null]
1305         then
1306                 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %d %d"]
1307                 AC_MSG_RESULT([using IRIX format swap])
1309         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
1310         then
1311                 ac_cv_swap_format=["%*s %*[[0-9,-]] %*d %d %d"]
1312                 AC_MSG_RESULT([using Solaris format swap])
1314         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1315         then
1316                 ac_cv_swap_format=["%*s %*[[0-9,-]] %*d %d %d"]
1317                 AC_MSG_RESULT([using Unixware format swap])
1319         fi
1320         EXTRAS="$EXTRAS check_swap"
1322 elif [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1323 then
1324         ac_cv_have_swap=yes
1325         ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1327         if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1328         then
1329                 ac_cv_swap_format=["%*s %d %*d %d"]
1330                 AC_MSG_RESULT([using FreeBSD format swapinfo])
1331         fi
1332         EXTRAS="$EXTRAS check_swap"
1334 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1335 then
1336         ac_cv_have_swap=yes
1337         ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
1338         ac_cv_swap_format=["%*s %d %*d %d"]
1339         AC_MSG_RESULT([using HP-UX format swapinfo])
1340 fi
1342 if test x$ac_cv_have_swap != x 
1343 then
1344         AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1345 fi
1346 AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1347         [Format string for parsing swap output])
1348 if test "x$ac_cv_swap_command" != "x" 
1349 then
1350         AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1351                 [Path to swap/swapinfo binary, with any args])
1352 fi
1354 AC_PATH_PROG(PATH_TO_DIG,dig)
1355 AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1356 if test -n "$PATH_TO_DIG"; then
1357         EXTRAS="$EXTRAS check_dig"
1358 fi
1360 if test -f plugins/check_nt.c ; then
1361   EXTRAS="$EXTRAS check_nt"
1362 elif test -f ../plugins/check_nt.c ; then
1363   EXTRAS="$EXTRAS check_nt"
1364 fi
1366 AC_MSG_CHECKING(for va_list)
1367 AC_TRY_COMPILE([#ifdef __STDC__
1368                 #include <stdio.h>
1369                 #include <stdlib.h>
1370                 #include <stdarg.h>
1371                 #else
1372                 #include <sys/types.h>
1373                 #include <stdio.h>
1374                 #include <varargs.h>
1375                 #endif],
1376                 [va_list args;],
1377                 [AC_MSG_RESULT(yes)],
1378                 [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
1380 AC_SUBST(EXTRAS)
1381 AC_SUBST(EXTRA_NETOBJS)
1382 AC_SUBST(DEPLIBS)
1384 AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version])
1386 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)
1388 ACX_FEATURE([with],[cgiurl])
1389 ACX_FEATURE([with],[nagios-user])
1390 ACX_FEATURE([with],[nagios-group])
1391 ACX_FEATURE([with],[trusted-path])
1392 ACX_FEATURE([with],[df-command])
1393 ACX_FEATURE([with],[ping-command])
1394 ACX_FEATURE([with],[ping6-command])
1395 ACX_FEATURE([with],[lwres])
1396 ACX_FEATURE([with],[ipv6])
1397 ACX_FEATURE([enable],[emulate-getaddrinfo])