From 5cd6c173ff74309ae7fb73b3e4c754f1589eaddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayd=C4=B1n=20Mercan?= Date: Tue, 16 Apr 2024 15:13:53 +0300 Subject: [PATCH] replace the build system with meson Meson is a modern build system that has seen a rise in adoption and some version of it is available in almost every platform supported. Compared to automake, meson has the following advantages: * Meson provides a significant boost to the build and configuration time by better exploiting parallelism. * Meson is subjectively considered to be better in readability. These merits alone justify experimenting with meson as a way of improving development time and ergonomics. However, there are some compromises to ensure the transition goes relatively smooth: * The system tests currently rely on various files within the source directory. Changing this requirement is a non-trivial task that can't be currently justified. Currently the last compiled build directory writes into the source tree which is in turn used by pytest. * The minimum version supported has been fixed at 0.61. Increasing this value will require choosing a baseline of distributions that can package with meson. On the contrary, there will likely be an attempt to decrease this value to ensure almost universal support for building BIND 9 with meson. --- .editorconfig | 4 + .gitattributes | 21 +- .gitlab-ci.yml | 482 ++--- .reuse/dep5 | 2 +- LICENSES/Autoconf-exception-3.0.txt | 26 - LICENSES/FSFAP.txt | 1 - LICENSES/GPL-3.0-or-later.txt | 232 --- Makefile.am | 30 - Makefile.docs | 59 - Makefile.dtrace | 20 - Makefile.tests | 28 - Makefile.top | 73 - README.md | 7 +- bin/Makefile.am | 1 - bin/check/Makefile.am | 32 - bin/check/meson.build | 21 + bin/confgen/Makefile.am | 30 - bin/confgen/meson.build | 23 + bin/delv/Makefile.am | 24 - bin/delv/meson.build | 14 + bin/dig/Makefile.am | 28 - bin/dig/meson.build | 22 + bin/dnssec/Makefile.am | 58 - bin/dnssec/meson.build | 36 + bin/meson.build | 24 + bin/named/Makefile.am | 125 -- bin/named/main.c | 2 +- bin/named/meson.build | 50 + bin/named/named.conf.rst | 20 +- bin/named/server.c | 2 +- bin/named/xsl_c.in | 14 + bin/nsupdate/Makefile.am | 22 - bin/nsupdate/meson.build | 18 + bin/plugins/Makefile.am | 15 - bin/plugins/meson.build | 20 + bin/rndc/Makefile.am | 24 - bin/rndc/meson.build | 19 + bin/tests/Makefile.am | 38 - bin/tests/meson.build | 17 + bin/tests/system/.gitignore | 5 +- bin/tests/system/Makefile.am | 205 -- bin/tests/system/conf.sh | 3 +- bin/tests/system/conftest.py | 7 +- .../system/dlzexternal/driver/Makefile.am | 13 - .../system/dlzexternal/ns1/named.conf.in | 14 +- bin/tests/system/dyndb/driver/Makefile.am | 23 - bin/tests/system/dyndb/driver/driver.c | 2 +- bin/tests/system/dyndb/ns1/named.conf.j2 | 4 +- .../conf/{bad1.conf => bad1.conf.in} | 2 +- .../conf/{bad2.conf => bad2.conf.in} | 2 +- .../conf/{bad3.conf => bad3.conf.in} | 2 +- .../conf/{bad4.conf => bad4.conf.in} | 2 +- .../conf/{bad5.conf => bad5.conf.in} | 2 +- .../conf/{good1.conf => good1.conf.in} | 2 +- .../conf/{good2.conf => good2.conf.in} | 2 +- .../conf/{good3.conf => good3.conf.in} | 2 +- .../conf/{good4.conf => good4.conf.in} | 2 +- .../conf/{good5.conf => good5.conf.in} | 2 +- .../system/filter-aaaa/ns1/named1.conf.in | 2 +- .../system/filter-aaaa/ns1/named2.conf.in | 2 +- .../system/filter-aaaa/ns2/named1.conf.in | 2 +- .../system/filter-aaaa/ns2/named2.conf.in | 2 +- .../system/filter-aaaa/ns3/named1.conf.in | 2 +- .../system/filter-aaaa/ns3/named2.conf.in | 2 +- .../system/filter-aaaa/ns4/named1.conf.in | 2 +- .../system/filter-aaaa/ns4/named2.conf.in | 2 +- .../system/filter-aaaa/ns5/named.conf.in | 2 +- bin/tests/system/filter-aaaa/setup.sh | 12 + .../filter-aaaa/tests_sh_filter_aaaa.py | 5 +- bin/tests/system/get_core_dumps.sh | 9 +- bin/tests/system/hooks/driver/Makefile.am | 12 - bin/tests/system/hooks/ns1/named.conf.j2 | 2 +- bin/tests/system/ifconfig.sh.in | 121 +- .../isctest/vars/.ac_vars/TOP_BUILDDIR.in | 1 - .../isctest/vars/.ac_vars/TOP_SRCDIR.in | 1 - .../vars/{.ac_vars => .build_vars}/CURL.in | 0 .../FSTRM_CAPTURE.in | 0 .../vars/{.ac_vars => .build_vars}/NC.in | 0 .../vars/{.ac_vars => .build_vars}/PERL.in | 0 .../vars/{.ac_vars => .build_vars}/PYTEST.in | 0 .../vars/{.ac_vars => .build_vars}/PYTHON.in | 0 .../vars/{.ac_vars => .build_vars}/SHELL.in | 0 .../isctest/vars/.build_vars/TOP_BUILDDIR.in | 1 + .../isctest/vars/.build_vars/TOP_SRCDIR.in | 1 + .../{.ac_vars => .build_vars}/XSLTPROC.in | 0 .../isctest/vars/.build_vars/meson.build | 57 + bin/tests/system/isctest/vars/all.py | 10 +- bin/tests/system/isctest/vars/autoconf.py | 29 - bin/tests/system/isctest/vars/basic.py | 70 +- bin/tests/system/isctest/vars/build.py | 59 + bin/tests/system/isctest/vars/dirs.py | 8 +- bin/tests/system/meson.build | 42 + bin/tests/system/rsabigexponent/bigkey.c | 2 - bin/tests/system/start.pl | 6 +- bin/tests/system/stop.pl | 2 +- bin/tests/system/stop.sh.in | 2 +- bin/tests/{wire_test.c => system/wire-test.c} | 0 bin/tools/Makefile.am | 48 - bin/tools/meson.build | 32 + ci/amd64cross32.ini | 27 + ci/cross_version_config_test.sh | 43 + ci/freebsd.ini | 15 + configure.ac | 1559 -------------- lib/dns/dnstap.proto => dnstap.proto | 0 doc/Makefile.am | 15 - doc/arm/Makefile.am | 110 - doc/arm/_ext/mergegrammar.py | 12 +- doc/arm/_ext/namedconf.py | 1 + doc/arm/_ext/rndcconf.py | 9 +- doc/arm/build.inc.rst | 85 +- doc/arm/conf.py | 23 +- doc/arm/meson.build | 86 + doc/dev/style.md | 14 +- doc/dnssec-guide/img/meson.build | 36 + doc/dnssec-guide/meson.build | 26 + doc/ext/configblock.py | 47 + doc/ext/meson.build | 16 + doc/man/Makefile.am | 217 -- doc/man/conf.py | 33 +- doc/man/meson.build | 92 + doc/meson.build | 21 + doc/misc/Makefile.am | 76 - doc/misc/forward.zoneopt | 6 - doc/misc/hint.zoneopt | 6 - doc/misc/in-view.zoneopt | 3 - doc/misc/meson.build | 95 + doc/misc/mirror.zoneopt | 47 - doc/misc/options | 695 ------- doc/misc/primary.zoneopt | 68 - doc/misc/redirect.zoneopt | 16 - doc/misc/rndc.grammar | 21 - doc/misc/secondary.zoneopt | 70 - doc/misc/static-stub.zoneopt | 14 - doc/misc/stub.zoneopt | 28 - fuzz/Makefile.am | 68 - fuzz/afl.ini | 28 + fuzz/libfuzzer.ini | 27 + fuzz/meson.build | 28 + gcovr.cfg | 18 + lib/Makefile.am | 3 - lib/dns/Makefile.am | 348 ---- lib/dns/include/dns/meson.build | 46 + lib/dns/include/meson.build | 12 + lib/dns/meson.build | 166 ++ lib/dns/rdata/any_255/meson.build | 12 + lib/dns/rdata/ch_3/meson.build | 12 + lib/dns/rdata/generic/meson.build | 79 + lib/dns/rdata/hs_4/meson.build | 12 + lib/dns/rdata/in_1/meson.build | 29 + lib/dns/rdata/meson.build | 18 + lib/isc/Makefile.am | 269 --- lib/isc/meson.build | 141 ++ lib/isc/netmgr/meson.build | 26 + lib/isccc/Makefile.am | 36 - lib/isccc/meson.build | 20 + lib/isccfg/Makefile.am | 44 - lib/isccfg/meson.build | 21 + lib/meson.build | 16 + lib/ns/Makefile.am | 62 - lib/ns/meson.build | 54 + m4/ax_check_compile_flag.m4 | 55 - m4/ax_check_link_flag.m4 | 55 - m4/ax_check_preproc_flag.m4 | 55 - m4/ax_gcc_func_attribute.m4 | 244 --- m4/ax_jemalloc.m4 | 57 - m4/ax_lib_lmdb.m4 | 52 - m4/ax_perl_module.m4 | 32 - m4/ax_posix_shell.m4 | 39 - m4/ax_prog_cc_for_build.m4 | 157 -- m4/ax_pthread.m4 | 524 ----- m4/ax_python_module.m4 | 33 - m4/ax_restore_flags.m4 | 54 - m4/ax_save_flags.m4 | 73 - m4/compat.m4 | 28 - m4/pkg-modversion.m4 | 35 - meson.build | 1806 +++++++++++++++++ meson.format | 14 + meson_options.txt | 190 ++ tests/Makefile.am | 21 - tests/bench/Makefile.am | 36 - tests/bench/meson.build | 51 + tests/dns/Makefile.am | 142 -- tests/dns/meson.build | 99 + tests/dns/sigs_test.c | 2 +- tests/dns/testdata/master/master18.data.in | 4 +- tests/dns/testdata/master/meson.build | 60 + tests/isc/Makefile.am | 226 --- tests/isc/meson.build | 94 + tests/isccfg/Makefile.am | 21 - tests/isccfg/meson.build | 38 + tests/libtest/Makefile.am | 32 - tests/meson.build | 50 + tests/ns/Makefile.am | 32 - tests/ns/meson.build | 43 + tests/unit-test-driver.sh.in | 60 - util/check-make-install.in | 20 +- util/dtrace.sh | 9 +- util/generate-stress-test-configs.py | 10 +- util/meson-dist-package.sh | 74 + util/meson-glob.sh | 37 + util/meson-system-test-init.sh | 20 + util/meson.build | 20 + util/pairwise-construct.jq | 18 + util/pairwise-testing.sh | 19 +- util/select-baseline-version.jq | 24 + 205 files changed, 4835 insertions(+), 7687 deletions(-) delete mode 100644 LICENSES/Autoconf-exception-3.0.txt delete mode 100644 LICENSES/FSFAP.txt delete mode 100644 LICENSES/GPL-3.0-or-later.txt delete mode 100644 Makefile.am delete mode 100644 Makefile.docs delete mode 100644 Makefile.dtrace delete mode 100644 Makefile.tests delete mode 100644 Makefile.top delete mode 100644 bin/Makefile.am delete mode 100644 bin/check/Makefile.am create mode 100644 bin/check/meson.build delete mode 100644 bin/confgen/Makefile.am create mode 100644 bin/confgen/meson.build delete mode 100644 bin/delv/Makefile.am create mode 100644 bin/delv/meson.build delete mode 100644 bin/dig/Makefile.am create mode 100644 bin/dig/meson.build delete mode 100644 bin/dnssec/Makefile.am create mode 100644 bin/dnssec/meson.build create mode 100644 bin/meson.build delete mode 100644 bin/named/Makefile.am create mode 100644 bin/named/meson.build create mode 100644 bin/named/xsl_c.in delete mode 100644 bin/nsupdate/Makefile.am create mode 100644 bin/nsupdate/meson.build delete mode 100644 bin/plugins/Makefile.am create mode 100644 bin/plugins/meson.build delete mode 100644 bin/rndc/Makefile.am create mode 100644 bin/rndc/meson.build delete mode 100644 bin/tests/Makefile.am create mode 100644 bin/tests/meson.build delete mode 100644 bin/tests/system/Makefile.am delete mode 100644 bin/tests/system/dlzexternal/driver/Makefile.am delete mode 100644 bin/tests/system/dyndb/driver/Makefile.am rename bin/tests/system/filter-aaaa/conf/{bad1.conf => bad1.conf.in} (89%) rename bin/tests/system/filter-aaaa/conf/{bad2.conf => bad2.conf.in} (93%) rename bin/tests/system/filter-aaaa/conf/{bad3.conf => bad3.conf.in} (89%) rename bin/tests/system/filter-aaaa/conf/{bad4.conf => bad4.conf.in} (89%) rename bin/tests/system/filter-aaaa/conf/{bad5.conf => bad5.conf.in} (90%) rename bin/tests/system/filter-aaaa/conf/{good1.conf => good1.conf.in} (89%) rename bin/tests/system/filter-aaaa/conf/{good2.conf => good2.conf.in} (89%) rename bin/tests/system/filter-aaaa/conf/{good3.conf => good3.conf.in} (90%) rename bin/tests/system/filter-aaaa/conf/{good4.conf => good4.conf.in} (89%) rename bin/tests/system/filter-aaaa/conf/{good5.conf => good5.conf.in} (90%) delete mode 100644 bin/tests/system/hooks/driver/Makefile.am delete mode 100644 bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR.in delete mode 100644 bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR.in rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/CURL.in (100%) rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/FSTRM_CAPTURE.in (100%) rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/NC.in (100%) rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/PERL.in (100%) rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/PYTEST.in (100%) rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/PYTHON.in (100%) rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/SHELL.in (100%) create mode 100644 bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR.in create mode 100644 bin/tests/system/isctest/vars/.build_vars/TOP_SRCDIR.in rename bin/tests/system/isctest/vars/{.ac_vars => .build_vars}/XSLTPROC.in (100%) create mode 100644 bin/tests/system/isctest/vars/.build_vars/meson.build delete mode 100644 bin/tests/system/isctest/vars/autoconf.py create mode 100644 bin/tests/system/isctest/vars/build.py create mode 100644 bin/tests/system/meson.build rename bin/tests/{wire_test.c => system/wire-test.c} (100%) delete mode 100644 bin/tools/Makefile.am create mode 100644 bin/tools/meson.build create mode 100644 ci/amd64cross32.ini create mode 100755 ci/cross_version_config_test.sh create mode 100644 ci/freebsd.ini delete mode 100644 configure.ac rename lib/dns/dnstap.proto => dnstap.proto (100%) delete mode 100644 doc/Makefile.am delete mode 100644 doc/arm/Makefile.am create mode 100644 doc/arm/meson.build create mode 100644 doc/dnssec-guide/img/meson.build create mode 100644 doc/dnssec-guide/meson.build create mode 100644 doc/ext/configblock.py create mode 100644 doc/ext/meson.build delete mode 100644 doc/man/Makefile.am create mode 100644 doc/man/meson.build create mode 100644 doc/meson.build delete mode 100644 doc/misc/Makefile.am delete mode 100644 doc/misc/forward.zoneopt delete mode 100644 doc/misc/hint.zoneopt delete mode 100644 doc/misc/in-view.zoneopt create mode 100644 doc/misc/meson.build delete mode 100644 doc/misc/mirror.zoneopt delete mode 100644 doc/misc/options delete mode 100644 doc/misc/primary.zoneopt delete mode 100644 doc/misc/redirect.zoneopt delete mode 100644 doc/misc/rndc.grammar delete mode 100644 doc/misc/secondary.zoneopt delete mode 100644 doc/misc/static-stub.zoneopt delete mode 100644 doc/misc/stub.zoneopt delete mode 100644 fuzz/Makefile.am create mode 100644 fuzz/afl.ini create mode 100644 fuzz/libfuzzer.ini create mode 100644 fuzz/meson.build create mode 100644 gcovr.cfg delete mode 100644 lib/Makefile.am delete mode 100644 lib/dns/Makefile.am create mode 100644 lib/dns/include/dns/meson.build create mode 100644 lib/dns/include/meson.build create mode 100644 lib/dns/meson.build create mode 100644 lib/dns/rdata/any_255/meson.build create mode 100644 lib/dns/rdata/ch_3/meson.build create mode 100644 lib/dns/rdata/generic/meson.build create mode 100644 lib/dns/rdata/hs_4/meson.build create mode 100644 lib/dns/rdata/in_1/meson.build create mode 100644 lib/dns/rdata/meson.build delete mode 100644 lib/isc/Makefile.am create mode 100644 lib/isc/meson.build create mode 100644 lib/isc/netmgr/meson.build delete mode 100644 lib/isccc/Makefile.am create mode 100644 lib/isccc/meson.build delete mode 100644 lib/isccfg/Makefile.am create mode 100644 lib/isccfg/meson.build create mode 100644 lib/meson.build delete mode 100644 lib/ns/Makefile.am create mode 100644 lib/ns/meson.build delete mode 100644 m4/ax_check_compile_flag.m4 delete mode 100644 m4/ax_check_link_flag.m4 delete mode 100644 m4/ax_check_preproc_flag.m4 delete mode 100644 m4/ax_gcc_func_attribute.m4 delete mode 100644 m4/ax_jemalloc.m4 delete mode 100644 m4/ax_lib_lmdb.m4 delete mode 100644 m4/ax_perl_module.m4 delete mode 100644 m4/ax_posix_shell.m4 delete mode 100644 m4/ax_prog_cc_for_build.m4 delete mode 100644 m4/ax_pthread.m4 delete mode 100644 m4/ax_python_module.m4 delete mode 100644 m4/ax_restore_flags.m4 delete mode 100644 m4/ax_save_flags.m4 delete mode 100644 m4/compat.m4 delete mode 100644 m4/pkg-modversion.m4 create mode 100644 meson.build create mode 100644 meson.format create mode 100644 meson_options.txt delete mode 100644 tests/Makefile.am delete mode 100644 tests/bench/Makefile.am create mode 100644 tests/bench/meson.build delete mode 100644 tests/dns/Makefile.am create mode 100644 tests/dns/meson.build create mode 100644 tests/dns/testdata/master/meson.build delete mode 100644 tests/isc/Makefile.am create mode 100644 tests/isc/meson.build delete mode 100644 tests/isccfg/Makefile.am create mode 100644 tests/isccfg/meson.build delete mode 100644 tests/libtest/Makefile.am create mode 100644 tests/meson.build delete mode 100644 tests/ns/Makefile.am create mode 100644 tests/ns/meson.build delete mode 100644 tests/unit-test-driver.sh.in create mode 100644 util/meson-dist-package.sh create mode 100755 util/meson-glob.sh create mode 100644 util/meson-system-test-init.sh create mode 100644 util/meson.build create mode 100755 util/pairwise-construct.jq create mode 100755 util/select-baseline-version.jq diff --git a/.editorconfig b/.editorconfig index 6191af8065..87bec2c982 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,3 +3,7 @@ indent_style = space indent_size = 2 binary_next_line = true switch_case_indent = true + +[{meson.build, meson_options.txt}] +indent_style = space +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index 770cf77f19..361ae28708 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,11 +3,30 @@ /fuzz/dns_rdata_fromwire_text.in/input-* -text +.clang-format* export-ignore +.dir-locals.el export-ignore +.editorconfig export-ignore +.git-blame-ignore-revs export-ignore +.gitattributes export-ignore .gitignore export-ignore +.gitlab-ci.yml export-ignore +.pylintrc export-ignore +.readthedocs.yaml export-ignore +.tsan-suppress export-ignore +.uncrustify.cfg export-ignore +dangerfile.py export-ignore +/.github/** export-ignore +/.gitlab/** export-ignore +/.mailmap export-ignore +/.reuse/** export-ignore +/ci export-ignore /conftools export-ignore /doc/design export-ignore /doc/dev export-ignore /util/** export-ignore /util/bindkeys.pl -export-ignore /util/check-make-install.in -export-ignore -/util/dtrace.sh -export-ignore +/util/dtrace.sh -export-ignore +/util/meson.build -export-ignore +/util/meson-system-test-init.sh -export-ignore +/util/meson-dist-package.sh -export-ignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23367780e6..4f477119cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,17 +14,19 @@ variables: BUILD_PARALLEL_JOBS: 6 TEST_PARALLEL_JOBS: 4 - CONFIGURE: ./configure CLANG_VERSION: 19 CLANG: "clang-${CLANG_VERSION}" SCAN_BUILD: "scan-build-${CLANG_VERSION}" LLVM_SYMBOLIZER: "/usr/lib/llvm-${CLANG_VERSION}/bin/llvm-symbolizer" CLANG_FORMAT: "clang-format-${CLANG_VERSION}" - CFLAGS_COMMON: -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1 -g -Wall -Wextra + CFLAGS_COMMON: -fno-omit-frame-pointer -fno-optimize-sibling-calls + + UBASAN_CONFIGURE_FLAGS_COMMON: "-Db_sanitize=address,undefined -Didn=enabled -Djemalloc=disabled -Dtracing=disabled" + TSAN_CONFIGURE_FLAGS_COMMON: "-Db_sanitize=thread -Doptimization=2 -Ddebug=true -Didn=enabled -Dlocktype=system -Djemalloc=disabled --pkg-config-path /opt/tsan/lib/pkgconfig" # Pass run-time flags to AddressSanitizer to get core dumps on error. - ASAN_OPTIONS: abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1 + ASAN_OPTIONS: abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1:detect_odr_violation=0 ASAN_SYMBOLIZER_PATH: "${LLVM_SYMBOLIZER}" TSAN_OPTIONS_COMMON: "disable_coredump=0 second_deadlock_stack=1 atexit_sleep_ms=1000 history_size=7 log_exe_name=true log_path=tsan" @@ -34,10 +36,10 @@ variables: UBSAN_OPTIONS: "halt_on_error=1:abort_on_error=1:disable_coredump=0" - AM_COLOR_TESTS: always + WITHOUT_LIBEDIT: "-Dline=disabled" + WITH_LIBEDIT: "-Dline=enabled" - WITHOUT_LIBEDIT: "--without-libedit" - WITH_LIBEDIT: "--with-libedit" + STRESS_CONFIGURE_FLAGS: "-Doptimization=g -Dcmocka=disabled" INSTALL_PATH: "${CI_PROJECT_DIR}/.local" @@ -91,7 +93,6 @@ default: - runner_system_failure stages: - - autoconf - precheck - build - unit @@ -161,11 +162,11 @@ stages: .freebsd-autoscaler-amd64: &freebsd_autoscaler_amd64 variables: CC: clang - CFLAGS: "${CFLAGS_COMMON} -Og" + CFLAGS: "${CFLAGS_COMMON}" GIT_CLONE_PATH: "${GIT_CLONE_PATH_INSTANCE_EXECUTOR}" # Use MIT Kerberos5 for BIND 9 GSS-API support because of FreeBSD Heimdal # incompatibility; see https://bugs.freebsd.org/275241. - EXTRA_CONFIGURE: "${WITH_LIBEDIT} --with-gssapi=/usr/local/bin/krb5-config" + EXTRA_CONFIGURE: "${WITH_LIBEDIT} -Doptimization=g --native-file ci/freebsd.ini" # Autoscaling GitLab Runner on AWS EC2 (FreeBSD 13) @@ -272,35 +273,23 @@ stages: <<: *base_image stage: precheck -.autoconf: &autoconf_job - <<: *default_triggering_rules - <<: *base_image - stage: autoconf - script: - - autoreconf -fi - artifacts: - untracked: true - .configure: &configure - - ${CONFIGURE} - --disable-maintainer-mode - --enable-developer - --enable-option-checking=fatal - --enable-dnstap - --with-cmocka - --with-libxml2 - --with-json-c - --enable-leak-detection + - meson setup + --libdir=lib + -Dcmocka=enabled + -Ddeveloper=enabled + -Dleak-detection=enabled + -Doptimization=1 $EXTRA_CONFIGURE - || (test -s config.log && cat config.log; exit 1) + build # change directory to the workspace before including this .find_python: &find_python - - PYTHON="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTHON)" + - PYTHON="$(cat build/bin/tests/system/isctest/vars/.build_vars/PYTHON)" - test -x "$PYTHON" .find_pytest: &find_pytest - - PYTEST="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTEST)" + - PYTEST="$(cat build/bin/tests/system/isctest/vars/.build_vars/PYTEST)" - test -x "$PYTEST" .parse_tsan: &parse_tsan @@ -308,51 +297,48 @@ stages: .check_readline_setup: &check_readline_setup - if [[ -n "${WITHOUT_LIBEDIT}" ]]; then - ! grep "^#define HAVE_LIBEDIT" config.h; + ! grep "^#define HAVE_LIBEDIT" build/config.h; elif [[ -n "${WITH_LIBEDIT}" ]]; then - grep -e "^#define HAVE_LIBEDIT" config.h; + grep -e "^#define HAVE_LIBEDIT" build/config.h; fi # Unpack release tarball and continue work in the extracted directory. .unpack_release_tarball: &unpack_release_tarball - - tar --extract --file bind-*.tar.xz + - tar --extract --file build/meson-dist/bind-*.tar.xz - rm -f bind-*.tar.xz - cd bind-* .fips-feature-test: &fips_feature_test - - if bin/tests/system/feature-test --have-fips-mode; then fips-mode-setup --check; fips-mode-setup --is-enabled; fi + - if build/feature-test --have-fips-mode; then fips-mode-setup --check; fips-mode-setup --is-enabled; fi .build: &build_job <<: *default_triggering_rules stage: build before_script: - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}" - - test -n "${OUT_OF_TREE_WORKSPACE}" && mkdir "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" script: - *configure - *check_readline_setup - - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1 - - test -z "${RUN_MAKE_INSTALL}" || make DESTDIR="${INSTALL_PATH}" install - - test -z "${RUN_MAKE_INSTALL}" || DESTDIR="${INSTALL_PATH}" sh util/check-make-install - - if [[ "${CFLAGS}" == *"-fsanitize=address"* ]]; then ( ! grep -F AddressSanitizer config.log ); fi - - test -z "${CROSS_COMPILATION}" || grep -F -A 1 "checking whether we are cross compiling" config.log | grep -q "result.*yes" - - test -z "${CROSS_COMPILATION}" || file lib/dns/gen | grep -F -q "ELF 64-bit LSB" - - test -z "${CROSS_COMPILATION}" || ( ! git ls-files -z --others --exclude lib/dns/gen | xargs -0 file | grep "ELF 64-bit LSB" ) - - if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi - - bin/named/named -V + - meson compile -C build + - meson compile -C build system-test-dependencies + - test -z "${BUILD_TEST_PREREQ}" || ninja -C build meson-test-prereq + - test -z "${RUN_MESON_INSTALL}" || meson install -C build --destdir=$INSTALL_PATH + - test -z "${RUN_MESON_INSTALL}" || DESTDIR="${INSTALL_PATH}" sh build/util/check-make-install + #- test -z "${CROSS_COMPILATION}" || grep -F -A 1 "checking whether we are cross compiling" config.log | grep -q "result.*yes" + - test -z "${CROSS_COMPILATION}" || file build/lib/dns/gen | grep -F -q "ELF 64-bit LSB" + #- test -z "${CROSS_COMPILATION}" || ( ! git ls-files -z --others --exclude lib/dns/gen | xargs -0 file | grep "ELF 64-bit LSB" ) + - build/named -V - *fips_feature_test - needs: - - job: autoreconf - artifacts: true + needs: [] artifacts: untracked: true when: always .setup_interfaces: &setup_interfaces - if [ "$(id -u)" -eq "0" ]; then - sh -x bin/tests/system/ifconfig.sh up; + sh -x build/bin/tests/system/ifconfig.sh up; else - sudo sh -x bin/tests/system/ifconfig.sh up; + sudo sh -x build/bin/tests/system/ifconfig.sh up; fi .display_pytest_failures: &display_pytest_failures @@ -407,7 +393,6 @@ stages: <<: *default_triggering_rules stage: system before_script: - - test -n "${OUT_OF_TREE_WORKSPACE}" && cp -r bin/tests/system/* "${OUT_OF_TREE_WORKSPACE}/bin/tests/system/" && cd "${OUT_OF_TREE_WORKSPACE}" - *setup_interfaces script: - *fips_feature_test @@ -418,9 +403,8 @@ stages: - > "$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt - '( ! grep -F "grep: warning:" pytest.out.txt )' - - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ( cd ../../.. && make clean >/dev/null 2>&1 ) + - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ( cd ../../.. && ninja -C build clean >/dev/null 2>&1 ) after_script: - - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - *display_pytest_failures .system_test: &system_test_job @@ -433,14 +417,6 @@ stages: reports: junit: junit.xml -.system_test_make_check: &system_test_make_check_job - <<: *system_test_common - script: - - cd bin/tests/system - - make -j${TEST_PARALLEL_JOBS:-1} check - after_script: - - cat bin/tests/system/test-suite.log || true - .system_test_gcov: &system_test_gcov_job <<: *system_test_common artifacts: @@ -453,35 +429,24 @@ stages: <<: *system_test_common after_script: - *display_pytest_failures - - find bin/tests/system -name "*dig.*" | xargs grep "error" || true - - *find_python - *parse_tsan - - > - "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml artifacts: untracked: true exclude: - "**/__pycache__/**/*" when: always reports: - junit: junit.xml + junit: junit.xml .unit_test_common: &unit_test_common <<: *default_triggering_rules stage: unit - before_script: - - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" script: - *fips_feature_test - - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 - - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || make clean >/dev/null 2>&1 + - meson test -C build --no-rebuild after_script: - - test -d bind-* && cd bind-* - - REALSOURCEDIR="$PWD" - - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - - *find_python - - > - "$PYTHON" "$REALSOURCEDIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml + - cp build/meson-logs/testlog.junit.xml $CI_PROJECT_DIR/junit.xml + - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ninja -C build clean >/dev/null 2>&1 .unit_test: &unit_test_job <<: *unit_test_common @@ -502,8 +467,6 @@ stages: after_script: - *find_python - *parse_tsan - - > - "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml artifacts: untracked: true when: always @@ -512,22 +475,22 @@ stages: .docs: &docs_job variables: - DOC_MAKE_TARGET: doc + DOC_BUILD_TARGET: man stage: docs script: - *configure - - make -j${BUILD_PARALLEL_JOBS:-1} -k ${DOC_MAKE_TARGET} V=1 - - find doc/man/ -maxdepth 1 -name "*.[0-9]" -exec mandoc -T lint "{}" \; | ( ! grep -v -e "skipping paragraph macro. sp after" -e "unknown font, skipping request. ft C" -e "input text line longer than 80 bytes" ) + - meson compile -C build ${DOC_BUILD_TARGET} + - find build/man/ -maxdepth 2 -name "*.[0-9]" -exec mandoc -T lint "{}" \; | ( ! grep -v -e "skipping paragraph macro. sp after" -e "unknown font, skipping request. ft C" -e "input text line longer than 80 bytes" ) .respdiff: &respdiff_job stage: system before_script: - - autoreconf -fi - *configure - - make -j${BUILD_PARALLEL_JOBS:-1} V=1 + - meson compile -C build - *setup_interfaces - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git - cd bind9-qa/respdiff + - sed -i -e 's|bin/named/|build/|g' -e 's|awk "/\\/bin\\/named\\/|awk "/build|g' respdiff.sh needs: [] artifacts: paths: @@ -541,9 +504,6 @@ stages: # Jobs in the precheck stage -autoreconf: - <<: *autoconf_job - misc: <<: *precheck_job script: @@ -585,15 +545,11 @@ ci-variables: stage: precheck <<: *precheck_job script: - - export BIND_BASELINE_BRANCH="$(sed -n -E "s|^m4_define\(\[bind_VERSION_MINOR\], ([0-9]+)\)dnl$|\1|p" configure.ac)" # When testing a .0 release, compare it against the previous development # release (e.g., 9.19.0 and 9.18.0 should both be compared against 9.17.22). - - if [ "$(sed -n -E "s|^m4_define\(\[bind_VERSION_PATCH\], ([0-9]+)\)dnl$|\1|p" configure.ac)" = "0" ]; then export BIND_BASELINE_BRANCH=$((BIND_BASELINE_BRANCH - 1 - (BIND_BASELINE_BRANCH % 2))); fi - - BIND_BASELINE_VERSION="$(curl -s "https://gitlab.isc.org/api/v4/projects/1/repository/tags?search=^v9.${BIND_BASELINE_BRANCH}&order_by=version" | jq -r ".[0].name")" + - export BIND_BASELINE_TAG=$(meson introspect meson.build --projectinfo | ./util/select-baseline-version.jq) + - BIND_BASELINE_VERSION="$(curl -s -G -d "version=^${BIND_BASELINE_TAG}" -d "order_by=version" "https://gitlab.isc.org/api/v4/projects/1/repository/tags" | jq -r '.[0].name')" - echo "BIND_BASELINE_VERSION=$BIND_BASELINE_VERSION" >> ci_vars.env - needs: - - job: autoreconf - artifacts: true artifacts: reports: dotenv: ci_vars.env @@ -685,21 +641,14 @@ tarball-create: <<: *base_image <<: *default_triggering_rules script: - - ./configure --enable-maintainer-mode - - make maintainer-clean - - autoreconf -fi - - ./configure --enable-maintainer-mode - - make -j${BUILD_PARALLEL_JOBS:-1} all V=1 + - *configure + - meson dist -C build --no-tests - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; git diff > diff.patch; exit 1; fi - - make -j${BUILD_PARALLEL_JOBS:-1} dist V=1 artifacts: paths: - diff.patch - - bind-*.tar.xz - when: always - needs: - - job: autoreconf - artifacts: true + - build/meson-dist/*.tar.xz + needs: [] # Jobs for doc builds on Debian 12 "bookworm" (amd64) @@ -713,7 +662,7 @@ changelog: GIT_AUTHOR_EMAIL: $GITLAB_USER_EMAIL GIT_COMMITTER_NAME: $GITLAB_USER_NAME GIT_COMMITTER_EMAIL: $GITLAB_USER_EMAIL - DOC_MAKE_TARGET: html + DOC_BUILD_TARGET: arm man before_script: - echo -e "$CI_MERGE_REQUEST_TITLE\n" > commitmsg - sed -i 's/^Draft:\s*//' commitmsg @@ -722,9 +671,7 @@ changelog: - ./contrib/gitchangelog/gitchangelog.py HEAD^..HEAD >> $(ls doc/changelog/changelog-9.* | sort --version-sort | tail -n 1) after_script: - git diff - needs: - - job: autoreconf - artifacts: true + needs: [] artifacts: untracked: true @@ -748,9 +695,7 @@ docs: <<: *default_triggering_rules <<: *base_image <<: *docs_job - needs: - - job: autoreconf - artifacts: true + needs: [] artifacts: untracked: true @@ -766,55 +711,36 @@ docs:tarball: # Job detecting named.conf breakage introduced since the previous point release -cross-version-config-tests: - stage: system - <<: *base_image - <<: *default_triggering_rules - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON}" - # Disable option checking to prevent problems with new default options in - # the &configure anchor. - EXTRA_CONFIGURE: "--disable-option-checking" - script: - - *configure - - *setup_interfaces - - make -j${BUILD_PARALLEL_JOBS:-1} - - git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git "bind-${BIND_BASELINE_VERSION}" - - cd "bind-${BIND_BASELINE_VERSION}" - - autoreconf -fi - - *configure - - make -j${BUILD_PARALLEL_JOBS:-1} - - *find_pytest - # The cross-version-config-tests job would fail when a system test is - # removed from the upcoming release. To avoid this, remove the system test - # also from the $BIND_BASELINE_VERSION. - - find bin/tests/system/ -mindepth 1 -maxdepth 1 -type d -exec sh -c 'test -e ../"$0" || rm -rfv -- "$0"' {} \; - - cd bin/tests/system - # System tests that employ binary drivers will fail on ABI change and - # should not be run. - - rm -r dlzexternal - - rm -r dyndb - # Run the setup phase of all system tests in the most recently tagged BIND 9 - # release using the binaries built for the current BIND 9 version. This - # intends to detect obvious backward compatibility issues with the latter. - - sed -i "s|f\"{AC_VARS\['TOP_BUILDDIR'\]}|\"$CI_PROJECT_DIR|g" isctest/vars/basic.py - - > - "$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}" - needs: - - job: autoreconf - artifacts: true - - job: ci-variables - artifacts: true - artifacts: - reports: - junit: junit.xml - paths: - - bind-* - - junit.xml - untracked: true - expire_in: "1 day" - when: always +# TODO: add when more meson versions are released +# cross-version-config-tests: +# stage: system +# <<: *base_image +# <<: *default_triggering_rules +# variables: +# CC: gcc +# CFLAGS: "${CFLAGS_COMMON}" +# AUTOCONF_CONFIGURE: "--disable-maintainer-mode --enable-developer --enable-leak-detection --enable-option-checking=fatal --disable-option-checking --with-cmocka" +# script: +# - *configure +# - *setup_interfaces +# - meson compile -C build system-test-init system-test-dependencies +# - meson compile -C build +# - *find_pytest +# - git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git "bind-${BIND_BASELINE_VERSION}" +# - cd "bind-${BIND_BASELINE_VERSION}" +# - autoreconf -fi +# needs: +# - job: ci-variables +# artifacts: true +# artifacts: +# reports: +# junit: junit.xml +# paths: +# - bind-* +# - junit.xml +# untracked: true +# expire_in: "1 day" +# when: always # Jobs for regular GCC builds on Alpine Linux 3.21 (amd64) @@ -846,7 +772,7 @@ gcc:almalinux8:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2" + EXTRA_CONFIGURE: "-Didn=enabled" <<: *almalinux_8_amd64_image <<: *build_job @@ -872,7 +798,7 @@ gcc:almalinux9:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2 --disable-developer" + EXTRA_CONFIGURE: "-Didn=enabled -Ddeveloper=disabled" <<: *almalinux_9_amd64_image <<: *build_job @@ -894,9 +820,10 @@ unit:gcc:almalinux9:amd64: gcc:8fips:amd64: variables: + BUILD_TEST_PREREQ: 1 CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2 --enable-fips-mode --disable-tracing" + EXTRA_CONFIGURE: "-Didn=enabled -Dfips=enabled -Dtracing=disabled" GIT_CLONE_PATH: "${GIT_CLONE_PATH_INSTANCE_EXECUTOR}" <<: *almalinux_8fips_amd64_image <<: *build_job @@ -923,7 +850,7 @@ gcc:9fips:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2 --enable-fips-mode --disable-leak-detection --disable-tracing" + EXTRA_CONFIGURE: "-Didn=enabled -Dfips=enabled -Dleak-detection=disabled" GIT_CLONE_PATH: "${GIT_CLONE_PATH_INSTANCE_EXECUTOR}" <<: *almalinux_9fips_amd64_image <<: *build_job @@ -952,8 +879,8 @@ gcc:tarball:nosphinx: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2 --disable-developer" - RUN_MAKE_INSTALL: 1 + EXTRA_CONFIGURE: "-Didn=enabled -Ddeveloper=disabled" + RUN_MESON_INSTALL: 1 <<: *almalinux_9_amd64_image <<: *build_job before_script: @@ -968,10 +895,10 @@ gcc:tarball:nosphinx: gcc:bookworm:amd64: variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} --coverage -O0" + CFLAGS: "${CFLAGS_COMMON}" # Tracing needs to be disabled otherwise gcovr fails - EXTRA_CONFIGURE: "--with-libidn2 ${WITH_LIBEDIT} --disable-tracing" - RUN_MAKE_INSTALL: 1 + EXTRA_CONFIGURE: "-Doptimization=0 -Db_coverage=true -Dtracing=disabled -Didn=enabled ${WITH_LIBEDIT}" + RUN_MESON_INSTALL: 1 <<: *debian_bookworm_amd64_image <<: *build_job @@ -996,30 +923,6 @@ unit:gcc:bookworm:amd64: - job: gcc:bookworm:amd64 artifacts: true -# Jobs for RBT zone- & cache-enabled GCC builds on Debian 12 "bookworm" (amd64) - -gcc:bookworm:rbt:amd64: - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2" - <<: *debian_bookworm_amd64_image - <<: *build_job - -system:gcc:bookworm:rbt:amd64: - <<: *debian_bookworm_amd64_image - <<: *system_test_job - needs: - - job: gcc:bookworm:rbt:amd64 - artifacts: true - -unit:gcc:bookworm:rbt:amd64: - <<: *debian_bookworm_amd64_image - <<: *unit_test_job - needs: - - job: gcc:bookworm:rbt:amd64 - artifacts: true - # Build job for cross-compiled GCC builds on 64-bit Debian 12 "bookworm" # (amd64) with 32-bit BIND 9. @@ -1027,7 +930,7 @@ gcc:bookworm:amd64cross32: variables: CFLAGS: "${CFLAGS_COMMON}" CROSS_COMPILATION: 1 - EXTRA_CONFIGURE: "--build=x86_64-linux-gnu --host=i686-linux-gnu --with-libidn2 ${WITH_LIBEDIT}" + EXTRA_CONFIGURE: "--cross-file ci/amd64cross32.ini -Didn=enabled -Dgssapi=disabled -Dtracing=disabled ${WITH_LIBEDIT}" <<: *debian_bookworm_amd64cross32_image <<: *build_job @@ -1038,7 +941,7 @@ gcc:bookworm:amd64cross32: --keep-cc --status-bugs --keep-going - -o scan-build.reports make -j${BUILD_PARALLEL_JOBS:-1} all V=1 + -o scan-build.reports ninja -C build scan-build: <<: *default_triggering_rules @@ -1047,14 +950,11 @@ scan-build: variables: CC: "${CLANG}" CFLAGS: "${CFLAGS_COMMON}" - CONFIGURE: "${SCAN_BUILD} ./configure" - EXTRA_CONFIGURE: "--with-libidn2" + EXTRA_CONFIGURE: "-Didn=enabled" + SCANBUILD: "${CI_PROJECT_DIR}/scan-build.sh" script: - *configure - *scan_build - needs: - - job: autoreconf - artifacts: true artifacts: paths: - scan-build.reports/ @@ -1064,14 +964,15 @@ scan-build: # Run with pkcs11-provider tests gcc:ossl3:sid:amd64: - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON} -O3 -DOPENSSL_NO_DEPRECATED=1 -DOPENSSL_API_COMPAT=30000" - # See https://gitlab.isc.org/isc-projects/bind9/-/issues/3444 - EXTRA_CONFIGURE: "--without-jemalloc --disable-leak-detection" - RUN_MAKE_INSTALL: 1 <<: *debian_sid_amd64_image <<: *build_job + variables: + BUILD_TEST_PREREQ: 1 + CC: gcc + CFLAGS: "${CFLAGS_COMMON} -DOPENSSL_NO_DEPRECATED=1 -DOPENSSL_API_COMPAT=30000" + # See https://gitlab.isc.org/isc-projects/bind9/-/issues/3444 + EXTRA_CONFIGURE: "-Doptimization=3 -Djemalloc=disabled -Dleak-detection=disabled" + RUN_MESON_INSTALL: 1 system:gcc:ossl3:sid:amd64: # Set up environment variables to run pkcs11-provider based system tests @@ -1092,16 +993,17 @@ unit:gcc:ossl3:amd64: artifacts: true # Jobs for regular GCC builds on Debian "sid" (amd64) -# Also tests configration option: --without-lmdb. +# Also tests configration option: -Dlmdb=disabled gcc:sid:amd64: - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON} -O3" - EXTRA_CONFIGURE: "--with-libidn2 --without-lmdb ${WITH_LIBEDIT}" - RUN_MAKE_INSTALL: 1 <<: *debian_sid_amd64_image <<: *build_job + variables: + CC: gcc + CFLAGS: "${CFLAGS_COMMON}" + EXTRA_CONFIGURE: "-Doptimization=3 -Didn=enabled -Dlmdb=disabled ${WITH_LIBEDIT}" + RUN_MESON_INSTALL: 1 + BUILD_TEST_PREREQ: 1 system:gcc:sid:amd64: <<: *debian_sid_amd64_image @@ -1119,45 +1021,13 @@ unit:gcc:sid:amd64: - job: gcc:sid:amd64 artifacts: true -# Job for out-of-tree GCC build on Debian 12 "bookworm" (amd64) -# Also tests configration option: --with-lmdb. - -gcc:out-of-tree: - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON} -Og" - CONFIGURE: "${CI_PROJECT_DIR}/configure" - EXTRA_CONFIGURE: "--with-libidn2 --with-lmdb" - RUN_MAKE_INSTALL: 1 - OUT_OF_TREE_WORKSPACE: workspace - <<: *base_image - <<: *build_job - -system:gcc:out-of-tree: - variables: - OUT_OF_TREE_WORKSPACE: workspace - needs: - - job: gcc:out-of-tree - artifacts: true - <<: *base_image - <<: *system_test_job - -unit:gcc:out-of-tree: - variables: - OUT_OF_TREE_WORKSPACE: workspace - needs: - - job: gcc:out-of-tree - artifacts: true - <<: *base_image - <<: *unit_test_job - # Jobs for tarball GCC builds on Debian 12 "bookworm" (amd64) gcc:tarball: variables: CC: gcc - EXTRA_CONFIGURE: "--with-libidn2" - RUN_MAKE_INSTALL: 1 + EXTRA_CONFIGURE: "-Didn=enabled" + RUN_MESON_INSTALL: 1 <<: *base_image <<: *build_job before_script: @@ -1191,17 +1061,17 @@ unit:gcc:tarball: # Jobs for debug GCC builds on openSUSE Tumbleweed (amd64) gcc:tumbleweed:amd64: + <<: *tumbleweed_latest_amd64_image + <<: *build_job variables: CC: gcc CFLAGS: "${CFLAGS_COMMON} -DDEBUG" - EXTRA_CONFIGURE: "--with-libidn2 ${WITH_LIBEDIT}" - <<: *tumbleweed_latest_amd64_image - <<: *build_job + EXTRA_CONFIGURE: "-Didn=enabled ${WITH_LIBEDIT}" + BUILD_TEST_PREREQ: 1 system:gcc:tumbleweed:amd64: <<: *tumbleweed_latest_amd64_image <<: *system_test_job - <<: *system_test_make_check_job needs: - job: gcc:tumbleweed:amd64 artifacts: true @@ -1219,7 +1089,7 @@ gcc:jammy:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--disable-geoip --with-libidn2 --disable-doh --disable-dnstap --without-cmocka --without-gssapi" + EXTRA_CONFIGURE: "-Dgeoip=disabled -Didn=enabled -Ddoh=disabled -Dcmocka=disabled -Ddnstap=disabled -Dgssapi=disabled" <<: *ubuntu_jammy_amd64_image <<: *build_job @@ -1245,7 +1115,7 @@ gcc:noble:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2" + EXTRA_CONFIGURE: "-Didn=enabled" <<: *ubuntu_noble_amd64_image <<: *build_job @@ -1268,9 +1138,9 @@ unit:gcc:noble:amd64: gcc:asan: variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined" - LDFLAGS: "-fsanitize=address,undefined" - EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc" + CFLAGS: "${CFLAGS_COMMON}" + EXTRA_CONFIGURE: "-Db_sanitize=address,undefined -Didn=enabled -Djemalloc=disabled -Dtracing=disabled" + BUILD_TEST_PREREQ: 1 <<: *fedora_42_amd64_image <<: *build_job @@ -1293,9 +1163,8 @@ unit:gcc:asan: clang:asan: variables: CC: ${CLANG} - CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined" - LDFLAGS: "-fsanitize=address,undefined" - EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc" + CFLAGS: "${CFLAGS_COMMON}" + EXTRA_CONFIGURE: "-Db_sanitize=address,undefined -Db_lundef=false -Didn=enabled -Djemalloc=disabled -Dtracing=disabled" <<: *base_image <<: *build_job @@ -1322,9 +1191,10 @@ unit:clang:asan: gcc:tsan: variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} -Wno-stringop-overread -ggdb -O2 -fsanitize=thread" - LDFLAGS: "-fsanitize=thread -Wl,--disable-new-dtags" - EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig" + CFLAGS: "${CFLAGS_COMMON} -Wno-stringop-overread" + LDFLAGS: "-Wl,--disable-new-dtags" + EXTRA_CONFIGURE: "${TSAN_CONFIGURE_FLAGS_COMMON}" + BUILD_TEST_PREREQ: 1 <<: *tsan_fedora_42_amd64_image <<: *build_job @@ -1353,10 +1223,9 @@ clang:tsan: <<: *build_job variables: CC: "${CLANG}" - CFLAGS: "${CFLAGS_COMMON} -ggdb -O2 -fsanitize=thread" - # -Wl,--disable-new-dtags ensures that Clang creates valid TSAN reports - LDFLAGS: "-fsanitize=thread -Wl,--disable-new-dtags" - EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig" + CFLAGS: "${CFLAGS_COMMON}" + LDFLAGS: "-Wl,--disable-new-dtags" + EXTRA_CONFIGURE: "${TSAN_CONFIGURE_FLAGS_COMMON} -Db_lundef=false" system:clang:tsan: variables: @@ -1412,8 +1281,8 @@ clang:bookworm:amd64: CC: ${CLANG} CFLAGS: "${CFLAGS_COMMON} -Wenum-conversion -DOPENSSL_API_COMPAT=10100" # See https://gitlab.isc.org/isc-projects/bind9/-/issues/3444 - EXTRA_CONFIGURE: "--without-jemalloc --disable-leak-detection" - RUN_MAKE_INSTALL: 1 + EXTRA_CONFIGURE: "-Djemalloc=disabled -Dleak-detection=disabled" + RUN_MESON_INSTALL: 1 <<: *debian_bookworm_amd64_image <<: *build_job @@ -1482,7 +1351,7 @@ release: <<: *base_image stage: release script: - - export BIND_DIRECTORY="$(basename bind-*.tar.xz ".tar.xz")" + - export BIND_DIRECTORY="$(basename build/meson-dist/bind-*.tar.xz ".tar.xz")" # Prepare release tarball contents (tarballs + documentation) - mkdir -p "${BIND_DIRECTORY}-release/doc/arm" - pushd "${BIND_DIRECTORY}-release" @@ -1605,7 +1474,7 @@ customer-git:tag: - test -d /tmp/cov-analysis-linux64-* .coverity_build: &coverity_build - - /tmp/cov-analysis-linux64-*/bin/cov-build --dir /tmp/cov-int --fs-capture-search . sh -c 'make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1' + - /tmp/cov-analysis-linux64-*/bin/cov-build --dir /tmp/cov-int --fs-capture-search . sh -c 'ninja -C ./build -v' - tar --create --gzip --file=/tmp/cov-int.tar.gz --directory /tmp cov-int - curl -v https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN @@ -1621,17 +1490,15 @@ coverity: stage: postcheck variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} -Og" - EXTRA_CONFIGURE: "--with-libidn2" + CFLAGS: "${CFLAGS_COMMON}" + EXTRA_CONFIGURE: "-Doptimization=g -Ddoc=disabled -Didn=enabled" script: - *coverity_prep - *configure - *coverity_build after_script: - mv -v /tmp/cov-int.tar.gz ${CI_PROJECT_DIR}/ - needs: - - job: autoreconf - artifacts: true + needs: [] artifacts: paths: - curl-response.txt @@ -1649,11 +1516,12 @@ respdiff: <<: *debian_bookworm_amd64_image variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} -Og -DISC_TRACK_PTHREADS_OBJECTS" + CFLAGS: "${CFLAGS_COMMON} -DISC_TRACK_PTHREADS_OBJECTS" + EXTRA_CONFIGURE: "-Doptimization=g" MAX_DISAGREEMENTS_PERCENTAGE: "0.3" script: - bash respdiff.sh -m /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named" - - cd ../.. && make clean >/dev/null 2>&1 + - cd ../.. && ninja -C build clean >/dev/null 2>&1 respdiff:asan: <<: *respdiff_job @@ -1661,13 +1529,12 @@ respdiff:asan: <<: *debian_bookworm_amd64_image variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} -Og -fsanitize=address,undefined" - LDFLAGS: "-fsanitize=address,undefined" - EXTRA_CONFIGURE: "--without-jemalloc" + CFLAGS: "${CFLAGS_COMMON}" + EXTRA_CONFIGURE: "-Doptimization=g -Db_sanitize=address,undefined -Djemalloc=disabled" MAX_DISAGREEMENTS_PERCENTAGE: "0.3" script: - bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named" - - cd ../.. && make clean >/dev/null 2>&1 + - cd ../.. && ninja -C build clean >/dev/null 2>&1 respdiff:tsan: <<: *respdiff_job @@ -1675,14 +1542,14 @@ respdiff:tsan: <<: *tsan_debian_bookworm_amd64_image variables: CC: "${CLANG}" - CFLAGS: "${CFLAGS_COMMON} -ggdb -O2 -fsanitize=thread" - LDFLAGS: "-fsanitize=thread -Wl,--disable-new-dtags" - EXTRA_CONFIGURE: "--enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig" + CFLAGS: "${CFLAGS_COMMON}" + LDFLAGS: "-Wl,--disable-new-dtags" + EXTRA_CONFIGURE: "${TSAN_CONFIGURE_FLAGS_COMMON} -Db_lundef=false" MAX_DISAGREEMENTS_PERCENTAGE: "0.3" TSAN_OPTIONS: "${TSAN_OPTIONS_DEBIAN}" script: - bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named" - - cd ../.. && make clean >/dev/null 2>&1 + - cd ../.. && ninja -C build clean >/dev/null 2>&1 after_script: - *find_python - *parse_tsan @@ -1693,11 +1560,12 @@ respdiff-third-party: <<: *debian_bookworm_amd64_image variables: CC: gcc - CFLAGS: "${CFLAGS_COMMON} -Og" + CFLAGS: "${CFLAGS_COMMON}" + EXTRA_CONFIGURE: "-Doptimization=g" MAX_DISAGREEMENTS_PERCENTAGE: "0.3" script: - bash respdiff.sh -s third_party -q "${PWD}/100k_mixed.txt" -c 1 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" - - cd ../.. && make clean >/dev/null 2>&1 + - cd ../.. && ninja -C build clean >/dev/null 2>&1 # Performance tests @@ -1760,6 +1628,25 @@ stress-test-child-pipeline: - job: generate-stress-test-configs artifacts: true +# Simple reproductibilty test, needs an image with meson >=1.6.0 +reproducible-build: + <<: *default_triggering_rules + <<: *alpine_3_21_amd64_image + stage: postcheck + needs: [] + variables: + CC: gcc + CFLAGS: "${CFLAGS_COMMON}" + script: + - meson reprotest + --intermediaries + -- + -Ddoc=disabled + -Doptimization=1 + artifacts: + untracked: true + when: on_failure + # git fsck operates over the whole repository and is sufficient to schedule it # only in one branch, preferably "main". GitLab's clone strategy prevents us # from using the "bind9" repo clone; we need to clone it ourselves. @@ -1786,37 +1673,24 @@ gcov: script: # Ensure gcov files for unit tests are found via tests/ rather than # lib/*/tests/ to prevent confusing gcovr. - - find lib/ -name tests -type l -delete - # The "a-conftest.gcno" file is result of the ./configure step and - # should be removed as it does not belong to the BIND 9 code base. - - rm a-conftest.gcno - # Generate XML file in the Cobertura XML format suitable for use by GitLab - # for the purpose of displaying code coverage information in the diff view - # of a given merge request. - - gcovr --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude tests --cobertura-pretty -o coverage.xml - - gcovr --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude tests --html-details -o coverage.html - - gcovr --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude tests --txt -o coverage.txt - - tail -n 3 coverage.txt + # - find lib/ -name tests -type l -delete + - ninja -C build coverage + - tail -n 3 build/meson-logs/coverage.txt coverage: /^TOTAL.*\s+(\d+\%)$/ artifacts: paths: - - coverage*.html - - coverage.css - - coverage.txt - - coverage.xml + - build/meson-logs/ reports: coverage_report: coverage_format: cobertura - path: coverage.xml + path: build/meson-logs/coverage.xml -# Pairwise testing of ./configure options +# Pairwise testing of build options pairwise: <<: *base_image stage: build - needs: - - job: autoreconf - artifacts: true + needs: [] script: - util/pairwise-testing.sh artifacts: diff --git a/.reuse/dep5 b/.reuse/dep5 index e17eb58f45..07b87f2d30 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -62,7 +62,7 @@ Files: **/*.after* bin/tests/system/forward/CA/index.txt bin/tests/system/forward/CA/index.txt.attr bin/tests/system/forward/CA/serial - bin/tests/system/isctest/vars/.ac_vars/* + bin/tests/system/isctest/vars/.build_vars/* bin/tests/system/journal/ns1/managed-keys.bind.in bin/tests/system/journal/ns1/managed-keys.bind.jnl.in bin/tests/system/journal/ns2/managed-keys.bind.in diff --git a/LICENSES/Autoconf-exception-3.0.txt b/LICENSES/Autoconf-exception-3.0.txt deleted file mode 100644 index f212f9c7bc..0000000000 --- a/LICENSES/Autoconf-exception-3.0.txt +++ /dev/null @@ -1,26 +0,0 @@ -AUTOCONF CONFIGURE SCRIPT EXCEPTION - -Version 3.0, 18 August 2009 -Copyright © 2009 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This Exception is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception. - -The purpose of this Exception is to allow distribution of Autoconf's typical output under terms of the recipient's choice (including proprietary). - -0. Definitions. - -"Covered Code" is the source or object code of a version of Autoconf that is a covered work under this License. - -"Normally Copied Code" for a version of Autoconf means all parts of its Covered Code which that version can copy from its code (i.e., not from its input file) into its minimally verbose, non-debugging and non-tracing output. - -"Ineligible Code" is Covered Code that is not Normally Copied Code. - -1. Grant of Additional Permission. - -You have permission to propagate output of Autoconf, even if such propagation would otherwise violate the terms of GPLv3. However, if by modifying Autoconf you cause any Ineligible Code of the version you received to become Normally Copied Code of your modified version, then you void this Exception for the resulting covered work. If you convey that resulting covered work, you must remove this Exception in accordance with the second paragraph of Section 7 of GPLv3. - -2. No Weakening of Autoconf Copyleft. - -The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of Autoconf. diff --git a/LICENSES/FSFAP.txt b/LICENSES/FSFAP.txt deleted file mode 100644 index 32bc8a8898..0000000000 --- a/LICENSES/FSFAP.txt +++ /dev/null @@ -1 +0,0 @@ -Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt deleted file mode 100644 index d41c0bd98f..0000000000 --- a/LICENSES/GPL-3.0-or-later.txt +++ /dev/null @@ -1,232 +0,0 @@ -GNU GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -Preamble - -The GNU General Public License is a free, copyleft license for software and other kinds of works. - -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. - -For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. - -Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and modification follow. - -TERMS AND CONDITIONS - -0. Definitions. - -“This License” refers to version 3 of the GNU General Public License. - -“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - -“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. - -To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. - -A “covered work” means either the unmodified Program or a work based on the Program. - -To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - -To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - -1. Source Code. -The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. - -A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - -The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - -The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -2. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. - - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - -6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - -A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - -“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - -7. Additional Terms. -“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - -All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - -8. Termination. -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - -9. Acceptance Not Required for Having Copies. -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - -10. Automatic Licensing of Downstream Recipients. -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - -An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - -11. Patents. -A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. - -A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - -In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - -A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - -12. No Surrender of Others' Freedom. -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - -13. Use with the GNU Affero General Public License. -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. - -14. Revised Versions of this License. -The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - -15. Disclaimer of Warranty. -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. Limitation of Liability. -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -17. Interpretation of Sections 15 and 16. -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. - -You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . - -The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 9a81318050..0000000000 --- a/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -include $(top_srcdir)/Makefile.top - -SUBDIRS = . lib doc - -# build libtest before fuzz/* and bin/tests -SUBDIRS += tests - -# run fuzz tests before system tests -SUBDIRS += fuzz bin - -BUILT_SOURCES += bind.keys.h -CLEANFILES += bind.keys.h - -bind.keys.h: bind.keys Makefile - ${PERL} ${top_srcdir}/util/bindkeys.pl ${top_srcdir}/bind.keys > $@ - -.PHONY: doc - -EXTRA_DIST = \ - bind.keys \ - util/bindkeys.pl \ - util/dtrace.sh \ - contrib \ - COPYRIGHT \ - LICENSE \ - *.md - -dist-hook: - find $(distdir) -type f -name .gitignore -delete - git rev-parse --short HEAD | cut -b1-7 > $(distdir)/srcid diff --git a/Makefile.docs b/Makefile.docs deleted file mode 100644 index a205c5efc7..0000000000 --- a/Makefile.docs +++ /dev/null @@ -1,59 +0,0 @@ -SPHINX_V = $(SPHINX_V_@AM_V@) -SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@) -SPHINX_V_0 = -q -SPHINX_V_1 = -n -SPHINX_W = -W - -AM_V_SPHINX = $(AM_V_SPHINX_@AM_V@) -AM_V_SPHINX_ = $(AM_V_SPHINX_@AM_DEFAULT_V@) -AM_V_SPHINX_0 = @echo " SPHINX $@"; - -SPHINXBUILDDIR = $(builddir)/_build - -LF = \n -RNDC_CONF = .. |rndc_conf| replace:: ``$(sysconfdir)/rndc.conf`` -RNDC_KEY = .. |rndc_key| replace:: ``$(sysconfdir)/rndc.key`` -NAMED_CONF = .. |named_conf| replace:: ``$(sysconfdir)/named.conf`` -NAMED_PID = .. |named_pid| replace:: ``$(runstatedir)/named.pid`` -SESSION_KEY = .. |session_key| replace:: ``$(runstatedir)/session.key`` - -export RST_EPILOG = $(RNDC_CONF)$(LF)$(RNDC_KEY)$(LF)$(NAMED_CONF)$(LF)$(BIND_KEYS)$(LF)$(NAMED_PID)$(LF)$(SESSION_KEY) - -common_SPHINXOPTS = \ - $(SPHINX_W) \ - -c $(srcdir) \ - -a \ - $(SPHINX_V) - -ALLSPHINXOPTS = \ - $(common_SPHINXOPTS) \ - -D rst_epilog="$$(printf "$${RST_EPILOG}")" \ - $(SPHINXOPTS) \ - $(srcdir) - -_ = @ -man_RNDC_CONF = .. |rndc_conf| replace:: ``$(_)sysconfdir$(_)/rndc.conf`` -man_RNDC_KEY = .. |rndc_key| replace:: ``$(_)sysconfdir$(_)/rndc.key`` -man_NAMED_CONF = .. |named_conf| replace:: ``$(_)sysconfdir$(_)/named.conf`` -man_BIND_KEYS = .. |bind_keys| replace:: ``$(_)sysconfdir$(_)/bind.keys`` -man_NAMED_PID = .. |named_pid| replace:: ``$(_)runstatedir$(_)/named.pid`` -man_SESSION_KEY = .. |session_key| replace:: ``$(_)runstatedir$(_)/session.key`` - -export man_RST_EPILOG = $(man_RNDC_CONF)$(LF)$(man_RNDC_KEY)$(LF)$(man_NAMED_CONF)$(LF)$(man_BIND_KEYS)$(LF)$(man_NAMED_PID)$(LF)$(man_SESSION_KEY) - -man_SPHINXOPTS = \ - $(common_SPHINXOPTS) \ - -D version="@""PACKAGE_VERSION@" \ - -D today="@""RELEASE_DATE@" \ - -D release="@""PACKAGE_VERSION@" \ - -D rst_epilog="$$(printf "$${man_RST_EPILOG}")" \ - $(SPHINXOPTS) \ - $(srcdir) - -AM_V_SED = $(AM_V_SED_@AM_V@) -AM_V_SED_ = $(AM_V_SED_@AM_DEFAULT_V@) -AM_V_SED_0 = @echo " SED $@"; - -AM_V_CFG_TEST = $(AM_V_CFG_TEST_@AM_V@) -AM_V_CFG_TEST_ = $(AM_V_CFG_TEST_@AM_DEFAULT_V@) -AM_V_CFG_TEST_0 = @echo " CFG_GEN $@"; diff --git a/Makefile.dtrace b/Makefile.dtrace deleted file mode 100644 index 9cb6b002b9..0000000000 --- a/Makefile.dtrace +++ /dev/null @@ -1,20 +0,0 @@ -# Hey Emacs, this is -*- makefile-automake -*- file! -# vim: filetype=automake - -AM_V_DTRACE = $(AM_V_DTRACE_@AM_V@) -AM_V_DTRACE_ = $(AM_V_DTRACE_@AM_DEFAULT_V@) -AM_V_DTRACE_0 = @echo " DTRACE $@"; - -BUILT_SOURCES += probes.h -CLEANFILES += probes.h probes.o - -probes.h: Makefile probes.d - $(AM_V_DTRACE)$(DTRACE) -s $(srcdir)/probes.d -h -o $@ -probes.lo: Makefile probes.d $(DTRACE_DEPS) - $(AM_V_DTRACE)$(LIBTOOL) --mode=compile --tag=CC $(DTRACE) -s $(srcdir)/probes.d -G -o $@ $(DTRACE_OBJS) - -if HAVE_DTRACE -if !HOST_MACOS -DTRACE_LIBADD = probes.lo -endif -endif diff --git a/Makefile.tests b/Makefile.tests deleted file mode 100644 index a0ea914d40..0000000000 --- a/Makefile.tests +++ /dev/null @@ -1,28 +0,0 @@ -# Hey Emacs, this is -*- makefile-automake -*- file! -# vim: filetype=automake - -unit-local: check - -if HAVE_CMOCKA -TESTS = $(check_PROGRAMS) -endif HAVE_CMOCKA - -LOG_COMPILER = $(top_builddir)/tests/unit-test-driver.sh - -AM_CFLAGS += \ - -I$(top_srcdir)/tests/include \ - $(TEST_CFLAGS) - -AM_CPPFLAGS += \ - $(CMOCKA_CFLAGS) \ - -DNAMED_PLUGINDIR=\"$(pkglibdir)\" \ - -DTESTS_DIR=\"$(abs_srcdir)\" - -LDADD += \ - $(top_builddir)/tests/libtest/libtest.la \ - $(CMOCKA_LIBS) - -if HAVE_JEMALLOC -AM_CFLAGS += $(JEMALLOC_CFLAGS) -LDADD += $(JEMALLOC_LIBS) -endif diff --git a/Makefile.top b/Makefile.top deleted file mode 100644 index da95a2d47a..0000000000 --- a/Makefile.top +++ /dev/null @@ -1,73 +0,0 @@ -# Hey Emacs, this is -*- makefile-automake -*- file! -# vim: filetype=automake - -ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4 - -AM_CFLAGS = \ - $(STD_CFLAGS) - -AM_CPPFLAGS = \ - $(STD_CPPFLAGS) \ - -include $(top_builddir)/config.h \ - -I$(srcdir)/include - -AM_LDFLAGS = \ - $(STD_LDFLAGS) -LDADD = - -BUILT_SOURCES = -CLEANFILES = - -if HOST_MACOS -AM_LDFLAGS += \ - -Wl,-flat_namespace -endif HOST_MACOS - -if HAVE_JEMALLOC -LIBISC_CFLAGS = $(JEMALLOC_CFLAGS) -LIBISC_LIBS = $(JEMALLOC_LIBS) -else -LIBISC_CFLAGS = -LIBISC_LIBS = -endif - -LIBISC_CFLAGS += \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib/isc/include \ - -I$(top_builddir)/lib/isc/include - -LIBISC_LIBS += $(top_builddir)/lib/isc/libisc.la -if HAVE_DTRACE -LIBISC_DTRACE = $(top_builddir)/lib/isc/probes.lo -endif - -LIBDNS_CFLAGS = \ - -I$(top_srcdir)/lib/dns/include \ - -I$(top_builddir)/lib/dns/include - -LIBDNS_LIBS = \ - $(top_builddir)/lib/dns/libdns.la -if HAVE_DTRACE -LIBDNS_DTRACE = $(top_builddir)/lib/dns/probes.lo -endif - -LIBNS_CFLAGS = \ - -I$(top_srcdir)/lib/ns/include - -LIBNS_LIBS = \ - $(top_builddir)/lib/ns/libns.la -if HAVE_DTRACE -LIBNS_DTRACE = $(top_builddir)/lib/ns/probes.lo -endif - -LIBISCCFG_CFLAGS = \ - -I$(top_srcdir)/lib/isccfg/include - -LIBISCCFG_LIBS = \ - $(top_builddir)/lib/isccfg/libisccfg.la - -LIBISCCC_CFLAGS = \ - -I$(top_srcdir)/lib/isccc/include/ - -LIBISCCC_LIBS = \ - $(top_builddir)/lib/isccc/libisccc.la diff --git a/README.md b/README.md index 16ede04c17..5d525ef6c0 100644 --- a/README.md +++ b/README.md @@ -144,12 +144,11 @@ be viewed at [https://bind9.readthedocs.io/en/latest/index.html](https://bind9.r The PDF version can be built by running: - cd doc/arm/ - sphinx-build -b latex . pdf/ - make -C pdf/ all-pdf + meson setup build + ninja -C build arm-pdf The above requires TeX Live in order to work. The PDF will be written to -`doc/arm/pdf/Bv9ARM.pdf`. +`build/arm-pdf/latex/Bv9ARM.pdf`. Man pages for some of the programs in the BIND 9 distribution are also included in the BIND ARM. diff --git a/bin/Makefile.am b/bin/Makefile.am deleted file mode 100644 index ba7658e1a7..0000000000 --- a/bin/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen tests plugins diff --git a/bin/check/Makefile.am b/bin/check/Makefile.am deleted file mode 100644 index c25dc4d3bf..0000000000 --- a/bin/check/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) - -AM_CPPFLAGS += \ - -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\" - -noinst_LTLIBRARIES = libcheck-tool.la - -libcheck_tool_la_SOURCES = \ - check-tool.h \ - check-tool.c - -LDADD += \ - libcheck-tool.la \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBNS_LIBS) \ - $(LIBISCCFG_LIBS) - -bin_PROGRAMS = named-checkconf named-checkzone - -install-exec-hook: - ln -f $(DESTDIR)$(bindir)/named-checkzone \ - $(DESTDIR)$(bindir)/named-compilezone - -uninstall-hook: - -rm -f $(DESTDIR)$(bindir)/named-compilezone diff --git a/bin/check/meson.build b/bin/check/meson.build new file mode 100644 index 0000000000..092d64911d --- /dev/null +++ b/bin/check/meson.build @@ -0,0 +1,21 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +named_checkconf_src += files('check-tool.c', 'named-checkconf.c') +named_checkzone_src += files('check-tool.c', 'named-checkzone.c') + +manrst_srcset.add( + files( + 'named-checkconf.rst', + 'named-checkzone.rst', + 'named-compilezone.rst', + ), +) diff --git a/bin/confgen/Makefile.am b/bin/confgen/Makefile.am deleted file mode 100644 index c1dca43194..0000000000 --- a/bin/confgen/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - -DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\" - -LDADD += \ - libconfgen.la \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) - -noinst_LTLIBRARIES = libconfgen.la - -libconfgen_la_SOURCES = \ - include/confgen/os.h \ - keygen.c \ - keygen.h \ - os.c \ - util.c \ - util.h - -sbin_PROGRAMS = tsig-keygen rndc-confgen - -install-exec-hook: - ln -f $(DESTDIR)$(sbindir)/tsig-keygen \ - $(DESTDIR)$(sbindir)/ddns-confgen - -uninstall-hook: - -rm -f $(DESTDIR)$(sbindir)/ddns-confgen diff --git a/bin/confgen/meson.build b/bin/confgen/meson.build new file mode 100644 index 0000000000..026c00bfe3 --- /dev/null +++ b/bin/confgen/meson.build @@ -0,0 +1,23 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +confgen_inc_p = include_directories('.', 'include') + +rndc_confgen_src += files('keygen.c', 'os.c', 'rndc-confgen.c', 'util.c') +tsig_keygen_src += files('keygen.c', 'os.c', 'tsig-keygen.c', 'util.c') + +manrst_srcset.add( + files( + 'ddns-confgen.rst', + 'rndc-confgen.rst', + 'tsig-keygen.rst', + ), +) diff --git a/bin/delv/Makefile.am b/bin/delv/Makefile.am deleted file mode 100644 index 1930c241f7..0000000000 --- a/bin/delv/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - -I$(top_builddir)/include \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(OPENSSL_CFLAGS) - -AM_CPPFLAGS += \ - -DSYSCONFDIR=\"${sysconfdir}\" - -bin_PROGRAMS = delv - -delv_SOURCES = \ - delv.c - -delv_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBNS_LIBS) \ - $(LIBISCCFG_LIBS) \ - $(OPENSSL_LIBS) diff --git a/bin/delv/meson.build b/bin/delv/meson.build new file mode 100644 index 0000000000..9ca88552f3 --- /dev/null +++ b/bin/delv/meson.build @@ -0,0 +1,14 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +delv_src += files('delv.c') + +manrst_srcset.add(files('delv.rst')) diff --git a/bin/dig/Makefile.am b/bin/dig/Makefile.am deleted file mode 100644 index 0aadcd3bc2..0000000000 --- a/bin/dig/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(LIBIDN2_CFLAGS) \ - $(OPENSSL_CFLAGS) \ - $(LIBEDIT_CFLAGS) \ - $(LIBUV_CFLAGS) \ - $(OPENSSL_CFLAGS) - -LDADD += \ - libdighost.la \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBISCCFG_LIBS) \ - $(OPENSSL_LIBS) \ - $(LIBEDIT_LIBS) \ - $(LIBIDN2_LIBS) - -noinst_LTLIBRARIES = libdighost.la - -libdighost_la_SOURCES = \ - dighost.h \ - dighost.c - -bin_PROGRAMS = dig host nslookup diff --git a/bin/dig/meson.build b/bin/dig/meson.build new file mode 100644 index 0000000000..0392060ce2 --- /dev/null +++ b/bin/dig/meson.build @@ -0,0 +1,22 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dig_src += files('dig.c', 'dighost.c') +host_src += files('dighost.c', 'host.c') +nslookup_src += files('dighost.c', 'nslookup.c') + +manrst_srcset.add( + files( + 'dig.rst', + 'host.rst', + 'nslookup.rst', + ), +) diff --git a/bin/dnssec/Makefile.am b/bin/dnssec/Makefile.am deleted file mode 100644 index bc4654e72b..0000000000 --- a/bin/dnssec/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(LIBDNS_CFLAGS) - -AM_CPPFLAGS += \ - -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\" - -noinst_LTLIBRARIES = libdnssectool.la - -LDADD += \ - libdnssectool.la \ - $(LIBISC_LIBS) \ - $(LIBISCCFG_LIBS) \ - $(LIBDNS_LIBS) \ - $(OPENSSL_LIBS) - -bin_PROGRAMS = \ - dnssec-cds \ - dnssec-dsfromkey \ - dnssec-importkey \ - dnssec-keyfromlabel \ - dnssec-keygen \ - dnssec-ksr \ - dnssec-revoke \ - dnssec-settime \ - dnssec-signzone \ - dnssec-verify - -libdnssectool_la_SOURCES = \ - dnssectool.h \ - dnssectool.c - -dnssec_keygen_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -dnssec_keygen_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -dnssec_ksr_CPPFLAGS= \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -dnssec_ksr_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -dnssec_signzone_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -dnssec_signzone_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) diff --git a/bin/dnssec/meson.build b/bin/dnssec/meson.build new file mode 100644 index 0000000000..b300ff3045 --- /dev/null +++ b/bin/dnssec/meson.build @@ -0,0 +1,36 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dnssec_cds_src += files('dnssec-cds.c', 'dnssectool.c') +dnssec_dsfromkey_src += files('dnssec-dsfromkey.c', 'dnssectool.c') +dnssec_importkey_src += files('dnssec-importkey.c', 'dnssectool.c') +dnssec_keyfromlabel_src += files('dnssec-keyfromlabel.c', 'dnssectool.c') +dnssec_keygen_src += files('dnssec-keygen.c', 'dnssectool.c') +dnssec_ksr_src += files('dnssec-ksr.c', 'dnssectool.c') +dnssec_revoke_src += files('dnssec-revoke.c', 'dnssectool.c') +dnssec_settime_src += files('dnssec-settime.c', 'dnssectool.c') +dnssec_signzone_src += files('dnssec-signzone.c', 'dnssectool.c') +dnssec_verify_src += files('dnssec-verify.c', 'dnssectool.c') + +manrst_srcset.add( + files( + 'dnssec-cds.rst', + 'dnssec-dsfromkey.rst', + 'dnssec-importkey.rst', + 'dnssec-keyfromlabel.rst', + 'dnssec-keygen.rst', + 'dnssec-ksr.rst', + 'dnssec-revoke.rst', + 'dnssec-settime.rst', + 'dnssec-signzone.rst', + 'dnssec-verify.rst', + ), +) diff --git a/bin/meson.build b/bin/meson.build new file mode 100644 index 0000000000..92f2110ff3 --- /dev/null +++ b/bin/meson.build @@ -0,0 +1,24 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +subdir('check') +subdir('confgen') +subdir('delv') +subdir('dig') +subdir('dnssec') +subdir('named') +subdir('nsupdate') +subdir('plugins') +subdir('rndc') +subdir('tools') + +# System tests +subdir('tests') diff --git a/bin/named/Makefile.am b/bin/named/Makefile.am deleted file mode 100644 index aec650875e..0000000000 --- a/bin/named/Makefile.am +++ /dev/null @@ -1,125 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - -I$(top_builddir)/include \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBISCCC_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(OPENSSL_CFLAGS) \ - $(LIBCAP_CFLAGS) \ - $(LMDB_CFLAGS) \ - $(MAXMINDDB_CFLAGS) \ - $(DNSTAP_CFLAGS) \ - $(LIBUV_CFLAGS) \ - $(ZLIB_CFLAGS) - -if HAVE_JSON_C -AM_CPPFLAGS += \ - $(JSON_C_CFLAGS) -endif HAVE_JSON_C - -if HAVE_LIBNGHTTP2 -AM_CPPFLAGS += \ - $(LIBNGHTTP2_CFLAGS) -endif HAVE_LIBNGHTTP2 - -if HAVE_LIBXML2 -AM_CPPFLAGS += \ - $(LIBXML2_CFLAGS) -endif HAVE_LIBXML2 - -AM_CPPFLAGS += \ - -DNAMED_LOCALSTATEDIR=\"${localstatedir}\" \ - -DNAMED_SYSCONFDIR=\"${sysconfdir}\" - -sbin_PROGRAMS = named - -nodist_named_SOURCES = xsl.c -BUILT_SOURCES += xsl.c -CLEANFILES += xsl.c - -EXTRA_DIST = bind9.xsl - -xsl.c: bind9.xsl Makefile - (echo 'const char xslmsg[] =' && \ - $(SED) -e 's,\",\\\",g' \ - -e 's,^,\",' \ - -e 's,$$,\\n\",' && \ - echo ";") \ - < "${srcdir}/bind9.xsl" > $@ - -named_SOURCES = \ - builtin.c \ - config.c \ - control.c \ - controlconf.c \ - dlz_dlopen_driver.c \ - fuzz.c \ - log.c \ - logconf.c \ - main.c \ - os.c \ - server.c \ - statschannel.c \ - tkeyconf.c \ - transportconf.c \ - tsigconf.c \ - zoneconf.c \ - include/dlz/dlz_dlopen_driver.h \ - include/named/builtin.h \ - include/named/config.h \ - include/named/control.h \ - include/named/fuzz.h \ - include/named/geoip.h \ - include/named/globals.h \ - include/named/log.h \ - include/named/logconf.h \ - include/named/main.h \ - include/named/os.h \ - include/named/server.h \ - include/named/smf_globals.h \ - include/named/statschannel.h \ - include/named/tkeyconf.h \ - include/named/transportconf.h \ - include/named/tsigconf.h \ - include/named/types.h \ - include/named/zoneconf.h \ - xsl_p.h - -if HAVE_GEOIP2 -AM_CPPFLAGS += \ - -DMAXMINDDB_PREFIX=\"@MAXMINDDB_PREFIX@\" -named_SOURCES += \ - geoip.c -endif - -named_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBNS_LIBS) \ - $(LIBISCCC_LIBS) \ - $(LIBISCCFG_LIBS) \ - $(OPENSSL_LIBS) \ - $(LIBCAP_LIBS) \ - $(LMDB_LIBS) \ - $(MAXMINDDB_LIBS) \ - $(DNSTAP_LIBS) \ - $(LIBUV_LIBS) \ - $(ZLIB_LIBS) - -if HAVE_JSON_C -named_LDADD += \ - $(JSON_C_LIBS) -endif HAVE_JSON_C - -if HAVE_LIBNGHTTP2 -named_LDADD += \ - $(LIBNGHTTP2_LIBS) -endif HAVE_LIBNGHTTP2 - -if HAVE_LIBXML2 -named_LDADD += \ - $(LIBXML2_LIBS) -endif HAVE_LIBXML2 diff --git a/bin/named/main.c b/bin/named/main.c index 470d5723b3..fb8062588d 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -515,7 +515,7 @@ printversion(bool verbose) { const cfg_obj_t *defaults = NULL, *obj = NULL; #endif /* if defined(HAVE_GEOIP2) */ - printf("%s%s \n", PACKAGE_STRING, PACKAGE_DESCRIPTION, + printf("%s (%s) \n", PACKAGE_STRING, PACKAGE_DESCRIPTION, PACKAGE_SRCID); if (!verbose) { diff --git a/bin/named/meson.build b/bin/named/meson.build new file mode 100644 index 0000000000..bf9e8f9dbf --- /dev/null +++ b/bin/named/meson.build @@ -0,0 +1,50 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +named_inc_p += include_directories('include') + +named_srcset.add(when: maxminddb_dep, if_true: files('geoip.c')) + +named_srcset.add( + configure_file( + input: 'xsl_c.in', + output: 'xsl.c', + configuration: { + 'XSL': '\\n'.join(fs.read('bind9.xsl').strip().replace('"', '\\"').split('\n')), + }, + ), + + files( + 'builtin.c', + 'config.c', + 'control.c', + 'controlconf.c', + 'dlz_dlopen_driver.c', + 'fuzz.c', + 'log.c', + 'logconf.c', + 'main.c', + 'os.c', + 'server.c', + 'statschannel.c', + 'tkeyconf.c', + 'transportconf.c', + 'tsigconf.c', + 'zoneconf.c', + ), +) + +manrst_srcset.add( + files( + 'named.conf.rst', + 'named.rst', + ), +) diff --git a/bin/named/named.conf.rst b/bin/named/named.conf.rst index 89e76bd99c..c53ada236b 100644 --- a/bin/named/named.conf.rst +++ b/bin/named/named.conf.rst @@ -40,19 +40,19 @@ C++ style: // to end of line Unix style: # to end of line -.. literalinclude:: ../../doc/misc/options +.. configblock:: options Any of these zone statements can also be set inside the view statement. -.. literalinclude:: ../../doc/misc/primary.zoneopt -.. literalinclude:: ../../doc/misc/secondary.zoneopt -.. literalinclude:: ../../doc/misc/mirror.zoneopt -.. literalinclude:: ../../doc/misc/forward.zoneopt -.. literalinclude:: ../../doc/misc/hint.zoneopt -.. literalinclude:: ../../doc/misc/redirect.zoneopt -.. literalinclude:: ../../doc/misc/static-stub.zoneopt -.. literalinclude:: ../../doc/misc/stub.zoneopt -.. literalinclude:: ../../doc/misc/in-view.zoneopt +.. configblock:: primary.zoneopt +.. configblock:: secondary.zoneopt +.. configblock:: mirror.zoneopt +.. configblock:: forward.zoneopt +.. configblock:: hint.zoneopt +.. configblock:: redirect.zoneopt +.. configblock:: static-stub.zoneopt +.. configblock:: stub.zoneopt +.. configblock:: in-view.zoneopt Files ~~~~~ diff --git a/bin/named/server.c b/bin/named/server.c index 949059f801..86ddf1b64a 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -11832,7 +11832,7 @@ named_server_status(named_server_t *server, isc_buffer_t **text) { isc_time_formathttptimestamp(&named_g_configtime, configtime, sizeof(configtime)); - snprintf(line, sizeof(line), "version: %s%s %s%s%s\n", + snprintf(line, sizeof(line), "version: %s (%s) %s%s%s\n", PACKAGE_STRING, PACKAGE_DESCRIPTION, PACKAGE_SRCID, ob, alt, cb); CHECK(putstr(text, line)); diff --git a/bin/named/xsl_c.in b/bin/named/xsl_c.in new file mode 100644 index 0000000000..33b9c71c1f --- /dev/null +++ b/bin/named/xsl_c.in @@ -0,0 +1,14 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +const char xslmsg[] = "@XSL@\n"; diff --git a/bin/nsupdate/Makefile.am b/bin/nsupdate/Makefile.am deleted file mode 100644 index c37189a7ef..0000000000 --- a/bin/nsupdate/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(GSSAPI_CFLAGS) \ - $(KRB5_CFLAGS) \ - $(LIBEDIT_CFLAGS) - -AM_CPPFLAGS += \ - -DSESSION_KEYFILE=\"${localstatedir}/run/named/session.key\" - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBISCCFG_LIBS) \ - $(GSSAPI_LIBS) \ - $(KRB5_LIBS) \ - $(LIBEDIT_LIBS) - -bin_PROGRAMS = nsupdate diff --git a/bin/nsupdate/meson.build b/bin/nsupdate/meson.build new file mode 100644 index 0000000000..ffd513396a --- /dev/null +++ b/bin/nsupdate/meson.build @@ -0,0 +1,18 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +nsupdate_src += files('nsupdate.c') + +manrst_srcset.add( + files( + 'nsupdate.rst', + ), +) diff --git a/bin/plugins/Makefile.am b/bin/plugins/Makefile.am deleted file mode 100644 index 611dd1b1e0..0000000000 --- a/bin/plugins/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) - -pkglib_LTLIBRARIES = filter-aaaa.la -pkglib_LTLIBRARIES += filter-a.la - -filter_aaaa_la_SOURCES = filter-aaaa.c -filter_a_la_SOURCES = filter-a.c -filter_aaaa_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -filter_a_la_LDFLAGS = -avoid-version -module -shared -export-dynamic diff --git a/bin/plugins/meson.build b/bin/plugins/meson.build new file mode 100644 index 0000000000..49114689f0 --- /dev/null +++ b/bin/plugins/meson.build @@ -0,0 +1,20 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +filter_a_src += files('filter-a.c') +filter_aaaa_src += files('filter-aaaa.c') + +manrst_srcset.add( + files( + 'filter-a.rst', + 'filter-aaaa.rst', + ), +) diff --git a/bin/rndc/Makefile.am b/bin/rndc/Makefile.am deleted file mode 100644 index f8f0ac96d5..0000000000 --- a/bin/rndc/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(LIBISCCC_CFLAGS) - -AM_CPPFLAGS += \ - -DRNDC_CONFFILE=\"${sysconfdir}/rndc.conf\" \ - -DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\" - -sbin_PROGRAMS = rndc - -rndc_SOURCES = \ - rndc.c \ - util.c \ - util.h - -rndc_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBISCCC_LIBS) \ - $(LIBISCCFG_LIBS) diff --git a/bin/rndc/meson.build b/bin/rndc/meson.build new file mode 100644 index 0000000000..789022f931 --- /dev/null +++ b/bin/rndc/meson.build @@ -0,0 +1,19 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +rndc_src += files('rndc.c', 'util.c') + +manrst_srcset.add( + files( + 'rndc.conf.rst', + 'rndc.rst', + ), +) diff --git a/bin/tests/Makefile.am b/bin/tests/Makefile.am deleted file mode 100644 index 56e81b118a..0000000000 --- a/bin/tests/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -include $(top_srcdir)/Makefile.top - -EXTRA_DIST = convert-trs-to-junit.py - -SUBDIRS = system - -noinst_PROGRAMS = \ - test_client \ - test_server \ - wire_test - -AM_CFLAGS += \ - $(TEST_CFLAGS) - -test_client_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISC_CFLAGS) - -test_client_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) - -test_server_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISC_CFLAGS) - -test_server_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) - -wire_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) - -wire_test_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) diff --git a/bin/tests/meson.build b/bin/tests/meson.build new file mode 100644 index 0000000000..475d16e845 --- /dev/null +++ b/bin/tests/meson.build @@ -0,0 +1,17 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +subdir('system') + +system_test_binaries += { + 'test_client': files('test_client.c'), + 'test_server': files('test_server.c'), +} diff --git a/bin/tests/system/.gitignore b/bin/tests/system/.gitignore index 0866236c20..c0f44047ac 100644 --- a/bin/tests/system/.gitignore +++ b/bin/tests/system/.gitignore @@ -21,8 +21,9 @@ named.run /start.sh /stop.sh /ifconfig.sh -/isctest/vars/.ac_vars/* -!/isctest/vars/.ac_vars/*.in +/isctest/vars/.build_vars/* +!/isctest/vars/.build_vars/*.in +!/isctest/vars/.build_vars/meson.build # Ignore file names with underscore in their name except python or shell files. # This is done to ignore the temporary directories and symlinks created by the diff --git a/bin/tests/system/Makefile.am b/bin/tests/system/Makefile.am deleted file mode 100644 index 5e94e8fb9e..0000000000 --- a/bin/tests/system/Makefile.am +++ /dev/null @@ -1,205 +0,0 @@ -include $(top_srcdir)/Makefile.top - -EXTRA_DIST = . - -# Source tarballs must not contain configure/build artifacts. -dist-hook: - git clean -n -x -d | \ - grep -v "Makefile.in$$" | \ - sed -n "s|^Would remove \(.*\)|$(distdir)/\1|p" | \ - xargs -I{} rm -rf "{}" - -SUBDIRS = dyndb/driver dlzexternal/driver hooks/driver - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) - -if HAVE_PERL -if HAVE_PYTHON -if HAVE_PYTEST - -noinst_PROGRAMS = \ - feature-test \ - makejournal \ - pipelined/pipequeries \ - rndc/gencheck - -feature_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(OPENSSL_CFLAGS) - -feature_test_LDADD = \ - $(LDADD) \ - $(LIBDNS_LIBS) \ - $(OPENSSL_LIBS) - -makejournal_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBDNS_CFLAGS) - -makejournal_LDADD = \ - $(LDADD) \ - $(LIBDNS_LIBS) - -pipelined_pipequeries_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBDNS_CFLAGS) - -pipelined_pipequeries_LDADD = \ - $(LDADD) \ - $(LIBDNS_LIBS) - -# Longer running tests are listed (and executed) first to take the most -# advantage of parallel execution. -TESTS = \ - rpz \ - rpzrecurse \ - serve-stale \ - timeouts \ - upforwd \ - acl \ - additional \ - addzone \ - allow-query \ - auth \ - autosign \ - builtin \ - cacheclean \ - camp \ - case \ - catz \ - cds \ - chain \ - checkconf \ - checkds \ - checknames \ - checkzone \ - cookie \ - cpu \ - database \ - digdelv \ - dispatch \ - dlzexternal \ - dns64 \ - dnssec \ - dnstap \ - doth \ - dsdigest \ - dyndb \ - ecdsa \ - eddsa \ - ednscompliance \ - emptyzones \ - enginepkcs11 \ - filter-aaaa \ - fetchlimit \ - formerr \ - forward \ - geoip2 \ - glue \ - idna \ - include-multiplecfg \ - inline \ - integrity \ - ixfr \ - hooks \ - host \ - journal \ - kasp \ - keepalive \ - keyfromlabel \ - ksr \ - legacy \ - limits \ - logfileconfig \ - masterfile \ - masterformat \ - metadata \ - mirror \ - mkeys \ - multisigner \ - names \ - notify \ - nsec3 \ - nslookup \ - nsupdate \ - nzd2nzf \ - padding \ - pending \ - proxy \ - pipelined \ - qmin \ - query-source \ - reclimit \ - redirect \ - resolver \ - rndc \ - rollover \ - rootkeysentinel \ - rpzextra \ - rrchecker \ - rrl \ - rrsetorder \ - rsabigexponent \ - runtime \ - sfcache \ - shutdown \ - smartsign \ - spf \ - staticstub \ - statistics \ - statschannel \ - stress \ - stub \ - synthfromdnssec \ - tcp \ - tools \ - transport-acl \ - tsig \ - tsiggss \ - ttl \ - unknown \ - verify \ - views \ - wildcard \ - xfer \ - xferquota \ - zero \ - zonechecks - -else !HAVE_PYTEST -check: - echo pytest is not available, no tests were ran - exit 1 -endif !HAVE_PYTEST -else !HAVE_PYTHON -check: - echo Python is not available, no tests were ran - exit 1 -endif !HAVE_PYTHON -else !HAVE_PERL -check: - echo Perl is not available, no tests were ran - exit 1 -endif !HAVE_PERL - -LOG_DRIVER_V = $(LOG_DRIVER_V_@AM_V@) -LOG_DRIVER_V_ = $(LOG_DRIVER_V_@AM_DEFAULT_V@) -LOG_DRIVER_V_0 = --verbose no -LOG_DRIVER_V_1 = --verbose yes - -LOG_DRIVER = $(srcdir)/custom-test-driver -AM_LOG_DRIVER_FLAGS = $(LOG_DRIVER_V) - -LOG_COMPILER = $(srcdir)/run.sh - -test-local: check - -clean-local:: - -find -L . -mindepth 1 -maxdepth 1 -type d -name "*_*" -and -not -name "_common" -exec rm -rf {} \; diff --git a/bin/tests/system/conf.sh b/bin/tests/system/conf.sh index 86cfaa1df9..fa5b17b703 100644 --- a/bin/tests/system/conf.sh +++ b/bin/tests/system/conf.sh @@ -500,8 +500,9 @@ get_named_xfer_stats() { # copy_setports() { dir=$(echo "$TMPDIR" | sed 's/\//\\\//g') - + # Use comma instead of slash for directory substitution sed -e "s/@TMPDIR@/${dir}/g" \ + -e "s,@TOP_BUILDDIR@,${TOP_BUILDDIR},g" \ -e "s/@PORT@/${PORT}/g" \ -e "s/@TLSPORT@/${TLSPORT}/g" \ -e "s/@HTTPPORT@/${HTTPPORT}/g" \ diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 8412611426..4a0f4e4a65 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -24,7 +24,7 @@ import pytest pytest.register_assert_rewrite("isctest") import isctest -from isctest.vars.dirs import SYSTEM_TEST_DIR_GIT_PATH +from isctest.vars.build import SYSTEM_TEST_DIR_GIT_PATH # Silence warnings caused by passing a pytest fixture to another fixture. @@ -414,7 +414,7 @@ def system_test_dir(request, system_test_name, expected_artifacts): ), f"Unexpected files found in test directory: {unexpected_files}" # Create a temporary directory with a copy of the original system test dir contents - system_test_root = Path(os.environ["builddir"]) + system_test_root = Path(os.environ["srcdir"]) testdir = Path( tempfile.mkdtemp(prefix=f"{system_test_name}_tmp_", dir=system_test_root) ) @@ -430,6 +430,9 @@ def system_test_dir(request, system_test_name, expected_artifacts): isctest.log.init_module_logger(system_test_name, testdir) + # Log which binaries are used for the test(s) + isctest.log.info("testing binaries from: %s", os.environ.get("TOP_BUILDDIR")) + # System tests are meant to be executed from their directory - switch to it. old_cwd = os.getcwd() os.chdir(testdir) diff --git a/bin/tests/system/dlzexternal/driver/Makefile.am b/bin/tests/system/dlzexternal/driver/Makefile.am deleted file mode 100644 index 0028edb573..0000000000 --- a/bin/tests/system/dlzexternal/driver/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) - -noinst_LTLIBRARIES = dlzexternal.la - -dlzexternal_la_SOURCES = \ - driver.c \ - driver.h - -dlzexternal_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir) diff --git a/bin/tests/system/dlzexternal/ns1/named.conf.in b/bin/tests/system/dlzexternal/ns1/named.conf.in index f8b36e9620..7e0234edeb 100644 --- a/bin/tests/system/dlzexternal/ns1/named.conf.in +++ b/bin/tests/system/dlzexternal/ns1/named.conf.in @@ -38,34 +38,34 @@ controls { }; dlz "example one" { - database "dlopen ../driver/.libs/dlzexternal.so example.nil"; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so example.nil"; }; dlz "example two" { - database "dlopen ../driver/.libs/dlzexternal.so alternate.nil"; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so alternate.nil"; }; dlz "example three" { - database "dlopen ../driver/.libs/dlzexternal.so example.org"; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so example.org"; }; dlz "example four" { // Long zone name to trigger ISC_R_NOSPACE in dns_sdlz_putrr. - database "dlopen ../driver/.libs/dlzexternal.so 123456789.123456789.123456789.123456789.123456789.example.foo"; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so 123456789.123456789.123456789.123456789.123456789.example.foo"; }; dlz "unsearched1" { - database "dlopen ../driver/.libs/dlzexternal.so other.nil"; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so other.nil"; search no; }; dlz "unsearched2" { - database "dlopen ../driver/.libs/dlzexternal.so zone.nil"; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so zone.nil"; search no; }; dlz redzone { - database "dlopen ../driver/.libs/dlzexternal.so ."; + database "dlopen @TOP_BUILDDIR@/testlib-driver-dlzexternal.so ."; search no; }; diff --git a/bin/tests/system/dyndb/driver/Makefile.am b/bin/tests/system/dyndb/driver/Makefile.am deleted file mode 100644 index 3e6b4a4890..0000000000 --- a/bin/tests/system/dyndb/driver/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) - -noinst_LTLIBRARIES = sample.la - -sample_la_SOURCES = \ - db.c \ - driver.c \ - instance.c \ - log.c \ - syncptr.c \ - zone.c \ - db.h \ - instance.h \ - log.h \ - syncptr.h \ - util.h \ - zone.h - -sample_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir) diff --git a/bin/tests/system/dyndb/driver/driver.c b/bin/tests/system/dyndb/driver/driver.c index dd81ecdb56..7c2a65c759 100644 --- a/bin/tests/system/dyndb/driver/driver.c +++ b/bin/tests/system/dyndb/driver/driver.c @@ -67,7 +67,7 @@ dns_dyndb_version_t dyndb_version; * once during startup and then again on every reload. * * @code - * dyndb example-name "sample.so" { param1 param2 }; + * dyndb example-name "testlib-driver-sample.so" { param1 param2 }; * @endcode * * @param[in] name User-defined string from dyndb "name" {}; definition diff --git a/bin/tests/system/dyndb/ns1/named.conf.j2 b/bin/tests/system/dyndb/ns1/named.conf.j2 index d319a2a81e..a32c8474fe 100644 --- a/bin/tests/system/dyndb/ns1/named.conf.j2 +++ b/bin/tests/system/dyndb/ns1/named.conf.j2 @@ -36,5 +36,5 @@ controls { inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; -dyndb sample "../driver/.libs/sample.so" { ipv4.example.nil. in-addr.arpa. }; -dyndb sample2 "../driver/.libs/sample.so" { ipv6.example.nil. 8.b.d.0.1.0.0.2.ip6.arpa. }; +dyndb sample "@TOP_BUILDDIR@/testlib-driver-sample.so" { ipv4.example.nil. in-addr.arpa. }; +dyndb sample2 "@TOP_BUILDDIR@/testlib-driver-sample.so" { ipv6.example.nil. 8.b.d.0.1.0.0.2.ip6.arpa. }; diff --git a/bin/tests/system/filter-aaaa/conf/bad1.conf b/bin/tests/system/filter-aaaa/conf/bad1.conf.in similarity index 89% rename from bin/tests/system/filter-aaaa/conf/bad1.conf rename to bin/tests/system/filter-aaaa/conf/bad1.conf.in index e498c19dd4..7223efcf84 100644 --- a/bin/tests/system/filter-aaaa/conf/bad1.conf +++ b/bin/tests/system/filter-aaaa/conf/bad1.conf.in @@ -11,7 +11,7 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { none; }; }; diff --git a/bin/tests/system/filter-aaaa/conf/bad2.conf b/bin/tests/system/filter-aaaa/conf/bad2.conf.in similarity index 93% rename from bin/tests/system/filter-aaaa/conf/bad2.conf rename to bin/tests/system/filter-aaaa/conf/bad2.conf.in index fcb972abb1..770227c454 100644 --- a/bin/tests/system/filter-aaaa/conf/bad2.conf +++ b/bin/tests/system/filter-aaaa/conf/bad2.conf.in @@ -11,7 +11,7 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { /* * While this matches the defaults, it is not a good configuration * to have in named.conf as the two options contradict each other diff --git a/bin/tests/system/filter-aaaa/conf/bad3.conf b/bin/tests/system/filter-aaaa/conf/bad3.conf.in similarity index 89% rename from bin/tests/system/filter-aaaa/conf/bad3.conf rename to bin/tests/system/filter-aaaa/conf/bad3.conf.in index 5f77361f5a..d8d30d18e8 100644 --- a/bin/tests/system/filter-aaaa/conf/bad3.conf +++ b/bin/tests/system/filter-aaaa/conf/bad3.conf.in @@ -12,7 +12,7 @@ */ view myview { - plugin query "../../../plugins/.libs/filter-aaaa.so" { + plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 no; filter-aaaa { any; }; }; diff --git a/bin/tests/system/filter-aaaa/conf/bad4.conf b/bin/tests/system/filter-aaaa/conf/bad4.conf.in similarity index 89% rename from bin/tests/system/filter-aaaa/conf/bad4.conf rename to bin/tests/system/filter-aaaa/conf/bad4.conf.in index 4a37e6418c..be198361ee 100644 --- a/bin/tests/system/filter-aaaa/conf/bad4.conf +++ b/bin/tests/system/filter-aaaa/conf/bad4.conf.in @@ -12,7 +12,7 @@ */ view myview { - plugin query "../../../plugins/.libs/filter-aaaa.so" { + plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { none; }; }; diff --git a/bin/tests/system/filter-aaaa/conf/bad5.conf b/bin/tests/system/filter-aaaa/conf/bad5.conf.in similarity index 90% rename from bin/tests/system/filter-aaaa/conf/bad5.conf rename to bin/tests/system/filter-aaaa/conf/bad5.conf.in index eee2336627..e17f6a0cd4 100644 --- a/bin/tests/system/filter-aaaa/conf/bad5.conf +++ b/bin/tests/system/filter-aaaa/conf/bad5.conf.in @@ -11,7 +11,7 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { 1.0.0.0/8; }; }; diff --git a/bin/tests/system/filter-aaaa/conf/good1.conf b/bin/tests/system/filter-aaaa/conf/good1.conf.in similarity index 89% rename from bin/tests/system/filter-aaaa/conf/good1.conf rename to bin/tests/system/filter-aaaa/conf/good1.conf.in index c330d866d4..45efef7940 100644 --- a/bin/tests/system/filter-aaaa/conf/good1.conf +++ b/bin/tests/system/filter-aaaa/conf/good1.conf.in @@ -11,6 +11,6 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; }; diff --git a/bin/tests/system/filter-aaaa/conf/good2.conf b/bin/tests/system/filter-aaaa/conf/good2.conf.in similarity index 89% rename from bin/tests/system/filter-aaaa/conf/good2.conf rename to bin/tests/system/filter-aaaa/conf/good2.conf.in index aa3c9a52b3..351bedfd3a 100644 --- a/bin/tests/system/filter-aaaa/conf/good2.conf +++ b/bin/tests/system/filter-aaaa/conf/good2.conf.in @@ -11,6 +11,6 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 break-dnssec; }; diff --git a/bin/tests/system/filter-aaaa/conf/good3.conf b/bin/tests/system/filter-aaaa/conf/good3.conf.in similarity index 90% rename from bin/tests/system/filter-aaaa/conf/good3.conf rename to bin/tests/system/filter-aaaa/conf/good3.conf.in index 26e50f5334..559d98a6f0 100644 --- a/bin/tests/system/filter-aaaa/conf/good3.conf +++ b/bin/tests/system/filter-aaaa/conf/good3.conf.in @@ -11,7 +11,7 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 break-dnssec; filter-aaaa { 1.0.0.0/8; }; }; diff --git a/bin/tests/system/filter-aaaa/conf/good4.conf b/bin/tests/system/filter-aaaa/conf/good4.conf.in similarity index 89% rename from bin/tests/system/filter-aaaa/conf/good4.conf rename to bin/tests/system/filter-aaaa/conf/good4.conf.in index b646c8d668..a9ee336fe1 100644 --- a/bin/tests/system/filter-aaaa/conf/good4.conf +++ b/bin/tests/system/filter-aaaa/conf/good4.conf.in @@ -11,7 +11,7 @@ * information regarding copyright ownership. */ -plugin query "../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { 1.0.0.0/8; }; }; diff --git a/bin/tests/system/filter-aaaa/conf/good5.conf b/bin/tests/system/filter-aaaa/conf/good5.conf.in similarity index 90% rename from bin/tests/system/filter-aaaa/conf/good5.conf rename to bin/tests/system/filter-aaaa/conf/good5.conf.in index 260fdf111c..4e568d7f5a 100644 --- a/bin/tests/system/filter-aaaa/conf/good5.conf +++ b/bin/tests/system/filter-aaaa/conf/good5.conf.in @@ -12,7 +12,7 @@ */ view myview { - plugin query "../../../plugins/.libs/filter-aaaa.so" { + plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { 1.0.0.0/8; }; }; diff --git a/bin/tests/system/filter-aaaa/ns1/named1.conf.in b/bin/tests/system/filter-aaaa/ns1/named1.conf.in index c4e6eacc8c..2098420352 100644 --- a/bin/tests/system/filter-aaaa/ns1/named1.conf.in +++ b/bin/tests/system/filter-aaaa/ns1/named1.conf.in @@ -29,7 +29,7 @@ trust-anchors { }; acl filterees { 10.53.0.1; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { filterees; }; }; diff --git a/bin/tests/system/filter-aaaa/ns1/named2.conf.in b/bin/tests/system/filter-aaaa/ns1/named2.conf.in index d82ed2d50f..87910becd5 100644 --- a/bin/tests/system/filter-aaaa/ns1/named2.conf.in +++ b/bin/tests/system/filter-aaaa/ns1/named2.conf.in @@ -27,7 +27,7 @@ options { trust-anchors { }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v6 yes; filter-aaaa { fd92:7065:b8e:ffff::1; }; }; diff --git a/bin/tests/system/filter-aaaa/ns2/named1.conf.in b/bin/tests/system/filter-aaaa/ns2/named1.conf.in index 2a1486d56a..cab026e949 100644 --- a/bin/tests/system/filter-aaaa/ns2/named1.conf.in +++ b/bin/tests/system/filter-aaaa/ns2/named1.conf.in @@ -25,7 +25,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 yes; filter-aaaa { 10.53.0.2; }; }; diff --git a/bin/tests/system/filter-aaaa/ns2/named2.conf.in b/bin/tests/system/filter-aaaa/ns2/named2.conf.in index 4e5a1ef095..abf5e7ce26 100644 --- a/bin/tests/system/filter-aaaa/ns2/named2.conf.in +++ b/bin/tests/system/filter-aaaa/ns2/named2.conf.in @@ -25,7 +25,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v6 yes; filter-aaaa { fd92:7065:b8e:ffff::2; }; }; diff --git a/bin/tests/system/filter-aaaa/ns3/named1.conf.in b/bin/tests/system/filter-aaaa/ns3/named1.conf.in index 602859b752..74534d3cf1 100644 --- a/bin/tests/system/filter-aaaa/ns3/named1.conf.in +++ b/bin/tests/system/filter-aaaa/ns3/named1.conf.in @@ -25,7 +25,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 break-dnssec; filter-aaaa { 10.53.0.3; }; }; diff --git a/bin/tests/system/filter-aaaa/ns3/named2.conf.in b/bin/tests/system/filter-aaaa/ns3/named2.conf.in index db449afb9e..7174067b23 100644 --- a/bin/tests/system/filter-aaaa/ns3/named2.conf.in +++ b/bin/tests/system/filter-aaaa/ns3/named2.conf.in @@ -25,7 +25,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v6 break-dnssec; filter-aaaa { fd92:7065:b8e:ffff::3; }; }; diff --git a/bin/tests/system/filter-aaaa/ns4/named1.conf.in b/bin/tests/system/filter-aaaa/ns4/named1.conf.in index 0aa30071e8..6909d2221e 100644 --- a/bin/tests/system/filter-aaaa/ns4/named1.conf.in +++ b/bin/tests/system/filter-aaaa/ns4/named1.conf.in @@ -25,7 +25,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 break-dnssec; filter-aaaa { 10.53.0.4; }; }; diff --git a/bin/tests/system/filter-aaaa/ns4/named2.conf.in b/bin/tests/system/filter-aaaa/ns4/named2.conf.in index e534e54a80..cb2ea3be69 100644 --- a/bin/tests/system/filter-aaaa/ns4/named2.conf.in +++ b/bin/tests/system/filter-aaaa/ns4/named2.conf.in @@ -25,7 +25,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v6 break-dnssec; filter-aaaa { fd92:7065:b8e:ffff::4; }; }; diff --git a/bin/tests/system/filter-aaaa/ns5/named.conf.in b/bin/tests/system/filter-aaaa/ns5/named.conf.in index 36380cd321..2dad6434a0 100644 --- a/bin/tests/system/filter-aaaa/ns5/named.conf.in +++ b/bin/tests/system/filter-aaaa/ns5/named.conf.in @@ -30,7 +30,7 @@ options { minimal-responses no; }; -plugin query "../../../../plugins/.libs/filter-aaaa.so" { +plugin query "@TOP_BUILDDIR@/filter-aaaa.so" { filter-aaaa-on-v4 break-dnssec; filter-aaaa { any; }; }; diff --git a/bin/tests/system/filter-aaaa/setup.sh b/bin/tests/system/filter-aaaa/setup.sh index c3901c575b..3e151f04d4 100644 --- a/bin/tests/system/filter-aaaa/setup.sh +++ b/bin/tests/system/filter-aaaa/setup.sh @@ -19,5 +19,17 @@ copy_setports ns3/named1.conf.in ns3/named.conf copy_setports ns4/named1.conf.in ns4/named.conf copy_setports ns5/named.conf.in ns5/named.conf +copy_setports conf/good1.conf.in conf/good1.conf +copy_setports conf/good2.conf.in conf/good2.conf +copy_setports conf/good3.conf.in conf/good3.conf +copy_setports conf/good4.conf.in conf/good4.conf +copy_setports conf/good5.conf.in conf/good5.conf + +copy_setports conf/bad1.conf.in conf/bad1.conf +copy_setports conf/bad2.conf.in conf/bad2.conf +copy_setports conf/bad3.conf.in conf/bad3.conf +copy_setports conf/bad4.conf.in conf/bad4.conf +copy_setports conf/bad5.conf.in conf/bad5.conf + (cd ns1 && $SHELL -e sign.sh) (cd ns4 && $SHELL -e sign.sh) diff --git a/bin/tests/system/filter-aaaa/tests_sh_filter_aaaa.py b/bin/tests/system/filter-aaaa/tests_sh_filter_aaaa.py index 6e1df65811..51c04dc32c 100644 --- a/bin/tests/system/filter-aaaa/tests_sh_filter_aaaa.py +++ b/bin/tests/system/filter-aaaa/tests_sh_filter_aaaa.py @@ -13,15 +13,16 @@ import pytest pytestmark = pytest.mark.extra_artifacts( [ + "conf/*.conf", "dig.out.*", "ns*/trusted.conf", + "ns1/*.signed", "ns1/K*", "ns1/dsset-*", - "ns1/*.signed", "ns1/signer.err", + "ns4/*.signed", "ns4/K*", "ns4/dsset-*", - "ns4/*.signed", "ns4/signer.err", ] ) diff --git a/bin/tests/system/get_core_dumps.sh b/bin/tests/system/get_core_dumps.sh index 1469c3c316..9b7a4a9111 100755 --- a/bin/tests/system/get_core_dumps.sh +++ b/bin/tests/system/get_core_dumps.sh @@ -17,7 +17,7 @@ dir=$(dirname "$0") systest=$1 status=0 -export SYSTESTDIR="${TOP_BUILDDIR}/bin/tests/system/${systest}" +export SYSTESTDIR="${TOP_SRCDIR}/bin/tests/system/${systest}" get_core_dumps() { find "$SYSTESTDIR/" \( -name 'core' -or -name 'core.*' -or -name '*.core' \) ! -name '*.gz' ! -name '*.txt' | sort @@ -31,10 +31,7 @@ if [ -n "$core_dumps" ]; then echoinfo "D:$systest:backtrace from $coredump:" echoinfo "D:$systest:--------------------------------------------------------------------------------" binary=$(gdb --batch --core="$coredump" 2>/dev/null | sed -ne "s|Core was generated by \`\([^' ]*\)[' ].*|\1|p") - if [ ! -f "${binary}" ]; then - binary=$(find "${TOP_BUILDDIR}" -path "*/.libs/${binary}" -type f) - fi - "${TOP_BUILDDIR}/libtool" --mode=execute gdb \ + gdb \ -batch \ -ex bt \ -core="$coredump" \ @@ -43,7 +40,7 @@ if [ -n "$core_dumps" ]; then echoinfo "D:$systest:--------------------------------------------------------------------------------" coredump_backtrace="${coredump}-backtrace.txt" echoinfo "D:$systest:full backtrace from $coredump saved in $coredump_backtrace" - "${TOP_BUILDDIR}/libtool" --mode=execute gdb \ + gdb \ -batch \ -command="${TOP_SRCDIR}/bin/tests/system/run.gdb" \ -core="$coredump" \ diff --git a/bin/tests/system/hooks/driver/Makefile.am b/bin/tests/system/hooks/driver/Makefile.am deleted file mode 100644 index b0c4b799c4..0000000000 --- a/bin/tests/system/hooks/driver/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) - -noinst_LTLIBRARIES = test-async.la - -test_async_la_SOURCES = test-async.c -test_async_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir) diff --git a/bin/tests/system/hooks/ns1/named.conf.j2 b/bin/tests/system/hooks/ns1/named.conf.j2 index 30ae85ae84..5055a00c53 100644 --- a/bin/tests/system/hooks/ns1/named.conf.j2 +++ b/bin/tests/system/hooks/ns1/named.conf.j2 @@ -26,7 +26,7 @@ options { trust-anchors { }; -plugin query "../driver/.libs/test-async.so"; +plugin query "@TOP_BUILDDIR@/testlib-driver-async.so"; key rndc_key { secret "1234abcd8765"; diff --git a/bin/tests/system/ifconfig.sh.in b/bin/tests/system/ifconfig.sh.in index ef50291672..a729055e22 100755 --- a/bin/tests/system/ifconfig.sh.in +++ b/bin/tests/system/ifconfig.sh.in @@ -31,33 +31,25 @@ # and testsock.pl (which checks the interfaces are configured) # -top_srcdir=@abs_top_srcdir@ - -sys=$(@SHELL@ "$top_srcdir/config.guess") +sys=@SYSTEM@ use_ip= -case "$sys" in - *-*-linux*) - if type ip >/dev/null; then - use_ip=yes - elif type ifconfig >/dev/null; then - : - else - echo "$0: can't find ip or ifconfig" >&2 - exit 1 - fi - ;; -esac +if [ "$sys" = "linux" ]; then + if type ip >/dev/null; then + use_ip=yes + elif type ifconfig >/dev/null; then + : + else + echo "$0: can't find ip or ifconfig" >&2 + exit 1 + fi +fi up() { + # https://mesonbuild.com/Reference-tables.html#operating-system-names case "$sys" in - *-pc-solaris2.5.1) - [ "$a" ] && ifconfig lo0:$int $a netmask 0xffffffff up - ;; - *-sun-solaris2.[6-7]) - [ "$a" ] && ifconfig lo0:$int $a netmask 0xffffffff up - ;; - *-*-solaris2.[8-9] | *-*-solaris2.10) + # "sunos" is for both illumos and Solaris + sunos) [ "$a" ] && { /sbin/ifconfig lo0:$int plumb /sbin/ifconfig lo0:$int $a up @@ -68,19 +60,7 @@ up() { /sbin/ifconfig lo0:$int inet6 $aaaa up } ;; - *-*-solaris2.1[1-9]) - [ "$a" ] && { - /sbin/ipadm create-addr -t -T static \ - -a $a lo0/bind9v4$int \ - || echo failed lo0/bind9v4$int - } - [ "$aaaa" ] && { - /sbin/ipadm create-addr -t -T static \ - -a $aaaa lo0/bind9v6$int \ - || echo failed lo0/bind9v6$int - } - ;; - *-*-linux*) + linux) if [ "$use_ip" ]; then [ "$a" ] && ip address add $a/24 dev lo:$int [ "$aaaa" ] && ip address add $aaaa/64 dev lo @@ -90,27 +70,15 @@ up() { [ "$aaaa" ] && ifconfig lo inet6 add $aaaa/64 fi ;; - *-unknown-freebsd*) + freebsd) [ "$a" ] && ifconfig lo0 $a alias netmask 0xffffffff mtu 1500 [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa alias ;; - *-unknown-dragonfly* | *-unknown-netbsd* | *-unknown-openbsd*) + dragonfly | netbsd | openbsd) [ "$a" ] && ifconfig lo0 $a alias netmask 255.255.255.0 mtu 1500 [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa alias ;; - *-*-bsdi[3-5].*) - [ "$a" ] && ifconfig lo0 add $a netmask 255.255.255.0 - ;; - *-dec-osf[4-5].*) - [ "$a" ] && ifconfig lo0 alias $a - ;; - *-sgi-irix6.*) - [ "$a" ] && ifconfig lo0 alias $a - ;; - *-*-sysv5uw7* | *-*-sysv*UnixWare* | *-*-sysv*OpenUNIX*) - [ "$a" ] && ifconfig lo0 $a alias netmask 0xffffffff - ;; - *-ibm-aix4.* | *-ibm-aix5.*) + aix) [ "$a" ] && ifconfig lo0 alias $a [ "$aaaa" ] && ifconfig lo0 inet6 alias -dad $aaaa/64 ;; @@ -118,10 +86,7 @@ up() { [ "$a" ] && ifconfig lo0:$int $a netmask 255.255.255.0 up [ "$aaaa" ] && ifconfig lo0:$int inet6 $aaaa up ;; - *-sco3.2v*) - [ "$a" ] && ifconfig lo0 alias $a - ;; - *-darwin*) + darwin) [ "$a" ] && ifconfig lo0 alias $a [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa alias ;; @@ -133,14 +98,10 @@ up() { } down() { + # https://mesonbuild.com/Reference-tables.html#operating-system-names case "$sys" in - *-pc-solaris2.5.1) - [ "$a" ] && ifconfig lo0:$int 0.0.0.0 down - ;; - *-sun-solaris2.[6-7]) - [ "$a" ] && ifconfig lo0:$int $a down - ;; - *-*-solaris2.[8-9] | *-*-solaris2.10) + # "sunos" is for both illumos and Solaris + sunos) [ "$a" ] && { ifconfig lo0:$int $a down ifconfig lo0:$int $a unplumb @@ -150,18 +111,7 @@ down() { ifconfig lo0:$int inet6 unplumb } ;; - *-*-solaris2.1[1-9]) - [ "$a" ] && { - ipadm delete-addr lo0/bind9v4$int \ - || echo failed lo0/bind9v4$int - } - [ "$aaaa" ] && { - ipadm delete-addr lo0/bind9v6$int \ - || echo failed lo0/bind9v6$int - } - ;; - - *-*-linux*) + linux) if [ "$use_ip" ]; then [ "$a" ] && ip address del $a/24 dev lo:$int [ "$aaaa" ] && ip address del $aaaa/64 dev lo @@ -170,31 +120,19 @@ down() { [ "$aaaa" ] && ifconfig lo inet6 del $aaaa/64 fi ;; - *-unknown-freebsd*) + freebsd) [ "$a" ] && ifconfig lo0 $a delete [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa delete ;; - *-unknown-netbsd*) + netbsd) [ "$a" ] && ifconfig lo0 $a delete [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa delete ;; - *-unknown-openbsd*) + openbsd) [ "$a" ] && ifconfig lo0 $a delete [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa delete ;; - *-*-bsdi[3-5].*) - [ "$a" ] && ifconfig lo0 remove $a - ;; - *-dec-osf[4-5].*) - [ "$a" ] && ifconfig lo0 -alias $a - ;; - *-sgi-irix6.*) - [ "$a" ] && ifconfig lo0 -alias $a - ;; - *-*-sysv5uw7* | *-*-sysv*UnixWare* | *-*-sysv*OpenUNIX*) - [ "$a" ] && ifconfig lo0 -alias $a - ;; - *-ibm-aix4.* | *-ibm-aix5.*) + aix) [ "$a" ] && ifconfig lo0 delete $a [ "$aaaa" ] && ifconfig lo0 delete inet6 $aaaa/64 ;; @@ -202,10 +140,7 @@ down() { [ "$a" ] && ifconfig lo0:$int 0.0.0.0 [ "$aaaa" ] && ifconfig lo0:$int inet6 :: ;; - *-sco3.2v*) - [ "$a" ] && ifconfig lo0 -alias $a - ;; - *darwin*) + darwin) [ "$a" ] && ifconfig lo0 -alias $a [ "$aaaa" ] && ifconfig lo0 inet6 $aaaa delete ;; diff --git a/bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR.in b/bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR.in deleted file mode 100644 index ad1e3ece17..0000000000 --- a/bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR.in +++ /dev/null @@ -1 +0,0 @@ -@abs_top_builddir@ diff --git a/bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR.in b/bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR.in deleted file mode 100644 index ab6784b0e5..0000000000 --- a/bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR.in +++ /dev/null @@ -1 +0,0 @@ -@abs_top_srcdir@ diff --git a/bin/tests/system/isctest/vars/.ac_vars/CURL.in b/bin/tests/system/isctest/vars/.build_vars/CURL.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/CURL.in rename to bin/tests/system/isctest/vars/.build_vars/CURL.in diff --git a/bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE.in b/bin/tests/system/isctest/vars/.build_vars/FSTRM_CAPTURE.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE.in rename to bin/tests/system/isctest/vars/.build_vars/FSTRM_CAPTURE.in diff --git a/bin/tests/system/isctest/vars/.ac_vars/NC.in b/bin/tests/system/isctest/vars/.build_vars/NC.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/NC.in rename to bin/tests/system/isctest/vars/.build_vars/NC.in diff --git a/bin/tests/system/isctest/vars/.ac_vars/PERL.in b/bin/tests/system/isctest/vars/.build_vars/PERL.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/PERL.in rename to bin/tests/system/isctest/vars/.build_vars/PERL.in diff --git a/bin/tests/system/isctest/vars/.ac_vars/PYTEST.in b/bin/tests/system/isctest/vars/.build_vars/PYTEST.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/PYTEST.in rename to bin/tests/system/isctest/vars/.build_vars/PYTEST.in diff --git a/bin/tests/system/isctest/vars/.ac_vars/PYTHON.in b/bin/tests/system/isctest/vars/.build_vars/PYTHON.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/PYTHON.in rename to bin/tests/system/isctest/vars/.build_vars/PYTHON.in diff --git a/bin/tests/system/isctest/vars/.ac_vars/SHELL.in b/bin/tests/system/isctest/vars/.build_vars/SHELL.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/SHELL.in rename to bin/tests/system/isctest/vars/.build_vars/SHELL.in diff --git a/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR.in b/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR.in new file mode 100644 index 0000000000..220b072da8 --- /dev/null +++ b/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR.in @@ -0,0 +1 @@ +@TOP_BUILDDIR@ diff --git a/bin/tests/system/isctest/vars/.build_vars/TOP_SRCDIR.in b/bin/tests/system/isctest/vars/.build_vars/TOP_SRCDIR.in new file mode 100644 index 0000000000..a33c126a50 --- /dev/null +++ b/bin/tests/system/isctest/vars/.build_vars/TOP_SRCDIR.in @@ -0,0 +1 @@ +@TOP_SRCDIR@ diff --git a/bin/tests/system/isctest/vars/.ac_vars/XSLTPROC.in b/bin/tests/system/isctest/vars/.build_vars/XSLTPROC.in similarity index 100% rename from bin/tests/system/isctest/vars/.ac_vars/XSLTPROC.in rename to bin/tests/system/isctest/vars/.build_vars/XSLTPROC.in diff --git a/bin/tests/system/isctest/vars/.build_vars/meson.build b/bin/tests/system/isctest/vars/.build_vars/meson.build new file mode 100644 index 0000000000..fbe88da8d2 --- /dev/null +++ b/bin/tests/system/isctest/vars/.build_vars/meson.build @@ -0,0 +1,57 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +if not pytest.found() + subdir_done() +endif + +configure_file( + configuration: {'TOP_BUILDDIR': meson.project_build_root()}, + input: 'TOP_BUILDDIR.in', + output: 'TOP_BUILDDIR', +) + +configure_file( + configuration: {'TOP_SRCDIR': meson.project_source_root()}, + input: 'TOP_SRCDIR.in', + output: 'TOP_SRCDIR', +) + +foreach name, prog : { + 'CURL': curl, + 'FSTRM_CAPTURE': fstrm_capture, + 'NC': nc, + 'PERL': perl, + 'PYTEST': pytest, + 'PYTHON': python, + 'SHELL': sh, + 'XSLTPROC': xsltproc, +} + if prog.found() + configure_file( + configuration: {name: prog.full_path()}, + input: fs.replace_suffix(name, '.in'), + output: name, + ) + endif +endforeach + +# Run a script to copy required files to the source directory in order to make +# pytest work and find the compiled files. This is executed on every incovation +# of the compile command, so the latest build is always used for system tests. +custom_target( + 'system-test-init', + build_always_stale: true, + build_by_default: true, + command: meson.project_source_root() / 'util' / 'meson-system-test-init.sh', + output: 'system-test-init', # not an actual file, but it's mandatory... + env: env, +) diff --git a/bin/tests/system/isctest/vars/all.py b/bin/tests/system/isctest/vars/all.py index eabe2c3791..07364df489 100644 --- a/bin/tests/system/isctest/vars/all.py +++ b/bin/tests/system/isctest/vars/all.py @@ -12,7 +12,7 @@ from collections import ChainMap # pylint: disable=import-error -from .autoconf import AC_VARS # type: ignore +from .build import BUILD_VARS # type: ignore # pylint: enable=import-error from .algorithms import ALG_VARS, CRYPTO_SUPPORTED_VARS @@ -54,11 +54,11 @@ class VarLookup(ChainMap): ALL = VarLookup( - AC_VARS, + ALG_VARS, BASIC_VARS, + CRYPTO_SUPPORTED_VARS, + DIR_VARS, + BUILD_VARS, OPENSSL_VARS, PORT_VARS, - DIR_VARS, - ALG_VARS, - CRYPTO_SUPPORTED_VARS, ) diff --git a/bin/tests/system/isctest/vars/autoconf.py b/bin/tests/system/isctest/vars/autoconf.py deleted file mode 100644 index 7000ef2d72..0000000000 --- a/bin/tests/system/isctest/vars/autoconf.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -from pathlib import Path -from typing import Dict - - -def load_ac_vars_from_files() -> Dict[str, str]: - ac_vars = {} - ac_vars_dir = Path(__file__).resolve().parent / ".ac_vars" - var_paths = [ - path - for path in ac_vars_dir.iterdir() - if path.is_file() and not path.name.endswith(".in") - ] - for var_path in var_paths: - ac_vars[var_path.name] = var_path.read_text(encoding="utf-8").strip() - return ac_vars - - -AC_VARS = load_ac_vars_from_files() diff --git a/bin/tests/system/isctest/vars/basic.py b/bin/tests/system/isctest/vars/basic.py index e76e5f12c3..d33ecae0ec 100644 --- a/bin/tests/system/isctest/vars/basic.py +++ b/bin/tests/system/isctest/vars/basic.py @@ -12,50 +12,50 @@ import os # pylint: disable=import-error -from .autoconf import AC_VARS # type: ignore +from .build import BUILD_VARS # type: ignore # pylint: enable=import-error BASIC_VARS = { - "ARPANAME": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/arpaname", - "CDS": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-cds", - "CHECKCONF": f"{AC_VARS['TOP_BUILDDIR']}/bin/check/named-checkconf", - "CHECKZONE": f"{AC_VARS['TOP_BUILDDIR']}/bin/check/named-checkzone", - "DIG": f"{AC_VARS['TOP_BUILDDIR']}/bin/dig/dig", - "DNSTAPREAD": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/dnstap-read", - "DSFROMKEY": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-dsfromkey", - "FEATURETEST": f"{AC_VARS['TOP_BUILDDIR']}/bin/tests/system/feature-test", - "HOST": f"{AC_VARS['TOP_BUILDDIR']}/bin/dig/host", - "IMPORTKEY": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-importkey", - "JOURNALPRINT": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/named-journalprint", - "KEYFRLAB": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-keyfromlabel", - "KEYGEN": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-keygen", - "KSR": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-ksr", - "MDIG": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/mdig", - "NAMED": f"{AC_VARS['TOP_BUILDDIR']}/bin/named/named", - "NSEC3HASH": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/nsec3hash", - "NSLOOKUP": f"{AC_VARS['TOP_BUILDDIR']}/bin/dig/nslookup", - "NSUPDATE": f"{AC_VARS['TOP_BUILDDIR']}/bin/nsupdate/nsupdate", - "NZD2NZF": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/named-nzd2nzf", - "REVOKE": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-revoke", - "RNDC": f"{AC_VARS['TOP_BUILDDIR']}/bin/rndc/rndc", - "RNDCCONFGEN": f"{AC_VARS['TOP_BUILDDIR']}/bin/confgen/rndc-confgen", - "RRCHECKER": f"{AC_VARS['TOP_BUILDDIR']}/bin/tools/named-rrchecker", - "SETTIME": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-settime", - "SIGNER": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-signzone", - "TSIGKEYGEN": f"{AC_VARS['TOP_BUILDDIR']}/bin/confgen/tsig-keygen", - "VERIFY": f"{AC_VARS['TOP_BUILDDIR']}/bin/dnssec/dnssec-verify", - "WIRETEST": f"{AC_VARS['TOP_BUILDDIR']}/bin/tests/wire_test", - "BIGKEY": f"{AC_VARS['TOP_BUILDDIR']}/bin/tests/system/rsabigexponent/bigkey", - "GENCHECK": f"{AC_VARS['TOP_BUILDDIR']}/bin/tests/system/rndc/gencheck", - "MAKEJOURNAL": f"{AC_VARS['TOP_BUILDDIR']}/bin/tests/system/makejournal", - "PIPEQUERIES": f"{AC_VARS['TOP_BUILDDIR']}/bin/tests/system/pipelined/pipequeries", + "ARPANAME": f"{BUILD_VARS['TOP_BUILDDIR']}/arpaname", + "CDS": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-cds", + "CHECKCONF": f"{BUILD_VARS['TOP_BUILDDIR']}/named-checkconf", + "CHECKZONE": f"{BUILD_VARS['TOP_BUILDDIR']}/named-checkzone", + "DIG": f"{BUILD_VARS['TOP_BUILDDIR']}/dig", + "DNSTAPREAD": f"{BUILD_VARS['TOP_BUILDDIR']}/dnstap-read", + "DSFROMKEY": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-dsfromkey", + "FEATURETEST": f"{BUILD_VARS['TOP_BUILDDIR']}/feature-test", + "HOST": f"{BUILD_VARS['TOP_BUILDDIR']}/host", + "IMPORTKEY": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-importkey", + "JOURNALPRINT": f"{BUILD_VARS['TOP_BUILDDIR']}/named-journalprint", + "KEYFRLAB": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-keyfromlabel", + "KEYGEN": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-keygen", + "KSR": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-ksr", + "MDIG": f"{BUILD_VARS['TOP_BUILDDIR']}/mdig", + "NAMED": f"{BUILD_VARS['TOP_BUILDDIR']}/named", + "NSEC3HASH": f"{BUILD_VARS['TOP_BUILDDIR']}/nsec3hash", + "NSLOOKUP": f"{BUILD_VARS['TOP_BUILDDIR']}/nslookup", + "NSUPDATE": f"{BUILD_VARS['TOP_BUILDDIR']}/nsupdate", + "NZD2NZF": f"{BUILD_VARS['TOP_BUILDDIR']}/named-nzd2nzf", + "REVOKE": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-revoke", + "RNDC": f"{BUILD_VARS['TOP_BUILDDIR']}/rndc", + "RNDCCONFGEN": f"{BUILD_VARS['TOP_BUILDDIR']}/rndc-confgen", + "RRCHECKER": f"{BUILD_VARS['TOP_BUILDDIR']}/named-rrchecker", + "SETTIME": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-settime", + "SIGNER": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-signzone", + "TSIGKEYGEN": f"{BUILD_VARS['TOP_BUILDDIR']}/tsig-keygen", + "VERIFY": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-verify", + "WIRETEST": f"{BUILD_VARS['TOP_BUILDDIR']}/wire-test", + "BIGKEY": f"{BUILD_VARS['TOP_BUILDDIR']}/bigkey", + "GENCHECK": f"{BUILD_VARS['TOP_BUILDDIR']}/gencheck", + "MAKEJOURNAL": f"{BUILD_VARS['TOP_BUILDDIR']}/makejournal", + "PIPEQUERIES": f"{BUILD_VARS['TOP_BUILDDIR']}/pipequeries", "TMPDIR": os.getenv("TMPDIR", "/tmp"), "KRB5_CONFIG": "/dev/null", # we don't want a KRB5_CONFIG setting breaking the tests "KRB5_KTNAME": "dns.keytab", # use local keytab instead of default /etc/krb5.keytab "DELV": ( - f"{AC_VARS['TOP_BUILDDIR']}/bin/delv/delv" + f"{BUILD_VARS['TOP_BUILDDIR']}/delv" if not os.getenv("TSAN_OPTIONS", "") else ":" # workaround for GL#4119 ), diff --git a/bin/tests/system/isctest/vars/build.py b/bin/tests/system/isctest/vars/build.py new file mode 100644 index 0000000000..4071272c11 --- /dev/null +++ b/bin/tests/system/isctest/vars/build.py @@ -0,0 +1,59 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +from pathlib import Path +from typing import Dict + + +SYSTEM_TEST_DIR_GIT_PATH = "bin/tests/system" + + +def load_vars_from_build_files() -> Dict[str, str]: + # TOP_BUILDDIR is special, it is always read from the source directory + top_builddir_file = Path(__file__).resolve().parent / ".build_vars" / "TOP_BUILDDIR" + if not top_builddir_file.exists(): + raise RuntimeError( + 'Uninitialized build variable: "TOP_BUILDDIR". Did you run `meson compile`?' + ) + + top_builddir = top_builddir_file.read_text(encoding="utf-8").strip() + + build_vars = { + "TOP_BUILDDIR": top_builddir, + } + + var_dir = ( + Path(top_builddir) + / SYSTEM_TEST_DIR_GIT_PATH + / "isctest" + / "vars" + / ".build_vars" + ) + + for var in [ + "CURL", + "FSTRM_CAPTURE", + "NC", + "PERL", + "PYTEST", + "PYTHON", + "SHELL", + "TOP_SRCDIR", + "XSLTPROC", + ]: + var_file = var_dir / var + if var_file.exists(): + build_vars[var] = var_file.read_text(encoding="utf-8").strip() + + return build_vars + + +BUILD_VARS = load_vars_from_build_files() diff --git a/bin/tests/system/isctest/vars/dirs.py b/bin/tests/system/isctest/vars/dirs.py index 56f4c55375..1ec52b69f7 100644 --- a/bin/tests/system/isctest/vars/dirs.py +++ b/bin/tests/system/isctest/vars/dirs.py @@ -12,16 +12,14 @@ import os # pylint: disable=import-error -from .autoconf import AC_VARS # type: ignore +from .build import BUILD_VARS, SYSTEM_TEST_DIR_GIT_PATH # type: ignore # pylint: enable=import-error -SYSTEM_TEST_DIR_GIT_PATH = "bin/tests/system" - DIR_VARS = { - "builddir": f"{AC_VARS['TOP_BUILDDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}", - "srcdir": f"{AC_VARS['TOP_SRCDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}", + "builddir": f"{BUILD_VARS['TOP_BUILDDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}", + "srcdir": f"{BUILD_VARS['TOP_SRCDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}", "SYSTESTDIR": None, } diff --git a/bin/tests/system/meson.build b/bin/tests/system/meson.build new file mode 100644 index 0000000000..1a1a44cc86 --- /dev/null +++ b/bin/tests/system/meson.build @@ -0,0 +1,42 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +configure_file( + input: 'ifconfig.sh.in', + output: 'ifconfig.sh', + configuration: { + 'SYSTEM': target_machine.system(), + }, +) + +subdir('isctest' / 'vars' / '.build_vars') + +system_test_binaries += { + # 'bigkey': files('rsabigexponent' / 'bigkey.c'), + 'feature-test': files('feature-test.c'), + 'gencheck': files('rndc' / 'gencheck.c'), + 'makejournal': files('makejournal.c'), + 'pipequeries': files('pipelined' / 'pipequeries.c'), + 'wire-test': files('wire-test.c'), +} + +system_test_libraries += { + 'driver-async': files('hooks' / 'driver' / 'test-async.c'), + 'driver-dlzexternal': files('dlzexternal' / 'driver' / 'driver.c'), + 'driver-sample': files( + 'dyndb' / 'driver' / 'db.c', + 'dyndb' / 'driver' / 'driver.c', + 'dyndb' / 'driver' / 'instance.c', + 'dyndb' / 'driver' / 'log.c', + 'dyndb' / 'driver' / 'syncptr.c', + 'dyndb' / 'driver' / 'zone.c', + ), +} diff --git a/bin/tests/system/rsabigexponent/bigkey.c b/bin/tests/system/rsabigexponent/bigkey.c index 1a43916615..1a24479985 100644 --- a/bin/tests/system/rsabigexponent/bigkey.c +++ b/bin/tests/system/rsabigexponent/bigkey.c @@ -107,8 +107,6 @@ main(int argc, char **argv) { isc_mem_create(argv[0], &mctx); - dns_log_init(); - logconfig = isc_logconfig_get(); isc_log_settag(logconfig, "bigkey"); diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index 35a7efe690..a82bc98f22 100755 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -85,7 +85,7 @@ if (!$test) { # Global variables my $builddir = $ENV{'builddir'}; my $srcdir = $ENV{'srcdir'}; -my $testdir = "$builddir/$test"; +my $testdir = "$srcdir/$test"; if (! -d $testdir) { die "No test directory: \"$testdir\"\n"; @@ -234,7 +234,7 @@ sub construct_ns_command { $command = "taskset $taskset $NAMED "; } elsif ($ENV{'USE_RR'}) { $ENV{'_RR_TRACE_DIR'} = "."; - $command = "$ENV{'TOP_BUILDDIR'}/libtool --mode=execute rr record --chaos $NAMED "; + $command = "rr record --chaos $NAMED "; } else { $command = "$NAMED "; } @@ -324,7 +324,7 @@ sub construct_ans_command { } if (-e "$testdir/$server/ans.py") { - $ENV{'PYTHONPATH'} = $testdir . ":" . $builddir; + $ENV{'PYTHONPATH'} = $testdir . ":" . $srcdir; $command = "$PYTHON -u ans.py 10.53.0.$n $queryport"; } elsif (-e "$testdir/$server/ans.pl") { $command = "$PERL ans.pl"; diff --git a/bin/tests/system/stop.pl b/bin/tests/system/stop.pl index 93474b0ee0..7a57250d41 100644 --- a/bin/tests/system/stop.pl +++ b/bin/tests/system/stop.pl @@ -58,7 +58,7 @@ if (!$test) { # Global variables my $builddir = $ENV{'builddir'}; my $srcdir = $ENV{'srcdir'}; -my $testdir = "$builddir/$test"; +my $testdir = "$srcdir/$test"; if (! -d $testdir) { die "No test directory: \"$testdir\"\n"; diff --git a/bin/tests/system/stop.sh.in b/bin/tests/system/stop.sh.in index 9b213568d3..edb535b015 100644 --- a/bin/tests/system/stop.sh.in +++ b/bin/tests/system/stop.sh.in @@ -15,7 +15,7 @@ builddir=@builddir@ srcdir=@srcdir@ # shellcheck source=conf.sh -. "${builddir}/conf.sh" +. "${srcdir}/conf.sh" export builddir srcdir diff --git a/bin/tests/wire_test.c b/bin/tests/system/wire-test.c similarity index 100% rename from bin/tests/wire_test.c rename to bin/tests/system/wire-test.c diff --git a/bin/tools/Makefile.am b/bin/tools/Makefile.am deleted file mode 100644 index 0df1c7409b..0000000000 --- a/bin/tools/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) - -LDADD += \ - $(LIBDNS_LIBS) \ - $(LIBISC_LIBS) - -bin_PROGRAMS = \ - arpaname \ - mdig \ - named-journalprint \ - named-rrchecker \ - nsec3hash - -arpaname_LDADD = \ - $(LIBISC_LIBS) - -if HAVE_DNSTAP -bin_PROGRAMS += \ - dnstap-read - -dnstap_read_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(DNSTAP_CFLAGS) \ - -I$(top_builddir)/lib/dns - -dnstap_read_LDADD = \ - $(LIBDNS_LIBS) \ - $(LIBISC_LIBS) \ - $(DNSTAP_LIBS) -endif - -if HAVE_LMDB -bin_PROGRAMS += \ - named-nzd2nzf - -named_nzd2nzf_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LMDB_CFLAGS) - -named_nzd2nzf_LDADD = \ - $(LIBISC_LIBS) \ - $(LMDB_LIBS) - -endif diff --git a/bin/tools/meson.build b/bin/tools/meson.build new file mode 100644 index 0000000000..fffb29e594 --- /dev/null +++ b/bin/tools/meson.build @@ -0,0 +1,32 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +arpaname_src += files('arpaname.c') +dnstap_read_src += files('dnstap-read.c') +mdig_src += files('mdig.c') +named_journalprint_src += files('named-journalprint.c') +named_nzd2nzf_src += files('named-nzd2nzf.c') +named_rrchecker_src += files('named-rrchecker.c') +nsec3hash_src += files('nsec3hash.c') + +manrst_srcset.add(when: 'HAVE_DNSTAP', if_true: files('dnstap-read.rst')) +manrst_srcset.add(when: 'HAVE_LMDB', if_true: files('named-nzd2nzf.rst')) +manrst_srcset.add( + files( + 'arpaname.rst', + 'dnstap-read.rst', + 'mdig.rst', + 'named-journalprint.rst', + 'named-nzd2nzf.rst', + 'named-rrchecker.rst', + 'nsec3hash.rst', + ), +) diff --git a/ci/amd64cross32.ini b/ci/amd64cross32.ini new file mode 100644 index 0000000000..410aa35ce1 --- /dev/null +++ b/ci/amd64cross32.ini @@ -0,0 +1,27 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# 32-bit builds on Debian + +[binaries] +c = 'i686-linux-gnu-gcc' +ar = 'i686-linux-gnu-ar' +nm = 'i686-linux-gnu-nm' +pkgconfig = 'i686-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'x86' +cpu = 'x86' +endian = 'little' + +[properties] +needs_exe_wrapper = false diff --git a/ci/cross_version_config_test.sh b/ci/cross_version_config_test.sh new file mode 100755 index 0000000000..4f4ef7f248 --- /dev/null +++ b/ci/cross_version_config_test.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git "bind-${BIND_BASELINE_VERSION}" + +cd "bind-${BIND_BASELINE_VERSION}" + +# if [ -f configure.ac ]; then +# echo "cannot compare autoconf builds with meson builds, skipping..." +# exit 0 +# fi + +# meson setup --libdir=lib -Dcmocka=enabled -Ddeveloper=enabled -Dleak-detection=enabled -Doptimization=1 build +# meson compile -C build + +# The cross-version-config-tests job would fail when a system test is +# removed from the upcoming release. To avoid this, remove the system test +# also from the $BIND_BASELINE_VERSION. + +# find bin/tests/system/ -mindepth 1 -maxdepth 1 -type d -exec sh -c 'test -e ../"$0" || rm -rfv -- "$0"' {} \; + +for test in bin/tests/system/*/; do + [ -d "../${test}" ] || rm -rfv ${test} +done + +cd bin/tests/system + +# System tests that employ binary drivers will fail on ABI change and +# should not be run. +rm -r dlzexternal +rm -r dyndb + +cp ${CI_PROJECT_DIR}/build/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR isctest/vars/.build_vars/ diff --git a/ci/freebsd.ini b/ci/freebsd.ini new file mode 100644 index 0000000000..9333cacade --- /dev/null +++ b/ci/freebsd.ini @@ -0,0 +1,15 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# Native file to use MIT Kerberos 5 instead of FreeBSD Heimdal + +[binaries] +krb5-config = '/usr/local/bin/krb5-config' diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a72ddc8acf..0000000000 --- a/configure.ac +++ /dev/null @@ -1,1559 +0,0 @@ -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -# -# Defining the version in m4 requires a bit of dancing around, -# so the strings are properly concatenated, as you can't use -# a shell variable in AC_INIT -# -m4_define([bind_VERSION_MAJOR], 9)dnl -m4_define([bind_VERSION_MINOR], 21)dnl -m4_define([bind_VERSION_PATCH], 10)dnl -m4_define([bind_VERSION_EXTRA], -dev)dnl -m4_define([bind_DESCRIPTION], [(Development Release)])dnl -m4_define([bind_SRCID], [m4_esyscmd_s([git rev-parse --short HEAD | cut -b1-7])])dnl -m4_define([bind_PKG_VERSION], [[bind_VERSION_MAJOR.bind_VERSION_MINOR.bind_VERSION_PATCH]bind_VERSION_EXTRA])dnl - -# -# Autoconf initialization -# -AC_INIT([BIND], bind_PKG_VERSION, [https://gitlab.isc.org/isc-projects/bind9/-/issues/new?issuable_template=Bug], [], [https://www.isc.org/downloads/]) -AC_PREREQ([2.69]) - -AC_DEFINE([PACKAGE_VERSION_MAJOR], ["][bind_VERSION_MAJOR]["], [BIND 9 Major part of the version]) -AC_DEFINE([PACKAGE_VERSION_MINOR], ["][bind_VERSION_MINOR]["], [BIND 9 Minor part of the version]) -AC_DEFINE([PACKAGE_VERSION_PATCH], ["][bind_VERSION_PATCH]["], [BIND 9 Patch part of the version]) -AC_DEFINE([PACKAGE_VERSION_EXTRA], ["][bind_VERSION_EXTRA]["], [BIND 9 Extra part of the version]) -AC_DEFINE([PACKAGE_DESCRIPTION], [m4_ifnblank(bind_DESCRIPTION, [" ]bind_DESCRIPTION["], [])], [An extra string to print after PACKAGE_STRING]) -AC_DEFINE([PACKAGE_SRCID], ["][bind_SRCID]["], [A short hash from git]) - -bind_CONFIGARGS="${ac_configure_args:-default}" -AC_DEFINE_UNQUOTED([PACKAGE_CONFIGARGS], ["$bind_CONFIGARGS"], [Either 'defaults' or used ./configure options]) - -AC_DEFINE([PACKAGE_BUILDER], ["make"], [make or Visual Studio]) - -# -# Get the Canonical System Type -# -AC_CANONICAL_BUILD -AC_CANONICAL_HOST -AC_CANONICAL_TARGET - -AC_CONFIG_SRCDIR([bin/named/main.c]) -AM_INIT_AUTOMAKE([1.14 tar-pax foreign subdir-objects dist-xz no-dist-gzip -Wall -Werror]) -AM_SILENT_RULES([yes]) -AM_EXTRA_RECURSIVE_TARGETS([test unit doc]) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# -# Enable maintainer mode by default only when building from git repository -# and not cross compling -# -AS_IF([test "$cross_compiling" = no], - [AM_MAINTAINER_MODE(m4_ifset([bind_SRCID],[enable],[disable]))], - [AM_MAINTAINER_MODE([disable])]) - -# -# Enable system extensions to C and POSIX -# -AC_USE_SYSTEM_EXTENSIONS - -# -# Compiler compatibility flags -# -m4_version_prereq([2.70], - [AC_PROG_CC], - [AC_PROG_CC_C99]) -AC_PROG_CPP_WERROR - -# -# Find build compiler when cross compiling -# -AX_PROG_CC_FOR_BUILD - -# -# Find the machine's endian flavor. -# -AC_C_BIGENDIAN - -# -# Enable large file support -# -AC_SYS_LARGEFILE -AC_FUNC_FSEEKO - -# Enable RFC 3542 APIs on macOS -AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS]) - -AC_PROG_MAKE_SET - -# Checks for programs. -m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # call AM_PROG_AR only if available - -AC_PROG_INSTALL -AC_PROG_LN_S -AX_POSIX_SHELL -AC_PROG_MKDIR_P - -# Initialize libtool -LT_INIT([disable-static dlopen pic-only]) - -AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"], - [AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])]) - - -# -# Set the default CFLAGS, CPPFLAGS, and LDFLAGS -# -STD_CFLAGS="-Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-missing-field-initializers -Wformat -Wshadow" - -# These should be always errors -STD_CFLAGS="$STD_CFLAGS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=format-security -Werror=parentheses -Werror=implicit -Werror=strict-prototypes -Werror=vla" - -# Disable false positives generated by GCC 11+ and ASAN -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[#if __GNUC__ >= 11 && defined(__SANITIZE_ADDRESS__) - #error Address Sanitizer enabled - #endif - ]])], - [], - [STD_CFLAGS="$STD_CFLAGS -Wno-stringop-overread"]) - -# Silence GCC 11.1+ note about the changed alignment, see GL #4841 -AS_CASE([$target_cpu],[i?86],[STD_CFLAGS="$STD_CFLAGS -Wno-psabi"]) - -STD_LDFLAGS="" - -# ... except in test code -TEST_CFLAGS="-Wno-vla" - -# Fortify the sources by default (we undefine the macro first in case -# the compiler has a different built-in setting) -STD_CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" - -# -# Define constexpr if it is missing from the compiler -# -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[constexpr int foo = 0;]])], - [], - [AC_DEFINE([constexpr],[static const],[Define compatibility shim for non-C23 compilers.])]) - -# -# Additional compiler settings. -# -AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], - [STD_CFLAGS="$STD_CFLAGS -fno-strict-aliasing"]) -# Clang only issues a warning so use -Werror to force a error. -AX_CHECK_COMPILE_FLAG([-Werror -fno-delete-null-pointer-checks], - [STD_CFLAGS="$STD_CFLAGS -fno-delete-null-pointer-checks"]) -AX_CHECK_COMPILE_FLAG([-fdiagnostics-show-option], - [STD_CFLAGS="$STD_CFLAGS -fdiagnostics-show-option"]) - -AX_CHECK_LINK_FLAG([-Wl,--export-dynamic], - [STD_LDFLAGS="$STD_LDFLAGS -Wl,--export-dynamic"]) - -host_macos=no -AS_CASE([$host],[*-darwin*],[host_macos=yes]) -AM_CONDITIONAL([HOST_MACOS], [test "$host_macos" = "yes"]) - -# -# Change defaults for developers if not explicity set. -# Needs to be before the option is tested. -# -# [pairwise: --enable-developer, --disable-developer] -AC_ARG_ENABLE([developer], - [AS_HELP_STRING([--enable-developer], - [enable developer build settings])]) - -AS_IF([test "$enable_developer" = "yes"], - [DEVELOPER_MODE=yes - STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_MEM_TRACKLINES=1 -DISC_LIST_CHECKINIT=1 -DISC_STATS_CHECKUNDERFLOW=1 -DISC_MUTEX_ERROR_CHECK=1 -DISC_SOCKET_DETAILS=1" - test "${enable_querytrace+set}" = set || enable_querytrace=yes - test "${with_cmocka+set}" = set || with_cmocka=yes - test "${with_zlib+set}" = set || with_zlib=yes - test "${enable_warn_error+set}" = set || enable_warn_error=yes - ]) - -AC_SUBST([DEVELOPER_MODE]) -AC_SUBST([STD_CFLAGS]) -AC_SUBST([STD_CPPFLAGS]) -AC_SUBST([STD_LDFLAGS]) -AC_SUBST([TEST_CFLAGS]) - -# [pairwise: --enable-warn-error, --disable-warn-error] -AC_ARG_ENABLE([warn_error], - [AS_HELP_STRING([--enable-warn-error], - [turn on -Werror when compiling])], - [],[enable_warn_error=no]) -AS_IF([test "$enable_warn_error" = "yes"], - [STD_CFLAGS="$STD_CFLAGS -Werror"]) - -# -# Use pkg-config -# - -PKG_PROG_PKG_CONFIG -AS_IF([test -z "$PKG_CONFIG"], - [AC_MSG_ERROR([The pkg-config script could not be found or is too old.])]) - -# -# Pick Userspace-RCU flavor (developer only option) -# -# [pairwise: skip] -AC_ARG_WITH([liburcu], - [AS_HELP_STRING([--with-liburcu=FLAVOR], - [Build with Userspace-RCU variant (developer-only option) (membarrier|qsbr|mb|bp) [default=membarrier]]))], - [], [with_liburcu=membarrier]) - -AC_MSG_CHECKING([liburcu flavor]) -AS_CASE([$with_liburcu], - [membarrier], - [RCU_FLAVOR="liburcu" - AC_DEFINE([RCU_MEMBARRIER], [1], [Build with membarrier Userspace-RCU flavor])], - [qsbr], - [RCU_FLAVOR="liburcu-qsbr" - AC_DEFINE([RCU_QSBR], [1], [Build with QSBR Userspace-RCU flavor])], - [mb], - [RCU_FLAVOR="liburcu-mb" - AC_DEFINE([RCU_MB], [1], [Build with mb Userspace-RCU flavor])], - [bp], - [RCU_FLAVOR="liburcu-bp" - AC_DEFINE([RCU_BP], [1], [Build with bulletproof Userspace-RCU flavor])], - [AC_MSG_ERROR([Invalid Userspace-RCU flavor picked])]) - -AS_IF([test "$with_liburcu" != "membarrier" && test "$enable_developer" != "yes"], - [AC_MSG_ERROR([Changing Userspace-RCU variant is allowed only in developer mode])]) - -AC_MSG_RESULT([$RCU_FLAVOR]) - -# -# liburcu << v0.13.0 didn't add -lurcu-common and some toolchains would -# not add it automatically - we need to add it explicitly in such case. -# -PKG_CHECK_MODULES([LIBURCU], [$RCU_FLAVOR >= 0.13.0 liburcu-cds >= 0.13.0], [], - [PKG_CHECK_MODULES([LIBURCU], [$RCU_FLAVOR >= 0.10.0 liburcu-cds >= 0.10.0], - [LIBURCU_LIBS="$LIBURCU_LIBS -lurcu-common"])]) - -AC_DEFINE_UNQUOTED([RCU_FLAVOR], ["$RCU_FLAVOR"], [Chosen Userspace-RCU flavor]) - -PKG_CHECK_VERSION([RCU_VERSION], [$RCU_FLAVOR]) -AC_DEFINE_UNQUOTED([RCU_VERSION], ["$RCU_VERSION"], [Compile-time Userspace-RCU version]) - -CFLAGS="$CFLAGS $LIBURCU_CFLAGS" -LIBS="$LIBS $LIBURCU_LIBS" - -# -# Userspace-RCU inlining doesn't work for rcu_deference() with some combination -# of C compiler and library version. -# -AC_MSG_CHECKING([whether we can inline small liburcu functions]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#define URCU_INLINE_SMALL_FUNCTIONS 1 - #include ]], - [[struct opaque *a; struct opaque *b = rcu_dereference(a);]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([URCU_INLINE_SMALL_FUNCTIONS], [1], [Inline small (less than 10 lines) functions])], - [AC_MSG_RESULT([no])]) - -# Fuzzing is not included in pairwise testing as fuzzing tools are -# not present in the relevant Docker image. -# -# [pairwise: skip] -AC_ARG_ENABLE([fuzzing], - [AS_HELP_STRING([--enable-fuzzing=], - [Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])], - [], - [enable_fuzzing=no]) - -AC_MSG_CHECKING([whether to enable fuzzing mode]) -AS_CASE([$enable_fuzzing], - [no],[AC_MSG_RESULT([no])], - [afl],[ - AC_MSG_RESULT([using AFL]) - AC_DEFINE([ENABLE_AFL], [1], - [Define to enable American Fuzzy Lop test harness]) - STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1" - FUZZ_LOG_COMPILER="afl.sh"], - [libfuzzer],[ - AC_MSG_RESULT([using libFuzzer]) - STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer-no-link,address,undefined" - LDFLAGS="$LDFLAGS -fsanitize=address,undefined" - FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined" - FUZZ_LOG_COMPILER="libfuzzer.sh"], - [ossfuzz],[ - AC_MSG_RESULT([using OSS-Fuzz]) - FUZZ_LDFLAGS="$LIB_FUZZING_ENGINE"], - [*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])]) -AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"]) -AC_SUBST([FUZZ_LOG_COMPILER]) -AC_SUBST([FUZZ_LDFLAGS]) - -AS_IF([test "$enable_fuzzing" = "afl"], - [AC_MSG_CHECKING("for AFL enabled compiler") - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], - [#ifndef __AFL_COMPILER - #error AFL compiler required - #endif - ])], - [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([set CC=afl- when --enable-fuzzing=afl is used])]) - ]) - -# -# Perl is optional; it is used only by some of the system test scripts. -# -AC_PATH_PROGS([PERL], [perl5 perl]) -AC_SUBST([PERL]) -AM_CONDITIONAL([HAVE_PERL], [test -n "$PERL"]) - -# -# Python is optional, it is used only by some of the system test scripts. -# -AM_PATH_PYTHON([3.6], [], [:]) -AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"]) - -AC_PATH_PROGS([PYTEST], [pytest-3 py.test-3 pytest py.test pytest-pypy], []) -AS_IF([test -z "$PYTEST"], - [AC_MSG_WARN([pytest not found, some system tests will be skipped])]) -AC_SUBST([PYTEST]) -AM_CONDITIONAL([HAVE_PYTEST], [test -n "$PYTEST"]) - -# -# xsltproc is optional, it is used only by system test scripts. -# -AC_PATH_PROG([XSLTPROC], [xsltproc]) - -# -# Using Solaris linker with gcc on Solaris breaks Thread Local Storage -# -AS_CASE([$host], - [*-solaris*],[ - AS_IF([test "$GCC" = "yes"], - [LDFLAGS="$LDFLAGS -zrelax=transtls" - AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage]) - ]) - ]) - -AC_CHECK_HEADERS([fcntl.h regex.h sys/time.h unistd.h sys/mman.h sys/sockio.h sys/select.h sys/sysctl.h net/if6.h net/route.h linux/netlink.h linux/rtnetlink.h], [], [], - [$ac_includes_default - #include - #include - ]) - -# -# Check for C11 thread local storage -# -# NOTE: OpenBSD doesn't ship , so we can't require it (yet). -# -AC_CHECK_HEADERS([threads.h]) - -# -# C11 Atomic Operations -# - -AC_CHECK_HEADERS([stdatomic.h], - [], - [AC_MSG_ERROR([C11 Atomic Operations required, update your toolchain to build BIND 9])]) - -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]] - )], - [AC_MSG_CHECKING([whether -latomic is needed for 64-bit stdatomic.h functions]) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]] - )], - [AC_MSG_RESULT([no])], - [LIBS="$LIBS -latomic" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]] - )], - [AC_MSG_RESULT([yes])], - [AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, please fix your toolchain.])]) - ]) - ], - [AC_MSG_FAILURE([stdatomic.h header found, but compilation failed, please fix your toolchain.])]) - -AC_C_CONST -AC_C_INLINE -AC_C_VOLATILE - -# -# Check for yield support on ARM processors -# -AS_CASE([$host], - [arm*|aarch64*], - [AC_MSG_CHECKING([for ARM yield instruction support]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[__asm__ __volatile__ ("yield")]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_ARM_YIELD], [1], - [define if the ARM yield instruction is available])], - [AC_MSG_RESULT([no])])]) - -# -# Check for pause support on SPARC processors -# -AS_CASE([$host], - [sparc*], - [AC_MSG_CHECKING([for pause instruction support]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[__asm__ __volatile__ ("pause")]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_SPARC_PAUSE], [1], - [define if the SPARC pause instruction is available])], - [AC_MSG_RESULT([no])])]) - -AC_CHECK_FUNCS([sysctlbyname]) - -AC_TYPE_SIZE_T -AC_TYPE_SSIZE_T -AC_TYPE_UINTPTR_T - -# -# check for uname library routine -# -AC_MSG_CHECKING([for uname]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include - ]], - [[ - struct utsname uts; - uname(&uts); - printf("running on %s %s %s for %s\n", - uts.sysname, uts.release, uts.version, uts.machine); - ]])], - [AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_UNAME], [1], [define if uname is available]) - ], - [AC_MSG_RESULT(no) - AC_MSG_WARN([uname is not correctly supported]) - ]) - -# -# check for GCC malloc attribute -# -AX_GCC_FUNC_ATTRIBUTE([malloc]) - -AC_MSG_CHECKING([for extended malloc attributes]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ - #include - #include - __attribute__ ((malloc, malloc (free, 1)) - void * xmalloc(size_t sz) { return malloc(sz); } - ]], - [[ - void *p = xmalloc(8); - free(p); - ]])], - [AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_MALLOC_EXT_ATTR], [1], [define if extended attributes for malloc are available]) - ], - [AC_MSG_RESULT(no)]) - -# -# check for GCC returns_nonnull attribute -# -AX_GCC_FUNC_ATTRIBUTE([returns_nonnull]) - -# -# how to link math functions? -# -AC_SEARCH_LIBS([sqrt],[m]) - -# -# GeoIP support? -# -# Should be on by default if libmaxminddb exists. -# -# [pairwise: --enable-geoip --with-maxminddb=auto, --enable-geoip --with-maxminddb=yes, --disable-geoip] -AC_ARG_ENABLE([geoip], - [AS_HELP_STRING([--disable-geoip], - [support GeoIP2 geolocation ACLs if available [default=yes]])], - [], [enable_geoip="yes"]) - -# [pairwise: skip] -AC_ARG_WITH([maxminddb], - [AS_HELP_STRING([--with-maxminddb=PATH], - [Build with MaxMind GeoIP2 support (auto|yes|no|path) [default=auto]])], - [], [with_maxminddb="auto"]) - -AS_IF([test "$enable_geoip" = "yes"], - [AS_CASE([$with_maxminddb], - [no],[AC_MSG_ERROR([Use '--disable-geoip' to disable the GeoIP])], - [auto],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb], - [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support]) - PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])]) - ],[:])], - [yes],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb], - [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support]) - PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])]) - ])], - [ # default - AX_SAVE_FLAGS([maxminddb]) - MAXMINDDB_CFLAGS="-I$with_maxminddb/include" - MAXMINDDB_LIBS="-L$with_maxminddb/lib" - CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS" - LIBS="$LIBS $MAXMINDDB_LIBS" - AC_SEARCH_LIBS([MMDB_open], [maxminddb], - [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support]) - MAXMINDDB_LIBS="$MAXMINDDB_LIBS $ac_cv_search_MMDB_open" - AC_MSG_NOTICE([GeoIP2 default database path set to $with_maxminddb/share/GeoIP]) - AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb]) - ], - [AC_MSG_ERROR([GeoIP2 requested, but libmaxminddb not found])]) - AX_RESTORE_FLAGS([maxminddb]) - ]) - AC_ARG_VAR([MAXMINDDB_PREFIX], [value of prefix for MAXMINDDB, overriding pkg-config]) -]) - -AM_CONDITIONAL([HAVE_GEOIP2], [test -n "$MAXMINDDB_LIBS"]) - -AC_SUBST([MAXMINDDB_CFLAGS]) -AC_SUBST([MAXMINDDB_LIBS]) - -AX_PTHREAD - -LIBS="$PTHREAD_LIBS $LIBS" -CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -CC="$PTHREAD_CC" - -AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[(void)pthread_mutexattr_settype(&(pthread_mutexattr_t){ NULL }, PTHREAD_MUTEX_ADAPTIVE_NP);]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], [1], [Define to 1 if PTHREAD_MUTEX_ADAPTIVE_NP is available])], - [AC_MSG_RESULT([no])]) - -AC_CHECK_FUNCS([pthread_attr_getstacksize pthread_attr_setstacksize pthread_barrier_init pthread_spin_init]) - -AC_SEARCH_LIBS([sched_yield],[rt]) -AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np]) - -# Look for functions relating to thread naming -AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np]) -AC_CHECK_HEADERS([pthread_np.h], [], [], [#include ]) - -# libuv -PKG_CHECK_MODULES([LIBUV], [libuv >= 1.37.0], [], - [PKG_CHECK_MODULES([LIBUV], [libuv >= 1.34.0 libuv < 1.35.0], [], - [AC_MSG_ERROR([libuv >= 1.34.0 (except 1.35.0 and 1.36.0) not found])])]) - -PKG_CHECK_VERSION([LIBUV_VERSION], [libuv]) - -AX_SAVE_FLAGS([libuv]) -CFLAGS="$CFLAGS $LIBUV_CFLAGS" -LIBS="$LIBS $LIBUV_LIBS" - -# libuv recvmmsg support -AC_CHECK_DECLS([UV_UDP_MMSG_FREE, UV_UDP_MMSG_CHUNK], [], [], [[#include ]]) -AC_MSG_CHECKING([whether struct msghdr uses padding for alignment]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], - [const struct msghdr h = { .__pad1 = 0, .__pad2 = 0 };])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_DECL_UV_UDP_RECVMMSG], - [0], [Disable recvmmsg support on systems with MUSL glibc])], - [AC_MSG_RESULT([no]) - AC_CHECK_DECLS([UV_UDP_RECVMMSG], [], [], [[#include ]])]) - -# libuv recverr support -AC_CHECK_DECLS([UV_UDP_LINUX_RECVERR], [], [], [[#include ]]) - -AX_RESTORE_FLAGS([libuv]) - -# [pairwise: --enable-doh --with-libnghttp2=auto, --enable-doh --with-libnghttp2=yes, --disable-doh] -AC_ARG_ENABLE([doh], - [AS_HELP_STRING([--disable-doh], [disable DNS over HTTPS, removes dependency on libnghttp2 (default is --enable-doh)])], - [], [enable_doh=yes]) - -# [pairwise: skip] -AC_ARG_WITH([libnghttp2], - [AS_HELP_STRING([--with-libnghttp2], - [build with libnghttp2 library [yes|no|auto] (default is auto)])], - [], [with_libnghttp2="auto"]) - -AS_IF([test "$enable_doh" = "yes"], - [AS_CASE([$with_libnghttp2], - [no],[AC_MSG_ERROR([Use '--disable-doh' to disable DNS-over-HTTPS support])], - [auto|yes],[PKG_CHECK_MODULES([LIBNGHTTP2], [libnghttp2 >= 1.6.0], - [AC_DEFINE([HAVE_LIBNGHTTP2], [1], [Build with DNS-over-HTTPS support])], - [AC_MSG_ERROR(m4_normalize([DNS-over-HTTPS support requested, but libnghttp2 not found. - Either install libnghttp2 or use --disable-doh.]))])], - [AC_MSG_ERROR([Specifying libnghttp2 installation path is not supported, adjust PKG_CONFIG_PATH instead])])]) - -AM_CONDITIONAL([HAVE_LIBNGHTTP2], [test -n "$LIBNGHTTP2_LIBS"]) - - -# -# flockfile is usually provided by pthreads -# -AC_CHECK_FUNCS([flockfile getc_unlocked]) - -# -# Look for other ways to allow detection of the number of processors. -# -AC_CHECK_FUNCS([sched_getaffinity cpuset_getaffinity]) - -# -# Do we want to use pthread rwlock? -# -# [pairwise: --enable-pthread-rwlock, --disable-pthread-rwlock] -AC_ARG_ENABLE([pthread_rwlock], - [AS_HELP_STRING([--enable-pthread-rwlock], - [use pthread rwlock instead of internal rwlock implementation])], - [], [enable_pthread_rwlock=no]) - -AS_IF([test "$enable_pthread_rwlock" = "yes"], - [AC_CHECK_FUNCS([pthread_rwlock_rdlock], [], - [AC_MSG_ERROR([pthread_rwlock_rdlock requested but not found])]) - AC_DEFINE([USE_PTHREAD_RWLOCK],[1],[Define if you want to use pthread rwlock implementation]) - ]) -AM_CONDITIONAL([USE_ISC_RWLOCK], [test "$enable_pthread_rwlock" != "yes"]) - -CRYPTO=OpenSSL - -# -# OpenSSL/LibreSSL is mandatory -# -PKG_CHECK_MODULES([OPENSSL], [libssl >= 1.1.1 libcrypto >= 1.1.1]) -PKG_CHECK_VERSION([OPENSSL_VERSION], [openssl]) - -AX_SAVE_FLAGS([openssl]) - -CFLAGS="$OPENSSL_CFLAGS $CFLAGS" -LIBS="$OPENSSL_LIBS $LIBS" - -# -# Check for functions added in OpenSSL or LibreSSL -# -AC_MSG_CHECKING([for Ed448 support]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[EVP_PKEY_CTX *kctx = EVP_PKEY_CTX_new_id(NID_ED448, NULL);]])], - [AC_DEFINE([HAVE_OPENSSL_ED448], [1], [define if OpenSSL supports Ed448]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -AC_CHECK_FUNCS([ERR_get_error_all]) -AC_CHECK_FUNCS([BIO_read_ex BIO_write_ex]) -AC_CHECK_FUNCS([EVP_MD_CTX_get0_md]) -AC_CHECK_FUNCS([EVP_PKEY_eq]) -AC_CHECK_FUNCS([SSL_CTX_set1_cert_store]) - -# -# Check whether FIPS mode is available and whether we should enable it -# -# FIPS is not included in pairwise testing as the relevant Docker image -# does not support FIPS mode. -# -AC_CHECK_FUNCS(EVP_default_properties_enable_fips FIPS_mode) - -# [pairwise: skip] -AC_ARG_ENABLE([fips-mode], - [AS_HELP_STRING([--enable-fips-mode], - [enable FIPS mode in OpenSSL library [default=no]])], - [], [enable_fips_mode="no"]) - -AC_MSG_CHECKING([whether to enable FIPS mode in OpenSSL library]) -AS_CASE([$enable_fips_mode], - [yes], [AC_MSG_RESULT([yes]) - AC_DEFINE([ENABLE_FIPS_MODE], [1], [Define to 1 if you want FIPS mode to be enabled]) - AS_IF([test "x$ac_cv_func_FIPS_mode" != xyes -a "x$ac_cv_func_EVP_default_properties_enable_fips" != xyes], - AC_MSG_FAILURE([OpenSSL FIPS mode requested but not available.]))], - [no], [AC_MSG_RESULT([no])]) - -AX_RESTORE_FLAGS([openssl]) - -AC_SUBST([OPENSSL_CFLAGS]) -AC_SUBST([OPENSSL_LIBS]) - -AC_CHECK_FUNCS([clock_gettime]) - -# [pairwise: --with-gssapi=yes, --with-gssapi=auto, --without-gssapi] -AC_ARG_WITH([gssapi], - [AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]], - [Specify path for system-supplied GSSAPI - [default=auto]])], - [], [with_gssapi="auto"]) - -KRB5_CONFIG= -AS_CASE([$with_gssapi], - [no],[AC_MSG_CHECKING([for GSSAPI support]) - AC_MSG_RESULT([no])], - [yes],[AC_PATH_PROG([KRB5_CONFIG], [krb5-config]) - AS_IF([test -z "$KRB5_CONFIG"], - [AC_MSG_ERROR([krb5-config required but not found])])], - [auto],[AC_PATH_PROG([KRB5_CONFIG], [krb5-config])], - [*krb5-config*],[KRB5_CONFIG="$with_gssapi"], - [AC_MSG_ERROR([--with-gssapi requires yes|no|auto|/path/to/krb5-config])]) - -GSSAPI_CFLAGS= -GSSAPI_LIBS= -KRB5_CFLAGS= -KRB5_LIBS= -AS_IF([test -n "$KRB5_CONFIG"], - [AC_MSG_CHECKING([for gssapi libraries]) - AX_SAVE_FLAGS([gssapi]) - GSSAPI_CFLAGS=`"$KRB5_CONFIG" --cflags gssapi` - GSSAPI_LIBS=`"$KRB5_CONFIG" --libs gssapi` - CFLAGS="$CFLAGS $GSSAPI_CFLAGS" - LIBS="$LIBS $GSSAPI_LIBS" - AC_MSG_RESULT([$GSSAPI_CFLAGS $GSSAPI_LIBS]) - AC_CHECK_HEADERS([gssapi/gssapi.h], [], - [AC_CHECK_HEADERS([gssapi.h], [], - [AC_MSG_ERROR([neither gssapi/gssapi.h nor gssapi.h found])])]) - AC_CHECK_HEADERS([gssapi/gssapi_krb5.h], - [AC_CHECK_HEADERS([gssapi_krb5.h], [] - [AC_MSG_ERROR([neither gssapi/gssapi_krb5.h nor gssapi_krb5.h found])])]) - AC_CHECK_FUNCS([gss_acquire_cred],[], - [AC_MSG_ERROR([linking with $GSSAPI_LIBS does not work])]) - AX_RESTORE_FLAGS([gssapi]) - - AC_MSG_CHECKING([for krb5 libraries]) - AX_SAVE_FLAGS([krb5]) - KRB5_CFLAGS=`"$KRB5_CONFIG" --cflags krb5` - KRB5_LIBS=`$KRB5_CONFIG --libs krb5` - CFLAGS="$CFLAGS $KRB5_CFLAGS" - LIBS="$CFLAGS $KRB5_LIBS" - AC_MSG_RESULT([$KRB5_CFLAGS $KRB5_LIBS]) - AC_CHECK_HEADERS([krb5/krb5.h], [], - [AC_CHECK_HEADERS([krb5.h], [], - [AC_MSG_ERROR([neither krb5/krb5.h nor krb5 found])])]) - AC_CHECK_FUNCS([krb5_init_context], [], - [AC_MSG_ERROR([linking with $KRB5_LIBS failed])]) - AX_RESTORE_FLAGS([krb5]) - - AC_DEFINE([HAVE_GSSAPI], [1], [Define to 1 if you have the Kerberos Framework available]) - # kludge to silence compiler warnings which recommend use of GSS.framework on macOS - AS_CASE([$host],[*-darwin*],[CFLAGS="$CFLAGS -Wno-deprecated-declarations"])]) -AM_CONDITIONAL([HAVE_GSSAPI], [test -n "$GSSAPI_LIBS"]) -AC_SUBST([GSSAPI_CFLAGS]) -AC_SUBST([GSSAPI_LIBS]) -AC_SUBST([KRB5_CFLAGS]) -AC_SUBST([KRB5_LIBS]) - -# -# was --with-lmdb specified? -# - -# [pairwise: --with-lmdb=auto, --with-lmdb=yes, --without-lmdb] -AC_ARG_WITH([lmdb], - [AS_HELP_STRING([--with-lmdb=@<:@PATH@:>@], - [use LMDB library @<:@default=auto@:>@, optionally specify the prefix for lmdb library])], - [:], - [with_lmdb="auto"]) - -ac_lib_lmdb_found=no -AS_CASE([$with_lmdb], - [no],[], - [auto|yes], [PKG_CHECK_MODULES([LMDB], [lmdb], - [ac_lib_lmdb_found=yes], - [for ac_lib_lmdb_path in /usr /usr/local /opt /opt/local; do - AX_LIB_LMDB([$ac_lib_lmdb_path], - [ac_lib_lmdb_found=yes - break]) - done - ])], - [AX_LIB_LMDB([$with_lmdb],[ac_lib_lmdb_found=yes])]) - -# don't fail when in automatic mode -AS_IF([test "$with_lmdb" = "auto" && test "$ac_lib_lmdb_found" = "no"], - [with_lmdb=no]) - -# hard fail when LMDB requested, but not found -AS_IF([test "$with_lmdb" != "no" && test "$ac_lib_lmdb_found" != "yes"], - [AC_MSG_ERROR([LMDB requested, but not found])]) - -AS_IF([test "$ac_lib_lmdb_found" = "yes"], - [AC_DEFINE([HAVE_LMDB], [1], [Use lmdb library])]) - -AC_SUBST([LMDB_CFLAGS]) -AC_SUBST([LMDB_LIBS]) -AM_CONDITIONAL([HAVE_LMDB], [test -n "$LMDB_LIBS"]) - -# -# was --with-libxml2 specified? -# -# [pairwise: --with-libxml2=auto, --with-libxml2=yes, --without-libxml2] -AC_ARG_WITH([libxml2], - [AS_HELP_STRING([--with-libxml2], - [build with libxml2 library [yes|no|auto] (default is auto)])], - [], [with_libxml2="auto"]) - -AS_CASE([$with_libxml2], - [no],[], - [auto],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0], - [AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])], - [:])], - [yes],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0], - [AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])])], - [AC_MSG_ERROR([Specifying libxml2 installation path is not supported, adjust PKG_CONFIG_PATH instead])]) - -AM_CONDITIONAL([HAVE_LIBXML2], [test -n "$LIBXML2_LIBS"]) - -# -# was --with-json-c specified? -# -# [pairwise: --with-json-c=detect, --with-json-c=yes, --without-json-c] -AC_ARG_WITH([json-c], - [AS_HELP_STRING([--with-json-c], - [build with json-c library [yes|no|detect] (default is detect)])], - [], [with_json_c="detect"]) - -AS_CASE([$with_json_c], - [no],[], - [detect],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11], - [AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])], - [:])], - [yes],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11], - [AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])])], - [AC_MSG_ERROR([Specifying json-c installation path is not supported, adjust PKG_CONFIG_PATH instead])] - ) - -AM_CONDITIONAL([HAVE_JSON_C], [test -n "$JSON_C_LIBS"]) - -AC_SUBST([JSON_C_CFLAGS]) -AC_SUBST([JSON_C_LIBS]) - -# -# was --with-zlib specified? -# -# [pairwise: --with-zlib=auto, --with-zlib=yes, --without-zlib] -AC_ARG_WITH([zlib], - [AS_HELP_STRING([--with-zlib], - [build with zlib for HTTP compression - [default=yes]])], - [], with_zlib="auto") - -AS_CASE([$with_zlib], - [no],[], - [auto],[PKG_CHECK_MODULES([ZLIB], [zlib], - [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])], - [:])], - [yes],[PKG_CHECK_MODULES([ZLIB], [zlib], - [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])], - [AC_MSG_ERROR([Specifying zlib installation path is not supported, adjust PKG_CONFIG_PATH instead])]) -AC_SUBST([ZLIB_CFLAGS]) -AC_SUBST([ZLIB_LIBS]) - -# -# Check if the system supports glibc-compatible backtrace() function. -# -AC_CHECK_HEADERS([execinfo.h], - [AC_SEARCH_LIBS([backtrace_symbols], [execinfo], - [AC_CHECK_FUNCS([backtrace_symbols])])]) - -# -# Allow forcibly disabling TCP Fast Open support as autodetection might yield -# confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen() -# comment in lib/isc/socket.c). -# -# [pairwise: --enable-tcp-fastopen, --disable-tcp-fastopen] -AC_ARG_ENABLE([tcp_fastopen], - [AS_HELP_STRING([--disable-tcp-fastopen], - [disable TCP Fast Open support [default=yes]])], - [], [enable_tcp_fastopen="yes"]) - -AS_IF([test "$enable_tcp_fastopen" = "yes"], - [AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])]) - -# -# Check for some other useful functions that are not ever-present. -# -AC_CHECK_FUNCS([strlcpy strlcat strnstr]) - -# -# Check for libedit support -# -# [pairwise: --with-libedit=auto, --with-libedit=yes, --without-libedit] -AC_ARG_WITH([libedit], - [AS_HELP_STRING([--with-libedit=auto|yes|no], - [specify libedit library [default auto]])], - [], [with_libedit="auto"]) - -AS_CASE([$with_libedit], - [no], [], - [auto], [PKG_CHECK_MODULES([LIBEDIT], [libedit], - [AC_DEFINE([HAVE_LIBEDIT], [1], [Build with libedit support])], - [:])], - - [yes], [PKG_CHECK_MODULES([LIBEDIT], [libedit], - [AC_DEFINE([HAVE_LIBEDIT], [1], [Build with libedit support])])], - [AC_MSG_ERROR([Specifying libedit installation path is not supported, adjust PKG_CONFIG_PATH instead])]) -AM_CONDITIONAL([HAVE_LIBEDIT], [test -n "$LIBEDIT_LIBS"]) -AC_SUBST([LIBEDIT_CFLAGS]) -AC_SUBST([LIBEDIT_LIBS]) - -# -# Security Stuff -# -# Note it is very recommended to *not* disable chroot(), -# this is only because chroot() was made obsolete by Posix. -# -# [pairwise: --enable-chroot, --disable-chroot] -AC_ARG_ENABLE(chroot, AS_HELP_STRING([--disable-chroot], [disable chroot])) -case "$enable_chroot" in - yes|'') - AC_CHECK_FUNCS(chroot) - ;; - no) - ;; -esac - -AS_CASE([$host], - [*-linux*], - [PKG_CHECK_MODULES([LIBCAP], [libcap], - [AC_DEFINE([HAVE_LIBCAP], [1], [Define to 1 if libcap was found])])]) - -case "$host" in -*-solaris*) - AC_DEFINE(NEED_SECURE_DIRECTORY, 1, - [Define if connect does not honour the permission on the UNIX domain socket.]) - ;; -esac - -# -# Time Zone Stuff -# -AC_CHECK_FUNCS([tzset]) - -AC_MSG_CHECKING(for optarg declaration) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[optarg = 0;]] - )], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - GEN_NEED_OPTARG="-DNEED_OPTARG=1" - AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])] -) - -# -# Check for nanoseconds in file stats -# -AC_MSG_CHECKING([for st_mtim.tv_nsec]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[struct stat s; - return(s.st_mtim.tv_nsec); - ]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])], - [AC_MSG_RESULT([no])]) - -# -# Check for if_nametoindex() for IPv6 scoped addresses support -# -AC_CHECK_FUNCS([if_nametoindex]) - -AC_CHECK_HEADERS([uchar.h]) - -# -# Check for __builtin_unreachable -# -AC_MSG_CHECKING([compiler support for __builtin_unreachable()]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[]], - [[__builtin_unreachable();]] - )], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_BUILTIN_UNREACHABLE], [1], [define if the compiler supports __builtin_unreachable().]) - ], - [AC_MSG_RESULT([no]) - ]) - -# -# Check for __builtin_clz -# -AC_MSG_CHECKING([compiler support for __builtin_clz]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[]], - [[return (__builtin_clz(0xff) == 24 ? 1 : 0);]] - )], - [AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.]) - ], - [AC_MSG_RESULT([no])] -) - -# -# Check for __builtin_*_overflow -# -AC_MSG_CHECKING([compiler support for __builtin_add_overflow()]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[return (__builtin_add_overflow((unsigned int)UINT_MAX, (unsigned int)UINT_MAX, &(unsigned int){ 0 }));]] - )], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_BUILTIN_ADD_OVERFLOW], [1], [define if the compiler supports __builtin_add_overflow().]) - ], - [AC_MSG_RESULT([no]) - ]) - -AC_MSG_CHECKING([compiler support for __builtin_sub_overflow()]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[return (__builtin_sub_overflow((unsigned int)0, (unsigned int)UINT_MAX, &(unsigned int){ 0 }));]] - )], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_BUILTIN_SUB_OVERFLOW], [1], [define if the compiler supports __builtin_sub_overflow().]) - ], - [AC_MSG_RESULT([no]) - ]) - -AC_MSG_CHECKING([compiler support for __builtin_mul_overflow()]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include - ]], - [[return (__builtin_mul_overflow(UINT64_MAX, UINT64_MAX, &(uint64_t){ 0 }));]] - )], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [define if the compiler supports __builtin_mul_overflow().]) - ], - [AC_MSG_RESULT([no]) - ]) - -# -# Activate dnstap? -# -# [pairwise: --enable-dnstap, --disable-dnstap] -AC_ARG_ENABLE([dnstap], - [AS_HELP_STRING([--enable-dnstap], - [enable dnstap support - (requires fstrm, protobuf-c)])], - [], [enable_dnstap=no]) - -AS_IF([test "$enable_dnstap" != "no"], - [PKG_CHECK_MODULES([DNSTAP], [libfstrm libprotobuf-c], [], - [AC_MSG_FAILURE([Required libraries (fstrm, protobuf-c) were not found, please install them.])]) - AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture]) - AC_PATH_PROG([PROTOC_C], [protoc-c]) - AS_IF([test -z "$PROTOC_C"], - [AC_MSG_ERROR([protoc-c compiler not found])]) - AC_DEFINE([HAVE_DNSTAP], 1, [Define to 1 to enable dnstap support]) - ]) - -AC_SUBST([DNSTAP_CFLAGS]) -AC_SUBST([DNSTAP_LIBS]) -AM_CONDITIONAL([HAVE_DNSTAP], [test "$enable_dnstap" != "no"]) -# -# The following sections deal with tools used for formatting -# the documentation. They are all optional, unless you are -# a developer editing the documentation source. -# - -# -# Look for sphinx-build -# -AC_ARG_VAR([SPHINX_BUILD], [path to sphinx-build binary used to build the documentation]) -AC_PATH_PROG([SPHINX_BUILD], [sphinx-build], []) -AM_CONDITIONAL([HAVE_SPHINX_BUILD], [test -n "$SPHINX_BUILD"]) - -# -# Build the man pages only if we have prebuilt manpages or we can build them from RST sources -# -AM_CONDITIONAL([BUILD_MANPAGES], [test -e doc/man/named.conf.5in || test -n "$SPHINX_BUILD"]) - -# -# Pull release date from changelog.rst file last modification date -# for reproducible builds -# -release_date=`date -u -r doc/arm/changelog.rst +%Y-%m-%d` -AC_SUBST([RELEASE_DATE], $release_date) - -# -# Look for Doxygen -# -AC_PATH_PROGS([DOXYGEN], [doxygen]) - -AC_CONFIG_FILES([doc/doxygen/doxygen-input-filter], - [chmod +x doc/doxygen/doxygen-input-filter]) - -# -# Look for curl -# - -AC_PATH_PROG(CURL, curl, curl) -AC_SUBST(CURL) - -# -# Look for nc -# - -AC_PATH_PROGS(NC, nc, nc) -AC_SUBST(NC) - -# -# IDN support using libidn2 -# - -LIBIDN2_CFLAGS= -LIBIDN2_LIBS= - -# [pairwise: --with-libidn2=yes, --without-libidn2] -AC_ARG_WITH([libidn2], - [AS_HELP_STRING([--with-libidn2[=PATH]], [enable IDN support using GNU libidn2 [yes|no(default)|path]])], - [with_libidn2="$withval"], [with_libidn2="no"]) -AS_CASE([$with_libidn2], - [yes], [PKG_CHECK_MODULES([LIBIDN2], [libidn2], - [AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])])], - [no], [], - [*], [AX_SAVE_FLAGS([libidn2]) - LIBIDN2_CFLAGS="-I$with_libidn2/include" - LIBIDN2_LIBS="-L$with_libidn2/lib" - CFLAGS="$CFLAGS $LIBIDN2_CFLAGS" - LIBS="$LIBS $LIBIDN2_LIBS" - AC_CHECK_HEADERS([idn2.h], - [], - [AC_MSG_ERROR([idn2.h not found])]) - AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2], - [LIBIDN2_LIBS="$LIBIDN2_LIBS $ac_cv_search_idn2_to_ascii_lz" - AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])], - [AC_MSG_ERROR([libidn2 requested, but not found])]) - AX_RESTORE_FLAGS([libidn2])]) -AC_SUBST([LIBIDN2_CFLAGS]) -AC_SUBST([LIBIDN2_LIBS]) - -# -# Check whether to build with cmocka unit testing framework -# -# [pairwise: --with-cmocka=detect, --with-cmocka=yes, --without-cmocka] -AC_ARG_WITH([cmocka], - [AS_HELP_STRING([--with-cmocka=detect],[enable CMocka based tests (default is detect)])], - [],[with_cmocka=detect]) - -AS_CASE([$with_cmocka], - [no],[], - [detect],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.3], - [AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka]) - with_cmocka=yes],[with_cmocka=no])], - [yes],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.3], - [AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])])], - [AC_MSG_ERROR([Use PKG_CONFIG_PATH to specify path to CMocka library])] - ) -AC_SUBST([CMOCKA_CFLAGS]) -AC_SUBST([CMOCKA_LIBS]) - -AM_CONDITIONAL([HAVE_CMOCKA], [test "$with_cmocka" = "yes"]) - -# -# Compile with jemalloc (either provided as package or wired in the system on FreeBSD) -# -# [pairwise: --with-jemalloc=detect, --with-jemalloc=yes, --without-jemalloc] -AC_ARG_WITH([jemalloc], - [AS_HELP_STRING([--with-jemalloc=detect],[enable jemalloc memory allocator (default is detect)])], - [],[with_jemalloc=detect]) - -AS_CASE([$with_jemalloc], - [no],[], - [yes],[AX_CHECK_JEMALLOC( - [AC_DEFINE([HAVE_JEMALLOC], [1], [Define to 1 if jemalloc is available])], - [AC_MSG_ERROR([jemalloc not found])])], - [AX_CHECK_JEMALLOC( - [AC_DEFINE([HAVE_JEMALLOC], [1], [Define to 1 if jemalloc is available]) - with_jemalloc=yes], - [AC_MSG_WARN([jemalloc not found; performance will be reduced]) - with_jemalloc=no])]) - -AS_IF([test "$with_jemalloc" = "no"], - [AS_CASE([$host], - [*-freebsd*],[AC_MSG_ERROR([You cannot compile without jemalloc; jemalloc is the system allocator on FreeBSD])])]) - -AM_CONDITIONAL([HAVE_JEMALLOC], [test "$with_jemalloc" = "yes"]) - -# -# Check memory leaks in external libraries -# -# [pairwise: --enable-leak-detection, --disable-leak-detection] -AC_ARG_ENABLE([leak-detection], - [AS_HELP_STRING([--enable-leak-detection],[enable the memory leak detection in external libraries (libxml2, libuv, OpenSSL) (disabled by default)])], - [],[enable_leak_detection=no]) -AS_CASE([$enable_leak_detection], - [yes],[AC_DEFINE([ENABLE_LEAK_DETECTION], [1], [Define to enable memory leak detection in external libraries])]) - -# -# was --enable-querytrace or --enable-singletrace specified? -# -# [pairwise: --enable-singletrace --enable-querytrace, --disable-singletrace --enable-querytrace, --disable-singletrace --disable-querytrace] -AC_ARG_ENABLE([singletrace], - AS_HELP_STRING([--enable-singletrace], - [enable single-query trace logging - [default=no]]), - enable_singletrace="$enableval", enable_singletrace="no") - -AC_MSG_CHECKING([whether to enable single-query trace logging]) -case "$enable_singletrace" in -yes) - enable_querytrace=yes - AC_MSG_RESULT(yes) - AC_DEFINE(WANT_SINGLETRACE, 1, [Define to enable single-query tracing.]) - ;; -no) - AC_MSG_RESULT(no) - ;; -*) - AC_MSG_ERROR("--enable-singletrace requires yes or no") - ;; -esac - -# [pairwise: skip] -AC_ARG_ENABLE(querytrace, - AS_HELP_STRING([--enable-querytrace], - [enable very verbose query trace logging - [default=no]]), - enable_querytrace="$enableval", - enable_querytrace="$enable_singletrace") - -AC_MSG_CHECKING([whether to enable query trace logging]) -case "$enable_querytrace" in -yes) - AC_MSG_RESULT(yes) - AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.]) - ;; -no) - AS_IF([test "$enable_singletrace" = "yes"], - [AC_MSG_ERROR([--enable-singletrace requires --enable-querytrace])]) - AC_MSG_RESULT(no) - ;; -*) - AC_MSG_ERROR(["--enable-querytrace requires yes or no (not $enable_querytrace)"]) - ;; -esac - -# -# Was --disable-auto-validation specified? -# - -validation_default=auto - -# [pairwise: --enable-auto-validation, --disable-auto-validation] -AC_ARG_ENABLE(auto-validation, - AS_HELP_STRING([--enable-auto-validation], - [turn on DNSSEC validation by default, using the IANA root key [default=yes]]), - [:],[enable_auto_validation=yes]) -AS_IF([test "$enable_auto_validation" = "no"],[validation_default=yes]) -AC_DEFINE_UNQUOTED([VALIDATION_DEFAULT], ["$validation_default"], [the default value of dnssec-validation option]) - -# -# Support for constructor and destructor attributes -# -AX_GCC_FUNC_ATTRIBUTE([constructor]) -AX_GCC_FUNC_ATTRIBUTE([destructor]) - -# -# Check whether to enable User Statically Defined Tracing. -# -# This is supported only on Linux now and requires SystemTap libraries. -# -# [pairwise: --enable-tracing=auto, --enable-tracing=yes, --disable-tracing] -AC_ARG_ENABLE([tracing], - [AS_HELP_STRING([--enable-tracing], - [enable User Statically Defined Tracing])], - [], - [enable_tracing=auto]) - -AC_ARG_VAR([DTRACE], [path to dtrace binary used to build User Statically Defined Tracing probes]) -AC_PATH_PROGS([DTRACE], [dtrace]) -AC_CHECK_HEADERS([sys/sdt.h]) - -AC_MSG_CHECKING([whether to enable User Statically Defined Tracing support (default is auto)]) -AS_CASE([$enable_tracing], - [auto], [enable_tracing=yes - AS_IF([test "$ac_cv_header_sys_sdt_h" != "yes"], [enable_tracing=no]) - AS_IF([test -z "$DTRACE"],[enable_tracing=no]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[#if !defined(__has_feature) - #define __has_feature(x) 0 - #endif /* if !defined(__has_feature) */ - #if __has_feature(address_sanitizer) - #define __SANITIZE_ADDRESS__ 1 - #endif /* if __has_feature(address_sanitizer) */ - #if defined(__SANITIZE_ADDRESS__) - #error Address Sanitizer enabled - #endif - ]])], - [], - [enable_tracing=no] - )]) -AS_CASE([$enable_tracing], - [yes], [AS_IF([test "$ac_cv_header_sys_sdt_h" != "yes"], - [AC_MSG_ERROR([sys/sdt.h header not found])]) - AS_IF([test -z "$DTRACE"], - [AC_MSG_ERROR([The dtrace command not found])]) - AC_MSG_RESULT([yes])], - [DTRACE="" - AC_MSG_RESULT([no])]) - -AS_CASE([$host], - [*-linux*],[have_systemtap=true]) - -AM_CONDITIONAL([HAVE_SYSTEMTAP], [test -n "$have_systemtap"]) -AM_CONDITIONAL([HAVE_DTRACE], [test -n "$DTRACE"]) - -# Use shim script if dtrace is not available -AS_IF([test -z "$DTRACE"], - [DTRACE='$(top_srcdir)/util/dtrace.sh']) - -AC_SUBST([DTRACE]) - -# -# We only support QP zone and cache databases -# -AC_DEFINE_UNQUOTED([ZONEDB_DEFAULT], ["qpzone"], [Default zone database type]) -AC_DEFINE_UNQUOTED([CACHEDB_DEFAULT], ["qpcache"], [Default cache database type]) - -# -# Files to configure. These are listed here because we used to -# specify them as arguments to AC_OUTPUT. -# - -# Top - -AC_CONFIG_FILES([Makefile]) - -# Binaries - -AC_CONFIG_FILES([bin/Makefile - bin/named/Makefile - bin/rndc/Makefile - bin/dig/Makefile - bin/delv/Makefile - bin/dnssec/Makefile - bin/tools/Makefile - bin/nsupdate/Makefile - bin/check/Makefile - bin/confgen/Makefile - bin/plugins/Makefile]) - -# Libraries - -AC_CONFIG_FILES([lib/Makefile - lib/isc/Makefile - lib/dns/Makefile - lib/ns/Makefile - lib/isccfg/Makefile - lib/isccc/Makefile]) - -# Documentation - -AC_CONFIG_FILES([doc/Makefile - doc/arm/Makefile - doc/man/Makefile - doc/misc/Makefile]) - -# Unit tests and benchmarks - -AC_CONFIG_FILES([tests/Makefile - tests/bench/Makefile - tests/isc/Makefile - tests/dns/Makefile - tests/ns/Makefile - tests/isccfg/Makefile - tests/libtest/Makefile]) - -AC_CONFIG_FILES([tests/unit-test-driver.sh], - [chmod +x tests/unit-test-driver.sh]) - -# System Tests - -AC_CONFIG_FILES([bin/tests/Makefile - bin/tests/system/Makefile - bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR - bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR - bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE - bin/tests/system/isctest/vars/.ac_vars/SHELL - bin/tests/system/isctest/vars/.ac_vars/PYTHON - bin/tests/system/isctest/vars/.ac_vars/PERL - bin/tests/system/isctest/vars/.ac_vars/CURL - bin/tests/system/isctest/vars/.ac_vars/NC - bin/tests/system/isctest/vars/.ac_vars/XSLTPROC - bin/tests/system/isctest/vars/.ac_vars/PYTEST - bin/tests/system/dyndb/driver/Makefile - bin/tests/system/dlzexternal/driver/Makefile - bin/tests/system/hooks/driver/Makefile - ]) - -AC_CONFIG_FILES([bin/tests/system/ifconfig.sh], - [chmod +x bin/tests/system/ifconfig.sh]) -AC_CONFIG_FILES([bin/tests/system/start.sh], - [chmod +x bin/tests/system/start.sh]) -AC_CONFIG_FILES([bin/tests/system/stop.sh], - [chmod +x bin/tests/system/stop.sh]) - -# Fuzz Tests - -AC_CONFIG_FILES([fuzz/Makefile]) - -# Misc - -AC_CONFIG_FILES([util/check-make-install]) - -# -# Do it -# - -AC_OUTPUT - -# [pairwise: --enable-full-report, --disable-full-report] -AC_ARG_ENABLE(full-report, - AS_HELP_STRING([--enable-full-report], - [report values of all configure options])) - -report() { - echo "===============================================================================" - echo "Configuration summary:" - echo "-------------------------------------------------------------------------------" - echo "Optional features enabled:" - if test "yes" = "$with_jemalloc"; then - echo " Memory allocator: jemalloc" - fi - if test "yes" = "$enable_full_report" -o "rbt" = "$zonedb"; then - echo " Default zone database type: $zonedb" - fi - if test "yes" = "$enable_full_report" -o "rbt" = "$zonedb"; then - echo " Default cache database type: $cachedb" - fi - test "no" = "$enable_dnstap" || \ - echo " Allow 'dnstap' packet logging (--enable-dnstap)" - test -z "$MAXMINDDB_LIBS" || echo " GeoIP2 access control (--enable-geoip)" - test -z "$GSSAPI_LIBS" || echo " GSS-API (--with-gssapi)" - - # these lines are only printed if run with --enable-full-report - if test "yes" = "$enable_full_report"; then - test -z "$LIBXML2_LIBS" || echo " XML statistics (--with-libxml2)" - test -z "$JSON_C_LIBS" || echo " JSON statistics (--with-json-c): $JSON_C_CFLAGS $JSON_C_LIBS" - test -z "$ZLIB_LIBS" || echo " HTTP zlib compression (--with-zlib)" - test -z "$LMDB_LIBS" || echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)" - test -z "$LIBIDN2_LIBS" || echo " IDN support (--with-libidn2)" - fi - - test "yes" = "$enable_fips_mode" && \ - echo " FIPS mode in OpenSSL (--enable-fips-mode)" - - test "yes" = "$enable_querytrace" && \ - echo " Very verbose query trace logging (--enable-querytrace)" - test "yes" = "$enable_singletrace" && \ - echo " Single-query trace logging (--enable-singletrace)" - test -z "$HAVE_CMOCKA" || echo " CMocka Unit Testing Framework (--with-cmocka)" - - test "auto" = "$validation_default" && echo " DNSSEC validation active by default (--enable-auto-validation)" - - echo "-------------------------------------------------------------------------------" - echo " Library versions:" - echo " OpenSSL: $OPENSSL_VERSION" - echo " libuv: $LIBUV_VERSION" - echo " Userspace-RCU: $RCU_VERSION" - if test "no" != "$with_jemalloc"; then - echo " jemalloc: $JEMALLOC_VERSION" - fi - echo "-------------------------------------------------------------------------------" - - echo "Features disabled or unavailable on this platform:" - if test "no" = "$with_jemalloc"; then - echo " Memory allocator: system" - echo - echo " +------------------------------------------+" - echo " | ==== WARNING ==== |" - echo " | |" - echo " | This is NOT a recommended configuration. |" - echo " | Using the system memory allocator causes |" - echo " | reduced performance and increased memory |" - echo " | fragmentation. Installing the jemalloc |" - echo " | memory allocator (version >= 4.0.0) is |" - echo " | strongly recommended. |" - echo " +------------------------------------------+" - echo - fi - - test "no" = "$enable_dnstap" && \ - echo " Allow 'dnstap' packet logging (--enable-dnstap)" - test -z "$MAXMINDDB_LIBS" && echo " GeoIP2 access control (--enable-geoip)" - test -z "$GSSAPI_LIBS" && echo " GSS-API (--with-gssapi)" - - test "yes" = "$validation_default" && echo " DNSSEC validation requires configuration (--enable-auto-validation)" - - test "yes" = "$enable_fips_mode" || \ - echo " FIPS mode in OpenSSL (--enable-fips-mode)" - - test "yes" = "$enable_querytrace" || \ - echo " Very verbose query trace logging (--enable-querytrace)" - test "yes" = "$enable_singletrace" || \ - echo " Single-query trace logging (--enable-singletrace)" - - test "no" = "$with_cmocka" && echo " CMocka Unit Testing Framework (--with-cmocka)" - - test -z "$LIBXML2_LIBS" && echo " XML statistics (--with-libxml2)" - test -z "$JSON_C_LIBS" && echo " JSON statistics (--with-json-c)" - test -z "$ZLIB_LIBS" && echo " HTTP zlib compression (--with-zlib)" - test -z "$LMDB_LIBS" && echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)" - test -z "$LIBIDN2_LIBS" && echo " IDN support (--with-libidn2)" - - echo "-------------------------------------------------------------------------------" - echo "Configured paths:" - echo " prefix: $prefix" - echo " sysconfdir: $sysconfdir" - echo " localstatedir: $localstatedir" - echo "-------------------------------------------------------------------------------" - echo "Compiler: $CC" - AS_IF([test "$GCC" = "yes"], - [$CC --version 2>&1 | sed 's/^/ /'], - [AS_CASE([$host], - [*-solaris*],[$CC -V 2>&1 | sed 's/^/ /'], - [$CC --version 2>&1 | sed 's/^/ /'])]) - echo "CFLAGS: $STD_CFLAGS $CFLAGS" - echo "CPPFLAGS: $STD_CPPFLAGS $CPPFLAGS" - echo "LDFLAGS: $LDFLAGS" - - if test "X$ac_unrecognized_opts" != "X"; then - echo "-------------------------------------------------------------------------------" - echo "Unrecognized options:" - echo " $ac_unrecognized_opts" - fi - - if test "yes" != "$enable_full_report"; then - echo "-------------------------------------------------------------------------------" - echo "For more detail, use --enable-full-report." - fi - echo "===============================================================================" -} - -if test "yes" != "$silent"; then - report -fi - -# Tell Emacs to edit this file in shell mode. -# Local Variables: -# mode: sh -# End: diff --git a/lib/dns/dnstap.proto b/dnstap.proto similarity index 100% rename from lib/dns/dnstap.proto rename to dnstap.proto diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index 0560c8e099..0000000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -SUBDIRS = . - -if HAVE_PERL -SUBDIRS += misc -endif - -# Do not change this line to "SUBDIRS = man" at the top of this file: in -# maintainer mode, the "man" subdirectory depends on the "misc" subdirectory. -if BUILD_MANPAGES -SUBDIRS += man -endif BUILD_MANPAGES - -if HAVE_SPHINX_BUILD -SUBDIRS += arm -endif HAVE_SPHINX_BUILD diff --git a/doc/arm/Makefile.am b/doc/arm/Makefile.am deleted file mode 100644 index 13e7ad1ca6..0000000000 --- a/doc/arm/Makefile.am +++ /dev/null @@ -1,110 +0,0 @@ -include $(top_srcdir)/Makefile.top -include $(top_srcdir)/Makefile.docs - -EXTRA_DIST = \ - advanced.inc.rst \ - build.inc.rst \ - catz.inc.rst \ - changelog.rst \ - chapter10.rst \ - chapter1.rst \ - chapter2.rst \ - chapter3.rst \ - chapter4.rst \ - chapter5.rst \ - chapter6.rst \ - chapter7.rst \ - chapter9.rst \ - config-auth.inc.rst \ - config-intro.inc.rst \ - config-resolve.inc.rst \ - conf.py \ - dlz.inc.rst \ - dns-ops.inc.rst \ - dnssec-guide.rst \ - dnssec.inc.rst \ - dns-security-overview.dia \ - dns-security-overview.png \ - dns-servers.dia \ - dns-servers.png \ - dns-tree.dia \ - dns-tree.png \ - dyndb.inc.rst \ - general.rst \ - history.rst \ - index.rst \ - intro-dns-bind.inc.rst \ - introduction.inc.rst \ - intro-security.inc.rst \ - isc-logo.pdf \ - logging-categories.inc.rst \ - managed-keys.inc.rst \ - manpages.rst \ - name-resolution.dia \ - name-resolution.png \ - notes.rst \ - pkcs11.inc.rst \ - platforms.inc.rst \ - plugins.inc.rst \ - primary-secondary.dia \ - primary-secondary.png \ - recursive-query.dia \ - recursive-query.png \ - reference.rst \ - requirements.inc.rst \ - requirements.txt \ - resolver-forward.dia \ - resolver-forward.png \ - rpz.inc.rst \ - security.inc.rst \ - sig0.inc.rst \ - troubleshooting.inc.rst \ - tsig.inc.rst \ - zones.inc.rst \ - _ext/iscconf.py \ - _ext/mergegrammar.py \ - _ext/namedconf.py \ - _ext/rndcconf.py \ - _static/custom.css \ - ../changelog/*.rst \ - ../dnssec-guide \ - ../misc/options \ - ../misc/rndc.grammar \ - ../misc/forward.zoneopt \ - ../misc/hint.zoneopt \ - ../misc/in-view.zoneopt \ - ../misc/mirror.zoneopt \ - ../misc/primary.zoneopt \ - ../misc/redirect.zoneopt \ - ../misc/secondary.zoneopt \ - ../misc/static-stub.zoneopt \ - ../misc/stub.zoneopt \ - ../notes/*.rst - -html-local: - $(AM_V_SPHINX)$(SPHINX_BUILD) -b html -d $(SPHINXBUILDDIR)/.doctrees/html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html - -install-html-local: - $(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static - $(INSTALL) -D $(SPHINXBUILDDIR)/html/*.html $(DESTDIR)/$(docdir)/ - cp -R $(SPHINXBUILDDIR)/html/_static/ $(DESTDIR)/$(docdir)/_static/ - -singlehtml: - $(AM_V_SPHINX)$(SPHINX_BUILD) -b singlehtml -d $(SPHINXBUILDDIR)/.doctrees/singlehtml $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/singlehtml - -install-singlehtml: singlehtml - $(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static - $(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/*.html $(DESTDIR)/$(docdir)/ - cp -R $(SPHINXBUILDDIR)/singlehtml/_static/* $(DESTDIR)/$(docdir)/_static/ - -epub: - $(AM_V_SPHINX)$(SPHINX_BUILD) -b epub -d $(SPHINXBUILDDIR)/.doctrees/epub $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/epub - -install-epub: - $(INSTALL) -d $(DESTDIR)/$(docdir) - $(INSTALL_DATA) $(SPHINXBUILDDIR)/epub/*.epub $(DESTDIR)/$(docdir)/ - -clean-local: - -rm -rf $(SPHINXBUILDDIR) - -doc-local: html singlehtml epub diff --git a/doc/arm/_ext/mergegrammar.py b/doc/arm/_ext/mergegrammar.py index b0500eb4b5..0628be64a1 100644 --- a/doc/arm/_ext/mergegrammar.py +++ b/doc/arm/_ext/mergegrammar.py @@ -13,15 +13,23 @@ # Depends on CWD - Sphinx plugin +import os import json from pathlib import Path import parsegrammar +buildroot = os.getenv("BIND_BUILD_ROOT") +if buildroot is None: + raise RuntimeError("Running outside meson?") + +misc_path = Path(buildroot) / "doc" / "misc" +options_path = misc_path / "options" + def read_zone(): zone_grammars = {} - for file in Path("../misc/").glob("*.zoneopt"): + for file in misc_path.glob("*.zoneopt"): # in-view is not really a zone type if file.stem == "in-view": zone_type = "in-view" @@ -39,7 +47,7 @@ def read_zone(): def read_main(): - with Path("../misc/options").open(encoding="ascii") as fp: + with Path(options_path).open(encoding="ascii") as fp: optgrammar = parsegrammar.parse_mapbody(fp) return optgrammar diff --git a/doc/arm/_ext/namedconf.py b/doc/arm/_ext/namedconf.py index bcf4a0c007..2578d0df5b 100644 --- a/doc/arm/_ext/namedconf.py +++ b/doc/arm/_ext/namedconf.py @@ -15,6 +15,7 @@ Sphinx domain "namedconf". See iscconf.py for details. """ + from docutils import nodes import iscconf diff --git a/doc/arm/_ext/rndcconf.py b/doc/arm/_ext/rndcconf.py index cac10e2f46..bc7bd7846b 100644 --- a/doc/arm/_ext/rndcconf.py +++ b/doc/arm/_ext/rndcconf.py @@ -15,11 +15,17 @@ Sphinx domain "rndcconf". See iscconf.py for details. """ +import os +from pathlib import Path + from docutils import nodes import iscconf import parsegrammar +buildroot = os.getenv("BIND_BUILD_ROOT") +grammar_path = Path(buildroot) / "doc" / "misc" / "rndc.grammar" + class ToBeReplacedStatementList(nodes.General, nodes.Element): """ @@ -29,8 +35,9 @@ class ToBeReplacedStatementList(nodes.General, nodes.Element): def setup(app): - with open("../misc/rndc.grammar", encoding="utf-8") as filein: + with open(grammar_path, encoding="utf-8") as filein: grammar = parsegrammar.parse_mapbody(filein) + return iscconf.setup( app, "rndcconf", "rndc.conf", ToBeReplacedStatementList, grammar ) diff --git a/doc/arm/build.inc.rst b/doc/arm/build.inc.rst index bbceecb546..487c14baf6 100644 --- a/doc/arm/build.inc.rst +++ b/doc/arm/build.inc.rst @@ -18,12 +18,11 @@ To build on a Unix or Linux system, use: :: - $ autoreconf -fi ### (only if building from the git repository) - $ ./configure - $ make + $ meson setup build-dir + $ meson compile -C build-dir Several environment variables affect compilation, and they can be set -before running ``configure``. The most significant ones are: +before running ``meson setup``. The most significant ones are: +--------------------+-------------------------------------------------+ | Variable | Description | @@ -31,23 +30,14 @@ before running ``configure``. The most significant ones are: | ``CC`` | The C compiler to use. ``configure`` tries to | | | figure out the right one for supported systems. | +--------------------+-------------------------------------------------+ -| ``CFLAGS`` | The C compiler flags. Defaults to include -g | -| | and/or -O2 as supported by the compiler. Please | -| | include ``-g`` if ``CFLAGS`` needs to be set. | +| ``CC_LD`` | The C linker to use. | ++----------------------------------------------------------------------+ +| ``CFLAGS`` | The C compiler flags. Defaults to an empty | +| | string. | +--------------------+-------------------------------------------------+ | ``LDFLAGS`` | The linker flags. Defaults to an empty string. | +--------------------+-------------------------------------------------+ -Additional environment variables affecting the build are listed at the -end of the ``configure`` help text, which can be obtained by running the -command: - -:: - - $ ./configure --help - -If using Emacs, the ``make tags`` command may be helpful. - .. _build_dependencies: Required Libraries @@ -56,19 +46,24 @@ Required Libraries To build BIND 9, the following packages must be installed: - a C11-compliant compiler +- ``meson`` - ``libcrypto``, ``libssl`` - ``liburcu`` - ``libuv`` - ``perl`` - ``pkg-config`` / ``pkgconfig`` / ``pkgconf`` +BIND 9 requires ``meson`` 0.61 or higher to configure and ``ninja``/``samurai`` +to build from source. + BIND 9.20 requires ``libuv`` 1.37.0 or higher; using ``libuv`` >= 1.40.0 is recommended. On older systems an updated ``libuv`` package needs to be installed from sources, such as EPEL, PPA, or other native sources. The other option is to build and install ``libuv`` from source. OpenSSL 1.1.1 or newer is required. If the OpenSSL library is installed -in a nonstandard location, specify the prefix using ``PKG_CONFIG_PATH``. +in a nonstandard location adjust ``PKG_CONFIG_PATH`` or use the option +``--pkg-config-path``. To use a PKCS#11 hardware service module for cryptographic operations, PKCS#11 Provider (https://github.com/latchset/pkcs11-provider/tree/main) @@ -83,17 +78,10 @@ On Linux, process capabilities are managed in user space using the installed on most Linux systems via the ``libcap-dev`` or ``libcap-devel`` package. -To build BIND from the git repository, the following tools must also be -installed: - -- ``autoconf`` (includes ``autoreconf``) -- ``automake`` -- ``libtool`` - Optional Features ~~~~~~~~~~~~~~~~~ -To see a full list of configuration options, run ``configure --help``. +To see a full list of configuration options, run ``meson configure``. To improve performance, use of the ``jemalloc`` library (https://jemalloc.net/) is strongly recommended. Version 4.0.0 or newer is @@ -101,68 +89,57 @@ required when in use. To support :rfc:`DNS over HTTPS (DoH) <8484>`, the server must be linked with ``libnghttp2`` (https://nghttp2.org/). If the library is -unavailable, ``--disable-doh`` can be used to disable DoH support. +unavailable, ``-Ddoh=disabled`` can be used to disable DoH support. To support the HTTP statistics channel, the server must be linked with at least one of the following libraries: ``libxml2`` (https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) or ``json-c`` -(https://github.com/json-c/json-c). If these are installed at a -nonstandard location, then: - -- for ``libxml2``, specify the prefix using ``--with-libxml2=/prefix``, -- for ``json-c``, adjust ``PKG_CONFIG_PATH``. +(https://github.com/json-c/json-c). If these are installed at a nonstandard +location, adjust ``PKG_CONFIG_PATH`` or use the option ``--pkg-config-path``. To support compression on the HTTP statistics channel, the server must be linked against ``zlib`` (https://zlib.net/). If this is installed in -a nonstandard location, specify the prefix using -``--with-zlib=/prefix``. +a nonstandard location, adjust ``PKG_CONFIG_PATH`` or use the option +``--pkg-config-path``. To support storing configuration data for runtime-added zones in an LMDB database, the server must be linked with ``liblmdb`` (https://github.com/LMDB/lmdb). If this is installed in a nonstandard -location, specify the prefix using ``--with-lmdb=/prefix``. +location, adjust ``PKG_CONFIG_PATH`` or use the option ``--pkg-config-path``. To support MaxMind GeoIP2 location-based ACLs, the server must be linked with ``libmaxminddb`` (https://maxmind.github.io/libmaxminddb/). This is -turned on by default if the library is found; if the library is -installed in a nonstandard location, specify the prefix using -``--with-maxminddb=/prefix``. GeoIP2 support can be switched off with -``--disable-geoip``. +turned on by default if the library is found; if the library is installed in +a nonstandard location, adjust ``PKG_CONFIG_PATH`` or use the option +``--pkg-config-path``. GeoIP2 support can be switched off with +``-Dgeoip=disabled``. For DNSTAP packet logging, ``libfstrm`` (https://github.com/farsightsec/fstrm) and ``libprotobuf-c`` (https://protobuf.dev) must be installed, and -BIND must be configured with ``--enable-dnstap``. +BIND must be configured with ``-Ddnstap=enabled``. To support internationalized domain names in :iscman:`dig`, ``libidn2`` (https://www.gnu.org/software/libidn/#libidn2) must be installed. If the library is installed in a nonstandard location, specify the prefix using ``--with-libidn2=/prefix`` or adjust ``PKG_CONFIG_PATH``. +<<<<<<< HEAD For line editing in :iscman:`nsupdate` and :iscman:`nslookup`, the ``libedit`` library (https://www.thrysoee.dk/editline/) must be installed. If these are installed at a nonstandard location, adjust -``PKG_CONFIG_PATH``. +``PKG_CONFIG_PATH`` or use the option ``--pkg-config-path``. -On some platforms it is necessary to explicitly request large file -support to handle files bigger than 2GB. This can be done by using -``--enable-largefile`` on the ``configure`` command line. - -Support for the “fixed” RRset-order option can be enabled or disabled by -specifying ``--enable-fixed-rrset`` or ``--disable-fixed-rrset`` on the -``configure`` command line. By default, fixed RRset-order is disabled to -reduce memory footprint. - -The ``--enable-querytrace`` option causes :iscman:`named` to log every step -while processing every query. The ``--enable-singletrace`` option turns +The ``-Dtrace-logging=query`` option causes :iscman:`named` to log every step +while processing every query. The ``-Dtrace-logging=query,single`` option turns on the same verbose tracing, but allows an individual query to be separately traced by setting its query ID to 0. These options should only be enabled when debugging, because they have a significant negative impact on query performance. -``make install`` installs :iscman:`named` and the various BIND 9 libraries. By +``meson install`` installs :iscman:`named` and the various BIND 9 libraries. By default, installation is into /usr/local, but this can be changed with -the ``--prefix`` option when running ``configure``. +the ``--prefix`` option when running ``meson setup``. The option ``--sysconfdir`` can be specified to set the directory where configuration files such as :iscman:`named.conf` go by default; diff --git a/doc/arm/conf.py b/doc/arm/conf.py index 371a4d4274..dedada00ca 100644 --- a/doc/arm/conf.py +++ b/doc/arm/conf.py @@ -11,10 +11,10 @@ # information regarding copyright ownership. ############################################################################ -from pathlib import Path -import re +import os import sys +from pathlib import Path from typing import List, Tuple from docutils import nodes @@ -142,6 +142,7 @@ def setup(app): # sys.path.append(str(Path(__file__).resolve().parent / "_ext")) sys.path.append(str(Path(__file__).resolve().parent.parent / "misc")) +sys.path.append(str(Path(__file__).resolve().parent.parent / "ext")) # -- Project information ----------------------------------------------------- @@ -150,29 +151,17 @@ project = "BIND 9" copyright = "2023, Internet Systems Consortium" author = "Internet Systems Consortium" -m4_vars = {} -with open("../../configure.ac", encoding="utf-8") as configure_ac: - for line in configure_ac: - match = re.match( - r"m4_define\(\[(?Pbind_VERSION_[A-Z]+)\], (?P[^)]*)\)dnl", line - ) - if match: - m4_vars[match.group("key")] = match.group("val") +version = os.getenv("BIND_PROJECT_VERSION") -version = "%s.%s.%s%s" % ( - m4_vars["bind_VERSION_MAJOR"], - m4_vars["bind_VERSION_MINOR"], - m4_vars["bind_VERSION_PATCH"], - m4_vars["bind_VERSION_EXTRA"], -) release = version + # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["namedconf", "rndcconf"] +extensions = ["namedconf", "rndcconf", "configblock"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/doc/arm/meson.build b/doc/arm/meson.build new file mode 100644 index 0000000000..2725e3f77b --- /dev/null +++ b/doc/arm/meson.build @@ -0,0 +1,86 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +arm_srcset.add( + files( + 'advanced.inc.rst', + 'build.inc.rst', + 'catz.inc.rst', + 'changelog.rst', + 'chapter1.rst', + 'chapter10.rst', + 'chapter2.rst', + 'chapter3.rst', + 'chapter4.rst', + 'chapter5.rst', + 'chapter6.rst', + 'chapter7.rst', + 'chapter9.rst', + 'config-auth.inc.rst', + 'config-intro.inc.rst', + 'config-resolve.inc.rst', + 'dlz.inc.rst', + 'dns-ops.inc.rst', + 'dnssec-guide.rst', + 'dnssec.inc.rst', + 'dyndb.inc.rst', + 'general.rst', + 'history.rst', + 'index.rst', + 'intro-dns-bind.inc.rst', + 'intro-security.inc.rst', + 'introduction.inc.rst', + 'logging-categories.inc.rst', + 'managed-keys.inc.rst', + 'manpages.rst', + 'notes.rst', + 'pkcs11.inc.rst', + 'platforms.inc.rst', + 'plugins.inc.rst', + 'reference.rst', + 'requirements.inc.rst', + 'rpz.inc.rst', + 'security.inc.rst', + 'sig0.inc.rst', + 'troubleshooting.inc.rst', + 'tsig.inc.rst', + 'zones.inc.rst', + ), + + files( + 'dns-security-overview.png', + 'dns-servers.png', + 'dns-tree.png', + 'name-resolution.png', + 'primary-secondary.png', + 'recursive-query.png', + 'resolver-forward.png', + ), + + files( + 'dns-security-overview.dia', + 'dns-servers.dia', + 'dns-tree.dia', + 'name-resolution.dia', + 'primary-secondary.dia', + 'recursive-query.dia', + 'resolver-forward.dia', + ), + + files( + '_ext' / 'iscconf.py', + '_ext' / 'mergegrammar.py', + '_ext' / 'namedconf.py', + '_ext' / 'rndcconf.py', + 'conf.py', + '_static' / 'custom.css', + ), +) diff --git a/doc/dev/style.md b/doc/dev/style.md index 1a9714f096..7a3e29d48d 100644 --- a/doc/dev/style.md +++ b/doc/dev/style.md @@ -14,9 +14,9 @@ information regarding copyright ownership. ## BIND 9 Coding Style BIND 9 is principally written in [C](#cstyle), with some additional code -written in [Python](#pystyle), [Perl](#plstyle) and -[Bourne shell](#shstyle). Style guidelines for each of these are -below. +written in [Python](#pystyle), [Perl](#plstyle), [Bourne shell](#shstyle) +and [Meson](#mesonstyle). +Style guidelines for each of these are below. ### C @@ -884,3 +884,11 @@ Bash should be avoided. Some pitfalls to avoid: * Don't close stdout/stderr descriptors (`>&-`), but redirect them to /dev/null instead (`>/dev/null`) as the closed descriptor might get reused leading to unpredictable behaviour when using `fprintf(stderr, ...)` + +### Meson + +Dependencies are grouped with the following order: + +- Libraries created with BIND 9 (`libisc`, `libdns` etc.) +- Required dependencies (OpenSSL, libuv etc.) +- Optional dependencies (jemalloc, libxml2 etc.) diff --git a/doc/dnssec-guide/img/meson.build b/doc/dnssec-guide/img/meson.build new file mode 100644 index 0000000000..c4c9738b96 --- /dev/null +++ b/doc/dnssec-guide/img/meson.build @@ -0,0 +1,36 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +arm_srcset.add( + files( + 'add-ds-1.png', + 'add-ds-2.png', + 'add-ds-3.png', + 'add-ds-4.png', + 'add-ds-5.png', + 'add-ds-6.png', + 'dnssec-12-steps.png', + 'dnssec-8-steps.png', + 'dnssec-inline-signing-1.png', + 'dnssec-inline-signing-2.png', + 'dnsviz-example-small.png', + 'remove-ds-1.png', + 'remove-ds-2.png', + 'remove-ds-3.png', + 'signature-generation.png', + 'signature-verification.png', + 'unsign-1.png', + 'unsign-2.png', + 'unsign-3.png', + 'unsign-4.png', + 'verisign-dnssec-debugger-example.png', + ), +) diff --git a/doc/dnssec-guide/meson.build b/doc/dnssec-guide/meson.build new file mode 100644 index 0000000000..7137d30cfc --- /dev/null +++ b/doc/dnssec-guide/meson.build @@ -0,0 +1,26 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +subdir('img') + +arm_srcset.add( + files( + 'advanced-discussions.rst', + 'commonly-asked-questions.rst', + 'getting-started.rst', + 'introduction.rst', + 'preface.rst', + 'recipes.rst', + 'signing.rst', + 'troubleshooting.rst', + 'validation.rst', + ), +) diff --git a/doc/ext/configblock.py b/doc/ext/configblock.py new file mode 100644 index 0000000000..cc34a77ce7 --- /dev/null +++ b/doc/ext/configblock.py @@ -0,0 +1,47 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +import os +from pathlib import Path + +from docutils import nodes + +from sphinx.application import Sphinx +from sphinx.util.docutils import SphinxDirective +from sphinx.util.typing import ExtensionMetadata + + +BIND_BUILD_ROOT = os.getenv("BIND_BUILD_ROOT") +if BIND_BUILD_ROOT is None: + raise RuntimeError("running outside meson?") + +miscpath = Path(BIND_BUILD_ROOT) / "doc" / "misc" + + +class ConfigBlockDirective(SphinxDirective): + required_arguments = 1 + + def run(self) -> list[nodes.Node]: + target = miscpath / self.arguments[0] + + block = "{}" if not target.exists() else target.read_text() + + return [nodes.literal_block(text=block)] + + +def setup(app: Sphinx) -> ExtensionMetadata: + app.add_directive("configblock", ConfigBlockDirective) + + return { + "version": "0.1", + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/doc/ext/meson.build b/doc/ext/meson.build new file mode 100644 index 0000000000..eb9532e463 --- /dev/null +++ b/doc/ext/meson.build @@ -0,0 +1,16 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +manrst_srcset.add( + files( + 'configblock.py', + ), +) diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am deleted file mode 100644 index 37d29ed17f..0000000000 --- a/doc/man/Makefile.am +++ /dev/null @@ -1,217 +0,0 @@ -include $(top_srcdir)/Makefile.top -include $(top_srcdir)/Makefile.docs - -MANPAGES_RST = \ - arpaname.rst \ - delv.rst \ - dig.rst \ - ddns-confgen.rst \ - dnssec-cds.rst \ - dnssec-dsfromkey.rst \ - dnssec-importkey.rst \ - dnssec-keyfromlabel.rst \ - dnssec-keygen.rst \ - dnssec-ksr.rst \ - dnssec-revoke.rst \ - dnssec-settime.rst \ - dnssec-signzone.rst \ - dnssec-verify.rst \ - dnstap-read.rst \ - filter-aaaa.rst \ - filter-a.rst \ - host.rst \ - index.rst \ - mdig.rst \ - named-checkconf.rst \ - named-checkzone.rst \ - named-compilezone.rst \ - named-journalprint.rst \ - named-nzd2nzf.rst \ - named-rrchecker.rst \ - named.conf.rst \ - named.rst \ - nsec3hash.rst \ - nslookup.rst \ - nsupdate.rst \ - rndc-confgen.rst \ - rndc.conf.rst \ - rndc.rst \ - tsig-keygen.rst \ - ../../bin/check/named-checkconf.rst \ - ../../bin/check/named-checkzone.rst \ - ../../bin/check/named-compilezone.rst \ - ../../bin/confgen/ddns-confgen.rst \ - ../../bin/confgen/rndc-confgen.rst \ - ../../bin/confgen/tsig-keygen.rst \ - ../../bin/delv/delv.rst \ - ../../bin/dig/dig.rst \ - ../../bin/dig/host.rst \ - ../../bin/dig/nslookup.rst \ - ../../bin/dnssec/dnssec-cds.rst \ - ../../bin/dnssec/dnssec-dsfromkey.rst \ - ../../bin/dnssec/dnssec-importkey.rst \ - ../../bin/dnssec/dnssec-keyfromlabel.rst \ - ../../bin/dnssec/dnssec-keygen.rst \ - ../../bin/dnssec/dnssec-ksr.rst \ - ../../bin/dnssec/dnssec-revoke.rst \ - ../../bin/dnssec/dnssec-settime.rst \ - ../../bin/dnssec/dnssec-signzone.rst \ - ../../bin/dnssec/dnssec-verify.rst \ - ../../bin/named/named.conf.rst \ - ../../bin/named/named.rst \ - ../../bin/nsupdate/nsupdate.rst \ - ../../bin/plugins/filter-aaaa.rst \ - ../../bin/plugins/filter-a.rst \ - ../../bin/rndc/rndc.conf.rst \ - ../../bin/rndc/rndc.rst \ - ../../bin/tools/arpaname.rst \ - ../../bin/tools/dnstap-read.rst \ - ../../bin/tools/mdig.rst \ - ../../bin/tools/named-journalprint.rst \ - ../../bin/tools/named-nzd2nzf.rst \ - ../../bin/tools/named-rrchecker.rst \ - ../../bin/tools/nsec3hash.rst - -man_MANS = \ - arpaname.1 \ - ddns-confgen.8 \ - delv.1 \ - dig.1 \ - host.1 \ - mdig.1 \ - named-rrchecker.1 \ - nslookup.1 \ - nsupdate.1 \ - named.conf.5 \ - rndc.conf.5 \ - dnssec-cds.1 \ - dnssec-dsfromkey.1 \ - dnssec-importkey.1 \ - dnssec-keyfromlabel.1 \ - dnssec-keygen.1 \ - dnssec-ksr.1 \ - dnssec-revoke.1 \ - dnssec-settime.1 \ - dnssec-signzone.1 \ - dnssec-verify.1 \ - filter-aaaa.8 \ - filter-a.8 \ - named-checkconf.1 \ - named-checkzone.1 \ - named-compilezone.1 \ - named-journalprint.1 \ - named.8 \ - nsec3hash.1 \ - rndc-confgen.8 \ - rndc.8 \ - tsig-keygen.8 - -if HAVE_DNSTAP -man_MANS += \ - dnstap-read.1 -endif HAVE_DNSTAP - -if HAVE_LMDB -man_MANS += \ - named-nzd2nzf.1 -endif HAVE_LMDB - -MANPAGES_IN = \ - $(man_MANS:=in) \ - dnstap-read.1in \ - named-nzd2nzf.1in - -EXTRA_DIST = \ - conf.py \ - $(MANPAGES_RST) \ - $(MANPAGES_IN) - -CLEANFILES += \ - $(man_MANS) - -# -# Build rules for pre-generated manpages -# - -man_SUBST = \ - $(AM_V_SED)$(SED) \ - -e 's,[@]PACKAGE_VERSION@,$(PACKAGE_VERSION),' \ - -e 's,[@]RELEASE_DATE@,$(RELEASE_DATE),' \ - -e 's,[@]libdir[@],$(libdir),g' \ - -e 's,[@]runstatedir[@],$(runstatedir),g' \ - -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ - $(srcdir)/$@in >$@ - -.1in.1: - $(man_SUBST) - -.5in.5: - $(man_SUBST) - -.8in.8: - $(man_SUBST) - -.NOTPARALLEL: man -man: Makefile $(man_MANS) - -doc-local: man - -clean-local:: - -rm -rf $(SPHINXBUILDDIR) - - -CLEANFILES += \ - manpages.stamp - -if MAINTAINER_MODE - -MAINTAINERCLEANFILES = \ - $(MANPAGES_IN) - -endif MAINTAINER_MODE - -# -# Build rules for generating pre-generated manpages -# - -if HAVE_SPHINX_BUILD -# -# See https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html -# -manpages.stamp: $(MANPAGES_RST) - @rm -f manpages.tmp - @touch manpages.tmp - echo "${man_RST_EPILOG}" - $(AM_V_SPHINX)$(SPHINX_BUILD) -b man -d $(SPHINXBUILDDIR)/.doctrees/man $(man_SPHINXOPTS) $(SPHINXBUILDDIR)/man - for f in $(SPHINXBUILDDIR)/man/*; do \ - cp -a "$$f" "$(srcdir)/$$(basename $$f)in"; \ - done - @mv -f manpages.tmp $@ - -$(MANPAGES_IN): manpages.stamp -## Recover from the removal of $@ - @dry=; for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=*|--*);; \ - *n*) dry=:;; \ - esac; \ - done; \ - if test -f $@; then :; else \ - $$dry trap 'rm -rf manpages.lock manpages.stamp' 1 2 13 15; \ - if $$dry mkdir manpages.lock 2>/dev/null; then \ -## This code is being executed by the first process. - $$dry rm -f manpages.stamp; \ - $(MAKE) $(AM_MAKEFLAGS) manpages.stamp; \ - $$dry rmdir manpages.lock; \ - else \ -## This code is being executed by the follower processes. -## Wait until the first process is done. - while test -d manpages.lock && test -z "$$dry"; do \ - sleep 1; \ - done; \ -## Succeed if and only if the first process succeeded. - $$dry test -f manpages.stamp; exit $$?; \ - fi; \ - fi - -endif HAVE_SPHINX_BUILD diff --git a/doc/man/conf.py b/doc/man/conf.py index 1ba2af8b1f..0e92bb61b7 100644 --- a/doc/man/conf.py +++ b/doc/man/conf.py @@ -11,6 +11,10 @@ # information regarding copyright ownership. ############################################################################ +import sys + +from pathlib import Path + # # Configuration file for the Sphinx documentation builder. # @@ -23,10 +27,9 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) + +sys.path.append(str(Path(__file__).resolve().parent.parent / "ext")) +sys.path.append(str(Path(__file__).resolve().parent.parent / "misc")) # -- Project information ----------------------------------------------------- @@ -41,14 +44,12 @@ author = "Internet Systems Consortium" # -- General configuration --------------------------------------------------- -# Build man pages directly in _build/man/, not in _build/man/
/. -# This is what the shell code in Makefile.am expects. -man_make_section_directory = False +man_make_section_directory = True # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ["configblock"] # Add any paths that contain templates here, relative to this directory. templates_path = ["../arm/_templates"] @@ -200,16 +201,16 @@ man_pages = [ ] # -# The rst_epilog will be completely overwritten from the Makefile, -# the definition here is provided purely for situations when -# sphinx-build is run by hand. +# The rst_epilog will be completely overwritten from meson +# the definition here is provided for when manpages are generated +# from built-in dist templates inside meson. # rst_epilog = """ -.. |rndc_conf| replace:: ``@sysconfdir@/rndc.conf`` -.. |rndc_key| replace:: ``@sysconfdir@/rndc.key`` -.. |named_conf| replace:: ``@sysconfdir@/named.conf`` -.. |named_pid| replace:: ``@runstatedir@/named.pid`` -.. |session_key| replace:: ``@runstatedir@/session.key`` +.. |rndc_conf| replace:: ``@SYSCONFDIR@/rndc.conf`` +.. |rndc_key| replace:: ``@SYSCONFDIR@/rndc.key`` +.. |named_conf| replace:: ``@SYSCONFDIR@/named.conf`` +.. |named_pid| replace:: ``@RUNSTATEDIR@/named.pid`` +.. |session_key| replace:: ``@RUNSTATEDIR@/session.key`` """ diff --git a/doc/man/meson.build b/doc/man/meson.build new file mode 100644 index 0000000000..c9b8052ac9 --- /dev/null +++ b/doc/man/meson.build @@ -0,0 +1,92 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +manrst_srcset.add(when: 'HAVE_DNSTAP', if_true: files('dnstap-read.rst')) +manrst_srcset.add(when: 'HAVE_LMDB', if_true: files('named-nzd2nzf.rst')) + +manrst_srcset.add( + files('conf.py'), + + files( + 'arpaname.rst', + 'ddns-confgen.rst', + 'delv.rst', + 'dig.rst', + 'dnssec-cds.rst', + 'dnssec-dsfromkey.rst', + 'dnssec-importkey.rst', + 'dnssec-keyfromlabel.rst', + 'dnssec-keygen.rst', + 'dnssec-ksr.rst', + 'dnssec-revoke.rst', + 'dnssec-settime.rst', + 'dnssec-signzone.rst', + 'dnssec-verify.rst', + 'filter-a.rst', + 'filter-aaaa.rst', + 'host.rst', + 'mdig.rst', + 'named-checkconf.rst', + 'named-checkzone.rst', + 'named-compilezone.rst', + 'named-journalprint.rst', + 'named-rrchecker.rst', + 'named.rst', + 'nsec3hash.rst', + 'nslookup.rst', + 'nsupdate.rst', + 'rndc-confgen.rst', + 'rndc.rst', + 'tsig-keygen.rst', + ), +) + +if fs.is_file('arpaname.1.in') + man_srcset.add(when: 'HAVE_DNSTAP', if_true: files('dnstap-read.1.in')) + man_srcset.add(when: 'HAVE_LMDB', if_true: files('named-nzd2nzf.1.in')) + + man_srcset.add( + files( + 'arpaname.1.in', + 'ddns-confgen.8.in', + 'delv.1.in', + 'dig.1.in', + 'dnssec-cds.1.in', + 'dnssec-dsfromkey.1.in', + 'dnssec-importkey.1.in', + 'dnssec-keyfromlabel.1.in', + 'dnssec-keygen.1.in', + 'dnssec-ksr.1.in', + 'dnssec-revoke.1.in', + 'dnssec-settime.1.in', + 'dnssec-signzone.1.in', + 'dnssec-verify.1.in', + 'filter-a.8.in', + 'filter-aaaa.8.in', + 'host.1.in', + 'mdig.1.in', + 'named-checkconf.1.in', + 'named-checkzone.1.in', + 'named-compilezone.1.in', + 'named-journalprint.1.in', + 'named-rrchecker.1.in', + 'named.8.in', + 'named.conf.5.in', + 'nsec3hash.1.in', + 'nslookup.1.in', + 'nsupdate.1.in', + 'rndc-confgen.8.in', + 'rndc.8.in', + 'rndc.conf.5.in', + 'tsig-keygen.8.in', + ), + ) +endif diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000000..3c30d254a1 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,21 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# Manpages can be build without sphinx +subdir('man') + +if not sphinx_build.found() + subdir_done() +endif + +subdir('arm') +subdir('dnssec-guide') +subdir('misc') diff --git a/doc/misc/Makefile.am b/doc/misc/Makefile.am deleted file mode 100644 index 898aa8f08b..0000000000 --- a/doc/misc/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -include $(top_srcdir)/Makefile.top -include $(top_srcdir)/Makefile.docs - -OPTIONS_FILES = \ - rndc.grammar \ - options \ - primary.zoneopt \ - secondary.zoneopt \ - mirror.zoneopt \ - forward.zoneopt \ - hint.zoneopt \ - stub.zoneopt \ - static-stub.zoneopt \ - redirect.zoneopt \ - in-view.zoneopt - -EXTRA_DIST = \ - $(OPTIONS_FILES) \ - checkgrammar.py \ - parsegrammar.py \ - sort-options.pl - -if MAINTAINER_MODE - -MAINTAINERCLEANFILES = $(OPTIONS_FILES) - -noinst_PROGRAMS = cfg_test - -cfg_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) - -cfg_test_LDADD = \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBISCCFG_LIBS) - -BUILT_SOURCES += \ - $(OPTIONS_FILES) - -rndc.grammar: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --rndc --grammar | $(PERL) $(srcdir)/sort-options.pl > $@ - -options: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --named --grammar | $(PERL) $(srcdir)/sort-options.pl > $@ - -primary.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar primary > $@ - -secondary.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar secondary > $@ - -mirror.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar mirror > $@ - -forward.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar forward > $@ - -hint.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar hint > $@ - -stub.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar stub > $@ - -static-stub.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar static-stub > $@ - -redirect.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar redirect > $@ - -in-view.zoneopt: cfg_test - $(AM_V_CFG_TEST)$(builddir)/cfg_test --zonegrammar in-view > $@ - -endif diff --git a/doc/misc/forward.zoneopt b/doc/misc/forward.zoneopt deleted file mode 100644 index af060cf347..0000000000 --- a/doc/misc/forward.zoneopt +++ /dev/null @@ -1,6 +0,0 @@ -zone [ ] { - type forward; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - template ; -}; diff --git a/doc/misc/hint.zoneopt b/doc/misc/hint.zoneopt deleted file mode 100644 index 260db7fb5f..0000000000 --- a/doc/misc/hint.zoneopt +++ /dev/null @@ -1,6 +0,0 @@ -zone [ ] { - type hint; - check-names ( fail | warn | ignore ); - file ; - template ; -}; diff --git a/doc/misc/in-view.zoneopt b/doc/misc/in-view.zoneopt deleted file mode 100644 index c63c4273e5..0000000000 --- a/doc/misc/in-view.zoneopt +++ /dev/null @@ -1,3 +0,0 @@ -zone [ ] { - in-view ; -}; diff --git a/doc/misc/meson.build b/doc/misc/meson.build new file mode 100644 index 0000000000..c27e129eb0 --- /dev/null +++ b/doc/misc/meson.build @@ -0,0 +1,95 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +sort_options = files('sort-options.pl') + +cfg_test = executable( + 'cfg_test', + files('cfg_test.c'), + install: false, + dependencies: [ + libisc_dep, + libisccfg_dep, + ], +) + +options_unsorted = custom_target( + 'options-unsorted', + capture: true, + install: false, + output: 'options-unsorted', + command: [ + cfg_test, + '--named', + '--grammar', + ], +) + +doc_misc_targets += custom_target( + 'options', + capture: true, + feed: true, + input: options_unsorted, + install: false, + output: 'options', + command: [ + perl, + sort_options, + ], +) + +rndc_grammar_unsorted = custom_target( + 'rndc.grammar-unsorted', + capture: true, + install: false, + output: 'rndc.grammar-unsorted', + command: [ + cfg_test, + '--rndc', + '--grammar', + ], +) + +doc_misc_targets += custom_target( + 'rndc.grammar', + capture: true, + feed: true, + input: rndc_grammar_unsorted, + install: false, + output: 'rndc.grammar', + command: [ + perl, + sort_options, + ], +) + +foreach zone : [ + 'primary', + 'secondary', + 'mirror', + 'forward', + 'hint', + 'stub', + 'static-stub', + 'redirect', + 'in-view', +] + doc_misc_targets += custom_target( + f'@zone@.zoneopt', + capture: true, + install: false, + output: f'@zone@.zoneopt', + command: [ + cfg_test, + '--zonegrammar', zone, + ], + ) +endforeach diff --git a/doc/misc/mirror.zoneopt b/doc/misc/mirror.zoneopt deleted file mode 100644 index aa193235a7..0000000000 --- a/doc/misc/mirror.zoneopt +++ /dev/null @@ -1,47 +0,0 @@ -zone [ ] { - type mirror; - allow-notify { ; ... }; - allow-query { ; ... }; - allow-query-on { ; ... }; - allow-transfer [ port ] [ transport ] { ; ... }; - allow-update-forwarding { ; ... }; - also-notify [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - check-names ( fail | warn | ignore ); - database ; - file ; - ixfr-from-differences ; - journal ; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - max-ixfr-ratio ( unlimited | ); - max-journal-size ( default | unlimited | ); - max-records ; - max-records-per-type ; - max-refresh-time ; - max-retry-time ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; - max-transfer-time-out ; - max-types-per-name ; - min-refresh-time ; - min-retry-time ; - min-transfer-rate-in ; - multi-master ; - notify ( explicit | master-only | primary-only | ); - notify-defer ; - notify-delay ; - notify-source ( | * ); - notify-source-v6 ( | * ); - primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - provide-zoneversion ; - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - template ; - transfer-source ( | * ); - transfer-source-v6 ( | * ); - try-tcp-refresh ; - zero-no-soa-ttl ; - zone-statistics ( full | terse | none | ); -}; diff --git a/doc/misc/options b/doc/misc/options deleted file mode 100644 index 3215fc7af7..0000000000 --- a/doc/misc/options +++ /dev/null @@ -1,695 +0,0 @@ -acl { ; ... }; // may occur multiple times - -controls { - inet ( | | * ) [ port ( | * ) ] allow { ; ... } [ keys { ; ... } ] [ read-only ]; // may occur multiple times - unix perm owner group [ keys { ; ... } ] [ read-only ]; // may occur multiple times -}; // may occur multiple times - -dlz { - database ; - search ; -}; // may occur multiple times - -dnssec-policy { - cdnskey ; - cds-digest-types { ; ... }; - dnskey-ttl ; - inline-signing ; - keys { ( csk | ksk | zsk ) [ key-directory | key-store ] lifetime algorithm [ tag-range ] [ ]; ... }; - max-zone-ttl ; - nsec3param [ iterations ] [ optout ] [ salt-length ]; - offline-ksk ; - parent-ds-ttl ; - parent-propagation-delay ; - publish-safety ; - purge-keys ; - retire-safety ; - signatures-jitter ; - signatures-refresh ; - signatures-validity ; - signatures-validity-dnskey ; - zone-propagation-delay ; -}; // may occur multiple times - -dyndb { }; // may occur multiple times - -http { - endpoints { ; ... }; - listener-clients ; - streams-per-connection ; -}; // optional (only available if configured), may occur multiple times - -key { - algorithm ; - secret ; -}; // may occur multiple times - -key-store { - directory ; - pkcs11-uri ; -}; // may occur multiple times - -logging { - category { ; ... }; // may occur multiple times - channel { - buffered ; - file [ versions ( unlimited | ) ] [ size ] [ suffix ( increment | timestamp ) ]; - null; - print-category ; - print-severity ; - print-time ( iso8601 | iso8601-utc | iso8601-tzinfo | local | ); - severity ; - stderr; - syslog [ ]; - }; // may occur multiple times -}; - -options { - allow-new-zones ; - allow-notify { ; ... }; - allow-proxy { ; ... }; // experimental - allow-proxy-on { ; ... }; // experimental - allow-query { ; ... }; - allow-query-cache { ; ... }; - allow-query-cache-on { ; ... }; - allow-query-on { ; ... }; - allow-recursion { ; ... }; - allow-recursion-on { ; ... }; - allow-transfer [ port ] [ transport ] { ; ... }; - allow-update { ; ... }; - allow-update-forwarding { ; ... }; - also-notify [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - answer-cookie ; - attach-cache ; - auth-nxdomain ; - automatic-interface-scan ; - bindkeys-file ; // test only - blackhole { ; ... }; - catalog-zones { zone [ default-primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone-directory ] [ in-memory ] [ min-update-interval ]; ... }; - check-dup-records ( fail | warn | ignore ); - check-integrity ; - check-mx ( fail | warn | ignore ); - check-mx-cname ( fail | warn | ignore ); - check-names ( primary | master | secondary | slave | response ) ( fail | warn | ignore ); // may occur multiple times - check-sibling ; - check-spf ( warn | ignore ); - check-srv-cname ( fail | warn | ignore ); - check-svcb ; - check-wildcard ; - clients-per-query ; - cookie-algorithm ( siphash24 ); - cookie-secret ; // may occur multiple times - deny-answer-addresses { ; ... } [ except-from { ; ... } ]; - deny-answer-aliases { ; ... } [ except-from { ; ... } ]; - directory ; - disable-algorithms { ; ... }; // may occur multiple times - disable-ds-digests { ; ... }; // may occur multiple times - disable-empty-zone ; // may occur multiple times - dns64 { - break-dnssec ; - clients { ; ... }; - exclude { ; ... }; - mapped { ; ... }; - recursive-only ; - suffix ; - }; // may occur multiple times - dns64-contact ; - dns64-server ; - dnskey-sig-validity ; // obsolete - dnsrps-enable ; // obsolete - dnsrps-library ; // obsolete - dnsrps-options { }; // obsolete - dnssec-accept-expired ; - dnssec-dnskey-kskonly ; // obsolete - dnssec-loadkeys-interval ; - dnssec-policy ; - dnssec-secure-to-insecure ; // obsolete - dnssec-update-mode ( maintain | no-resign ); // obsolete - dnssec-validation ( yes | no | auto ); - dnstap { ( all | auth | client | forwarder | resolver | update ) [ ( query | response ) ]; ... }; // optional (only available if configured) - dnstap-identity ( | none | hostname ); // optional (only available if configured) - dnstap-output ( file | unix ) [ size ( unlimited | ) ] [ versions ( unlimited | ) ] [ suffix ( increment | timestamp ) ]; // optional (only available if configured) - dnstap-version ( | none ); // optional (only available if configured) - dual-stack-servers [ port ] { ( [ port ] | [ port ] | [ port ] ); ... }; - dump-file ; - edns-udp-size ; - empty-contact ; - empty-server ; - empty-zones-enable ; - fetch-quota-params ; - fetches-per-server [ ( drop | fail ) ]; - fetches-per-zone [ ( drop | fail ) ]; - flush-zones-on-shutdown ; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - fstrm-set-buffer-hint ; // optional (only available if configured) - fstrm-set-flush-timeout ; // optional (only available if configured) - fstrm-set-input-queue-size ; // optional (only available if configured) - fstrm-set-output-notify-threshold ; // optional (only available if configured) - fstrm-set-output-queue-model ( mpsc | spsc ); // optional (only available if configured) - fstrm-set-output-queue-size ; // optional (only available if configured) - fstrm-set-reopen-interval ; // optional (only available if configured) - geoip-directory ( | none ); - hostname ( | none ); - http-listener-clients ; // optional (only available if configured) - http-port ; // optional (only available if configured) - http-streams-per-connection ; // optional (only available if configured) - https-port ; // optional (only available if configured) - interface-interval ; - ipv4only-contact ; - ipv4only-enable ; - ipv4only-server ; - ixfr-from-differences ( primary | master | secondary | slave | ); - keep-response-order { ; ... }; // obsolete - key-directory ; - lame-ttl ; - listen-on [ port ] [ proxy ] [ tls ] [ http ] { ; ... }; // may occur multiple times - listen-on-v6 [ port ] [ proxy ] [ tls ] [ http ] { ; ... }; // may occur multiple times - lmdb-mapsize ; // optional (only available if configured) - managed-keys-directory ; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - match-mapped-addresses ; - max-cache-size ( default | unlimited | | ); - max-cache-ttl ; - max-clients-per-query ; - max-ixfr-ratio ( unlimited | ); - max-journal-size ( default | unlimited | ); - max-ncache-ttl ; - max-query-count ; - max-query-restarts ; - max-records ; - max-records-per-type ; - max-recursion-depth ; - max-recursion-queries ; - max-refresh-time ; - max-retry-time ; - max-rsa-exponent-size ; - max-stale-ttl ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; - max-transfer-time-out ; - max-types-per-name ; - max-udp-size ; - max-validation-failures-per-fetch ; // experimental - max-validations-per-fetch ; // experimental - max-zone-ttl ( unlimited | ); // deprecated - memstatistics ; - memstatistics-file ; - message-compression ; - min-cache-ttl ; - min-ncache-ttl ; - min-refresh-time ; - min-retry-time ; - min-transfer-rate-in ; - minimal-any ; - minimal-responses ( no-auth | no-auth-recursive | ); - multi-master ; - new-zones-directory ; - no-case-compress { ; ... }; - nocookie-udp-size ; - notify ( explicit | master-only | primary-only | ); - notify-defer ; - notify-delay ; - notify-rate ; - notify-source ( | * ); - notify-source-v6 ( | * ); - notify-to-soa ; - nsec3-test-zone ; // test only - nta-lifetime ; - nta-recheck ; - nxdomain-redirect ; - parental-source ( | * ); - parental-source-v6 ( | * ); - pid-file ( | none ); - port ; - preferred-glue ; - prefetch [ ]; - provide-ixfr ; - provide-zoneversion ; - qname-minimization ( strict | relaxed | disabled | off ); - query-source [ address ] ( | * | none ); - query-source-v6 [ address ] ( | * | none ); - querylog ; - rate-limit { - all-per-second ; - errors-per-second ; - exempt-clients { ; ... }; - ipv4-prefix-length ; - ipv6-prefix-length ; - log-only ; - max-table-size ; - min-table-size ; - nodata-per-second ; - nxdomains-per-second ; - qps-scale ; - referrals-per-second ; - responses-per-second ; - slip ; - window ; - }; - recursing-file ; - recursion ; - recursive-clients ; - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - request-nsid ; - request-zoneversion ; - require-server-cookie ; - resolver-query-timeout ; - resolver-use-dns64 ; - response-padding { ; ... } block-size ; - response-policy { zone [ add-soa ] [ log ] [ max-policy-ttl ] [ min-update-interval ] [ policy ( cname | disabled | drop | given | no-op | nodata | nxdomain | passthru | tcp-only ) ] [ recursive-only ] [ nsip-enable ] [ nsdname-enable ] [ ede ]; ... } [ add-soa ] [ break-dnssec ] [ max-policy-ttl ] [ min-update-interval ] [ min-ns-dots ] [ nsip-wait-recurse ] [ nsdname-wait-recurse ] [ qname-wait-recurse ] [ recursive-only ] [ nsip-enable ] [ nsdname-enable ] [ dnsrps-enable ] [ dnsrps-options { } ]; - responselog ; - reuseport ; - root-key-sentinel ; - rrset-order { [ class ] [ type ] [ name ] ; ... }; - secroots-file ; - send-cookie ; - send-report-channel ; - serial-query-rate ; - serial-update-method ( date | increment | unixtime ); - server-id ( | none | hostname ); - servfail-ttl ; - session-keyalg ; - session-keyfile ( | none ); - session-keyname ; - sig-signing-nodes ; - sig-signing-signatures ; - sig-signing-type ; - sig-validity-interval [ ]; // obsolete - sig0checks-quota ; // experimental - sig0checks-quota-exempt { ; ... }; // experimental - sig0key-checks-limit ; - sig0message-checks-limit ; - stale-answer-client-timeout ( disabled | off | ); - stale-answer-enable ; - stale-answer-ttl ; - stale-cache-enable ; - stale-refresh-time ; - startup-notify-rate ; - statistics-file ; - synth-from-dnssec ; - tcp-advertised-timeout ; - tcp-clients ; - tcp-idle-timeout ; - tcp-initial-timeout ; - tcp-keepalive-timeout ; - tcp-listen-queue ; - tcp-primaries-timeout ; - tcp-receive-buffer ; - tcp-send-buffer ; - tkey-domain ; - tkey-gssapi-credential ; - tkey-gssapi-keytab ; - tls-port ; - transfer-format ( many-answers | one-answer ); - transfer-message-size ; - transfer-source ( | * ); - transfer-source-v6 ( | * ); - transfers-in ; - transfers-out ; - transfers-per-ns ; - trust-anchor-telemetry ; - try-tcp-refresh ; - udp-receive-buffer ; - udp-send-buffer ; - update-check-ksk ; // obsolete - update-quota ; - v6-bias ; - validate-except { ; ... }; - version ( | none ); - zero-no-soa-ttl ; - zero-no-soa-ttl-cache ; - zone-statistics ( full | terse | none | ); -}; - -plugin ( query ) [ { } ]; // may occur multiple times - -remote-servers [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times - -server { - bogus ; - edns ; - edns-udp-size ; - edns-version ; - keys ; - max-udp-size ; - notify-source ( | * ); - notify-source-v6 ( | * ); - padding ; - provide-ixfr ; - query-source [ address ] ( | * ); - query-source-v6 [ address ] ( | * ); - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - request-nsid ; - request-zoneversion ; - require-cookie ; - send-cookie ; - tcp-keepalive ; - tcp-only ; - transfer-format ( many-answers | one-answer ); - transfer-source ( | * ); - transfer-source-v6 ( | * ); - transfers ; -}; // may occur multiple times - -statistics-channels { - inet ( | | * ) [ port ( | * ) ] [ allow { ; ... } ]; // may occur multiple times -}; // optional (only available if configured), may occur multiple times - -template { - allow-notify { ; ... }; - allow-query { ; ... }; - allow-query-on { ; ... }; - allow-transfer [ port ] [ transport ] { ; ... }; - allow-update { ; ... }; - allow-update-forwarding { ; ... }; - also-notify [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - check-dup-records ( fail | warn | ignore ); - check-integrity ; - check-mx ( fail | warn | ignore ); - check-mx-cname ( fail | warn | ignore ); - check-names ( fail | warn | ignore ); - check-sibling ; - check-spf ( warn | ignore ); - check-srv-cname ( fail | warn | ignore ); - check-svcb ; - check-wildcard ; - checkds ( explicit | ); - database ; - dlz ; - dnskey-sig-validity ; // obsolete - dnssec-dnskey-kskonly ; // obsolete - dnssec-loadkeys-interval ; - dnssec-policy ; - dnssec-secure-to-insecure ; // obsolete - dnssec-update-mode ( maintain | no-resign ); // obsolete - file ; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - initial-file ; - inline-signing ; - ixfr-from-differences ; - journal ; - key-directory ; - log-report-channel ; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - max-ixfr-ratio ( unlimited | ); - max-journal-size ( default | unlimited | ); - max-records ; - max-records-per-type ; - max-refresh-time ; - max-retry-time ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; - max-transfer-time-out ; - max-types-per-name ; - max-zone-ttl ( unlimited | ); // deprecated - min-refresh-time ; - min-retry-time ; - min-transfer-rate-in ; - multi-master ; - notify ( explicit | master-only | primary-only | ); - notify-defer ; - notify-delay ; - notify-source ( | * ); - notify-source-v6 ( | * ); - notify-to-soa ; - nsec3-test-zone ; // test only - parental-agents [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - parental-source ( | * ); - parental-source-v6 ( | * ); - primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - provide-zoneversion ; - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - send-report-channel ; - serial-update-method ( date | increment | unixtime ); - server-addresses { ( | ); ... }; - server-names { ; ... }; - sig-signing-nodes ; - sig-signing-signatures ; - sig-signing-type ; - sig-validity-interval [ ]; // obsolete - transfer-source ( | * ); - transfer-source-v6 ( | * ); - try-tcp-refresh ; - type ( primary | master | secondary | slave | mirror | forward | hint | redirect | static-stub | stub ); - update-check-ksk ; // obsolete - update-policy ( local | { ( deny | grant ) ( 6to4-self | external | krb5-self | krb5-selfsub | krb5-subdomain | krb5-subdomain-self-rhs | ms-self | ms-selfsub | ms-subdomain | ms-subdomain-self-rhs | name | self | selfsub | selfwild | subdomain | tcp-self | wildcard | zonesub ) [ ] ; ... } ); - zero-no-soa-ttl ; - zone-statistics ( full | terse | none | ); -}; // may occur multiple times - -tls { - ca-file ; - cert-file ; - cipher-suites ; - ciphers ; - dhparam-file ; - key-file ; - prefer-server-ciphers ; - protocols { ; ... }; - remote-hostname ; - session-tickets ; -}; // may occur multiple times - -trust-anchors { ( static-key | initial-key | static-ds | initial-ds ) ; ... }; // may occur multiple times - -view [ ] { - allow-new-zones ; - allow-notify { ; ... }; - allow-proxy { ; ... }; // experimental - allow-proxy-on { ; ... }; // experimental - allow-query { ; ... }; - allow-query-cache { ; ... }; - allow-query-cache-on { ; ... }; - allow-query-on { ; ... }; - allow-recursion { ; ... }; - allow-recursion-on { ; ... }; - allow-transfer [ port ] [ transport ] { ; ... }; - allow-update { ; ... }; - allow-update-forwarding { ; ... }; - also-notify [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - attach-cache ; - auth-nxdomain ; - catalog-zones { zone [ default-primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone-directory ] [ in-memory ] [ min-update-interval ]; ... }; - check-dup-records ( fail | warn | ignore ); - check-integrity ; - check-mx ( fail | warn | ignore ); - check-mx-cname ( fail | warn | ignore ); - check-names ( primary | master | secondary | slave | response ) ( fail | warn | ignore ); // may occur multiple times - check-sibling ; - check-spf ( warn | ignore ); - check-srv-cname ( fail | warn | ignore ); - check-svcb ; - check-wildcard ; - clients-per-query ; - deny-answer-addresses { ; ... } [ except-from { ; ... } ]; - deny-answer-aliases { ; ... } [ except-from { ; ... } ]; - disable-algorithms { ; ... }; // may occur multiple times - disable-ds-digests { ; ... }; // may occur multiple times - disable-empty-zone ; // may occur multiple times - dlz { - database ; - search ; - }; // may occur multiple times - dns64 { - break-dnssec ; - clients { ; ... }; - exclude { ; ... }; - mapped { ; ... }; - recursive-only ; - suffix ; - }; // may occur multiple times - dns64-contact ; - dns64-server ; - dnskey-sig-validity ; // obsolete - dnsrps-enable ; // obsolete - dnsrps-options { }; // obsolete - dnssec-accept-expired ; - dnssec-dnskey-kskonly ; // obsolete - dnssec-loadkeys-interval ; - dnssec-policy ; - dnssec-secure-to-insecure ; // obsolete - dnssec-update-mode ( maintain | no-resign ); // obsolete - dnssec-validation ( yes | no | auto ); - dnstap { ( all | auth | client | forwarder | resolver | update ) [ ( query | response ) ]; ... }; // optional (only available if configured) - dual-stack-servers [ port ] { ( [ port ] | [ port ] | [ port ] ); ... }; - dyndb { }; // may occur multiple times - edns-udp-size ; - empty-contact ; - empty-server ; - empty-zones-enable ; - fetch-quota-params ; - fetches-per-server [ ( drop | fail ) ]; - fetches-per-zone [ ( drop | fail ) ]; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - ipv4only-contact ; - ipv4only-enable ; - ipv4only-server ; - ixfr-from-differences ( primary | master | secondary | slave | ); - key { - algorithm ; - secret ; - }; // may occur multiple times - key-directory ; - lame-ttl ; - lmdb-mapsize ; // optional (only available if configured) - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - match-clients { ; ... }; - match-destinations { ; ... }; - match-recursive-only ; - max-cache-size ( default | unlimited | | ); - max-cache-ttl ; - max-clients-per-query ; - max-ixfr-ratio ( unlimited | ); - max-journal-size ( default | unlimited | ); - max-ncache-ttl ; - max-query-count ; - max-query-restarts ; - max-records ; - max-records-per-type ; - max-recursion-depth ; - max-recursion-queries ; - max-refresh-time ; - max-retry-time ; - max-stale-ttl ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; - max-transfer-time-out ; - max-types-per-name ; - max-udp-size ; - max-validation-failures-per-fetch ; // experimental - max-validations-per-fetch ; // experimental - max-zone-ttl ( unlimited | ); // deprecated - message-compression ; - min-cache-ttl ; - min-ncache-ttl ; - min-refresh-time ; - min-retry-time ; - min-transfer-rate-in ; - minimal-any ; - minimal-responses ( no-auth | no-auth-recursive | ); - multi-master ; - new-zones-directory ; - no-case-compress { ; ... }; - nocookie-udp-size ; - notify ( explicit | master-only | primary-only | ); - notify-defer ; - notify-delay ; - notify-source ( | * ); - notify-source-v6 ( | * ); - notify-to-soa ; - nsec3-test-zone ; // test only - nta-lifetime ; - nta-recheck ; - nxdomain-redirect ; - parental-source ( | * ); - parental-source-v6 ( | * ); - plugin ( query ) [ { } ]; // may occur multiple times - preferred-glue ; - prefetch [ ]; - provide-ixfr ; - provide-zoneversion ; - qname-minimization ( strict | relaxed | disabled | off ); - query-source [ address ] ( | * | none ); - query-source-v6 [ address ] ( | * | none ); - rate-limit { - all-per-second ; - errors-per-second ; - exempt-clients { ; ... }; - ipv4-prefix-length ; - ipv6-prefix-length ; - log-only ; - max-table-size ; - min-table-size ; - nodata-per-second ; - nxdomains-per-second ; - qps-scale ; - referrals-per-second ; - responses-per-second ; - slip ; - window ; - }; - recursion ; - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - request-nsid ; - request-zoneversion ; - require-server-cookie ; - resolver-query-timeout ; - resolver-use-dns64 ; - response-padding { ; ... } block-size ; - response-policy { zone [ add-soa ] [ log ] [ max-policy-ttl ] [ min-update-interval ] [ policy ( cname | disabled | drop | given | no-op | nodata | nxdomain | passthru | tcp-only ) ] [ recursive-only ] [ nsip-enable ] [ nsdname-enable ] [ ede ]; ... } [ add-soa ] [ break-dnssec ] [ max-policy-ttl ] [ min-update-interval ] [ min-ns-dots ] [ nsip-wait-recurse ] [ nsdname-wait-recurse ] [ qname-wait-recurse ] [ recursive-only ] [ nsip-enable ] [ nsdname-enable ] [ dnsrps-enable ] [ dnsrps-options { } ]; - root-key-sentinel ; - rrset-order { [ class ] [ type ] [ name ] ; ... }; - send-cookie ; - send-report-channel ; - serial-update-method ( date | increment | unixtime ); - server { - bogus ; - edns ; - edns-udp-size ; - edns-version ; - keys ; - max-udp-size ; - notify-source ( | * ); - notify-source-v6 ( | * ); - padding ; - provide-ixfr ; - query-source [ address ] ( | * ); - query-source-v6 [ address ] ( | * ); - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - request-nsid ; - request-zoneversion ; - require-cookie ; - send-cookie ; - tcp-keepalive ; - tcp-only ; - transfer-format ( many-answers | one-answer ); - transfer-source ( | * ); - transfer-source-v6 ( | * ); - transfers ; - }; // may occur multiple times - servfail-ttl ; - sig-signing-nodes ; - sig-signing-signatures ; - sig-signing-type ; - sig-validity-interval [ ]; // obsolete - sig0key-checks-limit ; - sig0message-checks-limit ; - stale-answer-client-timeout ( disabled | off | ); - stale-answer-enable ; - stale-answer-ttl ; - stale-cache-enable ; - stale-refresh-time ; - synth-from-dnssec ; - transfer-format ( many-answers | one-answer ); - transfer-source ( | * ); - transfer-source-v6 ( | * ); - trust-anchor-telemetry ; - trust-anchors { ( static-key | initial-key | static-ds | initial-ds ) ; ... }; // may occur multiple times - try-tcp-refresh ; - update-check-ksk ; // obsolete - v6-bias ; - validate-except { ; ... }; - zero-no-soa-ttl ; - zero-no-soa-ttl-cache ; - zone-statistics ( full | terse | none | ); -}; // may occur multiple times - diff --git a/doc/misc/primary.zoneopt b/doc/misc/primary.zoneopt deleted file mode 100644 index dd1b94756b..0000000000 --- a/doc/misc/primary.zoneopt +++ /dev/null @@ -1,68 +0,0 @@ -zone [ ] { - type primary; - allow-query { ; ... }; - allow-query-on { ; ... }; - allow-transfer [ port ] [ transport ] { ; ... }; - allow-update { ; ... }; - also-notify [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - check-dup-records ( fail | warn | ignore ); - check-integrity ; - check-mx ( fail | warn | ignore ); - check-mx-cname ( fail | warn | ignore ); - check-names ( fail | warn | ignore ); - check-sibling ; - check-spf ( warn | ignore ); - check-srv-cname ( fail | warn | ignore ); - check-svcb ; - check-wildcard ; - checkds ( explicit | ); - database ; - dlz ; - dnskey-sig-validity ; // obsolete - dnssec-dnskey-kskonly ; // obsolete - dnssec-loadkeys-interval ; - dnssec-policy ; - dnssec-secure-to-insecure ; // obsolete - dnssec-update-mode ( maintain | no-resign ); // obsolete - file ; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - initial-file ; - inline-signing ; - ixfr-from-differences ; - journal ; - key-directory ; - log-report-channel ; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - max-ixfr-ratio ( unlimited | ); - max-journal-size ( default | unlimited | ); - max-records ; - max-records-per-type ; - max-transfer-idle-out ; - max-transfer-time-out ; - max-types-per-name ; - max-zone-ttl ( unlimited | ); // deprecated - notify ( explicit | master-only | primary-only | ); - notify-defer ; - notify-delay ; - notify-source ( | * ); - notify-source-v6 ( | * ); - notify-to-soa ; - nsec3-test-zone ; // test only - parental-agents [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - parental-source ( | * ); - parental-source-v6 ( | * ); - provide-zoneversion ; - send-report-channel ; - serial-update-method ( date | increment | unixtime ); - sig-signing-nodes ; - sig-signing-signatures ; - sig-signing-type ; - sig-validity-interval [ ]; // obsolete - template ; - update-check-ksk ; // obsolete - update-policy ( local | { ( deny | grant ) ( 6to4-self | external | krb5-self | krb5-selfsub | krb5-subdomain | krb5-subdomain-self-rhs | ms-self | ms-selfsub | ms-subdomain | ms-subdomain-self-rhs | name | self | selfsub | selfwild | subdomain | tcp-self | wildcard | zonesub ) [ ] ; ... } ); - zero-no-soa-ttl ; - zone-statistics ( full | terse | none | ); -}; diff --git a/doc/misc/redirect.zoneopt b/doc/misc/redirect.zoneopt deleted file mode 100644 index e338b6e231..0000000000 --- a/doc/misc/redirect.zoneopt +++ /dev/null @@ -1,16 +0,0 @@ -zone [ ] { - type redirect; - allow-query { ; ... }; - allow-query-on { ; ... }; - dlz ; - file ; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - max-records ; - max-records-per-type ; - max-types-per-name ; - max-zone-ttl ( unlimited | ); // deprecated - primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - template ; - zone-statistics ( full | terse | none | ); -}; diff --git a/doc/misc/rndc.grammar b/doc/misc/rndc.grammar deleted file mode 100644 index 9d5604f98a..0000000000 --- a/doc/misc/rndc.grammar +++ /dev/null @@ -1,21 +0,0 @@ -key { - algorithm ; - secret ; -}; // may occur multiple times - -options { - default-key ; - default-port ; - default-server ; - default-source-address ( | * ); - default-source-address-v6 ( | * ); -}; - -server { - addresses { ( [ port ] | [ port ] | [ port ] ); ... }; - key ; - port ; - source-address ( | * ); - source-address-v6 ( | * ); -}; // may occur multiple times - diff --git a/doc/misc/secondary.zoneopt b/doc/misc/secondary.zoneopt deleted file mode 100644 index 7529112a33..0000000000 --- a/doc/misc/secondary.zoneopt +++ /dev/null @@ -1,70 +0,0 @@ -zone [ ] { - type secondary; - allow-notify { ; ... }; - allow-query { ; ... }; - allow-query-on { ; ... }; - allow-transfer [ port ] [ transport ] { ; ... }; - allow-update-forwarding { ; ... }; - also-notify [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - check-names ( fail | warn | ignore ); - checkds ( explicit | ); - database ; - dlz ; - dnskey-sig-validity ; // obsolete - dnssec-dnskey-kskonly ; // obsolete - dnssec-loadkeys-interval ; - dnssec-policy ; - dnssec-update-mode ( maintain | no-resign ); // obsolete - file ; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - inline-signing ; - ixfr-from-differences ; - journal ; - key-directory ; - log-report-channel ; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - max-ixfr-ratio ( unlimited | ); - max-journal-size ( default | unlimited | ); - max-records ; - max-records-per-type ; - max-refresh-time ; - max-retry-time ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; - max-transfer-time-out ; - max-types-per-name ; - min-refresh-time ; - min-retry-time ; - min-transfer-rate-in ; - multi-master ; - notify ( explicit | master-only | primary-only | ); - notify-defer ; - notify-delay ; - notify-source ( | * ); - notify-source-v6 ( | * ); - notify-to-soa ; - nsec3-test-zone ; // test only - parental-agents [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - parental-source ( | * ); - parental-source-v6 ( | * ); - primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - provide-zoneversion ; - request-expire ; - request-ixfr ; - request-ixfr-max-diffs ; - send-report-channel ; - sig-signing-nodes ; - sig-signing-signatures ; - sig-signing-type ; - sig-validity-interval [ ]; // obsolete - template ; - transfer-source ( | * ); - transfer-source-v6 ( | * ); - try-tcp-refresh ; - update-check-ksk ; // obsolete - zero-no-soa-ttl ; - zone-statistics ( full | terse | none | ); -}; diff --git a/doc/misc/static-stub.zoneopt b/doc/misc/static-stub.zoneopt deleted file mode 100644 index 14928922dd..0000000000 --- a/doc/misc/static-stub.zoneopt +++ /dev/null @@ -1,14 +0,0 @@ -zone [ ] { - type static-stub; - allow-query { ; ... }; - allow-query-on { ; ... }; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - max-records ; - max-records-per-type ; - max-types-per-name ; - server-addresses { ( | ); ... }; - server-names { ; ... }; - template ; - zone-statistics ( full | terse | none | ); -}; diff --git a/doc/misc/stub.zoneopt b/doc/misc/stub.zoneopt deleted file mode 100644 index 4d25095484..0000000000 --- a/doc/misc/stub.zoneopt +++ /dev/null @@ -1,28 +0,0 @@ -zone [ ] { - type stub; - allow-query { ; ... }; - allow-query-on { ; ... }; - check-names ( fail | warn | ignore ); - database ; - file ; - forward ( first | only ); - forwarders [ port ] [ tls ] { ( | ) [ port ] [ tls ]; ... }; - masterfile-format ( raw | text ); - masterfile-style ( full | relative ); - max-records ; - max-records-per-type ; - max-refresh-time ; - max-retry-time ; - max-transfer-idle-in ; - max-transfer-time-in ; - max-types-per-name ; - min-refresh-time ; - min-retry-time ; - min-transfer-rate-in ; - multi-master ; - primaries [ port ] [ source ( | * ) ] [ source-v6 ( | * ) ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; - template ; - transfer-source ( | * ); - transfer-source-v6 ( | * ); - zone-statistics ( full | terse | none | ); -}; diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am deleted file mode 100644 index 75407d488b..0000000000 --- a/fuzz/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CFLAGS += \ - $(TEST_CFLAGS) - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBURCU_CFLAGS) \ - $(LIBUV_CFLAGS) \ - -DFUZZDIR=\"$(abs_srcdir)\" \ - -I$(top_srcdir)/lib/dns \ - -I$(top_srcdir)/lib/isc \ - -I$(top_srcdir)/tests/include - -AM_LDFLAGS += \ - $(FUZZ_LDFLAGS) - -LDADD += \ - libfuzzmain.la \ - $(top_builddir)/tests/libtest/libtest.la \ - $(LIBDNS_LIBS) \ - $(LIBISC_LIBS) - -check_LTLIBRARIES = libfuzzmain.la -libfuzzmain_la_SOURCES = \ - fuzz.h \ - main.c - -check_PROGRAMS = \ - dns_master_load \ - dns_message_checksig \ - dns_message_parse \ - dns_name_fromtext_target \ - dns_name_fromwire \ - dns_qp \ - dns_qpkey_name \ - dns_rdata_fromtext \ - dns_rdata_fromwire_text \ - isc_lex_getmastertoken \ - isc_lex_gettoken - -EXTRA_DIST = \ - dns_master_load.in \ - dns_message_checksig.in \ - dns_message_parse.in \ - dns_name_fromtext_target.in \ - dns_name_fromwire.in \ - dns_qp.in \ - dns_qpkey_name.in \ - dns_rdata_fromtext.in \ - dns_rdata_fromwire_text.in \ - isc_lex_getmastertoken.in \ - isc_lex_gettoken.in - -dns_name_fromwire_SOURCES = \ - dns_name_fromwire.c \ - old.c \ - old.h - -TESTS = $(check_PROGRAMS) - -if HAVE_FUZZ_LOG_COMPILER -LOG_COMPILER = $(srcdir)/$(FUZZ_LOG_COMPILER) -AM_LOG_FLAGS = $(srcdir) -endif HAVE_FUZZ_LOG_COMPILER - -unit-local: check diff --git a/fuzz/afl.ini b/fuzz/afl.ini new file mode 100644 index 0000000000..8756039efc --- /dev/null +++ b/fuzz/afl.ini @@ -0,0 +1,28 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +[binaries] +c = 'afl-cc' +pkg-config = 'pkg-config' + +[properties] +needs_exe_wrapper = false + +[built-in options] +b_lundef = false +default_library = 'static' + +[project options] +cmocka = 'disabled' +doc = 'disabled' +fuzzing = 'afl' +tracing = 'disabled' +zlib = 'disabled' diff --git a/fuzz/libfuzzer.ini b/fuzz/libfuzzer.ini new file mode 100644 index 0000000000..86afd9271d --- /dev/null +++ b/fuzz/libfuzzer.ini @@ -0,0 +1,27 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +[binaries] +c = 'clang' +pkg-config = 'pkg-config' + +[properties] +needs_exe_wrapper = false + +[built-in options] +b_lundef = false + +[project options] +cmocka = 'disabled' +doc = 'disabled' +fuzzing = 'libfuzzer' +tracing = 'disabled' +zlib = 'disabled' diff --git a/fuzz/meson.build b/fuzz/meson.build new file mode 100644 index 0000000000..09eef853ad --- /dev/null +++ b/fuzz/meson.build @@ -0,0 +1,28 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +if fuzz_opt == 'none' + subdir_done() +endif + +fuzz_binaries += { + 'fuzz_dns_master_load': files('dns_master_load.c', 'main.c'), + 'fuzz_dns_message_checksig': files('dns_message_checksig.c', 'main.c'), + 'fuzz_dns_message_parse': files('dns_message_parse.c', 'main.c'), + 'fuzz_dns_name_fromtext_target': files('dns_name_fromtext_target.c', 'main.c'), + 'fuzz_dns_name_fromwire': files('dns_name_fromwire.c', 'main.c', 'old.c'), + 'fuzz_dns_qp': files('dns_qp.c', 'main.c'), + 'fuzz_dns_qpkey_name': files('dns_qpkey_name.c', 'main.c'), + 'fuzz_dns_rdata_fromtext': files('dns_rdata_fromtext.c', 'main.c'), + 'fuzz_dns_rdata_fromwire_text': files('dns_rdata_fromwire_text.c', 'main.c'), + 'fuzz_isc_lex_getmastertoken': files('isc_lex_getmastertoken.c', 'main.c'), + 'fuzz_isc_lex_gettoken': files('isc_lex_gettoken.c', 'main.c'), +} diff --git a/gcovr.cfg b/gcovr.cfg new file mode 100644 index 0000000000..84a72cfb50 --- /dev/null +++ b/gcovr.cfg @@ -0,0 +1,18 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +gcov-parallel = yes +gcov-ignore-parse-errors = negative_hits.warn +exclude = lib/*/tests/ +exclude = bin/tests/ +exclude = doc/ +exclude = fuzz/ +exclude = tests/ diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index 62caeeefec..0000000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -include $(top_srcdir)/Makefile.top - -SUBDIRS = isc dns isccc ns isccfg diff --git a/lib/dns/Makefile.am b/lib/dns/Makefile.am deleted file mode 100644 index f77045fe35..0000000000 --- a/lib/dns/Makefile.am +++ /dev/null @@ -1,348 +0,0 @@ -include $(top_srcdir)/Makefile.top - -lib_LTLIBRARIES = libdns.la - -nodist_libdns_ladir = $(includedir)/dns -nodist_libdns_la_HEADERS = \ - include/dns/enumclass.h \ - include/dns/enumtype.h \ - include/dns/rdatastruct.h - -nodist_libdns_la_SOURCES = \ - $(nodist_libdns_la_HEADERS) \ - code.h - -BUILT_SOURCES += \ - $(nodist_libdns_la_SOURCES) - -CLEANFILES += \ - $(nodist_libdns_la_SOURCES) \ - gen$(BUILD_EXEEXT) - -gen$(BUILD_EXEEXT): gen.c - $(CC_FOR_BUILD) -g -I. $(srcdir)/gen.c -o $@ - -EXTRA_DIST = \ - dnstap.proto \ - gen.c \ - rdata/* - -include/dns/enumtype.h: gen Makefile - mkdir -p include/dns - $(builddir)/gen -s $(srcdir) -t > $@ - -include/dns/enumclass.h: gen Makefile - mkdir -p include/dns - $(builddir)/gen -s $(srcdir) -c > $@ - -include/dns/rdatastruct.h: gen rdata/rdatastructpre.h rdata/rdatastructsuf.h Makefile - mkdir -p include/dns - $(builddir)/gen -s $(srcdir) -i \ - -P $(srcdir)/rdata/rdatastructpre.h \ - -S $(srcdir)/rdata/rdatastructsuf.h > $@ - -code.h: gen Makefile - $(builddir)/gen -s $(srcdir) > $@ - -libdns_ladir = $(includedir)/dns -libdns_la_HEADERS = \ - include/dns/acl.h \ - include/dns/adb.h \ - include/dns/badcache.h \ - include/dns/bit.h \ - include/dns/byaddr.h \ - include/dns/cache.h \ - include/dns/callbacks.h \ - include/dns/catz.h \ - include/dns/cert.h \ - include/dns/client.h \ - include/dns/clientinfo.h \ - include/dns/compress.h \ - include/dns/db.h \ - include/dns/dbiterator.h \ - include/dns/diff.h \ - include/dns/dispatch.h \ - include/dns/dlz.h \ - include/dns/dlz_dlopen.h \ - include/dns/dns64.h \ - include/dns/dnssec.h \ - include/dns/ds.h \ - include/dns/dsdigest.h \ - include/dns/dnstap.h \ - include/dns/dyndb.h \ - include/dns/ecs.h \ - include/dns/ede.h \ - include/dns/edns.h \ - include/dns/fixedname.h \ - include/dns/forward.h \ - include/dns/geoip.h \ - include/dns/ipkeylist.h \ - include/dns/iptable.h \ - include/dns/journal.h \ - include/dns/kasp.h \ - include/dns/keydata.h \ - include/dns/keyflags.h \ - include/dns/keymgr.h \ - include/dns/keystore.h \ - include/dns/keytable.h \ - include/dns/keyvalues.h \ - include/dns/lib.h \ - include/dns/master.h \ - include/dns/masterdump.h \ - include/dns/message.h \ - include/dns/name.h \ - include/dns/nametree.h \ - include/dns/ncache.h \ - include/dns/nsec.h \ - include/dns/nsec3.h \ - include/dns/nta.h \ - include/dns/opcode.h \ - include/dns/order.h \ - include/dns/peer.h \ - include/dns/private.h \ - include/dns/qp.h \ - include/dns/rcode.h \ - include/dns/rdata.h \ - include/dns/rdataclass.h \ - include/dns/rdatalist.h \ - include/dns/rdataset.h \ - include/dns/rdatasetiter.h \ - include/dns/rdataslab.h \ - include/dns/rdatatype.h \ - include/dns/remote.h \ - include/dns/request.h \ - include/dns/resolver.h \ - include/dns/result.h \ - include/dns/rootns.h \ - include/dns/rpz.h \ - include/dns/rriterator.h \ - include/dns/rrl.h \ - include/dns/sdlz.h \ - include/dns/secalg.h \ - include/dns/secproto.h \ - include/dns/skr.h \ - include/dns/soa.h \ - include/dns/ssu.h \ - include/dns/stats.h \ - include/dns/time.h \ - include/dns/tkey.h \ - include/dns/trace.h \ - include/dns/transport.h \ - include/dns/tsig.h \ - include/dns/ttl.h \ - include/dns/types.h \ - include/dns/unreachcache.h \ - include/dns/update.h \ - include/dns/validator.h \ - include/dns/view.h \ - include/dns/xfrin.h \ - include/dns/zone.h \ - include/dns/zoneverify.h \ - include/dns/zt.h - -dstdir = $(includedir)/dst -dst_HEADERS = \ - include/dst/dst.h \ - include/dst/gssapi.h - -irsdir = $(includedir)/irs -irs_HEADERS = \ - include/irs/resconf.h - -libdns_la_SOURCES = \ - $(libdns_la_HEADERS) \ - $(dst_HEADERS) \ - $(irs_HEADERS) \ - acl.c \ - acl_p.h \ - adb.c \ - badcache.c \ - byaddr.c \ - cache.c \ - callbacks.c \ - catz.c \ - client.c \ - clientinfo.c \ - compress.c \ - db.c \ - db_p.h \ - dbiterator.c \ - diff.c \ - dispatch.c \ - dlz.c \ - dlz_p.h \ - dns64.c \ - dnssec.c \ - ds.c \ - dst_api.c \ - dst_internal.h \ - dst_openssl.h \ - dst_parse.c \ - dst_parse.h \ - dyndb.c \ - dyndb_p.h \ - ecs.c \ - ede.c \ - fixedname.c \ - forward.c \ - gssapictx.c \ - hmac_link.c \ - ipkeylist.c \ - iptable.c \ - journal.c \ - kasp.c \ - key.c \ - keydata.c \ - keymgr.c \ - keystore.c \ - keytable.c \ - lib.c \ - master.c \ - masterdump.c \ - message.c \ - name.c \ - nametree.c \ - ncache.c \ - nsec.c \ - nsec3.c \ - nta.c \ - openssl_link.c \ - openssl_shim.h \ - opensslecdsa_link.c \ - openssleddsa_link.c \ - opensslrsa_link.c \ - order.c \ - peer.c \ - private.c \ - probes.d \ - qp.c \ - qp_p.h \ - qpzone_p.h \ - qpzone.c \ - qpcache.c \ - qpcache_p.h \ - rcode.c \ - rdata.c \ - rdatalist.c \ - rdataset.c \ - rdatasetiter.c \ - rdataslab.c \ - remote.c \ - request.c \ - resconf.c \ - resolver.c \ - result.c \ - rootns.c \ - rpz.c \ - rrl.c \ - rriterator.c \ - sdlz.c \ - skr.c \ - soa.c \ - ssu.c \ - ssu_external.c \ - stats.c \ - time.c \ - transport.c \ - tkey.c \ - tsig.c \ - tsig_p.h \ - ttl.c \ - unreachcache.c \ - update.c \ - validator.c \ - view.c \ - xfrin.c \ - zone.c \ - zone_p.h \ - zoneverify.c \ - zt.c - -if HAVE_GSSAPI -libdns_la_SOURCES += \ - gssapi_link.c -endif - -if HAVE_GEOIP2 -libdns_la_SOURCES += \ - geoip2.c -endif - -libdns_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBURCU_CFLAGS) \ - $(LIBUV_CFLAGS) \ - $(OPENSSL_CFLAGS) - -libdns_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -release "$(PACKAGE_VERSION)" - -libdns_la_LIBADD = \ - $(LIBISC_LIBS) \ - $(LIBURCU_LIBS) \ - $(LIBUV_LIBS) \ - $(OPENSSL_LIBS) - -if HAVE_JSON_C -libdns_la_CPPFLAGS += \ - $(JSON_C_CFLAGS) - -libdns_la_LIBADD += \ - $(JSON_C_LIBS) -endif HAVE_JSON_C - -if HAVE_LIBXML2 -libdns_la_CPPFLAGS += \ - $(LIBXML2_CFLAGS) - -libdns_la_LIBADD += \ - $(LIBXML2_LIBS) -endif HAVE_LIBXML2 - -if HAVE_GSSAPI -libdns_la_CPPFLAGS += \ - $(GSSAPI_CFLAGS) \ - $(KRB5_CFLAGS) -libdns_la_LIBADD += \ - $(GSSAPI_LIBS) \ - $(KRB5_LIBS) -endif - -if HAVE_GEOIP2 -libdns_la_CPPFLAGS += \ - $(MAXMINDDB_CFLAGS) -libdns_la_LIBADD += \ - $(MAXMINDDB_LIBS) -endif - -if HAVE_DNSTAP -nodist_libdns_la_SOURCES += \ - dnstap.pb-c.h \ - dnstap.pb-c.c - -libdns_la_SOURCES += \ - dnstap.c - -dnstap.pb-c.h dnstap.pb-c.c: dnstap.proto - $(PROTOC_C) --proto_path=$(srcdir) --c_out=. dnstap.proto - -libdns_la_CPPFLAGS += $(DNSTAP_CFLAGS) -libdns_la_LIBADD += $(DNSTAP_LIBS) -endif - -if HAVE_LMDB -libdns_la_CPPFLAGS += $(LMDB_CFLAGS) -libdns_la_LIBADD += $(LMDB_LIBS) -endif - -if !HAVE_SYSTEMTAP -DTRACE_DEPS = libdns_la-xfrin.lo -DTRACE_OBJS = .libs/libdns_la-xfrin.$(OBJEXT) -endif - -include $(top_srcdir)/Makefile.dtrace - -libdns_la_LIBADD += $(DTRACE_LIBADD) diff --git a/lib/dns/include/dns/meson.build b/lib/dns/include/dns/meson.build new file mode 100644 index 0000000000..56f5907f90 --- /dev/null +++ b/lib/dns/include/dns/meson.build @@ -0,0 +1,46 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_gen_headers += [ + custom_target( + 'dns-header-enumtype', + output: 'enumtype.h', + depend_files: dns_header_depfiles, + capture: true, + install: false, + command: [dns_header_gen, '-s', '@CURRENT_SOURCE_DIR@' / '..' / '..', '-t'], + ), + + custom_target( + 'dns-header-enumclass', + output: 'enumclass.h', + depend_files: dns_header_depfiles, + capture: true, + install: false, + command: [dns_header_gen, '-s', '@CURRENT_SOURCE_DIR@' / '..' / '..', '-c'], + ), + + custom_target( + 'dns-header-rdatastruct', + output: 'rdatastruct.h', + depend_files: dns_header_depfiles, + capture: true, + install: false, + install_dir: get_option('includedir') / 'dns', + command: [ + dns_header_gen, + '-s', '@CURRENT_SOURCE_DIR@' / '..' / '..', + '-i', + '-P', '@CURRENT_SOURCE_DIR@' / '..' / '..' / 'rdata' / 'rdatastructpre.h', + '-S', '@CURRENT_SOURCE_DIR@' / '..' / '..' / 'rdata' / 'rdatastructsuf.h', + ], + ), +] diff --git a/lib/dns/include/meson.build b/lib/dns/include/meson.build new file mode 100644 index 0000000000..0d331876cb --- /dev/null +++ b/lib/dns/include/meson.build @@ -0,0 +1,12 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +subdir('dns') diff --git a/lib/dns/meson.build b/lib/dns/meson.build new file mode 100644 index 0000000000..4fa3ccf914 --- /dev/null +++ b/lib/dns/meson.build @@ -0,0 +1,166 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +probe_src = [dtrace_header.process('probes.d'), files('xfrin.c')] + +# dns_inc += include_directories('include') +dns_inc_p += include_directories('.') + +dns_header_depfiles = [] +subdir('rdata') + +dns_gen_headers = [] + +dns_header_gen = executable( + 'gen', + files('gen.c'), + install: false, + native: true, +) + +subdir('include') + +dns_srcset.add(dns_gen_headers) +dns_srcset.add(when: dnstap_dep, if_true: files('dnstap.c')) +dns_srcset.add(when: maxminddb_dep, if_true: files('geoip2.c')) +dns_srcset.add(when: [gssapi_dep, krb5_dep], if_true: files('gssapi_link.c')) + +dns_srcset.add( + custom_target( + 'dns-code', + output: 'code.h', + depend_files: dns_header_depfiles, + capture: true, + command: [dns_header_gen, '-s', meson.current_source_dir()], + ), +) + +if config.get('HAVE_DTRACE') + dns_probe_objects += static_library( + 'dns-probe-target', + probe_src, + build_by_default: false, + dependencies: urcu_dep, + implicit_include_directories: false, + include_directories: [isc_inc, dns_inc, dns_inc_p], + sources: dns_gen_headers, + ).extract_all_objects(recursive: false) +endif + +dns_srcset.add( + when: 'HAVE_DTRACE', + if_true: custom_target( + 'dns-probe', + input: [files('probes.d'), dns_probe_objects], + output: 'dns-probes.o', + command: [ + dtrace, + '-G', + '-o', '@OUTPUT@', + '-s', '@INPUT@', + ], + ), + if_false: probe_src, +) + +dns_srcset.add( + files( + 'acl.c', + 'adb.c', + 'badcache.c', + 'byaddr.c', + 'cache.c', + 'callbacks.c', + 'catz.c', + 'client.c', + 'clientinfo.c', + 'compress.c', + 'db.c', + 'dbiterator.c', + 'diff.c', + 'dispatch.c', + 'dlz.c', + 'dns64.c', + 'dnssec.c', + 'ds.c', + 'dst_api.c', + 'dst_parse.c', + 'dyndb.c', + 'ecs.c', + 'ede.c', + 'fixedname.c', + 'forward.c', + 'gssapictx.c', + 'hmac_link.c', + 'ipkeylist.c', + 'iptable.c', + 'journal.c', + 'kasp.c', + 'key.c', + 'keydata.c', + 'keymgr.c', + 'keystore.c', + 'keytable.c', + 'lib.c', + 'master.c', + 'masterdump.c', + 'message.c', + 'name.c', + 'nametree.c', + 'ncache.c', + 'nsec.c', + 'nsec3.c', + 'nta.c', + 'openssl_link.c', + 'opensslecdsa_link.c', + 'openssleddsa_link.c', + 'opensslrsa_link.c', + 'order.c', + 'peer.c', + 'private.c', + 'qp.c', + 'qpcache.c', + 'qpzone.c', + 'rcode.c', + 'rdata.c', + 'rdatalist.c', + 'rdataset.c', + 'rdatasetiter.c', + 'rdataslab.c', + 'remote.c', + 'request.c', + 'resconf.c', + 'resolver.c', + 'result.c', + 'rootns.c', + 'rpz.c', + 'rriterator.c', + 'rrl.c', + 'sdlz.c', + 'skr.c', + 'soa.c', + 'ssu.c', + 'ssu_external.c', + 'stats.c', + 'time.c', + 'tkey.c', + 'transport.c', + 'tsig.c', + 'ttl.c', + 'unreachcache.c', + 'update.c', + 'validator.c', + 'view.c', + 'zone.c', + 'zoneverify.c', + 'zt.c', + ), +) diff --git a/lib/dns/rdata/any_255/meson.build b/lib/dns/rdata/any_255/meson.build new file mode 100644 index 0000000000..e11e649fad --- /dev/null +++ b/lib/dns/rdata/any_255/meson.build @@ -0,0 +1,12 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_header_depfiles += files('tsig_250.c') diff --git a/lib/dns/rdata/ch_3/meson.build b/lib/dns/rdata/ch_3/meson.build new file mode 100644 index 0000000000..a8fa198063 --- /dev/null +++ b/lib/dns/rdata/ch_3/meson.build @@ -0,0 +1,12 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_header_depfiles += files('a_1.c') diff --git a/lib/dns/rdata/generic/meson.build b/lib/dns/rdata/generic/meson.build new file mode 100644 index 0000000000..0d16296910 --- /dev/null +++ b/lib/dns/rdata/generic/meson.build @@ -0,0 +1,79 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_header_depfiles += files( + 'afsdb_18.c', + 'amtrelay_260.c', + 'avc_258.c', + 'caa_257.c', + 'cdnskey_60.c', + 'cds_59.c', + 'cert_37.c', + 'cname_5.c', + 'csync_62.c', + 'dlv_32769.c', + 'dname_39.c', + 'dnskey_48.c', + 'doa_259.c', + 'ds_43.c', + 'eui48_108.c', + 'eui64_109.c', + 'gpos_27.c', + 'hinfo_13.c', + 'hip_55.c', + 'ipseckey_45.c', + 'isdn_20.c', + 'key_25.c', + 'keydata_65533.c', + 'l32_105.c', + 'l64_106.c', + 'loc_29.c', + 'lp_107.c', + 'mb_7.c', + 'md_3.c', + 'mf_4.c', + 'mg_8.c', + 'minfo_14.c', + 'mr_9.c', + 'mx_15.c', + 'naptr_35.c', + 'nid_104.c', + 'ninfo_56.c', + 'ns_2.c', + 'nsec3_50.c', + 'nsec3param_51.c', + 'nsec_47.c', + 'null_10.c', + 'nxt_30.c', + 'openpgpkey_61.c', + 'opt_41.c', + 'proforma.c', + 'ptr_12.c', + 'resinfo_261.c', + 'rkey_57.c', + 'rp_17.c', + 'rrsig_46.c', + 'rt_21.c', + 'sig_24.c', + 'sink_40.c', + 'smimea_53.c', + 'soa_6.c', + 'spf_99.c', + 'sshfp_44.c', + 'ta_32768.c', + 'talink_58.c', + 'tkey_249.c', + 'tlsa_52.c', + 'txt_16.c', + 'uri_256.c', + 'x25_19.c', + 'zonemd_63.c', +) diff --git a/lib/dns/rdata/hs_4/meson.build b/lib/dns/rdata/hs_4/meson.build new file mode 100644 index 0000000000..a8fa198063 --- /dev/null +++ b/lib/dns/rdata/hs_4/meson.build @@ -0,0 +1,12 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_header_depfiles += files('a_1.c') diff --git a/lib/dns/rdata/in_1/meson.build b/lib/dns/rdata/in_1/meson.build new file mode 100644 index 0000000000..e606f31f20 --- /dev/null +++ b/lib/dns/rdata/in_1/meson.build @@ -0,0 +1,29 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_header_depfiles += files( + 'a6_38.c', + 'a_1.c', + 'aaaa_28.c', + 'apl_42.c', + 'atma_34.c', + 'dhcid_49.c', + 'eid_31.c', + 'https_65.c', + 'kx_36.c', + 'nimloc_32.c', + 'nsap-ptr_23.c', + 'nsap_22.c', + 'px_26.c', + 'srv_33.c', + 'svcb_64.c', + 'wks_11.c', +) diff --git a/lib/dns/rdata/meson.build b/lib/dns/rdata/meson.build new file mode 100644 index 0000000000..3e314a880e --- /dev/null +++ b/lib/dns/rdata/meson.build @@ -0,0 +1,18 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +subdir('any_255') +subdir('ch_3') +subdir('generic') +subdir('hs_4') +subdir('in_1') + +dns_header_depfiles += files('rdatastructpre.h', 'rdatastructsuf.h') diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am deleted file mode 100644 index ad3d69a05b..0000000000 --- a/lib/isc/Makefile.am +++ /dev/null @@ -1,269 +0,0 @@ -include $(top_srcdir)/Makefile.top - -lib_LTLIBRARIES = libisc.la - -libisc_ladir = $(includedir)/isc -libisc_la_HEADERS = \ - include/isc/ascii.h \ - include/isc/assertions.h \ - include/isc/async.h \ - include/isc/atomic.h \ - include/isc/attributes.h \ - include/isc/backtrace.h \ - include/isc/barrier.h \ - include/isc/base32.h \ - include/isc/base64.h \ - include/isc/buffer.h \ - include/isc/commandline.h \ - include/isc/counter.h \ - include/isc/crypto.h \ - include/isc/dir.h \ - include/isc/dnsstream.h \ - include/isc/endian.h \ - include/isc/entropy.h \ - include/isc/errno.h \ - include/isc/error.h \ - include/isc/file.h \ - include/isc/formatcheck.h \ - include/isc/fuzz.h \ - include/isc/fxhash.h \ - include/isc/getaddresses.h \ - include/isc/hash.h \ - include/isc/hashmap.h \ - include/isc/heap.h \ - include/isc/helper.h \ - include/isc/hex.h \ - include/isc/histo.h \ - include/isc/hmac.h \ - include/isc/ht.h \ - include/isc/httpd.h \ - include/isc/interfaceiter.h \ - include/isc/iterated_hash.h \ - include/isc/job.h \ - include/isc/lex.h \ - include/isc/lib.h \ - include/isc/list.h \ - include/isc/log.h \ - include/isc/loop.h \ - include/isc/magic.h \ - include/isc/managers.h \ - include/isc/md.h \ - include/isc/mem.h \ - include/isc/meminfo.h \ - include/isc/mutex.h \ - include/isc/net.h \ - include/isc/netaddr.h \ - include/isc/netmgr.h \ - include/isc/netscope.h \ - include/isc/nonce.h \ - include/isc/once.h \ - include/isc/os.h \ - include/isc/overflow.h \ - include/isc/parseint.h \ - include/isc/pause.h \ - include/isc/portset.h \ - include/isc/proxy2.h \ - include/isc/queue.h \ - include/isc/quota.h \ - include/isc/radix.h \ - include/isc/random.h \ - include/isc/ratelimiter.h \ - include/isc/readline.h \ - include/isc/refcount.h \ - include/isc/regex.h \ - include/isc/region.h \ - include/isc/result.h \ - include/isc/rwlock.h \ - include/isc/safe.h \ - include/isc/serial.h \ - include/isc/sieve.h \ - include/isc/signal.h \ - include/isc/siphash.h \ - include/isc/sockaddr.h \ - include/isc/spinlock.h \ - include/isc/stats.h \ - include/isc/stdio.h \ - include/isc/stdtime.h \ - include/isc/strerr.h \ - include/isc/string.h \ - include/isc/symtab.h \ - include/isc/syslog.h \ - include/isc/thread.h \ - include/isc/tid.h \ - include/isc/time.h \ - include/isc/timer.h \ - include/isc/tls.h \ - include/isc/tm.h \ - include/isc/types.h \ - include/isc/urcu.h \ - include/isc/url.h \ - include/isc/utf8.h \ - include/isc/util.h \ - include/isc/uv.h \ - include/isc/xml.h \ - include/isc/work.h - -libisc_la_SOURCES = \ - $(libisc_la_HEADERS) \ - netmgr/netmgr-int.h \ - netmgr/netmgr.c \ - netmgr/proxystream.c \ - netmgr/proxyudp.c \ - netmgr/socket.c \ - netmgr/streamdns.c \ - netmgr/tcp.c \ - netmgr/timer.c \ - netmgr/tlsstream.c \ - netmgr/udp.c \ - ascii.c \ - assertions.c \ - async.c \ - async_p.h \ - backtrace.c \ - base32.c \ - base64.c \ - commandline.c \ - counter.c \ - crypto.c \ - dir.c \ - entropy.c \ - errno.c \ - errno2result.c \ - errno2result.h \ - error.c \ - file.c \ - getaddresses.c \ - hash.c \ - hashmap.c \ - heap.c \ - helper.c \ - hex.c \ - histo.c \ - hmac.c \ - ht.c \ - httpd.c \ - interfaceiter.c \ - iterated_hash.c \ - jemalloc_shim.h \ - job.c \ - job_p.h \ - lex.c \ - lib.c \ - log.c \ - loop.c \ - loop_p.h \ - managers.c \ - md.c \ - mem.c \ - mem_p.h \ - meminfo.c \ - mutex.c \ - mutex_p.h \ - net.c \ - netaddr.c \ - netscope.c \ - nonce.c \ - openssl_shim.c \ - openssl_shim.h \ - os.c \ - os_p.h \ - parseint.c \ - picohttpparser.c \ - picohttpparser.h \ - portset.c \ - probes.d \ - proxy2.c \ - quota.c \ - radix.c \ - random.c \ - ratelimiter.c \ - regex.c \ - region.c \ - result.c \ - safe.c \ - serial.c \ - signal.c \ - sockaddr.c \ - stats.c \ - stdio.c \ - stdtime.c \ - string.c \ - symtab.c \ - syslog.c \ - thread.c \ - thread_p.h \ - tid.c \ - time.c \ - timer.c \ - tls.c \ - tm.c \ - url.c \ - utf8.c \ - uv.c \ - xml.c \ - work.c - -if USE_ISC_RWLOCK -libisc_la_SOURCES += \ - rwlock.c -endif USE_ISC_RWLOCK - -libisc_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBUV_CFLAGS) \ - $(OPENSSL_CFLAGS) \ - $(ZLIB_CFLAGS) - -libisc_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -release "$(PACKAGE_VERSION)" - -libisc_la_LIBADD = \ - $(LIBUV_LIBS) \ - $(OPENSSL_LIBS) \ - $(ZLIB_LIBS) - -if HAVE_JEMALLOC -libisc_la_CPPFLAGS += \ - $(JEMALLOC_CFLAGS) - -libisc_la_LIBADD += \ - $(JEMALLOC_LIBS) -endif HAVE_JEMALLOC - -if HAVE_JSON_C -libisc_la_CPPFLAGS += \ - $(JSON_C_CFLAGS) - -libisc_la_LIBADD += \ - $(JSON_C_LIBS) -endif HAVE_JSON_C - -if HAVE_LIBNGHTTP2 -libisc_la_SOURCES += \ - netmgr/http.c - -libisc_la_CPPFLAGS += \ - $(LIBNGHTTP2_CFLAGS) - -libisc_la_LIBADD += \ - $(LIBNGHTTP2_LIBS) -endif - -if HAVE_LIBXML2 -libisc_la_CPPFLAGS += \ - $(LIBXML2_CFLAGS) - -libisc_la_LIBADD += \ - $(LIBXML2_LIBS) -endif HAVE_LIBXML2 - -if !HAVE_SYSTEMTAP -DTRACE_DEPS = libisc_la-rwlock.lo libisc_la-job.lo -DTRACE_OBJS = .libs/libisc_la-rwlock.$(OBJEXT) .libs/libisc_la-job.$(OBJEXT) -endif - -include $(top_srcdir)/Makefile.dtrace - -libisc_la_LIBADD += $(DTRACE_LIBADD) diff --git a/lib/isc/meson.build b/lib/isc/meson.build new file mode 100644 index 0000000000..223d6796f2 --- /dev/null +++ b/lib/isc/meson.build @@ -0,0 +1,141 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +probe_src = [] + +probe_src += [dtrace_header.process('probes.d'), files('job.c')] +if config.get('USE_PTHREAD_RWLOCK') != 1 + probe_src += files('rwlock.c') +endif + +# isc_inc += include_directories('include') +isc_inc_p += include_directories('.') + +subdir('netmgr') + +isc_srcset.add( + m_dep, + openssl_dep, + thread_dep, + urcu_dep, + uv_dep, +) + +isc_srcset.add(when: 'HAVE_JEMALLOC', if_true: jemalloc_dep) +isc_srcset.add(when: 'HAVE_JSON_C', if_true: json_c_dep) +isc_srcset.add(when: 'HAVE_LIBXML2', if_true: xml2_dep) +isc_srcset.add(when: 'HAVE_ZLIB', if_true: zlib_dep) + +if config.get('HAVE_DTRACE') + isc_probe_objects += static_library( + 'isc-probe-target', + probe_src, + build_by_default: false, + dependencies: [uv_dep, urcu_dep], + implicit_include_directories: false, + include_directories: [isc_inc, isc_inc_p], + ).extract_all_objects(recursive: false) +endif + +isc_srcset.add( + when: 'HAVE_DTRACE', + if_true: custom_target( + 'isc-probe', + input: [files('probes.d'), isc_probe_objects], + output: 'isc-probes.o', + command: [ + dtrace, + '-G', + '-o', '@OUTPUT@', + '-s', '@INPUT@', + ], + ), + if_false: probe_src, +) + +isc_srcset.add( + files( + 'ascii.c', + 'assertions.c', + 'async.c', + 'backtrace.c', + 'base32.c', + 'base64.c', + 'commandline.c', + 'counter.c', + 'crypto.c', + 'dir.c', + 'entropy.c', + 'errno.c', + 'errno2result.c', + 'error.c', + 'file.c', + 'getaddresses.c', + 'hash.c', + 'hashmap.c', + 'heap.c', + 'helper.c', + 'hex.c', + 'histo.c', + 'hmac.c', + 'ht.c', + 'httpd.c', + 'interfaceiter.c', + 'iterated_hash.c', + 'lex.c', + 'lib.c', + 'log.c', + 'loop.c', + 'managers.c', + 'md.c', + 'mem.c', + 'meminfo.c', + 'mutex.c', + 'net.c', + 'netaddr.c', + 'netscope.c', + 'nonce.c', + 'openssl_shim.c', + 'os.c', + 'parseint.c', + 'picohttpparser.c', + 'portset.c', + 'proxy2.c', + 'quota.c', + 'radix.c', + 'random.c', + 'ratelimiter.c', + 'regex.c', + 'region.c', + 'result.c', + 'safe.c', + 'serial.c', + 'signal.c', + 'sockaddr.c', + 'stats.c', + 'stdio.c', + 'stdtime.c', + 'string.c', + 'symtab.c', + 'syslog.c', + 'thread.c', + 'tid.c', + 'time.c', + 'timer.c', + 'tls.c', + 'tm.c', + 'url.c', + 'utf8.c', + 'uv.c', + 'work.c', + 'xml.c', + ), +) diff --git a/lib/isc/netmgr/meson.build b/lib/isc/netmgr/meson.build new file mode 100644 index 0000000000..e82bd4c377 --- /dev/null +++ b/lib/isc/netmgr/meson.build @@ -0,0 +1,26 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +isc_srcset.add(when: nghttp2_dep, if_true: files('http.c')) + +isc_srcset.add( + files( + 'netmgr.c', + 'proxystream.c', + 'proxyudp.c', + 'socket.c', + 'streamdns.c', + 'tcp.c', + 'timer.c', + 'tlsstream.c', + 'udp.c', + ), +) diff --git a/lib/isccc/Makefile.am b/lib/isccc/Makefile.am deleted file mode 100644 index 3a81340a48..0000000000 --- a/lib/isccc/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -include $(top_srcdir)/Makefile.top - -lib_LTLIBRARIES = libisccc.la - -libisccc_ladir = $(includedir)/isccc -libisccc_la_HEADERS = \ - include/isccc/alist.h \ - include/isccc/base64.h \ - include/isccc/cc.h \ - include/isccc/ccmsg.h \ - include/isccc/sexpr.h \ - include/isccc/symtype.h \ - include/isccc/types.h \ - include/isccc/util.h - -libisccc_la_SOURCES = \ - $(libisccc_la_HEADERS) \ - alist.c \ - base64.c \ - cc.c \ - ccmsg.c \ - sexpr.c - -libisccc_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISCCC_CFLAGS) \ - $(OPENSSL_CFLAGS) - -libisccc_la_LIBADD = \ - $(LIBISC_LIBS) - -libisccc_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -release "$(PACKAGE_VERSION)" diff --git a/lib/isccc/meson.build b/lib/isccc/meson.build new file mode 100644 index 0000000000..8017e8775e --- /dev/null +++ b/lib/isccc/meson.build @@ -0,0 +1,20 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +isccc_srcset.add( + files( + 'alist.c', + 'base64.c', + 'cc.c', + 'ccmsg.c', + 'sexpr.c', + ), +) diff --git a/lib/isccfg/Makefile.am b/lib/isccfg/Makefile.am deleted file mode 100644 index c5960400f8..0000000000 --- a/lib/isccfg/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -include $(top_srcdir)/Makefile.top - -lib_LTLIBRARIES = libisccfg.la - -libisccfg_ladir = $(includedir)/isccfg -libisccfg_la_HEADERS = \ - include/isccfg/aclconf.h \ - include/isccfg/cfg.h \ - include/isccfg/check.h \ - include/isccfg/duration.h \ - include/isccfg/grammar.h \ - include/isccfg/kaspconf.h \ - include/isccfg/namedconf.h - -libisccfg_la_SOURCES = \ - $(libisccfg_la_HEADERS) \ - aclconf.c \ - check.c \ - duration.c \ - kaspconf.c \ - namedconf.c \ - parser.c - -libisccfg_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(OPENSSL_CFLAGS) - -libisccfg_la_LIBADD = \ - $(LIBDNS_LIBS) \ - $(LIBISC_LIBS) \ - $(LIBNS_LIBS) \ - $(OPENSSL_LIBS) - -libisccfg_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -release "$(PACKAGE_VERSION)" - -if HAVE_DNSTAP -libisccfg_la_CPPFLAGS += $(DNSTAP_CFLAGS) -endif diff --git a/lib/isccfg/meson.build b/lib/isccfg/meson.build new file mode 100644 index 0000000000..1d799e3194 --- /dev/null +++ b/lib/isccfg/meson.build @@ -0,0 +1,21 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +isccfg_srcset.add( + files( + 'aclconf.c', + 'check.c', + 'duration.c', + 'kaspconf.c', + 'namedconf.c', + 'parser.c', + ), +) diff --git a/lib/meson.build b/lib/meson.build new file mode 100644 index 0000000000..f66985c967 --- /dev/null +++ b/lib/meson.build @@ -0,0 +1,16 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +subdir('dns') +subdir('isc') +subdir('isccc') +subdir('isccfg') +subdir('ns') diff --git a/lib/ns/Makefile.am b/lib/ns/Makefile.am deleted file mode 100644 index 3e0e58746d..0000000000 --- a/lib/ns/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - -DNAMED_PLUGINDIR=\"$(pkglibdir)\" - -lib_LTLIBRARIES = libns.la - -libns_ladir = $(includedir)/ns - -libns_la_HEADERS = \ - include/ns/client.h \ - include/ns/hooks.h \ - include/ns/interfacemgr.h \ - include/ns/listenlist.h \ - include/ns/notify.h \ - include/ns/query.h \ - include/ns/server.h \ - include/ns/stats.h \ - include/ns/types.h \ - include/ns/update.h \ - include/ns/xfrout.h - -libns_la_SOURCES = \ - $(libns_la_HEADERS) \ - client.c \ - hooks.c \ - interfacemgr.c \ - listenlist.c \ - notify.c \ - probes.d \ - query.c \ - server.c \ - stats.c \ - update.c \ - xfrout.c - -libns_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBUV_CFLAGS) \ - $(OPENSSL_CFLAGS) - -libns_la_LIBADD = \ - $(LIBDNS_LIBS) \ - $(LIBISC_LIBS) \ - $(LIBUV_LIBS) \ - $(OPENSSL_LIBS) - -libns_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -release "$(PACKAGE_VERSION)" - -if !HAVE_SYSTEMTAP -DTRACE_DEPS = libns_la-query.lo -DTRACE_OBJS = .libs/libns_la-query.$(OBJEXT) -endif - -include $(top_srcdir)/Makefile.dtrace - -libns_la_LIBADD += $(DTRACE_LIBADD) diff --git a/lib/ns/meson.build b/lib/ns/meson.build new file mode 100644 index 0000000000..0ea769e379 --- /dev/null +++ b/lib/ns/meson.build @@ -0,0 +1,54 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +probe_src = [dtrace_header.process('probes.d'), files('query.c')] + +if config.get('HAVE_DTRACE') + ns_probe_objects += static_library( + 'ns-probe-target', + probe_src, + sources: dns_gen_headers, + build_by_default: false, + dependencies: [uv_dep, urcu_dep], + implicit_include_directories: false, + include_directories: [isc_inc, dns_inc, ns_inc], + ).extract_all_objects(recursive: false) +endif + +ns_srcset.add( + when: 'HAVE_DTRACE', + if_true: custom_target( + 'ns-probe', + input: [files('probes.d'), ns_probe_objects], + output: 'ns-probes.o', + command: [ + dtrace, + '-G', + '-o', '@OUTPUT@', + '-s', '@INPUT@', + ], + ), + if_false: probe_src, +) + +ns_srcset.add( + files( + 'client.c', + 'hooks.c', + 'interfacemgr.c', + 'listenlist.c', + 'notify.c', + 'server.c', + 'stats.c', + 'update.c', + 'xfrout.c', + ), +) diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 deleted file mode 100644 index cf3d9f4ecb..0000000000 --- a/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,55 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 deleted file mode 100644 index 6a0c465774..0000000000 --- a/m4/ax_check_link_flag.m4 +++ /dev/null @@ -1,55 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the linker or gives an error. -# (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_LINK_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_LINK_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl -AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $4 $1" - AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - LDFLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_LINK_FLAGS diff --git a/m4/ax_check_preproc_flag.m4 b/m4/ax_check_preproc_flag.m4 deleted file mode 100644 index ee0ccb6f8e..0000000000 --- a/m4/ax_check_preproc_flag.m4 +++ /dev/null @@ -1,55 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's -# preprocessor or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the preprocessor's default -# flags when the check is done. The check is thus made with the flags: -# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the -# preprocessor to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_PREPROC_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_PREPROC_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [ - ax_check_save_flags=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $4 $1" - AC_PREPROC_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - CPPFLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_PREPROC_FLAGS diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4 deleted file mode 100644 index 554835d6df..0000000000 --- a/m4/ax_gcc_func_attribute.m4 +++ /dev/null @@ -1,244 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) -# -# DESCRIPTION -# -# This macro checks if the compiler supports one of GCC's function -# attributes; many other compilers also provide function attributes with -# the same syntax. Compiler warnings are used to detect supported -# attributes as unsupported ones are ignored by default so quieting -# warnings when using this macro will yield false positives. -# -# The ATTRIBUTE parameter holds the name of the attribute to be checked. -# -# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. -# -# The macro caches its result in the ax_cv_have_func_attribute_ -# variable. -# -# The macro currently supports the following function attributes: -# -# alias -# aligned -# alloc_size -# always_inline -# artificial -# cold -# const -# constructor -# constructor_priority for constructor attribute with priority -# deprecated -# destructor -# dllexport -# dllimport -# error -# externally_visible -# fallthrough -# flatten -# format -# format_arg -# gnu_format -# gnu_inline -# hot -# ifunc -# leaf -# malloc -# noclone -# noinline -# nonnull -# noreturn -# nothrow -# optimize -# pure -# sentinel -# sentinel_position -# unused -# used -# visibility -# warning -# warn_unused_result -# weak -# weakref -# -# Unsupported function attributes will be tested with a prototype -# returning an int and not accepting any arguments and the result of the -# check might be wrong or meaningless so use with care. -# -# LICENSE -# -# Copyright (c) 2013 Gabriele Svelto -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 13 - -AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ - AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) - - AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([ - m4_case([$1], - [alias], [ - int foo( void ) { return 0; } - int bar( void ) __attribute__(($1("foo"))); - ], - [aligned], [ - int foo( void ) __attribute__(($1(32))); - ], - [alloc_size], [ - void *foo(int a) __attribute__(($1(1))); - ], - [always_inline], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [artificial], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [cold], [ - int foo( void ) __attribute__(($1)); - ], - [const], [ - int foo( void ) __attribute__(($1)); - ], - [constructor_priority], [ - int foo( void ) __attribute__((__constructor__(65535/2))); - ], - [constructor], [ - int foo( void ) __attribute__(($1)); - ], - [deprecated], [ - int foo( void ) __attribute__(($1(""))); - ], - [destructor], [ - int foo( void ) __attribute__(($1)); - ], - [dllexport], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [dllimport], [ - int foo( void ) __attribute__(($1)); - ], - [error], [ - int foo( void ) __attribute__(($1(""))); - ], - [externally_visible], [ - int foo( void ) __attribute__(($1)); - ], - [fallthrough], [ - void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; - ], - [flatten], [ - int foo( void ) __attribute__(($1)); - ], - [format], [ - int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); - ], - [gnu_format], [ - int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2))); - ], - [format_arg], [ - char *foo(const char *p) __attribute__(($1(1))); - ], - [gnu_inline], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [hot], [ - int foo( void ) __attribute__(($1)); - ], - [ifunc], [ - int my_foo( void ) { return 0; } - static int (*resolve_foo(void))(void) { return my_foo; } - int foo( void ) __attribute__(($1("resolve_foo"))); - ], - [leaf], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [malloc], [ - void *foo( void ) __attribute__(($1)); - ], - [noclone], [ - int foo( void ) __attribute__(($1)); - ], - [noinline], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [nonnull], [ - int foo(char *p) __attribute__(($1(1))); - ], - [noreturn], [ - void foo( void ) __attribute__(($1)); - ], - [nothrow], [ - int foo( void ) __attribute__(($1)); - ], - [optimize], [ - __attribute__(($1(3))) int foo( void ) { return 0; } - ], - [pure], [ - int foo( void ) __attribute__(($1)); - ], - [sentinel], [ - int foo(void *p, ...) __attribute__(($1)); - ], - [sentinel_position], [ - int foo(void *p, ...) __attribute__(($1(1))); - ], - [returns_nonnull], [ - void *foo( void ) __attribute__(($1)); - ], - [unused], [ - int foo( void ) __attribute__(($1)); - ], - [used], [ - int foo( void ) __attribute__(($1)); - ], - [visibility], [ - int foo_def( void ) __attribute__(($1("default"))); - int foo_hid( void ) __attribute__(($1("hidden"))); - int foo_int( void ) __attribute__(($1("internal"))); - int foo_pro( void ) __attribute__(($1("protected"))); - ], - [warning], [ - int foo( void ) __attribute__(($1(""))); - ], - [warn_unused_result], [ - int foo( void ) __attribute__(($1)); - ], - [weak], [ - int foo( void ) __attribute__(($1)); - ], - [weakref], [ - static int foo( void ) { return 0; } - static int bar( void ) __attribute__(($1("foo"))); - ], - [ - m4_warn([syntax], [Unsupported attribute $1, the test may fail]) - int foo( void ) __attribute__(($1)); - ] - )], []) - ], - dnl GCC doesn't exit with an error if an unknown attribute is - dnl provided but only outputs a warning, so accept the attribute - dnl only if no warning were issued. - [AS_IF([grep -- -Wattributes conftest.err], - [AS_VAR_SET([ac_var], [no])], - [AS_VAR_SET([ac_var], [yes])])], - [AS_VAR_SET([ac_var], [no])]) - ]) - - AS_IF([test yes = AS_VAR_GET([ac_var])], - [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, - [Define to 1 if the system has the `$1' function attribute])], []) - - AS_VAR_POPDEF([ac_var]) -]) diff --git a/m4/ax_jemalloc.m4 b/m4/ax_jemalloc.m4 deleted file mode 100644 index bde7678bc7..0000000000 --- a/m4/ax_jemalloc.m4 +++ /dev/null @@ -1,57 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://gitlab.isc.org/isc-projects/autoconf-archive/ax_jemalloc.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_JEMALLOC([, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# Test for the jemalloc library in a path -# -# LICENSE -# -# Copyright (c) 2021 Internet Systems Consortium -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 1 - -# -AC_DEFUN([AX_CHECK_JEMALLOC], [ - found=false - PKG_CHECK_MODULES( - [JEMALLOC], [jemalloc], - [ - PKG_CHECK_VERSION([JEMALLOC_VERSION], [jemalloc]) - found=true - ], [ - AC_CHECK_HEADERS([malloc_np.h jemalloc/jemalloc.h], - [ - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - AC_SEARCH_LIBS([sdallocx], [jemalloc], - [ - found=true - JEMALLOC_VERSION=system - AS_IF([test "$ac_cv_search_mallocx" != "none required"], - [JEMALLOC_LIBS="$ac_cv_search_mallocx"]) - ]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ]) - ]) - - AS_IF([$found], [$1], [$2]) - - AC_SUBST([JEMALLOC_CFLAGS]) - AC_SUBST([JEMALLOC_LIBS]) -]) diff --git a/m4/ax_lib_lmdb.m4 b/m4/ax_lib_lmdb.m4 deleted file mode 100644 index b140b76670..0000000000 --- a/m4/ax_lib_lmdb.m4 +++ /dev/null @@ -1,52 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://gitlab.isc.org/isc-projects/autoconf-archive/ax_lib_lmdb.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_LIB_LMDB(PATH[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# Test for the LMDB library in a path -# -# This macro takes only one argument, a path to the lmdb headers and library. -# -# LICENSE -# -# Copyright (c) 2020 Internet Systems Consortium -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 19 - -# -AC_DEFUN([AX_LIB_LMDB], - [AS_IF([test -z "$1"], - [AC_MSG_ERROR([Path cannot be empty])]) - AC_MSG_CHECKING([for lmdb header in $1]) - AS_IF([test -r "$1/include/lmdb.h"], - [AC_MSG_RESULT([yes]) - LMDB_CFLAGS="-I$1/include" - LMDB_LIBS="-L$1/lib" - AX_SAVE_FLAGS([lmdb]) - CFLAGS="$CFLAGS $LMDB_CFLAGS" - LIBS="$LIBS $LMDB_LIBS" - AC_SEARCH_LIBS([mdb_env_create], [lmdb], - [LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_create" - AX_RESTORE_FLAGS([lmdb]) - $2 - ], - [AC_MSG_RESULT([no]) - LMDB_CFLAGS="" - LMDB_LIBS="" - AX_RESTORE_FLAGS([lmdb]) - $3 - ]) - ], - [AC_MSG_RESULT([no])])]) diff --git a/m4/ax_perl_module.m4 b/m4/ax_perl_module.m4 deleted file mode 100644 index f2cddd2f86..0000000000 --- a/m4/ax_perl_module.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# SYNOPSIS -# -# AX_PERL_MODULE(MODULE[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# Checks for Perl module. -# -# LICENSE -# -# Copyright (c) 2020 Internet Systems Consortium -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -AC_DEFUN([AX_PERL_MODULE],[ - AC_MSG_CHECKING([for perl module: $1]) - $PERL "-M$1" -e exit >/dev/null 2>&1 - AS_IF([test $? -eq 0], - [AC_MSG_RESULT([yes]) - eval AS_TR_CPP(HAVE_PERLMOD_$1)=yes - $2 - ], - [AC_MSG_RESULT([no]) - eval AS_TR_CPP(HAVE_PERLMOD_$1)=no - $3 - ]) - ]) diff --git a/m4/ax_posix_shell.m4 b/m4/ax_posix_shell.m4 deleted file mode 100644 index 2755faed61..0000000000 --- a/m4/ax_posix_shell.m4 +++ /dev/null @@ -1,39 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# AX_POSIX_SHELL -# ------------- -# Check for a POSIX-compatible shell. -# -# LICENSE -# -# Copyright (c) 2021 Internet Systems Consortium -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -AC_DEFUN([AX_POSIX_SHELL], - [AC_CACHE_CHECK([for a POSIX-compatible shell], [ac_cv_prog_shell], - [ac_test_shell_script=' - test "$(expr 1 + 1)" = "2" && - test "$(( 1 + 1 ))" = "2" - ' - - for ac_cv_prog_shell in \ - "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do - AS_CASE([$ac_cv_prog_shell], - [/*],[ - AS_IF(["$ac_cv_prog_shell" -c "$ac_test_shell_script" 2>/dev/null], - [break]) - ]) - done - ]) - AS_IF([test "$ac_cv_prog_shell" = "no"], - [SHELL=/bin/sh - AC_MSG_WARN([using $SHELL, even though it does not conform to POSIX]) - ], - [SHELL="$ac_cv_prog_shell" - ]) - AC_SUBST([SHELL]) - ]) diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 deleted file mode 100644 index 5168ae4847..0000000000 --- a/m4/ax_prog_cc_for_build.m4 +++ /dev/null @@ -1,157 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PROG_CC_FOR_BUILD -# -# DESCRIPTION -# -# This macro searches for a C compiler that generates native executables, -# that is a C compiler that surely is not a cross-compiler. This can be -# useful if you have to generate source code at compile-time like for -# example GCC does. -# -# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything -# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). -# The value of these variables can be overridden by the user by specifying -# a compiler with an environment variable (like you do for standard CC). -# -# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object -# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if -# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are -# substituted in the Makefile. -# -# LICENSE -# -# Copyright (c) 2008 Paolo Bonzini -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 20 - -AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) -AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_CPP])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl - -dnl Use the standard macros, but make them use other variable names -dnl -pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl -pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl -pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl -pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl -pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl -pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl -pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl -pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl -pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl -pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl -pushdef([ac_cv_objext], ac_cv_build_objext)dnl -pushdef([ac_exeext], ac_build_exeext)dnl -pushdef([ac_objext], ac_build_objext)dnl -pushdef([CC], CC_FOR_BUILD)dnl -pushdef([CPP], CPP_FOR_BUILD)dnl -pushdef([GCC], GCC_FOR_BUILD)dnl -pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl -pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl -pushdef([EXEEXT], BUILD_EXEEXT)dnl -pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl -pushdef([OBJEXT], BUILD_OBJEXT)dnl -pushdef([host], build)dnl -pushdef([host_alias], build_alias)dnl -pushdef([host_cpu], build_cpu)dnl -pushdef([host_vendor], build_vendor)dnl -pushdef([host_os], build_os)dnl -pushdef([ac_cv_host], ac_cv_build)dnl -pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl -pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl -pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl -pushdef([ac_cv_host_os], ac_cv_build_os)dnl -pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl -pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl -pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl -pushdef([cross_compiling], cross_compiling_build)dnl - -cross_compiling_build=no - -ac_build_tool_prefix= -AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], - [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) - -AC_LANG_PUSH([C]) - -dnl The pushdef([ac_cv_c_compiler_gnu], ...) currently does not cover -dnl the use of this variable in _AC_LANG_COMPILER_GNU called by -dnl AC_PROG_CC. Unset this cache variable temporarily as a workaround. -was_set_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y} -AS_IF([test ${was_set_c_compiler_gnu}], - [saved_c_compiler_gnu=$[ac_cv_c_compiler_gnu] - AS_UNSET([[ac_cv_c_compiler_gnu]])]) - -AC_PROG_CC - -dnl Restore ac_cv_c_compiler_gnu -AS_IF([test ${was_set_c_compiler_gnu}], - [[ac_cv_c_compiler_gnu]=$[saved_c_compiler_gnu]]) - -_AC_COMPILER_EXEEXT -_AC_COMPILER_OBJEXT -AC_PROG_CPP - -dnl Restore the old definitions -dnl -popdef([cross_compiling])dnl -popdef([am_cv_prog_cc_c_o])dnl -popdef([am_cv_CC_dependencies_compiler_type])dnl -popdef([ac_tool_prefix])dnl -popdef([ac_cv_host_os])dnl -popdef([ac_cv_host_vendor])dnl -popdef([ac_cv_host_cpu])dnl -popdef([ac_cv_host_alias])dnl -popdef([ac_cv_host])dnl -popdef([host_os])dnl -popdef([host_vendor])dnl -popdef([host_cpu])dnl -popdef([host_alias])dnl -popdef([host])dnl -popdef([OBJEXT])dnl -popdef([LDFLAGS])dnl -popdef([EXEEXT])dnl -popdef([CPPFLAGS])dnl -popdef([CFLAGS])dnl -popdef([GCC])dnl -popdef([CPP])dnl -popdef([CC])dnl -popdef([ac_objext])dnl -popdef([ac_exeext])dnl -popdef([ac_cv_objext])dnl -popdef([ac_cv_exeext])dnl -popdef([ac_cv_c_compiler_gnu])dnl -popdef([ac_cv_prog_cc_g])dnl -popdef([ac_cv_prog_cc_cross])dnl -popdef([ac_cv_prog_cc_works])dnl -popdef([ac_cv_prog_cc_c89])dnl -popdef([ac_cv_prog_gcc])dnl -popdef([ac_cv_prog_CPP])dnl - -dnl restore global variables ac_ext, ac_cpp, ac_compile, -dnl ac_link, ac_compiler_gnu (dependant on the current -dnl language after popping): -AC_LANG_POP([C]) - -dnl Finally, set Makefile variables -dnl -AC_SUBST(BUILD_EXEEXT)dnl -AC_SUBST(BUILD_OBJEXT)dnl -AC_SUBST([CFLAGS_FOR_BUILD])dnl -AC_SUBST([CPPFLAGS_FOR_BUILD])dnl -AC_SUBST([LDFLAGS_FOR_BUILD])dnl -]) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 deleted file mode 100644 index 1c8203d474..0000000000 --- a/m4/ax_pthread.m4 +++ /dev/null @@ -1,524 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-3.0 -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is -# needed for multi-threaded programs (defaults to the value of CC -# respectively CXX otherwise). (This is necessary on e.g. AIX to use the -# special cc_r/CC_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also to link with them as well. For example, you might link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threaded programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# CXX="$PTHREAD_CXX" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to -# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2011 Daniel Richard G. -# Copyright (c) 2019 Marc Stevens -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 30 - -AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) -AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_TARGET]) -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_SED]) -AC_LANG_PUSH([C]) -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on Tru64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then - ax_pthread_save_CC="$CC" - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) - AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) - AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) - AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = "xno"; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - CC="$ax_pthread_save_CC" - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items with a "," contain both -# C compiler flags (before ",") and linker flags (after ","). Other items -# starting with a "-" are C compiler flags, and remaining items are -# library names, except for "none" which indicates that we try without -# any flags at all, and "pthread-config" which is a program returning -# the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 -# (Note: HP C rejects this with "bad form for `-t' option") -# -pthreads: Solaris/gcc (Note: HP C also rejects) -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads and -# -D_REENTRANT too), HP C (must be checked before -lpthread, which -# is present but should not be used directly; and before -mthreads, -# because the compiler interprets this as "-mt" + "-hreads") -# -mthreads: Mingw32/gcc, Lynx/gcc -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case $target_os in - - freebsd*) - - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - - ax_pthread_flags="-kthread lthread $ax_pthread_flags" - ;; - - hpux*) - - # From the cc(1) man page: "[-mt] Sets various -D flags to enable - # multi-threading and also sets -lpthread." - - ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" - ;; - - openedition*) - - # IBM z/OS requires a feature-test macro to be defined in order to - # enable POSIX threads at all, so give the user a hint if this is - # not set. (We don't define these ourselves, as they can affect - # other portions of the system API in unpredictable ways.) - - AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], - [ -# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) - AX_PTHREAD_ZOS_MISSING -# endif - ], - [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) - ;; - - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (N.B.: The stubs are missing - # pthread_cleanup_push, or rather a function called by this macro, - # so we could check for that, but who knows whether they'll stub - # that too in a future libc.) So we'll check first for the - # standard Solaris way of linking pthreads (-mt -lpthread). - - ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" - ;; -esac - -# Are we compiling with Clang? - -AC_CACHE_CHECK([whether $CC is Clang], - [ax_cv_PTHREAD_CLANG], - [ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], - [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif - ], - [ax_cv_PTHREAD_CLANG=yes]) - fi - ]) -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" - - -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - -# Note that for GCC and Clang -pthread generally implies -lpthread, -# except when -nostdlib is passed. -# This is problematic using libtool to build C++ shared libraries with pthread: -# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 -# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 -# To solve this, first try -pthread together with -lpthread for GCC - -AS_IF([test "x$GCC" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) - -# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first - -AS_IF([test "x$ax_pthread_clang" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread"]) - - -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled - -case $target_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; - - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; - - *) - ax_pthread_check_macro="--" - ;; -esac -AS_IF([test "x$ax_pthread_check_macro" = "x--"], - [ax_pthread_check_cond=0], - [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) - - -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do - - case $ax_pthread_try_flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - *,*) - PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` - PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` - AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; - - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void *some_global = NULL; - static void routine(void *a) - { - /* To avoid any unused-parameter or - unused-but-set-parameter warning. */ - some_global = a; - } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - AC_MSG_RESULT([$ax_pthread_ok]) - AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - - -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way - -if test "x$ax_pthread_clang" = "xyes"; then - - # Clang takes -pthread; it has never supported any other flag - - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) - - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) - - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. - - AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [ac_link="$ax_pthread_2step_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [break]) - ]) - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - ]) - - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac - -fi # $ax_pthread_clang = yes - - - -# Various other checks: -if test "x$ax_pthread_ok" = "xyes"; then - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_CACHE_CHECK([for joinable pthread attribute], - [ax_cv_PTHREAD_JOINABLE_ATTR], - [ax_cv_PTHREAD_JOINABLE_ATTR=unknown - for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $ax_pthread_attr; return attr /* ; */])], - [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], - []) - done - ]) - AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ - test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes"], - [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], - [$ax_cv_PTHREAD_JOINABLE_ATTR], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - ax_pthread_joinable_attr_defined=yes - ]) - - AC_CACHE_CHECK([whether more special flags are required for pthreads], - [ax_cv_PTHREAD_SPECIAL_FLAGS], - [ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $target_os in - solaris*) - ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - ]) - AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes"], - [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" - ax_pthread_special_flags_added=yes]) - - AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT; - return i;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) - ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) - ax_pthread_prio_inherit_defined=yes - ]) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != "xyes"; then - case $target_os in - aix*) - AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [ - AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) - AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) - ], - [ - AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) - AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) - ] - ) - ]) - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" -test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" - -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) -AC_SUBST([PTHREAD_CC]) -AC_SUBST([PTHREAD_CXX]) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test "x$ax_pthread_ok" = "xyes"; then - ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) - : -else - ax_pthread_ok=no - $2 -fi -AC_LANG_POP -])dnl AX_PTHREAD diff --git a/m4/ax_python_module.m4 b/m4/ax_python_module.m4 deleted file mode 100644 index b3422fc532..0000000000 --- a/m4/ax_python_module.m4 +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# SYNOPSIS -# -# AX_PYTHON_MODULE(MODULE[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# Checks for Python module. -# -# LICENSE -# -# Copyright (c) 2008 Andrew Collier -# (c) 2020 Internet Systems Consortium -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -AC_DEFUN([AX_PYTHON_MODULE],[ - AC_MSG_CHECKING([for python module: $1]) - $PYTHON -c "import $1" >/dev/null 2>&1 - AS_IF([test $? -eq 0], - [AC_MSG_RESULT([yes]) - eval AS_TR_CPP(HAVE_PYMOD_$1)=yes - $2 - ], - [AC_MSG_RESULT([no]) - eval AS_TR_CPP(HAVE_PYMOD_$1)=no - $3 - ]) - ]) diff --git a/m4/ax_restore_flags.m4 b/m4/ax_restore_flags.m4 deleted file mode 100644 index 7379460b8c..0000000000 --- a/m4/ax_restore_flags.m4 +++ /dev/null @@ -1,54 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_restore_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_RESTORE_FLAGS([namespace]) -# -# DESCRIPTION -# -# Restore common compilation flags from temporary variables. -# -# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, -# OBJCFLAGS. -# -# By default these flags are restored to a global (empty) namespace, but -# user could restore from specific NAMESPACE by using -# AX_RESTORE_FLAGS(NAMESPACE) macro. -# -# Typical usage is like: -# -# AX_SAVE_FLAGS(mypackage) -# CPPFLAGS="-Imypackagespath ${CPPFLAGS}" -# dnl ... do some detection ... -# AX_RESTORE_FLAGS(mypackage) -# -# LICENSE -# -# Copyright (c) 2009 Filippo Giunchedi -# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2011 Russ Allbery -# Copyright (c) 2013 Bastien ROUCARIES -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 7 - -# save one flag in name space -AC_DEFUN([_AX_RESTORE_ONE_FLAG],[dnl - AS_VAR_PUSHDEF([_ax_restore_flag_var], [$2[]_$1[]_ax_save_flags]) - AS_VAR_COPY($2[],_ax_restore_flag_var) - AS_VAR_POPDEF([_ax_restore_flag_var]) -]) - -AC_DEFUN([AX_RESTORE_FLAGS], [dnl - m4_foreach([FLAG], dnl - [_AX_SAVE_FLAGS_LIST()], dnl - [_AX_RESTORE_ONE_FLAG([$1],FLAG)]) -]) diff --git a/m4/ax_save_flags.m4 b/m4/ax_save_flags.m4 deleted file mode 100644 index b0bba805d5..0000000000 --- a/m4/ax_save_flags.m4 +++ /dev/null @@ -1,73 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_save_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_SAVE_FLAGS([NAMESPACE]) -# -# DESCRIPTION -# -# Save common compilation flags into temporary variables. -# -# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, -# OBJCFLAGS. -# -# By default these flags are saved to a global (empty) namespace, but user -# could specify a specific NAMESPACE to AX_SAVE_FLAGS macro and latter -# restore it by using AX_RESTORE_FLAGS(NAMESPACE). -# -# AX_SAVE_FLAGS(mypackage) -# CPPFLAGS="-Imypackagespath ${CPPFLAGS}" -# dnl .. do some detection ... -# AX_RESTORE_FLAGS(mypackage) -# -# LICENSE -# -# Copyright (c) 2009 Filippo Giunchedi -# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2011 Russ Allbery -# Copyright (c) 2013 Bastien ROUCARIES -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -# list of flag to save -AC_DEFUN([_AX_SAVE_FLAGS_LIST],[dnl -[CCASFLAGS],dnl -[CFLAGS],dnl -[CPPFLAGS],dnl -[CXXFLAGS],dnl -[ERLCFLAGS],dnl -[FCFLAGS],dnl -[FCLIBS],dnl -[FFLAGS],dnl -[FLIBS],dnl -[GCJFLAGS],dnl -[JAVACFLAGS],dnl -[LDFLAGS],dnl -[LIBS],dnl -[OBJCFLAGS],dnl -[OBJCXXFLAGS],dnl -[UPCFLAGS],dnl -[VALAFLAGS]dnl -]) - -# save one flag in name space -AC_DEFUN([_AX_SAVE_ONE_FLAG],[ - AS_VAR_PUSHDEF([_ax_save_flag_var], [$2[]_$1[]_ax_save_flags]) - AS_VAR_COPY(_ax_save_flag_var, $2[]) - AS_VAR_POPDEF([_ax_save_flag_var]) -]) - -AC_DEFUN([AX_SAVE_FLAGS],[dnl - m4_foreach([FLAG], dnl - [_AX_SAVE_FLAGS_LIST()], dnl - [_AX_SAVE_ONE_FLAG([$1],FLAG)]) -]) diff --git a/m4/compat.m4 b/m4/compat.m4 deleted file mode 100644 index 2d204b251a..0000000000 --- a/m4/compat.m4 +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Internet Systems Consortium -# -# SPDX-License-Identifier: FSFAP -# -# backwards compat with older pkg-config -# - pull in AC_DEFUN from pkg.m4 -m4_ifndef([PKG_CHECK_VAR], [ -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR -]) - -# This hack makes PKG_CHECK_VARS from m4/pkg.m4 work on autoconf 2.63 -# ( courtesy of sunnybear in https://github.com/gdnsd/gdnsd/issues/85 ) -m4_ifndef([AS_VAR_COPY], -[m4_define([AS_VAR_COPY], -[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])]) -## End Autoconf-2.63-Compat diff --git a/m4/pkg-modversion.m4 b/m4/pkg-modversion.m4 deleted file mode 100644 index fba2cc2033..0000000000 --- a/m4/pkg-modversion.m4 +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-License-Identifier: FSFAP -# -# =========================================================================== -# https://gitlab.isc.org/isc-projects/autoconf-archive/ax_jemalloc.html -# =========================================================================== -# -# SYNOPSIS -# -# PKG_CHECK_VERSION(VARIABLE, MODULE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Retrieves the value of the pkg-config version for the given module. -# -# LICENSE -# -# Copyright (c) 2023 Internet Systems Consortium -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 1 - -# -AC_DEFUN([PKG_CHECK_VERSION], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [version of $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [modversion], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$4], [$3])dnl -])dnl PKG_CHECK_VERSION diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..ecce468210 --- /dev/null +++ b/meson.build @@ -0,0 +1,1806 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +project( + 'bind', + ['c'], + version: '9.21.10-dev', + meson_version: '>=0.61', + license: 'MPL-2.0', + default_options: [ + 'b_asneeded=true', + 'b_pch=false', + 'b_pie=true', + 'c_std=gnu11', + 'default_library=shared', + 'localstatedir=/var', + 'strip=false', + 'warning_level=2', + 'werror=false', + 'wrap_mode=nodownload', + ], +) + +fs = import('fs') +ss = import('sourceset') + +cc = meson.get_compiler('c') + +### Check if autoconf is mixed +if fs.exists(meson.project_source_root() / 'config.h') + error('in-place autoconf detected! please run `make distclean`!') +endif + +### Build Options +developer_mode = get_option('developer').enabled() + +c_std = get_option('c_std') +sanitizer = get_option('b_sanitize') + +trace_logging = get_option('trace-logging') +rcu_flavor = get_option('rcu-flavor') + +cap_opt = get_option('cap') +cmocka_opt = get_option('cmocka') +dnstap_opt = get_option('dnstap') +doc_opt = get_option('doc') +doh_opt = get_option('doh') +fips_opt = get_option('fips') +fuzz_opt = get_option('fuzzing') +geoip_opt = get_option('geoip') +gssapi_opt = get_option('gssapi') +idn_opt = get_option('idn') +jemalloc_opt = get_option('jemalloc').disable_auto_if(sanitizer != 'none') +leak_opt = get_option('leak-detection') +line_opt = get_option('line') +lmdb_opt = get_option('lmdb') +locktype_opt = get_option('locktype') +stats_json_opt = get_option('stats-json') +stats_xml_opt = get_option('stats-xml') +tracing_opt = get_option('tracing') +zlib_opt = get_option('zlib') + +if meson.version().version_compare('>=1.1.0') + build_options = meson.build_options() + if build_options == '' + build_options = 'default' + endif +else + build_options = 'unprobed' +endif + +### External commands +dtrace_shim = meson.project_source_root() / 'util' / 'dtrace.sh' + +if tracing_opt.disabled() + meson.override_find_program('dtrace', find_program(dtrace_shim)) +endif + +## Required +perl = find_program(['perl', 'perl5']) +sh = find_program('sh') + +## Feature gated +krb5_config = find_program('krb5-config', required: gssapi_opt) +protoc = find_program(['protoc-c', 'protoc'], required: dnstap_opt) +dtrace = find_program(['dtrace', dtrace_shim], required: false) + +## Testing +curl = find_program('curl', required: false) +fstrm_capture = find_program('fstrm_capture', required: false) +git = find_program('git', required: false) +nc = find_program('nc', required: false) +python = find_program(['python3', 'python'], required: false) +xsltproc = find_program('xsltproc', required: false) +pytest = find_program( + ['pytest-3', 'py.test-3', 'pytest', 'py.test', 'pytest-pypy'], + required: false, +) + +## Documentation +sphinx_build = find_program('sphinx-build', required: doc_opt) + +### Install information +prefix = get_option('prefix') + +datadir = prefix / get_option('datadir') +libdir = prefix / get_option('libdir') +localstatedir = prefix / get_option('localstatedir') +mandir = prefix / get_option('mandir') +runstatedir = localstatedir / 'run' +sbindir = prefix / get_option('sbindir') +sysconfdir = prefix / get_option('sysconfdir') + +src_id = '' +if fs.is_file('.source-id') + src_id = fs.read('.source-id', encoding: 'utf-8').strip() +elif git.found() + src_id = run_command(git, 'rev-parse', '--short', 'HEAD', check: true).stdout().substring(0, 7) + meson.add_dist_script('util' / 'meson-dist-package.sh', 'source-id', src_id) +endif + +### Compiler +add_project_arguments( + cc.get_supported_arguments( + '-Wformat', + '-Wno-missing-field-initializers', + '-Wpointer-arith', + '-Wshadow', + '-Wwrite-strings', + + '-Werror=alloca', + '-Werror=cpp', + '-Werror=flex-array-member-not-at-end', + '-Werror=format-security', + '-Werror=implicit', + '-Werror=implicit-function-declaration', + '-Werror=missing-prototypes', + '-Werror=parentheses', + '-Werror=strict-prototypes', + '-Werror=vla', + + '-fcf-protection=full', + '-fdiagnostics-show-option', + '-fno-delete-null-pointer-checks', + '-fno-strict-aliasing', + '-fstack-clash-protection', + '-fstack-protector-strong', + '-fstrict-flex-arrays=3', + ), + language: 'c', +) + +add_project_link_arguments( + cc.get_supported_link_arguments( + '-Wl,-z,noexecstack', + '-Wl,-z,now', + '-Wl,-z,relro', + '-Wl,-z,separate-code', + ), + language: 'c', +) + +if developer_mode + add_project_arguments('-Werror', language: 'c') +endif + +fortify_test = ''' +#include +#include + +int main(void) { + void *x = malloc(10); + printf("%p\n", x); +} +''' + +if not (get_option('optimization') == '0' or get_option('buildtype') == 'plain') + if cc.compiles( + fortify_test, + args: ['-Werror=cpp', '-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=3'], + name: 'usage of _FORTIFY_SOURCE=3', + ) + add_project_arguments('-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=3', language: 'c') + else + add_project_arguments('-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=2', language: 'c') + endif +endif + +if host_machine.system() == 'x86' + add_project_arguments( + cc.get_supported_arguments( + '-Wno-psabi', + ), + language: 'c', + ) +endif + +if host_machine.system() == 'darwin' + add_project_arguments( + cc.get_supported_arguments( + '-Wno-deprecated-declarations', # For GSS.Framework + '-Wno-unknown-attributes', # For _Noreturn in urcu + ), + language: 'c', + ) + + add_project_link_arguments( + cc.get_supported_link_arguments( + '-Wl,-flat_namespace', + '-Wl,-no_warn_duplicate_libraries', # for krb5 + ), + language: 'c', + ) +endif + +sys_defines = [ + '-D_BSD_SOURCE', + '-D_DARWIN_C_SOURCE', + '-D_DEFAULT_SOURCE', + '-D_FILE_OFFSET_BITS=64', + '-D_GNU_SOURCE', + '-D_LARGE_FILES', + '-D_TIME_BITS=64', + '-D__APPLE_USE_RFC_3542=1', +] + +add_project_arguments(sys_defines, language: 'c') + +### Environment + +env = environment( + { + 'BIND_PROJECT_VERSION': meson.project_version(), + 'BIND_BUILD_ROOT': meson.project_build_root(), + 'BIND_SOURCE_ROOT': meson.project_source_root(), + }, +) + +### Configuration +config = configuration_data() + +config.set_quoted('PACKAGE_NAME', 'BIND') +config.set_quoted('PACKAGE_DESCRIPTION', 'Development Release') +config.set_quoted('PACKAGE_VERSION', meson.project_version()) +config.set_quoted('PACKAGE_STRING', 'BIND ' + meson.project_version()) +config.set_quoted('PACKAGE_BUILDER', 'meson') +config.set_quoted('PACKAGE_SRCID', src_id) +config.set_quoted('PACKAGE_CONFIGARGS', build_options) + +if get_option('auto-validation').allowed() + config.set_quoted('VALIDATION_DEFAULT', 'yes') +else + config.set_quoted('VALIDATION_DEFAULT', 'no') +endif + +config.set_quoted('SESSION_KEYFILE', localstatedir / 'run' / 'named' / 'session.key') + +config.set_quoted('RNDC_CONFFILE', sysconfdir / 'rndc.conf') +config.set_quoted('RNDC_KEYFILE', sysconfdir / 'rndc.key') + +config.set_quoted('NAMED_PLUGINDIR', datadir / 'bind') +config.set_quoted('NAMED_LOCALSTATEDIR', localstatedir) +config.set_quoted('NAMED_SYSCONFDIR', sysconfdir) +config.set_quoted('NAMED_CONFFILE', sysconfdir / 'named.conf') + +config.set_quoted('CACHEDB_DEFAULT', get_option('cachedb')) +config.set_quoted('ZONEDB_DEFAULT', get_option('zonedb')) + +# Shim constexpr for pre-C23 +# "ne" => "none" +if c_std.substring(-2) in ['ne', '89', '99', '11', '17', '18'] + config.set('constexpr', 'static const') +endif + +if developer_mode + config.set('ISC_LIST_CHECKINIT', 1) + config.set('ISC_MEM_DEFAULTFILL', 1) + config.set('ISC_MEM_TRACKLINES', 1) + config.set('ISC_MUTEX_ERROR_CHECK', 1) + config.set('ISC_SOCKET_DETAILS', 1) + config.set('ISC_STATS_CHECKUNDERFLOW', 1) +endif + +foreach fn : [ + '__builtin_add_overflow', + '__builtin_clz', + '__builtin_mul_overflow', + '__builtin_sub_overflow', + '__builtin_unreachable', +] + if cc.has_function(fn) + config.set('HAVE_@0@'.format(fn.substring(2).to_upper()), 1) + endif +endforeach + +foreach attr : ['malloc', 'returns_nonnull'] + if cc.has_function_attribute(attr) + config.set('HAVE_FUNC_ATTRIBUTE_@0@'.format(attr.to_upper()), 1) + endif +endforeach + +malloc_ext_test = ''' +#include +#include + +__attribute__ ((malloc, malloc(free, 1)) +void * xmalloc(size_t sz) { + return malloc(sz); +} + +void main(void) { + return xmalloc(8) != NULL; +} +''' +if cc.compiles(malloc_ext_test, name: 'usage of extended malloc attribute') + config.set('HAVE_MALLOC_EXT_ATTR', 1) +endif + +## Fuzzing +config.set_quoted('FUZZDIR', meson.project_source_root() / 'fuzz') + +fuzz_link_args = [] +if fuzz_opt != 'none' + if get_option('b_lundef') != false + warning('fuzzing will fail to build properly without -Db_lundef=false') + endif + + if fuzz_opt == 'afl' + elif fuzz_opt == 'libfuzzer' + config.set('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1) + fuzz_link_args += '-fsanitize=fuzzer,address,undefined' + add_project_link_arguments('-fsanitize=address,undefined', language: 'c') + add_project_arguments('-fsanitize=fuzzer-no-link,address,undefined', language: 'c') + endif +endif + +## Architecture +if host_machine.endian() == 'big' + config.set('WORDS_BIGENDIAN', 1) +endif + +instruction_test = ''' +int main(void) { + __asm__ __volatile__ ("@0@"); + return 0; +} +''' + +cpu_family = host_machine.cpu_family() +if cpu_family in ['arm', 'aarch64'] + if cc.compiles( + instruction_test.format('yield'), + name: 'usage of yield instruction', + ) + config.set('HAVE_SPARC_PAUSE', 1) + endif +elif cpu_family in ['sparc', 'sparc64'] + if cc.compiles( + instruction_test.format('pause'), + name: 'usage of pause instruction', + ) + config.set('HAVE_SPARC_PAUSE', 1) + endif +endif + +atomic_test = ''' +#include +int main(void) { + atomic_int_fast64_t val = 0; + atomic_fetch_add_explicit(&val, 1, memory_order_relaxed); + + return 0; +} +''' + +# meson_version (>=1.7.0) : new custom dependency for atomic +if not cc.compiles(atomic_test, name: 'usage of atomics without -latomic') + atomic_dep = declare_dependency(link_args: '-latomic') + if not cc.compiles( + atomic_test, + dependencies: atomic_dep, + name: 'usage of atomics with -latomic', + ) + error( + 'libatomic needed, but linking with -latomic failed, please fix your toolchain', + ) + endif + + add_project_dependencies(atomic_dep, language: 'c') +endif + +## OS +config.set10('USE_PTHREAD_RWLOCK', locktype_opt == 'system') + +if host_machine.system() == 'sunos' and cc.get_id() == 'gcc' + add_project_link_arguments('-zrelax=transtls', language: 'c') + warning( + 'When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage', + ) +endif + +if cc.has_header_symbol('pthread.h', 'PTHREAD_MUTEX_ADAPTIVE_NP') + config.set('HAVE_PTHREAD_MUTEX_ADAPTIVE_NP', 1) +endif + +foreach fn, header : { + # Better strings + 'strlcpy': '#include ', + 'strlcat': '#include ', + 'strnstr': '#include ', + + # Kernel information + 'uname': '#include ', + + # Backtrace + 'backtrace_symbols': '#include ', + + # Timezone + 'tzset': '#include ', + + # Check for if_nametoindex() for IPv6 scoped addresses support + 'if_nametoindex': '#include ', + + # FILE locking + 'flockfile': '#include ', + 'getc_unlocked': '#include ', + + # Thread control + 'pthread_attr_getstacksize': '#include ', + 'pthread_attr_setstacksize': '#include ', + 'pthread_barrier_init': '#include ', + 'pthread_set_name_np': '#include ', + 'pthread_setname_np': '#include ', + 'pthread_spin_init': '#include ', + 'pthread_yield': '#include ', + 'pthread_yield_np': '#include ', + + # Processor control + 'cpuset_getaffinity': '#include ', + 'sched_getaffinity': '#include ', + 'sched_yield': '#include ', + + # Misc. + 'clock_gettime': '#include ', + 'sysctlbyname': '#include ', +} + if cc.has_function(fn, prefix: header, args: sys_defines) + config.set('HAVE_@0@'.format(fn.to_upper()), 1) + endif +endforeach + +# Check for nanoseconds in file stats +if cc.has_member('struct stat', 'st_mtim.tv_nsec', prefix: '#include ') + config.set('HAVE_STAT_NSEC', 1) +endif + +foreach h : [ + 'fcntl.h', + 'linux/netlink.h', + 'linux/rtnetlink.h', + 'malloc_np.h', + 'net/if6.h', + 'net/route.h', + 'regex.h', + 'sys/mman.h', + 'sys/select.h', + 'sys/sockio.h', + 'sys/sysctl.h', + 'sys/time.h', + 'unistd.h', +] + if cc.has_header(h) + config.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1) + endif +endforeach + +## Leak detection in external libraries +config.set10('ENABLE_LEAK_DETECTION', leak_opt.enabled()) + +## Query Tracing + +# meson_version (>=1.1.0) : enable_if in feature object +query_trace_opt = 'query' in trace_logging +single_trace_opt = 'single' in trace_logging +if query_trace_opt or developer_mode + config.set('WANT_QUERYTRACE', 1) + if single_trace_opt + config.set('WANT_SINGLETRACE', 1) + endif +elif single_trace_opt + error('single trace logging requires query trace logging') +endif + +### +### Dependencies +### +null_dep = dependency('', required: false) + +thread_dep = dependency('threads') +m_dep = cc.find_library('m', required: false) + +## OpenSSL +openssl_dep = [ + dependency('libcrypto', version: '>=1.1.1'), + dependency('libssl', version: '>=1.1.1'), +] + +foreach fn, header : { + 'EVP_default_properties_enable_fips': '#include ', + 'FIPS_mode': '#include ', +} + if cc.has_function(fn, prefix: header, dependencies: openssl_dep) + config.set('HAVE_OPENSSL_FIPS_TOGGLE', 1) + config.set('HAVE_@0@'.format(fn.to_upper()), 1) + endif +endforeach + +fips_opt.require( + config.has('HAVE_OPENSSL_FIPS_TOGGLE'), + error_message: 'OpenSSL FIPS mode requested but not available', +) + +# Hash and curve probe +if cc.has_header_symbol('openssl/evp.h', 'NID_ED448', dependencies: openssl_dep) + config.set('HAVE_OPENSSL_ED448', 1) +endif + +foreach fn, header : { + 'ERR_get_error_all': '#include ', + 'BIO_read_ex': '#include ', + 'BIO_write_ex': '#include ', + 'EVP_MD_CTX_get0_md': '#include ', + 'EVP_PKEY_eq': '#include ', + 'SSL_CTX_set1_cert_store': '#include ', +} + config.set10( + 'HAVE_@0@'.format(fn.to_upper()), + cc.has_function(fn, dependencies: openssl_dep, prefix: header), + ) +endforeach + +## libuv +uv_dep = dependency('libuv', version: '>=1.34.0') +if uv_dep.version().version_compare('<1.40.0') + warning('libuv version 1.40.0 or greater is highly recommended') +endif + +foreach sym : ['UV_UDP_LINUX_RECVERR', 'UV_UDP_MMSG_CHUNK', 'UV_UDP_MMSG_FREE'] + if cc.has_header_symbol('uv.h', sym, dependencies: uv_dep) + config.set('HAVE_DECL_@0@'.format(sym), 1) + endif +endforeach + +if not cc.has_members('struct msghdr', '__pad1', '__pad2', prefix: '#include ') + if cc.has_header_symbol('uv.h', 'UV_UDP_RECVMMSG', dependencies: uv_dep) + config.set('HAVE_DECL_UV_UDP_RECVMMSG', 1) + endif +else + message('likely non-glibc on linux, disabling recvmmsg') +endif + +## userspace-rcu +urcu_dep = [dependency('liburcu-cds', version: '>=0.10.0')] +if rcu_flavor == 'membarrier' + config.set('RCU_MEMBARRIER', true) + urcu_dep += dependency('liburcu', version: '>=0.10.0') +elif not developer_mode + error('Changing Userspace-RCU flavor is allowed only in development mode') +elif rcu_flavor == 'bp' + config.set('RCU_BP', true) + urcu_dep += dependency('liburcu-bp', version: '>=0.10.0') +elif rcu_flavor == 'mb' + config.set('RCU_MB', true) + urcu_dep += dependency('liburcu-mb', version: '>=0.10.0') +elif rcu_flavor == 'qsbr' + config.set('RCU_QSBR', true) + urcu_dep += dependency('liburcu-qsbr', version: '>=0.10.0') +endif + +# liburcu << v0.13.0 didn't add -lurcu-common and some toolchains would +# not add it automatically - we need to add it explicitly in such case. + +if urcu_dep[1].version().version_compare('<0.13.0') + urcu_dep += cc.find_library('liburcu-common') +endif + +config.set_quoted('RCU_FLAVOR', f'liburcu-@rcu_flavor@') +config.set_quoted('RCU_VERSION', urcu_dep[0].version()) + +urcu_inline_test = ''' +#define URCU_INLINE_SMALL_FUNCTIONS 1 +#include +int main(void) { + struct opaque *a = malloc(1); + struct opaque *b = rcu_dereference(a); + + return b != NULL; +} +''' +if cc.compiles( + urcu_inline_test, + dependencies: urcu_dep, + name: 'usage of opaque urcu inlining', +) + config.set('URCU_INLINE_SMALL_FUNCTIONS', 1) +endif + +## jemalloc +jemalloc_dep = null_dep +if jemalloc_opt.allowed() + jemalloc_dep = dependency('jemalloc', required: jemalloc_opt) + if jemalloc_dep.found() + config.set('HAVE_JEMALLOC', 1) + endif +endif + +## dnstap +dnstap_dep = null_dep # Will be filled later + +fstrm_dep = null_dep +proto_dep = null_dep +if dnstap_opt.allowed() + fstrm_dep = dependency('libfstrm', required: dnstap_opt) + proto_dep = dependency('libprotobuf-c', required: dnstap_opt) + if protoc.found() and fstrm_dep.found() and proto_dep.found() + config.set('HAVE_DNSTAP', 1) + endif +endif + +## JSON +json_c_dep = null_dep +if stats_json_opt.allowed() + json_c_dep = dependency('json-c', version: '>=0.11', required: stats_json_opt) + if json_c_dep.found() + config.set('HAVE_JSON_C', 1) + endif +endif + +## XML +xml2_dep = null_dep +if stats_xml_opt.allowed() + xml2_dep = dependency('libxml-2.0', version: '>=2.6.0', required: stats_xml_opt) + if xml2_dep.found() + config.set('HAVE_LIBXML2', 1) + endif +endif + +## DNS-over-HTTP (DoH) +nghttp2_dep = null_dep +if doh_opt.allowed() + nghttp2_dep = dependency('libnghttp2', version: '>=1.6.0', required: doh_opt) + if nghttp2_dep.found() + config.set('HAVE_LIBNGHTTP2', 1) + endif +endif + +## GeoIP +maxminddb_dep = null_dep +if geoip_opt.allowed() + maxminddb_dep = dependency('libmaxminddb', required: geoip_opt) + if maxminddb_dep.found() + config.set('HAVE_GEOIP2', 1) + config.set_quoted('MAXMINDDB_PREFIX', maxminddb_dep.get_variable('prefix')) + endif +endif + +## GSSAPI +gssapi_dep = null_dep +krb5_dep = null_dep +if gssapi_opt.allowed() and krb5_config.found() + krb5_dep = declare_dependency( + compile_args: run_command(krb5_config, ['krb5', '--cflags'], check: true).stdout().strip().split(), + link_args: run_command(krb5_config, ['krb5', '--libs'], check: true).stdout().strip().split(), + version: run_command(krb5_config, ['--version'], check: true).stdout().strip(), + ) + + if cc.has_header('krb5/krb5.h', dependencies: krb5_dep) + config.set('HAVE_KRB5_KRB5_H', 1) + elif cc.has_header('krb5.h', dependencies: krb5_dep) + config.set('HAVE_KRB5_H', 1) + elif krb5_dep.found() + error('neither krb5/krb5.h nor krb5 found') + endif + + if krb5_dep.found() and not cc.has_function('krb5_init_context', dependencies: krb5_dep) + error('KRB5 does not work') + endif + + gssapi_dep = declare_dependency( + compile_args: run_command(krb5_config, ['gssapi', '--cflags'], check: true).stdout().strip().split(), + link_args: run_command(krb5_config, ['gssapi', '--libs'], check: true).stdout().strip().split(), + version: krb5_dep.version(), + ) + + if cc.has_header('gssapi/gssapi.h', dependencies: gssapi_dep) + config.set('HAVE_GSSAPI_GSSAPI_H', 1) + elif cc.has_header('gssapi.h', dependencies: gssapi_dep) + config.set('HAVE_GSSAPI_H', 1) + elif gssapi_dep.found() + error('neither gssapi/gssapi.h nor gssapi.h found') + endif + + if cc.has_header('gssapi/gssapi_krb5.h', dependencies: gssapi_dep) + config.set('HAVE_GSSAPI_GSSAPI_KRB5_H', 1) + elif cc.has_header('gssapi_krb5.h', dependencies: gssapi_dep) + config.set('HAVE_GSSAPI_KRB5_H', 1) + elif gssapi_dep.found() + error('neither gssapi/gssapi_krb5.h nor gssapi_krb5.h found') + endif + + if krb5_dep.found() and gssapi_dep.found() + config.set('HAVE_GSSAPI', 1) + endif +endif + +## libcap +cap_dep = null_dep +if cap_opt.allowed() + cap_dep = dependency('libcap', required: cap_opt) + if cap_dep.found() + config.set('HAVE_LIBCAP', 1) + endif +endif + +## IDN +idn2_dep = null_dep +if idn_opt.allowed() + idn2_dep = dependency('libidn2', required: idn_opt) + if idn2_dep.found() + config.set('HAVE_LIBIDN2', 1) + endif +endif + +## LMDB +lmdb_dep = null_dep +if lmdb_opt.allowed() + lmdb_dep = dependency('lmdb', required: lmdb_opt) + if lmdb_dep.found() + config.set('HAVE_LMDB', 1) + endif +endif + +## zlib + +# meson_version (>=1.1.0) : enable_if in feature object +zlib_dep = null_dep +if zlib_opt.allowed() or developer_mode + zlib_dep = dependency('zlib', required: zlib_opt.enabled() or developer_mode) + if zlib_dep.found() + config.set('HAVE_ZLIB', 1) + endif +endif + +## libedit +edit_dep = null_dep +if line_opt.allowed() + edit_dep = dependency('libedit', required: line_opt) + if edit_dep.found() + config.set('HAVE_LIBEDIT', 1) + endif +endif + +## cmocka +cmocka_dep = null_dep + +# meson_version (>=1.1.0) : enable_if in feature object +if cmocka_opt.allowed() or developer_mode + cmocka_dep = dependency( + 'cmocka', + version: '>=1.1.3', + required: cmocka_opt.enabled() or developer_mode, + ) + + if cmocka_dep.found() + config.set('HAVE_CMOCKA', 1) + endif +endif + +## DTrace +dtrace_header = generator( + dtrace, + output: '@BASENAME@.h', + arguments: ['-s', '@INPUT@', '-h', '-o', '@OUTPUT@'], +) + +# Acutally, dtrace probes are still built with macOS. +# macOS flavored dtrace doesn't recognize the -G option and +# only uses headers. +# +# Since the binary is in the base system, there isn't much reason +# to be able to disable it. You can just not use the probes. +config.set( + 'HAVE_DTRACE', + dtrace.full_path() != dtrace_shim + and build_machine.system() != 'darwin', +) +cc.has_header('sys/sdt.h', required: tracing_opt) +assert( + dtrace.full_path() != dtrace_shim or not tracing_opt.enabled(), + 'tracing is requested but dtrace is not found', +) + +### Finalize configuration +configure_file(output: 'config.h', configuration: config) +add_project_arguments('-include', meson.project_build_root() / 'config.h', language: 'c') + +### Build dnstap if necessary, needs configuration +if config.has('HAVE_DNSTAP') + dnstap_schema_src = custom_target( + 'dnstap-protobuf', + input: ['dnstap.proto'], + output: ['dnstap.pb-c.c', 'dnstap.pb-c.h'], + command: [ + protoc, + '--proto_path=@CURRENT_SOURCE_DIR@', + '--c_out=@OUTDIR@', + '@INPUT@', + ], + ) + + dnstap = static_library( + 'dnstap', + dnstap_schema_src, + implicit_include_directories: false, + dependencies: proto_dep, + ) + + dnstap_dep = declare_dependency( + link_with: dnstap, + sources: dnstap_schema_src[1], + dependencies: [ + fstrm_dep, + proto_dep, + ], + ) +endif + +### +### Compile Targets +### +bind_keys = custom_target( + 'bind-keys', + output: 'bind.keys.h', + depend_files: files('bind.keys', 'util' / 'bindkeys.pl'), + capture: true, + command: [ + perl, + meson.project_source_root() / 'util' / 'bindkeys.pl', + meson.project_source_root() / 'bind.keys', + ], +) + +# Headers +dns_inc = include_directories('lib' / 'dns' / 'include') +isc_inc = include_directories('lib' / 'isc' / 'include') +isccc_inc = include_directories('lib' / 'isccc' / 'include') +isccfg_inc = include_directories('lib' / 'isccfg' / 'include') +ns_inc = include_directories('lib' / 'ns' / 'include') + +dns_inc_p = [] +isc_inc_p = [] + +named_inc_p = [] +confgen_inc_p = [] + +# USDT Probes +dns_probe_objects = [] +isc_probe_objects = [] +ns_probe_objects = [] + +# Use sourceset to add conditional files +# https://mesonbuild.com/SourceSet-module.html +dns_srcset = ss.source_set() +isc_srcset = ss.source_set() +isccc_srcset = ss.source_set() +isccfg_srcset = ss.source_set() +ns_srcset = ss.source_set() + +named_srcset = ss.source_set() + +arm_srcset = ss.source_set() +man_srcset = ss.source_set() +manrst_srcset = ss.source_set() +doc_misc_targets = [] + +man_pages = [] + +arpaname_src = [] +delv_src = [] +dig_src = [] +dnssec_cds_src = [] +dnssec_dsfromkey_src = [] +dnssec_importkey_src = [] +dnssec_keyfromlabel_src = [] +dnssec_keygen_src = [] +dnssec_ksr_src = [] +dnssec_revoke_src = [] +dnssec_settime_src = [] +dnssec_signzone_src = [] +dnssec_verify_src = [] +dnstap_read_src = [] +host_src = [] +mdig_src = [] +named_checkconf_src = [] +named_checkzone_src = [] +named_journalprint_src = [] +named_nzd2nzf_src = [] +named_rrchecker_src = [] +nsec3hash_src = [] +nslookup_src = [] +nsupdate_src = [] +rndc_confgen_src = [] +rndc_src = [] +tsig_keygen_src = [] + +filter_a_src = [] +filter_aaaa_src = [] + +fuzz_binaries = {} +system_test_binaries = {} +system_test_libraries = {} + +system_test_targets = [] + +subdir('bin') +subdir('fuzz') +subdir('lib') +subdir('util') + +### +### Libraries & Binaries +### + +# libisc + +isc_srcconf = isc_srcset.apply(config, strict: false) + +libisc = library( + 'isc', + isc_srcconf.sources(), + objects: isc_probe_objects, + install: true, + install_rpath: libdir, + implicit_include_directories: false, + include_directories: [isc_inc, isc_inc_p], + dependencies: isc_srcconf.dependencies(), +) + +libisc_dep = declare_dependency( + link_with: libisc, + include_directories: isc_inc, + dependencies: [ + openssl_dep, + thread_dep, + urcu_dep, + uv_dep, + + jemalloc_dep, + ], +) + +# libdns +dns_srcconf = dns_srcset.apply(config, strict: false) + +libdns = library( + 'dns', + dns_srcconf.sources(), + include_directories: dns_inc, + install: true, + install_rpath: libdir, + objects: dns_probe_objects, + dependencies: [ + libisc_dep, + + openssl_dep, + urcu_dep, + + json_c_dep, + lmdb_dep, + xml2_dep, + + dns_srcconf.dependencies(), + ], +) + +libdns_dep = declare_dependency( + link_with: libdns, + include_directories: dns_inc, + sources: dns_gen_headers, + dependencies: [ + libisc_dep, + ], +) + +# libns + +ns_srcconf = ns_srcset.apply(config, strict: false) + +libns = library( + 'ns', + ns_srcconf.sources(), + objects: ns_probe_objects, + install: true, + install_rpath: libdir, + implicit_include_directories: false, + include_directories: ns_inc, + dependencies: [ + libisc_dep, + libdns_dep, + ], +) + +libns_dep = declare_dependency( + link_with: libns, + include_directories: ns_inc, + dependencies: [ + libisc_dep, + libdns_dep, + ], +) + +# libisccc +isccc_srcconf = isccc_srcset.apply(config, strict: false) + +libisccc = library( + 'isccc', + isccc_srcconf.sources(), + implicit_include_directories: false, + include_directories: isccc_inc, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + ], +) + +libisccc_dep = declare_dependency( + link_with: libisccc, + include_directories: isccc_inc, +) + +# libisccfg +isccfg_srcconf = isccfg_srcset.apply(config, strict: false) + +libisccfg = library( + 'isccfg', + isccfg_srcconf.sources(), + implicit_include_directories: false, + include_directories: isccfg_inc, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libns_dep, + + dnstap_dep, + ], +) + +libisccfg_dep = declare_dependency( + link_with: libisccfg, + include_directories: isccfg_inc, +) + +named_srcconf = named_srcset.apply(config, strict: false) + +executable( + 'arpaname', + arpaname_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libisc_dep, + ], +) + +executable( + 'delv', + delv_src, + export_dynamic: true, + implicit_include_directories: true, + install: true, + install_rpath: libdir, + sources: bind_keys, + dependencies: [ + libisc_dep, + libisccfg_dep, + libns_dep, + ], +) + +executable( + 'dig', + dig_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + + idn2_dep, + ], +) + +executable( + 'dnssec-cds', + dnssec_cds_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-dsfromkey', + dnssec_dsfromkey_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-importkey', + dnssec_importkey_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-keyfromlabel', + dnssec_keyfromlabel_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-keygen', + dnssec_keygen_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-ksr', + dnssec_ksr_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-revoke', + dnssec_revoke_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-settime', + dnssec_settime_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-signzone', + dnssec_signzone_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +executable( + 'dnssec-verify', + dnssec_verify_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + ], +) + +if config.has('HAVE_DNSTAP') + executable( + 'dnstap-read', + dnstap_read_src, + export_dynamic: true, + implicit_include_directories: true, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + + dnstap_dep, + ], + ) +endif + +executable( + 'host', + host_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + + idn2_dep, + ], +) + +executable( + 'mdig', + mdig_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + ], +) + +executable( + 'named-checkconf', + named_checkconf_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libisc_dep, + libdns_dep, + libisccfg_dep, + ], +) + +executable( + 'named-checkzone', + named_checkzone_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libisc_dep, + libdns_dep, + libisccfg_dep, + libns_dep, + ], +) + +executable( + 'named-journalprint', + named_journalprint_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + ], +) + +if config.has('HAVE_LMDB') + executable( + 'named-nzd2nzf', + named_nzd2nzf_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + + lmdb_dep, + ], + ) +endif + +executable( + 'named-rrchecker', + named_rrchecker_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + ], + +) + +executable( + 'named', + named_srcconf.sources(), + export_dynamic: true, + implicit_include_directories: true, + include_directories: named_inc_p, + install: true, + install_dir: sbindir, + install_rpath: libdir, + sources: bind_keys, + dependencies: [ + libdns_dep, + libisc_dep, + libisccc_dep, + libisccfg_dep, + libns_dep, + + openssl_dep, + + cap_dep, + dnstap_dep, + json_c_dep, + lmdb_dep, + nghttp2_dep, + xml2_dep, + zlib_dep, + + named_srcconf.dependencies(), + ], +) + +executable( + 'nsec3hash', + nsec3hash_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + ], +) + +executable( + 'nslookup', + nslookup_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + + idn2_dep, + edit_dep, + ], +) + +executable( + 'nsupdate', + nsupdate_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + + gssapi_dep, + krb5_dep, + edit_dep, + ], +) + +executable( + 'rndc-confgen', + rndc_confgen_src, + export_dynamic: true, + implicit_include_directories: false, + include_directories: confgen_inc_p, + install: true, + install_rpath: libdir, + install_dir: sbindir, + dependencies: [ + libdns_dep, + libisc_dep, + ], +) + +executable( + 'rndc', + rndc_src, + export_dynamic: true, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + install_dir: sbindir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccc_dep, + libisccfg_dep, + ], +) + +executable( + 'tsig-keygen', + tsig_keygen_src, + export_dynamic: true, + implicit_include_directories: false, + include_directories: confgen_inc_p, + install: true, + install_rpath: libdir, + install_dir: sbindir, + dependencies: [ + libdns_dep, + libisc_dep, + libisccc_dep, + libisccfg_dep, + ], +) + +install_symlink( + 'ddns-confgen', + pointing_to: 'tsig-keygen', + install_dir: sbindir, +) + +shared_library( + 'filter-a', + filter_a_src, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + install_dir: libdir / 'bind', + name_prefix: '', + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + libns_dep, + ], +) + +shared_library( + 'filter-aaaa', + filter_aaaa_src, + implicit_include_directories: false, + install: true, + install_rpath: libdir, + install_dir: libdir / 'bind', + name_prefix: '', + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + libns_dep, + ], +) + +subdir('doc') +subdir('tests') + +foreach name, sources : fuzz_binaries + executable( + name, + sources, + export_dynamic: true, + implicit_include_directories: true, + install: false, + c_args: ['-Wno-vla'], + link_args: fuzz_link_args, + dependencies: [ + libdns_dep, + libisc_dep, + libtest_dep, + ], + ) +endforeach + +foreach name, sources : system_test_binaries + system_test_targets += executable( + name, + sources, + build_by_default: developer_mode, + export_dynamic: true, + implicit_include_directories: false, + install: false, + dependencies: [ + libdns_dep, + libisc_dep, + + openssl_dep, + ], + ) +endforeach + +foreach name, sources : system_test_libraries + system_test_targets += shared_library( + name, + sources, + build_by_default: developer_mode, + implicit_include_directories: false, + install: false, + name_prefix: 'testlib-', + dependencies: [ + libdns_dep, + libisc_dep, + libns_dep, + ], + ) +endforeach + +alias_target('system-test-dependencies', system_test_targets) + +### Documentation + +if doc_opt.allowed() + man_srcconf = man_srcset.apply(config, strict: false) + foreach man : man_srcconf.sources() + man_pages += configure_file( + input: man, + output: fs.stem(man), + configuration: { + 'SYSCONFDIR': sysconfdir, + 'RUNSTATEDIR': runstatedir, + }, + ) + endforeach + + install_man(man_pages) + + if sphinx_build.found() + meson.add_dist_script( + 'util' / 'meson-dist-package.sh', + 'manual', + meson.project_version(), + sphinx_build.full_path(), + ) + + # meson_version (>=0.63) : multiline f-string + rst_epilog_tmpl = '''.. |rndc_conf| replace:: ``@0@/rndc.conf`` +.. |rndc_key| replace:: ``@0@/rndc.key`` +.. |named_conf| replace:: ``@0@/named.key`` +.. |named_pid| replace:: ``@1@/named.key`` +.. |session_key| replace:: ``@1@/session.key`` +''' + + rst_epilog = rst_epilog_tmpl.format(sysconfdir, runstatedir) + + sphinx_common_options = [ + '-W', + '-a', + '-n', + '-q', + '-D', 'version=' + meson.project_version(), + '-D', 'release=' + meson.project_version(), + '-D', 'rst_epilog=' + rst_epilog, + '-D', 'today_fmt=%Y-%m-%d', + ] + + ## Manual pages + manrst_srcconf = manrst_srcset.apply(config, strict: false) + + custom_target( + 'man', + depend_files: manrst_srcconf.sources(), + depends: doc_misc_targets, + install: true, + install_dir: fs.parent(mandir), + output: fs.name(mandir), + env: env, + command: [ + sphinx_build, + sphinx_common_options, + '-b', 'man', + '-d', '@PRIVATE_DIR@', + '-c', '@CURRENT_SOURCE_DIR@' / 'doc' / 'man', + '@CURRENT_SOURCE_DIR@' / 'doc' / 'man', + '@OUTPUT@', + ], + ) + + ## ARM + arm_srcset.add_all(manrst_srcset) + arm_srcconf = arm_srcset.apply(config, strict: false) + + custom_target( + 'arm', + build_by_default: false, + depend_files: arm_srcconf.sources(), + depends: doc_misc_targets, + output: 'arm', + env: env, + command: [ + sphinx_build, + sphinx_common_options, + '-b', 'html', + '-d', '@PRIVATE_DIR@', + '-c', '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@OUTPUT@', + ], + ) + + custom_target( + 'arm-singlehtml', + build_by_default: false, + depend_files: arm_srcconf.sources(), + depends: doc_misc_targets, + output: 'arm-singlehtml', + env: env, + command: [ + sphinx_build, + sphinx_common_options, + '-b', 'singlehtml', + '-d', '@PRIVATE_DIR@', + '-c', '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@OUTPUT@', + ], + ) + + custom_target( + 'arm-pdf', + build_by_default: false, + depend_files: arm_srcconf.sources(), + depends: doc_misc_targets, + output: 'arm-pdf', + env: env, + command: [ + sphinx_build, + '-M', 'latexpdf', + '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@OUTPUT@', + sphinx_common_options, + '-d', '@PRIVATE_DIR@', + '-c', '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + ], + ) + + custom_target( + 'arm-epub', + build_by_default: false, + depend_files: arm_srcconf.sources(), + depends: doc_misc_targets, + output: 'arm-epub', + env: env, + command: [ + sphinx_build, + sphinx_common_options, + '-b', 'epub', + '-d', '@PRIVATE_DIR@', + '-c', '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@CURRENT_SOURCE_DIR@' / 'doc' / 'arm', + '@OUTPUT@', + ], + ) + endif +endif + +### +### Summary +### + +summary( + { + 'Compiler': cc.get_id(), + 'Linker': cc.get_linker_id(), + }, + section: 'Toolchain', +) + +summary( + { + 'libuv': uv_dep.version(), + 'OpenSSL': openssl_dep[0].version(), + 'Userspace RCU': urcu_dep[0].version(), + 'RCU Flavor': rcu_flavor, + }, + section: 'Required Dependencies', +) + +summary( + { + 'cmocka': cmocka_dep.version(), + 'fstrm': fstrm_dep.version(), + 'GSSAPI': gssapi_dep.version(), + 'jemalloc': jemalloc_dep.version(), + 'json-c': json_c_dep.version(), + 'krb5': krb5_dep.version(), + 'libcap': cap_dep.version(), + 'libedit': edit_dep.version(), + 'libidn2': idn2_dep.version(), + 'libxml2': xml2_dep.version(), + 'LMDB': lmdb_dep.version(), + 'MaxMindDB': maxminddb_dep.version(), + 'nghttp2': nghttp2_dep.version(), + 'protobuf-c': proto_dep.version(), + 'zlib': zlib_dep.version(), + }, + section: 'Optional Dependencies', +) + +### Warn about fragmentation +if not (config.has('HAVE_JEMALLOC') or config.has('HAVE_MALLOC_NP_H')) + message() + warning( + ''' + +------------------------------------------+ + | ==== WARNING ==== | + | | + | This is NOT a recommended configuration. | + | Using the system memory allocator causes | + | reduced performance and increased memory | + | fragmentation. Installing the jemalloc | + | memory allocator (version >= 4.0.0) is | + | strongly recommended. | + +------------------------------------------+ + ''', + ) + message() +endif diff --git a/meson.format b/meson.format new file mode 100644 index 0000000000..cbacfb2399 --- /dev/null +++ b/meson.format @@ -0,0 +1,14 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +group_arg_value = true +indent_before_comments = ' ' +no_single_comma_function = false diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..bb010924dd --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,190 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# Features +option( + 'doc', + type: 'feature', + value: 'auto', + description: 'Enable sphinx-based documentation generation', +) + +option( + 'cap', + type: 'feature', + value: 'auto', + description: 'Enable libcap-based capability support', +) + +option( + 'dnstap', + type: 'feature', + value: 'auto', + description: 'Enable dnstap packet logging, requires fstrm and protobuf-c', +) + +option( + 'doh', + type: 'feature', + value: 'auto', + description: 'Enable DNS over HTTPS, requires libnghttp2', +) + +option( + 'fips', + type: 'feature', + value: 'disabled', + description: 'Enable FIPS mode toggle', +) + +option( + 'geoip', + type: 'feature', + value: 'auto', + description: 'Enable GeoIP support, requires libmaxminddb', +) + +option( + 'gssapi', + type: 'feature', + value: 'auto', + description: 'Enable GSSAPI support, requires krb5 and gssapi', +) + +option( + 'idn', + type: 'feature', + value: 'auto', + description: 'Enable IDN support, requires libidn2', +) + +option( + 'line', + type: 'feature', + value: 'auto', + description: 'Enable line editing in nsupdate and nslookup, requires libedit', +) + +option( + 'lmdb', + type: 'feature', + value: 'auto', + description: 'LMDB database to store configuration for "addzone" zones', +) + +option( + 'stats-json', + type: 'feature', + value: 'auto', + description: 'Enable JSON statistics, requires json-c', +) + +option( + 'stats-xml', + type: 'feature', + value: 'auto', + description: 'Enable XML statistics, requires libxml2', +) + +option( + 'zlib', + type: 'feature', + value: 'auto', + description: 'Enable HTTP zlib compression, requires zlib', +) + +# Internals +option( + 'cachedb', + type: 'combo', + choices: ['qpcache'], + description: 'Default cache database type', +) + +option( + 'zonedb', + type: 'combo', + choices: ['qpzone'], + description: 'Default zone database type', +) + +option( + 'locktype', + type: 'combo', + choices: ['adaptive', 'system'], + description: 'Mutex lock type', +) + +option( + 'jemalloc', + type: 'feature', + value: 'auto', + description: 'Use jemalloc for allocation', +) + +option( + 'rcu-flavor', + type: 'combo', + choices: ['membarrier', 'bp', 'mb', 'qsbr'], + description: 'Userspace RCU Flavor (non-membarrier RCU is only allowed in development builds)', +) + +option( + 'tracing', + type: 'feature', + value: 'auto', + description: 'Enable User Statically Defined Tracing support, requires dtrace or systemtap', +) + +# Behavior +option( + 'auto-validation', + type: 'feature', + value: 'enabled', + description: 'Turn on DNSSEC validation by default, using the IANA root key', +) + +# Development +option( + 'developer', + type: 'feature', + value: 'disabled', + description: 'Enable development mode', +) + +option( + 'cmocka', + type: 'feature', + value: 'auto', + description: 'Enable cmocka based tests', +) + +option( + 'fuzzing', + type: 'combo', + choices: ['none', 'afl', 'libfuzzer', 'oss-fuzz'], + description: 'Enable fuzzing', +) + +option( + 'trace-logging', + type: 'array', + value: [], + choices: ['query', 'single'], + description: 'Enable very verbose (single-)query trace logging', +) + +option( + 'leak-detection', + type: 'feature', + value: 'disabled', + description: 'enable the memory leak detection in external libraries (libxml2, libuv, OpenSSL)', +) diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index c9240727ba..0000000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBUV_CFLAGS) \ - -I$(top_srcdir)/lib/isc - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBNS_LIBS) - -SUBDIRS = libtest - -if HAVE_CMOCKA -SUBDIRS += isc dns ns isccfg bench -endif HAVE_CMOCKA - -check_PROGRAMS = diff --git a/tests/bench/Makefile.am b/tests/bench/Makefile.am deleted file mode 100644 index 073c9b26a1..0000000000 --- a/tests/bench/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CFLAGS += -Wno-vla - -AM_CPPFLAGS += \ - $(LIBUV_CFLAGS) \ - $(LIBURCU_CFLAGS) \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - -I$(top_srcdir)/fuzz \ - -I$(top_srcdir)/lib/dns \ - -I$(top_srcdir)/lib/isc \ - -I$(top_srcdir)/tests/include - -LDADD += \ - $(LIBUV_LIBS) \ - $(LIBURCU_LIBS) \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(top_builddir)/tests/libtest/libtest.la - -noinst_PROGRAMS = \ - ascii \ - compress \ - dns_name_fromwire \ - iterated_hash \ - load-names \ - qp-dump \ - qplookups \ - qpmulti \ - siphash - -dns_name_fromwire_SOURCES = \ - $(top_builddir)/fuzz/old.c \ - $(top_builddir)/fuzz/old.h \ - dns_name_fromwire.c diff --git a/tests/bench/meson.build b/tests/bench/meson.build new file mode 100644 index 0000000000..b16b529ada --- /dev/null +++ b/tests/bench/meson.build @@ -0,0 +1,51 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +foreach bench : [ + 'ascii', + 'compress', + 'iterated_hash', + 'load-names', + 'qp-dump', + 'qplookups', + 'qpmulti', + 'siphash', +] + executable( + bench, + files(fs.replace_suffix(bench, '.c')), + export_dynamic: true, + install: false, + dependencies: [ + libisc_dep, + libdns_dep, + libns_dep, + libtest_dep, + ], + ) +endforeach + +executable( + 'dns_name_fromwire', + files( + 'dns_name_fromwire.c', + meson.project_source_root() / 'fuzz' / 'old.c', + ), + export_dynamic: true, + include_directories: '..' / '..' / 'fuzz', + install: false, + dependencies: [ + libisc_dep, + libdns_dep, + libns_dep, + libtest_dep, + ], +) diff --git a/tests/dns/Makefile.am b/tests/dns/Makefile.am deleted file mode 100644 index b10d482221..0000000000 --- a/tests/dns/Makefile.am +++ /dev/null @@ -1,142 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBURCU_CFLAGS) \ - $(LIBUV_CFLAGS) \ - $(KRB5_CFLAGS) \ - -DSRCDIR=\"$(abs_srcdir)\" \ - -DBUILDDIR=\"$(abs_builddir)\" \ - -I$(top_srcdir)/lib/dns \ - -I$(top_srcdir)/lib/isc - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBURCU_LIBS) \ - $(LIBUV_LIBS) \ - $(LIBDNS_LIBS) - -check_PROGRAMS = \ - acl_test \ - badcache_test \ - db_test \ - dbdiff_test \ - dbiterator_test \ - dbversion_test \ - diff_test \ - dispatch_test \ - dns64_test \ - dst_test \ - ede_test \ - keytable_test \ - name_test \ - nametree_test \ - nsec3_test \ - nsec3param_test \ - private_test \ - qp_test \ - qpmulti_test \ - qpdb_test \ - qpzone_test \ - rdata_test \ - rdataset_test \ - rdatasetstats_test \ - resconf_test \ - resolver_test \ - rsa_test \ - sigs_test \ - skr_test \ - time_test \ - transport_test \ - tsig_test \ - unreachcache_test \ - update_test \ - zonefile_test \ - zonemgr_test \ - zt_test - -if HAVE_PERL - -check_PROGRAMS += \ - master_test - -EXTRA_master_test_DEPENDENCIES = testdata/master/master12.data testdata/master/master13.data testdata/master/master14.data -CLEANFILES += $(EXTRA_master_test_DEPENDENCIES) - -testdata/master/master12.data: testdata/master/master12.data.in - mkdir -p testdata/master - $(PERL) -w $(srcdir)/mkraw.pl < $(srcdir)/testdata/master/master12.data.in > $@ - -testdata/master/master13.data: testdata/master/master13.data.in - mkdir -p testdata/master - $(PERL) -w $(srcdir)/mkraw.pl < $(srcdir)/testdata/master/master13.data.in > $@ - -testdata/master/master14.data: testdata/master/master14.data.in - mkdir -p testdata/master - $(PERL) -w $(srcdir)/mkraw.pl < $(srcdir)/testdata/master/master14.data.in > $@ - -endif - -if HAVE_GEOIP2 -check_PROGRAMS += \ - geoip_test - -geoip_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(MAXMINDDB_CFLAGS) \ - -DTEST_GEOIP_DATA=\"$(top_srcdir)/bin/tests/system/geoip2/data\" - -geoip_test_LDADD = \ - $(LDADD) \ - $(MAXMINDDB_LIBS) -endif - -if HAVE_DNSTAP -check_PROGRAMS += \ - dnstap_test - -dnstap_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(DNSTAP_CFLAGS) -dnstap_test_LDADD = \ - $(LDADD) \ - $(DNSTAP_LIBS) -endif - -dh_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -dst_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -rsa_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -rdata_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -rdata_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -EXTRA_sigs_test_DEPENDENCIES = testdata/master/master18.data -CLEANFILES += $(EXTRA_sigs_test_DEPENDENCIES) - -testdata/master/master18.data: testdata/master/master18.data.in - mkdir -p testdata/master - sed -e 's,@TOP_SRCDIR@,$(abs_srcdir),' < $(srcdir)/testdata/master/master18.data.in > $@ - -EXTRA_DIST = \ - Kdh.+002+18602.key \ - Krsa.+008+29238.key \ - comparekeys \ - mkraw.pl \ - testdata \ - testkeys - -include $(top_srcdir)/Makefile.tests diff --git a/tests/dns/meson.build b/tests/dns/meson.build new file mode 100644 index 0000000000..55d4dee47c --- /dev/null +++ b/tests/dns/meson.build @@ -0,0 +1,99 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +dns_tests = [ + 'acl', + 'badcache', + 'db', + 'dbdiff', + 'dbiterator', + 'dbversion', + 'dispatch', + 'dns64', + 'dst', + 'ede', + 'keytable', + 'master', + 'name', + 'nametree', + 'nsec3', + 'nsec3param', + 'private', + 'qp', + 'qpdb', + 'qpmulti', + 'qpzone', + 'rdata', + 'rdataset', + 'rdatasetstats', + 'resconf', + 'resolver', + 'rsa', + 'sigs', + 'time', + 'transport', + 'tsig', + 'unreachcache', + 'update', + 'zonefile', + 'zonemgr', + 'zt', +] + +if config.has('HAVE_GEOIP2') + dns_tests += 'geoip' +endif + +if config.has('HAVE_DNSTAP') + dns_tests += 'dnstap' +endif + +master_data = [] +subdir('testdata/master') + +foreach unit : dns_tests + test_bin = executable( + unit, + files(f'@unit@_test.c'), + build_by_default: false, + export_dynamic: true, + install: false, + c_args: [ + '-DBUILDDIR="@0@"'.format(meson.current_build_dir()), + '-DSRCDIR="@0@"'.format(meson.current_source_dir()), + '-DTESTS_DIR="@0@"'.format(meson.current_source_dir()), + '-DTEST_GEOIP_DATA="@0@"'.format( + meson.project_source_root() / 'bin' / 'tests' / 'system' / 'geoip2' / 'data', + ), + ], + dependencies: [ + libisc_dep, + libdns_dep, + libns_dep, + libtest_dep, + + openssl_dep, + + cmocka_dep, + dnstap_dep, + maxminddb_dep, + ], + ) + + test( + unit, + test_bin, + depends: master_data, + suite: 'dns', + timeout: 300, + workdir: meson.current_source_dir(), + ) +endforeach diff --git a/tests/dns/sigs_test.c b/tests/dns/sigs_test.c index 93d01b15e1..8d1bf3599f 100644 --- a/tests/dns/sigs_test.c +++ b/tests/dns/sigs_test.c @@ -279,7 +279,7 @@ ISC_RUN_TEST_IMPL(updatesigs_next) { assert_int_equal(result, ISC_R_SUCCESS); result = dns_test_loaddb(&db, dns_dbtype_zone, "example", - "testdata/master/master18.data"); + BUILDDIR "/testdata/master/master18.data"); assert_int_equal(result, DNS_R_SEENINCLUDE); dns_zone_setkeydirectory(zone, TESTS_DIR "/testkeys"); diff --git a/tests/dns/testdata/master/master18.data.in b/tests/dns/testdata/master/master18.data.in index 73c17ffd99..7b967bd254 100644 --- a/tests/dns/testdata/master/master18.data.in +++ b/tests/dns/testdata/master/master18.data.in @@ -6,5 +6,5 @@ $TTL 1000 604800 ;expiration 3600 ) ;minimum -$INCLUDE "@TOP_SRCDIR@/testkeys/Kexample.+008+20386.key"; -$INCLUDE "@TOP_SRCDIR@/testkeys/Kexample.+008+37464.key"; +$INCLUDE "@TOP_SRCDIR@/tests/dns/testkeys/Kexample.+008+20386.key"; +$INCLUDE "@TOP_SRCDIR@/tests/dns/testkeys/Kexample.+008+37464.key"; diff --git a/tests/dns/testdata/master/meson.build b/tests/dns/testdata/master/meson.build new file mode 100644 index 0000000000..e616536255 --- /dev/null +++ b/tests/dns/testdata/master/meson.build @@ -0,0 +1,60 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +master_data += custom_target( + 'master-data-12', + feed: true, + capture: true, + input: files('master12.data.in'), + output: 'master12.data', + command: [ + perl, + '-e', 'use strict;', + '-e', 'chomp(my $line = );', + '-e', 'print pack("H*", $line);', + ], +) + +master_data += custom_target( + 'master-data-13', + feed: true, + capture: true, + input: files('master13.data.in'), + output: 'master13.data', + command: [ + perl, + '-e', 'use strict;', + '-e', 'chomp(my $line = );', + '-e', 'print pack("H*", $line);', + ], +) + +master_data += custom_target( + 'master-data-14', + feed: true, + capture: true, + input: files('master14.data.in'), + output: 'master14.data', + command: [ + perl, + '-e', 'use strict;', + '-e', 'chomp(my $line = );', + '-e', 'print pack("H*", $line);', + ], +) + +configure_file( + input: 'master18.data.in', + output: 'master18.data', + configuration: { + 'TOP_SRCDIR': meson.project_source_root(), + }, +) diff --git a/tests/isc/Makefile.am b/tests/isc/Makefile.am deleted file mode 100644 index cbe2d8bba2..0000000000 --- a/tests/isc/Makefile.am +++ /dev/null @@ -1,226 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBURCU_CFLAGS) \ - $(LIBUV_CFLAGS) \ - -I$(top_srcdir)/lib/isc - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBURCU_LIBS) \ - $(LIBUV_LIBS) - -check_PROGRAMS = \ - ascii_test \ - async_test \ - buffer_test \ - counter_test \ - dnsstream_utils_test \ - errno_test \ - file_test \ - hash_test \ - hashmap_test \ - heap_test \ - histo_test \ - hmac_test \ - ht_test \ - job_test \ - lex_test \ - loop_test \ - md_test \ - mem_test \ - mutex_test \ - netaddr_test \ - parse_test \ - proxyheader_test \ - proxystream_test \ - proxyudp_test \ - quota_test \ - radix_test \ - random_test \ - ratelimiter_test\ - regex_test \ - result_test \ - rwlock_test \ - safe_test \ - siphash_test \ - sockaddr_test \ - spinlock_test \ - stats_test \ - symtab_test \ - tcp_test \ - tcpdns_test \ - time_test \ - timer_test \ - tls_test \ - tlsdns_test \ - udp_test \ - work_test - -if HAVE_LIBNGHTTP2 -check_PROGRAMS += \ - doh_test - -doh_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LIBNGHTTP2_CFLAGS) \ - $(OPENSSL_CFLAGS) - -doh_test_LDADD = \ - $(LDADD) \ - $(LIBNGHTTP2_LIBS) - -doh_test_SOURCES = \ - doh_test.c \ - uv_wrap.h - -endif HAVE_LIBNGHTTP2 - -dnsstream_utils_test_CPPFLAGS = \ - $(AM_CPPFLAGS) - -dnsstream_utils_test_LDADD = \ - $(LDADD) - -dnsstream_utils_test_SOURCES = \ - dnsstream_utils_test.c \ - dnsstream_utils_test_data.h - -hashmap_test_SOURCES = \ - hashmap_test.c \ - hashmap_nodes.h - -hmac_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -hmac_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -md_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -md_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -proxyheader_test_CPPFLAGS = \ - $(AM_CPPFLAGS) - -proxyheader_test_LDADD = \ - $(LDADD) - -proxyheader_test_SOURCES = \ - proxyheader_test.c \ - proxyheader_test_data.h - -proxystream_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -proxystream_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -proxystream_test_SOURCES = \ - proxystream_test.c \ - netmgr_common.h \ - netmgr_common.c \ - stream_shutdown.c - -proxyudp_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -proxyudp_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -proxyudp_test_SOURCES = \ - proxyudp_test.c \ - netmgr_common.h \ - netmgr_common.c \ - uv_wrap.h - -random_test_LDADD = \ - $(LDADD) \ - -lm - -tcp_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -tcp_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -tcp_test_SOURCES = \ - tcp_test.c \ - netmgr_common.h \ - netmgr_common.c \ - stream_shutdown.c \ - uv_wrap.h - -tcpdns_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -tcpdns_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -tcpdns_test_SOURCES = \ - tcpdns_test.c \ - netmgr_common.h \ - netmgr_common.c \ - uv_wrap.h - -tls_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -tls_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -tls_test_SOURCES = \ - tls_test.c \ - netmgr_common.h \ - netmgr_common.c \ - stream_shutdown.c \ - uv_wrap.h - -tlsdns_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -tlsdns_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -tlsdns_test_SOURCES = \ - tlsdns_test.c \ - netmgr_common.h \ - netmgr_common.c \ - uv_wrap.h - -udp_test_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(OPENSSL_CFLAGS) - -udp_test_LDADD = \ - $(LDADD) \ - $(OPENSSL_LIBS) - -udp_test_SOURCES = \ - udp_test.c \ - netmgr_common.h \ - netmgr_common.c \ - uv_wrap.h - -EXTRA_DIST = testdata - -include $(top_srcdir)/Makefile.tests diff --git a/tests/isc/meson.build b/tests/isc/meson.build new file mode 100644 index 0000000000..78da74ac11 --- /dev/null +++ b/tests/isc/meson.build @@ -0,0 +1,94 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +isc_test = [ + 'ascii', + 'async', + 'buffer', + 'counter', + 'dnsstream_utils', + 'errno', + 'file', + 'hash', + 'hashmap', + 'heap', + 'histo', + 'hmac', + 'ht', + 'job', + 'lex', + 'loop', + 'md', + 'mem', + 'mutex', + 'netaddr', + 'parse', + 'proxyheader', + 'proxystream', + 'proxyudp', + 'quota', + 'radix', + 'random', + 'ratelimiter', + 'regex', + 'result', + 'rwlock', + 'safe', + 'siphash', + 'sockaddr', + 'spinlock', + 'stats', + 'symtab', + 'tcp', + 'tcpdns', + 'time', + 'timer', + 'tls', + 'tlsdns', + 'udp', + 'work', +] + +if config.has('HAVE_NGHTTP2') + isc_test += 'doh' +endif + +foreach unit : isc_test + test_bin = executable( + unit, + files( + f'@unit@_test.c', + 'netmgr_common.c', + 'stream_shutdown.c', + ), + build_by_default: false, + export_dynamic: true, + install: false, + dependencies: [ + libisc_dep, + libtest_dep, + + m_dep, + openssl_dep, + + cmocka_dep, + nghttp2_dep, + ], + ) + + test( + unit, + test_bin, + suite: 'isc', + timeout: 300, + workdir: meson.current_source_dir(), + ) +endforeach diff --git a/tests/isccfg/Makefile.am b/tests/isccfg/Makefile.am deleted file mode 100644 index 1a1887d917..0000000000 --- a/tests/isccfg/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) \ - $(LIBUV_CFLAGS) \ - -I$(top_srcdir)/lib/isc - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBISCCFG_LIBS) \ - $(LIBUV_LIBS) - -check_PROGRAMS = \ - duration_test \ - parser_test \ - grammar_test - -include $(top_srcdir)/Makefile.tests diff --git a/tests/isccfg/meson.build b/tests/isccfg/meson.build new file mode 100644 index 0000000000..16ca023f86 --- /dev/null +++ b/tests/isccfg/meson.build @@ -0,0 +1,38 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +foreach unit : [ + 'duration', + 'parser', +] + test_bin = executable( + unit, + files(f'@unit@_test.c'), + build_by_default: false, + export_dynamic: true, + install: false, + dependencies: [ + libisc_dep, + libisccfg_dep, + libtest_dep, + + cmocka_dep, + ], + ) + + test( + unit, + test_bin, + suite: 'isccfg', + timeout: 300, + workdir: meson.current_source_dir(), + ) +endforeach diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am deleted file mode 100644 index 1fe4c57b36..0000000000 --- a/tests/libtest/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBURCU_CFLAGS) \ - $(LIBUV_CFLAGS) \ - -I$(top_srcdir)/lib/isc \ - -I$(top_srcdir)/lib/dns - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBNS_LIBS) - -noinst_LTLIBRARIES = libtest.la - -libtest_la_SOURCES = \ - ../include/tests/isc.h \ - ../include/tests/ns.h \ - ../include/tests/qp.h \ - isc.c \ - ns.c \ - qp.c -if HAVE_CMOCKA -libtest_la_SOURCES += \ - ../include/tests/dns.h \ - dns.c -endif HAVE_CMOCKA - -include $(top_srcdir)/Makefile.tests diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000000..416ba5125c --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,50 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +test_inc = include_directories( + 'include', + '..' / 'lib' / 'isc', + '..' / 'lib' / 'dns', +) + +libtest = shared_library( + 'bindtest', + files( + 'libtest/dns.c', + 'libtest/isc.c', + 'libtest/ns.c', + 'libtest/qp.c', + 'ns/netmgr_wrap.c', + ), + build_by_default: false, + include_directories: test_inc, + dependencies: [ + libdns_dep, + libisc_dep, + libisccfg_dep, + libns_dep, + ], +) + +libtest_dep = declare_dependency( + link_with: libtest, + include_directories: test_inc, +) + +if not cmocka_dep.found() + subdir_done() +endif + +subdir('bench') +subdir('dns') +subdir('isc') +subdir('isccfg') +subdir('ns') diff --git a/tests/ns/Makefile.am b/tests/ns/Makefile.am deleted file mode 100644 index 655bdc835c..0000000000 --- a/tests/ns/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) \ - $(LIBUV_CFLAGS) \ - -I$(top_srcdir)/lib/isc \ - -I$(top_srcdir)/lib/dns - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBDNS_LIBS) \ - $(LIBNS_LIBS) \ - $(LIBUV_LIBS) - -check_PROGRAMS = \ - notify_test \ - plugin_test \ - query_test - -notify_test_SOURCES = \ - notify_test.c \ - netmgr_wrap.c - -query_test_SOURCES = \ - query_test.c \ - netmgr_wrap.c - -EXTRA_DIST = testdata - -include $(top_srcdir)/Makefile.tests diff --git a/tests/ns/meson.build b/tests/ns/meson.build new file mode 100644 index 0000000000..7d4e2e30fa --- /dev/null +++ b/tests/ns/meson.build @@ -0,0 +1,43 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +foreach unit : [ + 'notify', + 'plugin', + 'query', +] + test_bin = executable( + unit, + files(f'@unit@_test.c', 'netmgr_wrap.c'), + build_by_default: false, + export_dynamic: true, + install: false, + dependencies: [ + libisc_dep, + libdns_dep, + libns_dep, + libtest_dep, + + openssl_dep, + + cmocka_dep, + nghttp2_dep, + ], + ) + + test( + unit, + test_bin, + suite: 'ns', + timeout: 300, + workdir: meson.current_source_dir(), + ) +endforeach diff --git a/tests/unit-test-driver.sh.in b/tests/unit-test-driver.sh.in deleted file mode 100644 index 1d35b0e3a4..0000000000 --- a/tests/unit-test-driver.sh.in +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -TOP_BUILDDIR=@abs_top_builddir@ -TOP_SRCDIR=@abs_top_srcdir@ - -if [ -z "${1}" ]; then - echo "Usage: ${0} test_program" >&2 - exit 1 -fi - -TEST_PROGRAM="${1}" -TIMEOUT=300 - -"${TEST_PROGRAM}" & -TEST_PROGRAM_PID=${!} -STATUS=124 -while [ ${TIMEOUT} -gt 0 ]; do - if ! kill -0 "${TEST_PROGRAM_PID}" 2>/dev/null; then - wait "${TEST_PROGRAM_PID}" - STATUS=${?} - break - fi - sleep 1 - TIMEOUT=$((TIMEOUT - 1)) -done -if [ ${TIMEOUT} -eq 0 ]; then - echo "PID ${TEST_PROGRAM_PID} exceeded run time limit, sending SIGABRT" >&2 - kill -ABRT "${TEST_PROGRAM_PID}" 2>/dev/null -fi - -TEST_PROGRAM_NAME=$(basename "${TEST_PROGRAM}") -TEST_PROGRAM_WORK_DIR=$(dirname "${TEST_PROGRAM}") -find "${TEST_PROGRAM_WORK_DIR}" -name 'core*' -or -name '*.core' | while read -r CORE_DUMP; do - BINARY=$(gdb --batch --core="${CORE_DUMP}" 2>/dev/null | sed -n "s/^Core was generated by \`\(.*\)'\.\$/\1/p") - if ! echo "${BINARY}" | grep -q "${TEST_PROGRAM_NAME}\$"; then - continue - fi - echo "I:${TEST_PROGRAM_NAME}:Core dump found: ${CORE_DUMP}" - echo "D:${TEST_PROGRAM_NAME}:backtrace from ${CORE_DUMP} start" - "${TOP_BUILDDIR}/libtool" --mode=execute gdb \ - --batch \ - --command="${TOP_SRCDIR}/bin/tests/system/run.gdb" \ - --core="${CORE_DUMP}" \ - -- \ - "${BINARY}" - echo "D:${TEST_PROGRAM_NAME}:backtrace from ${CORE_DUMP} end" -done - -exit ${STATUS} diff --git a/util/check-make-install.in b/util/check-make-install.in index 2905d2f68d..c65b0b95b1 100644 --- a/util/check-make-install.in +++ b/util/check-make-install.in @@ -14,26 +14,8 @@ abs_top_srcdir=@abs_top_srcdir@ abs_builddir=@abs_builddir@ prefix=@prefix@ -includedir=@includedir@ install_dir="${DESTDIR}@prefix@" -headers_to_install() { - find "${abs_top_srcdir}/lib" -name "*.h" -or -name "*.h.in" | - sed -n \ - -e "s|\.h\.in$|\.h|" \ - -e "s|.*include/|${DESTDIR}${includedir}/|p" | - sort -u -} - -status=0 - -for header in $(headers_to_install); do - if [ ! -f "${header}" ]; then - echo "Missing $header" - status=1 - fi -done - named_binary_path="${install_dir}/sbin/named" if [ ! -x "${named_binary_path}" ]; then echo "ERROR: ${named_binary_path} does not exist or is not executable" @@ -47,7 +29,7 @@ if [ ! -f "${named_man_page_path}" ]; then fi if [ -n "${DESTDIR}" ]; then - for expected_subdir in bin include lib sbin share; do + for expected_subdir in bin lib sbin share; do echo "${install_dir}/${expected_subdir}" >> "${abs_builddir}/expected_dirs" done find "${install_dir}" -maxdepth 1 -mindepth 1 -type d | sort > "${abs_builddir}/existing_dirs" diff --git a/util/dtrace.sh b/util/dtrace.sh index 469b5edf22..eeeb0612d0 100755 --- a/util/dtrace.sh +++ b/util/dtrace.sh @@ -11,7 +11,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -USAGE="# Usage: ${0} [-h | -G] -s File.d [-o ]" +USAGE="# Usage: ${0} [-h] -s File.d [-o ]" mode= while getopts hGs:o: opt; do @@ -19,7 +19,6 @@ while getopts hGs:o: opt; do h) mode=header ;; s) input=$OPTARG ;; o) output=$OPTARG ;; - G) mode=object ;; \?) echo $USAGE exit 1 @@ -44,10 +43,4 @@ case "${mode}" in echo "#define ${PROVIDER}_${PROBE}(...)" done >"${output}" ;; - object) - if test -z "${output}"; then - output="$(basename "${input}" .d).o" - fi - echo "extern int empty;" | gcc -xc -c - -fPIC -DPIC -o "${output}" - ;; esac diff --git a/util/generate-stress-test-configs.py b/util/generate-stress-test-configs.py index 06a7a57546..102e81bae7 100755 --- a/util/generate-stress-test-configs.py +++ b/util/generate-stress-test-configs.py @@ -87,6 +87,7 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): job_platform = "freebsd:amd64" compiler_binary = "clang" flame_binary = "/usr/local/bin/flame" + extra_configure = "--native-file ci/freebsd.ini" else: if "amd64" in platform: job_platform = "linux:amd64" @@ -94,6 +95,7 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): job_platform = "linux:arm64" compiler_binary = "gcc" flame_binary = "/usr/bin/flame" + extra_configure = "" if mode == "rpz": default_traffic_rate = 1500 @@ -109,7 +111,8 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): "stage": "test", "variables": { "CC": compiler_binary, - "CFLAGS": f"{cflags_common} -Og", + "CFLAGS": f"{cflags_common}", + "EXTRA_CONFIGURE": f"{extra_configure}", "EXPECTED_TCP_RESPONSE_RATE": expected_tcp_response_rate, "FLAME": flame_binary, "MODE": mode, @@ -118,11 +121,10 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): "RUN_TIME": runtime, }, "script": [ - "autoreconf -fi", *anchors[".configure"], *anchors[".setup_interfaces"], - f"make -j{build_parallel_jobs} -k all V=1", - f'make DESTDIR="{install_path}" install', + "meson compile -C build", + f"meson install -C build --destdir={install_path}", "git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git", "cd bind9-qa/stress", f'export LD_LIBRARY_PATH="{install_path}/usr/local/lib"', diff --git a/util/meson-dist-package.sh b/util/meson-dist-package.sh new file mode 100644 index 0000000000..ec1d76c4df --- /dev/null +++ b/util/meson-dist-package.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +set -e + +if [ -z "$MESON_DIST_ROOT" ] || [ -z "$MESON_SOURCE_ROOT" ]; then + echo "meson-dist-package.sh must be run inside meson dist!" + exit 1 +fi + +export BIND_BUILD_ROOT=${MESON_BUILD_ROOT} +export BIND_SOURCE_ROOT=${MESON_SOURCE_ROOT} + +generate_man_pages() { + export MESON_PROJECT_VERSION=$1 + + export SPHINX_BUILD=$2 + + if [ -d "${MESON_BUILD_ROOT}/dist-man" ]; then + rm -r "${MESON_BUILD_ROOT}/dist-man" + fi + + $SPHINX_BUILD \ + -W \ + -a \ + -n \ + -q \ + -b man \ + -D "release=${MESON_PROJECT_VERSION}" \ + -D "version=${MESON_PROJECT_VERSION}" \ + -D "today_fmt=%Y-%m-%d" \ + -d "${MESON_BUILD_ROOT}/dist-man-buildroot" \ + -c "${MESON_SOURCE_ROOT}/doc/man" \ + "${MESON_SOURCE_ROOT}/doc/man" \ + "${MESON_BUILD_ROOT}/dist-man" + + for man in ${MESON_BUILD_ROOT}/dist-man/man1/*; do + [ -f "${man}" ] || continue + cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" + done + + for man in ${MESON_BUILD_ROOT}/dist-man/man5/*; do + [ -f "${man}" ] || continue + cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" + done + + for man in ${MESON_BUILD_ROOT}/dist-man/man8/*; do + [ -f "${man}" ] || continue + cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" + done +} + +case $1 in + "source-id") + echo $2 >$MESON_DIST_ROOT/.source-id + ;; + "manual") + generate_man_pages $2 $3 + ;; + *) + echo "invalid usage" + exit 1 + ;; +esac diff --git a/util/meson-glob.sh b/util/meson-glob.sh new file mode 100755 index 0000000000..bd5f6d4968 --- /dev/null +++ b/util/meson-glob.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +set -euo pipefail + +extension= +dir= +while getopts d:e: opt; do + case "$opt" in + e) extension=$OPTARG ;; + d) dir=$OPTARG ;; + \?) + echo "meson-glob.sh -d DIR -e EXTENSION" + exit 1 + ;; + esac +done + +echo "files(" + +pushd ${dir:-.} >/dev/null +for file in ./*.${extension:-c}; do + echo " '${file:2}'," +done +popd >/dev/null + +echo ")" diff --git a/util/meson-system-test-init.sh b/util/meson-system-test-init.sh new file mode 100644 index 0000000000..07ff6f5b28 --- /dev/null +++ b/util/meson-system-test-init.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +if [ -z "$BIND_SOURCE_ROOT" ] || [ -z "$BIND_BUILD_ROOT" ]; then + echo "meson-system-test-init.sh must be run within meson!" + exit 1 +fi + +cp $BIND_BUILD_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR $BIND_SOURCE_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR +cp $BIND_BUILD_ROOT/bin/tests/system/ifconfig.sh $BIND_SOURCE_ROOT/bin/tests/system/ifconfig.sh diff --git a/util/meson.build b/util/meson.build new file mode 100644 index 0000000000..ff9da84d90 --- /dev/null +++ b/util/meson.build @@ -0,0 +1,20 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +configure_file( + input: 'check-make-install.in', + output: 'check-make-install', + configuration: { + 'abs_builddir': meson.project_build_root(), + 'abs_top_srcdir': meson.project_source_root(), + 'prefix': prefix, + }, +) diff --git a/util/pairwise-construct.jq b/util/pairwise-construct.jq new file mode 100755 index 0000000000..3007880137 --- /dev/null +++ b/util/pairwise-construct.jq @@ -0,0 +1,18 @@ +#!/usr/bin/env -S jq -rf + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +.[] + | select((.section == "user") and (.name | IN("rcu-flavor", "geoip", "fuzzing", "doh", "fips", "trace-logging") | not)) + | ["\(.name):", "-D\(.name)=\(.choices[]),"] + | join(" ") + | .[:-1] diff --git a/util/pairwise-testing.sh b/util/pairwise-testing.sh index 960695ad68..7ab00b52a8 100755 --- a/util/pairwise-testing.sh +++ b/util/pairwise-testing.sh @@ -45,26 +45,29 @@ if ! command -v timeout >/dev/null 2>&1; then exit 1 fi -grep -v -F "pairwise: skip" configure.ac | sed -n -E "s|.*# \[pairwise: (.*)\]|\1|p" \ - | while read -r SWITCH; do - echo "${RANDOM}: ${SWITCH}" - done >pairwise-model.txt +meson setup build-pairwise-default + +meson introspect build-pairwise-default --buildoptions | ./util/pairwise-construct.jq >pairwise-model.txt pict pairwise-model.txt | tr "\t" " " | sed "1d" >pairwise-commands.txt +rm -rf build-pairwire-default + while read -r -a configure_switches; do runid=${RANDOM} mkdir "pairwise-${runid}" cd "pairwise-${runid}" echo "Configuration:" "${configure_switches[@]}" | tee "../pairwise-output.${runid}.txt" - ../configure --enable-option-checking=fatal "${configure_switches[@]}" >>"../pairwise-output.${runid}.txt" 2>&1 + meson setup build .. "${configure_switches[@]}" >>"../pairwise-output.${runid}.txt" 2>&1 + # ../configure --enable-option-checking=fatal "${configure_switches[@]}" >>"../pairwise-output.${runid}.txt" 2>&1 echo "Building..." - make "-j${BUILD_PARALLEL_JOBS:-1}" all >>"../pairwise-output.${runid}.txt" 2>&1 + ninja -C build >>"../pairwise-output.${runid}.txt" 2>&1 + # make "-j${BUILD_PARALLEL_JOBS:-1}" all >>"../pairwise-output.${runid}.txt" 2>&1 echo "Running..." echo "${NAMED_CONF}" >named.conf echo "${ZONE_CONTENTS}" >zone.db ret=0 - timeout --kill-after=5s 5s bin/named/named -c named.conf -g >>"../pairwise-output.${runid}.txt" 2>&1 || ret=$? + timeout --kill-after=5s 5s build/named -c named.conf -g >>"../pairwise-output.${runid}.txt" 2>&1 || ret=$? # "124" is the exit code "timeout" returns when it terminates # the command; in other words, the command-under-test times # out, i.e., was still running and didn't crash. @@ -72,8 +75,8 @@ while read -r -a configure_switches; do echo "Unexpected exit code from the 'timeout' utility (${ret})" exit 1 fi + rm -rf build # "timeout" is unable to report a crash on shutdown via its exit # code. cd .. - rm -rf "pairwise-${runid}" "pairwise-output.${runid}.txt" done