[Distutils] Building an intermediate library

Paul Moore gustav@morpheus.demon.co.uk
Sun Jul 15 08:56:00 2001

I have an extension which I am trying to build using distutils. There are=
series of .c files in a subdirectory, and a couple of driver C files. The
subdirectory files should, ideally, be compiled and then built into a =
.lib file, which is then linked with the 2 individual driver files to =
create two
.pyd extensions. I can do the build by listing all of the subdirectory .c=
in the build instructions for the 2 .pyds, but if I do this, the compiler=
doesn't seem to eliminate unused object files. So either I need to list =
the right .c files for each extension, or I build the intermediate .lib.

The problem is, I can't work out if it is possible to persuade distutils =
build an intermediate library like this. Is it possible? If so, can =
anyone point
me to any suitable examples of what to do? (Or alternatively, point me at=
appropriate parts of the source, and appropriate example setup.py files, =
allow me to work out how to do this for myself.)