diff options
author | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2020-02-19 18:34:58 +0300 |
---|---|---|
committer | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2020-02-19 18:34:58 +0300 |
commit | 9987bdb2961ff23837ac9c238bfc45a8bdaeaf14 (patch) | |
tree | f0882551f0e461837250e0c4c7fa560207d7df84 /m4 | |
parent | 7061f747f0084e1cee8013a220b6a3bb8032e68c (diff) |
.......PS. [ZBXNEXT-3940] do netsnmp version checking earlier in m4
Diffstat (limited to 'm4')
-rw-r--r-- | m4/netsnmp.m4 | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4 index 94a14bb314b..3d1f48fd4cc 100644 --- a/m4/netsnmp.m4 +++ b/m4/netsnmp.m4 @@ -45,6 +45,41 @@ AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@], if test -x "$_libnetsnmp_config"; then + netsnmp_version_req=$2 + + if test -n "$netsnmp_version_req"; then + LIBNETSNMP_CONFIG_VERSION=`$_libnetsnmp_config --version` + netsnmp_version_major=`expr $LIBNETSNMP_CONFIG_VERSION : '\([[0-9]]*\)'` + netsnmp_version_minor=`expr $LIBNETSNMP_CONFIG_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` + netsnmp_version_micro=`expr $LIBNETSNMP_CONFIG_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + + if test "x$netsnmp_version_micro" = "x"; then + netsnmp_version_micro="0" + fi + + netsnmp_version_number=`expr $netsnmp_version_major \* 1000000 \ + \+ $netsnmp_version_minor \* 1000 \ + \+ $netsnmp_version_micro` + + netsnmp_version_req_major=`expr $netsnmp_version_req : '\([[0-9]]*\)'` + netsnmp_version_req_minor=`expr $netsnmp_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + netsnmp_version_req_micro=`expr $netsnmp_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + + if test "x$netsnmp_version_req_micro" = "x"; then + netsnmp_version_req_micro="0" + fi + + netsnmp_version_req_number=`expr $netsnmp_version_req_major \* 1000000 \ + \+ $netsnmp_version_req_minor \* 1000 \ + \+ $netsnmp_version_req_micro` + + netsnmp_version_check=`expr $netsnmp_version_number \>\= $netsnmp_version_req_number` + + if test "$netsnmp_version_check" != "1"; then + AC_MSG_RESULT([no]) + fi + fi + _full_libnetsnmp_cflags="`$_libnetsnmp_config --cflags`" for i in $_full_libnetsnmp_cflags; do case $i in @@ -111,43 +146,6 @@ session.localname = ""; AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) - netsnmp_version_req=$2 - - if test -n "$netsnmp_version_req"; then - LIBNETSNMP_CONFIG_VERSION=`$_libnetsnmp_config --version` - netsnmp_version_major=`expr $LIBNETSNMP_CONFIG_VERSION : '\([[0-9]]*\)'` - netsnmp_version_minor=`expr $LIBNETSNMP_CONFIG_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` - netsnmp_version_micro=`expr $LIBNETSNMP_CONFIG_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - - if test "x$netsnmp_version_micro" = "x"; then - netsnmp_version_micro="0" - fi - - netsnmp_version_number=`expr $netsnmp_version_major \* 1000000 \ - \+ $netsnmp_version_minor \* 1000 \ - \+ $netsnmp_version_micro` - - netsnmp_version_req_major=`expr $netsnmp_version_req : '\([[0-9]]*\)'` - netsnmp_version_req_minor=`expr $netsnmp_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - netsnmp_version_req_micro=`expr $netsnmp_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - - if test "x$netsnmp_version_req_micro" = "x"; then - netsnmp_version_req_micro="0" - fi - - netsnmp_version_req_number=`expr $netsnmp_version_req_major \* 1000000 \ - \+ $netsnmp_version_req_minor \* 1000 \ - \+ $netsnmp_version_req_micro` - - netsnmp_version_check=`expr $netsnmp_version_number \>\= $netsnmp_version_req_number` - - if test "$netsnmp_version_check" = "1"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - CFLAGS="$_save_netsnmp_cflags" LDFLAGS="$_save_netsnmp_ldflags" LIBS="$_save_netsnmp_libs" |