Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorMartins Abele <martins.abele@zabbix.com>2020-03-17 17:57:05 +0300
committerMartins Abele <martins.abele@zabbix.com>2020-03-17 17:57:05 +0300
commit6e07a67abb408d8690d798fbe8f905faede4647a (patch)
tree5c7a9b48f952f5170d35f6deaea6b025cb7fd8ae /m4
parent969f12ba9e6f0118d5abe57899582ebe52ea0942 (diff)
parent1a459dd18900d054aa85da62cfb922aa1f469d08 (diff)
.......PS. [ZBXNEXT-2753] resolved merge conflict
Diffstat (limited to 'm4')
-rw-r--r--m4/libmbedtls.m4148
-rw-r--r--m4/netsnmp.m438
2 files changed, 38 insertions, 148 deletions
diff --git a/m4/libmbedtls.m4 b/m4/libmbedtls.m4
deleted file mode 100644
index df70bdd2561..00000000000
--- a/m4/libmbedtls.m4
+++ /dev/null
@@ -1,148 +0,0 @@
-# mbed TLS (PolarSSL) LIBMBEDTLS_CHECK_CONFIG ([DEFAULT-ACTION])
-# ----------------------------------------------------------
-# Derived from libssh2.m4 written by
-# Alexander Vladishev Oct-26-2009
-# Dmitry Borovikov Feb-13-2010
-#
-# Checks for mbed TLS (PolarSSL) library libpolarssl. DEFAULT-ACTION is the
-# string yes or no to specify whether to default to --with-mbedtls or
-# --without-mbedtls. If not supplied, DEFAULT-ACTION is no.
-#
-# This macro #defines HAVE_POLARSSL if a required header files are
-# found, and sets @MBEDTLS_LDFLAGS@, @MBEDTLS_CFLAGS@ and @MBEDTLS_LIBS@
-# to the necessary values.
-#
-# Users may override the detected values by doing something like:
-# MBEDTLS_LIBS="-lpolarssl" MBEDTLS_CFLAGS="-I/usr/myinclude" ./configure
-#
-# This macro is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-AC_DEFUN([LIBMBEDTLS_TRY_LINK],
-[
-AC_TRY_LINK(
-[
-#include <polarssl/ssl.h>
-],
-[
- ssl_context ssl;
-
- ssl_init(&ssl);
-],
-found_mbedtls="yes",)
-])dnl
-
-AC_DEFUN([LIBMBEDTLS_ACCEPT_VERSION],
-[
- # Zabbix minimal supported version of libmbedtls:
- minimal_mbedtls_version_major=1
- minimal_mbedtls_version_minor=3
- minimal_mbedtls_version_patch=9
-
- # get version
- found_mbedtls_version_major=`cat $1 | $EGREP \#define.*POLARSSL_VERSION_MAJOR | $AWK '{print @S|@3;}'`
- found_mbedtls_version_minor=`cat $1 | $EGREP \#define.*POLARSSL_VERSION_MINOR | $AWK '{print @S|@3;}'`
- found_mbedtls_version_patch=`cat $1 | $EGREP \#define.*POLARSSL_VERSION_PATCH | $AWK '{print @S|@3;}'`
-
- if test $((found_mbedtls_version_major)) -gt $((minimal_mbedtls_version_major)); then
- accept_mbedtls_version="yes"
- elif test $((found_mbedtls_version_major)) -lt $((minimal_mbedtls_version_major)); then
- accept_mbedtls_version="no"
- elif test $((found_mbedtls_version_minor)) -gt $((minimal_mbedtls_version_minor)); then
- accept_mbedtls_version="yes"
- elif test $((found_mbedtls_version_minor)) -lt $((minimal_mbedtls_version_minor)); then
- accept_mbedtls_version="no"
- elif test $((found_mbedtls_version_patch)) -ge $((minimal_mbedtls_version_patch)); then
- accept_mbedtls_version="yes"
- else
- accept_mbedtls_version="no"
- fi;
-])dnl
-
-AC_DEFUN([LIBMBEDTLS_CHECK_CONFIG],
-[
- AC_ARG_WITH(mbedtls,[
-If you want to use encryption provided by mbed TLS (PolarSSL) library:
-AC_HELP_STRING([--with-mbedtls@<:@=DIR@:>@],[use mbed TLS (PolarSSL) package @<:@default=no@:>@, DIR is the libpolarssl install directory.])],
- [
- if test "$withval" = "no"; then
- want_mbedtls="no"
- _libmbedtls_dir="no"
- elif test "$withval" = "yes"; then
- want_mbedtls="yes"
- _libmbedtls_dir="no"
- else
- want_mbedtls="yes"
- _libmbedtls_dir=$withval
- fi
- accept_mbedtls_version="no"
- ],[want_mbedtls=ifelse([$1],,[no],[$1])]
- )
-
- if test "x$want_mbedtls" = "xyes"; then
- AC_MSG_CHECKING(for mbed TLS (PolarSSL) support)
-
- if test "x$_libmbedtls_dir" = "xno"; then
- if test -f /usr/local/include/polarssl/version.h; then
- MBEDTLS_CFLAGS=-I/usr/local/include
- MBEDTLS_LDFLAGS=-L/usr/local/lib
- MBEDTLS_LIBS="-lpolarssl"
- found_mbedtls="yes"
- LIBMBEDTLS_ACCEPT_VERSION([/usr/local/include/polarssl/version.h])
- elif test -f /usr/include/polarssl/version.h; then
- MBEDTLS_CFLAGS=-I/usr/include
- MBEDTLS_LDFLAGS=-L/usr/lib
- MBEDTLS_LIBS="-lpolarssl"
- found_mbedtls="yes"
- LIBMBEDTLS_ACCEPT_VERSION([/usr/include/polarssl/version.h])
- else # libraries are not found in default directories
- found_mbedtls="no"
- AC_MSG_RESULT(no)
- fi
- else
- if test -f $_libmbedtls_dir/include/polarssl/version.h; then
- MBEDTLS_CFLAGS=-I$_libmbedtls_dir/include
- MBEDTLS_LDFLAGS=-L$_libmbedtls_dir/lib
- MBEDTLS_LIBS="-lpolarssl"
- found_mbedtls="yes"
- LIBMBEDTLS_ACCEPT_VERSION([$_libmbedtls_dir/include/polarssl/version.h])
- else
- found_mbedtls="no"
- AC_MSG_RESULT(no)
- fi
- fi
- fi
-
- if test "x$found_mbedtls" = "xyes"; then
- am_save_cflags="$CFLAGS"
- am_save_ldflags="$LDFLAGS"
- am_save_libs="$LIBS"
-
- CFLAGS="$CFLAGS $MBEDTLS_CFLAGS"
- LDFLAGS="$LDFLAGS $MBEDTLS_LDFLAGS"
- LIBS="$LIBS $MBEDTLS_LIBS"
-
- found_mbedtls="no"
- LIBMBEDTLS_TRY_LINK([no])
-
- CFLAGS="$am_save_cflags"
- LDFLAGS="$am_save_ldflags"
- LIBS="$am_save_libs"
-
- if test "x$found_mbedtls" = "xyes"; then
- AC_DEFINE([HAVE_POLARSSL], 1, [Define to 1 if you have the 'libpolarssl' library (-lpolarssl)])
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- MBEDTLS_CFLAGS=""
- MBEDTLS_LDFLAGS=""
- MBEDTLS_LIBS=""
- fi
- fi
-
- AC_SUBST(MBEDTLS_CFLAGS)
- AC_SUBST(MBEDTLS_LDFLAGS)
- AC_SUBST(MBEDTLS_LIBS)
-
-])dnl
diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4
index 061ff4dd008..9cacf984494 100644
--- a/m4/netsnmp.m4
+++ b/m4/netsnmp.m4
@@ -45,6 +45,44 @@ AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@],
if test -x "$_libnetsnmp_config"; then
+ netsnmp_version_req=$2
+
+ if test -n "$netsnmp_version_req"; then
+ AC_MSG_CHECKING(version of netsnmp library)
+ 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_ERROR([Net-SNMP version mismatch])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ fi
+
_full_libnetsnmp_cflags="`$_libnetsnmp_config --cflags`"
for i in $_full_libnetsnmp_cflags; do
case $i in