debuggers.hg

view unmodified_drivers/linux-2.6/mkbuildtree @ 20342:bc6fe0a7622a

pv-on-hvm: Adjust mkbuildtree to handle pv_ops header placement

Due to the movement of the arch include directories, we need to adjust
where mkbuildtree looks for headers when building the pv drivers.
Also add a check for the location of features.c

Signed-off-by: Charles Arnold <carnold@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Oct 14 08:29:56 2009 +0100 (2009-10-14)
parents 0b8c6c91c5a4
children
line source
1 #! /bin/sh
3 if [ $1 ]; then
4 uname="$1"
5 else
6 uname=`uname -m`
7 echo "Defaulting to this machine's architecture, $uname, for linking."
8 echo "This may be overridden on the command line (i386,x86_64,ia64)."
9 fi
11 C=$(cd $(dirname $0) && pwd)
12 R=${C%/*/*}
14 if [ -n "$XEN" -a -d "$XEN" ]; then
15 XEN=$(cd $XEN && pwd)
16 else
17 XEN=$R/xen
18 fi
19 echo "Xen tree: $XEN"
21 if [ -n "$XL" -a -d "$XL" ]; then
22 XL=$(cd $XL && pwd)
23 else
24 XL=$R/linux-2.6.18-xen.hg
25 fi
26 echo "Linux tree: $XL"
28 cd $C
30 for d in $(find ${XL}/drivers/xen/ -mindepth 1 -maxdepth 1 -type d); do
31 test -d $(basename $d) || continue
32 lndir $d $(basename $d) > /dev/null 2>&1
33 done
35 ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci
36 if [ -f ${XL}/drivers/xen/core/features.c ]; then
37 ln -sf ${XL}/drivers/xen/core/features.c platform-pci
38 else
39 ln -sf ${XL}/drivers/xen/features.c platform-pci
40 fi
41 ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
42 ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
44 mkdir -p include/asm include/xen
46 lndir -silent ${XL}/include/xen include/xen
47 ln -nsf ${XEN}/include/public include/xen/interface
49 # Need to be quite careful here: we don't want the files we link in to
50 # risk overriding the native Linux ones (in particular, system.h must
51 # be native and not xenolinux).
52 case "$uname" in
53 i[34567]86|x86_64)
54 if [ -d ${XL}/arch/x86/include/mach-xen ]; then
55 ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypervisor.h include/asm
56 ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypercall*.h include/asm
57 ln -sf ${XL}/arch/x86/include/mach-xen/asm/synch_bitops*.h include/asm
58 ln -sf ${XL}/arch/x86/include/mach-xen/asm/maddr*.h include/asm
59 ln -sf ${XL}/arch/x86/include/mach-xen/asm/gnttab_dma.h include/asm
60 ln -sf ${XL}/arch/x86/lib/scrub.c balloon
61 elif [ -d ${XL}/include/asm-x86 ]; then
62 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm
63 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm
64 ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm
65 ln -sf ${XL}/include/asm-x86/mach-xen/asm/maddr*.h include/asm
66 ln -sf ${XL}/include/asm-x86/mach-xen/asm/gnttab_dma.h include/asm
67 ln -sf ${XL}/arch/x86/lib/scrub.c balloon
68 else
69 if [ $uname = x86_64 ]; then
70 mkdir -p include/asm-i386
71 lndir -silent ${XL}/include/asm-i386 include/asm-i386
72 else
73 uname=i386
74 fi
75 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypervisor.h include/asm
76 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypercall.h include/asm
77 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/synch_bitops.h include/asm
78 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/maddr.h include/asm
79 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
80 fi
81 ;;
82 "ia64")
83 ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
84 ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
85 ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
86 ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
87 ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
88 mkdir -p include/asm/xen
89 ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
90 ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
91 ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
92 ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
93 ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
94 ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
95 ;;
96 *)
97 echo unknown architecture $uname
98 exit 1
99 ;;
100 esac