summaryrefslogtreecommitdiffstats
path: root/scons/gallium.py
diff options
context:
space:
mode:
Diffstat (limited to 'scons/gallium.py')
-rwxr-xr-xscons/gallium.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/scons/gallium.py b/scons/gallium.py
index 1dcfa6b243c..ef6df1ae1a9 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -583,6 +583,24 @@ def generate(env):
env.Append(CCFLAGS = ['-fopenmp'])
env.Append(LIBS = ['gomp'])
+ if gcc_compat:
+ ccversion = env['CCVERSION']
+ cppdefines += [
+ 'HAVE___BUILTIN_EXPECT',
+ 'HAVE___BUILTIN_FFS',
+ 'HAVE___BUILTIN_FFSLL',
+ ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3.4'):
+ cppdefines += [
+ 'HAVE___BUILTIN_CTZ',
+ 'HAVE___BUILTIN_POPCOUNT',
+ 'HAVE___BUILTIN_POPCOUNTLL',
+ 'HAVE___BUILTIN_CLZ',
+ 'HAVE___BUILTIN_CLZLL',
+ ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.5'):
+ cppdefines += ['HAVE___BUILTIN_UNREACHABLE']
+
# Load tools
env.Tool('lex')
env.Tool('yacc')