Re: [PATCH 4/8] meson: convert cURL SSL library detection to compile-time test

Daniel Golle <[email protected]> Fri, 10 Oct 2025 02:28:14 +0100
Newsgroups gmane.network.gnunet.devel
Message-ID <[email protected]>
--H7oRYt/2tRtWqeYV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 10, 2025 at 02:13:30AM +0100, Daniel Golle wrote:
> Use compile-time test instead of relying on testing the cURL SSL library
> at runtime. This is done to make cross-compilation possible again.

Testing revealed that CURLSSLBACKEND_GNUTLS is always defined, even
is cURL isn't built againt gnuTLS. Hence this patch should be dropped.
For the OpenWrt cross-compilation case, libcurl-gnutls taking precendence
anyway already solves the problem.

> ---
>  meson.build | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>=20
> diff --git a/meson.build b/meson.build
> index a1afd8495..7f7856b03 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -477,17 +477,23 @@ if cc.check_header('gnutls/dane.h')
>  endif
>  curl_ssl_check =3D '''#include <curl/curl.h>
>    int main(int argc, char **argv) {
> -    return (CURLSSLSET_OK !=3D curl_global_sslset(CURLSSLBACKEND_GNUTLS,=
 NULL, NULL));
> +    #ifndef CURLSSLSET_OK
> +      #error "cURL SSL backend configuration not supported"
> +    #endif
> +    #ifndef CURLSSLBACKEND_GNUTLS
> +      #error "cURL GnuTLS backend not available"
> +    #endif
> +    return 0;
>      }
>    '''
> =20
> -result =3D cc.run(
> +curl_gnutls_available =3D cc.compiles(
>      curl_ssl_check,
>      name: 'cURL gnutls check',
>      dependencies: curl_dep,
>  )
>  private_config.set('curl_gnutls', 0)
> -if result.returncode() =3D=3D 0
> +if curl_gnutls_available
>      private_config.set('curl_gnutls', 1)
>  endif
> =20
> --=20
> 2.51.0



--H7oRYt/2tRtWqeYV
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABEIAB0WIQQ8WXOkSQLJP/KOu5qX7zeyq+FyywUCaOhhLAAKCRCX7zeyq+Fy
y2C9AP90pXIyZlegFAZEnnexksOGtUkNId46cieDEIWYcoiJ+gD+KtdpE9osRQLO
B+dV6f3VaHe8qDP1lrQ7ZClCyk4BVg8=
=cNsP
-----END PGP SIGNATURE-----

--H7oRYt/2tRtWqeYV--