1from sys import executable as python_cmd
2import distutils.version
3
4Import('*')
5
6if not env['llvm']:
7    print 'warning: LLVM disabled: not building llvmpipe'
8    Return()
9
10env = env.Clone()
11
12env.Append(CPPPATH = ['.'])
13
14env.CodeGenerate(
15	target = 'lp_tile_soa.c',
16	script = 'lp_tile_soa.py',
17	source = ['#src/gallium/auxiliary/util/u_format.csv'],
18	command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
19)
20
21# XXX: Our dependency scanner only finds depended modules in relative dirs.
22env.Depends('lp_tile_soa.c', [
23    '#src/gallium/auxiliary/util/u_format_parse.py',
24    '#src/gallium/auxiliary/util/u_format_pack.py',
25])
26
27
28lp_tile_soa_os = env.SharedObject('lp_tile_soa.c')
29
30
31llvmpipe = env.ConvenienceLibrary(
32	target = 'llvmpipe',
33	source = [
34		'lp_bld_alpha.c',
35		'lp_bld_blend.c',
36		'lp_bld_blend_aos.c',
37		'lp_bld_blend_logicop.c',
38		'lp_bld_blend_soa.c',
39		'lp_bld_depth.c',
40		'lp_bld_interp.c',
41		'lp_clear.c',
42		'lp_context.c',
43		'lp_draw_arrays.c',
44		'lp_fence.c',
45		'lp_flush.c',
46		'lp_jit.c',
47		'lp_memory.c',
48		'lp_perf.c',
49		'lp_query.c',
50		'lp_rast.c',
51		'lp_rast_debug.c',
52		'lp_rast_tri.c',
53		'lp_scene.c',
54		'lp_scene_queue.c',
55		'lp_screen.c',
56		'lp_setup.c',
57		'lp_setup_line.c',
58		'lp_setup_point.c',
59		'lp_setup_tri.c',
60		'lp_setup_vbuf.c',
61		'lp_state_blend.c',
62		'lp_state_clip.c',
63		'lp_state_derived.c',
64		'lp_state_fs.c',
65		'lp_state_setup.c',
66		'lp_state_gs.c',
67		'lp_state_rasterizer.c',
68		'lp_state_sampler.c',
69                'lp_state_so.c',
70		'lp_state_surface.c',
71		'lp_state_vertex.c',
72		'lp_state_vs.c',
73		'lp_surface.c',
74		'lp_tex_sample.c',
75		'lp_texture.c',
76		'lp_tile_image.c',
77        lp_tile_soa_os,
78	])
79
80env.Alias('llvmpipe', llvmpipe)
81
82
83if not env['embedded']:
84    env = env.Clone()
85
86    env.Prepend(LIBS = [llvmpipe] + gallium)
87
88    tests = [
89        'format',
90        'blend',
91        'conv',
92        'printf',
93    ]
94
95    if not env['msvc']:
96        tests.append('arit')
97
98    for test in tests:
99        testname = 'lp_test_' + test
100        target = env.Program(
101            target = testname,
102            source = [testname + '.c', 'lp_test_main.c'],
103        )
104        env.InstallProgram(target)
105
106        # http://www.scons.org/wiki/UnitTests
107        alias = env.Alias(testname, [target], target[0].abspath)
108        AlwaysBuild(alias)
109
110Export('llvmpipe')
111