fix scons build
[mesa.git] / src / gallium / targets / libgl-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 not set(('softpipe', 'llvmpipe', 'cell')).intersection(env['drivers']):
18 print 'warning: no supported pipe driver: skipping build of xlib libGL.so'
19 Return()
20
21 env = env.Clone()
22
23 env.Append(CPPPATH = [
24 '#/src/mesa',
25 '#/src/mesa/main',
26 '#src/gallium/state_trackers/glx/xlib',
27 ])
28
29 env.Append(CPPDEFINES = ['USE_XSHM'])
30
31 env.Prepend(LIBS = [
32 st_xlib,
33 ws_xlib,
34 trace,
35 identity,
36 glapi,
37 mesa,
38 glsl,
39 gallium,
40 ])
41
42 sources = [
43 'soft_screen.c',
44 'xlib.c',
45 ]
46
47 if 'softpipe' in env['drivers']:
48 env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
49 env.Prepend(LIBS = [softpipe])
50
51 if 'llvmpipe' in env['drivers']:
52 env.Tool('llvm')
53 if 'LLVM_VERSION' in env:
54 env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
55 env.Tool('udis86')
56 env.Prepend(LIBS = [llvmpipe])
57
58 if 'cell' in env['drivers']:
59 env.Append(CPPDEFINES = 'GALLIUM_CELL')
60 env.Prepend(LIBS = [cell])
61
62 # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
63 libgl = env.SharedLibrary(
64 target ='GL',
65 source = sources,
66 )
67
68 if not env['dri']:
69 # Only install this libGL.so if DRI not enabled
70 env.InstallSharedLibrary(libgl, version=(1, 5))