[ccan] Using ccan with a C python extension

David Gibson david at gibson.dropbear.id.au
Wed Jun 24 11:55:23 AEST 2015


On Tue, Jun 23, 2015 at 09:26:20PM +0930, Paul 'Rusty' Russell wrote:
> Naveen Nathan <naveen at lastninja.net> writes:
> >> >         I think you should use autoconf, as it's the standard.  I keep
> >> > hoping someone will write the autotools stuff for CCAN for me :)
> >
> > Yep, autotools for ccan makes sense, certainly a lot easier to work with
> > than the current ad-hoc configure program which also needs compilation.
> > I want to explore this option further.
> 
> It would be possible to make the current config.h use #ifdef tests for
> most things.  The problem is that it would only work on Linux + glibc,
> since I don't test on anything else.
> 
> And even that's problematic.  For GCC defines it's easy.  For glibc
> detection, you need to include <features.h>.  But you need to know if
> that exists first.  Though uclibc on linux seems to have it, so maybe
> testing __linux would work...
> 
> If I had an active community on different platforms, we could have fun
> trying to create the ultimate config.h.  But without that I fear we'd
> end up less portable than the current "try it" approach of configurator,
> and then have even fewer non-Linux users :(
> 
> IOW, please send autoconf macros to create config.h.  You can skip
> CCAN_COMPILER and CCAN_CFLAGS: they're hacks for ccanlint which should
> die.

Actually I did have one thought on this.

Maybe it would make sense for all the ccan files to *not* #include
config.h, and instead in the ccan makefiles and ccanlint force include
it with -include.  This gives embedding projects two options:

    a) Have the ccan modules include their own project's config.h
       (generated however they generate it), once they've added
       autoconf or whatever magic to generate all the config symbols
       that ccan needs

    b) Generate a ccan_config.h separately (perhaps by invoking the
       ccan configurator), and -include that for the ccan modules,
       leaving whatever configuration they use for the rest of their
       project independent

Either way, we want better tools for letting embedding projects
generate the necessary Makefile fragments and what have you for
building the ccan modules.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20150624/7fd93388/attachment.sig>


More information about the ccan mailing list