I'd prefer not to *require* a .DEF file, since by convention most people will name their module initialization function "init" + modulename. The compiler class can then generate the def-file on the fly (if needed) and
use
it appropriately. The terminally clever developer who wants the (private) name of his module initialization function to be something else would be required to provide a .DEF file which exports that function as "init" + module, though -- there's obviously no way for distutils to guess that.
Is this possible? I think when you 'import extension' python looks for extension.dll or extension.pyd, then tries to locate and call 'void initextension (void)' and will fail if this is not found.
By the way: again unlike Microsoft, Borland's linker prepends an
underscore
to exported functions' names, so the automatically-generated .DEF file for BorlandCCompiler will need to look something like this:
EXPORTS initmodule=_initmodule More reason to generate the def-file.
BTW: If you change the CCompiler (and derived classes) function signatures I'm willing to test this for the MS case. Another reason to update my distutils... Thomas