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