install_headers command support

Bug #138266 reported by Martijn Faassen on 2007-09-08
Affects Status Importance Assigned to Milestone

Bug Description

distutils supports a command install_headers. If any C headers are listed in the 'headers' section in, these will be installed. The default behavior of distutils is to try to create a new '/usr/include/python2.x/<mypackagename>' directory (but the install-dir option can be used to control where these end up). Other extensions can then import these C headers by using #include "<mypackagename>/<myheader.h>".

I imagine buildout has no support for this. I would therefore like to request such support. :)

We could have a new section in [buildout] that lists all the eggs that need their headers installed. These headers will then be placed in a special 'headers-directory' in buildout (which can also be modified by placing 'headers-directory' in the [buildout] section).

That takes care of header installation. Now as to how to use them. These headers are typically needed during the extension build process. An extension can then access the C headers of an extension during its own build process.

If the system can track which headers were installed by which egg somehow, we could place these headers on the C include path during build. Alternatively and more simply we could simply place the entire headers-directory on the C include path always, though this might lead to versioning issues.

If don't need precise control over versions (the simpler solution) would have a layout of the headers-directory as follows:


headers-directory would then be placed on the include path.

If we need precise control of versions we'd instead want something like this:


where package_a-1.3 etc are placed on the include path.

I do not know whether any special care about linking needs to be taken - I haven't set things up that far yet. Since everything will be linked together dynamically I think we should be fine as long as python extensions can share headers.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers