Work around a WAF bug in failing to recognize GCC while detecting CXXFLAGS for compiling Python extensions.

This commit is contained in:
Gustavo J. A. M. Carneiro
2008-10-31 22:47:29 +00:00
parent a97b740785
commit ccd6e796cd

View File

@@ -118,6 +118,14 @@ def configure(conf):
conf.report_optional_feature("python", "Python Bindings", False, str(ex))
return
# Fix a bug with WAF and g++ 4.3.2 (it does not include "(GCC") in
# the output of g++ --version, so the WAF python detection fails
# to recognize it is gcc)
gcc_version = os.popen("%s --version" % conf.env['CXX']).readline()
if '(GCC)' in gcc_version or 'g++' in gcc_version:
conf.env.append_value('CXXFLAGS_PYEMBED','-fno-strict-aliasing')
conf.env.append_value('CXXFLAGS_PYEXT','-fno-strict-aliasing')
## Check for pybindgen
if Params.g_options.pybindgen_checkout:
fetch_pybindgen(conf)