diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 106 |
1 files changed, 41 insertions, 65 deletions
diff --git a/configure.ac b/configure.ac index 8594238f..ef3d26e2 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"]) |
@@ -185,12 +183,14 @@ fi | |||
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_disk 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" | ||
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"]) |
@@ -464,20 +464,16 @@ AC_ARG_WITH([ipv6], | |||
464 | dnl Check for AF_INET6 support - unistd.h required for Darwin | 464 | dnl Check for AF_INET6 support - unistd.h required for Darwin |
465 | if test "$with_ipv6" != "no"; then | 465 | if test "$with_ipv6" != "no"; then |
466 | AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [ | 466 | AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [ |
467 | AC_TRY_COMPILE( | 467 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_UNISTD_H |
468 | [#ifdef HAVE_UNISTD_H | ||
469 | #include <unistd.h> | 468 | #include <unistd.h> |
470 | #endif | 469 | #endif |
471 | #include <netinet/in.h> | 470 | #include <netinet/in.h> |
472 | #include <sys/socket.h>], | 471 | #include <sys/socket.h>]], [[struct sockaddr_in6 sin6; |
473 | [struct sockaddr_in6 sin6; | ||
474 | void *p; | 472 | void *p; |
475 | 473 | ||
476 | sin6.sin6_family = AF_INET6; | 474 | sin6.sin6_family = AF_INET6; |
477 | sin6.sin6_port = 587; | 475 | sin6.sin6_port = 587; |
478 | p = &sin6.sin6_addr;], | 476 | 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 | ]) | 477 | ]) |
482 | if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then | 478 | 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]) | 479 | AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed]) |
@@ -611,10 +607,10 @@ dnl | |||
611 | dnl Checks for header files. | 607 | dnl Checks for header files. |
612 | dnl | 608 | dnl |
613 | 609 | ||
614 | AC_HEADER_TIME | ||
615 | AC_HEADER_SYS_WAIT | 610 | 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) | 611 | 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) | 612 | AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h) |
613 | AC_CHECK_HEADERS_ONCE([sys/time.h]) | ||
618 | 614 | ||
619 | dnl Checks for typedefs, structures, and compiler characteristics. | 615 | dnl Checks for typedefs, structures, and compiler characteristics. |
620 | AC_C_CONST | 616 | AC_C_CONST |
@@ -623,36 +619,27 @@ AC_TYPE_PID_T | |||
623 | AC_TYPE_SIZE_T | 619 | AC_TYPE_SIZE_T |
624 | 620 | ||
625 | AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ | 621 | AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ |
626 | AC_TRY_LINK([#include <stdarg.h> | 622 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
627 | va_list ap1,ap2;], [va_copy(ap1,ap2);], | 623 | 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 | 624 | if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then |
631 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) | 625 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) |
632 | else | 626 | else |
633 | AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ | 627 | AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ |
634 | AC_TRY_LINK([#include <stdarg.h> | 628 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
635 | va_list ap1,ap2;], [__va_copy(ap1,ap2);], | 629 | 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 | 630 | if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then |
639 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) | 631 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) |
640 | fi | 632 | fi |
641 | fi | 633 | fi |
642 | 634 | ||
643 | AC_TRY_COMPILE([#include <sys/time.h>], | 635 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval *tv; |
644 | [struct timeval *tv; | 636 | struct timezone *tz;]])],[AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,Define if we have a timeval structure) |
645 | struct timezone *tz;], | 637 | FOUND_STRUCT_TIMEVAL="yes"],[]) |
646 | AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure]) | ||
647 | FOUND_STRUCT_TIMEVAL="yes") | ||
648 | 638 | ||
649 | if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then | 639 | if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then |
650 | AC_TRY_COMPILE([#include <sys/time.h>], | 640 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval *tv; |
651 | [struct timeval *tv; | ||
652 | struct timezone *tz; | 641 | struct timezone *tz; |
653 | gettimeofday(tv, tz);], | 642 | 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 | 643 | fi |
657 | 644 | ||
658 | dnl Checks for library functions. | 645 | dnl Checks for library functions. |
@@ -660,14 +647,11 @@ AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor) | |||
660 | AC_CHECK_FUNCS(poll) | 647 | AC_CHECK_FUNCS(poll) |
661 | 648 | ||
662 | AC_MSG_CHECKING(return type of socket size) | 649 | AC_MSG_CHECKING(return type of socket size) |
663 | AC_TRY_COMPILE([#include <stdlib.h> | 650 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
664 | #include <sys/types.h> | 651 | #include <sys/types.h> |
665 | #include <sys/socket.h>], | 652 | #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);], | 653 | AC_MSG_RESULT(size_t)],[ac_cv_socket_size_type="int" |
667 | ac_cv_socket_size_type=["size_t"] | 654 | AC_MSG_RESULT(int)]) |
668 | AC_MSG_RESULT(size_t), | ||
669 | ac_cv_socket_size_type=["int"] | ||
670 | AC_MSG_RESULT(int)) | ||
671 | 655 | ||
672 | AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , | 656 | AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , |
673 | [Define type of socket size]) | 657 | [Define type of socket size]) |
@@ -1430,20 +1414,14 @@ if test -n "$ac_cv_nslookup_command"; then | |||
1430 | fi | 1414 | fi |
1431 | 1415 | ||
1432 | AC_MSG_CHECKING([for number of online cpus]) | 1416 | AC_MSG_CHECKING([for number of online cpus]) |
1433 | AC_TRY_COMPILE([#include <unistd.h>], | 1417 | 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;], | 1418 | 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]) | 1419 | ]) |
1436 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]), | ||
1437 | AC_MSG_RESULT([cannot calculate]) | ||
1438 | ) | ||
1439 | 1420 | ||
1440 | AC_MSG_CHECKING([for number of available cpus]) | 1421 | AC_MSG_CHECKING([for number of available cpus]) |
1441 | AC_TRY_COMPILE([#include <unistd.h>], | 1422 | 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;], | 1423 | 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]) | 1424 | ]) |
1444 | AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), | ||
1445 | AC_MSG_RESULT([cannot calculate]) | ||
1446 | ) | ||
1447 | 1425 | ||
1448 | AC_PATH_PROG(PATH_TO_UPTIME,uptime) | 1426 | AC_PATH_PROG(PATH_TO_UPTIME,uptime) |
1449 | AC_ARG_WITH(uptime_command, | 1427 | AC_ARG_WITH(uptime_command, |
@@ -1850,8 +1828,8 @@ AC_SUBST(EXTRAS_ROOT) | |||
1850 | AC_SUBST(EXTRA_NETOBJS) | 1828 | AC_SUBST(EXTRA_NETOBJS) |
1851 | AC_SUBST(DEPLIBS) | 1829 | AC_SUBST(DEPLIBS) |
1852 | 1830 | ||
1853 | AM_GNU_GETTEXT([external], [need-ngettext]) | 1831 | dnl AM_GNU_GETTEXT([external], [need-ngettext]) |
1854 | AM_GNU_GETTEXT_VERSION(0.15) | 1832 | dnl AM_GNU_GETTEXT_VERSION(0.15) |
1855 | 1833 | ||
1856 | dnl Check for Redhat spopen problem | 1834 | dnl Check for Redhat spopen problem |
1857 | dnl Weird problem where ECHILD is returned from a wait call in error | 1835 | dnl Weird problem where ECHILD is returned from a wait call in error |
@@ -1861,8 +1839,7 @@ dnl We patch plugins/popen.c | |||
1861 | dnl Need to add smp because uname different on those | 1839 | dnl Need to add smp because uname different on those |
1862 | dnl Can force patch to be applied with --enable-redhat-pthread-workaround | 1840 | dnl Can force patch to be applied with --enable-redhat-pthread-workaround |
1863 | AC_ARG_ENABLE(redhat-pthread-workaround, | 1841 | AC_ARG_ENABLE(redhat-pthread-workaround, |
1864 | AC_HELP_STRING([--enable-redhat-pthread-workaround], | 1842 | 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], | 1843 | [ac_cv_enable_redhat_pthread_workaround=$enableval], |
1867 | [ac_cv_enable_redhat_pthread_workaround=test]) | 1844 | [ac_cv_enable_redhat_pthread_workaround=test]) |
1868 | if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then | 1845 | if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then |
@@ -1883,8 +1860,7 @@ fi | |||
1883 | 1860 | ||
1884 | dnl Perl modules | 1861 | dnl Perl modules |
1885 | AC_ARG_ENABLE(perl-modules, | 1862 | AC_ARG_ENABLE(perl-modules, |
1886 | AC_HELP_STRING([--enable-perl-modules], | 1863 | 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], | 1864 | [enable_perl_modules=$enableval], |
1889 | [enable_perl_modules=no]) | 1865 | [enable_perl_modules=no]) |
1890 | if test "$enable_perl_modules" = "yes" ; then | 1866 | if test "$enable_perl_modules" = "yes" ; then |
@@ -1911,8 +1887,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?) | 1887 | AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?) |
1912 | fi | 1888 | fi |
1913 | 1889 | ||
1914 | AC_OUTPUT( | 1890 | AC_CONFIG_FILES([Makefile |
1915 | Makefile | ||
1916 | tap/Makefile | 1891 | tap/Makefile |
1917 | lib/Makefile | 1892 | lib/Makefile |
1918 | plugins/Makefile | 1893 | plugins/Makefile |
@@ -1924,7 +1899,8 @@ AC_OUTPUT( | |||
1924 | perlmods/Makefile | 1899 | perlmods/Makefile |
1925 | test.pl | 1900 | test.pl |
1926 | pkg/solaris/pkginfo | 1901 | pkg/solaris/pkginfo |
1927 | ) | 1902 | ]) |
1903 | AC_OUTPUT | ||
1928 | 1904 | ||
1929 | 1905 | ||
1930 | dnl the ones below that are commented out need to be cleaned up | 1906 | dnl the ones below that are commented out need to be cleaned up |