[Python] Re: Building extensions with mingw32 -- bdist_wininst fails.

Thomas Heller theller at python.net
Fri Aug 8 09:39:07 EDT 2003


"Chris Gonnerman" <chris.gonnerman at newcenturycomputers.net> writes:

>> > OK, here's the problem.  The distutils bdist_wininst
>> > script calls build (illustrated below) but does not
>> > accept --compiler=mingw32.  This is obviously wrong,
>> > but I'm unsure how to fix it (I'm still trying to wrap
>> > my fuzzy and tired mind around the entire distutils
>> > thing).
>> 
>> 
>> There's an easy workaround.
>> 
>>   python setup.py build --compiler=mingw32 bdist_wininst
>> 
>
> Well, whaddaya know, it works!  Thanks!
>
> I still think the bdist*.py scripts should accept 
> --compiler=mingw32 (or whatever) as a matter of 
> correctness, if nothing else; but I can live with
> this.  Perhaps if I get time I'll work up a patch.

I'm not so convinced that this is needed. I always view the disutils
commands as a stack or chain, and the command line above can be used to
inject flags in vertain places in the chain. the build commands, for
example, accept quite some parameters which are not valid for the
install or (s|b)dist commands (--debug is another example).
So, to install debug versions, one would use
  python setup.py build --debug install
which also looks natural to me.

The --compiler problem may be unique because obviously the build command
constructs a compiler instance even if it has nothing to do, and the
build command is run from bdist_wininst to make sure everything is ok.

Oh, and yet another way, which you may want to try, is to write an
(maybe even site-global) distutils configuration file containing
  [build]
  compiler = mingw32
If this works, you no longer have to remember to give the compiler
option on the command line.

Thomas




More information about the Python-list mailing list