From ccd6e796cd8887eeb0db0929b0e68215ce89dcaa Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Fri, 31 Oct 2008 22:47:29 +0000 Subject: [PATCH] Work around a WAF bug in failing to recognize GCC while detecting CXXFLAGS for compiling Python extensions. --- bindings/python/wscript | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bindings/python/wscript b/bindings/python/wscript index 4efa378e8..cab9e6b56 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -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)