Use compile-time test instead of relying on testing the cURL SSL library
at runtime. This is done to make cross-compilation possible again.
---
 meson.build | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

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 = '''#include <curl/curl.h>
   int main(int argc, char **argv) {
-    return (CURLSSLSET_OK != 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;
     }
   '''
 
-result = cc.run(
+curl_gnutls_available = cc.compiles(
     curl_ssl_check,
     name: 'cURL gnutls check',
     dependencies: curl_dep,
 )
 private_config.set('curl_gnutls', 0)
-if result.returncode() == 0
+if curl_gnutls_available
     private_config.set('curl_gnutls', 1)
 endif
 
-- 
2.51.0

Attachment: signature.asc
Description: PGP signature

Reply via email to