Prepare for the 2.1.2 release
[monitoring-plugins.git] / configure.ac
blob2839254d7b884b28f1298ba8baf4a5634e6e0ae6
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(monitoring-plugins,2.1.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(freeradius-client,rc_read_config)
277   if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then
278     EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
279     RADIUSLIBS="-lfreeradius-client"
280     AC_SUBST(RADIUSLIBS)
281   else
282     AC_CHECK_LIB(radiusclient-ng,rc_read_config)
283     if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
284       EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
285       RADIUSLIBS="-lradiusclient-ng"
286       AC_SUBST(RADIUSLIBS)
287     else
288       AC_CHECK_LIB(radiusclient,rc_read_config)
289       if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
290         EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
291         RADIUSLIBS="-lradiusclient"
292         AC_SUBST(RADIUSLIBS)
293       else
294         AC_MSG_WARN([Skipping radius plugin])
295         AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
296       fi
297     fi
298   fi
299   LIBS="$_SAVEDLIBS"
302 AC_ARG_WITH([ldap], [AS_HELP_STRING([--without-ldap], [Skips the LDAP plugin])])
304 dnl Check for LDAP libraries
305 AS_IF([test "x$with_ldap" != "xno"], [
306   _SAVEDLIBS="$LIBS"
307   AC_CHECK_LIB(ldap,main,,,-llber)
308   if test "$ac_cv_lib_ldap_main" = "yes"; then
309     LDAPLIBS="-lldap -llber"\
310     LDAPINCLUDE="-I/usr/include/ldap"
311     AC_SUBST(LDAPLIBS)
312     AC_SUBST(LDAPINCLUDE)
313     AC_CHECK_FUNCS(ldap_set_option)
314     EXTRAS="$EXTRAS check_ldap\$(EXEEXT)"
315         AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
316   else
317     AC_MSG_WARN([Skipping LDAP plugin])
318     AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
319   fi
320   LIBS="$_SAVEDLIBS"
323 dnl Check for headers used by check_ide_smart
324 case $host in
325   *linux*)
326     AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
327     if test "$FOUNDINCLUDE" = "yes" ; then
328         AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
329     fi
330     if test "$FOUNDINCLUDE" = "no" ; then
331         AC_MSG_WARN([Skipping check_ide_smart plugin.])
332         AC_MSG_WARN([check_ide_smart requires linux/hdreg.h and linux/types.h.])
333     fi
334   ;;
335   *netbsd*)
336     AC_CHECK_HEADER(dev/ata/atareg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
337     if test "$FOUNDINCLUDE" = "yes" ; then
338         AC_CHECK_HEADER(dev/ic/wdcreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
339     fi
340     if test "$FOUNDINCLUDE" = "no" ; then
341         AC_MSG_WARN([Skipping check_ide_smart plugin.])
342         AC_MSG_WARN([check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h])
343     fi
344   ;;
345   *)
346     AC_MSG_WARN([Skipping check_ide_smart plugin.])
347     AC_MSG_WARN([check_ide_smart works only on Linux and NetBSD])
348 esac
350 if test "$FOUNDINCLUDE" = "yes" ; then
351         EXTRAS="$EXTRAS check_ide_smart\$(EXEEXT)"
354 dnl Check for mysql libraries
355 np_mysqlclient
356 if test $with_mysql = "no" ; then
357   AC_MSG_WARN([Skipping mysql plugin])
358   AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
359 else
360   EXTRAS="$EXTRAS check_mysql\$(EXEEXT) check_mysql_query\$(EXEEXT)"
361   MYSQLINCLUDE="$np_mysql_include"
362   MYSQLLIBS="$np_mysql_libs"
363   MYSQLCFLAGS="$np_mysql_cflags"
364   AC_SUBST(MYSQLINCLUDE)
365   AC_SUBST(MYSQLLIBS)
366   AC_SUBST(MYSQLCFLAGS)
369 dnl Check for headers used by check_users
370 AC_CHECK_HEADERS(utmpx.h)
371 AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"])
373 AC_CHECK_HEADERS(wtsapi32.h, [], [], [#include <windows.h>])
374 AM_CONDITIONAL([HAVE_WTS32API], [test "$ac_cv_header_wtsapi32_h" = "yes"])
376 if test "$ac_cv_header_wtsapi32_h" = "yes"; then
377   WTSAPI32LIBS="-lwtsapi32"
378   AC_SUBST(WTSAPI32LIBS)
381 dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface
382 if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no"
383 then
384         AC_PATH_PROG(PATH_TO_WHO,who)
386         if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
387         then
388                 ac_cv_path_to_who="$PATH_TO_WHO -q"
389         else
390                 ac_cv_path_to_who="$PATH_TO_WHO"
391         fi
393         AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
394                 [path and arguments for invoking 'who'])
397 AC_ARG_WITH([ipv6],
398         [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
399         [], [with_ipv6=check])
401 dnl Check for AF_INET6 support - unistd.h required for Darwin
402 if test "$with_ipv6" != "no"; then
403         AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
404                 AC_TRY_COMPILE(
405                         [#ifdef HAVE_UNISTD_H
406                         #include <unistd.h>
407                         #endif
408                         #include <netinet/in.h>
409                         #include <sys/socket.h>],
410                         [struct sockaddr_in6 sin6;
411                         void *p;
413                         sin6.sin6_family = AF_INET6;
414                         sin6.sin6_port = 587;
415                         p = &sin6.sin6_addr;],
416                         [np_cv_sys_ipv6=yes],
417                         [np_cv_sys_ipv6=no])
418                 ])
419         if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
420                 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
421         fi
422         if test "$np_cv_sys_ipv6" = "yes"; then
423                 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
424         fi
425         with_ipv6="$np_cv_sys_ipv6"
429 dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
430 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
431 if test "$FOUNDINCLUDE" = "no"; then
432   _SAVEDCPPFLAGS="$CPPFLAGS"
433   CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
434   unset ac_cv_header_krb5_h
435   AC_CHECK_HEADERS(krb5.h,
436                    KRB5INCLUDE="-I/usr/kerberos/include"
437                    FOUNDINCLUDE=yes,
438                    FOUNDINCLUDE=no)
440 AC_SUBST(KRBINCLUDE)
441 if test "$FOUNDINCLUDE" = "no"; then
442   CPPFLAGS="$_SAVEDCPPFLAGS"
445 dnl *** The following block comes from wget configure.ac ***
446 dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto
447 dnl shared library doesn't record its dependency on libdl, so we
448 dnl need to check for it ourselves so we won't fail to link due to a
449 dnl lack of -ldl.  Most OSes use dlopen(), but HP-UX uses
450 dnl shl_load().
451 AC_CHECK_LIB(dl,dlopen)
452 AC_CHECK_LIB(dl,shl_load)
454 dnl openssl detection/configuration
455 if ! test x"$with_openssl" = x"no"; then
456         dnl Check for OpenSSL location if it wasn't already specified
457         if ! test -d "$with_openssl"; then
458                 for d in $OPENSSL_DIRS; do
459                         if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
460                                 with_openssl=$d
461                         fi
462                 done
463         fi
465         _SAVEDCPPFLAGS="$CPPFLAGS"
466         _SAVEDLDFLAGS="$LDFLAGS"
467         dnl Check for OpenSSL header files
468         unset FOUNDINCLUDE
469         if test x"$with_openssl" != x"/usr" ; then
470                 CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
471                 LDFLAGS="$LDFLAGS -L$with_openssl/lib"
472         fi
474         dnl check for openssl in $dir/include/openssl
475         AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
476                          SSLINCLUDE="-I$with_openssl/include"
477                          FOUNDINCLUDE=yes,
478                          FOUNDINCLUDE=no)
479         dnl else check to see if $dir/include has it
480         if test "$FOUNDINCLUDE" = "no"; then
481                 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
482                                  SSLINCLUDE="-I$with_openssl/include"
483                                  FOUNDINCLUDE=yes,
484                                  FOUNDINCLUDE=no)
485         fi
486         AC_SUBST(SSLINCLUDE)
487         dnl if we didn't find it, reset CPPFLAGS
488         if test "$FOUNDINCLUDE" = "no"; then
489                 CPPFLAGS="$_SAVEDCPPFLAGS"
490                 LDFLAGS="$_SAVEDLDFLAGS"
491         fi
493         dnl Check for crypto lib
494         _SAVEDLIBS="$LIBS"
495         LIBS="-L${with_openssl}/lib"
496         AC_CHECK_LIB(crypto,CRYPTO_lock)
497         if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
498                 dnl Check for SSL lib
499                 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
500         fi
501         LIBS="$_SAVEDLIBS"
503         dnl test headers and libs to decide whether check_http should use SSL
504         if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
505                 if test "$ac_cv_lib_ssl_main" = "yes"; then
506                         if test "$FOUNDINCLUDE" = "yes"; then
507                                 FOUNDOPENSSL="yes"
508                         fi
509                 fi
510         fi
514 dnl check for gnutls if openssl isn't found (or is disabled)
515 if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
516         if test ! "$with_gnutls" = ""; then
517                 CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
518         fi
519         AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
520         if test "$FOUNDGNUTLS" = "yes"; then
521                 AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
522         fi
524 dnl end check for gnutls
526 if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
527         check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
528         AC_SUBST(check_tcp_ssl)
529         AC_SUBST(SSLLIBS)
530         AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
531         if test "$FOUNDOPENSSL" = "yes"; then
532                 AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
533                 with_openssl="yes"
534                 with_gnutls="no"
535         else
536                 AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
537                 with_gnutls="yes"
538                 with_openssl="no"
539         fi
540 else
541         dnl else deliberately disabled or no ssl support available
542         AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
543         with_openssl="no"
544         with_gnutls="no"
548 dnl Checks for header files.
551 AC_HEADER_TIME
552 AC_HEADER_SYS_WAIT
553 AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
554 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
556 dnl Checks for typedefs, structures, and compiler characteristics.
557 AC_C_CONST
558 AC_STRUCT_TM
559 AC_TYPE_PID_T
560 AC_TYPE_SIZE_T
561 AC_TYPE_SIGNAL
563 AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
564 AC_TRY_LINK([#include <stdarg.h>
565 va_list ap1,ap2;], [va_copy(ap1,ap2);],
566 ac_cv_HAVE_VA_COPY=yes,
567 ac_cv_HAVE_VA_COPY=no)])
568 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
569     AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
570 else
571     AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
572     AC_TRY_LINK([#include <stdarg.h>
573     va_list ap1,ap2;], [__va_copy(ap1,ap2);],
574     ac_cv_HAVE___VA_COPY=yes,
575     ac_cv_HAVE___VA_COPY=no)])
576     if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
577         AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
578     fi
581 AC_TRY_COMPILE([#include <sys/time.h>],
582                [struct timeval *tv;
583                 struct timezone *tz;],
584                AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
585                AC_TRY_COMPILE([#include <sys/time.h>],
586                               [struct timeval *tv;
587                                struct timezone *tz;
588                                gettimeofday(tv, tz);],
589                               AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
590                               AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
592 dnl Checks for library functions.
593 AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
594 AC_CHECK_FUNCS(poll)
596 AC_MSG_CHECKING(return type of socket size)
597 AC_TRY_COMPILE([#include <stdlib.h>
598                 #include <sys/types.h>
599                 #include <sys/socket.h>],
600                [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
601                ac_cv_socket_size_type=["size_t"]
602                 AC_MSG_RESULT(size_t),
603                ac_cv_socket_size_type=["int"]
604                 AC_MSG_RESULT(int))
606 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
607         [Define type of socket size])
610 dnl #### Process table test
612 AC_PATH_PROG(PATH_TO_PS,ps)
614 AC_MSG_CHECKING(for ps syntax)
615 AC_ARG_WITH(ps_command,
616             ACX_HELP_STRING([--with-ps-command=PATH],
617                             [Verbatim command to execute for ps]),
618             PS_COMMAND=$withval)
619 AC_ARG_WITH(ps_format,
620             ACX_HELP_STRING([--with-ps-format=FORMAT],
621                             [Format string for scanning ps output]),
622             PS_FORMAT=$withval)
623 AC_ARG_WITH(ps_cols,
624             ACX_HELP_STRING([--with-ps-cols=NUM],
625                             [Number of columns in ps command]),
626             PS_COLS=$withval)
627 AC_ARG_WITH(ps_varlist,
628             ACX_HELP_STRING([--with-ps-varlist=LIST],
629                             [Variable list for sscanf of 'ps' output]),
630             PS_VARLIST=$withval)
632 if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
633         ac_cv_ps_command="$PS_COMMAND"
634         ac_cv_ps_format="$PS_FORMAT"
635         ac_cv_ps_varlist="$PS_VARLIST"
636         ac_cv_ps_cols="$PS_COLS"
637         AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
639 dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
640 elif test "$ac_cv_uname_s" = "SunOS"; then
641         #
642         # this is a very, very ugly hack, to hardcode the location for plugins
643         #
644         if test "$libexecdir" = '${exec_prefix}/libexec'; then
645                 if test "$exec_prefix" = "NONE"; then
646                         if test "$prefix" = "NONE"; then
647                                 pst3="$ac_default_prefix/libexec/pst3"
648                         else
649                                 pst3="$prefix/libexec/pst3"
650                         fi
651                 else
652                         pst3="$exec_prefix/libexec/pst3"
653                 fi
654         else
655                 pst3="$libexecdir/pst3"
656         fi
657         ac_cv_ps_command="$pst3"
658         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
659         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
660         ac_cv_ps_cols=9
661         AC_MSG_RESULT([using monitoring-plugins internal ps command (pst3) for solaris])
662         if test `isainfo -b` = 64 ; then
663                 pst3_use_64bit=1
664                 AC_MSG_NOTICE([using 64bit pst3])
665         else
666                 AC_MSG_NOTICE([using 32bit pst3])
667         fi
668         EXTRAS_ROOT="$EXTRAS_ROOT pst3\$(EXEEXT)"
670         if test "$pst3_use_64bit" = 1; then
671                 dnl Test if we can actually compile code in 64bit
672                 old_cflags=$CFLAGS
673                 CFLAGS="$CFLAGS -m64"
674                 pst3_64bit_working=0
675                 AC_RUN_IFELSE(
676                         [AC_LANG_PROGRAM([], [
677 return sizeof(void*) == 8 ? 0 : 1;
678                         ])
679                 ],[
680                         PST3CFLAGS="-m64"
681                         AC_SUBST(PST3CFLAGS)
682                         pst3_64bit_working=1
683                         AC_MSG_NOTICE([using -m64 for 64bit code])
684                 ],[
685                         pst3_64bit_working=0
686                         AC_MSG_NOTICE([compiler do not like -m64])
687                 ])
688                 CFLAGS=$old_cflags
689                 if test "$pst3_64bit_working" = 0; then
690                         old_cflags=$CFLAGS
691                         CFLAGS="$CFLAGS -xarch=v9"
692                         AC_RUN_IFELSE(
693                                 [AC_LANG_PROGRAM([], [
694 return sizeof(void*) == 8 ? 0 : 1;
695                                 ])
696                         ],[
697                                 PST3CFLAGS="-xarch=v9"
698                                 AC_SUBST(PST3CFLAGS)
699                                 pst3_64bit_working=1
700                                 AC_MSG_NOTICE([using -xarch=v9 for 64bit code])
701                         ],[
702                                 pst3_64bit_working=0
703                                 AC_MSG_NOTICE([compiler do not like -xarch=v9])
704                         ])
705                         CFLAGS=$old_cflags
706                 fi
707                 if test "$pst3_64bit_working" = 0; then
708                         old_cflags=$CFLAGS
709                         CFLAGS="$CFLAGS -xarch=amd64"
710                         AC_RUN_IFELSE(
711                                 [AC_LANG_PROGRAM([], [
712 return sizeof(void*) == 8 ? 0 : 1;
713                                 ])
714                         ],[
715                                 PST3CFLAGS="-xarch=amd64"
716                                 AC_SUBST(PST3CFLAGS)
717                                 pst3_64bit_working=1
718                                 AC_MSG_NOTICE([using -xarch=amd64 for 64bit code])
719                         ],[
720                                 pst3_64bit_working=0
721                                 AC_MSG_NOTICE([compiler do not like -xarch=amd64])
722                         ])
723                         CFLAGS=$old_cflags
724                 fi
725                 if test "$pst3_64bit_working" = 0; then
726                         AC_MSG_ERROR([I don't know how to build a 64-bit object!])
727                 fi
728         fi
730 dnl Removing this for the moment - Ton
731 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
732 dnl Limitation that command name is not available
733 dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
734 dnl     egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
735 dnl then
736 dnl     ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
737 dnl     ac_cv_ps_command="/usr/ucb/ps -alxwwn"
738 dnl     ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
739 dnl     ac_cv_ps_cols=8
740 dnl     AC_MSG_RESULT([$ac_cv_ps_command])
742 dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
743 dnl so test for this first...
744 elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
745         egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
746 then
747         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
748         ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
749         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
750         ac_cv_ps_cols=9
751         AC_MSG_RESULT([$ac_cv_ps_command])
753 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
754 dnl Should also work for FreeBSD 5.2.1 and 5.3
755 dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
756 elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
757         egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
758 then
759         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
760         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
761         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
762         ac_cv_ps_cols=9
763         AC_MSG_RESULT([$ac_cv_ps_command])
765 dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
766 dnl Limitation: Only first 16 chars returned for ucomm field
767 dnl Must come before ps -weo
768 elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
769         egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
770 then
771         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
772         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
773         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
774         ac_cv_ps_cols=9
775         AC_MSG_RESULT([$ac_cv_ps_command])
777 dnl  STAT UCOMM              VSZ   RSS USER       UID  PPID COMMAND
778 elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
779         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
780 then
781         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
782         ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
783         ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
784         ac_cv_ps_cols=10
785         AC_MSG_RESULT([$ac_cv_ps_command])
787 dnl FreeBSD
788 elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
789         egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
790 then
791         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
792         ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
793         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
794         ac_cv_ps_cols=9
795         AC_MSG_RESULT([$ac_cv_ps_command])
797 dnl BSD-like mode in RH 6.1
798 elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
799         egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
800 then
801         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
802         ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
803         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
804         ac_cv_ps_cols=9
805         AC_MSG_RESULT([$ac_cv_ps_command])
807 dnl SunOS 4.1.3:
808 dnl  F  UID  PID  PPID  CP  PRI  NI  SZ  RSS  WCHAN  STAT  TT  TIME  COMMAND
809 dnl Need the head -1 otherwise test will work because arguments are found
810 elif ps -laxnwww 2>/dev/null | head -1 | \
811         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
812 then
813         ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
814         ac_cv_ps_command="$PATH_TO_PS -laxnwww"
815         ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
816         ac_cv_ps_cols=9
817         AC_MSG_RESULT([$ac_cv_ps_command])
819 dnl Debian Linux / procps v1.2.9:
820 dnl  FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
821 dnl    100     0     1     0   0   0    776    76  c0131c8c   S  ffff  0:11 init [2]
823 elif ps laxnwww 2>/dev/null | \
824         egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
825 then
826         ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
827         ac_cv_ps_command="$PATH_TO_PS laxnwww"
828         ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
829         ac_cv_ps_cols=9
830         AC_MSG_RESULT([$ac_cv_ps_command])
832 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
833 elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
834         egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
835 then
836         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
837         ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
838         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
839         ac_cv_ps_cols=9
840         AC_MSG_RESULT([$ac_cv_ps_command])
842 dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
843 dnl Has /usr/bin/ps and /sbin/ps - force sbin version
844 dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
845 dnl of 1500). Will need big changes to check_procs to support
846 elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
847         egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
848 then
849         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
850         ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
851         ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
852         ac_cv_ps_cols=8
853         AC_MSG_RESULT([$ac_cv_ps_command])
855 elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
856         egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
857 then
858         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
859         ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
860         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
861         ac_cv_ps_cols=9
862         AC_MSG_RESULT([$ac_cv_ps_command])
864 dnl AIX 4.3.3 and 5.1 do not have an rss field
865 elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
866         egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
867 then
868         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
869         ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
870         ac_cv_ps_format="%s %d %d %d %d %f %s %n"
871         ac_cv_ps_cols=8
872         AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
874 dnl Solaris 2.6
875 elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
876         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
877 then
878         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
879         ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
880         # There must be no space between the %s and %n due to a wierd problem in sscanf where
881         # it will return %n as longer than the line length
882         ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
883         ac_cv_ps_cols=9
884         AC_MSG_RESULT([$ac_cv_ps_command])
886 elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
887         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
888 then
889         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
890         ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
891         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
892         ac_cv_ps_cols=9
893         AC_MSG_RESULT([$ac_cv_ps_command])
895 elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
896         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
897 then
898         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
899         ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
900         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
901         ac_cv_ps_cols=9
902         AC_MSG_RESULT([$ac_cv_ps_command])
904 dnl wonder who takes state instead of stat
905 elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
906         egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
907 then
908         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
909         ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
910         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
911         ac_cv_ps_cols=8
912         AC_MSG_RESULT([$ac_cv_ps_command])
914 dnl IRIX 53
915 elif ps -el 2>/dev/null | \
916         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
917 then
918         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
919         ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
920         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
921         ac_cv_ps_cols=8
922         AC_MSG_RESULT([$ac_cv_ps_command])
924 dnl IRIX 63
925 elif ps -el 2>/dev/null | \
926         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
927 then
928         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
929         ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
930         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
931         ac_cv_ps_cols=6
932         AC_MSG_RESULT([$ac_cv_ps_command])
934 dnl AIX 4.1:
935 dnl     F S      UID   PID  PPID   C PRI NI ADDR  SZ  RSS   WCHAN    TTY  TIME CMD
936 dnl    303 A        0     0     0 120  16 -- 1c07  20   24              -  0:45 swapper
937 elif ps -el 2>/dev/null | \
938         egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
939 then
940         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
941         ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
942         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
943         ac_cv_ps_cols=6
944         AC_MSG_RESULT([$ac_cv_ps_command])
946 dnl AIX?
947 elif ps glaxen 2>/dev/null | \
948         egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
949 then
950         ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
951         ac_cv_ps_command="$PATH_TO_PS glaxen"
952         ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
953         ac_cv_ps_cols=8
954         AC_MSG_RESULT([$ac_cv_ps_command])
956 dnl MacOSX / Darwin
957 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
958 dnl Some truncation will happen in UCOMM column
959 dnl STAT      VSZ    RSS   UID  PPID %CPU UCOMM            COMMAND
960 dnl Ss      52756  22496   501     1   6.9 Window Manager   /System/Library/CoreServices/WindowServer -daemon
961 elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
962         egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
963 then
964         ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
965         ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
966         ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
967         ac_cv_ps_cols=8
968         AC_MSG_RESULT([$ac_cv_ps_command])
970 dnl UnixWare
971 elif ps -Al 2>/dev/null | \
972         egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
973 then
974         ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
975         ac_cv_ps_command="$PATH_TO_PS -Al"
976         ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
977         ac_cv_ps_cols=8
978         AC_MSG_RESULT([$ac_cv_ps_command])
980 else
981         AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
984 if test -n "$ac_cv_ps_varlist" ; then
985         AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
986                 [Variable list for sscanf of 'ps' output])
987         AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
988                 [Verbatim command to execute for ps in check_procs])
989         AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
990                 [Format string for scanning ps output in check_procs])
991         AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
992                 [Number of columns in ps command])
993         EXTRAS="$EXTRAS check_procs check_nagios\$(EXEEXT)"
994         if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
995                 AC_DEFINE(PS_USES_PROCETIME,"yes",
996                           [Whether the ps utility uses the "procetime" field])
997         fi
1000 AC_PATH_PROG(PATH_TO_PING,ping)
1001 AC_PATH_PROG(PATH_TO_PING6,ping6)
1003 AC_ARG_WITH(ping_command,
1004         ACX_HELP_STRING([--with-ping-command=SYNTAX],
1005                 [sets syntax for ICMP ping]),
1006         with_ping_command=$withval,)
1008 AC_MSG_CHECKING(for ICMP ping syntax)
1009 ac_cv_ping_packets_first=no
1010 ac_cv_ping_has_timeout=no
1011 if test -n "$with_ping_command"
1012 then
1013         AC_MSG_RESULT([(command-line) $with_ping_command])
1014         if echo "$with_ping_command" | grep '%d.*%d.*%s' >/dev/null
1015         then
1016                 ac_cv_ping_packets_first=yes
1017                 ac_cv_ping_has_timeout=yes
1018         elif echo "$with_ping_command" | grep '%d.*%s.*%d' >/dev/null || \
1019              echo "$with_ping_command" | grep '%s.*%d.*%d' >/dev/null
1020         then
1021                 ac_cv_ping_has_timeout=yes
1022         elif echo "$with_ping_command" | grep '%d.*%s' >/dev/null
1023         then
1024                 ac_cv_ping_packets_first=yes
1025         fi
1027 elif [[ "z$ac_cv_uname_o" = "zCygwin" ]]
1028 then
1029         with_ping_command="$PATH_TO_PING -n %d -w %d000 %s"
1030         ac_cv_ping_packets_first=yes
1031         ac_cv_ping_has_timeout=yes
1032         AC_MSG_RESULT([$with_ping_command])
1034 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1035         $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
1036         egrep -i "^round-trip|^rtt" >/dev/null
1037 then
1038         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
1039         ac_cv_ping_packets_first=yes
1040         AC_MSG_RESULT([$with_ping_command])
1042 elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
1043         egrep -i "^round-trip|^rtt" >/dev/null
1044 then
1045         with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
1046         ac_cv_ping_packets_first=yes
1047         ac_cv_ping_has_timeout=yes
1048         AC_MSG_RESULT([$with_ping_command])
1050 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
1051         egrep -i "^round-trip|^rtt" >/dev/null
1052 then
1053         with_ping_command="$PATH_TO_PING -n -U -c %d %s"
1054         ac_cv_ping_packets_first=yes
1055         AC_MSG_RESULT([$with_ping_command])
1057 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
1058         egrep -i "^round-trip|^rtt" >/dev/null
1059 then
1060         with_ping_command="$PATH_TO_PING -n -c %d %s"
1061         ac_cv_ping_packets_first=yes
1062         AC_MSG_RESULT([$with_ping_command])
1064 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
1065         egrep -i "^round-trip|^rtt" >/dev/null
1066 then
1067         with_ping_command="$PATH_TO_PING -n %s -c %d"
1068         AC_MSG_RESULT([$with_ping_command])
1070 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
1071         egrep -i "^round-trip|^rtt" >/dev/null
1072 then
1073         with_ping_command="$PATH_TO_PING %s -n %d"
1074         AC_MSG_RESULT([$with_ping_command])
1076 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
1077         egrep -i "^round-trip|^rtt" >/dev/null
1078 then
1079         with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
1080         AC_MSG_RESULT([$with_ping_command])
1082 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
1083         egrep -i "^round-trip|^rtt" >/dev/null
1084 then
1085         with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
1086         AC_MSG_RESULT([$with_ping_command])
1088 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
1089         egrep -i "^round-trip|^rtt" >/dev/null
1090 then
1091         with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
1092         ac_cv_ping_packets_first=yes
1093         AC_MSG_RESULT([$with_ping_command])
1095 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
1096         egrep -i "^round-trip|^rtt" >/dev/null
1097 then
1098         with_ping_command="$PATH_TO_PING -n -c %d %s"
1099         ac_cv_ping_packets_first=yes
1100         AC_MSG_RESULT([$with_ping_command])
1102 else
1103         AC_MSG_WARN([unable to find usable ping syntax])
1106 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
1107         [path and args for ICMP ping command])
1109 if test "x$ac_cv_ping_packets_first" != "xno"
1110 then
1111         AC_DEFINE(PING_PACKETS_FIRST,1,
1112                 [Define if packet count must precede host])
1115 if test "x$ac_cv_ping_has_timeout" != "xno"
1116 then
1117         AC_DEFINE(PING_HAS_TIMEOUT,1,
1118                 [Define if ping has its own timeout option that should be set])
1121 AC_ARG_WITH(ping6_command,
1122         ACX_HELP_STRING([--with-ping6-command=SYNTAX],
1123                 [sets syntax for ICMPv6 ping]),
1124         with_ping6_command=$withval,)
1126 if test x"$with_ipv6" != xno ; then
1127 AC_MSG_CHECKING(for ICMPv6 ping syntax)
1128 ac_cv_ping6_packets_first=no
1129 if test -n "$with_ping6_command"
1130 then
1131         AC_MSG_RESULT([(command-line) $with_ping6_command])
1132         if echo "$with_ping6_command" | grep '%d.*%d.*%s' >/dev/null
1133         then
1134                 ac_cv_ping6_packets_first=yes
1135         elif echo "$with_ping6_command" | grep '%d.*%s.*%d' >/dev/null || \
1136              echo "$with_ping6_command" | grep '%s.*%d.*%d' >/dev/null
1137         then
1138                 # Just keep same logic as ping (IPv4) if we ever need ac_cv_ping6_has_timeout
1139                 true
1140         elif echo "$with_ping6_command" | grep '%d.*%s' >/dev/null
1141         then
1142                 ac_cv_ping6_packets_first=yes
1143         fi
1144 elif [[ "z$ac_cv_uname_o" = "zCygwin" -a "x$PATH_TO_PING" != "x" ]]; then
1145         with_ping6_command="$PATH_TO_PING -6 -n %d -w %d000 %s"
1146         ac_cv_ping6_packets_first=yes
1147         ac_cv_ping_has_timeout=yes
1148         AC_MSG_RESULT([$with_ping6_command])
1149 elif test "x$PATH_TO_PING6" != "x"; then
1150         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1151                 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1152                 egrep -i "^round-trip|^rtt" >/dev/null
1153         then
1154                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
1155                 ac_cv_ping6_packets_first=yes
1156                 AC_MSG_RESULT([$with_ping6_command])
1158         elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
1159                 egrep -i "^round-trip|^rtt" >/dev/null
1160         then
1161                 with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
1162                 ac_cv_ping6_packets_first=yes
1163                 ac_cv_ping_has_timeout=yes
1164                 AC_MSG_RESULT([$with_ping6_command])
1166         elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
1167                 egrep -i "^round-trip|^rtt" >/dev/null
1168         then
1169                 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
1170                 ac_cv_ping6_packets_first=yes
1171                 AC_MSG_RESULT([$with_ping6_command])
1173         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1174                 egrep -i "^round-trip|^rtt" >/dev/null
1175         then
1176                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1177                 ac_cv_ping6_packets_first=yes
1178                 AC_MSG_RESULT([$with_ping6_command])
1180         elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
1181                 egrep -i "^round-trip|^rtt" >/dev/null
1182         then
1183                 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1184                 AC_MSG_RESULT([$with_ping6_command])
1186         elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1187                 egrep -i "^round-trip|^rtt" >/dev/null
1188         then
1189                 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1190                 AC_MSG_RESULT([$with_ping6_command])
1192         elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1193                 egrep -i "^round-trip|^rtt" >/dev/null
1194         then
1195                 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1196                 AC_MSG_RESULT([$with_ping6_command])
1198         elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1199                 egrep -i "^round-trip|^rtt" >/dev/null
1200         then
1201                 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1202                 AC_MSG_RESULT([$with_ping6_command])
1204         elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1205                 egrep -i "^round-trip|^rtt" >/dev/null
1206         then
1207                 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1208                 ac_cv_ping6_packets_first=yes
1209                 AC_MSG_RESULT([$with_ping_command])
1211         elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1212                 egrep -i "^round-trip|^rtt" >/dev/null
1213         then
1214                 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1215                 ac_cv_ping6_packets_first=yes
1216                 AC_MSG_RESULT([$with_ping6_command])
1218         fi
1220 elif test "x$PATH_TO_PING" != "x"; then
1221         if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1222                 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1223                 egrep -i "^round-trip|^rtt" >/dev/null
1224         then
1225                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1226                 ac_cv_ping6_packets_first=yes
1227                 AC_MSG_RESULT([$with_ping6_command])
1229         elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1230                 egrep -i "^round-trip|^rtt" >/dev/null
1231         then
1232                 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1233                 ac_cv_ping6_packets_first=yes
1234                 AC_MSG_RESULT([$with_ping6_command])
1236         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1237                 egrep -i "^round-trip|^rtt" >/dev/null
1238         then
1239                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1240                 ac_cv_ping6_packets_first=yes
1241                 AC_MSG_RESULT([$with_ping6_command])
1243         elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1244                 egrep -i "^round-trip|^rtt" >/dev/null
1245         then
1246                 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1247                 AC_MSG_RESULT([$with_ping6_command])
1249         elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1250                 egrep -i "^round-trip|^rtt" >/dev/null
1251         then
1252                 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1253                 AC_MSG_RESULT([$with_ping6_command])
1255         elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1256                 egrep -i "^round-trip|^rtt" >/dev/null
1257         then
1258                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1259                 AC_MSG_RESULT([$with_ping6_command])
1261         elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1262                 egrep -i "^round-trip|^rtt" >/dev/null
1263         then
1264                 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1265                 AC_MSG_RESULT([$with_ping6_command])
1267         elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1268                 egrep -i "^round-trip|^rtt" >/dev/null
1269         then
1270                 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1271                 ac_cv_ping6_packets_first=yes
1272                 AC_MSG_RESULT([$with_ping_command])
1274         elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1275                 egrep -i "^round-trip|^rtt" >/dev/null
1276         then
1277                 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1278                 ac_cv_ping6_packets_first=yes
1279                 AC_MSG_RESULT([$with_ping6_command])
1281         fi
1285 if test "x$with_ping6_command" != "x"; then
1286         AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1287                 [path and args for ICMPv6 ping command])
1288 else
1289         AC_MSG_RESULT([none])
1292 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1293         AC_DEFINE(PING6_PACKETS_FIRST,1,
1294                 [Define if packet count must precede host])
1299 AC_ARG_WITH(nslookup_command,
1300             ACX_HELP_STRING([--with-nslookup-command=PATH],
1301                             [sets path to nslookup executable]),
1302             ac_cv_nslookup_command=$withval)
1303 if test -n "$ac_cv_nslookup_command"; then
1304         AC_MSG_NOTICE([Using specific nslookup at $ac_cv_nslookup_command])
1305 else
1306         AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1307         if test -n "$PATH_TO_NSLOOKUP"
1308         then
1309                 AC_MSG_CHECKING(for nslookup syntax)
1310                 if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1311                 then
1312                         ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1313                         AC_MSG_RESULT([$ac_cv_nslookup_command])
1315                 else
1316                         ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1317                         AC_MSG_RESULT([$ac_cv_nslookup_command])
1319                 fi
1320         else
1321                 AC_MSG_WARN([nslookup command not found])
1322         fi
1325 if test -n "$ac_cv_nslookup_command"; then
1326         EXTRAS="$EXTRAS check_dns\$(EXEEXT)"
1327         AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
1330 AC_MSG_CHECKING([for number of online cpus])
1331 AC_TRY_COMPILE([#include <unistd.h>],
1332         [sysconf(_SC_NPROCESSORS_ONLN) > 0;],
1333         AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus])
1334         AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]),
1335         AC_MSG_RESULT([cannot calculate])
1336         )
1338 AC_MSG_CHECKING([for number of available cpus])
1339 AC_TRY_COMPILE([#include <unistd.h>],
1340         [sysconf(_SC_NPROCESSORS_CONF) > 0;],
1341         AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus])
1342         AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1343         AC_MSG_RESULT([cannot calculate])
1344         )
1346 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1347 AC_ARG_WITH(uptime_command,
1348             ACX_HELP_STRING([--with-uptime-command=PATH],
1349                             [sets path to uptime]), PATH_TO_UPTIME=$withval)
1350 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1352 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1353 AC_ARG_WITH(rpcinfo_command,
1354             ACX_HELP_STRING([--with-rpcinfo-command=PATH],
1355                             [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
1356 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1358 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1359 if test -x "$PATH_TO_LMSTAT"
1360 then
1361         AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1362 else
1363         AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1366 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1367 AC_ARG_WITH(smbclient_command,
1368             ACX_HELP_STRING([--with-smbclient-command=PATH],
1369                             [sets path to smbclient]),
1370             PATH_TO_SMBCLIENT=$withval)
1371 if test -n "$PATH_TO_SMBCLIENT"
1372 then
1373         AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1374 else
1375         AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1378 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1379 AC_ARG_WITH(snmpget_command,
1380             ACX_HELP_STRING([--with-snmpget-command=PATH],
1381                             [Path to snmpget command]),
1382             PATH_TO_SNMPGET=$withval)
1383 if test -n "$PATH_TO_SNMPGET"
1384 then
1385         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1386         EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
1387 else
1388         AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1391 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1392 AC_ARG_WITH(snmpgetnext_command,
1393             ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
1394                             [Path to snmpgetnext command]),
1395             PATH_TO_SNMPGETNEXT=$withval)
1396 if test -n "$PATH_TO_SNMPGETNEXT"
1397 then
1398         AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1401 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )
1402 then
1403         AC_MSG_CHECKING(for Net::SNMP perl module)
1404         AC_MSG_RESULT([found])
1405 else
1406         AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1409 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1410 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1411 AC_ARG_WITH(qstat_command,
1412             ACX_HELP_STRING([--with-qstat-command=PATH],
1413                             [Path to qstat command]), PATH_TO_QSTAT=$withval)
1415 if test -x "$PATH_TO_QUAKESTAT"
1416 then
1417         ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1418         EXTRAS="$EXTRAS check_game\$(EXEEXT)"
1420 elif test -n "$PATH_TO_QSTAT"
1421 then
1422         ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1423         EXTRAS="$EXTRAS check_game\$(EXEEXT)"
1424 else
1425         AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1428 if test $ac_cv_path_to_qstat
1429 then
1430         AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1431                 [path to qstat/quakestat])
1434 AC_PATH_PROG(PATH_TO_FPING,fping)
1435 AC_PATH_PROG(PATH_TO_FPING6,fping6)
1437 AC_ARG_WITH(fping_command,
1438             ACX_HELP_STRING([--with-fping-command=PATH],
1439                             [Path to fping command]), PATH_TO_FPING=$withval)
1440 AC_ARG_WITH(fping6_command,
1441             ACX_HELP_STRING([--with-fping6-command=PATH],
1442                             [Path to fping6 command]), PATH_TO_FPING6=$withval)
1444 if test -n "$PATH_TO_FPING"
1445 then
1446         AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1447         EXTRAS="$EXTRAS check_fping\$(EXEEXT)"
1448         if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then
1449                 AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6])
1450         fi
1451 else
1452         AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1455 AC_PATH_PROG(PATH_TO_SSH,ssh)
1456 AC_ARG_WITH(ssh_command,
1457             ACX_HELP_STRING([--with-ssh-command=PATH],
1458                             [sets path for ssh]), PATH_TO_SSH=$withval)
1459 if test -n "$PATH_TO_SSH"
1460 then
1461         AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1462         EXTRAS="$EXTRAS check_by_ssh\$(EXEEXT)"
1463 else
1464         AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1468 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1469 AC_ARG_WITH(mailq_command,
1470             ACX_HELP_STRING([--with-mailq-command=PATH],
1471                             [sets path to mailq]), PATH_TO_MAILQ=$withval)
1472 if test -n "$PATH_TO_MAILQ"
1473 then
1474         AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1475 else
1476         AC_MSG_WARN([Could not find mailq or eqivalent])
1479 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1480 AC_ARG_WITH(qmail_qstat_command,
1481             ACX_HELP_STRING([--with-qmail-qstat-command=PATH],
1482                             [sets path to qmail-qstat]), PATH_TO_QMAIL_QSTAT=$withval)
1483 if test -n "$PATH_TO_QMAIL_QSTAT"
1484 then
1485         AC_DEFINE_UNQUOTED(PATH_TO_QMAIL_QSTAT,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1486 else
1487         AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1490 dnl SWAP info required is amount allocated/available and amount free
1491 dnl The plugin works through all the swap devices and adds up the total swap
1492 dnl available.
1493 AC_PATH_PROG(PATH_TO_SWAP,swap)
1494 if (test -n "$PATH_TO_SWAP")
1495 then
1496 AC_MSG_CHECKING([for $PATH_TO_SWAP format])
1497 if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1498 then
1499         ac_cv_have_swap=yes
1500         ac_cv_swap_command="$PATH_TO_SWAP -l"
1501         if [$PATH_TO_SWAP -l 2>/dev/null | \
1502                 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1503                 >/dev/null]
1504         then
1505                 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
1506                 ac_cv_swap_conv=2048
1507                 AC_MSG_RESULT([using IRIX format swap])
1509         elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1510         then
1511                 ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
1512                 ac_cv_swap_conv=2048
1513                 AC_MSG_RESULT([using Unixware format swap])
1514         else
1515                 dnl if we don't know what format swap's output is
1516                 dnl we might as well pretend we didn't see it
1517                 ac_cv_have_swap=""
1518                 ac_cv_swap_command=""
1519         fi
1521 dnl end if for PATH_TO_SWAP
1524 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1525 if (test -n "$PATH_TO_SWAPINFO")
1526 then
1527 AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
1528 if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1529 then
1530         ac_cv_have_swap=yes
1531         ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1533         if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1534         then
1535                 ac_cv_swap_format=["%*s %f %*d %f"]
1536                 ac_cv_swap_conv=1024
1537                 AC_MSG_RESULT([using FreeBSD format swapinfo])
1538         fi
1540 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1541 then
1542         ac_cv_have_swap=yes
1543         ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
1544         ac_cv_swap_format=["%*s %f %*d %f"]
1545         ac_cv_swap_conv=1024
1546         AC_MSG_RESULT([using HP-UX format swapinfo])
1548 dnl end if for PATH_TO_SWAPINFO
1551 AC_PATH_PROG(PATH_TO_LSPS,lsps)
1552 if (test -n "$PATH_TO_LSPS")
1553 then
1554 AC_MSG_CHECKING([for $PATH_TO_LSPS format])
1555 if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
1556 then
1557         ac_cv_have_swap=yes
1558         ac_cv_swap_command="$PATH_TO_LSPS -a"
1559         ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
1560         ac_cv_swap_conv=1
1561         AC_MSG_RESULT([using AIX lsps])
1563 dnl end if for PATH_TO_SWAPINFO
1567 dnl test for swapctl system call, both the 2-arg and 3-arg variants
1568 dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
1569 dnl in the various BSD's
1572 AC_CHECK_HEADERS([sys/stat.h sys/param.h])
1573 AC_CHECK_HEADERS([sys/swap.h], [], [], [
1574 #ifdef HAVE_SYS_PARAM_H
1575 #include <sys/param.h>
1576 #endif
1578 AC_CHECK_DECLS([swapctl],,,[
1579                #include <unistd.h>
1580                #include <sys/types.h>
1581                #include <sys/param.h>
1582                #include <sys/stat.h>
1583                #include <sys/swap.h>
1584                ])
1585 AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
1586                #include <sys/types.h>
1587                #include <sys/param.h>
1588                #include <sys/stat.h>
1589                #include <sys/swap.h>
1590                ])
1591 AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1592                  #include <unistd.h>
1593                  #include <sys/types.h>
1594                  #include <sys/param.h>
1595                  #include <sys/stat.h>
1596                  #include <sys/swap.h>
1597                  ])
1599 if test "$ac_cv_have_decl_swapctl" = "yes";
1600 then
1601         EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
1602         AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1603         if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1604                 "$ac_cv_type_swapent_t" = "yes";
1605         then
1606                 AC_MSG_RESULT([yes])
1607                 ac_cv_check_swap_swapctl_svr4="1";
1608                 AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
1609                           [Define if 2-argument SVR4 swapctl exists])
1610         else
1611                 AC_MSG_RESULT([no])
1612                 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1613                 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1614                 then
1615                         AC_MSG_RESULT([yes])
1616                         AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
1617                                   [Define if 3-argument BSD swapctl exists])
1618                 else
1619                         AC_MSG_RESULT([no])
1620                 fi
1621         fi
1622         AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
1623         if test "$ac_cv_check_swap_swapctl_svr4" = "1";
1624         then
1625                 dnl
1626                 dnl the SVR4 spec returns values in pages
1627                 dnl
1628                 AC_MSG_RESULT([page])
1629                 AC_CHECK_DECLS([sysconf])
1630                 AC_MSG_CHECKING([for system page size])
1631                 if test "$ac_cv_have_decl_sysconf" = "yes";
1632                 then
1633                         AC_MSG_RESULT([determined by sysconf(3)])
1634                         ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
1635                 else
1636                         AC_MSG_WARN([don't know. guessing 4096k])
1637                         ac_cv_swap_conv=256
1638                 fi
1639         else
1640                 dnl
1641                 dnl the BSD spec returns values in blocks
1642                 dnl
1643                 AC_MSG_RESULT([blocks (assuming 512b)])
1644                 ac_cv_swap_conv=2048
1645         fi
1646         AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1647                 [Conversion factor to MB])
1650 dnl end tests for the swapctl system calls
1654 if test "x$ac_cv_have_swap" != "x"
1655 then
1656         AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1657         EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
1659 if test "x$ac_cv_swap_command" != "x"
1660 then
1661         AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1662                 [Path to swap/swapinfo binary, with any args])
1663         AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1664                 [Format string for parsing swap output])
1665         AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1666                 [Conversion factor to MB])
1669 AC_ARG_WITH(proc-meminfo,
1670             ACX_HELP_STRING([--with-proc-meminfo=PATH],
1671                             [path to /proc/meminfo or equivalent]),
1672                             ac_cv_proc_meminfo=$withval)
1673 dnl dunno why this does not work below - use hack (kbd)
1674 dnl fine on linux, broken on solaris
1675 dnl if /bin/test -e "/proc/meminfo"
1676 AC_MSG_CHECKING([for /proc/meminfo])
1677 if test -n "$ac_cv_proc_meminfo"; then
1678         AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
1679 elif [cat /proc/meminfo > /dev/null 2>&1]; then
1680         AC_MSG_RESULT([found /proc/meminfo])
1681         ac_cv_proc_meminfo="/proc/meminfo"
1682 else
1683         AC_MSG_RESULT([no])
1686 if test -n "$ac_cv_proc_meminfo"; then
1687         AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1688         AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
1689         EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
1692 AC_PATH_PROG(PATH_TO_DIG,dig)
1693 AC_ARG_WITH(dig_command,
1694             ACX_HELP_STRING([--with-dig-command=PATH],
1695                             [Path to dig command]), PATH_TO_DIG=$withval)
1696 if test -n "$PATH_TO_DIG"; then
1697         EXTRAS="$EXTRAS check_dig\$(EXEEXT)"
1698         AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1701 AC_PATH_PROG(PATH_TO_APTGET,apt-get)
1702 AC_ARG_WITH(apt-get_command,
1703             ACX_HELP_STRING([--with-apt-get-command=PATH],
1704                             [Path to apt-get command]),
1705                             with_apt_get_command=$withval,
1706                             with_apt_get_command=$PATH_TO_APTGET)
1707 AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
1708 if test -n "$PATH_TO_APTGET" ; then
1709         EXTRAS="$EXTRAS check_apt\$(EXEEXT)"
1713 if test -f $srcdir/plugins/check_nt.c ; then
1714   EXTRAS="$EXTRAS check_nt\$(EXEEXT)"
1718 dnl used in check_dhcp
1719 AC_CHECK_HEADERS(sys/sockio.h)
1721 case $host in
1722         *bsd*)
1723                 AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
1724         ;;
1725         *linux*)
1726                 AC_DEFINE(__linux__,1,[linux specific code in check_dhcp.c])
1727         ;;
1728         *sun* | *solaris*)
1729                 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
1730         ;;
1731         *hpux*)
1732                 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
1733         ;;
1734 esac
1736 AC_SUBST(EXTRAS)
1737 AC_SUBST(EXTRAS_ROOT)
1738 AC_SUBST(EXTRA_NETOBJS)
1739 AC_SUBST(DEPLIBS)
1741 AM_GNU_GETTEXT([external], [need-ngettext])
1742 AM_GNU_GETTEXT_VERSION(0.15)
1744 dnl Check for Redhat spopen problem
1745 dnl Wierd problem where ECHILD is returned from a wait call in error
1746 dnl Only appears to affect nslookup and dig calls. Only affects redhat around
1747 dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
1748 dnl We patch plugins/popen.c
1749 dnl Need to add smp because uname different on those
1750 dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1751 AC_ARG_ENABLE(redhat-pthread-workaround,
1752         AC_HELP_STRING([--enable-redhat-pthread-workaround],
1753                 [force Redhat patch to be applied (default: test system)]),
1754         [ac_cv_enable_redhat_pthread_workaround=$enableval],
1755         [ac_cv_enable_redhat_pthread_workaround=test])
1756 if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
1757         if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
1758                 AC_MSG_NOTICE([See https://www.monitoring-plugins.org/doc/faq/configure-hangs.html if this next part takes a long time])
1759                 AC_MSG_CHECKING(for redhat spopen problem)
1760                 ( cd config_test && make && make test ) > /dev/null 2>&1
1761                 if test $? -eq 0 ; then
1762                         AC_MSG_RESULT(okay)
1763                 else
1764                         AC_MSG_RESULT(error)
1765                         AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
1766                 fi
1767         fi
1768 elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
1769         AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
1772 dnl Perl modules
1773 AC_ARG_ENABLE(perl-modules,
1774         AC_HELP_STRING([--enable-perl-modules],
1775                 [Enables installation of Monitoring::Plugin and its dependencies (default: no)]),
1776         [enable_perl_modules=$enableval],
1777         [enable_perl_modules=no])
1778 if test "$enable_perl_modules" = "yes" ; then
1779   AC_SUBST(PERLMODS_DIR,perlmods)
1782 # From Tap configure
1783 # Checks for libraries
1784 case "$host" in
1785         *-*-*freebsd4*)
1786                 LDFLAGS="$LDFLAGS -pthread"
1787                 HAVE_LIBPTHREAD=1
1788                 ;;
1789         *)
1790                 AC_CHECK_LIB(pthread, main)
1791                 ;;
1792 esac
1794 dnl External libraries - see ACKNOWLEDGEMENTS
1795 gl_INIT
1797 dnl Some helpful common compile errors checked here
1798 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
1799         AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
1802 AC_OUTPUT(
1803   Makefile
1804   tap/Makefile
1805   lib/Makefile
1806   plugins/Makefile
1807   lib/tests/Makefile
1808   plugins-root/Makefile
1809   plugins-scripts/Makefile
1810   plugins-scripts/utils.pm
1811   plugins-scripts/utils.sh
1812   perlmods/Makefile
1813   test.pl
1814   pkg/solaris/pkginfo
1815   po/Makefile.in
1819 dnl the ones below that are commented out need to be cleaned up
1820 dnl in the configure code above to use with_foo instead of ac_cv_foo
1821 dnl if we want them to show up here.  it'd also make the code cleaner.
1822 dnl i'll get to that on another rainy day :) -sf
1823 ACX_FEATURE([with],[apt-get-command])
1824 dnl ACX_FEATURE([with],[dig-command])
1825 dnl ACX_FEATURE([with],[fping-command])
1826 dnl ACX_FEATURE([with],[mailq-command])
1827 dnl ACX_FEATURE([with],[nslookup-command])
1828 ACX_FEATURE([with],[ping6-command])
1829 ACX_FEATURE([with],[ping-command])
1830 dnl ACX_FEATURE([with],[qstat-command])
1831 dnl ACX_FEATURE([with],[rpcinfo-command])
1832 dnl ACX_FEATURE([with],[smbclient-command])
1833 dnl ACX_FEATURE([with],[snmpget-command])
1834 dnl ACX_FEATURE([with],[snmpgetnext-command])
1835 dnl ACX_FEATURE([with],[ssh-command])
1836 dnl ACX_FEATURE([with],[uptime-command])
1838 dnl ACX_FEATURE([with],[proc-meminfo])
1839 dnl ACX_FEATURE([with],[ps-command])
1840 dnl ACX_FEATURE([with],[ps-format])
1841 dnl ACX_FEATURE([with],[ps-cols])
1842 dnl ACX_FEATURE([with],[ps-varlist])
1844 ACX_FEATURE([with],[ipv6])
1845 ACX_FEATURE([with],[mysql])
1846 ACX_FEATURE([with],[openssl])
1847 ACX_FEATURE([with],[gnutls])
1848 ACX_FEATURE([enable],[extra-opts])
1849 ACX_FEATURE([with],[perl])
1850 ACX_FEATURE([enable],[perl-modules])
1851 ACX_FEATURE([with],[cgiurl])
1852 ACX_FEATURE([with],[trusted-path])
1853 ACX_FEATURE([enable],[libtap])