blob: f56578672a640b289687e7b4fe4d8650fb77bcde [file] [log] [blame]
José Fonsecac42e6252008-01-31 13:14:35 +09001#######################################################################
José Fonseca33ceb672008-02-18 10:52:44 +00002# SConscript for Mesa
José Fonsecac42e6252008-01-31 13:14:35 +09003
4
5Import('*')
Brian Paulf83af362011-09-28 08:15:22 -06006import filecmp
7import os
8import subprocess
Brian Pauldff36e92012-05-30 10:08:11 -06009from sys import executable as python_cmd
José Fonsecac42e6252008-01-31 13:14:35 +090010
José Fonseca601498a2010-11-01 13:30:22 +000011env = env.Clone()
José Fonsecab9da3792008-02-19 15:07:53 +090012
José Fonseca601498a2010-11-01 13:30:22 +000013env.Append(CPPPATH = [
14 '#/src/mapi',
15 '#/src/glsl',
16 '#/src/mesa',
José Fonseca71c87e42013-01-21 17:47:51 +000017 Dir('../mapi'), # src/mapi build path
18 Dir('.'), # src/mesa build path
José Fonseca601498a2010-11-01 13:30:22 +000019])
José Fonseca2105b612009-01-06 16:20:12 +000020
José Fonseca601498a2010-11-01 13:30:22 +000021if env['platform'] == 'windows':
22 env.Append(CPPDEFINES = [
23 '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
24 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
José Fonseca601498a2010-11-01 13:30:22 +000025 ])
Chia-I Wubb770af2011-01-14 17:50:29 +080026 if not env['gles']:
27 # prevent _glapi_* from being declared __declspec(dllimport)
28 env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
Chia-I Wubb045d32010-11-20 17:47:11 -080029else:
30 env.Append(CPPDEFINES = [
Tapani Pälli91214602012-08-28 14:01:51 +030031 ('HAVE_DLOPEN', '1'),
Chia-I Wubb045d32010-11-20 17:47:11 -080032 ])
José Fonseca5c9c6b02008-06-04 23:56:57 +090033
José Fonseca601498a2010-11-01 13:30:22 +000034#
35# Source files
36#
Michal Krol3371f7e2009-11-25 14:52:21 +010037
José Fonseca601498a2010-11-01 13:30:22 +000038main_sources = [
39 'main/api_arrayelt.c',
40 'main/api_exec.c',
41 'main/api_loopback.c',
José Fonseca601498a2010-11-01 13:30:22 +000042 'main/api_validate.c',
43 'main/accum.c',
44 'main/arbprogram.c',
45 'main/atifragshader.c',
46 'main/attrib.c',
47 'main/arrayobj.c',
48 'main/blend.c',
Brian Paulbfcb9bb2014-02-01 08:58:43 -070049 'main/blit.c',
José Fonseca601498a2010-11-01 13:30:22 +000050 'main/bufferobj.c',
51 'main/buffers.c',
52 'main/clear.c',
53 'main/clip.c',
54 'main/colortab.c',
Paul Berry79134cb2014-01-06 15:08:04 -080055 'main/compute.c',
José Fonseca601498a2010-11-01 13:30:22 +000056 'main/condrender.c',
57 'main/context.c',
58 'main/convolve.c',
59 'main/cpuinfo.c',
60 'main/debug.c',
61 'main/depth.c',
José Fonseca601498a2010-11-01 13:30:22 +000062 'main/dlist.c',
José Fonseca601498a2010-11-01 13:30:22 +000063 'main/drawpix.c',
64 'main/drawtex.c',
65 'main/enable.c',
66 'main/enums.c',
nobled5ab088c2011-05-01 12:47:31 +000067 'main/errors.c',
Vinson Lee5cbc0f02012-11-06 23:16:29 -080068 'main/es1_conversion.c',
José Fonseca601498a2010-11-01 13:30:22 +000069 'main/eval.c',
70 'main/execmem.c',
71 'main/extensions.c',
72 'main/fbobject.c',
73 'main/feedback.c',
Vinson Leedee6eaf2011-03-11 13:32:41 -080074 'main/ff_fragment_shader.cpp',
José Fonseca601498a2010-11-01 13:30:22 +000075 'main/ffvertex_prog.c',
76 'main/fog.c',
Brian Pauldfcd7652013-01-16 08:18:33 -070077 'main/formatquery.c',
José Fonseca601498a2010-11-01 13:30:22 +000078 'main/formats.c',
Brian Paulaa6cb952011-12-03 10:04:18 -070079 'main/format_pack.c',
Brian Paul730952a2011-09-08 20:16:18 -060080 'main/format_unpack.c',
José Fonseca601498a2010-11-01 13:30:22 +000081 'main/framebuffer.c',
Brian Paul3abd4f42014-02-01 08:58:43 -070082 'main/genmipmap.c',
José Fonseca601498a2010-11-01 13:30:22 +000083 'main/getstring.c',
Jordan Justen9ad8f432012-06-25 10:52:39 -070084 'main/glformats.c',
José Fonseca601498a2010-11-01 13:30:22 +000085 'main/hash.c',
Eric Anholt35fd61b2012-11-06 23:18:41 -080086 'main/hash_table.c',
José Fonseca601498a2010-11-01 13:30:22 +000087 'main/hint.c',
88 'main/histogram.c',
89 'main/image.c',
90 'main/imports.c',
91 'main/light.c',
92 'main/lines.c',
93 'main/matrix.c',
94 'main/mipmap.c',
95 'main/mm.c',
96 'main/multisample.c',
Timothy Arceria7f5eb82013-08-26 18:08:51 +100097 'main/objectlabel.c',
José Fonseca601498a2010-11-01 13:30:22 +000098 'main/pack.c',
Brian Paulb70610b2011-02-28 18:24:35 -070099 'main/pbo.c',
Kenneth Graunkeb2e327e2013-04-11 13:22:00 -0700100 'main/performance_monitor.c',
Vinson Lee34587e42014-02-21 16:58:17 -0800101 'main/pipelineobj.c',
José Fonseca601498a2010-11-01 13:30:22 +0000102 'main/pixel.c',
103 'main/pixelstore.c',
104 'main/pixeltransfer.c',
105 'main/points.c',
106 'main/polygon.c',
107 'main/querymatrix.c',
108 'main/queryobj.c',
109 'main/rastpos.c',
110 'main/readpix.c',
111 'main/remap.c',
112 'main/renderbuffer.c',
Brian Paul34a5d3b2011-04-10 12:48:28 -0600113 'main/samplerobj.c',
José Fonseca601498a2010-11-01 13:30:22 +0000114 'main/scissor.c',
Eric Anholt82c9d982012-12-04 01:03:57 -0800115 'main/set.c',
José Fonseca601498a2010-11-01 13:30:22 +0000116 'main/shaderapi.c',
Brian Paulbf27d022014-01-15 09:17:04 -0700117 'main/shaderimage.c',
José Fonseca601498a2010-11-01 13:30:22 +0000118 'main/shaderobj.c',
Brian Paul6399b7d2011-10-04 15:59:09 -0600119 'main/shader_query.cpp',
José Fonseca601498a2010-11-01 13:30:22 +0000120 'main/shared.c',
121 'main/state.c',
122 'main/stencil.c',
123 'main/syncobj.c',
124 'main/texcompress.c',
Brian Paulc1a9e602012-08-21 20:22:27 -0600125 'main/texcompress_cpal.c',
Vinson Lee93893132011-02-27 23:17:49 -0800126 'main/texcompress_rgtc.c',
José Fonseca601498a2010-11-01 13:30:22 +0000127 'main/texcompress_s3tc.c',
128 'main/texcompress_fxt1.c',
Chia-I Wu51f4d272011-11-28 23:55:31 +0800129 'main/texcompress_etc.c',
José Fonseca601498a2010-11-01 13:30:22 +0000130 'main/texenv.c',
José Fonseca601498a2010-11-01 13:30:22 +0000131 'main/texformat.c',
132 'main/texgen.c',
133 'main/texgetimage.c',
134 'main/teximage.c',
135 'main/texobj.c',
José Fonseca601498a2010-11-01 13:30:22 +0000136 'main/texparam.c',
José Fonseca601498a2010-11-01 13:30:22 +0000137 'main/texstate.c',
Brian Paul29eb2e82011-10-31 10:52:56 -0600138 'main/texstorage.c',
José Fonseca601498a2010-11-01 13:30:22 +0000139 'main/texstore.c',
Marek Olšákd0e805e2011-03-15 16:25:16 +0100140 'main/texturebarrier.c',
Courtney Goeltzenleuchterd77d2af2013-11-04 14:08:16 -0700141 'main/textureview.c',
José Fonseca601498a2010-11-01 13:30:22 +0000142 'main/transformfeedback.c',
Vinson Lee116b7bb2011-10-18 18:39:11 -0700143 'main/uniform_query.cpp',
José Fonseca601498a2010-11-01 13:30:22 +0000144 'main/uniforms.c',
145 'main/varray.c',
Brian Paulbc239442013-10-26 07:17:53 -0600146 'main/vdpau.c',
José Fonseca601498a2010-11-01 13:30:22 +0000147 'main/version.c',
148 'main/viewport.c',
149 'main/vtxfmt.c',
150]
José Fonseca5c9c6b02008-06-04 23:56:57 +0900151
Imre Deak98f880e2012-09-10 08:46:13 +0300152glget_sources = [
153 'main/get.c',
154]
155
José Fonseca601498a2010-11-01 13:30:22 +0000156math_sources = [
157 'math/m_debug_clip.c',
158 'math/m_debug_norm.c',
159 'math/m_debug_xform.c',
160 'math/m_eval.c',
161 'math/m_matrix.c',
162 'math/m_translate.c',
163 'math/m_vector.c',
164 'math/m_xform.c',
165]
166
José Fonseca8e8a56e2011-04-23 12:22:59 +0100167swrast_sources = [
168 'swrast/s_aaline.c',
169 'swrast/s_aatriangle.c',
José Fonseca8e8a56e2011-04-23 12:22:59 +0100170 'swrast/s_alpha.c',
171 'swrast/s_atifragshader.c',
172 'swrast/s_bitmap.c',
173 'swrast/s_blend.c',
174 'swrast/s_blit.c',
175 'swrast/s_clear.c',
176 'swrast/s_copypix.c',
177 'swrast/s_context.c',
178 'swrast/s_depth.c',
179 'swrast/s_drawpix.c',
180 'swrast/s_feedback.c',
181 'swrast/s_fog.c',
182 'swrast/s_fragprog.c',
183 'swrast/s_lines.c',
184 'swrast/s_logic.c',
185 'swrast/s_masking.c',
186 'swrast/s_points.c',
Brian Paulb85284f2011-12-05 20:40:48 -0700187 'swrast/s_renderbuffer.c',
José Fonseca8e8a56e2011-04-23 12:22:59 +0100188 'swrast/s_span.c',
189 'swrast/s_stencil.c',
190 'swrast/s_texcombine.c',
Brian Paulbaeefef2011-09-17 14:50:48 -0600191 'swrast/s_texfetch.c',
José Fonseca8e8a56e2011-04-23 12:22:59 +0100192 'swrast/s_texfilter.c',
Brian Paul755f2e22011-06-13 13:44:35 -0600193 'swrast/s_texrender.c',
Brian Paul6f1846e2011-08-29 11:37:13 -0600194 'swrast/s_texture.c',
José Fonseca8e8a56e2011-04-23 12:22:59 +0100195 'swrast/s_triangle.c',
196 'swrast/s_zoom.c',
197]
198
199swrast_setup_sources = [
200 'swrast_setup/ss_context.c',
201 'swrast_setup/ss_triangle.c',
202]
203
204tnl_sources = [
205 'tnl/t_context.c',
206 'tnl/t_pipeline.c',
207 'tnl/t_draw.c',
208 'tnl/t_rasterpos.c',
209 'tnl/t_vb_program.c',
210 'tnl/t_vb_render.c',
211 'tnl/t_vb_texgen.c',
212 'tnl/t_vb_texmat.c',
213 'tnl/t_vb_vertex.c',
214 'tnl/t_vb_fog.c',
215 'tnl/t_vb_light.c',
216 'tnl/t_vb_normals.c',
217 'tnl/t_vb_points.c',
218 'tnl/t_vp_build.c',
219 'tnl/t_vertex.c',
220 'tnl/t_vertex_sse.c',
221 'tnl/t_vertex_generic.c',
222]
223
José Fonseca601498a2010-11-01 13:30:22 +0000224vbo_sources = [
225 'vbo/vbo_context.c',
226 'vbo/vbo_exec.c',
227 'vbo/vbo_exec_api.c',
228 'vbo/vbo_exec_array.c',
229 'vbo/vbo_exec_draw.c',
230 'vbo/vbo_exec_eval.c',
Brian Paule6c41592011-11-09 17:22:47 -0700231 'vbo/vbo_noop.c',
Jordan Justenbc8e0f52012-05-07 15:50:21 -0700232 'vbo/vbo_primitive_restart.c',
José Fonseca601498a2010-11-01 13:30:22 +0000233 'vbo/vbo_rebase.c',
234 'vbo/vbo_split.c',
235 'vbo/vbo_split_copy.c',
236 'vbo/vbo_split_inplace.c',
237 'vbo/vbo_save.c',
238 'vbo/vbo_save_api.c',
239 'vbo/vbo_save_draw.c',
240 'vbo/vbo_save_loopback.c',
241]
242
José Fonseca601498a2010-11-01 13:30:22 +0000243statetracker_sources = [
244 'state_tracker/st_atom.c',
Brian Paul4d9f2632012-06-15 09:31:15 -0600245 'state_tracker/st_atom_array.c',
José Fonseca601498a2010-11-01 13:30:22 +0000246 'state_tracker/st_atom_blend.c',
247 'state_tracker/st_atom_clip.c',
248 'state_tracker/st_atom_constbuf.c',
249 'state_tracker/st_atom_depth.c',
250 'state_tracker/st_atom_framebuffer.c',
251 'state_tracker/st_atom_msaa.c',
252 'state_tracker/st_atom_pixeltransfer.c',
253 'state_tracker/st_atom_sampler.c',
254 'state_tracker/st_atom_scissor.c',
255 'state_tracker/st_atom_shader.c',
256 'state_tracker/st_atom_rasterizer.c',
257 'state_tracker/st_atom_stipple.c',
258 'state_tracker/st_atom_texture.c',
259 'state_tracker/st_atom_viewport.c',
José Fonseca601498a2010-11-01 13:30:22 +0000260 'state_tracker/st_cb_bitmap.c',
261 'state_tracker/st_cb_blit.c',
262 'state_tracker/st_cb_bufferobjects.c',
263 'state_tracker/st_cb_clear.c',
264 'state_tracker/st_cb_condrender.c',
265 'state_tracker/st_cb_flush.c',
266 'state_tracker/st_cb_drawpixels.c',
267 'state_tracker/st_cb_drawtex.c',
268 'state_tracker/st_cb_eglimage.c',
269 'state_tracker/st_cb_fbo.c',
270 'state_tracker/st_cb_feedback.c',
José Fonsecaed9687c2013-04-11 22:37:34 +0100271 'state_tracker/st_cb_msaa.c',
José Fonseca601498a2010-11-01 13:30:22 +0000272 'state_tracker/st_cb_program.c',
273 'state_tracker/st_cb_queryobj.c',
274 'state_tracker/st_cb_rasterpos.c',
275 'state_tracker/st_cb_readpixels.c',
Marek Olšák5257a6d2011-03-05 20:32:28 +0100276 'state_tracker/st_cb_syncobj.c',
José Fonseca601498a2010-11-01 13:30:22 +0000277 'state_tracker/st_cb_strings.c',
278 'state_tracker/st_cb_texture.c',
Marek Olšákaea4ed42011-03-08 11:32:35 +0100279 'state_tracker/st_cb_texturebarrier.c',
José Fonseca601498a2010-11-01 13:30:22 +0000280 'state_tracker/st_cb_viewport.c',
281 'state_tracker/st_cb_xformfb.c',
282 'state_tracker/st_context.c',
283 'state_tracker/st_debug.c',
284 'state_tracker/st_draw.c',
285 'state_tracker/st_draw_feedback.c',
286 'state_tracker/st_extensions.c',
287 'state_tracker/st_format.c',
Brian Pauld7f2e382011-08-04 15:55:13 -0600288 'state_tracker/st_glsl_to_tgsi.cpp',
José Fonseca601498a2010-11-01 13:30:22 +0000289 'state_tracker/st_gen_mipmap.c',
290 'state_tracker/st_manager.c',
291 'state_tracker/st_mesa_to_tgsi.c',
292 'state_tracker/st_program.c',
293 'state_tracker/st_texture.c',
Brian Paulbc239442013-10-26 07:17:53 -0600294 'state_tracker/st_vdpau.c',
José Fonseca601498a2010-11-01 13:30:22 +0000295]
296
Brian Paule78ebbc2012-09-15 09:01:02 -0600297env.Append(YACCFLAGS = '-d -p "_mesa_program_"')
Kenneth Graunke8be58df2011-03-01 15:04:04 -0800298program_lex = env.CFile('program/lex.yy.c', 'program/program_lexer.l')
299program_parse = env.CFile('program/program_parse.tab.c',
300 'program/program_parse.y')
José Fonsecadbfbb8c2011-03-03 15:43:18 +0000301
José Fonseca601498a2010-11-01 13:30:22 +0000302program_sources = [
303 'program/arbprogparse.c',
Jordan Justen59284bc2012-11-30 16:32:11 -0800304 'program/prog_hash_table.c',
José Fonseca601498a2010-11-01 13:30:22 +0000305 'program/ir_to_mesa.cpp',
José Fonseca601498a2010-11-01 13:30:22 +0000306 'program/program.c',
José Fonseca601498a2010-11-01 13:30:22 +0000307 'program/program_parse_extra.c',
308 'program/prog_cache.c',
309 'program/prog_execute.c',
310 'program/prog_instruction.c',
311 'program/prog_noise.c',
312 'program/prog_optimize.c',
Ian Romanick54c48a92011-02-10 15:48:27 -0800313 'program/prog_opt_constant_fold.c',
José Fonseca601498a2010-11-01 13:30:22 +0000314 'program/prog_parameter.c',
315 'program/prog_parameter_layout.c',
316 'program/prog_print.c',
317 'program/prog_statevars.c',
José Fonseca601498a2010-11-01 13:30:22 +0000318 'program/programopt.c',
319 'program/sampler.cpp',
320 'program/symbol_table.c',
Brian Paul6399b7d2011-10-04 15:59:09 -0600321 'program/string_to_uint_map.cpp',
Kenneth Graunke8be58df2011-03-01 15:04:04 -0800322 program_lex,
323 program_parse[0],
José Fonseca601498a2010-11-01 13:30:22 +0000324]
325
José Fonseca8e8a56e2011-04-23 12:22:59 +0100326common_driver_sources = [
327 'drivers/common/driverfuncs.c',
328 'drivers/common/meta.c',
Vinson Lee98fb8c92014-03-07 23:39:29 -0800329 'drivers/common/meta_blit.c',
330 'drivers/common/meta_generate_mipmap.c'
José Fonseca8e8a56e2011-04-23 12:22:59 +0100331]
332
José Fonseca601498a2010-11-01 13:30:22 +0000333mesa_sources = (
334 main_sources +
Imre Deak98f880e2012-09-10 08:46:13 +0300335 glget_sources +
José Fonseca601498a2010-11-01 13:30:22 +0000336 math_sources +
337 program_sources +
338 vbo_sources +
José Fonseca8e8a56e2011-04-23 12:22:59 +0100339 tnl_sources +
340 swrast_sources +
341 swrast_setup_sources +
342 common_driver_sources +
José Fonseca601498a2010-11-01 13:30:22 +0000343 statetracker_sources
344)
345
Brian Pauldff36e92012-05-30 10:08:11 -0600346GLAPI = '#src/mapi/glapi/'
347
Imre Deak98f880e2012-09-10 08:46:13 +0300348get_hash_header = env.CodeGenerate(
349 target = 'main/get_hash.h',
350 script = 'main/get_hash_generator.py',
351 source = GLAPI + 'gen/gl_and_es_API.xml',
Brian Paul815ca0b2013-04-17 09:49:39 -0600352 command = python_cmd + ' $SCRIPT ' + ' -f $SOURCE > $TARGET'
Imre Deak98f880e2012-09-10 08:46:13 +0300353)
354
José Fonseca601498a2010-11-01 13:30:22 +0000355#
356# Assembly sources
357#
José Fonseca16879322013-04-24 22:02:18 +0100358if (env['gcc'] or env['clang']) and \
359 env['platform'] not in ('cygwin', 'darwin', 'windows', 'haiku'):
José Fonsecaf9156eb2010-11-01 13:56:16 +0000360 if env['machine'] == 'x86':
361 env.Append(CPPDEFINES = [
362 'USE_X86_ASM',
363 'USE_MMX_ASM',
364 'USE_3DNOW_ASM',
365 'USE_SSE_ASM',
366 ])
367 mesa_sources += [
368 'x86/common_x86.c',
369 'x86/x86_xform.c',
370 'x86/3dnow.c',
371 'x86/sse.c',
372 'x86/common_x86_asm.S',
373 'x86/x86_xform2.S',
374 'x86/x86_xform3.S',
375 'x86/x86_xform4.S',
376 'x86/x86_cliptest.S',
377 'x86/mmx_blend.S',
378 'x86/3dnow_xform1.S',
379 'x86/3dnow_xform2.S',
380 'x86/3dnow_xform3.S',
381 'x86/3dnow_xform4.S',
382 'x86/3dnow_normal.S',
383 'x86/sse_xform1.S',
384 'x86/sse_xform2.S',
385 'x86/sse_xform3.S',
386 'x86/sse_xform4.S',
387 'x86/sse_normal.S',
388 'x86/read_rgba_span_x86.S',
389 ]
390 elif env['machine'] == 'x86_64':
391 env.Append(CPPDEFINES = [
392 'USE_X86_64_ASM',
393 ])
394 mesa_sources += [
José Fonsecac59c8f02014-05-22 20:24:44 +0100395 'x86/common_x86.c',
José Fonsecaf9156eb2010-11-01 13:56:16 +0000396 'x86-64/x86-64.c',
397 'x86-64/xform4.S',
398 ]
José Fonsecaf9156eb2010-11-01 13:56:16 +0000399 elif env['machine'] == 'sparc':
400 mesa_sources += [
401 'sparc/sparc.c',
Jon TURNEY86768902012-07-07 00:53:31 +0100402 'sparc/sparc_clip.S',
José Fonsecaf9156eb2010-11-01 13:56:16 +0000403 'sparc/norm.S',
404 'sparc/xform.S',
405 ]
406 else:
407 pass
José Fonseca601498a2010-11-01 13:30:22 +0000408
José Fonsecaf9156eb2010-11-01 13:56:16 +0000409 # Generate matypes.h
410 if env['machine'] in ('x86', 'x86_64'):
411 # See http://www.scons.org/wiki/UsingCodeGenerators
412 gen_matypes = env.Program(
413 target = 'gen_matypes',
414 source = 'x86/gen_matypes.c',
415 )
416 matypes = env.Command(
417 'matypes.h',
418 gen_matypes,
419 gen_matypes[0].abspath + ' > $TARGET',
420 )
421 # Add the dir containing the generated header (somewhere inside the
422 # build dir) to the include path
423 env.Append(CPPPATH = [matypes[0].dir])
José Fonseca601498a2010-11-01 13:30:22 +0000424
Brian Paul0c245502011-04-05 14:07:41 -0600425
Brian Paulf83af362011-09-28 08:15:22 -0600426def write_git_sha1_h_file(filename):
427 """Mesa looks for a git_sha1.h file at compile time in order to display
428 the current git hash id in the GL_VERSION string. This function tries
429 to retrieve the git hashid and write the header file. An empty file
430 will be created if anything goes wrong."""
431
432 args = [ 'git', 'log', '-n', '1', '--oneline' ]
433 try:
434 (commit, foo) = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
435 except:
436 # git log command didn't work
437 if not os.path.exists(filename):
438 # create an empty file if none already exists
439 f = open(filename, "w")
440 f.close()
441 return
442
Brian Pauld487cc22011-09-28 09:51:36 -0600443 commit = '#define MESA_GIT_SHA1 "git-%s"\n' % commit[0:7]
Brian Paulf83af362011-09-28 08:15:22 -0600444 tempfile = "git_sha1.h.tmp"
445 f = open(tempfile, "w")
446 f.write(commit)
Vinson Lee622ee082011-04-05 15:32:39 -0700447 f.close()
Brian Paulf83af362011-09-28 08:15:22 -0600448 if not os.path.exists(filename) or not filecmp.cmp(tempfile, filename):
449 # The filename does not exist or it's different from the new file,
450 # so replace old file with new.
Brian Paule1122872011-09-28 09:04:03 -0600451 if os.path.exists(filename):
452 os.remove(filename)
Brian Paulf83af362011-09-28 08:15:22 -0600453 os.rename(tempfile, filename)
454 return
455
456
457# Create the git_sha1.h header file
458write_git_sha1_h_file("main/git_sha1.h")
Vinson Lee622ee082011-04-05 15:32:39 -0700459# and update CPPPATH so the git_sha1.h header can be found
460env.Append(CPPPATH = ["#" + env['build_dir'] + "/mesa/main"])
Brian Paul0c245502011-04-05 14:07:41 -0600461
462
José Fonseca601498a2010-11-01 13:30:22 +0000463#
464# Libraries
465#
466
467mesa = env.ConvenienceLibrary(
468 target = 'mesa',
469 source = mesa_sources,
470)
471
472env.Alias('mesa', mesa)
473
474Export('mesa')
José Fonseca8e8a56e2011-04-23 12:22:59 +0100475
476SConscript('drivers/SConscript')