--- /dev/null
+../../../meson/atomics
\ No newline at end of file
+++ /dev/null
-#include <cstdint>
-
-int main()
-{
- uint64_t val = 0;
- __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);
- return 0;
-}
+++ /dev/null
-dep_atomics = dependency('', required: false)
-need_latomic = false
-
-prog = fs.read('atomic_add_fetch.cc')
-if not cxx.links(prog, name: '-latomic is not needed for using __atomic builtins')
- lib_atomic = cxx.find_library('atomic', disabler: true, required: false)
- if lib_atomic.found()
- if cxx.links(prog, name: '-latomic is needed for using __atomic builtins', dependencies: lib_atomic)
- need_latomic = true
- dep_atomics = declare_dependency(dependencies: lib_atomic)
- summary('Atomics Library', lib_atomic, section: 'System')
- else
- error('libatomic is needed and was found, but linking with it failed')
- endif
- else
- error('libatomic is needed but could not be found')
- endif
-else
- dep_atomics = declare_dependency()
-endif
-
-summary('Need -latomic', need_latomic, bool_yn: true, section: 'System')
--- /dev/null
+../../../meson/auto-var-init
\ No newline at end of file
+++ /dev/null
-auto_var_init = get_option('auto-var-init')
-
-if auto_var_init != 'disabled'
- arg = '-ftrivial-auto-var-init=' + auto_var_init
- if cxx.has_argument(arg)
- add_project_arguments(arg, language: ['c', 'cpp'])
- else
- warning('Compiler does not support ' + arg + ', which is needed for automatic variable initialization')
- auto_var_init = 'unsupported by compiler'
- endif
-endif
-
-summary('Auto Var Init', auto_var_init, section: 'Configuration')
--- /dev/null
+../../../meson/boost
\ No newline at end of file
+++ /dev/null
-dep_boost = dependency('boost', version: '>= 1.54', required: true)
-# conf.set('BOOST_CONTAINER_USE_STD_EXCEPTIONS', true, description: 'Boost use std exceptions')
-add_project_arguments('-DBOOST_CONTAINER_USE_STD_EXCEPTIONS', language: ['c', 'cpp'])
-summary('Boost', dep_boost.found(), bool_yn: true, section: 'Boost')
-summary('Version', dep_boost.version(), section: 'Boost')
--- /dev/null
+../../../meson/clock-gettime
\ No newline at end of file
+++ /dev/null
-found = cxx.has_function('clock_gettime')
-dep_rt = dependency('', required: false)
-
-if not found
- dep_rt = cxx.find_library('rt', required: true)
- found = cxx.has_function('clock_gettime', dependencies: dep_rt)
-endif
-
-conf.set('HAVE_CLOCK_GETTIME', found, description: 'Have clock_gettime')
-summary('clock_gettime', true, bool_yn: true, section: 'System')
-
-if dep_rt.found()
- summary('rt library', dep_rt.name(), bool_yn: true, section: 'System')
- summary('rt library version', dep_rt.version(), bool_yn: true, section: 'System')
-endif
--- /dev/null
+../../../meson/code-coverage
\ No newline at end of file
+++ /dev/null
-coverage = get_option('b_coverage')
-
-if coverage
- if get_option('buildtype') != 'debug'
- warning('Coverage is enabled, using `builtype=debug` would produce better reports')
- endif
-
- if cxx.has_argument('-U_FORTIFY_SOURCE')
- add_project_arguments('-U_FORTIFY_SOURCE', language: ['c', 'cpp'])
- endif
-endif
-
-summary('Code Coverage', coverage, bool_yn: true, section: 'Configuration')
--- /dev/null
+../../../meson/config
\ No newline at end of file
+++ /dev/null
-add_project_arguments('-DHAVE_CONFIG_H', language: ['c', 'cpp'])
--- /dev/null
+../../../meson/dlopen
\ No newline at end of file
+++ /dev/null
-dep_dlopen = declare_dependency()
-
-if not cxx.has_function('dlopen')
- dep_dlopen = dependency('dl', required: false)
-
- if not dep_dlopen.found()
- dep_dlopen = cxx.find_library('dl', required: true)
-
- if not cxx.has_function('dlopen', dependencies: dep_dlopen)
- error('Your system does not support dlopen')
- endif
- endif
-endif
-
-summary('dlopen', dep_dlopen.found(), bool_yn: true, section: 'System')
--- /dev/null
+../../../meson/dnstap
\ No newline at end of file
+++ /dev/null
-opt_dnstap = get_option('dnstap')
-dep_dnstap = dependency('libfstrm', required: opt_dnstap)
-
-if dep_dnstap.found()
- funcs = [
- 'fstrm_tcp_writer_init',
- ]
-
- foreach func: funcs
- has = cxx.has_function(func, dependencies: dep_dnstap)
- conf.set('HAVE_' + func.to_upper(), has, description: 'Have libfstram ' + func)
- endforeach
-endif
-
-conf.set('HAVE_FSTRM', dep_dnstap.found(), description: 'libfstrm')
-summary('DNSTAP', dep_dnstap.found(), bool_yn: true, section: 'Configuration')
-
--- /dev/null
+../../../meson/dot
\ No newline at end of file
+++ /dev/null
-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()
- 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')
--- /dev/null
+../../../meson/gnutls
\ No newline at end of file
+++ /dev/null
-opt_gnutls = get_option('tls-gnutls')
-dep_gnutls = dependency('gnutls', version: '>= 3.1.11', required: opt_gnutls)
-
-if dep_gnutls.found()
- funcs = [
- 'gnutls_memset',
- 'gnutls_session_set_verify_cert',
- 'gnutls_session_get_verify_cert_status',
- 'gnutls_alpn_set_protocols',
- ]
-
- foreach func: funcs
- has = cxx.has_function(func, dependencies: dep_gnutls)
- conf.set('HAVE_' + func.to_upper(), has, description: 'Have GnuTLS ' + func)
- endforeach
-endif
-
-conf.set('HAVE_GNUTLS', dep_gnutls.found(), description: 'GnuTLS')
-summary('GnuTLS', dep_gnutls.found(), bool_yn: true, section: 'Crypto')
--- /dev/null
+../../../meson/hardening
\ No newline at end of file
+++ /dev/null
-opt_cf = get_option('hardening-experimental-cf')
-
-support_cf_prot = opt_cf != 'disabled' and cxx.has_argument('-fcf-protection=' + opt_cf)
-if support_cf_prot
- add_project_arguments('-fcf-protection=' + opt_cf, language: ['c', 'cpp'])
-elif opt_cf != 'disabled'
- error('Control Flow Protection was explicitly requested but is not supported by the compiler')
-endif
-
-summary('Control Flow Protection', support_cf_prot, bool_yn: true, section: 'Hardening')
+++ /dev/null
-fortify_source_opt = get_option('hardening-fortify-source')
-fortify_source = fortify_source_opt != 'disabled'
-fortify_source_level = 0
-
-if fortify_source and get_option('buildtype') == 'debug'
- error('Source fortification was requested but it requires compiling with optimization. ' +
- 'A debug buildtype was requested, try setting buildtype=debugoptimized instead')
-endif
-
-if fortify_source
- fortify_source_level = 2
- if fortify_source_opt == 'auto'
- fortify_source_level = 3
- else
- fortify_source_level = fortify_source_opt.to_int()
- endif
-
- variants = [3, 2, 1]
- foreach variant: variants
- variant_str = variant.to_string()
- if fortify_source_level == variant
- if cxx.has_argument('-D_FORTIFY_SOURCE=' + variant_str)
- add_project_arguments('-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=' + variant_str, language: ['c', 'cpp'])
- break
- else
- fortify_source_level = fortify_source_level - 1
- endif
- endif
- endforeach
-endif
-
-fortify_source = fortify_source and fortify_source_level != 0
-summary('Source Fortification', fortify_source, bool_yn: true, section: 'Hardening')
-
-if fortify_source
- summary('Source Fortification Level', fortify_source_level, section: 'Hardening')
-endif
+++ /dev/null
-opt_hardening = get_option('hardening')
-if opt_hardening.enabled() or opt_hardening.auto()
- hardening_features = []
-
- # PIE
- opt_pie = get_option('b_pie')
- if not opt_pie and opt_hardening.enabled()
- error('Hardening was requested but building position independent executables is disabled')
- endif
- hardening_features += [[opt_pie, 'Building position independent executables (PIEs)']]
- conf.set('PIE', opt_pie, description: 'Build a Position Independent Executable (PIE)')
- summary('PIE', opt_pie, bool_yn: true, section: 'Hardening')
-
- subdir('stack-prot') # Stack Protector
- subdir('stack-smashing-prot') # Stack-Smashing Protection
- subdir('relro') # RELRO
-
- foreach feature: hardening_features
- available = feature[0]
- name = feature[1]
-
- if not available
- if opt_hardening.auto()
- warning(name + ' is disabled or not supported')
- else
- error('Failing because ' + name + ' is not supported but hardening was requested')
- endif
- endif
- endforeach
-endif
-
-subdir('fortify-source') # Fortify Source
-subdir('control-flow') # Control Flow Protection
-subdir('stack-clash-prot') # Stack Clash Protection
+++ /dev/null
-have_relro = true
-variants = [
- '-Wl,-z,relro',
- '-Wl,-z,now',
-]
-
-foreach variant: variants
- if cxx.has_link_argument(variant)
- hardening_features += [[true, 'RELRO (' + variant + ')']]
- add_project_link_arguments(variant, language: ['c', 'cpp'])
- else
- have_relro = false
- endif
-endforeach
-
-summary('RELRO', have_relro, bool_yn: true, section: 'Hardening')
+++ /dev/null
-opt_scp = get_option('hardening-experimental-scp')
-
-support_scp = not opt_scp.disabled() and cxx.has_argument('-fstack-clash-protection')
-if support_scp
- add_project_arguments('-fstack-clash-protection', language: ['c', 'cpp'])
-elif opt_scp.enabled()
- error('Stack Clash Protection was explicitly requested but is not supported by the compiler')
-endif
-
-summary('Stack Clash Protection', support_scp, bool_yn: true, section: 'Hardening')
+++ /dev/null
-support_stack_protector = cxx.has_argument('-fstack-protector')
-
-if support_stack_protector
- add_project_arguments('-fstack-protector', language: ['c', 'cpp'])
-endif
-
-hardening_features += [[support_stack_protector, 'Stack Protector']]
-summary('Stack Protector', support_stack_protector, bool_yn: true, section: 'Hardening')
+++ /dev/null
-support_stack_smashing_protector = cxx.has_argument('--param=ssp-buffer-size=4')
-if support_stack_smashing_protector
- add_project_arguments('--param=ssp-buffer-size=4', language: ['c', 'cpp'])
-endif
-
-hardening_features += [[support_stack_smashing_protector, 'Stack Smashing Protection']]
-summary('Stack Smashing Protection', support_stack_smashing_protector, bool_yn: true, section: 'Hardening')
-if support_stack_smashing_protector
- summary('SSP Buffer Size', 4, section: 'Hardening')
-endif
--- /dev/null
+../../../meson/ipcipher
\ No newline at end of file
+++ /dev/null
-opt_ipcipher = get_option('ipcipher')
-
-if not dep_libcrypto.found() and opt_ipcipher.enabled()
- error('ipcipher support was requested but libcrypto is not available')
-endif
-
-enable_ipcipher = dep_libcrypto.found() and not opt_ipcipher.disabled()
-conf.set('HAVE_IPCIPHER', enable_ipcipher, description: 'ipcipher support')
-summary('ipcipher', enable_ipcipher, bool_yn: true, section: 'Configuration')
--- /dev/null
+../../../meson/kiss-rng
\ No newline at end of file
+++ /dev/null
-opt_kiss_rng = get_option('rng-kiss')
-conf.set('HAVE_KISS_RNG', opt_kiss_rng, description: 'Use the unsafe KISS RNG')
-summary('Unsafe KISS RNG', opt_kiss_rng, bool_yn: true, section: 'Configuration')
--- /dev/null
+../../../meson/libdir
\ No newline at end of file
+++ /dev/null
-conf.set_quoted('PKGLIBDIR', get_option('libdir'), description: 'Modules directory')
--- /dev/null
+../../../meson/libssl
\ No newline at end of file
+++ /dev/null
-opt_libssl = get_option('tls-libssl')
-dep_libssl = dependency('libssl', required: opt_libssl)
-
-if dep_libssl.found()
- funcs = [
- 'SSL_CTX_set_ciphersuites',
- 'SSL_CTX_set_num_tickets',
- 'SSL_CTX_set_keylog_callback',
- 'SSL_CTX_get0_privatekey',
- 'SSL_set_hostflags',
- 'SSL_CTX_set_alpn_protos',
- 'SSL_CTX_set_next_proto_select_cb',
- 'SSL_get0_alpn_selected',
- 'SSL_get0_next_proto_negotiated',
- 'SSL_CTX_set_alpn_select_cb',
- 'SSL_CTX_use_cert_and_key',
- ]
-
- foreach func: funcs
- has = cxx.has_function(func, dependencies: dep_libssl)
- conf.set('HAVE_' + func.to_upper(), has, description: 'Have OpenSSL libssl ' + func)
- endforeach
-endif
-
-has = cxx.has_header_symbol(
- 'openssl/ssl.h',
- 'SSL_CTX_set_min_proto_version',
- dependencies: dep_libssl,
-)
-conf.set(
- 'HAVE_SSL_CTX_SET_MIN_PROTO_VERSION',
- has,
- description: 'Have OpenSSL libssl SSL_CTX_set_min_proto_version',
-)
-conf.set(
- 'OPENSSL_NO_ENGINE',
- true,
- description: 'Disable engine support for auth in libssl.cc',
-)
-
-conf.set('HAVE_LIBSSL', dep_libssl.found(), description: 'OpenSSL libssl')
-summary('OpenSSL libssl', dep_libssl.found(), bool_yn: true, section: 'Crypto')
--- /dev/null
+../../../meson/libsystemd
\ No newline at end of file
+++ /dev/null
-opt_systemd = get_option('systemd')
-
-dep_systemd = dependency('libsystemd', required: opt_systemd)
-conf.set('HAVE_SYSTEMD', dep_systemd.found(), description: 'libsystemd')
-summary('libsystemd', dep_systemd.found(), bool_yn: true, section: 'Configuration')
-
-if dep_systemd.found()
- summary('Lib Version', dep_systemd.version(), section: 'Systemd')
-endif
--- /dev/null
+../../../meson/mmap
\ No newline at end of file
+++ /dev/null
-mman_h = cxx.has_header('sys/mman.h', required: false)
-have_mmap = mman_h and cxx.has_function('mmap', prefix: '''#include <sys/mman.h>''')
-
-conf.set('HAVE_MMAP', have_mmap, description: 'Have mmap')
-
-summary('Have <sys/mman.h>', mman_h, bool_yn: true, section: 'Function mmap')
-summary('mmap', have_mmap, bool_yn: true, section: 'Function mmap')
--- /dev/null
+../../../meson/net-libs
\ No newline at end of file
+++ /dev/null
-netlib_deps = []
-
-variants = [
- ['inet_aton', 'resolv'],
- ['gethostbyname', 'nsl'],
- ['socket', 'socket'],
- ['gethostent', 'nsl'],
-]
-
-foreach variant: variants
- func_name = variant[0]
- lib_name = variant[1]
-
- found = cxx.has_function(func_name)
- if not found
- lib = cxx.find_library(lib_name, required: true)
- if not cxx.has_function(func_name, dependencies: lib)
- error('Cannot find function ' + func_name + ', searched library `' + lib_name + '`')
- endif
- netlib_deps += lib
- found = lib.name() + ' ' + lib.version()
- endif
-
- summary(func_name, found, bool_yn: true, section: 'Networking Functions')
-endforeach
-
-dep_netlibs = declare_dependency(dependencies: netlib_deps)
-
-variants = [
- 'recvmmsg',
- 'sendmmsg',
- 'accept4',
-]
-
-foreach variant: variants
- found = cxx.has_function(variant)
- define = 'HAVE_' + variant.to_upper()
- conf.set(define, found, description: 'Have ' + variant)
- summary(variant, found, bool_yn: true, section: 'Networking Functions')
-endforeach
-
-declared = cxx.has_header_symbol('ifaddrs.h', 'getifaddrs')
-conf.set('HAVE_GETIFADDRS', declared, description: 'Have getifaddrs')
-summary('getifaddrs', declared, bool_yn: true, section: 'Networking Functions')
--- /dev/null
+../../../meson/platform
\ No newline at end of file
+++ /dev/null
-platforms = [
- {
- 'name': 'linux',
- 'config-defines': [{ 'name': 'HAVE_LINUX', 'description': 'On Linux' }],
- },
- {
- 'name': 'darwin',
- 'config-defines': [{ 'name': 'HAVE_DARWIN', 'description': 'On Darwin/MacOS' }],
- 'cmdline-defines': ['__APPLE_USE_RFC_3542', '_XOPEN_SOURCE', '_DARWIN_C_SOURCE'],
- },
- {
- 'name': 'openbsd',
- 'config-defines': [{ 'name': 'HAVE_OPENBSD', 'description': 'On OpenBSD' }],
- },
- {
- 'name': 'freebsd',
- 'config-defines': [{ 'name': 'HAVE_FREEBSD', 'description': 'On FreeBSD' }],
- },
- {
- 'name': 'sunos',
- 'config-defines': [
- { 'name': 'HAVE_SOLARIS', 'description': 'On Solaris/SunOS' },
- { 'name': 'NEED_POSIX_TYPEDEF', 'description': 'POSIX typedefs need to be defined' },
- { 'name': 'NEED_INET_NTOP_PROTO', 'description': 'OS is so broken that it needs an additional prototype' },
- ],
- 'cmdline-defines': ['_REENTRANT'],
- 'libraries': ['posix4'],
- },
-]
-
-platform_deps = []
-
-foreach platform: platforms
- name = platform['name']
- set_variable('have_' + name, system == name)
-
- config_defines = 'config-defines' in platform ? platform['config-defines'] : []
- cmdline_defines = 'cmdline-defines' in platform ? platform['cmdline-defines'] : []
- libraries = 'libraries' in platform ? platform['libraries'] : []
-
- if system == name
- platform_defines = []
- foreach define: config_defines
- define_name = define['name']
- define_desc = define['description']
- conf.set(define_name, true, description: define_desc)
- platform_defines += define_name
- endforeach
-
- foreach cmdline_define: cmdline_defines
- add_project_arguments('-D' + cmdline_define, language: ['c', 'cpp'])
- endforeach
-
- foreach library: libraries
- platform_deps += cxx.find_library(library, required: true)
- endforeach
-
- summary('Platform Defines', platform_defines, section: 'System')
- endif
-endforeach
-
-dep_platform = declare_dependency(
- dependencies: platform_deps,
-)
--- /dev/null
+../../../meson/pthread-headers
\ No newline at end of file
+++ /dev/null
-dep_threads = dependency('threads')
-
-have_pthread_h = cxx.check_header(
- 'pthread.h',
- dependencies: dep_threads,
- required: true,
-)
-have_pthread_np_h = cxx.check_header(
- 'pthread_np.h',
- dependencies: dep_threads,
- prefix: '#include <pthread.h>',
-)
-
-conf.set('HAVE_PTHREAD_NP_H', have_pthread_np_h, description: 'Have <pthread_np.h>')
-
-summary('Threads', dep_threads.found(), bool_yn: true, section: 'POSIX Threads')
-summary('Have <pthread.h>', have_pthread_h, bool_yn: true, section: 'POSIX Threads')
-summary('Have <pthread_np.h>', have_pthread_np_h, bool_yn: true, section: 'POSIX Threads')
--- /dev/null
+../../../meson/pthread-np
\ No newline at end of file
+++ /dev/null
-funcs = [
- 'pthread_setaffinity_np',
- 'pthread_getattr_np',
- 'pthread_get_stackaddr_np',
- 'pthread_get_stacksize_np',
-]
-
-foreach func: funcs
- found = cxx.has_function(func, dependencies: dep_threads)
- define = 'HAVE_' + func.to_upper()
- conf.set(define, found, description: 'Have ' + func)
- summary(func, found, bool_yn: true, section: 'POSIX Threads')
-endforeach
--- /dev/null
+../../../meson/pthread-setname
\ No newline at end of file
+++ /dev/null
-variants = [
- [
- '2-arg pthread_setname_np',
- 'HAVE_PTHREAD_SETNAME_NP_2',
- 'pthread_setname_np takes 2 arguments (Linux/glibc, QNX, IBM)',
- fs.read('pthread_setname_np_2args.cc'),
- ],
- [
- '2-arg pthread_set_name_np',
- 'HAVE_PTHREAD_SET_NAME_NP_2',
- 'pthread_set_name_np takes 2 arguments and does not return void (FreeBSD, OpenBSD)',
- fs.read('pthread_set_name_np_2args.cc'),
- ],
- [
- '2-arg void pthread_set_name_np',
- 'HAVE_PTHREAD_SET_NAME_NP_2_VOID',
- 'pthread_set_name_np takes 2 arguments and returns void (FreeBSD, OpenBSD)',
- fs.read('pthread_set_name_np_void_2args.cc'),
- ],
- [
- '1-arg pthread_setname_np',
- 'HAVE_PTHREAD_SETNAME_NP_1',
- 'pthread_setname_np takes 1 argument (Darwin, MacOS)',
- fs.read('pthread_setname_np_1arg.cc'),
- ],
- [
- '3-arg pthread_setname_np',
- 'HAVE_PTHREAD_SETNAME_NP_3',
- 'pthread_setname_np takes 3 arguments (NetBSD)',
- fs.read('pthread_setname_np_3args.cc'),
- ],
-]
-
-found = false
-foreach variant: variants
- variant_name = variant[0]
- variant_define = variant[1]
- variant_description = variant[2]
- variant_program = variant[3]
-
- if cxx.links(
- variant_program,
- name: variant_name,
- dependencies: dep_threads,
- args: have_pthread_np_h ? ['-DHAVE_PTHREAD_NP_H'] : []
- )
- found = true
- conf.set(variant_define, true, description: variant_description)
- summary('pthread_setname Variant', variant_define, section: 'POSIX Threads')
- summary('Description', variant_description, section: 'POSIX Threads')
- break
- endif
-endforeach
-
-if not found
- error('Could not find a suitable pthread_setname function')
-endif
+++ /dev/null
-#include <pthread.h>
-#if HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
-int main()
-{
- return pthread_set_name_np(pthread_self(), "foo");
-}
+++ /dev/null
-#include <pthread.h>
-#if HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
-int main()
-{
- pthread_set_name_np(pthread_self(), "foo");
- return 0;
-}
+++ /dev/null
-#include <pthread.h>
-#if HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
-int main()
-{
- return pthread_setname_np("foo");
-}
+++ /dev/null
-#include <pthread.h>
-#if HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
-int main()
-{
- pthread_setname_np(pthread_self(), "foo");
- return 0;
-}
+++ /dev/null
-#include <pthread.h>
-#if HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
-int main()
-{
- return pthread_setname_np(pthread_self(), "foo", NULL);
-}
--- /dev/null
+../../../meson/reproducible
\ No newline at end of file
+++ /dev/null
-opt_repro = get_option('reproducible')
-conf.set('REPRODUCIBLE', opt_repro, description: 'Reproducible builds')
-summary('Reproducible Builds', opt_repro, bool_yn: true, section: 'Reproducible Builds')
-
-if not opt_repro
- id_prog = find_program('id', required: opt_repro)
- id_prog_res = run_command(id_prog, '-u', '-n', check: true)
- build_user = id_prog_res.stdout().strip()
-
- build_host = ''
- hostname_prog = find_program('hostname', required: opt_repro)
- build_system = build_machine.system()
- if build_system == 'sunos' or build_system == 'openbsd'
- domainname_prog = find_program('domainname', required: opt_repro)
-
- hostname_prog_res = run_command(hostname_prog, check: true)
- domainname_prog_res = run_command(domainname_prog, check: true)
-
- build_host_hostname = hostname_prog_res.stdout().strip()
- build_host_domainname = domainname_prog_res.stdout().strip()
-
- build_host = build_host_hostname + '.' + build_host_domainname
- else
- cmds = [
- [hostname_prog, '-f'],
- [hostname_prog],
- ['echo', '\'localhost\''],
- ]
-
- found = false
- foreach cmd: cmds
- res = run_command(cmd, check: false)
- if res.returncode() == 0
- build_host = res.stdout().strip()
- found = true
- break
- endif
- endforeach
-
- if not found
- error('Reproducible builds requested but could not figure out a build host string on ' + build_system)
- endif
- endif
-
- build_host = build_user + '@' + build_host
- conf.set_quoted('BUILD_HOST', build_host, description: 'User and host who built PowerDNS')
- summary('Build Host', build_host, section: 'Reproducible Builds')
-endif
--- /dev/null
+../../../meson/sanitizers
\ No newline at end of file
+++ /dev/null
-prog_single_pointer = fs.read('sanitizer_finish_switch_fiber_1ptr.cc')
-prog_three_pointers = fs.read('sanitizer_finish_switch_fiber_3ptrs.cc')
-
-single_pointer = false
-three_pointers = false
-
-if cxx.check_header('sanitizer/common_interface_defs.h', required: false)
- if cxx.has_header_symbol('sanitizer/common_interface_defs.h', '__sanitizer_start_switch_fiber', required: false)
- if cxx.compiles(prog_single_pointer, name: '__sanitizer_finish_switch_fiber with a single pointer')
- single_pointer = true
- endif
-
- if cxx.compiles(prog_three_pointers, name: '__sanitizer_finish_switch_fiber with three pointers')
- three_pointers = true
- endif
- else
- warning('Address Sanitizer fiber switching is not available')
- endif
-
-else
- warning('Address Sanitizer requested but `sanitizer/common_interface_defs.h` ' +
- 'is invalid or cannot be found. Address Sanitizer fiber switching is ' +
- 'not available')
-endif
-
-if not single_pointer and not three_pointers
- warning('Address Sanitizer fiber switching is not available due to an unknown API version')
-endif
-
-conf.set(
- 'HAVE_FIBER_SANITIZER',
- single_pointer or three_pointers,
- description: 'Address Sanitizer fiber annotation interface is available',
-)
-conf.set(
- 'HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR',
- single_pointer,
- description: 'Address Sanitizer: __sanitizer_finish_switch_fiber takes only a pointer',
-)
-conf.set(
- 'HAVE_SANITIZER_FINISH_SWITCH_FIBER_THREE_PTRS',
- three_pointers,
- description: 'Address Sanitizer: __sanitizer_finish_switch_fiber takes three pointers',
-)
+++ /dev/null
-#include <sanitizer/common_interface_defs.h>
-
-int main()
-{
- __sanitizer_finish_switch_fiber(nullptr);
- return 0;
-}
+++ /dev/null
-#include <sanitizer/common_interface_defs.h>
-
-int main()
-{
- __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
- return 0;
-}
+++ /dev/null
-opt_sanitize = get_option('b_sanitize')
-
-if opt_sanitize == 'address' or opt_sanitize == 'address,undefined'
- subdir('address-sanitizer-fiber-switching')
-endif
-
-if opt_sanitize != 'none'
- add_project_arguments('-fno-omit-frame-pointer', language: ['c', 'cpp'])
-endif
-
-summary('Sanitizers', opt_sanitize, bool_yn: true, section: 'Configuration')
--- /dev/null
+../../../meson/strerror
\ No newline at end of file
+++ /dev/null
-prog = fs.read('strerror_r.c')
-
-have_strerror_r_decl = cxx.has_header_symbol('string.h', 'strerror_r')
-have_strerror_r = cxx.has_function('strerror_r', prefix: '#include <string.h>')
-strerror_r_returns_charp = have_strerror_r and cxx.compiles(prog, name: 'strerror_r() returns char *')
-
-conf.set('HAVE_DECL_STRERROR_R', have_strerror_r_decl, description: 'Whether strerror_r is declared')
-conf.set('HAVE_STRERROR_R', have_strerror_r, description: 'Whether strerror_r is available')
-conf.set('STRERROR_R_CHAR_P', strerror_r_returns_charp, description: 'Whether strerror_r returns char *')
-
-summary('Symbol', have_strerror_r_decl, bool_yn: true, section: 'Function strerror_r')
-summary('Declaration', have_strerror_r, bool_yn: true, section: 'Function strerror_r')
-summary('Returns char *', strerror_r_returns_charp, bool_yn: true, section: 'Function strerror_r')
+++ /dev/null
-#include <string.h>
-
-int main () {
- char error_string[256];
- char *ptr = strerror_r(-2, error_string, 256);
- char c = *strerror_r(-2, error_string, 256);
- return c != 0 && ptr != (void*) 0L;
-}
--- /dev/null
+../../../meson/summary
\ No newline at end of file
+++ /dev/null
-summary('System', system, section: 'System')
-summary('C++ Compiler', cxx.get_id(), section: 'System')
-summary('C++ Compiler Version', cxx.version(), section: 'System')
-summary('C++ Compiler Command', ' '.join(cxx.cmd_array()), section: 'System')
-summary('Linker', cxx.get_linker_id(), section: 'System')
--- /dev/null
+../../../meson/sysconfdir
\ No newline at end of file
+++ /dev/null
-conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'), description: 'Configuration data directory')
--- /dev/null
+../../../meson/systemd
\ No newline at end of file
+++ /dev/null
-dep_systemd_prog = dependency('systemd', required: false)
-summary('Systemd', dep_systemd_prog.found(), bool_yn: true, section: 'Configuration')
-
-# Map systemd features to systemd/systemctl version.
-systemd_features = {
- 'private_tmp': 183,
- 'system_call_architectures': 209,
- 'private_devices': 209,
- 'restrict_address_families': 211,
- 'protect_system': 214,
- 'protect_home': 214,
- 'restrict_realtime': 231,
- 'memory_deny_write_execute': 231,
- 'protect_control_groups': 232,
- 'protect_kernel_modules': 232,
- 'protect_kernel_tunables': 232,
- 'remove_ipc': 232,
- 'dynamic_user': 232,
- 'private_users': 232,
- 'protect_system_strict': 232,
- 'restrict_namespaces': 233,
- 'lock_personality': 235,
- # while SystemCallFilter is technically available starting with 187,
- # we use the pre-defined call filter sets that have been introduced later.
- # Initial support for these landed in 231
- # @filesystem @reboot @swap in 233
- # @aio, @sync, @chown, @setuid, @memlock, @signal and @timer in 235
- 'system_call_filter': 235,
- 'percent_t': 236,
- 'private_mounts': 239,
- 'with_runtime_dir_env': 240,
- 'protect_hostname': 242,
- 'restrict_suidsgid': 242,
- 'protect_kernel_logs': 244,
- 'protect_clock': 245,
- 'protect_proc': 247,
- 'private_ipc': 248,
-}
-
-systemd_version = dep_systemd_prog.version()
-foreach feature, version: systemd_features
- feature_name = 'have_systemd_' + feature
- feature_value = systemd_version.version_compare('>=' + version.to_string())
- set_variable(feature_name, feature_value)
- conf.set(feature_name.to_upper(), feature_value, description: 'systemd feature: ' + feature)
-endforeach
-
-if dep_systemd_prog.found()
- summary('Version', dep_systemd_prog.version(), section: 'Systemd')
-endif
--- /dev/null
+../../../meson/timet-sign
\ No newline at end of file
+++ /dev/null
-fs = import('fs')
-
-prog = fs.read('timet_sign.cc')
-timet_signed = cxx.compiles(prog, name: 'time_t is signed')
-
-if not timet_signed
- error('time_t is unsigned, PowerDNS code relies on it being signed')
-endif
-
-summary('Signed time_t', timet_signed, bool_yn: true, section: 'System')
+++ /dev/null
-#include <sys/types.h>
-
-int main()
-{
- int foo[1 - 2 * !(((time_t)-1) < 0)];
- (void)foo[0];
- return 0;
-}
--- /dev/null
+../../../meson/timet-size
\ No newline at end of file
+++ /dev/null
-timet_size = cxx.sizeof('time_t', prefix: '#include <sys/types.h>')
-
-if timet_size < 8
- error('size of time_t is ' +
- timet_size.to_string() +
- ' which is not large enough to fix the y2k38 bug')
-endif
-
-summary('Size of time_t', timet_size, section: 'System')
--- /dev/null
+../../../meson/tm-gmtoff
\ No newline at end of file
+++ /dev/null
-prefix = '''
-#include <sys/types.h>
-#include <time.h>
-'''
-
-has = cxx.has_member('struct tm', 'tm_gmtoff', prefix: prefix)
-conf.set('HAVE_TM_GMTOFF', has, description: 'Whether tm_gmtoff is available')
-summary('tm_gmtoff', has, bool_yn: true, section: 'System')
--- /dev/null
+../../../meson/various-functions
\ No newline at end of file
+++ /dev/null
-funcs = [
- 'strcasestr',
- 'localtime_r',
- 'gmtime_r',
- 'recvmmsg',
- 'sched_setscheduler',
- 'getrandom',
- 'arc4random',
- 'getentropy',
- 'arc4random_uniform',
- 'arc4random_buf',
- 'explicit_bzero',
- 'explicit_memset',
- 'memset_s',
-]
-
-foreach func: funcs
- found = cxx.has_function(func)
- define = 'HAVE_' + func.to_upper()
- conf.set(define, found, description: 'Have ' + func)
- summary(func, found, bool_yn: true, section: 'Various Functions')
-endforeach
--- /dev/null
+../../../meson/various-headers
\ No newline at end of file
+++ /dev/null
-conf.set(
- 'HAVE_SYS_RANDOM_H',
- cxx.has_header('sys/random.h'),
- description: 'Have sys/random.h',
-)
--- /dev/null
+../../../meson/version
\ No newline at end of file
+++ /dev/null
-gen_version_prog = find_program('gen-version', dirs: product_source_dir / 'builder-support', required: true)
-gen_version_prog_res = run_command(gen_version_prog, check: true)
-product_version = gen_version_prog_res.stdout().strip()
-conf.set_quoted('VERSION', product_version, description: 'Version')