]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
autotools: mbedtls detection fixes
authorViktor Szakats <commit@vsz.me>
Fri, 22 May 2026 23:05:10 +0000 (01:05 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 27 May 2026 14:57:56 +0000 (16:57 +0200)
- fix symbol used for first-round detection.
- skip detecting mbedtls on custom path if custom path was not supplied.

Reported-by: Ross Burton
Fixes #21727

Closes #21729

m4/curl-mbedtls.m4

index 7c5bccd229832cc5013d680ee32d92bb83ecf99e..6887302592d64bf0db439070a7f1e51dcb813e7d 100644 (file)
@@ -42,7 +42,7 @@ if test "x$OPT_MBEDTLS" != "xno"; then
     if test -z "$OPT_MBEDTLS"; then
       dnl check for lib first without setting any new path
 
-      AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
+      AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
       dnl libmbedtls found, set the variable
       [
         AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
@@ -58,7 +58,7 @@ if test "x$OPT_MBEDTLS" != "xno"; then
     addcflags=""
     mbedtlslib=""
 
-    if test "$USE_MBEDTLS" != "yes"; then
+    if test "$USE_MBEDTLS" != "yes" && test -n "$OPT_MBEDTLS"; then
       dnl add the path and test again
       addld=-L$OPT_MBEDTLS/lib$libsuff
       addcflags=-I$OPT_MBEDTLS/include