5c067b4a44a5c628851bdb1f222d87e518337151
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION ($Revision$)
3 AC_PREREQ(2.50)
4 AC_INIT(nagios-plugins,1.3.99)
5 AC_CONFIG_SRCDIR(Helper.pm)
6 AM_INIT_AUTOMAKE
7 AM_CONFIG_HEADER(plugins/config.h)
8 AC_CANONICAL_HOST
10 RELEASE=1
11 AC_SUBST(RELEASE)
13 AC_PREFIX_DEFAULT(/usr/local/nagios)
15 dnl Figure out how to invoke "install" and what install options to use.
16 AC_PROG_INSTALL
17 AC_SUBST(INSTALL)
19 AC_GNU_SOURCE
20 AC_PROG_CC
21 AC_PROG_CPP
22 AC_PROG_GCC_TRADITIONAL
23 AC_PROG_RANLIB
24 AC_AIX
25 AC_MINIX
27 AC_PROG_MAKE_SET
28 AC_PROG_AWK
32 saved_srcdir=$srcdir
33 srcdir=$srcdir/lib
34 test -f $srcdir/getloadavg.c \
35 || AC_MSG_ERROR([getloadavg.c is not in $srcdir])
36 AC_FUNC_GETLOADAVG
37 srcdir=$saved_srcdir
39 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
40 dnl AM_WITH_REGEX
42 PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
43 AC_SUBST(PLUGIN_TEST)dnl
45 SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
46 AC_SUBST(SCRIPT_TEST)dnl
48 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"
49 AC_SUBST(WARRANTY)
51 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"
52 AC_SUBST(SUPPORT)
54 dnl CGIURL has changed for Nagios with 1.0 beta
55 AC_ARG_WITH(cgiurl,
56 ACX_HELP_STRING([--with-cgiurl=DIR],
57 [sets URL for cgi programs]),
58 with_cgiurl=$withval,
59 with_cgiurl=/nagios/cgi-bin)
60 CGIURL="$with_cgiurl"
61 AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
63 AC_ARG_WITH(nagios_user,
64 ACX_HELP_STRING([--with-nagios-user=USER],
65 [set user name to run nagios]),
66 with_nagios_user=$withval,
67 with_nagios_user=nagios)
68 AC_ARG_WITH(nagios_group,
69 ACX_HELP_STRING([--with-nagios-group=GROUP],
70 [set group name to run nagios]),
71 with_nagios_group=$withval,
72 with_nagios_group=nagios)
73 AC_SUBST(with_nagios_user)
74 AC_SUBST(with_nagios_group)
75 INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group"
76 AC_SUBST(INSTALL_OPTS)
78 AC_ARG_WITH(trusted_path,
79 ACX_HELP_STRING([--with-trusted-path=PATH],
80 [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
81 with_trusted_path=$withval,
82 with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
83 AC_SUBST(with_trusted_path)
85 EXTRAS=
86 dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
88 LDFLAGS="$LDFLAGS -L."
90 ac_cv_uname_m=`uname -m`
91 ac_cv_uname_s=`uname -s`
92 ac_cv_uname_r=`uname -r`
93 ac_cv_uname_v=`uname -v`
95 PKG_ARCH=`uname -p`
96 REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
97 REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
99 AC_SUBST(PKG_ARCH)
100 AC_SUBST(REV_DATESTAMP)
101 AC_SUBST(REV_TIMESTAMP)
103 dnl Checks for programs.
104 AC_PATH_PROG(PYTHON,python)
105 AC_PATH_PROG(PERL,perl)
106 AC_PATH_PROG(SH,sh)
108 AC_PATH_PROG(HOSTNAME,hostname)
109 AC_PATH_PROG(BASENAME,basename)
111 dnl
112 dnl Check for miscellaneous stuff
113 dnl
115 case $host_vender-$host_os in
116 sun*)
117 AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
118 ;;
119 osf*)
120 AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
121 ;;
122 esac
124 dnl
125 dnl Checks for libraries.
126 dnl
128 AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
129 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
130 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
131 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
132 AC_SUBST(SOCKETLIBS)
134 dnl Check for PostgreSQL libraries
135 _SAVEDLIBS="$LIBS"
136 _SAVEDCPPFLAGS="$CPPFLAGS"
137 AC_ARG_WITH(pgsql,
138 ACX_HELP_STRING([--with-pgsql=DIR],
139 [sets path to pgsql installation]),
140 PGSQL=$withval,)
141 AC_CHECK_LIB(crypt,main)
142 if test "$ac_cv_lib_crypt_main" = "yes"; then
143 if test -n "$PGSQL"; then
144 LDFLAGS="$LDFLAGS -L$PGSQL/lib"
145 CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
146 fi
147 AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
148 if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
149 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
150 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
151 AC_CHECK_HEADERS(libpq-fe.h)
152 if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
153 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
154 PGINCLUDE="-I$PGSQL/include"
155 elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
156 PGLIBS="-lpq -lcrypt"
157 PGINCLUDE="-I/usr/include/pgsql"
158 elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
159 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
160 PGINCLUDE="-I/usr/include/postgresql"
161 elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
162 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
163 PGINCLUDE="-I$PGSQL/include"
164 fi
165 if test -z "$PGINCLUDE"; then
166 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
167 AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
168 else
169 AC_SUBST(PGLIBS)
170 AC_SUBST(PGINCLUDE)
171 EXTRAS="$EXTRAS check_pgsql"
172 fi
173 else
174 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
175 AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
176 AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
177 fi
178 else
179 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
180 AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
181 fi
182 LIBS="$_SAVEDLIBS"
183 CPPFLAGS="$_SAVEDCPPFLAGS"
185 dnl Check for radius libraries
186 _SAVEDLIBS="$LIBS"
187 AC_CHECK_LIB(radiusclient,rc_read_config)
188 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
189 EXTRAS="$EXTRAS check_radius"
190 RADIUSLIBS="-lradiusclient"
191 AC_SUBST(RADIUSLIBS)
192 else
193 AC_MSG_WARN([Skipping radius plugin])
194 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
195 fi
196 LIBS="$_SAVEDLIBS"
198 dnl Check for LDAP libraries
199 _SAVEDLIBS="$LIBS"
200 AC_CHECK_LIB(ldap,main,,,-llber)
201 if test "$ac_cv_lib_ldap_main" = "yes"; then
202 LDAPLIBS="-lldap -llber"\
203 LDAPINCLUDE="-I/usr/include/ldap"
204 AC_SUBST(LDAPLIBS)
205 AC_SUBST(LDAPINCLUDE)
206 AC_CHECK_FUNCS(ldap_set_option)
207 EXTRAS="$EXTRAS check_ldap"
208 else
209 AC_MSG_WARN([Skipping LDAP plugin])
210 AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
211 fi
212 LIBS="$_SAVEDLIBS"
215 dnl Check for mysql libraries
216 _SAVEDLIBS="$LIBS"
217 _SAVEDCPPFLAGS="$CPPFLAGS"
218 AC_ARG_WITH(mysql,
219 ACX_HELP_STRING([--with-mysql=DIR],
220 [sets path to mysql installation (assumes lib/mysql and include subdirs]),
221 MYSQL=$withval,)
222 if test -n "$MYSQL"; then
223 MYSQLLIBDIR=$MYSQL/lib/mysql
224 CPPFLAGS="-I$MYSQL/include"
225 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
226 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
227 elif test -f /usr/lib/libmysqlclient.so; then
228 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
229 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
230 elif test -f /usr/lib/libmysqlclient.a; then
231 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
232 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
233 elif test -f /usr/lib/mysql/libmysqlclient.so; then
234 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
235 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
236 elif test -f /usr/lib/mysql/libmysqlclient.a; then
237 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
238 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
239 fi
240 if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
241 AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
242 if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
243 EXTRAS="$EXTRAS check_mysql"
244 AC_SUBST(MYSQLINCLUDE)
245 AC_SUBST(MYSQLLIBS)
246 AC_SUBST(check_mysql_LDFLAGS)
247 else
248 AC_MSG_WARN([Skipping mysql plugin])
249 AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
250 fi
251 else
252 AC_MSG_WARN([Skipping mysql plugin])
253 AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
254 fi
255 CPPFLAGS="$_SAVEDCPPFLAGS"
256 LIBS="$_SAVEDLIBS"
258 dnl Check for OpenSSL location
259 AC_PATH_PROG(OPENSSL,openssl)
260 if test "$OPENSSL" = "/usr/bin/openssl"; then
261 OPENSSL=/usr
262 elif test "$OPENSSL" = "/usr/sbin/openssl"; then
263 OPENSSL=/usr
264 elif test "$OPENSSL" = "/opt/bin/openssl"; then
265 OPENSSL=/opt
266 elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
267 OPENSSL=/opt/openssl
268 elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
269 OPENSSL=/usr/slocal
270 elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
271 OPENSSL=/usr/local
272 elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
273 OPENSSL=/usr/local/ssl
274 fi
275 AC_ARG_WITH(openssl,
276 ACX_HELP_STRING([--with-openssl=DIR],
277 [sets path to openssl installation]),
278 OPENSSL=$withval,)
280 AC_CHECK_HEADERS(unistd.h)
282 dnl Check for AF_INET6 support - unistd.h required for Darwin
283 AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
284 AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
285 #include <unistd.h>
286 #endif
287 #include <netinet/in.h>
288 #include <sys/socket.h>],
289 [struct sockaddr_in6 sin6;
290 void *p;
292 sin6.sin6_family = AF_INET6;
293 sin6.sin6_port = 587;
294 p = &sin6.sin6_addr;],
295 [with_ipv6=yes],
296 [with_ipv6=no])
297 ])
299 if test x"$with_ipv6" != xno ; then
300 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
301 fi
303 dnl #########################################################################
304 dnl Check if Posix getaddrinfo() is available. It is also possible to use
305 dnl the version from the lwres library distributed with BIND.
306 dnl #########################################################################
307 AC_ARG_ENABLE([emulate-getaddrinfo],
308 ACX_HELP_STRING([--enable-emulate-getaddrinfo],
309 [enable getaddrinfo emulation (default=no)]),
310 ,
311 enable_emulate_getaddrinfo=no)
313 AC_ARG_WITH(lwres,
314 ACX_HELP_STRING([--with-lwres=DIR],
315 [use lwres library for getaddrinfo (default=no)]),
316 ,
317 with_lwres=no)
319 dnl ## enable force to test getaddrinfo.c
320 if test x$enable_emulate_getaddrinfo = xforce ; then
321 enable_emulate_getaddrinfo=yes
322 have_getaddrinfo=no
323 else
325 have_getaddrinfo=no
326 if test x$with_lwres != xno ; then
327 if test "$with_lwres" != yes ; then
328 CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
329 LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
330 fi
331 AC_CHECK_HEADERS(lwres/netdb.h, ,
332 [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
333 AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
334 [AC_MSG_ERROR([cannot find the lwres library])],
335 -lnsl -lpthread)
336 have_getaddrinfo=yes
337 fi
339 if test x$have_getaddrinfo != xyes ; then
340 AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
341 fi
343 dnl # Special nonsense for systems that actually have getaddrinfo but
344 dnl # redefine the name to something else, e.g. OSF
345 if test x$have_getaddrinfo != xyes ; then
346 AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
347 AC_TRY_LINK([
348 # include <netdb.h>
349 ], [
350 struct addrinfo hints, *res;
351 int err;
353 err = getaddrinfo ("host", "service", &hints, &res);
354 ], [
355 have_getaddrinfo=yes
356 AC_MSG_RESULT(yes)
357 ], [AC_MSG_RESULT(no)])
358 fi
360 fi
362 if test x$have_getaddrinfo != xno ; then
363 if test x$enable_emulate_getaddrinfo != xno ; then
364 AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
365 fi
366 AC_DEFINE(HAVE_GETADDRINFO, 1,
367 [Does system provide RFC 2553/Posix getaddrinfo?])
368 else
369 if test x$enable_emulate_getaddrinfo != xyes ; then
370 dnl AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
371 enable_emulate_getaddrinfo=yes
372 AC_MSG_WARN([enabling getaddrinfo emulation])
373 fi
374 EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
375 fi
377 if test x"$enable_emulate_getaddrinfo" != xno ; then
378 have_resolver=no
380 dnl Try for getipnodebyname
381 AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
382 if test x"$have_resolver" != xno ; then
383 AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
384 [Set when getipnodebyname is available])
385 fi
387 dnl Try for gethostbyname_r
388 if test x"$have_resolver" = xno ; then
389 AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
390 [have_resolver=yes
391 ACX_WHICH_GETHOSTBYNAME_R])
392 fi
394 dnl Try for gethostbyname
395 if test x"$have_resolver" = xno ; then
396 if test x"$enable_pthreads" != xno ; then
397 AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
398 fi
399 AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
400 [AC_MSG_ERROR([cannot find gethostbyname])])
401 fi
402 EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
404 fi
406 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
407 if test "$FOUNDINCLUDE" = "no"; then
408 _SAVEDCPPFLAGS="$CPPFLAGS"
409 CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
410 unset ac_cv_header_krb5_h
411 AC_CHECK_HEADERS(krb5.h,
412 KRB5INCLUDE="-I/usr/kerberos/include"
413 FOUNDINCLUDE=yes,
414 FOUNDINCLUDE=no)
415 fi
416 AC_SUBST(KRBINCLUDE)
417 if test "$FOUNDINCLUDE" = "no"; then
418 CPPFLAGS="$_SAVEDCPPFLAGS"
419 fi
421 dnl Check for OpenSSL header files
422 unset FOUNDINCLUDE
423 _SAVEDCPPFLAGS="$CPPFLAGS"
424 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
425 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
426 SSLINCLUDE="-I$OPENSSL/include"
427 FOUNDINCLUDE=yes,
428 FOUNDINCLUDE=no)
429 if test "$FOUNDINCLUDE" = "no"; then
430 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
431 SSLINCLUDE="-I$OPENSSL/include"
432 FOUNDINCLUDE=yes,
433 FOUNDINCLUDE=no)
434 fi
435 AC_SUBST(SSLINCLUDE)
436 if test "$FOUNDINCLUDE" = "no"; then
437 CPPFLAGS="$_SAVEDCPPFLAGS"
438 fi
440 dnl Check for crypto lib
441 _SAVEDLIBS="$LIBS"
442 AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
443 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
444 dnl Check for SSL lib
445 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)
446 fi
447 LIBS="$_SAVEDLIBS"
449 dnl test headers and libs to decide whether check_http should use SSL
450 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
451 if test "$ac_cv_lib_ssl_main" = "yes"; then
452 if test "$FOUNDINCLUDE" = "yes"; then
453 check_tcp_ssl="check_simap check_spop"
454 AC_SUBST(check_tcp_ssl)
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(features.h 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
534 #
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);
576 }
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 GETTEXT_VERSION=0.11.4
1393 AM_GNU_GETTEXT
1395 AC_OUTPUT(Makefile lib/Makefile plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl pkg/solaris/pkginfo intl/Makefile po/Makefile.in )
1397 ACX_FEATURE([with],[cgiurl])
1398 ACX_FEATURE([with],[nagios-user])
1399 ACX_FEATURE([with],[nagios-group])
1400 ACX_FEATURE([with],[trusted-path])
1401 ACX_FEATURE([with],[df-command])
1402 ACX_FEATURE([with],[ping-command])
1403 ACX_FEATURE([with],[ping6-command])
1404 ACX_FEATURE([with],[lwres])
1405 ACX_FEATURE([with],[ipv6])
1406 ACX_FEATURE([enable],[emulate-getaddrinfo])