Initial scons support to build gallivm.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 19 Feb 2008 01:50:39 +0000 (10:50 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 19 Feb 2008 05:01:49 +0000 (14:01 +0900)
Not yet complete.

SConstruct
src/gallium/SConscript
src/gallium/auxiliary/gallivm/SConscript [new file with mode: 0644]

index 4fb51f2e6dfd1fffd2a9100212e1cd1502bf348b..b20f88a303e9ecaf3204b80625ed4ee1442a8565 100644 (file)
@@ -32,6 +32,7 @@ import sys
 opts = Options('config.py')
 opts.Add(BoolOption('debug', 'build debug version', False))
 opts.Add(BoolOption('dri', 'build dri drivers', False))
+opts.Add(BoolOption('llvm', 'use llvm', False))
 opts.Add(EnumOption('machine', 'use machine-specific assembly code', 'x86',
                      allowed_values=('generic', 'x86', 'x86-64')))
 
@@ -55,6 +56,7 @@ else:
 # replicate options values in local variables
 debug = env['debug']
 dri = env['dri']
+llvm = env['llvm']
 machine = env['machine']
 
 # derived options
@@ -66,6 +68,7 @@ Export([
        'debug', 
        'x86', 
        'dri', 
+       'llvm',
        'platform',
        'gcc',
        'msvc',
@@ -159,6 +162,14 @@ if dri:
                'GLX_INDIRECT_RENDERING',
        ])
 
+# LLVM
+if llvm:
+       # See also http://www.scons.org/wiki/UsingPkgConfig
+       env.ParseConfig('llvm-config --cflags --ldflags --libs')
+       env.Append(CPPDEFINES = ['MESA_LLVM'])
+       env.Append(CXXFLAGS = ['-Wno-long-long'])
+       
+
 # libGL
 if 1:
        env.Append(LIBS = [
@@ -214,6 +225,8 @@ build_topdir = 'build'
 build_subdir = platform
 if dri:
        build_subdir += "-dri"
+if llvm:
+       build_subdir += "-llvm"
 if x86:
        build_subdir += "-x86"
 if debug:
index ea55ed2ed55c64029ffaeeec958cbb0456cf102b..c505eee792cf30f64750c89918017f4d1eeafec4 100644 (file)
@@ -13,9 +13,13 @@ SConscript([
        'auxiliary/tgsi/SConscript',
        'auxiliary/cso_cache/SConscript',
        'auxiliary/draw/SConscript',
-       #'auxiliary/gallivm/SConscript',
        'auxiliary/pipebuffer/SConscript',
+])
+
+if llvm:
+       SConscript(['auxiliary/gallivm/SConscript'])
 
+SConscript([
        'drivers/softpipe/SConscript',
        'drivers/i915simple/SConscript',
        'drivers/i965simple/SConscript',
diff --git a/src/gallium/auxiliary/gallivm/SConscript b/src/gallium/auxiliary/gallivm/SConscript
new file mode 100644 (file)
index 0000000..c0aa51b
--- /dev/null
@@ -0,0 +1,16 @@
+Import('*')
+
+gallivm = env.ConvenienceLibrary(
+       target = 'gallivm',
+       source = [
+        'gallivm.cpp',
+        'gallivm_cpu.cpp',
+        'instructions.cpp',
+        'loweringpass.cpp',
+        'tgsitollvm.cpp',
+        'storage.cpp',
+        'storagesoa.cpp',
+        'instructionssoa.cpp',
+       ])
+
+auxiliaries.insert(0, gallivm)