diff options
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 215 |
1 files changed, 116 insertions, 99 deletions
diff --git a/configure.ac b/configure.ac index 8594238f..abd90413 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_PREREQ(2.64) | 2 | AC_PREREQ([2.64]) |
| 3 | AC_INIT(monitoring-plugins,2.4git) | 3 | AC_INIT([monitoring-plugins],[2.4git]) |
| 4 | AC_CONFIG_SRCDIR(NPTest.pm) | 4 | AC_CONFIG_SRCDIR(NPTest.pm) |
| 5 | AC_CONFIG_FILES([gl/Makefile]) | 5 | AC_CONFIG_FILES([gl/Makefile]) |
| 6 | AC_CONFIG_AUX_DIR(build-aux) | 6 | AC_CONFIG_AUX_DIR(build-aux) |
| 7 | AM_INIT_AUTOMAKE([1.8.3]) | 7 | AM_INIT_AUTOMAKE([1.8.3 subdir-objects]) |
| 8 | AM_SILENT_RULES([yes]) | 8 | AM_SILENT_RULES([yes]) |
| 9 | AM_MAINTAINER_MODE([enable]) | 9 | AM_MAINTAINER_MODE([enable]) |
| 10 | AC_CONFIG_HEADERS([config.h]) | 10 | AC_CONFIG_HEADERS([config.h]) |
| @@ -43,14 +43,14 @@ AC_SUBST(INSTALL) | |||
| 43 | AC_PROG_CC | 43 | AC_PROG_CC |
| 44 | gl_EARLY | 44 | gl_EARLY |
| 45 | AC_PROG_GCC_TRADITIONAL | 45 | AC_PROG_GCC_TRADITIONAL |
| 46 | AC_PROG_LIBTOOL | 46 | LT_INIT |
| 47 | 47 | ||
| 48 | AM_PROG_CC_C_O | 48 | AM_PROG_CC_C_O |
| 49 | 49 | ||
| 50 | AC_FUNC_ERROR_AT_LINE | 50 | AC_FUNC_ERROR_AT_LINE |
| 51 | AC_SYS_LARGEFILE | 51 | AC_SYS_LARGEFILE |
| 52 | 52 | ||
| 53 | ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD]) | 53 | ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AC_FUNC_STRTOD]) |
| 54 | 54 | ||
| 55 | PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'` | 55 | PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'` |
| 56 | AC_SUBST(PLUGIN_TEST)dnl | 56 | AC_SUBST(PLUGIN_TEST)dnl |
| @@ -125,8 +125,7 @@ AC_SUBST(PERL, $with_perl) | |||
| 125 | 125 | ||
| 126 | dnl openssl/gnutls | 126 | dnl openssl/gnutls |
| 127 | AC_ARG_WITH(openssl, | 127 | AC_ARG_WITH(openssl, |
| 128 | AC_HELP_STRING([--with-openssl=DIR], | 128 | AS_HELP_STRING([--with-openssl=DIR],[path to openssl installation]),) |
| 129 | [path to openssl installation]),) | ||
| 130 | 129 | ||
| 131 | AC_ARG_WITH(gnutls, | 130 | AC_ARG_WITH(gnutls, |
| 132 | ACX_HELP_STRING([--with-gnutls=PATH], | 131 | ACX_HELP_STRING([--with-gnutls=PATH], |
| @@ -167,8 +166,7 @@ AC_SUBST(MATHLIBS) | |||
| 167 | 166 | ||
| 168 | dnl Check if we buils local libtap | 167 | dnl Check if we buils local libtap |
| 169 | AC_ARG_ENABLE(libtap, | 168 | AC_ARG_ENABLE(libtap, |
| 170 | AC_HELP_STRING([--enable-libtap], | 169 | AS_HELP_STRING([--enable-libtap],[Enable built-in libtap for unit-testing (default: autodetect system library).]), |
| 171 | [Enable built-in libtap for unit-testing (default: autodetect system library).]), | ||
| 172 | [enable_libtap=$enableval], | 170 | [enable_libtap=$enableval], |
| 173 | [enable_libtap=no]) | 171 | [enable_libtap=no]) |
| 174 | AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"]) | 172 | AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"]) |
| @@ -183,14 +181,16 @@ fi | |||
| 183 | 181 | ||
| 184 | # Finally, define tests if we use libtap | 182 | # Finally, define tests if we use libtap |
| 185 | if test "$enable_libtap" = "yes" ; then | 183 | if test "$enable_libtap" = "yes" ; then |
| 186 | EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64" | 184 | EXTRA_TEST="test_utils test_tcp test_cmd test_base64" |
| 187 | AC_SUBST(EXTRA_TEST) | 185 | AC_SUBST(EXTRA_TEST) |
| 186 | |||
| 187 | EXTRA_PLUGIN_TESTS="tests/test_check_swap tests/test_check_disk" | ||
| 188 | AC_SUBST(EXTRA_PLUGIN_TESTS) | ||
| 188 | fi | 189 | fi |
| 189 | 190 | ||
| 190 | dnl INI Parsing | 191 | dnl INI Parsing |
| 191 | AC_ARG_ENABLE(extra-opts, | 192 | AC_ARG_ENABLE(extra-opts, |
| 192 | AC_HELP_STRING([--enable-extra-opts], | 193 | AS_HELP_STRING([--enable-extra-opts],[Enables parsing of plugins ini config files for extra options (default: no)]), |
| 193 | [Enables parsing of plugins ini config files for extra options (default: no)]), | ||
| 194 | [enable_extra_opts=$enableval], | 194 | [enable_extra_opts=$enableval], |
| 195 | [enable_extra_opts=yes]) | 195 | [enable_extra_opts=yes]) |
| 196 | AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"]) | 196 | AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"]) |
| @@ -205,32 +205,46 @@ fi | |||
| 205 | dnl Check for PostgreSQL libraries | 205 | dnl Check for PostgreSQL libraries |
| 206 | _SAVEDLIBS="$LIBS" | 206 | _SAVEDLIBS="$LIBS" |
| 207 | _SAVEDCPPFLAGS="$CPPFLAGS" | 207 | _SAVEDCPPFLAGS="$CPPFLAGS" |
| 208 | case $host in | ||
| 209 | *openbsd*) | ||
| 210 | _CRYPTLIB="crypto" | ||
| 211 | ;; | ||
| 212 | *) | ||
| 213 | _CRYPTLIB="crypt" | ||
| 214 | esac | ||
| 215 | |||
| 208 | AC_ARG_WITH(pgsql, | 216 | AC_ARG_WITH(pgsql, |
| 209 | ACX_HELP_STRING([--with-pgsql=DIR], | 217 | ACX_HELP_STRING([--with-pgsql=DIR], |
| 210 | [sets path to pgsql installation]), | 218 | [sets path to pgsql installation]), |
| 211 | PGSQL=$withval,) | 219 | PGSQL=$withval,) |
| 212 | AC_CHECK_LIB(crypt,main) | 220 | AC_CHECK_LIB(crypt,main) |
| 213 | if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then | 221 | AC_CHECK_LIB(crypto,main) |
| 222 | if test \( "$ac_cv_lib_crypt_main" = "yes" -o "$ac_cv_lib_crypto_main" = "yes" \) -a "x$PGSQL" != "xno"; then | ||
| 214 | if test -n "$PGSQL"; then | 223 | if test -n "$PGSQL"; then |
| 215 | LDFLAGS="$LDFLAGS -L$PGSQL/lib" | 224 | LDFLAGS="$LDFLAGS -L$PGSQL/lib" |
| 216 | CPPFLAGS="$CPPFLAGS -I$PGSQL/include" | 225 | CPPFLAGS="$CPPFLAGS -I$PGSQL/include" |
| 217 | fi | 226 | fi |
| 218 | AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt) | 227 | AC_CHECK_LIB(pq,PQsetdbLogin,,,"-l$_CRYPTLIB") |
| 219 | if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then | 228 | if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then |
| 220 | AC_CHECK_HEADERS(pgsql/libpq-fe.h) | 229 | AC_CHECK_HEADERS(pgsql/libpq-fe.h) |
| 221 | AC_CHECK_HEADERS(postgresql/libpq-fe.h) | 230 | AC_CHECK_HEADERS(postgresql/libpq-fe.h) |
| 222 | AC_CHECK_HEADERS(libpq-fe.h) | 231 | AC_CHECK_HEADERS(libpq-fe.h) |
| 223 | if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then | 232 | if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then |
| 224 | PGLIBS="-L$PGSQL/lib -lpq -lcrypt" | 233 | PGLIBS="-L$PGSQL/lib -lpq -l$_CRYPTLIB" |
| 225 | PGINCLUDE="-I$PGSQL/include" | 234 | PGINCLUDE="-I$PGSQL/include" |
| 226 | elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then | 235 | elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then |
| 227 | PGLIBS="-lpq -lcrypt" | 236 | PGLIBS="-lpq -l$_CRYPTLIB" |
| 228 | PGINCLUDE="-I/usr/include/pgsql" | 237 | PGINCLUDE="-I/usr/include/pgsql" |
| 229 | elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then | 238 | elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then |
| 230 | PGLIBS="-L$PGSQL/lib -lpq -lcrypt" | 239 | PGLIBS="-L$PGSQL/lib -lpq -l$_CRYPTLIB" |
| 231 | PGINCLUDE="-I/usr/include/postgresql" | 240 | case $host in |
| 241 | *openbsd*) | ||
| 242 | PGINCLUDE="-I$PGSQL/include/postgresql" ;; | ||
| 243 | *) | ||
| 244 | PGINCLUDE="-I/usr/include/postgresql" | ||
| 245 | esac | ||
| 232 | elif test "$ac_cv_header_libpq_fe_h" = "yes"; then | 246 | elif test "$ac_cv_header_libpq_fe_h" = "yes"; then |
| 233 | PGLIBS="-L$PGSQL/lib -lpq -lcrypt" | 247 | PGLIBS="-L$PGSQL/lib -lpq -l$_CRYPTLIB" |
| 234 | PGINCLUDE="-I$PGSQL/include" | 248 | PGINCLUDE="-I$PGSQL/include" |
| 235 | fi | 249 | fi |
| 236 | if test -z "$PGINCLUDE"; then | 250 | if test -z "$PGINCLUDE"; then |
| @@ -464,20 +478,16 @@ AC_ARG_WITH([ipv6], | |||
| 464 | dnl Check for AF_INET6 support - unistd.h required for Darwin | 478 | dnl Check for AF_INET6 support - unistd.h required for Darwin |
| 465 | if test "$with_ipv6" != "no"; then | 479 | if test "$with_ipv6" != "no"; then |
| 466 | AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [ | 480 | AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [ |
| 467 | AC_TRY_COMPILE( | 481 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_UNISTD_H |
| 468 | [#ifdef HAVE_UNISTD_H | ||
| 469 | #include <unistd.h> | 482 | #include <unistd.h> |
| 470 | #endif | 483 | #endif |
| 471 | #include <netinet/in.h> | 484 | #include <netinet/in.h> |
| 472 | #include <sys/socket.h>], | 485 | #include <sys/socket.h>]], [[struct sockaddr_in6 sin6; |
| 473 | [struct sockaddr_in6 sin6; | ||
| 474 | void *p; | 486 | void *p; |
| 475 | 487 | ||
| 476 | sin6.sin6_family = AF_INET6; | 488 | sin6.sin6_family = AF_INET6; |
| 477 | sin6.sin6_port = 587; | 489 | sin6.sin6_port = 587; |
| 478 | p = &sin6.sin6_addr;], | 490 | p = &sin6.sin6_addr;]])],[np_cv_sys_ipv6=yes],[np_cv_sys_ipv6=no]) |
| 479 | [np_cv_sys_ipv6=yes], | ||
| 480 | [np_cv_sys_ipv6=no]) | ||
| 481 | ]) | 491 | ]) |
| 482 | if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then | 492 | if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then |
| 483 | AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed]) | 493 | AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed]) |
| @@ -611,10 +621,10 @@ dnl | |||
| 611 | dnl Checks for header files. | 621 | dnl Checks for header files. |
| 612 | dnl | 622 | dnl |
| 613 | 623 | ||
| 614 | AC_HEADER_TIME | ||
| 615 | AC_HEADER_SYS_WAIT | 624 | AC_HEADER_SYS_WAIT |
| 616 | AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h) | 625 | AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h) |
| 617 | AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h) | 626 | AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h) |
| 627 | AC_CHECK_HEADERS_ONCE([sys/time.h]) | ||
| 618 | 628 | ||
| 619 | dnl Checks for typedefs, structures, and compiler characteristics. | 629 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 620 | AC_C_CONST | 630 | AC_C_CONST |
| @@ -623,36 +633,27 @@ AC_TYPE_PID_T | |||
| 623 | AC_TYPE_SIZE_T | 633 | AC_TYPE_SIZE_T |
| 624 | 634 | ||
| 625 | AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ | 635 | AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ |
| 626 | AC_TRY_LINK([#include <stdarg.h> | 636 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
| 627 | va_list ap1,ap2;], [va_copy(ap1,ap2);], | 637 | va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],[ac_cv_HAVE_VA_COPY=yes],[ac_cv_HAVE_VA_COPY=no])]) |
| 628 | ac_cv_HAVE_VA_COPY=yes, | ||
| 629 | ac_cv_HAVE_VA_COPY=no)]) | ||
| 630 | if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then | 638 | if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then |
| 631 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) | 639 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) |
| 632 | else | 640 | else |
| 633 | AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ | 641 | AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ |
| 634 | AC_TRY_LINK([#include <stdarg.h> | 642 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
| 635 | va_list ap1,ap2;], [__va_copy(ap1,ap2);], | 643 | va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],[ac_cv_HAVE___VA_COPY=yes],[ac_cv_HAVE___VA_COPY=no])]) |
| 636 | ac_cv_HAVE___VA_COPY=yes, | ||
| 637 | ac_cv_HAVE___VA_COPY=no)]) | ||
| 638 | if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then | 644 | if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then |
| 639 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) | 645 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) |
| 640 | fi | 646 | fi |
| 641 | fi | 647 | fi |
| 642 | 648 | ||
| 643 | AC_TRY_COMPILE([#include <sys/time.h>], | 649 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval *tv; |
| 644 | [struct timeval *tv; | 650 | struct timezone *tz;]])],[AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,Define if we have a timeval structure) |
| 645 | struct timezone *tz;], | 651 | FOUND_STRUCT_TIMEVAL="yes"],[]) |
| 646 | AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure]) | ||
| 647 | FOUND_STRUCT_TIMEVAL="yes") | ||
| 648 | 652 | ||
| 649 | if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then | 653 | if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then |
| 650 | AC_TRY_COMPILE([#include <sys/time.h>], | 654 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval *tv; |
| 651 | [struct timeval *tv; | ||
| 652 | struct timezone *tz; | 655 | struct timezone *tz; |
| 653 | gettimeofday(tv, tz);], | 656 | gettimeofday(tv, tz);]])],[AC_DEFINE(HAVE_GETTIMEOFDAY,1,Define if gettimeofday is found)],[AC_DEFINE(NEED_GETTIMEOFDAY,1,Define if gettimeofday is needed)]) |
| 654 | AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]), | ||
| 655 | AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])) | ||
| 656 | fi | 657 | fi |
| 657 | 658 | ||
| 658 | dnl Checks for library functions. | 659 | dnl Checks for library functions. |
| @@ -660,14 +661,11 @@ AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor) | |||
| 660 | AC_CHECK_FUNCS(poll) | 661 | AC_CHECK_FUNCS(poll) |
| 661 | 662 | ||
| 662 | AC_MSG_CHECKING(return type of socket size) | 663 | AC_MSG_CHECKING(return type of socket size) |
| 663 | AC_TRY_COMPILE([#include <stdlib.h> | 664 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
| 664 | #include <sys/types.h> | 665 | #include <sys/types.h> |
| 665 | #include <sys/socket.h>], | 666 | #include <sys/socket.h>]], [[int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);]])],[ac_cv_socket_size_type="size_t" |
| 666 | [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);], | 667 | AC_MSG_RESULT(size_t)],[ac_cv_socket_size_type="int" |
| 667 | ac_cv_socket_size_type=["size_t"] | 668 | AC_MSG_RESULT(int)]) |
| 668 | AC_MSG_RESULT(size_t), | ||
| 669 | ac_cv_socket_size_type=["int"] | ||
| 670 | AC_MSG_RESULT(int)) | ||
| 671 | 669 | ||
| 672 | AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , | 670 | AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , |
| 673 | [Define type of socket size]) | 671 | [Define type of socket size]) |
| @@ -812,7 +810,7 @@ elif ps axwo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \ | |||
| 812 | then | 810 | then |
| 813 | ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]" | 811 | ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]" |
| 814 | ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu etime comm args'" | 812 | ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu etime comm args'" |
| 815 | ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n" | 813 | ac_cv_ps_format="%s %u %d %d %d %d %f %s %s %n" |
| 816 | ac_cv_ps_cols=10 | 814 | ac_cv_ps_cols=10 |
| 817 | AC_MSG_RESULT([$ac_cv_ps_command]) | 815 | AC_MSG_RESULT([$ac_cv_ps_command]) |
| 818 | 816 | ||
| @@ -1430,20 +1428,14 @@ if test -n "$ac_cv_nslookup_command"; then | |||
| 1430 | fi | 1428 | fi |
| 1431 | 1429 | ||
| 1432 | AC_MSG_CHECKING([for number of online cpus]) | 1430 | AC_MSG_CHECKING([for number of online cpus]) |
| 1433 | AC_TRY_COMPILE([#include <unistd.h>], | 1431 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[sysconf(_SC_NPROCESSORS_ONLN) > 0;]])],[AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,Define if sysconf returns number of online cpus) |
| 1434 | [sysconf(_SC_NPROCESSORS_ONLN) > 0;], | 1432 | AC_MSG_RESULT(sysconf(_SC_NPROCESSORS_ONLN))],[AC_MSG_RESULT(cannot calculate) |
| 1435 | AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus]) | 1433 | ]) |
| 1436 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]), | ||
| 1437 | AC_MSG_RESULT([cannot calculate]) | ||
| 1438 | ) | ||
| 1439 | 1434 | ||
| 1440 | AC_MSG_CHECKING([for number of available cpus]) | 1435 | AC_MSG_CHECKING([for number of available cpus]) |
| 1441 | AC_TRY_COMPILE([#include <unistd.h>], | 1436 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[sysconf(_SC_NPROCESSORS_CONF) > 0;]])],[AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,Define if sysconf returns number of available cpus) |
| 1442 | [sysconf(_SC_NPROCESSORS_CONF) > 0;], | 1437 | AC_MSG_RESULT(sysconf(_SC_NPROCESSORS_CONF))],[AC_MSG_RESULT(cannot calculate) |
| 1443 | AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus]) | 1438 | ]) |
| 1444 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), | ||
| 1445 | AC_MSG_RESULT([cannot calculate]) | ||
| 1446 | ) | ||
| 1447 | 1439 | ||
| 1448 | AC_PATH_PROG(PATH_TO_UPTIME,uptime) | 1440 | AC_PATH_PROG(PATH_TO_UPTIME,uptime) |
| 1449 | AC_ARG_WITH(uptime_command, | 1441 | AC_ARG_WITH(uptime_command, |
| @@ -1482,23 +1474,19 @@ AC_ARG_WITH(snmpget_command, | |||
| 1482 | ACX_HELP_STRING([--with-snmpget-command=PATH], | 1474 | ACX_HELP_STRING([--with-snmpget-command=PATH], |
| 1483 | [Path to snmpget command]), | 1475 | [Path to snmpget command]), |
| 1484 | PATH_TO_SNMPGET=$withval) | 1476 | PATH_TO_SNMPGET=$withval) |
| 1485 | if test -n "$PATH_TO_SNMPGET" | ||
| 1486 | then | ||
| 1487 | AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary]) | ||
| 1488 | EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)" | ||
| 1489 | else | ||
| 1490 | AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins]) | ||
| 1491 | fi | ||
| 1492 | 1477 | ||
| 1493 | AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext) | 1478 | AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext) |
| 1494 | AC_ARG_WITH(snmpgetnext_command, | 1479 | AC_ARG_WITH(snmpgetnext_command, |
| 1495 | ACX_HELP_STRING([--with-snmpgetnext-command=PATH], | 1480 | ACX_HELP_STRING([--with-snmpgetnext-command=PATH], |
| 1496 | [Path to snmpgetnext command]), | 1481 | [Path to snmpgetnext command]), |
| 1497 | PATH_TO_SNMPGETNEXT=$withval) | 1482 | PATH_TO_SNMPGETNEXT=$withval) |
| 1498 | if test -n "$PATH_TO_SNMPGETNEXT" | 1483 | |
| 1499 | then | 1484 | AS_IF([test -n "$PATH_TO_SNMPGET"], [ |
| 1500 | AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary]) | 1485 | AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary]) |
| 1501 | fi | 1486 | EXTRAS="$EXTRAS check_hpjd" |
| 1487 | ], [ | ||
| 1488 | AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to build the check_hpjd and check_snmp plugins]) | ||
| 1489 | ]) | ||
| 1502 | 1490 | ||
| 1503 | if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null ) | 1491 | if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null ) |
| 1504 | then | 1492 | then |
| @@ -1508,6 +1496,16 @@ else | |||
| 1508 | AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins]) | 1496 | AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins]) |
| 1509 | fi | 1497 | fi |
| 1510 | 1498 | ||
| 1499 | dnl Check whether DES encryption is available (might not on RHEL) | ||
| 1500 | AC_COMPILE_IFELSE( | ||
| 1501 | [AC_LANG_PROGRAM( | ||
| 1502 | [[#include <net-snmp/net-snmp-config.h> | ||
| 1503 | #include <net-snmp/net-snmp-includes.h>]], [[oid *foo = usmDESPrivProtocol;]] | ||
| 1504 | )], | ||
| 1505 | [AC_DEFINE(HAVE_USM_DES_PRIV_PROTOCOL,1,Define whether we have DES Privacy Protocol)], | ||
| 1506 | [] | ||
| 1507 | ) | ||
| 1508 | |||
| 1511 | AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) | 1509 | AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) |
| 1512 | AC_PATH_PROG(PATH_TO_QSTAT,qstat) | 1510 | AC_PATH_PROG(PATH_TO_QSTAT,qstat) |
| 1513 | AC_ARG_WITH(qstat_command, | 1511 | AC_ARG_WITH(qstat_command, |
| @@ -1534,21 +1532,47 @@ then | |||
| 1534 | fi | 1532 | fi |
| 1535 | 1533 | ||
| 1536 | AC_PATH_PROG(PATH_TO_FPING,fping) | 1534 | AC_PATH_PROG(PATH_TO_FPING,fping) |
| 1537 | AC_PATH_PROG(PATH_TO_FPING6,fping6) | ||
| 1538 | 1535 | ||
| 1539 | AC_ARG_WITH(fping_command, | 1536 | AC_ARG_WITH(fping_command, |
| 1540 | ACX_HELP_STRING([--with-fping-command=PATH], | 1537 | ACX_HELP_STRING([--with-fping-command=PATH], |
| 1541 | [Path to fping command]), PATH_TO_FPING=$withval) | 1538 | [Path to fping command]), PATH_TO_FPING=$withval) |
| 1542 | AC_ARG_WITH(fping6_command, | 1539 | if test -n "$PATH_TO_FPING"; then |
| 1543 | ACX_HELP_STRING([--with-fping6-command=PATH], | ||
| 1544 | [Path to fping6 command]), PATH_TO_FPING6=$withval) | ||
| 1545 | |||
| 1546 | if test -n "$PATH_TO_FPING" | ||
| 1547 | then | ||
| 1548 | AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) | 1540 | AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) |
| 1549 | EXTRAS="$EXTRAS check_fping\$(EXEEXT)" | 1541 | EXTRAS="$EXTRAS check_fping\$(EXEEXT)" |
| 1550 | if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then | 1542 | |
| 1551 | AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6]) | 1543 | if test -z "$($PATH_TO_FPING --version)" ; then |
| 1544 | AC_MSG_NOTICE([failed to get version of fping]) | ||
| 1545 | else | ||
| 1546 | FPING_MAJOR_VERSION="$($PATH_TO_FPING --version | sed 's/.*fping: Version //' | sed 's/\..*//')" | ||
| 1547 | FPING_MINOR_VERSION="$($PATH_TO_FPING --version | sed 's/.*fping: Version //' | sed 's/.*\.//')" | ||
| 1548 | |||
| 1549 | if test $FPING_MAJOR_VERSION -eq 5 ; then | ||
| 1550 | if test $FPING_MINOR_VERSION -ge 3 ; then | ||
| 1551 | AC_DEFINE(FPING_VERSION_5_3_OR_HIGHER, "true", [fping is of version 5.3 or higher]) | ||
| 1552 | AC_MSG_NOTICE([fping is of version 5.3 or higher]) | ||
| 1553 | AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher]) | ||
| 1554 | AC_MSG_NOTICE([fping is of version 5.2 or higher]) | ||
| 1555 | elif test $FPING_MINOR_VERSION -ge 2 ; then | ||
| 1556 | AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher]) | ||
| 1557 | AC_MSG_NOTICE([fping is of version 5.2 or higher]) | ||
| 1558 | else | ||
| 1559 | AC_MSG_NOTICE([fping is of a version lower then 5.2]) | ||
| 1560 | fi | ||
| 1561 | |||
| 1562 | elif $FPING_MAJOR_VERSION > 5 ; then | ||
| 1563 | AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher]) | ||
| 1564 | AC_MSG_NOTICE([fping is of version 5.2 or higher]) | ||
| 1565 | AC_DEFINE(FPING_VERSION_5_3_OR_HIGHER, "true", [fping is of version 5.2 or higher]) | ||
| 1566 | AC_MSG_NOTICE([fping is of version 5.3 or higher]) | ||
| 1567 | fi | ||
| 1568 | |||
| 1569 | if test "`fping --version | sed 's/.*fping: Version //'`" = "5.2" ; then | ||
| 1570 | AC_DEFINE(FPING_VERSION, "5.2", [the version of fping available]) | ||
| 1571 | AC_MSG_NOTICE([fping version: 5.2]) | ||
| 1572 | elif test "`fping --version | sed 's/.*fping: Version //'`" = "5.3"; then | ||
| 1573 | AC_DEFINE(FPING_VERSION, "5.3", [the version of fping available]) | ||
| 1574 | AC_MSG_NOTICE([fping version: 5.3]) | ||
| 1575 | fi | ||
| 1552 | fi | 1576 | fi |
| 1553 | else | 1577 | else |
| 1554 | AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) | 1578 | AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) |
| @@ -1822,11 +1846,6 @@ if test -n "$PATH_TO_APTGET" ; then | |||
| 1822 | fi | 1846 | fi |
| 1823 | 1847 | ||
| 1824 | 1848 | ||
| 1825 | if test -f $srcdir/plugins/check_nt.c ; then | ||
| 1826 | EXTRAS="$EXTRAS check_nt\$(EXEEXT)" | ||
| 1827 | fi | ||
| 1828 | |||
| 1829 | |||
| 1830 | dnl used in check_dhcp | 1849 | dnl used in check_dhcp |
| 1831 | AC_CHECK_HEADERS(sys/sockio.h) | 1850 | AC_CHECK_HEADERS(sys/sockio.h) |
| 1832 | 1851 | ||
| @@ -1850,8 +1869,8 @@ AC_SUBST(EXTRAS_ROOT) | |||
| 1850 | AC_SUBST(EXTRA_NETOBJS) | 1869 | AC_SUBST(EXTRA_NETOBJS) |
| 1851 | AC_SUBST(DEPLIBS) | 1870 | AC_SUBST(DEPLIBS) |
| 1852 | 1871 | ||
| 1853 | AM_GNU_GETTEXT([external], [need-ngettext]) | 1872 | dnl AM_GNU_GETTEXT([external], [need-ngettext]) |
| 1854 | AM_GNU_GETTEXT_VERSION(0.15) | 1873 | dnl AM_GNU_GETTEXT_VERSION(0.15) |
| 1855 | 1874 | ||
| 1856 | dnl Check for Redhat spopen problem | 1875 | dnl Check for Redhat spopen problem |
| 1857 | dnl Weird problem where ECHILD is returned from a wait call in error | 1876 | dnl Weird problem where ECHILD is returned from a wait call in error |
| @@ -1861,8 +1880,7 @@ dnl We patch plugins/popen.c | |||
| 1861 | dnl Need to add smp because uname different on those | 1880 | dnl Need to add smp because uname different on those |
| 1862 | dnl Can force patch to be applied with --enable-redhat-pthread-workaround | 1881 | dnl Can force patch to be applied with --enable-redhat-pthread-workaround |
| 1863 | AC_ARG_ENABLE(redhat-pthread-workaround, | 1882 | AC_ARG_ENABLE(redhat-pthread-workaround, |
| 1864 | AC_HELP_STRING([--enable-redhat-pthread-workaround], | 1883 | AS_HELP_STRING([--enable-redhat-pthread-workaround],[force Redhat patch to be applied (default: test system)]), |
| 1865 | [force Redhat patch to be applied (default: test system)]), | ||
| 1866 | [ac_cv_enable_redhat_pthread_workaround=$enableval], | 1884 | [ac_cv_enable_redhat_pthread_workaround=$enableval], |
| 1867 | [ac_cv_enable_redhat_pthread_workaround=test]) | 1885 | [ac_cv_enable_redhat_pthread_workaround=test]) |
| 1868 | if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then | 1886 | if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then |
| @@ -1883,8 +1901,7 @@ fi | |||
| 1883 | 1901 | ||
| 1884 | dnl Perl modules | 1902 | dnl Perl modules |
| 1885 | AC_ARG_ENABLE(perl-modules, | 1903 | AC_ARG_ENABLE(perl-modules, |
| 1886 | AC_HELP_STRING([--enable-perl-modules], | 1904 | AS_HELP_STRING([--enable-perl-modules],[Enables installation of Monitoring::Plugin and its dependencies (default: no)]), |
| 1887 | [Enables installation of Monitoring::Plugin and its dependencies (default: no)]), | ||
| 1888 | [enable_perl_modules=$enableval], | 1905 | [enable_perl_modules=$enableval], |
| 1889 | [enable_perl_modules=no]) | 1906 | [enable_perl_modules=no]) |
| 1890 | if test "$enable_perl_modules" = "yes" ; then | 1907 | if test "$enable_perl_modules" = "yes" ; then |
| @@ -1911,8 +1928,7 @@ if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_c | |||
| 1911 | AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?) | 1928 | AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?) |
| 1912 | fi | 1929 | fi |
| 1913 | 1930 | ||
| 1914 | AC_OUTPUT( | 1931 | AC_CONFIG_FILES([Makefile |
| 1915 | Makefile | ||
| 1916 | tap/Makefile | 1932 | tap/Makefile |
| 1917 | lib/Makefile | 1933 | lib/Makefile |
| 1918 | plugins/Makefile | 1934 | plugins/Makefile |
| @@ -1924,7 +1940,8 @@ AC_OUTPUT( | |||
| 1924 | perlmods/Makefile | 1940 | perlmods/Makefile |
| 1925 | test.pl | 1941 | test.pl |
| 1926 | pkg/solaris/pkginfo | 1942 | pkg/solaris/pkginfo |
| 1927 | ) | 1943 | ]) |
| 1944 | AC_OUTPUT | ||
| 1928 | 1945 | ||
| 1929 | 1946 | ||
| 1930 | dnl the ones below that are commented out need to be cleaned up | 1947 | dnl the ones below that are commented out need to be cleaned up |
