I did this
m4/curl-mbedtls.m4 first looks for mbedtls_havege_init on the default search path and if that fails tries mbedtls_ssl_init after setting search paths. However, mbedtls_havege_init was removed in the 3.0 release five years ago, so this will never realistically be found.
This was discovered as this results in the default search paths being added to curl-config and libcurl.pc, when they shouldn't be there.
Swapping mbedtls_havege_init for mbedtls_ssl_init fixes the detection and ensures that default paths don't end up in generated files.
Side-note: the logic here is a bit of a mess. If you don't specify a path for mbedtls it tries the default search path and if that fails (which it does currently, as above) it uses the unset path as a prefix so searches /lib. In native compiles where /lib and /usr/lib are the same, this will actually pass. In cross-compile builds this is now pulling host paths into a cross build which is very bad.
I expect simply replacing most of this file with pkgconfig checks would solve many problems.
I expected the following
No response
curl/libcurl version
curl 8.19
operating system
Linux
I did this
m4/curl-mbedtls.m4first looks formbedtls_havege_initon the default search path and if that fails triesmbedtls_ssl_initafter setting search paths. However,mbedtls_havege_initwas removed in the 3.0 release five years ago, so this will never realistically be found.This was discovered as this results in the default search paths being added to curl-config and libcurl.pc, when they shouldn't be there.
Swapping
mbedtls_havege_initformbedtls_ssl_initfixes the detection and ensures that default paths don't end up in generated files.Side-note: the logic here is a bit of a mess. If you don't specify a path for mbedtls it tries the default search path and if that fails (which it does currently, as above) it uses the unset path as a prefix so searches
/lib. In native compiles where /lib and /usr/lib are the same, this will actually pass. In cross-compile builds this is now pulling host paths into a cross build which is very bad.I expect simply replacing most of this file with pkgconfig checks would solve many problems.
I expected the following
No response
curl/libcurl version
curl 8.19
operating system
Linux