loader: introduce 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 glapi
31 ])
32
33 env.PkgUseModules('X11')
34 env.PkgUseModules('XCB')
35 env.PkgUseModules('DRM')
36
37 if env['HAVE_XF86VIDMODE']:
38 env.Append(CPPDEFINES = ['XF86VIDMODE'])
39 env.PkgUseModules('XF86VIDMODE')
40
41 if False: # XXX: SHARED_GLAPI
42 env.Append(CPPDEFINES = ['GLX_SHARED_GLAPI'])
43
44 sources = [
45 'clientattrib.c',
46 'clientinfo.c',
47 'create_context.c',
48 'compsize.c',
49 'eval.c',
50 'glx_error.c',
51 'glxconfig.c',
52 'glxcmds.c',
53 'glxcurrent.c',
54 'glxext.c',
55 'glxextensions.c',
56 'indirect_glx.c',
57 'indirect.c',
58 'indirect_init.c',
59 'indirect_size.c',
60 'indirect_window_pos.c',
61 'indirect_texture_compression.c',
62 'indirect_transpose_matrix.c',
63 'indirect_vertex_array.c',
64 'indirect_vertex_program.c',
65 'pixel.c',
66 'pixelstore.c',
67 'query_renderer.c',
68 'render2.c',
69 'renderpix.c',
70 'single2.c',
71 'singlepix.c',
72 'vertarr.c',
73 'xfont.c',
74 'glx_pbuffer.c',
75 'glx_query.c',
76 'drisw_glx.c',
77 'dri_common.c',
78 'dri_glx.c',
79 'XF86dri.c',
80 'glxhash.c',
81 'dri2_glx.c',
82 'dri2.c',
83 'dri2_query_renderer.c',
84 #'dri3_glx.c',
85 #'dri3_common.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)