[Distutils] Brewing controversy over header file installation

Greg Ward gward@python.net
Fri Sep 15 21:40:01 2000

On 15 September 2000, Mark W. Alexander said:
> Since the python tree already contains stuff to do C modules, I 
> don't see anything at all "wrong" with putting additional stuff
> there for use by C developers. I'm just questioning whether it's
> something that distutils should be responsible for. I think the
> answer is a definite maybe. It seems like a lot of effort to
> provide something that may not be a good fit.

Installing C headers is definitely something the Distutils has to do.
Just as people write modules that depend on other modules, they also
write extensions that depend on other extensions.  In C, that kind of
dependence usually means two things: include a header file and link
against a library.  In the specialized domain of writing Python
extensions in C, I *think* all the header file is the only problem; the
linking issue will be taken care of when both extensions are loaded into
the Python interpreter.  (This is merely informed speculation; I've
never actually written an extension that depends on facilities provided
by another extension!  Things could well be different on platforms that
don't follow the usual Unix model of shared libraries, where .so files
can depend on each other, but the dependencies don't have to be resolved
until load-time.)

That's why the "install" command can install C header files (using the
"install_headers" command).  We install .py and .so/.pyd files because
they will be needed by Python programmers writing Python modules and
applications; we install .h files because they might be needed by C
programmers writing Python extensions.  We doesn't install any C
libraries, either shared or static, because I have not yet seen a need
for them.