summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac95
1 files changed, 68 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac
index bd3de196..abd90413 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
@@ -796,7 +810,7 @@ elif ps axwo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
796then 810then
797 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]"
798 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'"
799 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"
800 ac_cv_ps_cols=10 814 ac_cv_ps_cols=10
801 AC_MSG_RESULT([$ac_cv_ps_command]) 815 AC_MSG_RESULT([$ac_cv_ps_command])
802 816
@@ -1470,17 +1484,6 @@ AC_ARG_WITH(snmpgetnext_command,
1470AS_IF([test -n "$PATH_TO_SNMPGET"], [ 1484AS_IF([test -n "$PATH_TO_SNMPGET"], [
1471 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary]) 1485 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1472 EXTRAS="$EXTRAS check_hpjd" 1486 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], [ 1487], [
1485 AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to build the check_hpjd and check_snmp plugins]) 1488 AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to build the check_hpjd and check_snmp plugins])
1486]) 1489])
@@ -1493,6 +1496,16 @@ else
1493 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])
1494fi 1497fi
1495 1498
1499dnl Check whether DES encryption is available (might not on RHEL)
1500AC_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
1496AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) 1509AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1497AC_PATH_PROG(PATH_TO_QSTAT,qstat) 1510AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1498AC_ARG_WITH(qstat_command, 1511AC_ARG_WITH(qstat_command,
@@ -1519,15 +1532,48 @@ then
1519fi 1532fi
1520 1533
1521AC_PATH_PROG(PATH_TO_FPING,fping) 1534AC_PATH_PROG(PATH_TO_FPING,fping)
1522AC_PATH_PROG(PATH_TO_FPING6,fping6)
1523 1535
1524AC_ARG_WITH(fping_command, 1536AC_ARG_WITH(fping_command,
1525 ACX_HELP_STRING([--with-fping-command=PATH], 1537 ACX_HELP_STRING([--with-fping-command=PATH],
1526 [Path to fping command]), PATH_TO_FPING=$withval) 1538 [Path to fping command]), PATH_TO_FPING=$withval)
1527if test -n "$PATH_TO_FPING" 1539if test -n "$PATH_TO_FPING"; then
1528then
1529 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])
1530 EXTRAS="$EXTRAS check_fping\$(EXEEXT)" 1541 EXTRAS="$EXTRAS check_fping\$(EXEEXT)"
1542
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
1576 fi
1531else 1577else
1532 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])
1533fi 1579fi
@@ -1800,11 +1846,6 @@ if test -n "$PATH_TO_APTGET" ; then
1800fi 1846fi
1801 1847
1802 1848
1803if test -f $srcdir/plugins/check_nt.c ; then
1804 EXTRAS="$EXTRAS check_nt\$(EXEEXT)"
1805fi
1806
1807
1808dnl used in check_dhcp 1849dnl used in check_dhcp
1809AC_CHECK_HEADERS(sys/sockio.h) 1850AC_CHECK_HEADERS(sys/sockio.h)
1810 1851