
Building From Source
====================

In general, this is a standard autoconf-style project: ./configure && make check && sudo make install

If your starting point is a tarball download, the following prerequisites apply:

* A basically functional POSIX build environment with a C99 compiler
* libev headers and libraries, version 4.x: distro pkg or http://software.schmorp.de/pkg/libev.html
* Perl 5.8.1 or higher and the perl "pod2man" command for document generation
  (this may be in the package perl-podlaters on some systems)
* liburcu aka userspace-rcu headers and libraries. Use distro pkg or http://lttng.org/urcu/
  (^ optional, but important for performance!)

The following have no real effect on the build or runtime, but are required in order to run the testsuite:

* Perl modules: LWP 5.805+, Socket6, IO::Socket::INET6, HTTP::Daemon

If working directly from a git clone rather than a tarball, in addition to all of the above:

* You may need to install autoconf (2.63+), automake(1.11.1+), and libtool(2.2.6+) packages
* You will need a working copy of Ragel 6.x: http://www.complang.org/ragel/ (or distro package)
* Use "git clean -dfx" to reset to a truly clean state (could wipe local edits!)
* Start with "autoreconf -vi", then ./configure ...

Interesting / Non-standard autoconf options
===========================================

--with-systemd
  Turns on compile-time support for running as a systemd service.
  You want this iff your Linux distribution uses systemd.  If systemd
  is detected at runtime (that is, systemd is booted and it appears
  the gdnsd invocation in question is being executed as part of a
  systemd service), gdnsd will use systemd APIs as appropriate.
  Notably this includes sd_notify() of MAINPID when starting a new
  daemon, logging via sd_journal_printv(), and watchdog support
  (if systemd version is >= 209 and configured in the unit file).

  Note that currently there is no support for gdnsd's standard fast,
  overlapped restart behavior under systemd, as systemd has no
  apparent capability to handle this concept.  "systemctl restart"
  will result in a full shutdown and then a full startup, sequentially,
  and a systemd-started gdnsd can't be fast-restarted from outside
  of systemctl.

--enable-developer
  Builds a debugging build (-g) with a lot of extra gcc warnings
    flags, a large suite of assert()ions, and extra
    informative debug information via STDERR or syslog().
    It also does other excessive runtime checks that really
    slow things down.
  Not generally for production use.  If you just want debug
    symbols, put -g in your CFLAGS.

--with-testport=N
  The test suite needs to be able to bind to 3 consecutive ports
   on 127.0.0.1, starting with port N.  The default is 12345.  If
   this conflicts with some existing service on your machine, change
   it here.

--without-urcu
  Explicitly disable support for liburcu (falls back to pthread locks)

--with-rundir=/some/where
  Set an alternate system-level rundir, e.g. in situations where a Linux
  distro wants to use "/run" in place of "/var/run".
