summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac88
1 files changed, 72 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 0a554af..7c17dcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.59) 2AC_PREREQ(2.59)
3AC_INIT(monitoring-plugins,2.1.2) 3AC_INIT(monitoring-plugins,2.3git)
4AC_CONFIG_SRCDIR(NPTest.pm) 4AC_CONFIG_SRCDIR(NPTest.pm)
5AC_CONFIG_FILES([gl/Makefile]) 5AC_CONFIG_FILES([gl/Makefile])
6AC_CONFIG_AUX_DIR(build-aux) 6AC_CONFIG_AUX_DIR(build-aux)
@@ -273,26 +273,33 @@ AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plug
273dnl Check for radius libraries 273dnl Check for radius libraries
274AS_IF([test "x$with_radius" != "xno"], [ 274AS_IF([test "x$with_radius" != "xno"], [
275 _SAVEDLIBS="$LIBS" 275 _SAVEDLIBS="$LIBS"
276 AC_CHECK_LIB(freeradius-client,rc_read_config) 276 AC_CHECK_LIB(radcli,rc_read_config)
277 if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then 277 if test "$ac_cv_lib_radcli_rc_read_config" = "yes"; then
278 EXTRAS="$EXTRAS check_radius\$(EXEEXT)" 278 EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
279 RADIUSLIBS="-lfreeradius-client" 279 RADIUSLIBS="-lradcli"
280 AC_SUBST(RADIUSLIBS) 280 AC_SUBST(RADIUSLIBS)
281 else 281 else
282 AC_CHECK_LIB(radiusclient-ng,rc_read_config) 282 AC_CHECK_LIB(freeradius-client,rc_read_config)
283 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then 283 if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then
284 EXTRAS="$EXTRAS check_radius\$(EXEEXT)" 284 EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
285 RADIUSLIBS="-lradiusclient-ng" 285 RADIUSLIBS="-lfreeradius-client"
286 AC_SUBST(RADIUSLIBS) 286 AC_SUBST(RADIUSLIBS)
287 else 287 else
288 AC_CHECK_LIB(radiusclient,rc_read_config) 288 AC_CHECK_LIB(radiusclient-ng,rc_read_config)
289 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then 289 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
290 EXTRAS="$EXTRAS check_radius\$(EXEEXT)" 290 EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
291 RADIUSLIBS="-lradiusclient" 291 RADIUSLIBS="-lradiusclient-ng"
292 AC_SUBST(RADIUSLIBS) 292 AC_SUBST(RADIUSLIBS)
293 else 293 else
294 AC_MSG_WARN([Skipping radius plugin]) 294 AC_CHECK_LIB(radiusclient,rc_read_config)
295 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) 295 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
296 EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
297 RADIUSLIBS="-lradiusclient"
298 AC_SUBST(RADIUSLIBS)
299 else
300 AC_MSG_WARN([Skipping radius plugin])
301 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
302 fi
296 fi 303 fi
297 fi 304 fi
298 fi 305 fi
@@ -378,6 +385,42 @@ if test "$ac_cv_header_wtsapi32_h" = "yes"; then
378 AC_SUBST(WTSAPI32LIBS) 385 AC_SUBST(WTSAPI32LIBS)
379fi 386fi
380 387
388_can_enable_check_curl=no
389dnl Check for cURL library
390LIBCURL_CHECK_CONFIG(yes, 7.15.2, [
391 _can_enable_check_curl=yes
392 LIBCURLINCLUDE="$LIBCURL_CPPFLAGS"
393 LIBCURLLIBS="$LIBCURL"
394 LIBCURLCFLAGS="$LIBCURL_CPPFLAGS"
395 AC_SUBST(LIBCURLINCLUDE)
396 AC_SUBST(LIBCURLLIBS)
397 AC_SUBST(LIBCURLCFLAGS)
398 ], [
399 _can_enable_check_curl=no
400 AC_MSG_WARN([Skipping curl plugin])
401 AC_MSG_WARN([install libcurl libs to compile this plugin (see REQUIREMENTS).])
402])
403
404dnl Check for uriparser library
405URIPARSER_CHECK(yes, 0.7.5, [
406 URIPARSERINCLUDE="$URIPARSER_CPPFLAGS"
407 URIPARSERLIBS="$URIPARSER"
408 URIPARSERCFLAGS="$URIPARSER_CPPFLAGS"
409 AC_SUBST(URIPARSERINCLUDE)
410 AC_SUBST(URIPARSERLIBS)
411 AC_SUBST(URIPARSERCFLAGS)
412 ], [
413 _can_enable_check_curl=no
414 AC_MSG_WARN([Skipping curl plugin])
415 AC_MSG_WARN([install the uriparser library to compile this plugin (see REQUIREMENTS).])
416])
417
418dnl prerequisites met, enable the plugin
419if test x$_can_enable_check_curl = xyes; then
420 EXTRAS="$EXTRAS check_curl\$(EXEEXT)"
421fi
422AC_CONFIG_FILES([plugins/picohttpparser/Makefile])
423
381dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface 424dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface
382if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no" 425if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no"
383then 426then
@@ -493,15 +536,15 @@ if ! test x"$with_openssl" = x"no"; then
493 dnl Check for crypto lib 536 dnl Check for crypto lib
494 _SAVEDLIBS="$LIBS" 537 _SAVEDLIBS="$LIBS"
495 LIBS="-L${with_openssl}/lib" 538 LIBS="-L${with_openssl}/lib"
496 AC_CHECK_LIB(crypto,CRYPTO_lock) 539 AC_CHECK_LIB(crypto,CRYPTO_new_ex_data)
497 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then 540 if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
498 dnl Check for SSL lib 541 dnl Check for SSL lib
499 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto) 542 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
500 fi 543 fi
501 LIBS="$_SAVEDLIBS" 544 LIBS="$_SAVEDLIBS"
502 545
503 dnl test headers and libs to decide whether check_http should use SSL 546 dnl test headers and libs to decide whether check_http should use SSL
504 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then 547 if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
505 if test "$ac_cv_lib_ssl_main" = "yes"; then 548 if test "$ac_cv_lib_ssl_main" = "yes"; then
506 if test "$FOUNDINCLUDE" = "yes"; then 549 if test "$FOUNDINCLUDE" = "yes"; then
507 FOUNDOPENSSL="yes" 550 FOUNDOPENSSL="yes"
@@ -1009,6 +1052,10 @@ if test -n "$ac_cv_ps_varlist" ; then
1009 AC_DEFINE(PS_USES_PROCETIME,"yes", 1052 AC_DEFINE(PS_USES_PROCETIME,"yes",
1010 [Whether the ps utility uses the "procetime" field]) 1053 [Whether the ps utility uses the "procetime" field])
1011 fi 1054 fi
1055 if echo "$ac_cv_ps_varlist" | grep "procpcpu" >/dev/null; then
1056 AC_DEFINE(PS_USES_PROCPCPU,"yes",
1057 [Whether the ps utility uses the "procpcpu" field])
1058 fi
1012fi 1059fi
1013 1060
1014AC_PATH_PROG(PATH_TO_PING,ping) 1061AC_PATH_PROG(PATH_TO_PING,ping)
@@ -1053,6 +1100,14 @@ then
1053 ac_cv_ping_packets_first=yes 1100 ac_cv_ping_packets_first=yes
1054 AC_MSG_RESULT([$with_ping_command]) 1101 AC_MSG_RESULT([$with_ping_command])
1055 1102
1103elif $PATH_TO_PING -4 -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
1104 egrep -i "^round-trip|^rtt" >/dev/null
1105then
1106 # check if -4 is supported - issue #1550
1107 with_ping_command="$PATH_TO_PING -4 -n -U -w %d -c %d %s"
1108 ac_cv_ping_packets_first=yes
1109 ac_cv_ping_has_timeout=yes
1110 AC_MSG_RESULT([$with_ping_command])
1056elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ 1111elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
1057 egrep -i "^round-trip|^rtt" >/dev/null 1112 egrep -i "^round-trip|^rtt" >/dev/null
1058then 1113then
@@ -1875,4 +1930,5 @@ ACX_FEATURE([enable],[perl-modules])
1875ACX_FEATURE([with],[cgiurl]) 1930ACX_FEATURE([with],[cgiurl])
1876ACX_FEATURE([with],[trusted-path]) 1931ACX_FEATURE([with],[trusted-path])
1877ACX_FEATURE([enable],[libtap]) 1932ACX_FEATURE([enable],[libtap])
1878 1933ACX_FEATURE([with],[libcurl])
1934ACX_FEATURE([with],[uriparser])