• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# SYNOPSIS
3#
4#   AX_CHECK_{GNUTLS|OPENSSL}_VERSION
5#
6# DESCRIPTION
7#
8#   This m4 file contains helper functions for checking the version of the
9#   respective cryptographic library version of GnuTLS, Mbed TLS or OpenSSL on
10#   the host. The variables '$gnutls_version_required',
11#   '$mbedtls_version_required' and '$openssl_version_required' hold the
12#   minimum required version and are set up externaly in configure.ac.
13#
14#   Example:
15#
16#     AX_CHECK_GNUTLS_VERSION
17#    or
18#     AX_CHECK_OPENSSL_VERSION
19#
20# LICENSE
21#
22#   Copyright (c) 2017 Carsten Schoenert <c.schoenert@t-online.de>
23#
24#   Copying and distribution of this file, with or without modification, are
25#   permitted in any medium without royalty provided the copyright notice
26#   and this notice are preserved. This file is offered as-is, without any
27#   warranty.
28
29AC_DEFUN([AX_CHECK_GNUTLS_VERSION],
30         [AC_MSG_CHECKING([for compatible GnuTLS version (>= $gnutls_version_required)])
31          AS_VERSION_COMPARE([$gnutls_version],
32                             [$gnutls_version_required],
33                             [AC_MSG_RESULT([no])
34                              GNUTLSV=""],
35                             [AC_MSG_RESULT([yes $gnutls_version])
36                              GNUTLSV="$gnutls_version"],
37                             [AC_MSG_RESULT([yes $gnutls_version])
38                              GNUTLSV="$gnutls_version"])
39          if test "x$GNUTLSV" = "x"; then
40              AC_MSG_ERROR([==> GnuTLS $gnutls_version too old. GnuTLS >= $gnutls_version_required required for suitable DTLS support build.])
41          fi
42]) dnl AX_CHECK_GNUTLS_VERSION
43
44AC_DEFUN([AX_CHECK_OPENSSL_VERSION],
45         [AC_MSG_CHECKING([for compatible OpenSSL version (>= $openssl_version_required)])
46          AS_VERSION_COMPARE([$openssl_version], [$openssl_version_required],
47                             [AC_MSG_RESULT([no])
48                              OPENSSLV=""],
49                             [AC_MSG_RESULT([yes $openssl_version])
50                              OPENSSLV="$openssl_version"],
51                             [AC_MSG_RESULT([yes $openssl_version])
52                              OPENSSLV="$openssl_version"])
53          if test "x$OPENSSLV" = "x"; then
54              AC_MSG_ERROR([==> OpenSSL $openssl_version too old. OpenSSL >= $openssl_version_required required for suitable DTLS support build.])
55          fi
56]) dnl AX_CHECK_OPENSSL_VERSION
57
58AC_DEFUN([AX_CHECK_MBEDTLS_VERSION],
59         [AC_MSG_CHECKING([for compatible Mbed TLS version (>= $mbedtls_version_required)])
60          AS_VERSION_COMPARE([$mbedtls_version], [$mbedtls_version_required],
61                             [AC_MSG_RESULT([no])
62                              MBEDTLSV=""],
63                             [AC_MSG_RESULT([yes $mbedtls_version])
64                              MBEDTLSV="$mbedtls_version"],
65                             [AC_MSG_RESULT([yes $mbedtls_version])
66                              MBEDTLSV="$mbedtls_version"])
67          if test "x$MBEDTLSV" = "x"; then
68              AC_MSG_ERROR([==> Mbed TLS $mbedtls_version too old. Mbed TLS >= $mbedtls_version_required required for suitable DTLS support build.])
69          fi
70]) dnl AX_CHECK_MBEDTLS_VERSION
71
72