4 # A script that symlinks source files from Mesa to modular
6 # Author: Soren Sandmann (sandmann@redhat.com) (original)
7 # adapted for Mesa by Adam Jackson (ajax@nwnk.net)
10 # Things we would like to do
12 # - Check that all the relevant files exist
13 # - AUTHORS, autogen.sh, configure.ac, ...
14 # - Check that we have actually linked everything
15 # - if a file doesn't need to be linked, then it needs
16 # to be listed as "not-linked"
17 # - Compute diffs between all the files (shouldn't be necessary)
18 # - possibly check that files are listet in Makefile.am's
19 # - Clean target directory of irrelevant files
22 check_destinations
() {
23 # don't do anything - we are relying on the side
29 # Check whether $1 exists
53 run check_destinations
"Creating destination directories"
54 run check_exist
"Checking that the source files exist"
55 run delete_existing
"Deleting existing files"
56 run link_files
"Linking files"
61 symlink_mesa_glapi
() {
62 src_dir src
/mesa
/glapi
63 dst_dir xserver
/xorg
/GL
/mesa
/glapi
75 dst_dir xserver
/xorg
/GL
/mesa
/main
164 action renderbuffer.c
165 action renderbuffer.h
173 action texcompress_fxt1.c
174 action texcompress_s3tc.c
175 action texenvprogram.c
176 action texenvprogram.h
179 action texformat_tmp.h
199 symlink_mesa_math
() {
200 src_dir src
/mesa
/math
201 dst_dir xserver
/xorg
/GL
/mesa
/math
206 action m_debug_clip.c
207 action m_debug_norm.c
208 action m_debug_util.h
209 action m_debug_xform.c
210 action m_dotprod_tmp.h
228 src_dir src
/mesa
/array_cache
229 dst_dir xserver
/xorg
/GL
/mesa
/array_cache
237 symlink_mesa_swrast
() {
238 src_dir src
/mesa
/swrast
239 dst_dir xserver
/xorg
/GL
/mesa
/swrast
243 action s_aalinetemp.h
244 action s_aatriangle.c
245 action s_aatriangle.h
251 action s_atifragshader.c
252 action s_atifragshader.h
268 action s_fragprog_to_c.c
277 action s_nvfragprog.c
278 action s_nvfragprog.h
304 src_dir src
/mesa
/swrast_setup
305 dst_dir xserver
/xorg
/GL
/mesa
/swrast_setup
313 action swrast_setup.h
318 dst_dir xserver
/xorg
/GL
/mesa
/tnl
322 action t_array_import.c
323 action t_array_import.h
330 action t_save_loopback.c
331 action t_save_playback.c
332 action t_vb_arbprogram.c
333 action t_vb_arbprogram.h
334 action t_vb_arbprogram_sse.c
335 action t_vb_cliptmp.h
339 action t_vb_lighttmp.h
340 action t_vb_normals.c
342 action t_vb_program.c
344 action t_vb_rendertmp.h
350 action t_vertex_generic.c
351 action t_vertex_sse.c
358 action t_vtx_generic.c
363 symlink_mesa_shader
() {
364 src_dir src
/mesa
/shader
365 dst_dir xserver
/xorg
/GL
/mesa
/shader
367 action arbfragparse.c
368 action arbfragparse.h
369 action arbprogparse.c
370 action arbprogparse.h
373 action arbprogram_syn.h
374 action arbvertparse.c
375 action arbvertparse.h
376 action atifragshader.c
377 action atifragshader.h
390 action shaderobjects.c
391 action shaderobjects.h
392 action shaderobjects_3dlabs.c
393 action shaderobjects_3dlabs.h
396 src_dir src
/mesa
/shader
/grammar
400 action grammar_mesa.c
401 action grammar_mesa.h
404 src_dir src
/mesa
/shader
/slang
405 action slang_compile.h
409 src_dir src
/mesa
/drivers
/x11
410 dst_dir xserver
/xorg
/GL
/mesa
/X
417 # action xm_buffer.c ?
425 src_dir src
/mesa
/drivers
/common
429 symlink_mesa_glapi
() {
430 src_dir src
/mesa
/glapi
431 dst_dir xserver
/xorg
/GL
/mesa
/glapi
436 dst_dir xserver
/xorg
/GL
/mesa
/ppc
439 symlink_mesa_sparc
() {
440 src_dir src
/mesa
/sparc
441 dst_dir xserver
/xorg
/GL
/mesa
/sparc
446 dst_dir xserver
/xorg
/GL
/mesa
/x86
449 symlink_mesa_x8664
() {
450 src_dir src
/mesa
/x86-64
451 dst_dir xserver
/xorg
/GL
/mesa
/x86-64
478 echo \ \ \ error
:\ \ \
$1
482 # printing out what's going on
486 echo -n $EXPLANATION for $1 module ...\
495 ACTION
=$1 EXPLANATION
=$2 run_module mesa
499 REAL_SRC_DIR
=$SRC_DIR/$1
500 if [ ! -d $REAL_SRC_DIR ] ; then
501 error
"Source directory $REAL_SRC_DIR does not exist"
506 REAL_DST_DIR
=$DST_DIR/$1
507 if [ ! -d $REAL_DST_DIR ] ; then
508 mkdir
-p $REAL_DST_DIR
514 $ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$1
516 $ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$2
521 echo symlink.sh src-dir dst-dir
522 echo src-dir
: the xc directory of the monolithic
source tree
523 echo dst-dir
: the modular
source tree containing proto
, app
, lib
, ...
526 # Check commandline args
529 echo Missing
source dir
535 echo Missing destination dir
540 if [ ! -d $1 ] ; then
546 if [ ! -d $2 ] ; then
552 if [ $1 = $2 ] ; then
553 echo source and destination can
\'t be the same
558 D
=`dirname "$relpath"`
559 B
=`basename "$relpath"`
560 abspath
="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
562 SRC_DIR
=`( cd $1 ; pwd )`
563 DST_DIR
=`(cd $2 ; pwd )`