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