[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: [PATCH] Xgl doesn't compile with Mesa HEAD > 0821
From:       "Dan Nicholson" <dbn.lists () gmail ! com>
Date:       2006-08-30 2:14:46
Message-ID: 91705d080608291914y57e3b74ciae04958d42c2bf84 () mail ! gmail ! com
[Download RAW message or body]

On 8/28/06, Brian Paul <brian.paul@tungstengraphics.com> wrote:
> Dan Nicholson wrote:
> >
> > I took a quick hack at this. Immediately, the problem is that Xorg
> > needs to symlink a lot of header files that aren't listed in
> > src/mesa/sources.
>
> We could add the .h files to 'sources'.  Let me know if you want that.

I went in another direction after I found there wasn't much
correlation between the listing in Mesa's sources file and the way
that xserver creates the tree. Instead, I just decided to use a for
loop to link all the C files in the Mesa directory. It turns out that
it was only missing a few anyway.

$ diff -qr -x symlink-mesa.sh xserver{.orig,}
Only in xserver/GL/mesa/main: dispatch.c
Only in xserver/GL/mesa/shader/grammar: grammar_crt.c
Only in xserver/GL/mesa/shader/grammar: grammar_crt.h
Only in xserver/GL/mesa/shader: programopt.c
Only in xserver/GL/mesa/shader: programopt.h
Only in xserver/GL/mesa/shader/slang/library: gc_to_bin.c
Only in xserver/GL/mesa/shader/slang/library: slang_builtin_vec4_gc.h
Only in xserver/GL/mesa/shader/slang/library: syn_to_c.c

I left alone the special hacks to handle GL/glx and GL/X. The nice
thing is that the script doesn't overwrite existing files, so using
the blind for loop still wouldn't be a problem if there was a
preferred local file in the xserver tree.

The only drawback is that it's a lot slower due to repeated use of
`basename'. It could be a lot faster using bash parameter expansion,
but I'm sure `basename' is a much more portable. Here's the timing on
my crawling PIII 500.

$ cat time1
Creating destination directories for mesa module ... DONE
Creating destination directories for glx module ... DONE
Checking that the source files exist for mesa module ... DONE
Checking that the source files exist for glx module ... DONE
Deleting existing files for mesa module ... DONE
Deleting existing files for glx module ... DONE
Linking files for mesa module ... DONE
Linking files for glx module ... DONE

real    0m4.384s
user    0m2.516s
sys     0m1.668s
$ cat time2
Creating destination directories for mesa module ... DONE
Creating destination directories for glx module ... DONE
Checking that the source files exist for mesa module ... DONE
Checking that the source files exist for glx module ... DONE
Deleting existing files for mesa module ... DONE
Deleting existing files for glx module ... DONE
Linking files for mesa module ... DONE
Linking files for glx module ... DONE

real    0m11.227s
user    0m4.880s
sys     0m5.868s

Patch is attached. I tested this on the xgl-0-0-1 branch and it built
fine. If you want to use this with xgl, you also need to apply this
commit from master first:

http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commit;h=b29b236d88789fd45d823a55dbedb393bb134c5b

--
Dan

["symlink.diff" (text/x-patch)]

commit f383252c5fb3130eebae47f70781e3c69c9c532a
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Tue Aug 29 18:08:18 2006 -0700

    Symlink all .c and .h files in the Mesa tree.
    
    symlink-mesa.sh is changed to symlink all .c and .h files it
    finds in the source directory except for special cases. This
    should help alleviate the need to update the script every time
    the upstream Mesa source changes.

diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh
index 7b5ed5c..88dddfc 100755
--- a/GL/symlink-mesa.sh
+++ b/GL/symlink-mesa.sh
@@ -62,414 +62,99 @@ symlink_mesa_glapi() {
     src_dir src/mesa/glapi
     dst_dir mesa/glapi
 
-    action dispatch.h
-    action glapi.c
-    action glapi.h
-    action glapioffsets.h
-    action glapitable.h
-    action glapitemp.h
-    action glprocs.h
-    action glthread.c
-    action glthread.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_main() {
     src_dir src/mesa/main
     dst_dir mesa/main
 
-    action accum.c
-    action accum.h
-    action api_arrayelt.c
-    action api_arrayelt.h
-    action api_eval.h
-    action api_loopback.c
-    action api_loopback.h
-    action api_noop.c
-    action api_noop.h
-    action api_validate.c
-    action api_validate.h
-    action arrayobj.c
-    action arrayobj.h
-    action attrib.c
-    action attrib.h
-    action bitset.h
-    action blend.c
-    action blend.h
-    action bufferobj.c
-    action bufferobj.h
-    action buffers.c
-    action buffers.h
-    action clip.c
-    action clip.h
-    action colormac.h
-    action colortab.c
-    action colortab.h
-    action config.h
-    action context.c
-    action context.h
-    action convolve.c
-    action convolve.h
-    action dd.h
-    action debug.c
-    action debug.h
-    action depth.c
-    action depth.h
-    action depthstencil.c
-    action depthstencil.h
-    action dlist.c
-    action dlist.h
-    action drawpix.c
-    action drawpix.h
-    action enable.c
-    action enable.h
-    action enums.c
-    action enums.h
-    action eval.c
-    action eval.h
-    action execmem.c
-    action extensions.c
-    action extensions.h
-    action fbobject.c
-    action fbobject.h
-    action feedback.c
-    action feedback.h
-    action fog.c
-    action fog.h
-    action framebuffer.c
-    action framebuffer.h
-    action get.c
-    action get.h
-    action getstring.c
-    action glheader.h
-    action hash.c
-    action hash.h
-    action hint.c
-    action hint.h
-    action histogram.c
-    action histogram.h
-    action image.c
-    action image.h
-    action imports.c
-    action imports.h
-    action light.c
-    action light.h
-    action lines.c
-    action lines.h
-    action macros.h
-    action matrix.c
-    action matrix.h
-    action mm.c
-    action mm.h
-    action mtypes.h
-    action occlude.c
-    action occlude.h
-    action pixel.c
-    action pixel.h
-    action points.c
-    action points.h
-    action polygon.c
-    action polygon.h
-    action rastpos.c
-    action rastpos.h
-    action rbadaptors.c
-    action rbadaptors.h
-    action renderbuffer.c
-    action renderbuffer.h
-    action simple_list.h
-    action state.c
-    action state.h
-    action stencil.c
-    action stencil.h
-    action texcompress.c
-    action texcompress.h
-    action texcompress_fxt1.c
-    action texcompress_s3tc.c
-    action texenvprogram.c
-    action texenvprogram.h
-    action texformat.c
-    action texformat.h
-    action texformat_tmp.h
-    action teximage.c
-    action teximage.h
-    action texobj.c
-    action texobj.h
-    action texrender.c
-    action texrender.h
-    action texstate.c
-    action texstate.h
-    action texstore.c
-    action texstore.h
-    action varray.c
-    action varray.h
-    action version.h
-    action vsnprintf.c
-    action vtxfmt.c
-    action vtxfmt.h
-    action vtxfmt_tmp.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_math() {
     src_dir src/mesa/math
     dst_dir mesa/math
 
-    action m_clip_tmp.h
-    action m_copy_tmp.h
-    action m_debug.h
-    action m_debug_clip.c
-    action m_debug_norm.c
-    action m_debug_util.h
-    action m_debug_xform.c
-    action m_dotprod_tmp.h
-    action m_eval.c
-    action m_eval.h
-    action m_matrix.c
-    action m_matrix.h
-    action m_norm_tmp.h
-    action m_trans_tmp.h
-    action m_translate.c
-    action m_translate.h
-    action m_vector.c
-    action m_vector.h
-    action m_xform.c
-    action m_xform.h
-    action m_xform_tmp.h
-    action mathmod.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_ac() {
     src_dir src/mesa/array_cache
     dst_dir mesa/array_cache
 
-    action ac_context.c
-    action ac_context.h
-    action ac_import.c
-    action acache.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_swrast() {
     src_dir src/mesa/swrast
     dst_dir mesa/swrast
 
-    action s_aaline.c
-    action s_aaline.h
-    action s_aalinetemp.h
-    action s_aatriangle.c
-    action s_aatriangle.h
-    action s_aatritemp.h
-    action s_accum.c
-    action s_accum.h
-    action s_alpha.c
-    action s_alpha.h
-    action s_arbshader.c
-    action s_arbshader.h
-    action s_atifragshader.c
-    action s_atifragshader.h
-    action s_bitmap.c
-    action s_blend.c
-    action s_blend.h
-    action s_blit.c
-    action s_buffers.c
-    action s_context.c
-    action s_context.h
-    action s_copypix.c
-    action s_depth.c
-    action s_depth.h
-    action s_drawpix.c
-    action s_drawpix.h
-    action s_feedback.c
-    action s_feedback.h
-    action s_fog.c
-    action s_fog.h
-    action s_imaging.c
-    action s_lines.c
-    action s_lines.h
-    action s_linetemp.h
-    action s_logic.c
-    action s_logic.h
-    action s_masking.c
-    action s_masking.h
-    action s_nvfragprog.c
-    action s_nvfragprog.h
-    action s_points.c
-    action s_points.h
-    action s_pointtemp.h
-    action s_readpix.c
-    action s_span.c
-    action s_span.h
-    action s_spantemp.h
-    action s_stencil.c
-    action s_stencil.h
-    action s_texcombine.c
-    action s_texcombine.h
-    action s_texfilter.c
-    action s_texfilter.h
-    action s_texstore.c
-    action s_triangle.c
-    action s_triangle.h
-    action s_trispan.h
-    action s_tritemp.h
-    action s_zoom.c
-    action s_zoom.h
-    action swrast.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_ss() {
     src_dir src/mesa/swrast_setup
     dst_dir mesa/swrast_setup
 
-    action ss_context.c
-    action ss_context.h
-    action ss_triangle.c
-    action ss_triangle.h
-    action ss_tritmp.h
-    action ss_vb.h
-    action swrast_setup.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_tnl() {
     src_dir src/mesa/tnl
     dst_dir mesa/tnl
 
-    action t_array_api.c
-    action t_array_api.h
-    action t_array_import.c
-    action t_array_import.h
-    action t_context.c
-    action t_context.h
-    action t_pipeline.c
-    action t_pipeline.h
-    action t_save_api.c
-    action t_save_api.h
-    action t_save_loopback.c
-    action t_save_playback.c
-    action t_vb_arbprogram.c
-    action t_vb_arbprogram.h
-    action t_vb_arbprogram_sse.c
-    action t_vb_arbshader.c
-    action t_vb_cliptmp.h
-    action t_vb_cull.c
-    action t_vb_fog.c
-    action t_vb_light.c
-    action t_vb_lighttmp.h
-    action t_vb_normals.c
-    action t_vb_points.c
-    action t_vb_program.c
-    action t_vb_render.c
-    action t_vb_rendertmp.h
-    action t_vb_texgen.c
-    action t_vb_texmat.c
-    action t_vb_vertex.c
-    action t_vertex.c
-    action t_vertex.h
-    action t_vertex_generic.c
-    action t_vertex_sse.c
-    action t_vp_build.c
-    action t_vp_build.h
-    action t_vtx_api.c
-    action t_vtx_api.h
-    action t_vtx_eval.c
-    action t_vtx_exec.c
-    action t_vtx_generic.c
-    action t_vtx_x86.c
-    action tnl.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_shader() {
     src_dir src/mesa/shader
     dst_dir mesa/shader
 
-    action arbprogparse.c
-    action arbprogparse.h
-    action arbprogram.c
-    action arbprogram.h
-    action arbprogram_syn.h
-    action atifragshader.c
-    action atifragshader.h
-    action nvfragparse.c
-    action nvfragparse.h
-    action nvprogram.c
-    action nvprogram.h
-    action nvvertexec.c
-    action nvvertexec.h
-    action nvvertparse.c
-    action nvvertparse.h
-    action program.c
-    action program.h
-    action program_instruction.h
-    action shaderobjects.c
-    action shaderobjects.h
-    action shaderobjects_3dlabs.c
-    action shaderobjects_3dlabs.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_shader_grammar() {
     src_dir src/mesa/shader/grammar
     dst_dir mesa/shader/grammar
 
-    action grammar.c
-    action grammar.h
-    action grammar_syn.h
-    action grammar_mesa.c
-    action grammar_mesa.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_shader_slang() {
     src_dir src/mesa/shader/slang
     dst_dir mesa/shader/slang
 
-    action slang_analyse.c
-    action slang_analyse.h
-    action slang_assemble.c
-    action slang_assemble.h
-    action slang_assemble_assignment.c
-    action slang_assemble_assignment.h
-    action slang_assemble_conditional.c
-    action slang_assemble_conditional.h
-    action slang_assemble_constructor.c
-    action slang_assemble_constructor.h
-    action slang_assemble_typeinfo.c
-    action slang_assemble_typeinfo.h
-    action slang_compile.c
-    action slang_compile.h
-    action slang_compile_function.c
-    action slang_compile_function.h
-    action slang_compile_operation.c
-    action slang_compile_operation.h
-    action slang_compile_struct.c
-    action slang_compile_struct.h
-    action slang_compile_variable.c
-    action slang_compile_variable.h
-    action slang_execute.c
-    action slang_execute.h
-    action slang_execute_x86.c
-    action slang_export.c
-    action slang_export.h
-    action slang_library_noise.c
-    action slang_library_noise.h
-    action slang_library_texsample.c
-    action slang_library_texsample.h
-    action slang_link.c
-    action slang_link.h
-    action slang_mesa.h
-    action slang_preprocess.c
-    action slang_preprocess.h
-    action slang_storage.c
-    action slang_storage.h
-    action slang_utility.c
-    action slang_utility.h
-    action traverse_wrap.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }
 
 symlink_mesa_shader_slang_library() {
     src_dir src/mesa/shader/slang/library
     dst_dir mesa/shader/slang/library
 
-    action slang_common_builtin_gc.h
-    action slang_core_gc.h
-    action slang_fragment_builtin_gc.h
-    action slang_shader_syn.h
-    action slang_pp_version_syn.h
-    action slang_vertex_builtin_gc.h
+    for src in $REAL_SRC_DIR/*.{c,h}; do
+        action `basename $src`
+    done
 }        
 
 symlink_mesa_x() {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic