scons: Fix build with clang.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Vinson Lee 2012-07-24 23:02:18 -07:00
parent cc44aa7749
commit 4f109ca4e8
2 changed files with 3 additions and 2 deletions

View File

@ -140,6 +140,7 @@ def generate(env):
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
env['clang'] = env['CC'] == 'clang'
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
# MSVC x64 support is broken in earlier versions of scons
@ -482,7 +483,7 @@ def generate(env):
env.Append(SHLINKFLAGS = shlinkflags)
# We have C++ in several libraries, so always link with the C++ compiler
if env['gcc']:
if env['gcc'] or env['clang']:
env['LINK'] = env['CXX']
# Default libs

View File

@ -4,7 +4,7 @@ env = env.Clone()
env.PkgUseModules('DRM')
if env['gcc']:
if env['gcc'] or env['clang']:
env.Append(CCFLAGS = ['-fvisibility=hidden'])
env.Append(CPPDEFINES = [
'HAVE_STDINT_H',