]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
meson: DoH, DoH3, DoQ and DoT are now features, not options
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Mar 2025 14:04:37 +0000 (15:04 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 25 Mar 2025 09:08:19 +0000 (10:08 +0100)
14 files changed:
Dockerfile-dnsdist
builder-support/debian/dnsdist/debian-bookworm/rules
builder-support/debian/dnsdist/debian-bullseye/rules
builder-support/specs/dnsdist.spec
meson/dot/meson.build
meson_options.txt
pdns/dnsdistdist/meson.build
pdns/dnsdistdist/meson/doh2/meson.build
pdns/dnsdistdist/meson/doh3/meson.build
pdns/dnsdistdist/meson/doq/meson.build
pdns/dnsdistdist/meson/quiche/meson.build
pdns/dnsdistdist/meson_options.txt
pdns/recursordist/meson_options.txt
tasks.py

index cc310f00ff4bcfce982ddd6152b808c356e43002..be6641fdabd630e60da30261bd80be670d4e9620 100644 (file)
@@ -65,10 +65,10 @@ RUN mkdir /build && \
       -Db_lto=true \
       -Db_lto_mode=thin \
       -Db_pie=true \
-      -Ddns-over-https=true \
-      -Ddns-over-quic=true \
-      -Ddns-over-http3=true \
-      -Ddns-over-tls=true \
+      -Ddns-over-https=enabled \
+      -Ddns-over-quic=enabled \
+      -Ddns-over-http3=enabled \
+      -Ddns-over-tls=enabled \
       -Ddnscrypt=enabled \
       -Ddnstap=enabled \
       -Dyaml=enabled \
index adc24b0fa8c4c676db5ae8078622ae010cdfb6b9..5238445ca42bac623d1bdefc2f4c48a495969231 100755 (executable)
@@ -53,10 +53,10 @@ override_dh_auto_configure:
          -Db_lto=true \
          -Db_lto_mode=thin \
          -Db_pie=true \
-         -Ddns-over-https=true \
-         -Ddns-over-quic=true \
-         -Ddns-over-http3=true \
-         -Ddns-over-tls=true \
+         -Ddns-over-https=enabled \
+         -Ddns-over-quic=enabled \
+         -Ddns-over-http3=enabled \
+         -Ddns-over-tls=enabled \
          -Ddnscrypt=enabled \
          -Ddnstap=enabled \
          -Dyaml=enabled \
index 80dd7902455a43556c17f2d12d6316df20bb813c..f67c354f4e462a93934593426783e648e74f4ee1 100755 (executable)
@@ -46,10 +46,10 @@ override_dh_auto_configure:
          -Db_lto=true \
          -Db_lto_mode=thin \
          -Db_pie=true \
-         -Ddns-over-https=true \
-         -Ddns-over-quic=true \
-         -Ddns-over-http3=true \
-         -Ddns-over-tls=true \
+         -Ddns-over-https=enabled \
+         -Ddns-over-quic=enabled \
+         -Ddns-over-http3=enabled \
+         -Ddns-over-tls=enabled \
          -Ddnscrypt=enabled \
          -Ddnstap=enabled \
          -Dyaml=enabled \
index 3c41562c8bcd457ead3b9174af57efc6a678ee94..056d3b733d2362c142df016094f362b7f94844e4 100644 (file)
@@ -98,7 +98,7 @@ export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/lib64/pkgconfig
   -Db_lto=true \
   -Db_lto_mode=thin \
   -Db_pie=true \
-  -Ddns-over-tls=true \
+  -Ddns-over-tls=enabled \
 %if 0%{?suse_version}
   -Ddnscrypt=disabled \
   -Dsnmp=disabled \
@@ -107,13 +107,13 @@ export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/lib64/pkgconfig
   -Dsnmp=enabled \
 %endif
   -Ddnstap=enabled \
-  -Ddns-over-https=true \
+  -Ddns-over-https=enabled \
   -Dtls-gnutls=enabled \
   -Dlibcap=enabled \
   -Dlua=%{lua_implementation} \
   -Dre2=enabled \
-  -Ddns-over-quic=true \
-  -Ddns-over-http3=true \
+  -Ddns-over-quic=enabled \
+  -Ddns-over-http3=enabled \
 %ifarch aarch64
   -Dxsk=disabled \
 %endif
index e1166a181495c7f31639beade4705839c2746b35..91f95515b194cf1d70e015d84d51c0ecc461ef99 100644 (file)
@@ -1,8 +1,12 @@
 opt_dot = get_option('dns-over-tls')
-conf.set('HAVE_DNS_OVER_TLS', opt_dot, description: 'DNS over TLS (DoT)')
 
-if opt_dot and not dep_libssl.found() and not dep_gnutls.found()
+if opt_dot.enabled() and not dep_libssl.found() and not dep_gnutls.found()
   error('DNS over TLS support was requested but neither OpenSSL libssl nor GnuTLS support is enabled')
 endif
 
-summary('DNS over TLS', opt_dot, bool_yn: true, section: 'Configuration')
+if opt_dot.allowed() and (dep_libssl.found() or dep_gnutls.found())
+  conf.set('HAVE_DNS_OVER_TLS', true, description: 'DNS over TLS (DoT)')
+  summary('DNS over TLS', true, bool_yn: true, section: 'Configuration')
+else
+  summary('DNS over TLS', false, bool_yn: true, section: 'Configuration')
+endif
index 930da3fcb792b49520dca3ce9332d569521ecb32..cf19f6a1881e2fa680771d96436616288833f0ae 100644 (file)
@@ -9,7 +9,7 @@ option('signers-libcrypto', type: 'feature', value: 'auto', description: 'Enable
 option('signers-libcrypto-path', type: 'string', value: '', description: 'Custom path to find OpenSSL libcrypto')
 option('tls-libssl', type: 'feature', value: 'auto', description: 'OpenSSL-based TLS')
 option('tls-gnutls', type: 'feature', value: 'auto', description: 'GnuTLS-based TLS')
-option('dns-over-tls', type: 'boolean', value: false, description: 'DNS over TLS (requires GnuTLS or OpenSSL)')
+option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires GnuTLS or OpenSSL)')
 option('ipcipher', type: 'feature', value: 'auto', description: 'IPcipher (requires libcrypto)')
 option('unit-tests', type: 'boolean', value: false, description: 'Build and run unit tests')
 option('unit-tests-backends', type: 'boolean', value: false, description: 'Build and run backend unit tests')
index 3e2ae9402032d1ebffaa68e7f35635fe3e59a2a2..1db616bcd66eb8124f2c1d256c65b50baf7b5cc1 100644 (file)
@@ -232,7 +232,7 @@ conditional_sources = {
     'sources': [
       src_dir / 'doq.cc',
     ],
-    'condition': get_option('dns-over-quic'),
+    'condition': get_option('dns-over-quic').allowed() and dep_libquiche.found(),
    },
   'ipcipher': {
     'sources': [
index b74d835c7f0184ca2071d51dda6589acf0f7c496..c09d0e42b3d19eda4d33b9d3cf6ae841e7feebaa 100644 (file)
@@ -1,7 +1,6 @@
 opt_doh2 = get_option('dns-over-https')
-conf.set('HAVE_DNS_OVER_HTTPS', opt_doh2, description: 'DNS over HTTP/2 (DoH)')
 
-if opt_doh2
+if opt_doh2.enabled()
   if not dep_libssl.found() and not dep_gnutls.found()
     error('DNS over HTTP/2 support was requested but neither OpenSSL libssl nor GnuTLS support is enabled')
   endif
@@ -10,4 +9,9 @@ if opt_doh2
   endif
 endif
 
-summary('DNS over HTTP/2', opt_doh2, bool_yn: true, section: 'Configuration')
+if opt_doh2.allowed() and (dep_libssl.found() or dep_gnutls.found()) and (dep_libnghttp2.found() or dep_libh2o_evloop.found())
+  conf.set('HAVE_DNS_OVER_HTTPS', true, description: 'DNS over HTTP/2 (DoH)')
+  summary('DNS over HTTP/2', true, bool_yn: true, section: 'Configuration')
+else
+  summary('DNS over HTTP/2', false, bool_yn: true, section: 'Configuration')
+endif
index e2cb1f137b4e4b60069715bec29f10551ec1adae..052dd138d4f663d462a41c9dea0dd8df12be7f8e 100644 (file)
@@ -1,10 +1,14 @@
 opt_doh3 = get_option('dns-over-http3')
-conf.set('HAVE_DNS_OVER_HTTP3', opt_doh3, description: 'DNS over HTTP/3 (DoH3)')
 
-if opt_doh3
+if opt_doh3.enabled()
   if not dep_libquiche.found()
     error('DNS over HTTP/3 support was requested but Quiche support is not enabled')
   endif
 endif
 
-summary('DNS over HTTP/3', opt_doh3, bool_yn: true, section: 'Configuration')
+if opt_doh3.allowed() and dep_libquiche.found()
+  conf.set('HAVE_DNS_OVER_HTTP3', true, description: 'DNS over HTTP/3 (DoH3)')
+  summary('DNS over HTTP/3', true, bool_yn: true, section: 'Configuration')
+else
+  summary('DNS over HTTP/3', false, bool_yn: true, section: 'Configuration')
+endif
index 9924f9bbf2d0d475ccaae7f5e7f35446ed9899c1..06fc522ad4892d5654e09ac70b0c75bb3d0d9306 100644 (file)
@@ -1,10 +1,14 @@
 opt_doq = get_option('dns-over-quic')
-conf.set('HAVE_DNS_OVER_QUIC', opt_doq, description: 'DNS over QUIC (DoQ)')
 
-if opt_doq
+if opt_doq.enabled()
   if not dep_libquiche.found()
     error('DNS over QUIC support was requested but Quiche support is not enabled')
   endif
 endif
 
-summary('DNS over QUIC', opt_doq, bool_yn: true, section: 'Configuration')
+if opt_doq.allowed() and dep_libquiche.found()
+  conf.set('HAVE_DNS_OVER_QUIC', true, description: 'DNS over QUIC (DoQ)')
+  summary('DNS over QUIC', true, bool_yn: true, section: 'Configuration')
+else
+  summary('DNS over QUIC', false, bool_yn: true, section: 'Configuration')
+endif
index 31980cf6b9fbe1bb74a3322fb23b26804287d444..70ea7ecfcd29c33ff6bd7d16b999a4126b4b8c26 100644 (file)
@@ -1,9 +1,8 @@
-dep_libquiche = dependency('', required: false)
 opt_libquiche = get_option('quiche')
 opt_quic = get_option('dns-over-quic')
 opt_doh3 = get_option('dns-over-http3')
 
-if (opt_quic or opt_doh3) and opt_libquiche.allowed()
+if (opt_quic.allowed() or opt_doh3.allowed()) and opt_libquiche.allowed()
   dep_libquiche = dependency('quiche', version: '>= 0.23.0', required: false)
   if dep_libquiche.found()
     conf.set('HAVE_QUICHE_H3_EVENT_HEADERS_HAS_MORE_FRAMES', dep_libquiche.found(), description: 'if the Quiche API has quiche_h3_event_headers_has_more_frames instead of quiche_h3_event_headers_has_body')
@@ -14,8 +13,10 @@ if (opt_quic or opt_doh3) and opt_libquiche.allowed()
   if dep_libquiche.found()
     conf.set('HAVE_QUICHE_STREAM_ERROR_CODES', dep_libquiche.found(), description: 'if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send')
   else
-    dep_libquiche = dependency('quiche', version: '>= 0.15.0', required: opt_libquiche or opt_quic or opt_doh3)
+    dep_libquiche = dependency('quiche', version: '>= 0.15.0', required: opt_libquiche.enabled() or opt_quic.enabled() or opt_doh3.enabled())
   endif
+else
+  dep_libquiche = dependency('', required: false)
 endif
 
 conf.set('HAVE_QUICHE', dep_libquiche.found(), description: 'quiche')
index 0eba4b4879f4482f2e61787d88027c9ce03cadfb..f5b35835a3aca55e38add86c5380719318c5ff36 100644 (file)
@@ -13,10 +13,10 @@ option('hardening-fortify-source', type: 'combo', choices: ['auto', 'disabled',
 option('ipcipher', type: 'feature', value: 'auto', description: 'IPCipher')
 option('tls-libssl', type: 'feature', value: 'auto', description: 'OpenSSL-based TLS')
 option('tls-libssl-providers', type: 'boolean', value: false, description: 'OpenSSL-based TLS with TLS providers')
-option('dns-over-tls', type: 'boolean', value: false, description: 'DNS over TLS (requires GnuTLS or OpenSSL)')
-option('dns-over-https', type: 'boolean', value: false, description: 'DNS over HTTP/2 (requires GnuTLS or OpenSSL)')
-option('dns-over-http3', type: 'boolean', value: false, description: 'Enable DNS over HTTP/3')
-option('dns-over-quic', type: 'boolean', value: false, description: 'Enable DNS over QUIC')
+option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires GnuTLS or OpenSSL)')
+option('dns-over-https', type: 'feature', value: 'auto', description: 'DNS over HTTP/2 (requires GnuTLS or OpenSSL)')
+option('dns-over-http3', type: 'feature', value: 'auto', description: 'Enable DNS over HTTP/3')
+option('dns-over-quic', type: 'feature', value: 'auto', description: 'Enable DNS over QUIC')
 option('unit-tests', type: 'boolean', value: false, description: 'Build and run unit tests')
 option('reproducible', type: 'boolean', value: false, description: 'Reproducible builds (for distro maintainers, makes debugging difficult)')
 option('systemd-service', type: 'feature', value: 'auto', description: 'Systemd integration (requires libsystemd)')
index 00a72cff1fb7e45a62c43d3ba089dfb55ca4d5d8..75460b80d5d2bc67106c724f6e5863984000c385 100644 (file)
@@ -8,7 +8,7 @@ option('signers-libsodium', type: 'feature', value: 'auto', description: 'Enable
 option('signers-libcrypto', type: 'feature', value: 'auto', description: 'Enable OpenSSL libcrypto-based signers)')
 option('signers-libcrypto-path', type: 'string', value: '', description: 'Custom path to find OpenSSL libcrypto')
 option('tls-libssl', type: 'feature', value: 'auto', description: 'OpenSSL-based TLS')
-option('dns-over-tls', type: 'boolean', value: false, description: 'DNS over TLS (requires GnuTLS or OpenSSL)')
+option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires GnuTLS or OpenSSL)')
 option('unit-tests', type: 'boolean', value: false, description: 'Build and run unit tests')
 # not relevant for rec, but accessed by boost meson.build
 option('unit-tests-backends', type: 'boolean', value: false, description: 'Build and run backend unit tests')
index 54f65ab99ede612c7296ff9a77b96b2182f8e5ae..5382115724ef4176600743cf7301c96e5da6e05b 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -562,7 +562,7 @@ def ci_auth_configure_meson(c, build_dir):
         "-D module-remote-zeromq=true",
         "-D module-tinydns=static",
         "-D tools=true",
-        "-D dns-over-tls=true",
+        "-D dns-over-tls=enabled",
         "-D experimental-pkcs11=enabled",
         "-D experimental-gss-tsig=enabled",
         "-D prefix=/opt/pdns-auth",
@@ -593,7 +593,7 @@ def ci_rec_configure_meson(c, features, build_dir):
             "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
             get_base_configure_cmd_meson(build_dir),
             "-D prefix=/opt/pdns-recursor",
-            "-D dns-over-tls=true",
+            "-D dns-over-tls=enabled",
             "-D nod=true",
             "-D libcap=enabled",
             "-D lua=luajit",
@@ -605,7 +605,7 @@ def ci_rec_configure_meson(c, features, build_dir):
             "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
             get_base_configure_cmd_meson(build_dir),
             "-D prefix=/opt/pdns-recursor",
-            "-D dns-over-tls=false",
+            "-D dns-over-tls=disabled",
             "-D dnstap=disabled",
             "-D nod=false",
             "-D systemd-service=disabled",
@@ -783,10 +783,10 @@ def ci_dnsdist_configure_meson(features, additional_flags, additional_ld_flags,
                       -D re2=enabled \
                       -D systemd-service=enabled \
                       -D tls-gnutls=enabled \
-                      -D dns-over-https=true \
-                      -D dns-over-http3=true \
-                      -D dns-over-quic=true \
-                      -D dns-over-tls=true \
+                      -D dns-over-https=enabled \
+                      -D dns-over-http3=enabled \
+                      -D dns-over-quic=enabled \
+                      -D dns-over-tls=enabled \
                       -D reproducible=true \
                       -D snmp=enabled'
     else:
@@ -803,10 +803,10 @@ def ci_dnsdist_configure_meson(features, additional_flags, additional_ld_flags,
                       -D re2=disabled \
                       -D systemd-service=disabled \
                       -D tls-gnutls=disabled \
-                      -D dns-over-https=false \
-                      -D dns-over-http3=false \
-                      -D dns-over-quic=false \
-                      -D dns-over-tls=false \
+                      -D dns-over-https=disabled \
+                      -D dns-over-http3=disabled \
+                      -D dns-over-quic=disabled \
+                      -D dns-over-tls=disabled \
                       -D reproducible=false \
                       -D snmp=disabled'
     unittests = get_unit_tests(meson=True)