Choosing a new build system for Samba

tridge at tridge at
Thu Apr 1 23:24:30 MDT 2010

Hi Andreas,

 > What we should support is a complete out of source build. 

I agree in principle.

Unfortunately the problem with supporting an out of source build
actually has very little to do with the build system itself. The
problem is that we have a lot of generated code in our source tree,
which forces us to re-generate on updates to the dependencies by
writing into the source tree.

The main culprit is the librpc/gen_ndr/ directory, but we also have
generated code in heimdal, and pidl (the yapp parsers) and a few other

The second problem is the number of places (particularly in our test
suite) that rely on "../foo" type paths to find pieces of the source
tree from the build directory. Those can all be fixed, but it will
take time.

For now what I've done with the waf build is a compromise that tries
to move as much stuff as possible into a build directory, while
maintaining compatibility with the existing build system. With waf you
can do complete out of tree builds (eg. building in /tmp/build), but I
have chosen instead to put the build in bin/. All object files,
generated headers etc go into bin, so that the simplest method to do a
"make distclean" is "rm -rf bin".

This is compatible with our existing build system, while also
minimising the cluttering of the source tree with build files.

If at some point in the future we move away from having librpc/gen_ndr
and other generated files committed in git then it will be possible
for us to support a full out of tree build. Until that happens though
I think the "everything in bin" compromise is the best we can do.

Cheers, Tridge

More information about the samba-technical mailing list