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