Merge branch 'mesa_7_7_branch'
[mesa.git] / src / gallium / state_trackers / python / SConscript
1 import sys
2 import os.path
3
4 Import('*')
5
6 if 'python' in env['statetrackers']:
7
8 env = env.Clone()
9
10 env.Tool('python')
11
12 env.Tool('swig')
13 env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe'])
14 env.Append(SWIGFLAGS = ['-python', '-keyword'])
15
16 env.Append(CPPPATH = '.')
17
18 if env['platform'] == 'windows':
19 env.Append(LIBS = [
20 'opengl32',
21 'gdi32',
22 'user32',
23 'kernel32',
24 ])
25 else:
26 env.Append(LIBS = [
27 'GL',
28 'X11',
29 ])
30
31 sources = [
32 'gallium.i',
33 'st_device.c',
34 'st_sample.c',
35 ]
36
37 drivers = [
38 trace
39 ]
40
41 if 'llvmpipe' in env['drivers']:
42 env.Tool('llvm')
43 sources += ['st_llvmpipe_winsys.c']
44 drivers += [llvmpipe]
45 else:
46 sources += ['st_softpipe_winsys.c']
47 drivers += [softpipe]
48
49 pyst = env.ConvenienceLibrary(
50 target = 'pyst',
51 source = sources,
52 )
53
54 env['no_import_lib'] = 1
55
56 env.SharedLibrary(
57 target = '_gallium',
58 source = [
59 'st_hardpipe_winsys.c',
60 ],
61 LIBS = [pyst] + drivers + gallium + env['LIBS'],
62 )