--- /dev/null
+# The files in here get synced from
+# https://gitlab.nic.cz/knot/knot-dns/-/tree/master/src/contrib/libngtcp2
+# except for this ./meson.build itself.
+
+libembngtcp2_src = files([
+ 'ngtcp2/crypto/gnutls.c',
+ 'ngtcp2/crypto/shared.c',
+ 'ngtcp2/lib/ngtcp2_acktr.c',
+ 'ngtcp2/lib/ngtcp2_addr.c',
+ 'ngtcp2/lib/ngtcp2_balloc.c',
+ 'ngtcp2/lib/ngtcp2_bbr.c',
+ 'ngtcp2/lib/ngtcp2_buf.c',
+ 'ngtcp2/lib/ngtcp2_cc.c',
+ 'ngtcp2/lib/ngtcp2_cid.c',
+ 'ngtcp2/lib/ngtcp2_conn.c',
+ 'ngtcp2/lib/ngtcp2_conn_info.c',
+ 'ngtcp2/lib/ngtcp2_conv.c',
+ 'ngtcp2/lib/ngtcp2_crypto.c',
+ 'ngtcp2/lib/ngtcp2_err.c',
+ 'ngtcp2/lib/ngtcp2_frame_chain.c',
+ 'ngtcp2/lib/ngtcp2_gaptr.c',
+ 'ngtcp2/lib/ngtcp2_idtr.c',
+ 'ngtcp2/lib/ngtcp2_ksl.c',
+ 'ngtcp2/lib/ngtcp2_log.c',
+ 'ngtcp2/lib/ngtcp2_map.c',
+ 'ngtcp2/lib/ngtcp2_mem.c',
+ 'ngtcp2/lib/ngtcp2_objalloc.c',
+ 'ngtcp2/lib/ngtcp2_opl.c',
+ 'ngtcp2/lib/ngtcp2_path.c',
+ 'ngtcp2/lib/ngtcp2_pcg.c',
+ 'ngtcp2/lib/ngtcp2_pkt.c',
+ 'ngtcp2/lib/ngtcp2_pmtud.c',
+ 'ngtcp2/lib/ngtcp2_ppe.c',
+ 'ngtcp2/lib/ngtcp2_pq.c',
+ 'ngtcp2/lib/ngtcp2_pv.c',
+ 'ngtcp2/lib/ngtcp2_qlog.c',
+ 'ngtcp2/lib/ngtcp2_range.c',
+ 'ngtcp2/lib/ngtcp2_ratelim.c',
+ 'ngtcp2/lib/ngtcp2_ringbuf.c',
+ 'ngtcp2/lib/ngtcp2_rob.c',
+ 'ngtcp2/lib/ngtcp2_rst.c',
+ 'ngtcp2/lib/ngtcp2_rtb.c',
+ 'ngtcp2/lib/ngtcp2_settings.c',
+ 'ngtcp2/lib/ngtcp2_str.c',
+ 'ngtcp2/lib/ngtcp2_strm.c',
+ 'ngtcp2/lib/ngtcp2_transport_params.c',
+ 'ngtcp2/lib/ngtcp2_unreachable.c',
+ 'ngtcp2/lib/ngtcp2_vec.c',
+ 'ngtcp2/lib/ngtcp2_version.c',
+ 'ngtcp2/lib/ngtcp2_window_filter.c',
+ 'ngtcp2/lib/ngtcp2_dcidtr.c',
+ 'ngtcp2/lib/ngtcp2_callbacks.c',
+])
+
+libembngtcp2_headers = files([
+ 'ngtcp2/crypto/shared.h',
+ 'ngtcp2/lib/ngtcp2_acktr.h',
+ 'ngtcp2/lib/ngtcp2_addr.h',
+ 'ngtcp2/lib/ngtcp2_balloc.h',
+ 'ngtcp2/lib/ngtcp2_bbr.h',
+ 'ngtcp2/lib/ngtcp2_buf.h',
+ 'ngtcp2/lib/ngtcp2_cc.h',
+ 'ngtcp2/lib/ngtcp2_cid.h',
+ 'ngtcp2/lib/ngtcp2_conn.h',
+ 'ngtcp2/lib/ngtcp2_conn_info.h',
+ 'ngtcp2/lib/ngtcp2_conn_stat.h',
+ 'ngtcp2/lib/ngtcp2_conv.h',
+ 'ngtcp2/lib/ngtcp2_crypto.h',
+ 'ngtcp2/lib/ngtcp2_err.h',
+ 'ngtcp2/lib/ngtcp2_frame_chain.h',
+ 'ngtcp2/lib/ngtcp2_gaptr.h',
+ 'ngtcp2/lib/ngtcp2_idtr.h',
+ 'ngtcp2/lib/ngtcp2_ksl.h',
+ 'ngtcp2/lib/ngtcp2_log.h',
+ 'ngtcp2/lib/ngtcp2_macro.h',
+ 'ngtcp2/lib/ngtcp2_map.h',
+ 'ngtcp2/lib/ngtcp2_mem.h',
+ 'ngtcp2/lib/ngtcp2_net.h',
+ 'ngtcp2/lib/ngtcp2_objalloc.h',
+ 'ngtcp2/lib/ngtcp2_opl.h',
+ 'ngtcp2/lib/ngtcp2_path.h',
+ 'ngtcp2/lib/ngtcp2_pcg.h',
+ 'ngtcp2/lib/ngtcp2_pkt.h',
+ 'ngtcp2/lib/ngtcp2_pktns_id.h',
+ 'ngtcp2/lib/ngtcp2_pmtud.h',
+ 'ngtcp2/lib/ngtcp2_ppe.h',
+ 'ngtcp2/lib/ngtcp2_pq.h',
+ 'ngtcp2/lib/ngtcp2_pv.h',
+ 'ngtcp2/lib/ngtcp2_qlog.h',
+ 'ngtcp2/lib/ngtcp2_range.h',
+ 'ngtcp2/lib/ngtcp2_ratelim.h',
+ 'ngtcp2/lib/ngtcp2_rcvry.h',
+ 'ngtcp2/lib/ngtcp2_ringbuf.h',
+ 'ngtcp2/lib/ngtcp2_rob.h',
+ 'ngtcp2/lib/ngtcp2_rst.h',
+ 'ngtcp2/lib/ngtcp2_rtb.h',
+ 'ngtcp2/lib/ngtcp2_settings.h',
+ 'ngtcp2/lib/ngtcp2_str.h',
+ 'ngtcp2/lib/ngtcp2_strm.h',
+ 'ngtcp2/lib/ngtcp2_transport_params.h',
+ 'ngtcp2/lib/ngtcp2_tstamp.h',
+ 'ngtcp2/lib/ngtcp2_unreachable.h',
+ 'ngtcp2/lib/ngtcp2_vec.h',
+ 'ngtcp2/lib/ngtcp2_window_filter.h',
+ 'ngtcp2/lib/ngtcp2_dcidtr.h',
+ 'ngtcp2/lib/ngtcp2_callbacks.h',
+ 'ngtcp2/ngtcp2.h',
+ 'ngtcp2/ngtcp2_crypto.h',
+ 'ngtcp2/ngtcp2_crypto_gnutls.h',
+ 'ngtcp2/version.h',
+])
+
+libembngtcp2_lib = static_library(
+ 'embngtcp2',
+ libembngtcp2_src,
+ include_directories: include_directories('./ngtcp2/lib'),
+)
+
+libngtcp2_deps = [declare_dependency(
+ link_with: [libembngtcp2_lib],
+ include_directories: include_directories('.'),
+)]
nghttp2 = dependency('libnghttp2', required: false)
openssl = dependency('openssl', required: false)
-libngtcp2 = dependency('libngtcp2', version: '>=1.11.0', required: get_option('quic') == 'external')
-libngtcp2_crypto = dependency('libngtcp2_crypto_gnutls', required: get_option('quic') == 'external')
-enable_quic = libngtcp2.found() and libngtcp2_crypto.found()
-if enable_quic
- libngtcp2_deps = [libngtcp2, libngtcp2_crypto]
+embed_ngtcp2 = false
+if get_option('quic') == 'disabled'
+ quic_sumstr = 'disabled explicitly'
+ enable_quic = false
+ libngtcp2_deps = []
+else
+ libngtcp2 = dependency('libngtcp2', version: '>=1.11.0', required: get_option('quic') == 'external')
+ libngtcp2_crypto = dependency('libngtcp2_crypto_gnutls', required: get_option('quic') == 'external')
+ if libngtcp2.found() and libngtcp2_crypto.found()
+ quic_sumstr = 'with external libngtcp2*'
+ enable_quic = true
+ libngtcp2_deps = [libngtcp2, libngtcp2_crypto]
+ elif gnutls.version() >= '3.7.5' # https://github.com/ngtcp2/ngtcp2?tab=readme-ov-file#requirements
+ quic_sumstr = 'with embedded libngtcp2*'
+ enable_quic = true
+ embed_ngtcp2 = true
+ #libngtcp2_deps gets set later, as it's not possible at this point yet
+ elif get_option('quic') == 'auto'
+ quic_sumstr = 'disabled because missing dependencies'
+ enable_quic = false
+ libngtcp2_deps = []
+ else
+ error('failed to satisfy -Dquic=embedded')
+ endif
endif
-quic_summary = [enable_quic, 'with external libngtcp2*']
have_asprintf = meson.get_compiler('c').has_function('asprintf',
prefix: '#define _GNU_SOURCE\n#include <stdio.h>')
summary({'sendmmsg': sendmmsg,
'XDP (in libknot)': xdp,
'doh2 (serving)': nghttp2.found(),
- 'DoQ': quic_summary,
+ 'DoQ': [enable_quic, quic_sumstr],
'capabilities': capng.found(),
'malloc': malloc.found() ? malloc_name : 'libc default',
}, section: 'Features', bool_yn: true)