[Distutils] overriding build options

Juergen Hermann Juergen Hermann" <jh@web.de
Thu Dec 12 06:45:02 2002


On Wed, 11 Dec 2002 14:35:15 -0800, Keith Jackson (DSD staff) wrote:

>I've got what might be a simple question, but I haven't found an answer=
 
>yet. The default python build with gcc uses "-Wall" and 
>"-fstrict-prototypes". I'd like to be able to build extension modules 
>without these flags. SWIG generated code throws a lot of warnings, as 
>does the libraries I'm wrapping, and it makes it very hard for users to=
 
>see what is actually going on. What is the right way to remove these 
>from the compile command?

A quick and quite dirty way is this:

from distutils import sysconfig
cv =3D sysconfig.get_config_vars()
cv["OPT"] =3D cv["OPT"].replace("-O3", "")

Call this before calling setup().

And yes, you will burn in hell for it! :)



Ciao, J=FCrgen

--
J=FCrgen Hermann, Developer
WEB.DE AG, http://webde-ag.de/