aboutsummaryrefslogtreecommitdiff
path: root/mesalib/scons/llvm.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-05-18 14:43:25 +0200
committermarha <marha@users.sourceforge.net>2014-05-18 14:43:25 +0200
commita27ca45b676116ebbce31973bc1a319cad76ffbf (patch)
tree098711ced704936739bc91abbd75942a815d89db /mesalib/scons/llvm.py
parent0b89941658d6117d17555ee28c6e5d7715673705 (diff)
parent55cf29d7f748b814a2b8eb016fbf15635d56aa53 (diff)
downloadvcxsrv-a27ca45b676116ebbce31973bc1a319cad76ffbf.tar.gz
vcxsrv-a27ca45b676116ebbce31973bc1a319cad76ffbf.tar.bz2
vcxsrv-a27ca45b676116ebbce31973bc1a319cad76ffbf.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/glsl/builtin_functions.cpp
Diffstat (limited to 'mesalib/scons/llvm.py')
-rw-r--r--mesalib/scons/llvm.py57
1 files changed, 13 insertions, 44 deletions
diff --git a/mesalib/scons/llvm.py b/mesalib/scons/llvm.py
index 134a0728e..cdfbe4370 100644
--- a/mesalib/scons/llvm.py
+++ b/mesalib/scons/llvm.py
@@ -37,6 +37,9 @@ import SCons.Errors
import SCons.Util
+required_llvm_version = '3.1'
+
+
def generate(env):
env['llvm'] = False
@@ -84,6 +87,9 @@ def generate(env):
if llvm_version is None:
print 'scons: could not determine the LLVM version from %s' % llvm_config
return
+ if llvm_version < distutils.version.LooseVersion(required_llvm_version):
+ print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version)
+ return
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
env.AppendUnique(CPPDEFINES = [
@@ -104,8 +110,8 @@ def generate(env):
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport', 'LLVMRuntimeDyld', 'LLVMObject'
])
- elif llvm_version >= distutils.version.LooseVersion('3.0'):
- # 3.0
+ else:
+ # 3.1
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
@@ -116,46 +122,6 @@ def generate(env):
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport'
])
- elif llvm_version >= distutils.version.LooseVersion('2.9'):
- # 2.9
- env.Prepend(LIBS = [
- 'LLVMObject', 'LLVMMCJIT', 'LLVMMCDisassembler',
- 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
- 'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
- 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
- 'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
- 'LLVMSelectionDAG', 'LLVMX86Utils', 'LLVMX86Info', 'LLVMAsmPrinter',
- 'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
- 'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
- 'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
- 'LLVMCore', 'LLVMMC', 'LLVMSupport',
- ])
- elif llvm_version >= distutils.version.LooseVersion('2.7'):
- # 2.7
- env.Prepend(LIBS = [
- 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
- 'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
- 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
- 'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
- 'LLVMSelectionDAG', 'LLVMX86Info', 'LLVMAsmPrinter',
- 'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
- 'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
- 'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
- 'LLVMMC', 'LLVMCore', 'LLVMSupport', 'LLVMSystem',
- ])
- else:
- # 2.6
- env.Prepend(LIBS = [
- 'LLVMX86AsmParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
- 'LLVMX86Info', 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
- 'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
- 'LLVMDebugger', 'LLVMBitWriter', 'LLVMAsmParser',
- 'LLVMArchive', 'LLVMBitReader', 'LLVMSelectionDAG',
- 'LLVMAsmPrinter', 'LLVMCodeGen', 'LLVMScalarOpts',
- 'LLVMTransformUtils', 'LLVMipa', 'LLVMAnalysis',
- 'LLVMTarget', 'LLVMMC', 'LLVMCore', 'LLVMSupport',
- 'LLVMSystem',
- ])
env.Append(LIBS = [
'imagehlp',
'psapi',
@@ -180,6 +146,10 @@ def generate(env):
llvm_version = env.backtick('llvm-config --version').rstrip()
llvm_version = distutils.version.LooseVersion(llvm_version)
+ if llvm_version < distutils.version.LooseVersion(required_llvm_version):
+ print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version)
+ return
+
try:
# Treat --cppflags specially to prevent NDEBUG from disabling
# assertion failures in debug builds.
@@ -197,8 +167,7 @@ def generate(env):
components = ['engine', 'bitwriter', 'x86asmprinter']
- if llvm_version >= distutils.version.LooseVersion('3.1'):
- components.append('mcjit')
+ components.append('mcjit')
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')