[Distutils] Customizing for MinGW

andreas.held at smi-grp.com andreas.held at smi-grp.com
Tue Sep 23 07:41:56 EDT 2003


I am distributing an extension that can be built either using MinGW or 
MSVC on Windows.
However, the extension must link against some additional libraries, whose 
name change
depending on the compiler that was used to build them.

For instance, using MSVC I have
# module declarations
module1 = Extension('_MyModule',
and for MinGW I have
# module declarations
module1 = Extension('_MyModule',

Unfortunately, I do not have any influence on the naming of those 
libraries and I wondered
whether I can customize distutils to account for this. Basically, what I 
want is the follwoing
if sys.platform=='win32':
        if compiler=='mingw32':
                libnames= ExtLibOne

How can I obtain the information on what compiler the script was invoked 
with, e.g. I would need the value
of the command line switch '--compiler'? Can this be done at all?

Thanks for your help


Andreas Held

More information about the Distutils-SIG mailing list