ia64/xen-unstable

view xenolinux-2.4.21-pre4-sparse/mkbuildtree @ 439:76eba4e532dd

bitkeeper revision 1.221 (3eba8f8dgXua1A_xKfhWMGYPP8YLPQ)

lndir-rel:
new file
mkbuildtree:
Fixed xenolinux mkbuildtree script to create relative symlinks.
author kaf24@scramble.cl.cam.ac.uk
date Thu May 08 17:10:37 2003 +0000 (2003-05-08)
parents b695c18bad2d
children bf8403ac8e85
line source
1 #!/bin/sh
3 # mkbuildtree <build tree>
4 #
5 # Creates symbolic links in <build tree> for the sparse tree
6 # in the current directory.
8 # Script to determine the relative path between two directories.
9 # Copyright (c) D. J. Hawkey Jr. 2002
10 # Fixed for Xen project by K. Fraser in 2003.
11 abs_to_rel ()
12 {
13 local CWD SRCPATH
15 if [ "$1" != "/" -a "${1##*[^/]}" = "/" ]; then
16 SRCPATH=${1%?}
17 else
18 SRCPATH=$1
19 fi
20 if [ "$2" != "/" -a "${2##*[^/]}" = "/" ]; then
21 DESTPATH=${2%?}
22 else
23 DESTPATH=$2
24 fi
26 CWD=$PWD
27 [ "${1%%[^/]*}" != "/" ] && cd $1 && SRCPATH=$PWD
28 [ "${2%%[^/]*}" != "/" ] && cd $2 && DESTPATH=$PWD
29 [ "$CWD" != "$PWD" ] && cd $CWD
31 BASEPATH=$SRCPATH
33 [ "$SRCPATH" = "$DESTPATH" ] && DESTPATH="." && return
34 [ "$SRCPATH" = "/" ] && DESTPATH=${DESTPATH#?} && return
36 while [ "$BASEPATH/" != "${DESTPATH%${DESTPATH#$BASEPATH/}}" ]; do
37 BASEPATH=${BASEPATH%/*}
38 done
40 SRCPATH=${SRCPATH#$BASEPATH}
41 DESTPATH=${DESTPATH#$BASEPATH}
42 DESTPATH=${DESTPATH#?}
43 while [ -n "$SRCPATH" ]; do
44 SRCPATH=${SRCPATH%/*}
45 DESTPATH="../$DESTPATH"
46 done
48 [ -z "$BASEPATH" ] && BASEPATH="/"
49 [ "${DESTPATH##*[^/]}" = "/" ] && DESTPATH=${DESTPATH%?}
50 }
53 [ "$1" == "" ] && { echo "Syntax: $0 <linux tree to xenify>"; exit 1; }
55 # Get absolute path to the destination directory
56 pushd . >/dev/null
57 cd ${1}
58 AD=`pwd`
59 popd >/dev/null
61 # Get absolute path to the source directory
62 AS=`pwd`
64 # Get path to source, relative to destination
65 abs_to_rel ${AD} ${AS}
66 RS=$DESTPATH
68 # Remove old copies of files and directories at the destination
69 for i in `find . -type f -o -type l` ; do rm -f ${AD}/${i#./} ; done
71 # We now work from the destination directory
72 cd ${AD}
74 # Create symlinks of files and directories which exist in the sparse source
75 ${AS}/lndir-rel -silent ${RS}
76 rm -f mkbuildtree lndir-rel
78 ## There are a whole bunch of special symlinks, mostly for files
79 ## which are identical in the i386 and xeno-i386 architecture-dependent
80 ## subdirectories.
82 # This first symlink is special: it links to shared files in Xen's source tree
83 rm -f ${AD}/include/asm-xeno/hypervisor-ifs
84 mkdir ${AD}/include/asm-xeno/hypervisor-ifs
85 cd ${AD}/include/asm-xeno/hypervisor-ifs
86 ${AS}/lndir-rel -silent ../../../${RS}/../xen/include/hypervisor-ifs
88 # The remainder are the i386 -> xeno-i386 links
89 cd ..
90 ln -sf ../asm-i386/a.out.h
91 ln -sf ../asm-i386/apicdef.h
92 ln -sf ../asm-i386/apic.h
93 ln -sf ../asm-i386/atomic.h
94 ln -sf ../asm-i386/bitops.h
95 ln -sf ../asm-i386/boot.h
96 ln -sf ../asm-i386/byteorder.h
97 ln -sf ../asm-i386/cache.h
98 ln -sf ../asm-i386/checksum.h
99 ln -sf ../asm-i386/cpufeature.h
100 ln -sf ../asm-i386/current.h
101 ln -sf ../asm-i386/debugreg.h
102 ln -sf ../asm-i386/delay.h
103 ln -sf ../asm-i386/div64.h
104 ln -sf ../asm-i386/dma.h
105 ln -sf ../asm-i386/elf.h
106 ln -sf ../asm-i386/errno.h
107 ln -sf ../asm-i386/fcntl.h
108 ln -sf ../asm-i386/floppy.h
109 ln -sf ../asm-i386/hardirq.h
110 ln -sf ../asm-i386/hdreg.h
111 ln -sf ../asm-i386/i387.h
112 ln -sf ../asm-i386/ide.h
113 ln -sf ../asm-i386/init.h
114 ln -sf ../asm-i386/io_apic.h
115 ln -sf ../asm-i386/ioctl.h
116 ln -sf ../asm-i386/ioctls.h
117 ln -sf ../asm-i386/ipcbuf.h
118 ln -sf ../asm-i386/ipc.h
119 ln -sf ../asm-i386/kmap_types.h
120 ln -sf ../asm-i386/ldt.h
121 ln -sf ../asm-i386/linux_logo.h
122 ln -sf ../asm-i386/locks.h
123 ln -sf ../asm-i386/math_emu.h
124 ln -sf ../asm-i386/mc146818rtc.h
125 ln -sf ../asm-i386/mca_dma.h
126 ln -sf ../asm-i386/mman.h
127 ln -sf ../asm-i386/mmx.h
128 ln -sf ../asm-i386/module.h
129 ln -sf ../asm-i386/mpspec.h
130 ln -sf ../asm-i386/msgbuf.h
131 ln -sf ../asm-i386/msr.h
132 ln -sf ../asm-i386/mtrr.h
133 ln -sf ../asm-i386/namei.h
134 ln -sf ../asm-i386/param.h
135 ln -sf ../asm-i386/parport.h
136 ln -sf ../asm-i386/pgtable-3level.h
137 ln -sf ../asm-i386/poll.h
138 ln -sf ../asm-i386/posix_types.h
139 ln -sf ../asm-i386/resource.h
140 ln -sf ../asm-i386/rwlock.h
141 ln -sf ../asm-i386/rwsem.h
142 ln -sf ../asm-i386/scatterlist.h
143 ln -sf ../asm-i386/semaphore.h
144 ln -sf ../asm-i386/sembuf.h
145 ln -sf ../asm-i386/serial.h
146 ln -sf ../asm-i386/setup.h
147 ln -sf ../asm-i386/shmbuf.h
148 ln -sf ../asm-i386/shmparam.h
149 ln -sf ../asm-i386/sigcontext.h
150 ln -sf ../asm-i386/siginfo.h
151 ln -sf ../asm-i386/signal.h
152 ln -sf ../asm-i386/smplock.h
153 ln -sf ../asm-i386/socket.h
154 ln -sf ../asm-i386/sockios.h
155 ln -sf ../asm-i386/softirq.h
156 ln -sf ../asm-i386/spinlock.h
157 ln -sf ../asm-i386/statfs.h
158 ln -sf ../asm-i386/stat.h
159 ln -sf ../asm-i386/string-486.h
160 ln -sf ../asm-i386/string.h
161 ln -sf ../asm-i386/termbits.h
162 ln -sf ../asm-i386/termios.h
163 ln -sf ../asm-i386/timex.h
164 ln -sf ../asm-i386/tlb.h
165 ln -sf ../asm-i386/types.h
166 ln -sf ../asm-i386/uaccess.h
167 ln -sf ../asm-i386/ucontext.h
168 ln -sf ../asm-i386/unaligned.h
169 ln -sf ../asm-i386/unistd.h
170 ln -sf ../asm-i386/user.h
171 ln -sf ../asm-i386/vga.h
172 ln -sf ../asm-i386/xor.h
174 cd ../../arch/xeno/kernel
175 ln -sf ../../i386/kernel/i387.c
176 ln -sf ../../i386/kernel/init_task.c
177 ln -sf ../../i386/kernel/ptrace.c
178 ln -sf ../../i386/kernel/semaphore.c
179 ln -sf ../../i386/kernel/sys_i386.c
180 cd ../lib
181 ln -sf ../../i386/lib/checksum.S
182 ln -sf ../../i386/lib/dec_and_lock.c
183 ln -sf ../../i386/lib/getuser.S
184 ln -sf ../../i386/lib/iodebug.c
185 ln -sf ../../i386/lib/memcpy.c
186 ln -sf ../../i386/lib/mmx.c
187 ln -sf ../../i386/lib/old-checksum.c
188 ln -sf ../../i386/lib/strstr.c
189 ln -sf ../../i386/lib/usercopy.c
190 cd ../mm
191 ln -sf ../../i386/mm/extable.c
192 ln -sf ../../i386/mm/pageattr.c