summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-02-19 14:23:54 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-02-19 14:23:54 +0100
commitbd2611685f28f877e1f2b01ec2af3435c56d836f (patch)
treeb0347ef72a21dec3e4a05a045d41f752ba0d1519 /configure.ac
parentec18b80cdbdc2c4c1e7eb587e251177e8cc7ca11 (diff)
parente23325f7c3b34d8950cf27e9ab23af362d0b341b (diff)
downloadmonitoring-plugins-bd2611685f28f877e1f2b01ec2af3435c56d836f.tar.gz
Merge branch 'master' into feature/new_output_infra
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac97
1 files changed, 35 insertions, 62 deletions
diff --git a/configure.ac b/configure.ac
index b12cf6c5..e9254566 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.64) 2AC_PREREQ([2.64])
3AC_INIT(monitoring-plugins,2.4git) 3AC_INIT([monitoring-plugins],[2.4git])
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)
@@ -43,14 +43,14 @@ AC_SUBST(INSTALL)
43AC_PROG_CC 43AC_PROG_CC
44gl_EARLY 44gl_EARLY
45AC_PROG_GCC_TRADITIONAL 45AC_PROG_GCC_TRADITIONAL
46AC_PROG_LIBTOOL 46LT_INIT
47 47
48AM_PROG_CC_C_O 48AM_PROG_CC_C_O
49 49
50AC_FUNC_ERROR_AT_LINE 50AC_FUNC_ERROR_AT_LINE
51AC_SYS_LARGEFILE 51AC_SYS_LARGEFILE
52 52
53ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD]) 53ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AC_FUNC_STRTOD])
54 54
55PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'` 55PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
56AC_SUBST(PLUGIN_TEST)dnl 56AC_SUBST(PLUGIN_TEST)dnl
@@ -125,8 +125,7 @@ AC_SUBST(PERL, $with_perl)
125 125
126dnl openssl/gnutls 126dnl openssl/gnutls
127AC_ARG_WITH(openssl, 127AC_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
131AC_ARG_WITH(gnutls, 130AC_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
168dnl Check if we buils local libtap 167dnl Check if we buils local libtap
169AC_ARG_ENABLE(libtap, 168AC_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])
174AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"]) 172AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"])
@@ -205,8 +203,7 @@ AM_CONDITIONAL([ENALBE_JSON_OUTPUT], [test x$json_output = xtrue])
205 203
206dnl INI Parsing 204dnl INI Parsing
207AC_ARG_ENABLE(extra-opts, 205AC_ARG_ENABLE(extra-opts,
208 AC_HELP_STRING([--enable-extra-opts], 206 AS_HELP_STRING([--enable-extra-opts],[Enables parsing of plugins ini config files for extra options (default: no)]),
209 [Enables parsing of plugins ini config files for extra options (default: no)]),
210 [enable_extra_opts=$enableval], 207 [enable_extra_opts=$enableval],
211 [enable_extra_opts=yes]) 208 [enable_extra_opts=yes])
212AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"]) 209AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
@@ -480,20 +477,16 @@ AC_ARG_WITH([ipv6],
480dnl Check for AF_INET6 support - unistd.h required for Darwin 477dnl Check for AF_INET6 support - unistd.h required for Darwin
481if test "$with_ipv6" != "no"; then 478if test "$with_ipv6" != "no"; then
482 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [ 479 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
483 AC_TRY_COMPILE( 480 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_UNISTD_H
484 [#ifdef HAVE_UNISTD_H
485 #include <unistd.h> 481 #include <unistd.h>
486 #endif 482 #endif
487 #include <netinet/in.h> 483 #include <netinet/in.h>
488 #include <sys/socket.h>], 484 #include <sys/socket.h>]], [[struct sockaddr_in6 sin6;
489 [struct sockaddr_in6 sin6;
490 void *p; 485 void *p;
491 486
492 sin6.sin6_family = AF_INET6; 487 sin6.sin6_family = AF_INET6;
493 sin6.sin6_port = 587; 488 sin6.sin6_port = 587;
494 p = &sin6.sin6_addr;], 489 p = &sin6.sin6_addr;]])],[np_cv_sys_ipv6=yes],[np_cv_sys_ipv6=no])
495 [np_cv_sys_ipv6=yes],
496 [np_cv_sys_ipv6=no])
497 ]) 490 ])
498 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then 491 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
499 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed]) 492 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
@@ -627,10 +620,10 @@ dnl
627dnl Checks for header files. 620dnl Checks for header files.
628dnl 621dnl
629 622
630AC_HEADER_TIME
631AC_HEADER_SYS_WAIT 623AC_HEADER_SYS_WAIT
632AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h) 624AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
633AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h) 625AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
626AC_CHECK_HEADERS_ONCE([sys/time.h])
634 627
635dnl Checks for typedefs, structures, and compiler characteristics. 628dnl Checks for typedefs, structures, and compiler characteristics.
636AC_C_CONST 629AC_C_CONST
@@ -639,36 +632,27 @@ AC_TYPE_PID_T
639AC_TYPE_SIZE_T 632AC_TYPE_SIZE_T
640 633
641AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ 634AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
642AC_TRY_LINK([#include <stdarg.h> 635AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
643va_list ap1,ap2;], [va_copy(ap1,ap2);], 636va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],[ac_cv_HAVE_VA_COPY=yes],[ac_cv_HAVE_VA_COPY=no])])
644ac_cv_HAVE_VA_COPY=yes,
645ac_cv_HAVE_VA_COPY=no)])
646if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then 637if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
647 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) 638 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
648else 639else
649 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ 640 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
650 AC_TRY_LINK([#include <stdarg.h> 641 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
651 va_list ap1,ap2;], [__va_copy(ap1,ap2);], 642 va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],[ac_cv_HAVE___VA_COPY=yes],[ac_cv_HAVE___VA_COPY=no])])
652 ac_cv_HAVE___VA_COPY=yes,
653 ac_cv_HAVE___VA_COPY=no)])
654 if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then 643 if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
655 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) 644 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
656 fi 645 fi
657fi 646fi
658 647
659AC_TRY_COMPILE([#include <sys/time.h>], 648AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval *tv;
660 [struct timeval *tv; 649 struct timezone *tz;]])],[AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,Define if we have a timeval structure)
661 struct timezone *tz;], 650 FOUND_STRUCT_TIMEVAL="yes"],[])
662 AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
663 FOUND_STRUCT_TIMEVAL="yes")
664 651
665if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then 652if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then
666 AC_TRY_COMPILE([#include <sys/time.h>], 653 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval *tv;
667 [struct timeval *tv;
668 struct timezone *tz; 654 struct timezone *tz;
669 gettimeofday(tv, tz);], 655 gettimeofday(tv, tz);]])],[AC_DEFINE(HAVE_GETTIMEOFDAY,1,Define if gettimeofday is found)],[AC_DEFINE(NEED_GETTIMEOFDAY,1,Define if gettimeofday is needed)])
670 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
671 AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed]))
672fi 656fi
673 657
674dnl Checks for library functions. 658dnl Checks for library functions.
@@ -676,14 +660,11 @@ AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
676AC_CHECK_FUNCS(poll) 660AC_CHECK_FUNCS(poll)
677 661
678AC_MSG_CHECKING(return type of socket size) 662AC_MSG_CHECKING(return type of socket size)
679AC_TRY_COMPILE([#include <stdlib.h> 663AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
680 #include <sys/types.h> 664 #include <sys/types.h>
681 #include <sys/socket.h>], 665 #include <sys/socket.h>]], [[int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);]])],[ac_cv_socket_size_type="size_t"
682 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);], 666 AC_MSG_RESULT(size_t)],[ac_cv_socket_size_type="int"
683 ac_cv_socket_size_type=["size_t"] 667 AC_MSG_RESULT(int)])
684 AC_MSG_RESULT(size_t),
685 ac_cv_socket_size_type=["int"]
686 AC_MSG_RESULT(int))
687 668
688AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , 669AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
689 [Define type of socket size]) 670 [Define type of socket size])
@@ -1446,20 +1427,14 @@ if test -n "$ac_cv_nslookup_command"; then
1446fi 1427fi
1447 1428
1448AC_MSG_CHECKING([for number of online cpus]) 1429AC_MSG_CHECKING([for number of online cpus])
1449AC_TRY_COMPILE([#include <unistd.h>], 1430AC_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)
1450 [sysconf(_SC_NPROCESSORS_ONLN) > 0;], 1431 AC_MSG_RESULT(sysconf(_SC_NPROCESSORS_ONLN))],[AC_MSG_RESULT(cannot calculate)
1451 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus]) 1432 ])
1452 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]),
1453 AC_MSG_RESULT([cannot calculate])
1454 )
1455 1433
1456AC_MSG_CHECKING([for number of available cpus]) 1434AC_MSG_CHECKING([for number of available cpus])
1457AC_TRY_COMPILE([#include <unistd.h>], 1435AC_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)
1458 [sysconf(_SC_NPROCESSORS_CONF) > 0;], 1436 AC_MSG_RESULT(sysconf(_SC_NPROCESSORS_CONF))],[AC_MSG_RESULT(cannot calculate)
1459 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus]) 1437 ])
1460 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1461 AC_MSG_RESULT([cannot calculate])
1462 )
1463 1438
1464AC_PATH_PROG(PATH_TO_UPTIME,uptime) 1439AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1465AC_ARG_WITH(uptime_command, 1440AC_ARG_WITH(uptime_command,
@@ -1877,8 +1852,7 @@ dnl We patch plugins/popen.c
1877dnl Need to add smp because uname different on those 1852dnl Need to add smp because uname different on those
1878dnl Can force patch to be applied with --enable-redhat-pthread-workaround 1853dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1879AC_ARG_ENABLE(redhat-pthread-workaround, 1854AC_ARG_ENABLE(redhat-pthread-workaround,
1880 AC_HELP_STRING([--enable-redhat-pthread-workaround], 1855 AS_HELP_STRING([--enable-redhat-pthread-workaround],[force Redhat patch to be applied (default: test system)]),
1881 [force Redhat patch to be applied (default: test system)]),
1882 [ac_cv_enable_redhat_pthread_workaround=$enableval], 1856 [ac_cv_enable_redhat_pthread_workaround=$enableval],
1883 [ac_cv_enable_redhat_pthread_workaround=test]) 1857 [ac_cv_enable_redhat_pthread_workaround=test])
1884if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then 1858if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
@@ -1899,8 +1873,7 @@ fi
1899 1873
1900dnl Perl modules 1874dnl Perl modules
1901AC_ARG_ENABLE(perl-modules, 1875AC_ARG_ENABLE(perl-modules,
1902 AC_HELP_STRING([--enable-perl-modules], 1876 AS_HELP_STRING([--enable-perl-modules],[Enables installation of Monitoring::Plugin and its dependencies (default: no)]),
1903 [Enables installation of Monitoring::Plugin and its dependencies (default: no)]),
1904 [enable_perl_modules=$enableval], 1877 [enable_perl_modules=$enableval],
1905 [enable_perl_modules=no]) 1878 [enable_perl_modules=no])
1906if test "$enable_perl_modules" = "yes" ; then 1879if test "$enable_perl_modules" = "yes" ; then
@@ -1927,8 +1900,7 @@ if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_c
1927 AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?) 1900 AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
1928fi 1901fi
1929 1902
1930AC_OUTPUT( 1903AC_CONFIG_FILES([Makefile
1931 Makefile
1932 tap/Makefile 1904 tap/Makefile
1933 lib/Makefile 1905 lib/Makefile
1934 plugins/Makefile 1906 plugins/Makefile
@@ -1940,7 +1912,8 @@ AC_OUTPUT(
1940 perlmods/Makefile 1912 perlmods/Makefile
1941 test.pl 1913 test.pl
1942 pkg/solaris/pkginfo 1914 pkg/solaris/pkginfo
1943) 1915])
1916AC_OUTPUT
1944 1917
1945 1918
1946dnl the ones below that are commented out need to be cleaned up 1919dnl the ones below that are commented out need to be cleaned up