scons: Fix xlib build.
[mesa.git] / src / gallium / winsys / xlib / SConscript
1 #######################################################################
2 # SConscript for xlib winsys
3
4 Import('*')
5
6 if env['platform'] == 'linux' \
7 and 'mesa' in env['statetrackers'] \
8 and set(('softpipe', 'llvmpipe', 'i915', 'trace')).intersection(env['drivers']) \
9 and not env['dri']:
10
11 env = env.Clone()
12
13 env.Append(CPPPATH = [
14 '#/src/mesa',
15 '#/src/mesa/main',
16 '#src/gallium/state_trackers/glx/xlib',
17 ])
18
19 env.Append(CPPDEFINES = ['USE_XSHM'])
20
21 sources = [
22 'xlib.c',
23 ]
24
25 drivers = []
26
27 if 'softpipe' in env['drivers']:
28 env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
29 sources += ['xlib_softpipe.c']
30 drivers += [softpipe]
31
32 if 'llvmpipe' in env['drivers']:
33 env.Tool('llvm')
34 if 'LLVM_VERSION' in env:
35 env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
36 env.Tool('udis86')
37 sources += ['xlib_llvmpipe.c']
38 drivers += [llvmpipe]
39
40 if 'cell' in env['drivers']:
41 env.Append(CPPDEFINES = 'GALLIUM_CELL')
42 sources += ['xlib_cell.c']
43 drivers += [cell]
44
45 if 'trace' in env['drivers']:
46 env.Append(CPPDEFINES = 'GALLIUM_TRACE')
47 sources += ['xlib_trace.c']
48 drivers += [trace]
49
50 # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
51 libgl = env.SharedLibrary(
52 target ='GL',
53 source = sources,
54 LIBS = st_xlib + glapi + mesa + glsl + drivers + auxiliaries + env['LIBS'],
55 )
56
57 env.InstallSharedLibrary(libgl, version=(1, 5))