• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#######################################################################
2# SConscript for xlib winsys
3
4Import('*')
5
6env = env.Clone()
7
8env.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
17env.Append(CPPDEFINES = ['USE_XSHM'])
18
19env.Prepend(LIBS = env['X11_LIBS'])
20env.Prepend(LIBPATH = env['X11_LIBPATH'])
21
22env.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
35sources = [
36    'xlib.c',
37]
38
39if True:
40    env.Append(CPPDEFINES = ['GALLIUM_SOFTPIPE'])
41    env.Prepend(LIBS = [softpipe])
42
43if env['llvm']:
44    env.Append(CPPDEFINES = ['GALLIUM_LLVMPIPE'])
45    env.Prepend(LIBS = [llvmpipe])
46
47if 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
60libgl_1_5 = env.SharedLibrary(
61    target ='GL',
62    source = sources,
63    SHLIBSUFFIX = env['SHLIBSUFFIX'] + '.1.5',
64)
65
66# libGL.so.1
67libgl = env.subst('${SHLIBPREFIX}GL${SHLIBSUFFIX}')
68libgl_1 = libgl + '.1'
69env.Command(libgl_1, libgl_1_5, "ln -sf ${SOURCE.file} ${TARGET}")
70env.Command(libgl, libgl_1, "ln -sf ${SOURCE.file} ${TARGET}")
71
72env.Alias('libgl-xlib', libgl)
73