This system notes describe a process to build Kea on NetBSD 7.0.1. I'll first describe the process for "normal" users who only need to install and use a release version of Kea; for developers who need to build (and possibly modify) a development version, I'll add specific process and notes at the end of this memo.

This page explains how to compile Kea from sources. NetBSD does provide yet packages for Kea.

0. Install necessary tools.

Kea depends on several external packages, so you need the standard package system. To use pkg_add you must have in your environment PKG_PATH. The best is to set them in your shell initialisation file. If you don't know:

$ export PKG_PATH http://<nirror>/pub/pkgsrc/packages/NetBSD/<arch>/<NetBSD version>/All

for instance:

$ export PKG_PATH

1. Install necessary dependencies.

We need to install automake, autoconf (which is an automake dependency), autoreconf (which is an autoconf dependency), libtool, pkg-config, boost and log4cplus.

$ pkg_add automake
$ pkg_add libtool
$ pkg_add pkg-config
$ pkg_add boost
$ pkg_add log4cplus

In some older versions the boost meta package does not yet exist and you have to install includes (boost-headers) and libraries (boost-libs).

You need a crypto backend, i.e., either Botan or OpenSSL. If you choose Botan we need to install it (note Botan 1.11 is not compatible):

$ pkg_add botan-1.8.14

git is not strictly necessary (you can use a distrib in a gzipped tar file) but highly recommended:

$ pkg_add git

And if you'd like to run unit tests:

$ pkg_add googletest

2. Optional dependencies.

You can believe you need python3 even it is no longer used by Kea (version 3.5.1 is currently available):

$ pkg_add python35

For generating parsers flex is included, bison is available with a version 3:

$ pkg_add bison

For generating documentation you need docbook, docbook-xsl, libxslt (for xsltproc), elinks and doxygen (which comes with a lot of graphic, X11, TeX, etc):

$ pkg_add docbook
$ pkg_add docbook-xsl
$ pkg_add libxslt
$ pkg_add elinks
$ pkg_add doxygen

3. Download, build, and install Kea.

The following steps are necessary to download sources and install Kea (because of a libtool/configure bug shared libraries don't link):

$ git clone
$ cd kea
$ autoreconf -if
$ ./configure --prefix=/usr/local --with-boost-libs=-lboost_system --with-boost-lib-dir=/usr/pkgl/lib --with-gtest --enable-static-link --disable-shared --without-werror
$ make

and as root:

# make install

Some notes:

  • --without-werror does not make any warnings a fatal error. In general you should not need it but you do not put it and a warning occurs you have to restart from ./configure.
  • if you try boost in the include/header only mode you can (unlikely) get a compilation error, or (unfortunately the likely case) it compiles but tools depending on boost asio do not work correctly (e.g., kea-dhcp-ddns). So I recommend to use the safer library version.
  • in version 7.0.1 (but not 6.1.5) the configure/litool shows a fatal problem (message: Warning: linker path does not have real file for library -lgcc.). 4 solutions:
    • wait for a fix in a new package version (cf. NetBSD GNATS pkg/51311).
    • build with static link: it breaks dynamic shared object (aka hook) load feature but is safe and perhaps you do not need this feature.
    • fix the postdeps definition at the very end of libtool or postdeps_CXX in config.status: remove everything after -lm.
    • allow static runtimes: set to yes either the allow_libtool_libs_with_static_runtimes at the end of libtool or enable_shared_with_static_runtimes_CXX definition in config.status.

If you'd like to understand the two last solutions:

  • autoreconf invokes automake (which builds files from files), libtoolize (which handles libtool), autoconf (which builds configure from, etc.
  • ./configure builds the config.status script and runs it.
  • config.status substitutes @xxx@ variables in files from a configuration file list and configures libtool

So each time you run ./configure the config.statusis regenerated and run. When you run config.status configurable files (mostly Makefile files) and libtool command are updated. So if you patch libtool the patch is erased by sh config.status or ./configure. If you patch config.status the patch is erased by ./configure.

4. Database Backends.

For MySQL:

$ pkg_add mysql-client-5.6.29nb1
$ pkg_add mysql-server-5.6.29nb1


$ ./configure ... --with-dhcp-mysql=/usr/pkg/bin/mysql_config

For PostgreSQL:

$ pkg_add postgresql95


$ ./configure ... --with-dhcp-pgsql=/usr/pkg/bin/pg_config

The PostgreSQL user pgsql is created with the nologin shell. As you need to do su pgsql you must first change its shell as root:

# chsh pgsql
Last modified 17 months ago Last modified on Jul 10, 2016, 2:59:38 PM