[Distutils] Proposed change to ccompiler classes

Stefan Seefeld seefeld at sympatico.ca
Thu Nov 6 15:57:54 EST 2003

Thomas Heller wrote:

> I can see two solutions:
> - Enhance the compiler classes with a method which will bring the files
> into the correct order, then make sure that they are actually compiled
> in this order.
> - Change the code so that the files are compiled in the order of the
> sequence passed to the compiler, and let the setup script writer take
> care that the order is correct.
> The latter is the easiest option, and this change would enable this -
> although it must be done in each compiler class:
>     #for obj, (src, ext) in build.items():
>     for obj in objects:
>         try:
>             src, ext = build[obj]
>         except KeyError:
>             continue
>         ....
> Any thoughts?

Yes, the second solution looks like the right thing to do. May I add
another RFE here that somewhat relates to your proposal:

Right now an 'Extension' is basically a flat list of files, to which
some parameters are associated, specifying the build procedure.
I'v had to work with code (all belonging to the same 'extension
module'), where some files needed other compiler options than the
Would it be possible to allow 'Extensions' to be composed not only
of files, but of 'sub extensions' ? Each such 'sub extension' would
contain its own parameters (possibly inheriting default values from
their parent), and the final link stage would just combine all the
thusly generated .o files into one module.
That seems completely doable, and even fully backward compatible.
Of course, there, too, the order of execution may be important.

Comments ?


More information about the Distutils-SIG mailing list