summaryrefslogtreecommitdiff
path: root/scons/gallium.py
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-02-27 15:42:23 +0000
committerJose Fonseca <jfonseca@vmware.com>2015-03-02 14:23:51 +0000
commitfa5140bb18422da570958a58a4bd0cec718402e7 (patch)
tree73e075959fb9533cd00336aa1c0d503e3e6369dd /scons/gallium.py
parent9a07435ff885277aba670eb59c039a748175c702 (diff)
scons: Fix HAVE___* definition.
These definitions must be moved before `cppdefines` is used to have effect. Trivial.
Diffstat (limited to 'scons/gallium.py')
-rwxr-xr-xscons/gallium.py47
1 files changed, 23 insertions, 24 deletions
diff --git a/scons/gallium.py b/scons/gallium.py
index 51955087125..711aa3b1c7b 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -342,6 +342,29 @@ def generate(env):
print 'warning: Floating-point textures enabled.'
print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.'
cppdefines += ['TEXTURE_FLOAT_ENABLED']
+ if gcc_compat:
+ ccversion = env['CCVERSION']
+ cppdefines += [
+ 'HAVE___BUILTIN_EXPECT',
+ 'HAVE___BUILTIN_FFS',
+ 'HAVE___BUILTIN_FFSLL',
+ 'HAVE_FUNC_ATTRIBUTE_FLATTEN',
+ ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3'):
+ cppdefines += [
+ 'HAVE_FUNC_ATTRIBUTE_FORMAT',
+ 'HAVE_FUNC_ATTRIBUTE_PACKED',
+ ]
+ 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']
env.Append(CPPDEFINES = cppdefines)
# C compiler options
@@ -584,30 +607,6 @@ 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',
- 'HAVE_FUNC_ATTRIBUTE_FLATTEN',
- ]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3'):
- cppdefines += [
- 'HAVE_FUNC_ATTRIBUTE_FORMAT',
- 'HAVE_FUNC_ATTRIBUTE_PACKED',
- ]
- 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')