From: Aydın Mercan Date: Tue, 17 Feb 2026 12:43:16 +0000 (+0300) Subject: optionally use libngtcp2 only in development builds X-Git-Tag: v9.21.21~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=163892f793eebd9377b3576819d7fd69d3d4f33f;p=thirdparty%2Fbind9.git optionally use libngtcp2 only in development builds Unlike new transports with a new dependency DNS-over-QUIC support will be added incrementally due to the non-trivial amound of plumbing required by libngtcp2. This will require non-functional QUIC code in the main branch that won't be exposed for non-development builds. Therefore, libngtcp2 is linked as an optional dependency only on explicitly enabled development builds and cannot be required. This will be changed with a `doq` meson build option once the server-side functionality is complete for consumption. --- diff --git a/bin/named/main.c b/bin/named/main.c index 984c01c85aa..de12a973243 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -103,6 +103,10 @@ #include #endif +#ifdef HAVE_LIBNGTCP2 +#include +#endif /* HAVE_LIBNGTCP2 */ + /* On DragonFly BSD the header does not provide jemalloc API */ #if defined(HAVE_MALLOC_NP_H) && !defined(__DragonFly__) #include @@ -558,6 +562,11 @@ printversion(bool verbose) { nginfo = nghttp2_version(1); printf("linked to libnghttp2 version: %s\n", nginfo->version_str); #endif +#ifdef HAVE_LIBNGTCP2 + const ngtcp2_info *ngtcpinfo = ngtcp2_version(0); + printf("compiled with libngtcp2 version: %s\n", NGTCP2_VERSION); + printf("linked to libngtcp2 version: %s\n", ngtcpinfo->version_str); +#endif /* HAVE_LIBNGTCP2 */ #ifdef HAVE_LIBXML2 printf("compiled with libxml2 version: %s\n", LIBXML_DOTTED_VERSION); printf("linked to libxml2 version: %s\n", xmlParserVersion); diff --git a/meson.build b/meson.build index 60b4e4b9916..269f24636ba 100644 --- a/meson.build +++ b/meson.build @@ -798,6 +798,13 @@ if doh_opt.allowed() endif endif +## DNS-over-QUIC (DoQ) [IN PROGRESS, DEVELOPER MODE ONLY] +ngtcp2_dep = null_dep +if developer_mode + ngtcp2_dep = dependency('libngtcp2', required: false) + config.set('HAVE_LIBNGTCP2', ngtcp2_dep.found()) +endif + ## GeoIP maxminddb_dep = null_dep if geoip_opt.allowed() @@ -1655,6 +1662,7 @@ executable( json_c_dep, lmdb_dep, nghttp2_dep, + ngtcp2_dep, xml2_dep, zlib_dep,