From: Frank Lichtenheld <[email protected]> mbedTLS does not seem to have pkg-config support on e.g. Debian/Ubuntu, so we definitely need to keep the fallback check as well.
Change-Id: I5d0da76018e874cda5dbab9202a2b817ad5e4692 Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Yuriy Darnobyt <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg29090.html Signed-off-by: Gert Doering <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1422 (cherry picked from commit c829f57096cb6951aa4698eff388aeebf9310334) --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to release/2.6. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1422 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering <[email protected]> diff --git a/configure.ac b/configure.ac index bf252c9..307329d 100644 --- a/configure.ac +++ b/configure.ac @@ -1010,14 +1010,21 @@ if test -z "${MBEDTLS_CFLAGS}" -a -z "${MBEDTLS_LIBS}"; then # if the user did not explicitly specify flags, try to autodetect - LIBS="${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto" - AC_CHECK_LIB( - [mbedtls], - [mbedtls_ssl_init], - [MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"], - [AC_MSG_ERROR([Could not find mbed TLS.])], - [${PKCS11_HELPER_LIBS}] + PKG_CHECK_MODULES([MBEDTLS], + [mbedtls >= 2.0.0 mbedx509 >= 2.0.0 mbedcrypto >= 2.0.0], + [have_mbedtls="yes"], + [LIBS="${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto"] ) + # mbedtls might not have pkgconfig integration, so try manually + if test "${have_mbedtls}" != "yes"; then + AC_CHECK_LIB( + [mbedtls], + [mbedtls_ssl_init], + [MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"], + [AC_MSG_ERROR([Could not find mbed TLS.])], + [${PKCS11_HELPER_LIBS}] + ) + fi fi CFLAGS="${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}" _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
