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