Version 1 (modified by ahu, 8 years ago)

--

Getting the latest PowerDNS sources to work on

Most users are well served by our precompiled packages, or those shipped by the Linux/Unix? distribution, and others can compile from the source tarballs available on http://www.powerdns.com/downloads/.

However, to get really involved in PowerDNS development, or to test the latest features, you need to be able to build from the Subversion repository, or apply patches suggested by PowerDNS developers.

The descriptions below are intended for developers or for advanced users willing to experiment!

Applying patches to released versions

To apply a patch, get the clean PowerDNS sources the patch is against. This will generally be the latest version released, as found on http://www.powerdns.com/downloads/.

Patches are generally against a certain directory, so look at the first lines, which look something like this:

Index: dnspacket.hh
===================================================================
--- dnspacket.hh        (revision 456)
+++ dnspacket.hh        (working copy)
@@ -297,12 +297,15 @@

Here we see no directory, so we need to go to the directory containing dnspacket.hh and run:

$ patch -p0 < the-patch

The -p0 bit means "don't strip any paths from the filenames". If the patch had looked like this:

Index: dnspacket.hh
===================================================================
--- pdns/dnspacket.hh        (revision 456)
+++ pdns/dnspacket.hh        (working copy)
@@ -297,12 +297,15 @@

We would have had two choices: use patch -p1 in the directory containing dnspacket.hh, or change to the parent directory, and use patch -p0.

Building from Subversion

To retrieve the latest version, do:

$ svn co svn://svn.powerdns.com/pdns/trunk/pdns pdns
A  pdns/debian
A  pdns/debian/control
A  pdns/debian/pdns.postinst
...

This will generate a directory called pdns, containing the very latest version of our sources.

Building from Subversion

For technical reasons an additional step called 'bootstrapping' is needed before you can compile. In order for this to work you need to have installed:

  • autoconf 2.59
  • automake 1.6 or 1.9.4
  • libtool 1.5.6

On linux you then run the below, on FreeBSD replace ./bootstrap by ./bootstrap.freebsd:

$ ./bootstrap
./bootstrap
Please ignore this warning when you see it:
warning: AC_TRY_RUN called without default to allow cross compiling

/usr/share/aclocal/sigc++.m4:8: warning: underquoted definition of AM_PATH_SIGC
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/usr/share/aclocal/pkg.m4:5: warning: underquoted definition of PKG_CHECK_MODULES
/usr/share/aclocal/gtk.m4:7: warning: underquoted definition of AM_PATH_GTK
/usr/share/aclocal/glib.m4:8: warning: underquoted definition of AM_PATH_GLIB
/usr/share/aclocal/aalib.m4:12: warning: underquoted definition of AM_PATH_AALIB

Afterwards you can run ./configure as usual and build as if from a source tarball.