[ccan] embedding ccan in other projects redux

Naveen Nathan naveen at lastninja.net
Tue Aug 18 17:03:16 AEST 2015


Earlier I had started a discussion about how to approach embedding
specific ccan modules into a Python C extension project. I discussed
the options available with David Gibson over IRC. This email
serves to bring the conversation back to this mailing list.

Two distinct issues were discussed:

(1) ccan modules shouldn't implicitly include a "config.h" for their config.

Another way to say this is each ccan module should stand alone with no shared
dependencies. Instead a top-level build/configurator system will generate the
needed config.h files and glue. In the case of ccan this is done by
specifying the -include compiler directive in the Makefiles.


(2) creating a pathway to make ccan modules embeddable

Instead of an overhaul of the existing build system we can make incremental
progress to allow flexible embedding of ccan into other projects. A few
steps were discussed:

 * Adapt the ccan makefile for easier embedding, so it will just attempt
   to build those modules that are present
 * Implement (1) for ccan using -include directives
 * Make a ccan tool to spit out all config variables used by a module
   (and its dependencies?)
 * Document the existing ccan config options
 * [possible] generate files to help autoconf systems (such as aclocal defs)

I can potentially see create-ccan-tree used as a way to create a
separate ccan tree with a skeleton build environment and specified modules
and dependencies.

Projects embedding ccan would then import the tree into the project,
use the existnig configurator to generate a config.h (or create their own),
or potenitally use supplied aclocal defs.

Sorry if this is a bit long-winded. Would like to hear thoughts or see
if we're missing anything crucial.

Thanks,
Naveen


More information about the ccan mailing list