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>
env['msvc'] = env['CC'] == 'cl'
env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
env['clang'] = env['CC'] == 'clang'
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
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
# MSVC x64 support is broken in earlier versions of scons
gcc = env['gcc']
msvc = env['msvc']
suncc = env['suncc']
gcc = env['gcc']
msvc = env['msvc']
suncc = env['suncc']
# Determine whether we are cross compiling; in particular, whether we need
# to compile code generators with a different compiler as the target code.
# Determine whether we are cross compiling; in particular, whether we need
# to compile code generators with a different compiler as the target code.
cflags += [
'-Wdeclaration-after-statement',
]
cflags += [
'-Wdeclaration-after-statement',
]
+ if icc:
+ cflags += [
+ '-std=gnu99',
+ ]
if msvc:
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
if msvc:
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
-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',
env.Append(CCFLAGS = ['-fvisibility=hidden'])
env.Append(CPPDEFINES = [
'HAVE_STDINT_H',