Merge branch 'mesa_7_7_branch'
[mesa.git] / src / gallium / winsys / xlib / SConscript
1 #######################################################################
2 # SConscript for xlib winsys
3
4 Import('*')
5
6 if env['platform'] != 'linux':
7 Return()
8
9 if 'mesa' not in env['statetrackers']:
10 print 'warning: Mesa state tracker disabled: skipping build of xlib libGL.so'
11 Return()
12
13 if env['dri']:
14 print 'warning: DRI enabled: skipping build of xlib libGL.so'
15 Return()
16
17 if 'trace' not in env['drivers']:
18 print 'warning: trace pipe driver disabled: skipping build of xlib libGL.so'
19 Return()
20
21 if not set(('softpipe', 'llvmpipe', 'trace')).intersection(env['drivers']):
22 print 'warning: no supported pipe driver: skipping build of xlib libGL.so'
23 Return()
24
25 env = env.Clone()
26
27 env.Append(CPPPATH = [
28 '#/src/mesa',
29 '#/src/mesa/main',
30 '#src/gallium/state_trackers/glx/xlib',
31 ])
32
33 env.Append(CPPDEFINES = ['USE_XSHM'])
34
35 sources = [
36 'xlib.c',
37 ]
38
39 drivers = [trace]
40
41 if 'softpipe' in env['drivers']:
42 env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
43 sources += ['xlib_softpipe.c']
44 drivers += [softpipe]
45
46 if 'llvmpipe' in env['drivers']:
47 env.Tool('llvm')
48 if 'LLVM_VERSION' in env:
49 env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
50 env.Tool('udis86')
51 sources += ['xlib_llvmpipe.c']
52 drivers += [llvmpipe]
53
54 if 'cell' in env['drivers']:
55 env.Append(CPPDEFINES = 'GALLIUM_CELL')
56 sources += ['xlib_cell.c']
57 drivers += [cell]
58
59 # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
60 libgl = env.SharedLibrary(
61 target ='GL',
62 source = sources,
63 LIBS = st_xlib + glapi + mesa + glsl + drivers + gallium + env['LIBS'],
64 )
65
66 if not env['dri']:
67 # Only install this libGL.so if DRI not enabled
68 env.InstallSharedLibrary(libgl, version=(1, 5))