0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-19 19:42:30 +02:00

configure: Try to use pkg-config to detect mbedTLS

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 <frank@lichtenheld.com>
Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com>
Message-Id: <20240906160510.76387-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29090.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
Frank Lichtenheld 2024-09-06 18:05:10 +02:00 committed by Gert Doering
parent 4788aaba07
commit c829f57096

View File

@ -1000,7 +1000,13 @@ elif test "${with_crypto_library}" = "mbedtls"; then
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"
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],
@ -1009,6 +1015,7 @@ elif test "${with_crypto_library}" = "mbedtls"; then
[${PKCS11_HELPER_LIBS}]
)
fi
fi
CFLAGS="${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}"
LIBS="${MBEDTLS_LIBS} ${PKCS11_HELPER_LIBS} ${LIBS}"