ff6046
From b6943446f8ffde53ce059b5e869c22bed8926827 Mon Sep 17 00:00:00 2001
ff6046
From: Yu Watanabe <watanabe.yu+github@gmail.com>
ff6046
Date: Mon, 25 Jun 2018 22:40:40 +0900
ff6046
Subject: [PATCH] meson: check whether gnutls supports TCP fast open
ff6046
ff6046
Fixes #9403
ff6046
ff6046
Cherry-picked from: f02582f69fe1e7663a87ba80bd4f90d5d23ee75f
ff6046
---
ff6046
 README      | 1 +
ff6046
 meson.build | 2 +-
ff6046
 2 files changed, 2 insertions(+), 1 deletion(-)
ff6046
ff6046
diff --git a/README b/README
ff6046
index 2cde08c37e..7d06e04800 100644
ff6046
--- a/README
ff6046
+++ b/README
ff6046
@@ -154,6 +154,7 @@ REQUIREMENTS:
ff6046
         libmicrohttpd (optional)
ff6046
         libpython (optional)
ff6046
         libidn2 or libidn (optional)
ff6046
+        gnutls >= 3.1.4 (optional, >= 3.5.3 is necessary to support DNS-over-TLS)
ff6046
         elfutils >= 158 (optional)
ff6046
         polkit (optional)
ff6046
         pkg-config
ff6046
diff --git a/meson.build b/meson.build
ff6046
index ebc55872c9..d58926c981 100644
ff6046
--- a/meson.build
ff6046
+++ b/meson.build
ff6046
@@ -1148,7 +1148,7 @@ substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
ff6046
 
ff6046
 dns_over_tls = get_option('dns-over-tls')
ff6046
 if dns_over_tls != 'false'
ff6046
-        have = conf.get('HAVE_GNUTLS') == 1
ff6046
+        have = libgnutls != [] and libgnutls.version().version_compare('>=3.5.3')
ff6046
         if dns_over_tls == 'true' and not have
ff6046
                 error('DNS-over-TLS support was requested, but dependencies are not available')
ff6046
         endif