Code

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