[monitoring-plugins] configure.ac: use AS_IF in net-snmp tests
Michael Orlitzky
git at monitoring-plugins.org
Mon Feb 17 23:30:11 CET 2025
Module: monitoring-plugins
Branch: master
Commit: df03c12a2b206465046805426f7368a8de90e85c
Author: Michael Orlitzky <michael at orlitzky.com>
Date: Sat Feb 15 17:47:34 2025 -0500
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=df03c12a
configure.ac: use AS_IF in net-snmp tests
Not strictly required here, but the AS_IF macro is generally safer
because it handles (often unintentional) AC_REQUIRE calls.
---
configure.ac | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5141c652..e8ab77f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1460,23 +1460,21 @@ AC_ARG_WITH(snmpget_command,
ACX_HELP_STRING([--with-snmpget-command=PATH],
[Path to snmpget command]),
PATH_TO_SNMPGET=$withval)
-if test -n "$PATH_TO_SNMPGET"
-then
+AS_IF([test -n "$PATH_TO_SNMPGET"], [
AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
-else
+], [
AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to make check_hpjd and check_snmp plugins])
-fi
+])
AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
AC_ARG_WITH(snmpgetnext_command,
ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
[Path to snmpgetnext command]),
PATH_TO_SNMPGETNEXT=$withval)
-if test -n "$PATH_TO_SNMPGETNEXT"
-then
+AS_IF([test -n "$PATH_TO_SNMPGETNEXT"], [
AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
-fi
+])
if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
then
More information about the Commits
mailing list