scons: Add support for Intel Compiler.
authorVinson Lee <vlee@freedesktop.org>
Wed, 1 Aug 2012 05:55:39 +0000 (22:55 -0700)
committerVinson Lee <vlee@freedesktop.org>
Thu, 2 Aug 2012 04:28:47 +0000 (21:28 -0700)
The patch makes the SCons build with Intel Compiler successful.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
scons/gallium.py
src/gallium/winsys/svga/drm/SConscript

index 458651b4513ebe85b737e80911f123153caf3704..f4776d83d7fbf396e095c4110be0f55e20bdbbdf 100755 (executable)
@@ -141,6 +141,7 @@ def generate(env):
     env['msvc'] = env['CC'] == 'cl'
     env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
     env['clang'] = env['CC'] == 'clang'
+    env['icc'] = 'icc' == os.path.basename(env['CC'])
 
     if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
         # MSVC x64 support is broken in earlier versions of scons
@@ -154,6 +155,7 @@ def generate(env):
     gcc = env['gcc']
     msvc = env['msvc']
     suncc = env['suncc']
+    icc = env['icc']
 
     # Determine whether we are cross compiling; in particular, whether we need
     # to compile code generators with a different compiler as the target code.
@@ -382,6 +384,10 @@ def generate(env):
             cflags += [
                 '-Wdeclaration-after-statement',
             ]
+    if icc:
+        cflags += [
+            '-std=gnu99',
+        ]
     if msvc:
         # See also:
         # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
index 2d511d2bb5e73c983c678d4e2f2c75a09225fc6c..fea9df36824827a409403bd5bccce33f5fb6956c 100644 (file)
@@ -4,7 +4,7 @@ env = env.Clone()
 
 env.PkgUseModules('DRM')
 
-if env['gcc'] or env['clang']:
+if env['gcc'] or env['clang'] or env['icc']:
     env.Append(CCFLAGS = ['-fvisibility=hidden'])
     env.Append(CPPDEFINES = [
         'HAVE_STDINT_H',