aboutsummaryrefslogtreecommitdiff
path: root/mesalib/scons/gallium.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-03-05 23:40:39 +0100
committermarha <marha@users.sourceforge.net>2015-03-05 23:42:09 +0100
commitc646056120fe14e4c4ccf81bac5d78d61225a8e8 (patch)
treeba0af42750f0ab6dc4724342a7063835636222b5 /mesalib/scons/gallium.py
parent87e58a93f7248171e736656080069cb65ff56aae (diff)
parent8574eba804031f6b19713f0b02952280730bf62e (diff)
downloadvcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.gz
vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.bz2
vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/drivers/dri/swrast/swrast.c mesalib/src/mesa/main/.gitignore mesalib/src/mesa/main/queryobj.c
Diffstat (limited to 'mesalib/scons/gallium.py')
-rw-r--r--mesalib/scons/gallium.py74
1 files changed, 41 insertions, 33 deletions
diff --git a/mesalib/scons/gallium.py b/mesalib/scons/gallium.py
index 519550871..7533f0651 100644
--- a/mesalib/scons/gallium.py
+++ b/mesalib/scons/gallium.py
@@ -87,6 +87,25 @@ def createInstallMethods(env):
env.AddMethod(install_shared_library, 'InstallSharedLibrary')
+def msvc2013_compat(env):
+ if env['gcc']:
+ env.Append(CCFLAGS = [
+ '-Werror=vla',
+ '-Werror=pointer-arith',
+ ])
+
+def msvc2008_compat(env):
+ msvc2013_compat(env)
+ if env['gcc']:
+ env.Append(CFLAGS = [
+ '-Werror=declaration-after-statement',
+ ])
+
+def createMSVCCompatMethods(env):
+ env.AddMethod(msvc2013_compat, 'MSVC2013Compat')
+ env.AddMethod(msvc2008_compat, 'MSVC2008Compat')
+
+
def num_jobs():
try:
return int(os.environ['NUMBER_OF_PROCESSORS'])
@@ -283,6 +302,7 @@ def generate(env):
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
+ '_DEFAULT_SOURCE',
'HAVE_PTHREAD',
'HAVE_POSIX_MEMALIGN',
]
@@ -342,6 +362,25 @@ 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',
+ # GCC 3.0
+ 'HAVE_FUNC_ATTRIBUTE_FORMAT',
+ 'HAVE_FUNC_ATTRIBUTE_PACKED',
+ # GCC 3.4
+ '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
@@ -377,8 +416,7 @@ def generate(env):
'-m32',
#'-march=pentium4',
]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
- and platform != 'haiku':
+ if platform != 'haiku':
# NOTE: We need to ensure stack is realigned given that we
# produce shared objects, and have no control over the stack
# alignment policy of the application. Therefore we need
@@ -419,13 +457,6 @@ def generate(env):
'-Wmissing-prototypes',
'-std=gnu99',
]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
- ccflags += [
- '-Wpointer-arith',
- ]
- cflags += [
- '-Wdeclaration-after-statement',
- ]
if icc:
cflags += [
'-std=gnu99',
@@ -584,30 +615,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')
@@ -617,6 +624,7 @@ def generate(env):
# Custom builders and methods
env.Tool('custom')
createInstallMethods(env)
+ createMSVCCompatMethods(env)
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes', 'glproto >= 1.4.13'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])