2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 01:59:26 +00:00
bind/doc/arm/build.inc.rst
Aydın Mercan 5cd6c173ff
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.
2025-06-11 10:30:12 +03:00

158 lines
6.6 KiB
ReStructuredText

.. 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.
.. _build_bind:
Building BIND 9
---------------
To build on a Unix or Linux system, use:
::
$ meson setup build-dir
$ meson compile -C build-dir
Several environment variables affect compilation, and they can be set
before running ``meson setup``. The most significant ones are:
+--------------------+-------------------------------------------------+
| Variable | Description |
+====================+=================================================+
| ``CC`` | The C compiler to use. ``configure`` tries to |
| | figure out the right one for supported systems. |
+--------------------+-------------------------------------------------+
| ``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. |
+--------------------+-------------------------------------------------+
.. _build_dependencies:
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 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)
must be compiled, configured and used directly in the OpenSSL 3.x.
The Userspace RCU library ``liburcu`` (https://liburcu.org/) is used
for lock-free data structures and concurrent safe memory reclamation.
On Linux, process capabilities are managed in user space using the
``libcap`` library
(https://git.kernel.org/pub/scm/libs/libcap/libcap.git/), which can be
installed on most Linux systems via the ``libcap-dev`` or
``libcap-devel`` package.
Optional Features
~~~~~~~~~~~~~~~~~
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
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, ``-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, 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, 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, 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, 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 ``-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`` or use the option ``--pkg-config-path``.
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.
``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 ``meson setup``.
The option ``--sysconfdir`` can be specified to set the directory where
configuration files such as :iscman:`named.conf` go by default;
``--localstatedir`` can be used to set the default parent directory of
``run/named.pid``. ``--sysconfdir`` defaults to ``$prefix/etc`` and
``--localstatedir`` defaults to ``$prefix/var``.
macOS
~~~~~
Building on macOS assumes that the “Command Tools for Xcode” are
installed. These can be downloaded from
https://developer.apple.com/xcode/resources/ or, if Xcode is already
installed, simply run ``xcode-select --install``. (Note that an Apple ID
may be required to access the download page.)