gallium: rename 'state tracker' to 'frontend'
[mesa.git] / src / gallium / targets / libgl-xlib / SConscript
1 #######################################################################
2 # SConscript for xlib winsys
3
4 Import('*')
5
6 env = env.Clone()
7
8 env.Append(CPPPATH = [
9 '#/src/mapi',
10 '#/src/mesa',
11 '#/src/mesa/main',
12 '#src/gallium/frontends/glx/xlib',
13 Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers
14 Dir('../../../mapi/glapi/gen'), # src/mapi build path for python-generated GL API files/headers
15 ])
16
17 env.Append(CPPDEFINES = ['USE_XSHM'])
18
19 env.Prepend(LIBS = env['X11_LIBS'])
20 env.Prepend(LIBPATH = env['X11_LIBPATH'])
21
22 env.Prepend(LIBS = [
23 st_xlib,
24 ws_xlib,
25 glapi,
26 mesautil,
27 compiler,
28 mesa,
29 glsl,
30 nir,
31 spirv,
32 gallium,
33 ])
34
35 sources = [
36 'xlib.c',
37 ]
38
39 if True:
40 env.Append(CPPDEFINES = ['GALLIUM_SOFTPIPE'])
41 env.Prepend(LIBS = [softpipe])
42
43 if env['llvm']:
44 env.Append(CPPDEFINES = ['GALLIUM_LLVMPIPE'])
45 env.Prepend(LIBS = [llvmpipe])
46
47 if env['platform'] != 'darwin':
48 # Disallow undefined symbols, except with Address Sanitizer, since libasan
49 # is not linked on shared libs, as it should be LD_PRELOAD'ed instead
50 if not env['asan']:
51 env.Append(SHLINKFLAGS = [
52 '-Wl,-z,defs',
53 ])
54 env.Append(SHLINKFLAGS = [
55 # Restrict exported symbols
56 '-Wl,--version-script=%s' % File("libgl-xlib.sym").srcnode().path,
57 ])
58
59 # libGL.so.1.5
60 libgl_1_5 = env.SharedLibrary(
61 target ='GL',
62 source = sources,
63 SHLIBSUFFIX = env['SHLIBSUFFIX'] + '.1.5',
64 )
65
66 # libGL.so.1
67 libgl = env.subst('${SHLIBPREFIX}GL${SHLIBSUFFIX}')
68 libgl_1 = libgl + '.1'
69 env.Command(libgl_1, libgl_1_5, "ln -sf ${SOURCE.file} ${TARGET}")
70 env.Command(libgl, libgl_1, "ln -sf ${SOURCE.file} ${TARGET}")
71
72 env.Alias('libgl-xlib', libgl)