| Message ID | 20251208194151.17419-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers | show |
| Series | [Openvpn-devel,v1] configure: Try to use pkg-config to detect mbedTLS | expand |
This is a straightforward cherrypick from the corresponding master patch
(c829f57096cb6951aa4698eff388aeebf9310334), affects only building with
mbedtls, and improves library detection by means of pkgconf.
This is backported *now* because a few buildbot workers were reinstalled
with mbedtls3, relying on openvpn build to pick up everything via
pkgconf, and now the 2.6 builds are failing there -> fixing builds.
No actual code change.
Your patch has been applied to the release/2.6 branch.
commit 40420d43a95d4b837188f8345f3f2583e105b23f
Author: Frank Lichtenheld
Date: Mon Dec 8 20:41:46 2025 +0100
configure: Try to use pkg-config to detect mbedTLS
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>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1422
Message-Id: <20251208194151.17419-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34911.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
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}"