[botan-devel] build system feature request

john skaller skaller at users.sourceforge.net
Sun Feb 10 17:17:29 EST 2013

On 11/02/2013, at 3:45 AM, Jack Lloyd wrote:

>  I
> made some move towards more of an actual autoconf-like system with
> https://github.com/randombit/tinned but I have not had a chance to
> work on it in a long time, but finishing that and then using it in
> botan was part of the plan - we do need more autoconf-like features,
> but I am not a fan of autoconf or M4, and autoconf doesn't really
> solve the problems I have anyway.

Have a look at fbuild. I think it's available on github as a module
in felix-lang. However the easiest way may be to just grab Felix,
because that not only contains fbuild, but also a (hopefully)
working build script for a complex system.

Maybe the author Erik Tryzelaar will be willing to help.
[Google should find him]

It already does M4'ish things like check for header,
macros, etc, and it works on Windows.

Alternatively just steal what you need, the licence
is FFAU. Roll your own is often the best option.

> OK, in theory I like this. And it would make other builders easier to
> write. But how is it represented to step 3?

Filename format: must be relative to the repository.
You can choose either native format or Unix.
On Windows native is like a\b but Unix is a/b,
so the Unix format is platform independent.
The client reading the filenames is responsible for
translation in both cases: with native format they may
have to add a prefix, eg the local repository location
relative to the current directory: because of this Unix
format is appealing, since the client has to translate
the names anyhow, and it means the Botan script
doesn't need to worry.

In Felix, the system is messy. Felix copies
some files to the build directory but not others. I hate this
but the repository, build, and installation layouts are all different.

So lets assume I will copy all the files required to build
Botan as a single library, then 

(1) I need a list of *.cpp files.

(2) I need a list of header files for building

(3) I need a list of header files for installing

The hard bit: include path. I don't know the full answer
to this one. To compile files, I need to copy the header
files somewhere AND tell the compiler where they are
using an include path. 

This is easy if you're includes are like:

	#include "header.hpp"
	#include <header.hpp>

but if you include like:

	#include <botan/header.hpp>

its harder because the include path isn't where the files are,
but one level up.

One solution to this is to elide step (2) and just provide an include
path into the repository. Eg Python like:

	include_path = "botan/private/includes"

I have this problem in Felix. I have modules like


which contain *.cpp files and *.hpp files. However the *cpp files
can include headers from other modules. So I copy all the headers
into a single place and set the path to that. I try to enforce the

	#include "felixheader.hpp"

so this works. If a header says

	#include "gc/header.hpp"

then I have to copy 

	repo/gc/header.hpp -> build/include/gc/header.hpp

I'd be interested in any enlightenment on this problem.
Again the problem is: your sources are divided into
modules but build result, even if each module makes
a separate library, will have all the headers gathered
out of subdirectories into a single place.

john skaller
skaller at users.sourceforge.net

More information about the botan-devel mailing list