5764d4ff62f8138c2fa5dd8ddb372249c7d4e1d7
[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/state_trackers/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['swr']:
48 env.Append(CPPDEFINES = 'GALLIUM_SWR')
49 env.Prepend(LIBS = [swr])
50
51 if env['platform'] != 'darwin':
52 # Disallow undefined symbols, except with Address Sanitizer, since libasan
53 # is not linked on shared libs, as it should be LD_PRELOAD'ed instead
54 if not env['asan']:
55 env.Append(SHLINKFLAGS = [
56 '-Wl,-z,defs',
57 ])
58 env.Append(SHLINKFLAGS = [
59 # Restrict exported symbols
60 '-Wl,--version-script=%s' % File("libgl-xlib.sym").srcnode().path,
61 ])
62
63 # libGL.so.1.5
64 libgl_1_5 = env.SharedLibrary(
65 target ='GL',
66 source = sources,
67 SHLIBSUFFIX = env['SHLIBSUFFIX'] + '.1.5',
68 )
69
70 # libGL.so.1
71 libgl = env.subst('${SHLIBPREFIX}GL${SHLIBSUFFIX}')
72 libgl_1 = libgl + '.1'
73 env.Command(libgl_1, libgl_1_5, "ln -sf ${SOURCE.file} ${TARGET}")
74 env.Command(libgl, libgl_1, "ln -sf ${SOURCE.file} ${TARGET}")
75
76 env.Alias('libgl-xlib', libgl)