890f9983efdc626e24594f911571cdfd99822b1d
[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/mesa',
15 '#src/mapi',
16 '#src/mapi/glapi',
17 #$(LIBDRM_CFLAGS)
18 #$(DRI2PROTO_CFLAGS)
19 #$(GLPROTO_CFLAGS)
20 #$(X11_INCLUDES)
21 ])
22
23 env.Append(CPPDEFINES = [
24 '_REENTRANT',
25 #('DEFAULT_DRIVER_DIR', 'DRI_DRIVER_SEARCH_DIR')
26 ])
27
28 env.Prepend(LIBS = [
29 glapi
30 ])
31
32 env.PkgUseModules('X11')
33 env.PkgUseModules('XCB')
34 env.PkgUseModules('DRM')
35
36 if env['HAVE_XF86VIDMODE']:
37 env.Append(CPPDEFINES = ['XF86VIDMODE'])
38 env.PkgUseModules('XF86VIDMODE')
39
40 if False: # XXX: SHARED_GLAPI
41 env.Append(CPPDEFINES = ['GLX_SHARED_GLAPI'])
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 'dri2_query_renderer.c',
83 #'dri3_glx.c',
84 #'dri3_common.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 -h _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)