improve command examples for 'at least' processes
[monitoring-plugins.git] / configure.ac
blob08a0e782e9151592a28820161c67ee82aa1e4937
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(monitoring-plugins,2.2)
4 AC_CONFIG_SRCDIR(NPTest.pm)
5 AC_CONFIG_FILES([gl/Makefile])
6 AC_CONFIG_AUX_DIR(build-aux)
7 AM_INIT_AUTOMAKE([1.8.3])
8 AM_MAINTAINER_MODE([enable])
9 AC_CONFIG_HEADERS([config.h])
10 AC_CANONICAL_HOST
12 DEFAULT_PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
13 RELEASE=1
14 AC_SUBST(RELEASE)
16 dnl Deprecated configure options
19 dnl Append user (-o), group (-g), mode (-m) to install command
20 dnl There is an assumption that this is possible with ./configure's chosen install command
21 extra_install_args=""
22 AC_ARG_WITH(nagios_user,
23         ACX_HELP_STRING([--with-nagios-user=USER],
24                 [Installs executables with this user. Defaults to install user]),
25         extra_install_args="-o $withval")
26 AC_ARG_WITH(nagios_group,
27         ACX_HELP_STRING([--with-nagios-group=GROUP],
28                 [Installs executables with this group. Defaults to install user]),
29         extra_install_args="$extra_install_args -g $withval")
30 AC_ARG_WITH(world_permissions,
31         ACX_HELP_STRING([--without-world-permissions],
32                 [Installs executables without world permissions]))
34 if test "x$with_world_permissions" = xno ; then
35         extra_install_args="$extra_install_args -m 0550"
38 INSTALL="$INSTALL $extra_install_args"
39 INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
40 AC_SUBST(INSTALL)
42 AC_PROG_CC
43 gl_EARLY
44 AC_PROG_GCC_TRADITIONAL
45 AC_PROG_LIBTOOL
47 AM_PROG_CC_C_O
49 AC_FUNC_ERROR_AT_LINE
50 AC_SYS_LARGEFILE
52 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
54 PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
55 AC_SUBST(PLUGIN_TEST)dnl
57 SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
58 AC_SUBST(SCRIPT_TEST)dnl
60 WARRANTY="The Monitoring 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"
61 AC_SUBST(WARRANTY)
63 SUPPORT="Send email to help@monitoring-plugins.org if you have questions regarding use\nof this software. To submit patches or suggest improvements, send email to\ndevel@monitoring-plugins.org. Please include version information with all\ncorrespondence (when possible, use output from the --version option of the\nplugin itself).\n"
64 AC_SUBST(SUPPORT)
66 dnl CGIURL has changed for Nagios with 1.0 beta
67 AC_ARG_WITH(cgiurl,
68         ACX_HELP_STRING([--with-cgiurl=DIR],
69                 [sets URL for cgi programs]),
70         with_cgiurl=$withval,
71         with_cgiurl=/nagios/cgi-bin)
72 CGIURL="$with_cgiurl"
73 AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
75 AC_ARG_WITH(trusted_path,
76         ACX_HELP_STRING([--with-trusted-path=PATH],
77                 [sets trusted path for executables called by scripts]),
78         with_trusted_path=$withval,
79         with_trusted_path=$DEFAULT_PATH)
80 AC_SUBST(with_trusted_path)
82 EXTRAS=
83 EXTRAS_ROOT=
84 dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
86 LDFLAGS="$LDFLAGS -L."
88 ac_cv_uname_m=`uname -m`
89 ac_cv_uname_s=`uname -s`
90 ac_cv_uname_r=`uname -r`
91 ac_cv_uname_v=`uname -v`
92 ac_cv_uname_o=`uname -o`
94 PKG_ARCH=`uname -p`
95 REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
96 REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
98 AC_SUBST(PKG_ARCH)
99 AC_SUBST(REV_DATESTAMP)
100 AC_SUBST(REV_TIMESTAMP)
102 dnl Check if version file is present
103 AM_CONDITIONAL([RELEASE_PRESENT], [test -f $srcdir/release])
105 # Also read in the version from it
106 if test -f $srcdir/release; then
107         NP_RELEASE="$(<release)"
108 else
109         NP_RELEASE="$PACKAGE_VERSION"
111 AC_SUBST(NP_RELEASE)
113 dnl Checks for programs.
114 AC_PATH_PROG(PERL,perl)
115 AC_PATH_PROG(HOSTNAME,hostname)
116 AC_PATH_PROG(BASENAME,basename)
118 dnl allow them to override the path of perl
119 AC_ARG_WITH(perl,
120         ACX_HELP_STRING([--with-perl=PATH],
121                         [sets path to perl executable]),
122                         with_perl=$withval,with_perl=$PERL)
123 AC_SUBST(PERL, $with_perl)
125 dnl openssl/gnutls
126 AC_ARG_WITH(openssl,
127             AC_HELP_STRING([--with-openssl=DIR],
128                            [path to openssl installation]),)
130 AC_ARG_WITH(gnutls,
131             ACX_HELP_STRING([--with-gnutls=PATH],
132                             [path to gnutls installation root]),)
134 dnl you can only have one or the other
135 if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
136         with_gnutls="no"
138 if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
139         with_openssl="no"
142 dnl list of possible dirs to try to autodetect openssl
143 dnl if $dir/include exists, we consider it found
144 dnl the order should allow locally installed versions to override distros' ones
145 OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
146               /opt /opt/openssl"
150 dnl Checks for libraries.
153 AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
154 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
155 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
156 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
157 AC_SUBST(SOCKETLIBS)
160 dnl check for math-related functions needing -lm
161 AC_CHECK_HEADERS(math.h)
162 AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
163 AC_CHECK_HEADERS(mp.h)
164 AC_CHECK_LIB(bsd,pow,MATHLIBS="$MATHLIBS -lbsd")
165 AC_SUBST(MATHLIBS)
167 dnl Check if we buils local libtap
168 AC_ARG_ENABLE(libtap,
169   AC_HELP_STRING([--enable-libtap],
170                 [Enable built-in libtap for unit-testing (default: autodetect system library).]),
171         [enable_libtap=$enableval],
172         [enable_libtap=no])
173 AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"])
175 # If not local, check if we can use the system one
176 if test "$enable_libtap" != "yes" ; then
177         dnl Check for libtap, to run perl-like tests
178         AC_CHECK_LIB(tap, plan_tests,
179                 enable_libtap="yes"
180                 )
183 # Finally, define tests if we use libtap
184 if test "$enable_libtap" = "yes" ; then
185         EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
186         AC_SUBST(EXTRA_TEST)
189 dnl INI Parsing
190 AC_ARG_ENABLE(extra-opts,
191   AC_HELP_STRING([--enable-extra-opts],
192                 [Enables parsing of plugins ini config files for extra options (default: no)]),
193         [enable_extra_opts=$enableval],
194         [enable_extra_opts=yes])
195 AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
196 if test "$enable_extra_opts" = "yes" ; then
197         AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
198         if test "$enable_libtap" = "yes"; then
199                 EXTRA_TEST="$EXTRA_TEST test_ini1 test_ini3 test_opts1 test_opts2 test_opts3"
200                 AC_SUBST(EXTRA_TEST)
201         fi
204 dnl Check for PostgreSQL libraries
205 _SAVEDLIBS="$LIBS"
206 _SAVEDCPPFLAGS="$CPPFLAGS"
207 AC_ARG_WITH(pgsql,
208         ACX_HELP_STRING([--with-pgsql=DIR],
209                 [sets path to pgsql installation]),
210         PGSQL=$withval,)
211 AC_CHECK_LIB(crypt,main)
212 if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
213   if test -n "$PGSQL"; then
214     LDFLAGS="$LDFLAGS -L$PGSQL/lib"
215     CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
216   fi
217   AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
218   if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
219     AC_CHECK_HEADERS(pgsql/libpq-fe.h)
220     AC_CHECK_HEADERS(postgresql/libpq-fe.h)
221     AC_CHECK_HEADERS(libpq-fe.h)
222     if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
223       PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
224       PGINCLUDE="-I$PGSQL/include"
225     elif test  "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
226       PGLIBS="-lpq -lcrypt"
227       PGINCLUDE="-I/usr/include/pgsql"
228     elif test  "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
229       PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
230       PGINCLUDE="-I/usr/include/postgresql"
231     elif test  "$ac_cv_header_libpq_fe_h" = "yes"; then
232       PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
233       PGINCLUDE="-I$PGSQL/include"
234     fi
235     if test -z "$PGINCLUDE"; then
236       AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
237       AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
238     else
239       AC_SUBST(PGLIBS)
240       AC_SUBST(PGINCLUDE)
241       EXTRAS="$EXTRAS check_pgsql\$(EXEEXT)"
242     fi
243   else
244     AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
245     AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
246     AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
247   fi
248 else
249   AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
250   AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
252 LIBS="$_SAVEDLIBS"
253 CPPFLAGS="$_SAVEDCPPFLAGS"
255 AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Skips the dbi plugin])])
256 dnl Check for DBI libraries
257 AS_IF([test "x$with_dbi" != "xno"], [
258   _SAVEDLIBS="$LIBS"
259   AC_CHECK_LIB(dbi,dbi_initialize)
260   if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
261     EXTRAS="$EXTRAS check_dbi\$(EXEEXT)"
262         DBILIBS="-ldbi"
263     AC_SUBST(DBILIBS)
264   else
265     AC_MSG_WARN([Skipping dbi plugin])
266     AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).])
267   fi
268   LIBS="$_SAVEDLIBS"
271 AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plugin])])
273 dnl Check for radius libraries
274 AS_IF([test "x$with_radius" != "xno"], [
275   _SAVEDLIBS="$LIBS"
276   AC_CHECK_LIB(radcli,rc_read_config)
277   if test "$ac_cv_lib_radcli_rc_read_config" = "yes"; then
278     EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
279     RADIUSLIBS="-lradcli"
280     AC_SUBST(RADIUSLIBS)
281   else
282     AC_CHECK_LIB(freeradius-client,rc_read_config)
283     if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then
284       EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
285       RADIUSLIBS="-lfreeradius-client"
286       AC_SUBST(RADIUSLIBS)
287     else
288       AC_CHECK_LIB(radiusclient-ng,rc_read_config)
289       if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
290         EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
291         RADIUSLIBS="-lradiusclient-ng"
292         AC_SUBST(RADIUSLIBS)
293       else
294         AC_CHECK_LIB(radiusclient,rc_read_config)
295         if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
296           EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
297           RADIUSLIBS="-lradiusclient"
298           AC_SUBST(RADIUSLIBS)
299         else
300           AC_MSG_WARN([Skipping radius plugin])
301           AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
302         fi
303       fi
304     fi
305   fi
306   LIBS="$_SAVEDLIBS"
309 AC_ARG_WITH([ldap], [AS_HELP_STRING([--without-ldap], [Skips the LDAP plugin])])
311 dnl Check for LDAP libraries
312 AS_IF([test "x$with_ldap" != "xno"], [
313   _SAVEDLIBS="$LIBS"
314   AC_CHECK_LIB(ldap,main,,,-llber)
315   if test "$ac_cv_lib_ldap_main" = "yes"; then
316     LDAPLIBS="-lldap -llber"\
317     LDAPINCLUDE="-I/usr/include/ldap"
318     AC_SUBST(LDAPLIBS)
319     AC_SUBST(LDAPINCLUDE)
320     AC_CHECK_FUNCS(ldap_set_option)
321     EXTRAS="$EXTRAS check_ldap\$(EXEEXT)"
322         AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
323   else
324     AC_MSG_WARN([Skipping LDAP plugin])
325     AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
326   fi
327   LIBS="$_SAVEDLIBS"
330 dnl Check for headers used by check_ide_smart
331 case $host in
332   *linux*)
333     AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
334     if test "$FOUNDINCLUDE" = "yes" ; then
335         AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
336     fi
337     if test "$FOUNDINCLUDE" = "no" ; then
338         AC_MSG_WARN([Skipping check_ide_smart plugin.])
339         AC_MSG_WARN([check_ide_smart requires linux/hdreg.h and linux/types.h.])
340     fi
341   ;;
342   *netbsd*)
343     AC_CHECK_HEADER(dev/ata/atareg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
344     if test "$FOUNDINCLUDE" = "yes" ; then
345         AC_CHECK_HEADER(dev/ic/wdcreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
346     fi
347     if test "$FOUNDINCLUDE" = "no" ; then
348         AC_MSG_WARN([Skipping check_ide_smart plugin.])
349         AC_MSG_WARN([check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h])
350     fi
351   ;;
352   *)
353     AC_MSG_WARN([Skipping check_ide_smart plugin.])
354     AC_MSG_WARN([check_ide_smart works only on Linux and NetBSD])
355 esac
357 if test "$FOUNDINCLUDE" = "yes" ; then
358         EXTRAS="$EXTRAS check_ide_smart\$(EXEEXT)"
361 dnl Check for mysql libraries
362 np_mysqlclient
363 if test $with_mysql = "no" ; then
364   AC_MSG_WARN([Skipping mysql plugin])
365   AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
366 else
367   EXTRAS="$EXTRAS check_mysql\$(EXEEXT) check_mysql_query\$(EXEEXT)"
368   MYSQLINCLUDE="$np_mysql_include"
369   MYSQLLIBS="$np_mysql_libs"
370   MYSQLCFLAGS="$np_mysql_cflags"
371   AC_SUBST(MYSQLINCLUDE)
372   AC_SUBST(MYSQLLIBS)
373   AC_SUBST(MYSQLCFLAGS)
376 dnl Check for headers used by check_users
377 AC_CHECK_HEADERS(utmpx.h)
378 AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"])
380 AC_CHECK_HEADERS(wtsapi32.h, [], [], [#include <windows.h>])
381 AM_CONDITIONAL([HAVE_WTS32API], [test "$ac_cv_header_wtsapi32_h" = "yes"])
383 if test "$ac_cv_header_wtsapi32_h" = "yes"; then
384   WTSAPI32LIBS="-lwtsapi32"
385   AC_SUBST(WTSAPI32LIBS)
388 dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface
389 if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no"
390 then
391         AC_PATH_PROG(PATH_TO_WHO,who)
393         if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
394         then
395                 ac_cv_path_to_who="$PATH_TO_WHO -q"
396         else
397                 ac_cv_path_to_who="$PATH_TO_WHO"
398         fi
400         AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
401                 [path and arguments for invoking 'who'])
404 AC_ARG_WITH([ipv6],
405         [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
406         [], [with_ipv6=check])
408 dnl Check for AF_INET6 support - unistd.h required for Darwin
409 if test "$with_ipv6" != "no"; then
410         AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
411                 AC_TRY_COMPILE(
412                         [#ifdef HAVE_UNISTD_H
413                         #include <unistd.h>
414                         #endif
415                         #include <netinet/in.h>
416                         #include <sys/socket.h>],
417                         [struct sockaddr_in6 sin6;
418                         void *p;
420                         sin6.sin6_family = AF_INET6;
421                         sin6.sin6_port = 587;
422                         p = &sin6.sin6_addr;],
423                         [np_cv_sys_ipv6=yes],
424                         [np_cv_sys_ipv6=no])
425                 ])
426         if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
427                 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
428         fi
429         if test "$np_cv_sys_ipv6" = "yes"; then
430                 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
431         fi
432         with_ipv6="$np_cv_sys_ipv6"
436 dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
437 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
438 if test "$FOUNDINCLUDE" = "no"; then
439   _SAVEDCPPFLAGS="$CPPFLAGS"
440   CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
441   unset ac_cv_header_krb5_h
442   AC_CHECK_HEADERS(krb5.h,
443                    KRB5INCLUDE="-I/usr/kerberos/include"
444                    FOUNDINCLUDE=yes,
445                    FOUNDINCLUDE=no)
447 AC_SUBST(KRBINCLUDE)
448 if test "$FOUNDINCLUDE" = "no"; then
449   CPPFLAGS="$_SAVEDCPPFLAGS"
452 dnl *** The following block comes from wget configure.ac ***
453 dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto
454 dnl shared library doesn't record its dependency on libdl, so we
455 dnl need to check for it ourselves so we won't fail to link due to a
456 dnl lack of -ldl.  Most OSes use dlopen(), but HP-UX uses
457 dnl shl_load().
458 AC_CHECK_LIB(dl,dlopen)
459 AC_CHECK_LIB(dl,shl_load)
461 dnl openssl detection/configuration
462 if ! test x"$with_openssl" = x"no"; then
463         dnl Check for OpenSSL location if it wasn't already specified
464         if ! test -d "$with_openssl"; then
465                 for d in $OPENSSL_DIRS; do
466                         if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
467                                 with_openssl=$d
468                         fi
469                 done
470         fi
472         _SAVEDCPPFLAGS="$CPPFLAGS"
473         _SAVEDLDFLAGS="$LDFLAGS"
474         dnl Check for OpenSSL header files
475         unset FOUNDINCLUDE
476         if test x"$with_openssl" != x"/usr" ; then
477                 CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
478                 LDFLAGS="$LDFLAGS -L$with_openssl/lib"
479         fi
481         dnl check for openssl in $dir/include/openssl
482         AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
483                          SSLINCLUDE="-I$with_openssl/include"
484                          FOUNDINCLUDE=yes,
485                          FOUNDINCLUDE=no)
486         dnl else check to see if $dir/include has it
487         if test "$FOUNDINCLUDE" = "no"; then
488                 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
489                                  SSLINCLUDE="-I$with_openssl/include"
490                                  FOUNDINCLUDE=yes,
491                                  FOUNDINCLUDE=no)
492         fi
493         AC_SUBST(SSLINCLUDE)
494         dnl if we didn't find it, reset CPPFLAGS
495         if test "$FOUNDINCLUDE" = "no"; then
496                 CPPFLAGS="$_SAVEDCPPFLAGS"
497                 LDFLAGS="$_SAVEDLDFLAGS"
498         fi
500         dnl Check for crypto lib
501         _SAVEDLIBS="$LIBS"
502         LIBS="-L${with_openssl}/lib"
503         AC_CHECK_LIB(crypto,CRYPTO_new_ex_data)
504         if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
505                 dnl Check for SSL lib
506                 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
507         fi
508         LIBS="$_SAVEDLIBS"
510         dnl test headers and libs to decide whether check_http should use SSL
511         if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
512                 if test "$ac_cv_lib_ssl_main" = "yes"; then
513                         if test "$FOUNDINCLUDE" = "yes"; then
514                                 FOUNDOPENSSL="yes"
515                         fi
516                 fi
517         fi
521 dnl check for gnutls if openssl isn't found (or is disabled)
522 if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
523         if test ! "$with_gnutls" = ""; then
524                 CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
525         fi
526         AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
527         if test "$FOUNDGNUTLS" = "yes"; then
528                 AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
529         fi
531 dnl end check for gnutls
533 if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
534         check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
535         AC_SUBST(check_tcp_ssl)
536         AC_SUBST(SSLLIBS)
537         AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
538         if test "$FOUNDOPENSSL" = "yes"; then
539                 AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
540                 with_openssl="yes"
541                 with_gnutls="no"
542         else
543                 AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
544                 with_gnutls="yes"
545                 with_openssl="no"
546         fi
547 else
548         dnl else deliberately disabled or no ssl support available
549         AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
550         with_openssl="no"
551         with_gnutls="no"
555 dnl Checks for header files.
558 AC_HEADER_TIME
559 AC_HEADER_SYS_WAIT
560 AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
561 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
563 dnl Checks for typedefs, structures, and compiler characteristics.
564 AC_C_CONST
565 AC_STRUCT_TM
566 AC_TYPE_PID_T
567 AC_TYPE_SIZE_T
568 AC_TYPE_SIGNAL
570 AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
571 AC_TRY_LINK([#include <stdarg.h>
572 va_list ap1,ap2;], [va_copy(ap1,ap2);],
573 ac_cv_HAVE_VA_COPY=yes,
574 ac_cv_HAVE_VA_COPY=no)])
575 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
576     AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
577 else
578     AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
579     AC_TRY_LINK([#include <stdarg.h>
580     va_list ap1,ap2;], [__va_copy(ap1,ap2);],
581     ac_cv_HAVE___VA_COPY=yes,
582     ac_cv_HAVE___VA_COPY=no)])
583     if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
584         AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
585     fi
588 AC_TRY_COMPILE([#include <sys/time.h>],
589                [struct timeval *tv;
590                 struct timezone *tz;],
591                AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
592                AC_TRY_COMPILE([#include <sys/time.h>],
593                               [struct timeval *tv;
594                                struct timezone *tz;
595                                gettimeofday(tv, tz);],
596                               AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
597                               AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
599 dnl Checks for library functions.
600 AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
601 AC_CHECK_FUNCS(poll)
603 AC_MSG_CHECKING(return type of socket size)
604 AC_TRY_COMPILE([#include <stdlib.h>
605                 #include <sys/types.h>
606                 #include <sys/socket.h>],
607                [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
608                ac_cv_socket_size_type=["size_t"]
609                 AC_MSG_RESULT(size_t),
610                ac_cv_socket_size_type=["int"]
611                 AC_MSG_RESULT(int))
613 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
614         [Define type of socket size])
617 dnl #### Process table test
619 AC_PATH_PROG(PATH_TO_PS,ps)
620 AC_PATH_PROG(PATH_TO_ENV,env)
622 AC_MSG_CHECKING(for ps syntax)
623 AC_ARG_WITH(ps_command,
624             ACX_HELP_STRING([--with-ps-command=PATH],
625                             [Verbatim command to execute for ps]),
626             PS_COMMAND=$withval)
627 AC_ARG_WITH(ps_format,
628             ACX_HELP_STRING([--with-ps-format=FORMAT],
629                             [Format string for scanning ps output]),
630             PS_FORMAT=$withval)
631 AC_ARG_WITH(ps_cols,
632             ACX_HELP_STRING([--with-ps-cols=NUM],
633                             [Number of columns in ps command]),
634             PS_COLS=$withval)
635 AC_ARG_WITH(ps_varlist,
636             ACX_HELP_STRING([--with-ps-varlist=LIST],
637                             [Variable list for sscanf of 'ps' output]),
638             PS_VARLIST=$withval)
640 if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
641         ac_cv_ps_command="$PS_COMMAND"
642         ac_cv_ps_format="$PS_FORMAT"
643         ac_cv_ps_varlist="$PS_VARLIST"
644         ac_cv_ps_cols="$PS_COLS"
645         AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
647 dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
648 elif test "$ac_cv_uname_s" = "SunOS"; then
649         #
650         # this is a very, very ugly hack, to hardcode the location for plugins
651         #
652         if test "$libexecdir" = '${exec_prefix}/libexec'; then
653                 if test "$exec_prefix" = "NONE"; then
654                         if test "$prefix" = "NONE"; then
655                                 pst3="$ac_default_prefix/libexec/pst3"
656                         else
657                                 pst3="$prefix/libexec/pst3"
658                         fi
659                 else
660                         pst3="$exec_prefix/libexec/pst3"
661                 fi
662         else
663                 pst3="$libexecdir/pst3"
664         fi
665         ac_cv_ps_command="$pst3"
666         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
667         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
668         ac_cv_ps_cols=9
669         AC_MSG_RESULT([using monitoring-plugins internal ps command (pst3) for solaris])
670         if test `isainfo -b` = 64 ; then
671                 pst3_use_64bit=1
672                 AC_MSG_NOTICE([using 64bit pst3])
673         else
674                 AC_MSG_NOTICE([using 32bit pst3])
675         fi
676         EXTRAS_ROOT="$EXTRAS_ROOT pst3\$(EXEEXT)"
678         if test "$pst3_use_64bit" = 1; then
679                 dnl Test if we can actually compile code in 64bit
680                 old_cflags=$CFLAGS
681                 CFLAGS="$CFLAGS -m64"
682                 pst3_64bit_working=0
683                 AC_RUN_IFELSE(
684                         [AC_LANG_PROGRAM([], [
685 return sizeof(void*) == 8 ? 0 : 1;
686                         ])
687                 ],[
688                         PST3CFLAGS="-m64"
689                         AC_SUBST(PST3CFLAGS)
690                         pst3_64bit_working=1
691                         AC_MSG_NOTICE([using -m64 for 64bit code])
692                 ],[
693                         pst3_64bit_working=0
694                         AC_MSG_NOTICE([compiler do not like -m64])
695                 ])
696                 CFLAGS=$old_cflags
697                 if test "$pst3_64bit_working" = 0; then
698                         old_cflags=$CFLAGS
699                         CFLAGS="$CFLAGS -xarch=v9"
700                         AC_RUN_IFELSE(
701                                 [AC_LANG_PROGRAM([], [
702 return sizeof(void*) == 8 ? 0 : 1;
703                                 ])
704                         ],[
705                                 PST3CFLAGS="-xarch=v9"
706                                 AC_SUBST(PST3CFLAGS)
707                                 pst3_64bit_working=1
708                                 AC_MSG_NOTICE([using -xarch=v9 for 64bit code])
709                         ],[
710                                 pst3_64bit_working=0
711                                 AC_MSG_NOTICE([compiler do not like -xarch=v9])
712                         ])
713                         CFLAGS=$old_cflags
714                 fi
715                 if test "$pst3_64bit_working" = 0; then
716                         old_cflags=$CFLAGS
717                         CFLAGS="$CFLAGS -xarch=amd64"
718                         AC_RUN_IFELSE(
719                                 [AC_LANG_PROGRAM([], [
720 return sizeof(void*) == 8 ? 0 : 1;
721                                 ])
722                         ],[
723                                 PST3CFLAGS="-xarch=amd64"
724                                 AC_SUBST(PST3CFLAGS)
725                                 pst3_64bit_working=1
726                                 AC_MSG_NOTICE([using -xarch=amd64 for 64bit code])
727                         ],[
728                                 pst3_64bit_working=0
729                                 AC_MSG_NOTICE([compiler do not like -xarch=amd64])
730                         ])
731                         CFLAGS=$old_cflags
732                 fi
733                 if test "$pst3_64bit_working" = 0; then
734                         AC_MSG_ERROR([I don't know how to build a 64-bit object!])
735                 fi
736         fi
738 dnl Removing this for the moment - Ton
739 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
740 dnl Limitation that command name is not available
741 dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
742 dnl     egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
743 dnl then
744 dnl     ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
745 dnl     ac_cv_ps_command="/usr/ucb/ps -alxwwn"
746 dnl     ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
747 dnl     ac_cv_ps_cols=8
748 dnl     AC_MSG_RESULT([$ac_cv_ps_command])
750 dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
751 dnl so test for this first...
752 elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
753         egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
754 then
755         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
756         ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
757         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
758         ac_cv_ps_cols=9
759         AC_MSG_RESULT([$ac_cv_ps_command])
761 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
762 dnl Should also work for FreeBSD 5.2.1 and 5.3
763 dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
764 elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
765         egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
766 then
767         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
768         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
769         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
770         ac_cv_ps_cols=9
771         AC_MSG_RESULT([$ac_cv_ps_command])
773 dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
774 dnl Limitation: Only first 16 chars returned for ucomm field
775 dnl Must come before ps -weo
776 elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
777         egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
778 then
779         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
780         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
781         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
782         ac_cv_ps_cols=9
783         AC_MSG_RESULT([$ac_cv_ps_command])
785 dnl  STAT UCOMM              VSZ   RSS USER       UID  PPID COMMAND
786 elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
787         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
788 then
789         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
790         ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
791         ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
792         ac_cv_ps_cols=10
793         AC_MSG_RESULT([$ac_cv_ps_command])
795 dnl FreeBSD
796 elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
797         egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
798 then
799         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
800         ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
801         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
802         ac_cv_ps_cols=9
803         AC_MSG_RESULT([$ac_cv_ps_command])
805 dnl BSD-like mode in RH 6.1
806 elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
807         egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
808 then
809         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
810         ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
811         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
812         ac_cv_ps_cols=9
813         AC_MSG_RESULT([$ac_cv_ps_command])
815 dnl SunOS 4.1.3:
816 dnl  F  UID  PID  PPID  CP  PRI  NI  SZ  RSS  WCHAN  STAT  TT  TIME  COMMAND
817 dnl Need the head -1 otherwise test will work because arguments are found
818 elif ps -laxnwww 2>/dev/null | head -1 | \
819         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
820 then
821         ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
822         ac_cv_ps_command="$PATH_TO_PS -laxnwww"
823         ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
824         ac_cv_ps_cols=9
825         AC_MSG_RESULT([$ac_cv_ps_command])
827 dnl Debian Linux / procps v1.2.9:
828 dnl  FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
829 dnl    100     0     1     0   0   0    776    76  c0131c8c   S  ffff  0:11 init [2]
831 elif ps laxnwww 2>/dev/null | \
832         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
833 then
834         ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
835         ac_cv_ps_command="$PATH_TO_PS laxnwww"
836         ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
837         ac_cv_ps_cols=9
838         AC_MSG_RESULT([$ac_cv_ps_command])
840 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
841 elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
842         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
843 then
844         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
845         ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
846         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
847         ac_cv_ps_cols=9
848         AC_MSG_RESULT([$ac_cv_ps_command])
850 dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
851 dnl Has /usr/bin/ps and /sbin/ps - force sbin version
852 dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
853 dnl of 1500). Will need big changes to check_procs to support
854 elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
855         egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
856 then
857         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
858         ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
859         ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
860         ac_cv_ps_cols=8
861         AC_MSG_RESULT([$ac_cv_ps_command])
863 elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
864         egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
865 then
866         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
867         ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
868         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
869         ac_cv_ps_cols=9
870         AC_MSG_RESULT([$ac_cv_ps_command])
872 dnl AIX 4.3.3 and 5.1 do not have an rss field
873 elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
874         egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
875 then
876         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
877         ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
878         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
879         ac_cv_ps_cols=8
880         AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
882 dnl Solaris 2.6
883 elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
884         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
885 then
886         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
887         ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
888         # There must be no space between the %s and %n due to a wierd problem in sscanf where
889         # it will return %n as longer than the line length
890         ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
891         ac_cv_ps_cols=9
892         AC_MSG_RESULT([$ac_cv_ps_command])
894 elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
895         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
896 then
897         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
898         ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
899         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
900         ac_cv_ps_cols=9
901         AC_MSG_RESULT([$ac_cv_ps_command])
903 elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
904         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
905 then
906         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
907         ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
908         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
909         ac_cv_ps_cols=9
910         AC_MSG_RESULT([$ac_cv_ps_command])
912 dnl wonder who takes state instead of stat
913 elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
914         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
915 then
916         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
917         ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
918         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
919         ac_cv_ps_cols=8
920         AC_MSG_RESULT([$ac_cv_ps_command])
922 dnl IRIX 53
923 elif ps -el 2>/dev/null | \
924         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
925 then
926         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
927         ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
928         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
929         ac_cv_ps_cols=8
930         AC_MSG_RESULT([$ac_cv_ps_command])
932 dnl IRIX 63
933 elif ps -el 2>/dev/null | \
934         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
935 then
936         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
937         ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
938         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
939         ac_cv_ps_cols=6
940         AC_MSG_RESULT([$ac_cv_ps_command])
942 dnl HP-UX:
943 dnl S        UID       RUID USER     RUSER      PID  PPID     VSZ  %CPU COMMAND         COMMAND
944 dnl S          0        400 root     oracle    2805     1   12904  0.00 ora_dism_SEA1X  ora_dism_SEA1X
945 dnl S        400        400 oracle   oracle   19261     1  126488  0.00 tnslsnr         /u01/app/oracle/product/db/11.2.0.3/bin/tnslsnr LISTENER -inherit
946 elif env UNIX95=1 ps -eo 'state uid ruid user ruser pid ppid vsz pcpu comm args' 2>/dev/null | head -n 1 | \
947     egrep -i ["^ *S +UID +RUID +USER +RUSER +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
948 then
949     ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
950     ac_cv_ps_command="$PATH_TO_ENV UNIX95=1 $PATH_TO_PS -eo 'state uid pid ppid vsz pcpu comm args'"
951     ac_cv_ps_format="%s %d %d %d %d %f %s %n"
952     ac_cv_ps_cols=8
953     AC_MSG_RESULT([$ac_cv_ps_command])
955 dnl AIX 4.1:
956 dnl     F S      UID   PID  PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
957 dnl    303 A        0     0     0 120  16 -- 1c07  20   24              -  0:45 swapper
958 elif ps -el 2>/dev/null | \
959         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
960 then
961         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
962         ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
963         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
964         ac_cv_ps_cols=6
965         AC_MSG_RESULT([$ac_cv_ps_command])
967 dnl AIX?
968 elif ps glaxen 2>/dev/null | \
969         egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
970 then
971         ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
972         ac_cv_ps_command="$PATH_TO_PS glaxen"
973         ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
974         ac_cv_ps_cols=8
975         AC_MSG_RESULT([$ac_cv_ps_command])
977 dnl MacOSX / Darwin
978 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
979 dnl Some truncation will happen in UCOMM column
980 dnl STAT      VSZ    RSS   UID  PPID %CPU UCOMM            COMMAND
981 dnl Ss      52756  22496   501     1   6.9 Window Manager   /System/Library/CoreServices/WindowServer -daemon
982 elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
983         egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
984 then
985         ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
986         ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
987         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
988         ac_cv_ps_cols=8
989         AC_MSG_RESULT([$ac_cv_ps_command])
991 dnl UnixWare
992 elif ps -Al 2>/dev/null | \
993         egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
994 then
995         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
996         ac_cv_ps_command="$PATH_TO_PS -Al"
997         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
998         ac_cv_ps_cols=8
999         AC_MSG_RESULT([$ac_cv_ps_command])
1001 else
1002         AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
1005 if test -n "$ac_cv_ps_varlist" ; then
1006         AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
1007                 [Variable list for sscanf of 'ps' output])
1008         AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
1009                 [Verbatim command to execute for ps in check_procs])
1010         AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
1011                 [Format string for scanning ps output in check_procs])
1012         AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
1013                 [Number of columns in ps command])
1014         EXTRAS="$EXTRAS check_procs check_nagios\$(EXEEXT)"
1015         if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
1016                 AC_DEFINE(PS_USES_PROCETIME,"yes",
1017                           [Whether the ps utility uses the "procetime" field])
1018         fi
1019         if echo "$ac_cv_ps_varlist" | grep "procpcpu" >/dev/null; then
1020                 AC_DEFINE(PS_USES_PROCPCPU,"yes",
1021                           [Whether the ps utility uses the "procpcpu" field])
1022         fi
1025 AC_PATH_PROG(PATH_TO_PING,ping)
1026 AC_PATH_PROG(PATH_TO_PING6,ping6)
1028 AC_ARG_WITH(ping_command,
1029         ACX_HELP_STRING([--with-ping-command=SYNTAX],
1030                 [sets syntax for ICMP ping]),
1031         with_ping_command=$withval,)
1033 AC_MSG_CHECKING(for ICMP ping syntax)
1034 ac_cv_ping_packets_first=no
1035 ac_cv_ping_has_timeout=no
1036 if test -n "$with_ping_command"
1037 then
1038         AC_MSG_RESULT([(command-line) $with_ping_command])
1039         if echo "$with_ping_command" | grep '%d.*%d.*%s' >/dev/null
1040         then
1041                 ac_cv_ping_packets_first=yes
1042                 ac_cv_ping_has_timeout=yes
1043         elif echo "$with_ping_command" | grep '%d.*%s.*%d' >/dev/null || \
1044              echo "$with_ping_command" | grep '%s.*%d.*%d' >/dev/null
1045         then
1046                 ac_cv_ping_has_timeout=yes
1047         elif echo "$with_ping_command" | grep '%d.*%s' >/dev/null
1048         then
1049                 ac_cv_ping_packets_first=yes
1050         fi
1052 elif [[ "z$ac_cv_uname_o" = "zCygwin" ]]
1053 then
1054         with_ping_command="$PATH_TO_PING -n %d -w %d000 %s"
1055         ac_cv_ping_packets_first=yes
1056         ac_cv_ping_has_timeout=yes
1057         AC_MSG_RESULT([$with_ping_command])
1059 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1060         $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
1061         egrep -i "^round-trip|^rtt" >/dev/null
1062 then
1063         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
1064         ac_cv_ping_packets_first=yes
1065         AC_MSG_RESULT([$with_ping_command])
1067 elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
1068         egrep -i "^round-trip|^rtt" >/dev/null
1069 then
1070         with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
1071         ac_cv_ping_packets_first=yes
1072         ac_cv_ping_has_timeout=yes
1073         AC_MSG_RESULT([$with_ping_command])
1075 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
1076         egrep -i "^round-trip|^rtt" >/dev/null
1077 then
1078         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
1079         ac_cv_ping_packets_first=yes
1080         AC_MSG_RESULT([$with_ping_command])
1082 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
1083         egrep -i "^round-trip|^rtt" >/dev/null
1084 then
1085         with_ping_command="$PATH_TO_PING -n -c %d %s"
1086         ac_cv_ping_packets_first=yes
1087         AC_MSG_RESULT([$with_ping_command])
1089 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
1090         egrep -i "^round-trip|^rtt" >/dev/null
1091 then
1092         with_ping_command="$PATH_TO_PING -n %s -c %d"
1093         AC_MSG_RESULT([$with_ping_command])
1095 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
1096         egrep -i "^round-trip|^rtt" >/dev/null
1097 then
1098         with_ping_command="$PATH_TO_PING %s -n %d"
1099         AC_MSG_RESULT([$with_ping_command])
1101 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
1102         egrep -i "^round-trip|^rtt" >/dev/null
1103 then
1104         with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
1105         AC_MSG_RESULT([$with_ping_command])
1107 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
1108         egrep -i "^round-trip|^rtt" >/dev/null
1109 then
1110         with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
1111         AC_MSG_RESULT([$with_ping_command])
1113 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
1114         egrep -i "^round-trip|^rtt" >/dev/null
1115 then
1116         with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
1117         ac_cv_ping_packets_first=yes
1118         AC_MSG_RESULT([$with_ping_command])
1120 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
1121         egrep -i "^round-trip|^rtt" >/dev/null
1122 then
1123         with_ping_command="$PATH_TO_PING -n -c %d %s"
1124         ac_cv_ping_packets_first=yes
1125         AC_MSG_RESULT([$with_ping_command])
1127 else
1128         AC_MSG_WARN([unable to find usable ping syntax])
1131 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
1132         [path and args for ICMP ping command])
1134 if test "x$ac_cv_ping_packets_first" != "xno"
1135 then
1136         AC_DEFINE(PING_PACKETS_FIRST,1,
1137                 [Define if packet count must precede host])
1140 if test "x$ac_cv_ping_has_timeout" != "xno"
1141 then
1142         AC_DEFINE(PING_HAS_TIMEOUT,1,
1143                 [Define if ping has its own timeout option that should be set])
1146 AC_ARG_WITH(ping6_command,
1147         ACX_HELP_STRING([--with-ping6-command=SYNTAX],
1148                 [sets syntax for ICMPv6 ping]),
1149         with_ping6_command=$withval,)
1151 if test x"$with_ipv6" != xno ; then
1152 AC_MSG_CHECKING(for ICMPv6 ping syntax)
1153 ac_cv_ping6_packets_first=no
1154 if test -n "$with_ping6_command"
1155 then
1156         AC_MSG_RESULT([(command-line) $with_ping6_command])
1157         if echo "$with_ping6_command" | grep '%d.*%d.*%s' >/dev/null
1158         then
1159                 ac_cv_ping6_packets_first=yes
1160         elif echo "$with_ping6_command" | grep '%d.*%s.*%d' >/dev/null || \
1161              echo "$with_ping6_command" | grep '%s.*%d.*%d' >/dev/null
1162         then
1163                 # Just keep same logic as ping (IPv4) if we ever need ac_cv_ping6_has_timeout
1164                 true
1165         elif echo "$with_ping6_command" | grep '%d.*%s' >/dev/null
1166         then
1167                 ac_cv_ping6_packets_first=yes
1168         fi
1169 elif [[ "z$ac_cv_uname_o" = "zCygwin" -a "x$PATH_TO_PING" != "x" ]]; then
1170         with_ping6_command="$PATH_TO_PING -6 -n %d -w %d000 %s"
1171         ac_cv_ping6_packets_first=yes
1172         ac_cv_ping_has_timeout=yes
1173         AC_MSG_RESULT([$with_ping6_command])
1174 elif test "x$PATH_TO_PING6" != "x"; then
1175         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1176                 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1177                 egrep -i "^round-trip|^rtt" >/dev/null
1178         then
1179                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
1180                 ac_cv_ping6_packets_first=yes
1181                 AC_MSG_RESULT([$with_ping6_command])
1183         elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
1184                 egrep -i "^round-trip|^rtt" >/dev/null
1185         then
1186                 with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
1187                 ac_cv_ping6_packets_first=yes
1188                 ac_cv_ping_has_timeout=yes
1189                 AC_MSG_RESULT([$with_ping6_command])
1191         elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
1192                 egrep -i "^round-trip|^rtt" >/dev/null
1193         then
1194                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
1195                 ac_cv_ping6_packets_first=yes
1196                 AC_MSG_RESULT([$with_ping6_command])
1198         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1199                 egrep -i "^round-trip|^rtt" >/dev/null
1200         then
1201                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1202                 ac_cv_ping6_packets_first=yes
1203                 AC_MSG_RESULT([$with_ping6_command])
1205         elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
1206                 egrep -i "^round-trip|^rtt" >/dev/null
1207         then
1208                 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1209                 AC_MSG_RESULT([$with_ping6_command])
1211         elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1212                 egrep -i "^round-trip|^rtt" >/dev/null
1213         then
1214                 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1215                 AC_MSG_RESULT([$with_ping6_command])
1217         elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1218                 egrep -i "^round-trip|^rtt" >/dev/null
1219         then
1220                 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1221                 AC_MSG_RESULT([$with_ping6_command])
1223         elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1224                 egrep -i "^round-trip|^rtt" >/dev/null
1225         then
1226                 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1227                 AC_MSG_RESULT([$with_ping6_command])
1229         elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1230                 egrep -i "^round-trip|^rtt" >/dev/null
1231         then
1232                 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1233                 ac_cv_ping6_packets_first=yes
1234                 AC_MSG_RESULT([$with_ping_command])
1236         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1237                 egrep -i "^round-trip|^rtt" >/dev/null
1238         then
1239                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1240                 ac_cv_ping6_packets_first=yes
1241                 AC_MSG_RESULT([$with_ping6_command])
1243         fi
1245 elif test "x$PATH_TO_PING" != "x"; then
1246         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1247                 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1248                 egrep -i "^round-trip|^rtt" >/dev/null
1249         then
1250                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1251                 ac_cv_ping6_packets_first=yes
1252                 AC_MSG_RESULT([$with_ping6_command])
1254         elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1255                 egrep -i "^round-trip|^rtt" >/dev/null
1256         then
1257                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1258                 ac_cv_ping6_packets_first=yes
1259                 AC_MSG_RESULT([$with_ping6_command])
1261         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1262                 egrep -i "^round-trip|^rtt" >/dev/null
1263         then
1264                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1265                 ac_cv_ping6_packets_first=yes
1266                 AC_MSG_RESULT([$with_ping6_command])
1268         elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1269                 egrep -i "^round-trip|^rtt" >/dev/null
1270         then
1271                 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1272                 AC_MSG_RESULT([$with_ping6_command])
1274         elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1275                 egrep -i "^round-trip|^rtt" >/dev/null
1276         then
1277                 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1278                 AC_MSG_RESULT([$with_ping6_command])
1280         elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1281                 egrep -i "^round-trip|^rtt" >/dev/null
1282         then
1283                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1284                 AC_MSG_RESULT([$with_ping6_command])
1286         elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1287                 egrep -i "^round-trip|^rtt" >/dev/null
1288         then
1289                 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1290                 AC_MSG_RESULT([$with_ping6_command])
1292         elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1293                 egrep -i "^round-trip|^rtt" >/dev/null
1294         then
1295                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1296                 ac_cv_ping6_packets_first=yes
1297                 AC_MSG_RESULT([$with_ping_command])
1299         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1300                 egrep -i "^round-trip|^rtt" >/dev/null
1301         then
1302                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1303                 ac_cv_ping6_packets_first=yes
1304                 AC_MSG_RESULT([$with_ping6_command])
1306         fi
1310 if test "x$with_ping6_command" != "x"; then
1311         AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1312                 [path and args for ICMPv6 ping command])
1313 else
1314         AC_MSG_RESULT([none])
1317 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1318         AC_DEFINE(PING6_PACKETS_FIRST,1,
1319                 [Define if packet count must precede host])
1324 AC_ARG_WITH(nslookup_command,
1325             ACX_HELP_STRING([--with-nslookup-command=PATH],
1326                             [sets path to nslookup executable]),
1327             ac_cv_nslookup_command=$withval)
1328 if test -n "$ac_cv_nslookup_command"; then
1329         AC_MSG_NOTICE([Using specific nslookup at $ac_cv_nslookup_command])
1330 else
1331         AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1332         if test -n "$PATH_TO_NSLOOKUP"
1333         then
1334                 AC_MSG_CHECKING(for nslookup syntax)
1335                 if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1336                 then
1337                         ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1338                         AC_MSG_RESULT([$ac_cv_nslookup_command])
1340                 else
1341                         ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1342                         AC_MSG_RESULT([$ac_cv_nslookup_command])
1344                 fi
1345         else
1346                 AC_MSG_WARN([nslookup command not found])
1347         fi
1350 if test -n "$ac_cv_nslookup_command"; then
1351         EXTRAS="$EXTRAS check_dns\$(EXEEXT)"
1352         AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
1355 AC_MSG_CHECKING([for number of online cpus])
1356 AC_TRY_COMPILE([#include <unistd.h>],
1357         [sysconf(_SC_NPROCESSORS_ONLN) > 0;],
1358         AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus])
1359         AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]),
1360         AC_MSG_RESULT([cannot calculate])
1361         )
1363 AC_MSG_CHECKING([for number of available cpus])
1364 AC_TRY_COMPILE([#include <unistd.h>],
1365         [sysconf(_SC_NPROCESSORS_CONF) > 0;],
1366         AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus])
1367         AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1368         AC_MSG_RESULT([cannot calculate])
1369         )
1371 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1372 AC_ARG_WITH(uptime_command,
1373             ACX_HELP_STRING([--with-uptime-command=PATH],
1374                             [sets path to uptime]), PATH_TO_UPTIME=$withval)
1375 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1377 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1378 AC_ARG_WITH(rpcinfo_command,
1379             ACX_HELP_STRING([--with-rpcinfo-command=PATH],
1380                             [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
1381 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1383 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1384 if test -x "$PATH_TO_LMSTAT"
1385 then
1386         AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1387 else
1388         AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1391 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1392 AC_ARG_WITH(smbclient_command,
1393             ACX_HELP_STRING([--with-smbclient-command=PATH],
1394                             [sets path to smbclient]),
1395             PATH_TO_SMBCLIENT=$withval)
1396 if test -n "$PATH_TO_SMBCLIENT"
1397 then
1398         AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1399 else
1400         AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1403 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1404 AC_ARG_WITH(snmpget_command,
1405             ACX_HELP_STRING([--with-snmpget-command=PATH],
1406                             [Path to snmpget command]),
1407             PATH_TO_SNMPGET=$withval)
1408 if test -n "$PATH_TO_SNMPGET"
1409 then
1410         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1411         EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
1412 else
1413         AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1416 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1417 AC_ARG_WITH(snmpgetnext_command,
1418             ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
1419                             [Path to snmpgetnext command]),
1420             PATH_TO_SNMPGETNEXT=$withval)
1421 if test -n "$PATH_TO_SNMPGETNEXT"
1422 then
1423         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1426 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )
1427 then
1428         AC_MSG_CHECKING(for Net::SNMP perl module)
1429         AC_MSG_RESULT([found])
1430 else
1431         AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1434 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1435 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1436 AC_ARG_WITH(qstat_command,
1437             ACX_HELP_STRING([--with-qstat-command=PATH],
1438                             [Path to qstat command]), PATH_TO_QSTAT=$withval)
1440 if test -x "$PATH_TO_QUAKESTAT"
1441 then
1442         ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1443         EXTRAS="$EXTRAS check_game\$(EXEEXT)"
1445 elif test -n "$PATH_TO_QSTAT"
1446 then
1447         ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1448         EXTRAS="$EXTRAS check_game\$(EXEEXT)"
1449 else
1450         AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1453 if test $ac_cv_path_to_qstat
1454 then
1455         AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1456                 [path to qstat/quakestat])
1459 AC_PATH_PROG(PATH_TO_FPING,fping)
1460 AC_PATH_PROG(PATH_TO_FPING6,fping6)
1462 AC_ARG_WITH(fping_command,
1463             ACX_HELP_STRING([--with-fping-command=PATH],
1464                             [Path to fping command]), PATH_TO_FPING=$withval)
1465 AC_ARG_WITH(fping6_command,
1466             ACX_HELP_STRING([--with-fping6-command=PATH],
1467                             [Path to fping6 command]), PATH_TO_FPING6=$withval)
1469 if test -n "$PATH_TO_FPING"
1470 then
1471         AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1472         EXTRAS="$EXTRAS check_fping\$(EXEEXT)"
1473         if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then
1474                 AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6])
1475         fi
1476 else
1477         AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1480 AC_PATH_PROG(PATH_TO_SSH,ssh)
1481 AC_ARG_WITH(ssh_command,
1482             ACX_HELP_STRING([--with-ssh-command=PATH],
1483                             [sets path for ssh]), PATH_TO_SSH=$withval)
1484 if test -n "$PATH_TO_SSH"
1485 then
1486         AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1487         EXTRAS="$EXTRAS check_by_ssh\$(EXEEXT)"
1488 else
1489         AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1492 AC_PATH_PROG(PATH_TO_SUDO,sudo)
1493 AC_ARG_WITH(sudo_command,
1494             ACX_HELP_STRING([--with-sudo-command=PATH],
1495                             [sets path to sudo]), PATH_TO_SUDO=$withval)
1496 if test -n "$PATH_TO_SUDO"
1497 then
1498         AC_DEFINE_UNQUOTED(PATH_TO_SUDO,"$PATH_TO_SUDO",[path to sudo])
1499 else
1500         AC_MSG_WARN([Could not find sudo or eqivalent])
1503 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1504 AC_ARG_WITH(mailq_command,
1505             ACX_HELP_STRING([--with-mailq-command=PATH],
1506                             [sets path to mailq]), PATH_TO_MAILQ=$withval)
1507 if test -n "$PATH_TO_MAILQ"
1508 then
1509         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1510 else
1511         AC_MSG_WARN([Could not find mailq or eqivalent])
1514 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1515 AC_ARG_WITH(qmail_qstat_command,
1516             ACX_HELP_STRING([--with-qmail-qstat-command=PATH],
1517                             [sets path to qmail-qstat]), PATH_TO_QMAIL_QSTAT=$withval)
1518 if test -n "$PATH_TO_QMAIL_QSTAT"
1519 then
1520         AC_DEFINE_UNQUOTED(PATH_TO_QMAIL_QSTAT,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1521 else
1522         AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1525 dnl SWAP info required is amount allocated/available and amount free
1526 dnl The plugin works through all the swap devices and adds up the total swap
1527 dnl available.
1528 AC_PATH_PROG(PATH_TO_SWAP,swap)
1529 if (test -n "$PATH_TO_SWAP")
1530 then
1531 AC_MSG_CHECKING([for $PATH_TO_SWAP format])
1532 if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1533 then
1534         ac_cv_have_swap=yes
1535         ac_cv_swap_command="$PATH_TO_SWAP -l"
1536         if [$PATH_TO_SWAP -l 2>/dev/null | \
1537                 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1538                 >/dev/null]
1539         then
1540                 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
1541                 ac_cv_swap_conv=2048
1542                 AC_MSG_RESULT([using IRIX format swap])
1544         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1545         then
1546                 ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
1547                 ac_cv_swap_conv=2048
1548                 AC_MSG_RESULT([using Unixware format swap])
1549         else
1550                 dnl if we don't know what format swap's output is
1551                 dnl we might as well pretend we didn't see it
1552                 ac_cv_have_swap=""
1553                 ac_cv_swap_command=""
1554         fi
1556 dnl end if for PATH_TO_SWAP
1559 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1560 if (test -n "$PATH_TO_SWAPINFO")
1561 then
1562 AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
1563 if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1564 then
1565         ac_cv_have_swap=yes
1566         ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1568         if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1569         then
1570                 ac_cv_swap_format=["%*s %f %*d %f"]
1571                 ac_cv_swap_conv=1024
1572                 AC_MSG_RESULT([using FreeBSD format swapinfo])
1573         fi
1575 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1576 then
1577         ac_cv_have_swap=yes
1578         ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
1579         ac_cv_swap_format=["%*s %f %*d %f"]
1580         ac_cv_swap_conv=1024
1581         AC_MSG_RESULT([using HP-UX format swapinfo])
1583 dnl end if for PATH_TO_SWAPINFO
1586 AC_PATH_PROG(PATH_TO_LSPS,lsps)
1587 if (test -n "$PATH_TO_LSPS")
1588 then
1589 AC_MSG_CHECKING([for $PATH_TO_LSPS format])
1590 if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
1591 then
1592         ac_cv_have_swap=yes
1593         ac_cv_swap_command="$PATH_TO_LSPS -a"
1594         ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
1595         ac_cv_swap_conv=1
1596         AC_MSG_RESULT([using AIX lsps])
1598 dnl end if for PATH_TO_SWAPINFO
1602 dnl test for swapctl system call, both the 2-arg and 3-arg variants
1603 dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
1604 dnl in the various BSD's
1607 AC_CHECK_HEADERS([sys/stat.h sys/param.h])
1608 AC_CHECK_HEADERS([sys/swap.h], [], [], [
1609 #ifdef HAVE_SYS_PARAM_H
1610 #include <sys/param.h>
1611 #endif
1613 AC_CHECK_DECLS([swapctl],,,[
1614                #include <unistd.h>
1615                #include <sys/types.h>
1616                #include <sys/param.h>
1617                #include <sys/stat.h>
1618                #include <sys/swap.h>
1619                ])
1620 AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
1621                #include <sys/types.h>
1622                #include <sys/param.h>
1623                #include <sys/stat.h>
1624                #include <sys/swap.h>
1625                ])
1626 AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1627                  #include <unistd.h>
1628                  #include <sys/types.h>
1629                  #include <sys/param.h>
1630                  #include <sys/stat.h>
1631                  #include <sys/swap.h>
1632                  ])
1634 if test "$ac_cv_have_decl_swapctl" = "yes";
1635 then
1636         EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
1637         AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1638         if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1639                 "$ac_cv_type_swapent_t" = "yes";
1640         then
1641                 AC_MSG_RESULT([yes])
1642                 ac_cv_check_swap_swapctl_svr4="1";
1643                 AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
1644                           [Define if 2-argument SVR4 swapctl exists])
1645         else
1646                 AC_MSG_RESULT([no])
1647                 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1648                 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1649                 then
1650                         AC_MSG_RESULT([yes])
1651                         AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
1652                                   [Define if 3-argument BSD swapctl exists])
1653                 else
1654                         AC_MSG_RESULT([no])
1655                 fi
1656         fi
1657         AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
1658         if test "$ac_cv_check_swap_swapctl_svr4" = "1";
1659         then
1660                 dnl
1661                 dnl the SVR4 spec returns values in pages
1662                 dnl
1663                 AC_MSG_RESULT([page])
1664                 AC_CHECK_DECLS([sysconf])
1665                 AC_MSG_CHECKING([for system page size])
1666                 if test "$ac_cv_have_decl_sysconf" = "yes";
1667                 then
1668                         AC_MSG_RESULT([determined by sysconf(3)])
1669                         ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
1670                 else
1671                         AC_MSG_WARN([don't know. guessing 4096k])
1672                         ac_cv_swap_conv=256
1673                 fi
1674         else
1675                 dnl
1676                 dnl the BSD spec returns values in blocks
1677                 dnl
1678                 AC_MSG_RESULT([blocks (assuming 512b)])
1679                 ac_cv_swap_conv=2048
1680         fi
1681         AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1682                 [Conversion factor to MB])
1685 dnl end tests for the swapctl system calls
1689 if test "x$ac_cv_have_swap" != "x"
1690 then
1691         AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1692         EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
1694 if test "x$ac_cv_swap_command" != "x"
1695 then
1696         AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1697                 [Path to swap/swapinfo binary, with any args])
1698         AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1699                 [Format string for parsing swap output])
1700         AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1701                 [Conversion factor to MB])
1704 AC_ARG_WITH(proc-meminfo,
1705             ACX_HELP_STRING([--with-proc-meminfo=PATH],
1706                             [path to /proc/meminfo or equivalent]),
1707                             ac_cv_proc_meminfo=$withval)
1708 dnl dunno why this does not work below - use hack (kbd)
1709 dnl fine on linux, broken on solaris
1710 dnl if /bin/test -e "/proc/meminfo"
1711 AC_MSG_CHECKING([for /proc/meminfo])
1712 if test -n "$ac_cv_proc_meminfo"; then
1713         AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
1714 elif [cat /proc/meminfo > /dev/null 2>&1]; then
1715         AC_MSG_RESULT([found /proc/meminfo])
1716         ac_cv_proc_meminfo="/proc/meminfo"
1717 else
1718         AC_MSG_RESULT([no])
1721 if test -n "$ac_cv_proc_meminfo"; then
1722         AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1723         AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
1724         EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
1727 AC_PATH_PROG(PATH_TO_DIG,dig)
1728 AC_ARG_WITH(dig_command,
1729             ACX_HELP_STRING([--with-dig-command=PATH],
1730                             [Path to dig command]), PATH_TO_DIG=$withval)
1731 if test -n "$PATH_TO_DIG"; then
1732         EXTRAS="$EXTRAS check_dig\$(EXEEXT)"
1733         AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1736 AC_PATH_PROG(PATH_TO_APTGET,apt-get)
1737 AC_ARG_WITH(apt-get_command,
1738             ACX_HELP_STRING([--with-apt-get-command=PATH],
1739                             [Path to apt-get command]),
1740                             with_apt_get_command=$withval,
1741                             with_apt_get_command=$PATH_TO_APTGET)
1742 AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
1743 if test -n "$PATH_TO_APTGET" ; then
1744         EXTRAS="$EXTRAS check_apt\$(EXEEXT)"
1748 if test -f $srcdir/plugins/check_nt.c ; then
1749   EXTRAS="$EXTRAS check_nt\$(EXEEXT)"
1753 dnl used in check_dhcp
1754 AC_CHECK_HEADERS(sys/sockio.h)
1756 case $host in
1757         *bsd*)
1758                 AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
1759         ;;
1760         *linux*)
1761                 AC_DEFINE(__linux__,1,[linux specific code in check_dhcp.c])
1762         ;;
1763         *sun* | *solaris*)
1764                 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
1765         ;;
1766         *hpux*)
1767                 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
1768         ;;
1769 esac
1771 AC_SUBST(EXTRAS)
1772 AC_SUBST(EXTRAS_ROOT)
1773 AC_SUBST(EXTRA_NETOBJS)
1774 AC_SUBST(DEPLIBS)
1776 AM_GNU_GETTEXT([external], [need-ngettext])
1777 AM_GNU_GETTEXT_VERSION(0.15)
1779 dnl Check for Redhat spopen problem
1780 dnl Wierd problem where ECHILD is returned from a wait call in error
1781 dnl Only appears to affect nslookup and dig calls. Only affects redhat around
1782 dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
1783 dnl We patch plugins/popen.c
1784 dnl Need to add smp because uname different on those
1785 dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1786 AC_ARG_ENABLE(redhat-pthread-workaround,
1787         AC_HELP_STRING([--enable-redhat-pthread-workaround],
1788                 [force Redhat patch to be applied (default: test system)]),
1789         [ac_cv_enable_redhat_pthread_workaround=$enableval],
1790         [ac_cv_enable_redhat_pthread_workaround=test])
1791 if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
1792         if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
1793                 AC_MSG_NOTICE([See https://www.monitoring-plugins.org/doc/faq/configure-hangs.html if this next part takes a long time])
1794                 AC_MSG_CHECKING(for redhat spopen problem)
1795                 ( cd config_test && make && make test ) > /dev/null 2>&1
1796                 if test $? -eq 0 ; then
1797                         AC_MSG_RESULT(okay)
1798                 else
1799                         AC_MSG_RESULT(error)
1800                         AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
1801                 fi
1802         fi
1803 elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
1804         AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
1807 dnl Perl modules
1808 AC_ARG_ENABLE(perl-modules,
1809         AC_HELP_STRING([--enable-perl-modules],
1810                 [Enables installation of Monitoring::Plugin and its dependencies (default: no)]),
1811         [enable_perl_modules=$enableval],
1812         [enable_perl_modules=no])
1813 if test "$enable_perl_modules" = "yes" ; then
1814   AC_SUBST(PERLMODS_DIR,perlmods)
1817 # From Tap configure
1818 # Checks for libraries
1819 case "$host" in
1820         *-*-*freebsd4*)
1821                 LDFLAGS="$LDFLAGS -pthread"
1822                 HAVE_LIBPTHREAD=1
1823                 ;;
1824         *)
1825                 AC_CHECK_LIB(pthread, main)
1826                 ;;
1827 esac
1829 dnl External libraries - see ACKNOWLEDGEMENTS
1830 gl_INIT
1832 dnl Some helpful common compile errors checked here
1833 if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_cv_prog_ac_ct_AR" = 'false' \) ; then
1834         AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
1837 AC_OUTPUT(
1838   Makefile
1839   tap/Makefile
1840   lib/Makefile
1841   plugins/Makefile
1842   lib/tests/Makefile
1843   plugins-root/Makefile
1844   plugins-scripts/Makefile
1845   plugins-scripts/utils.pm
1846   plugins-scripts/utils.sh
1847   perlmods/Makefile
1848   test.pl
1849   pkg/solaris/pkginfo
1850   po/Makefile.in
1854 dnl the ones below that are commented out need to be cleaned up
1855 dnl in the configure code above to use with_foo instead of ac_cv_foo
1856 dnl if we want them to show up here.  it'd also make the code cleaner.
1857 dnl i'll get to that on another rainy day :) -sf
1858 ACX_FEATURE([with],[apt-get-command])
1859 dnl ACX_FEATURE([with],[dig-command])
1860 dnl ACX_FEATURE([with],[fping-command])
1861 dnl ACX_FEATURE([with],[mailq-command])
1862 dnl ACX_FEATURE([with],[nslookup-command])
1863 ACX_FEATURE([with],[ping6-command])
1864 ACX_FEATURE([with],[ping-command])
1865 dnl ACX_FEATURE([with],[qstat-command])
1866 dnl ACX_FEATURE([with],[rpcinfo-command])
1867 dnl ACX_FEATURE([with],[smbclient-command])
1868 dnl ACX_FEATURE([with],[snmpget-command])
1869 dnl ACX_FEATURE([with],[snmpgetnext-command])
1870 dnl ACX_FEATURE([with],[ssh-command])
1871 dnl ACX_FEATURE([with],[uptime-command])
1873 dnl ACX_FEATURE([with],[proc-meminfo])
1874 dnl ACX_FEATURE([with],[ps-command])
1875 dnl ACX_FEATURE([with],[ps-format])
1876 dnl ACX_FEATURE([with],[ps-cols])
1877 dnl ACX_FEATURE([with],[ps-varlist])
1879 ACX_FEATURE([with],[ipv6])
1880 ACX_FEATURE([with],[mysql])
1881 ACX_FEATURE([with],[openssl])
1882 ACX_FEATURE([with],[gnutls])
1883 ACX_FEATURE([enable],[extra-opts])
1884 ACX_FEATURE([with],[perl])
1885 ACX_FEATURE([enable],[perl-modules])
1886 ACX_FEATURE([with],[cgiurl])
1887 ACX_FEATURE([with],[trusted-path])
1888 ACX_FEATURE([enable],[libtap])