From bf48447cafc8069839ad41c9c11078c794f4b307 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 22 Oct 2009 19:11:48 +0100 Subject: scons: Hack LLVM support on Windows. Doesn't quite work yet though, as small differences in the compilation flags used when building LLVM and Mesa cause link failures for STL symbols. --- scons/llvm.py | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'scons/llvm.py') diff --git a/scons/llvm.py b/scons/llvm.py index d3293bb404..73e9310f71 100644 --- a/scons/llvm.py +++ b/scons/llvm.py @@ -29,6 +29,7 @@ Tool-specific initialization for LLVM import os import os.path +import sys import SCons.Errors import SCons.Util @@ -39,7 +40,7 @@ def generate(env): llvm_dir = os.environ['LLVM'] except KeyError: # Do nothing -- use the system headers/libs - pass + llvm_dir = None else: if not os.path.isdir(llvm_dir): raise SCons.Errors.InternalError, "Specified LLVM directory not found" @@ -57,7 +58,47 @@ def generate(env): env.PrependENVPath('PATH', llvm_bin_dir) - if env.Detect('llvm-config'): + if env['msvc']: + # XXX: There is no llvm-config on Windows, so assume a standard layout + if llvm_dir is not None: + env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')]) + env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')]) + env.Prepend(LIBS = [ + 'LLVMBitWriter', + 'LLVMCore', + 'LLVMSupport', + 'LLVMSystem', + 'LLVMSupport', + 'LLVMSystem', + 'LLVMCore', + 'LLVMCodeGen', + 'LLVMSelectionDAG', + 'LLVMAsmPrinter', + 'LLVMBitReader', + 'LLVMBitWriter', + 'LLVMTransformUtils', + 'LLVMInstrumentation', + 'LLVMScalarOpts', + 'LLVMipo', + 'LLVMHello', + 'LLVMLinker', + 'LLVMAnalysis', + 'LLVMipa', + 'LLVMX86CodeGen', + 'LLVMX86AsmPrinter', + 'LLVMExecutionEngine', + 'LLVMInterpreter', + 'LLVMJIT', + 'LLVMTarget', + 'LLVMAsmParser', + 'LLVMDebugger', + 'LLVMArchive', + 'imagehlp', + 'psapi', + ]) + env['LLVM_VERSION'] = '2.5' + return + elif env.Detect('llvm-config'): version = env.backtick('llvm-config --version').rstrip() try: -- cgit v1.2.3 From 9e3728c858e0f84b05a24f858f6aeba53fa4e7cb Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 25 Nov 2009 18:06:12 +0000 Subject: scons: Make it work with MinGW build of LLVM 2.6. LLVM 2.5 is no longer supported on windows. --- scons/llvm.py | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'scons/llvm.py') diff --git a/scons/llvm.py b/scons/llvm.py index 73e9310f71..7b26650290 100644 --- a/scons/llvm.py +++ b/scons/llvm.py @@ -58,45 +58,47 @@ def generate(env): env.PrependENVPath('PATH', llvm_bin_dir) - if env['msvc']: + if env['platform'] == 'windows': # XXX: There is no llvm-config on Windows, so assume a standard layout if llvm_dir is not None: env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')]) + env.AppendUnique(CPPDEFINES = [ + '__STDC_LIMIT_MACROS', + '__STDC_CONSTANT_MACROS', + ]) env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')]) env.Prepend(LIBS = [ + 'LLVMX86AsmParser', + 'LLVMX86AsmPrinter', + 'LLVMX86CodeGen', + 'LLVMX86Info', + 'LLVMLinker', + 'LLVMipo', + 'LLVMInterpreter', + 'LLVMInstrumentation', + 'LLVMJIT', + 'LLVMExecutionEngine', + 'LLVMDebugger', 'LLVMBitWriter', - 'LLVMCore', - 'LLVMSupport', - 'LLVMSystem', - 'LLVMSupport', - 'LLVMSystem', - 'LLVMCore', - 'LLVMCodeGen', + 'LLVMAsmParser', + 'LLVMArchive', + 'LLVMBitReader', 'LLVMSelectionDAG', 'LLVMAsmPrinter', - 'LLVMBitReader', - 'LLVMBitWriter', - 'LLVMTransformUtils', - 'LLVMInstrumentation', + 'LLVMCodeGen', 'LLVMScalarOpts', - 'LLVMipo', - 'LLVMHello', - 'LLVMLinker', - 'LLVMAnalysis', + 'LLVMTransformUtils', 'LLVMipa', - 'LLVMX86CodeGen', - 'LLVMX86AsmPrinter', - 'LLVMExecutionEngine', - 'LLVMInterpreter', - 'LLVMJIT', + 'LLVMAnalysis', 'LLVMTarget', - 'LLVMAsmParser', - 'LLVMDebugger', - 'LLVMArchive', + 'LLVMMC', + 'LLVMCore', + 'LLVMSupport', + 'LLVMSystem', 'imagehlp', 'psapi', ]) - env['LLVM_VERSION'] = '2.5' + env['LLVM_VERSION'] = '2.6' return elif env.Detect('llvm-config'): version = env.backtick('llvm-config --version').rstrip() -- cgit v1.2.3