Merge branch '7.8'
[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 'xlib.c',
44 ]
45
46 if 'softpipe' in env['drivers']:
47 env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
48 env.Prepend(LIBS = [softpipe])
49
50 if 'llvmpipe' in env['drivers']:
51 env.Tool('llvm')
52 if 'LLVM_VERSION' in env:
53 env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
54 env.Tool('udis86')
55 env.Prepend(LIBS = [llvmpipe])
56
57 if 'cell' in env['drivers']:
58 env.Append(CPPDEFINES = 'GALLIUM_CELL')
59 env.Prepend(LIBS = [cell])
60
61 # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
62 libgl = env.SharedLibrary(
63 target ='GL',
64 source = sources,
65 )
66
67 if not env['dri']:
68 # Only install this libGL.so if DRI not enabled
69 env.InstallSharedLibrary(libgl, version=(1, 5))