7555fb0568c8dc80b126155e97d3eda1bcbffafd
[mesa.git] / src / glx / SConscript
1 Import('*')
2
3 if not env['x11'] or not env['xcb'] or not env['drm']:
4 Return()
5
6 from sys import executable as python_cmd
7
8 env = env.Clone()
9
10 env.Prepend(CPPPATH = [
11 '.', # the build/<platform>/glx/ directory
12 '#include',
13 '#include/GL/internal',
14 '#src/',
15 '#src/loader',
16 '#src/mesa',
17 '#src/mapi',
18 '#src/mapi/glapi',
19 #$(LIBDRM_CFLAGS)
20 #$(DRI2PROTO_CFLAGS)
21 #$(GLPROTO_CFLAGS)
22 #$(X11_INCLUDES)
23 ])
24
25 env.Append(CPPDEFINES = [
26 '_REENTRANT',
27 ])
28
29 env.Prepend(LIBS = [
30 libloader,
31 mesautil,
32 glapi
33 ])
34
35 env.PkgUseModules('X11')
36 env.PkgUseModules('XCB')
37 env.PkgUseModules('DRM')
38
39 if env['HAVE_XF86VIDMODE']:
40 env.Append(CPPDEFINES = ['XF86VIDMODE'])
41 env.PkgUseModules('XF86VIDMODE')
42
43 sources = [
44 'clientattrib.c',
45 'clientinfo.c',
46 'create_context.c',
47 'compsize.c',
48 'eval.c',
49 'glx_error.c',
50 'glxconfig.c',
51 'glxcmds.c',
52 'glxcurrent.c',
53 'glxext.c',
54 'glxextensions.c',
55 'indirect_glx.c',
56 'indirect.c',
57 'indirect_init.c',
58 'indirect_size.c',
59 'indirect_window_pos.c',
60 'indirect_texture_compression.c',
61 'indirect_transpose_matrix.c',
62 'indirect_vertex_array.c',
63 'indirect_vertex_program.c',
64 'pixel.c',
65 'pixelstore.c',
66 'query_renderer.c',
67 'render2.c',
68 'renderpix.c',
69 'single2.c',
70 'singlepix.c',
71 'vertarr.c',
72 'xfont.c',
73 'glx_pbuffer.c',
74 'glx_query.c',
75 'drisw_glx.c',
76 'dri_common.c',
77 'dri_glx.c',
78 'XF86dri.c',
79 'glxhash.c',
80 'dri2_glx.c',
81 'dri2.c',
82 'dri_common_query_renderer.c',
83 'dri_common_interop.c',
84 #'dri3_glx.c',
85 'applegl_glx.c',
86 ]
87
88 libgl = env.SharedLibrary(
89 target ='GL',
90 source = sources,
91 )
92
93
94 # Generate GLX-specific .c and .h files here. Other GL API-related
95 # files are used, but they're generated in mapi/glapi/gen/ since they're
96 # used by other targets as well.
97
98 GLAPI = '#src/mapi/glapi/'
99 sources = [GLAPI + 'gen/gl_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
100
101 env.CodeGenerate(
102 target = 'indirect.c',
103 script = GLAPI + 'gen/glX_proto_send.py',
104 source = sources,
105 command = python_cmd + ' $SCRIPT -f $SOURCE -m proto > $TARGET'
106 )
107
108 env.CodeGenerate(
109 target = 'indirect_size.c',
110 script = GLAPI + 'gen/glX_proto_size.py',
111 source = sources,
112 command = python_cmd + ' $SCRIPT -f $SOURCE -m size_c --only-set > $TARGET'
113 )
114
115 env.CodeGenerate(
116 target = 'indirect_init.c',
117 script = GLAPI + 'gen/glX_proto_send.py',
118 source = sources,
119 command = python_cmd + ' $SCRIPT -f $SOURCE -m init_c > $TARGET'
120 )
121
122 env.CodeGenerate(
123 target = 'indirect_size.h',
124 script = GLAPI + 'gen/glX_proto_size.py',
125 source = sources,
126 command = python_cmd + ' $SCRIPT -f $SOURCE -m size_h --only-set --header-tag _INDIRECT_SIZE_H > $TARGET'
127 )
128
129 env.CodeGenerate(
130 target = 'indirect.h',
131 script = GLAPI + 'gen/glX_proto_send.py',
132 source = sources,
133 command = python_cmd + ' $SCRIPT -m init_h -f $SOURCE > $TARGET',
134 )
135
136
137 libgl = env.InstallSharedLibrary(libgl, version=(1, 2))
138
139 env.Alias('glx', libgl)
140 env.Alias('libgl', libgl)