summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac126
1 files changed, 68 insertions, 58 deletions
diff --git a/configure.ac b/configure.ac
index 204fc6e3..ae7eb30b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,10 +181,10 @@ fi
181 181
182# Finally, define tests if we use libtap 182# Finally, define tests if we use libtap
183if test "$enable_libtap" = "yes" ; then 183if test "$enable_libtap" = "yes" ; then
184 EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64" 184 EXTRA_TEST="test_utils test_tcp test_cmd test_base64"
185 AC_SUBST(EXTRA_TEST) 185 AC_SUBST(EXTRA_TEST)
186 186
187 EXTRA_PLUGIN_TESTS="tests/test_check_swap" 187 EXTRA_PLUGIN_TESTS="tests/test_check_swap tests/test_check_disk"
188 AC_SUBST(EXTRA_PLUGIN_TESTS) 188 AC_SUBST(EXTRA_PLUGIN_TESTS)
189fi 189fi
190 190
@@ -205,32 +205,46 @@ fi
205dnl Check for PostgreSQL libraries 205dnl Check for PostgreSQL libraries
206_SAVEDLIBS="$LIBS" 206_SAVEDLIBS="$LIBS"
207_SAVEDCPPFLAGS="$CPPFLAGS" 207_SAVEDCPPFLAGS="$CPPFLAGS"
208case $host in
209 *openbsd*)
210 _CRYPTLIB="crypto"
211 ;;
212 *)
213 _CRYPTLIB="crypt"
214esac
215
208AC_ARG_WITH(pgsql, 216AC_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,)
212AC_CHECK_LIB(crypt,main) 220AC_CHECK_LIB(crypt,main)
213if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then 221AC_CHECK_LIB(crypto,main)
222if 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
@@ -461,30 +475,6 @@ AC_ARG_WITH([ipv6],
461 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], 475 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
462 [], [with_ipv6=check]) 476 [], [with_ipv6=check])
463 477
464dnl Check for AF_INET6 support - unistd.h required for Darwin
465if test "$with_ipv6" != "no"; then
466 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
467 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_UNISTD_H
468 #include <unistd.h>
469 #endif
470 #include <netinet/in.h>
471 #include <sys/socket.h>]], [[struct sockaddr_in6 sin6;
472 void *p;
473
474 sin6.sin6_family = AF_INET6;
475 sin6.sin6_port = 587;
476 p = &sin6.sin6_addr;]])],[np_cv_sys_ipv6=yes],[np_cv_sys_ipv6=no])
477 ])
478 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
479 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
480 fi
481 if test "$np_cv_sys_ipv6" = "yes"; then
482 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
483 fi
484 with_ipv6="$np_cv_sys_ipv6"
485fi
486
487
488dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3 478dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
489AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) 479AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
490if test "$FOUNDINCLUDE" = "no"; then 480if test "$FOUNDINCLUDE" = "no"; then
@@ -1470,17 +1460,6 @@ AC_ARG_WITH(snmpgetnext_command,
1470AS_IF([test -n "$PATH_TO_SNMPGET"], [ 1460AS_IF([test -n "$PATH_TO_SNMPGET"], [
1471 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary]) 1461 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1472 EXTRAS="$EXTRAS check_hpjd" 1462 EXTRAS="$EXTRAS check_hpjd"
1473
1474 dnl PATH_TO_SNMPGETNEXT is used unconditionally in check_snmp:
1475 dnl
1476 dnl https://github.com/nagios-plugins/nagios-plugins/issues/788
1477 dnl
1478 AS_IF([test -n "$PATH_TO_SNMPGETNEXT"], [
1479 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1480 EXTRAS="$EXTRAS check_snmp\$(EXEEXT)"
1481 ], [
1482 AC_MSG_WARN([Get snmpgetnext from https://net-snmp.sourceforge.io/ to build the check_snmp plugin])
1483 ])
1484], [ 1463], [
1485 AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to build the check_hpjd and check_snmp plugins]) 1464 AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to build the check_hpjd and check_snmp plugins])
1486]) 1465])
@@ -1493,6 +1472,16 @@ else
1493 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins]) 1472 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1494fi 1473fi
1495 1474
1475dnl Check whether DES encryption is available (might not on RHEL)
1476AC_COMPILE_IFELSE(
1477 [AC_LANG_PROGRAM(
1478 [[#include <net-snmp/net-snmp-config.h>
1479 #include <net-snmp/net-snmp-includes.h>]], [[oid *foo = usmDESPrivProtocol;]]
1480 )],
1481 [AC_DEFINE(HAVE_USM_DES_PRIV_PROTOCOL,1,Define whether we have DES Privacy Protocol)],
1482 []
1483)
1484
1496AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) 1485AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1497AC_PATH_PROG(PATH_TO_QSTAT,qstat) 1486AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1498AC_ARG_WITH(qstat_command, 1487AC_ARG_WITH(qstat_command,
@@ -1519,21 +1508,47 @@ then
1519fi 1508fi
1520 1509
1521AC_PATH_PROG(PATH_TO_FPING,fping) 1510AC_PATH_PROG(PATH_TO_FPING,fping)
1522AC_PATH_PROG(PATH_TO_FPING6,fping6)
1523 1511
1524AC_ARG_WITH(fping_command, 1512AC_ARG_WITH(fping_command,
1525 ACX_HELP_STRING([--with-fping-command=PATH], 1513 ACX_HELP_STRING([--with-fping-command=PATH],
1526 [Path to fping command]), PATH_TO_FPING=$withval) 1514 [Path to fping command]), PATH_TO_FPING=$withval)
1527AC_ARG_WITH(fping6_command, 1515if test -n "$PATH_TO_FPING"; then
1528 ACX_HELP_STRING([--with-fping6-command=PATH],
1529 [Path to fping6 command]), PATH_TO_FPING6=$withval)
1530
1531if test -n "$PATH_TO_FPING"
1532then
1533 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) 1516 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1534 EXTRAS="$EXTRAS check_fping\$(EXEEXT)" 1517 EXTRAS="$EXTRAS check_fping\$(EXEEXT)"
1535 if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then 1518
1536 AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6]) 1519 if test -z "$($PATH_TO_FPING --version)" ; then
1520 AC_MSG_NOTICE([failed to get version of fping])
1521 else
1522 FPING_MAJOR_VERSION="$($PATH_TO_FPING --version | sed 's/.*fping: Version //' | sed 's/\..*//')"
1523 FPING_MINOR_VERSION="$($PATH_TO_FPING --version | sed 's/.*fping: Version //' | sed 's/.*\.//')"
1524
1525 if test $FPING_MAJOR_VERSION -eq 5 ; then
1526 if test $FPING_MINOR_VERSION -ge 3 ; then
1527 AC_DEFINE(FPING_VERSION_5_3_OR_HIGHER, "true", [fping is of version 5.3 or higher])
1528 AC_MSG_NOTICE([fping is of version 5.3 or higher])
1529 AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher])
1530 AC_MSG_NOTICE([fping is of version 5.2 or higher])
1531 elif test $FPING_MINOR_VERSION -ge 2 ; then
1532 AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher])
1533 AC_MSG_NOTICE([fping is of version 5.2 or higher])
1534 else
1535 AC_MSG_NOTICE([fping is of a version lower then 5.2])
1536 fi
1537
1538 elif $FPING_MAJOR_VERSION > 5 ; then
1539 AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher])
1540 AC_MSG_NOTICE([fping is of version 5.2 or higher])
1541 AC_DEFINE(FPING_VERSION_5_3_OR_HIGHER, "true", [fping is of version 5.2 or higher])
1542 AC_MSG_NOTICE([fping is of version 5.3 or higher])
1543 fi
1544
1545 if test "`fping --version | sed 's/.*fping: Version //'`" = "5.2" ; then
1546 AC_DEFINE(FPING_VERSION, "5.2", [the version of fping available])
1547 AC_MSG_NOTICE([fping version: 5.2])
1548 elif test "`fping --version | sed 's/.*fping: Version //'`" = "5.3"; then
1549 AC_DEFINE(FPING_VERSION, "5.3", [the version of fping available])
1550 AC_MSG_NOTICE([fping version: 5.3])
1551 fi
1537 fi 1552 fi
1538else 1553else
1539 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) 1554 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
@@ -1807,11 +1822,6 @@ if test -n "$PATH_TO_APTGET" ; then
1807fi 1822fi
1808 1823
1809 1824
1810if test -f $srcdir/plugins/check_nt.c ; then
1811 EXTRAS="$EXTRAS check_nt\$(EXEEXT)"
1812fi
1813
1814
1815dnl used in check_dhcp 1825dnl used in check_dhcp
1816AC_CHECK_HEADERS(sys/sockio.h) 1826AC_CHECK_HEADERS(sys/sockio.h)
1817 1827