overriding build options
Hi, 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? thanks in advance, --keith ---------------------------------------------------------------- Keith R. Jackson KRJackson@lbl.gov Secure Grid Technologies Group (510) 486-4401 Lawrence Berkeley National Laboratory http://www-itg.lbl.gov/~kjackson/
Keith Jackson (DSD staff) wrote:
Hi, 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?
AFAIK, there is none. These options are read from Python's own Makefile in sysconfig.customize_compiler(compiler). Of course, you can start subclassing distutils as I did in mxSetup.py of the egenix-mx-base package to tweak that API into doing whatever you like :-) -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/
That's what I was afraid of. It sure seems like a simple way to override the compile options from the python build would be nice. --keith M.-A. Lemburg wrote:
Keith Jackson (DSD staff) wrote:
Hi, 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?
AFAIK, there is none. These options are read from Python's own Makefile in sysconfig.customize_compiler(compiler).
Of course, you can start subclassing distutils as I did in mxSetup.py of the egenix-mx-base package to tweak that API into doing whatever you like :-)
-- ---------------------------------------------------------------- Keith R. Jackson KRJackson@lbl.gov Secure Grid Technologies Group (510) 486-4401 Lawrence Berkeley National Laboratory http://www-itg.lbl.gov/~kjackson/
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 = sysconfig.get_config_vars() cv["OPT"] = cv["OPT"].replace("-O3", "") Call this before calling setup(). And yes, you will burn in hell for it! :) Ciao, Jürgen -- Jürgen Hermann, Developer WEB.DE AG, http://webde-ag.de/
participants (3)
-
Juergen Hermann -
Keith Jackson (DSD staff) -
M.-A. Lemburg