scons: Use '-Werror=' option on GCC 4.2.x and greater.
authorVinson Lee <vlee@vmware.com>
Wed, 27 Jan 2010 06:56:58 +0000 (22:56 -0800)
committerVinson Lee <vlee@vmware.com>
Wed, 27 Jan 2010 06:56:58 +0000 (22:56 -0800)
The existing code only checked for GCC 4.2.x and 4.3.x.

scons/gallium.py

index 5aa0b7bddd0fb3fcff365f0ba6f785b197a6c694..c88af96898ba96dd2570bc99cc12228c31a3ccd8 100644 (file)
@@ -30,6 +30,7 @@ Frontend-tool for Gallium3D architecture.
 #
 
 
+import distutils.version
 import os
 import os.path
 import re
@@ -276,7 +277,7 @@ def generate(env):
             '-Wmissing-prototypes',
             '-std=gnu99',
         ]
-        if env['CCVERSION'].startswith('4.2.') or env['CCVERSION'].startswith('4.3.'):
+        if distutils.version.LooseVersion(env['CCVERSION']) >= distutils.version.LooseVersion('4.2'):
            ccflags += [
                '-Werror=pointer-arith',
            ]