ia64/xen-unstable

view unmodified_drivers/linux-2.6/mkbuildtree @ 18824:0b8c6c91c5a4

pv-on-hvm drivers: build fixes for Linux 2.6.27+

Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).

Portions from Charles Arnold <carnold@novell.com>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Nov 24 11:11:20 2008 +0000 (2008-11-24)
parents c98276a51ff8
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 ln -sf ${XL}/drivers/xen/core/features.c platform-pci
37 ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
38 ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
40 mkdir -p include/asm include/xen
42 lndir -silent ${XL}/include/xen include/xen
43 ln -nsf ${XEN}/include/public include/xen/interface
45 # Need to be quite careful here: we don't want the files we link in to
46 # risk overriding the native Linux ones (in particular, system.h must
47 # be native and not xenolinux).
48 case "$uname" in
49 i[34567]86|x86_64)
50 if [ -d ${XL}/include/asm-x86 ]; then
51 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm
52 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm
53 ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm
54 ln -sf ${XL}/include/asm-x86/mach-xen/asm/maddr*.h include/asm
55 ln -sf ${XL}/include/asm-x86/mach-xen/asm/gnttab_dma.h include/asm
56 ln -sf ${XL}/arch/x86/lib/scrub.c balloon
57 else
58 if [ $uname = x86_64 ]; then
59 mkdir -p include/asm-i386
60 lndir -silent ${XL}/include/asm-i386 include/asm-i386
61 else
62 uname=i386
63 fi
64 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypervisor.h include/asm
65 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypercall.h include/asm
66 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/synch_bitops.h include/asm
67 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/maddr.h include/asm
68 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
69 fi
70 ;;
71 "ia64")
72 ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
73 ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
74 ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
75 ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
76 ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
77 mkdir -p include/asm/xen
78 ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
79 ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
80 ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
81 ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
82 ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
83 ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
84 ;;
85 *)
86 echo unknown architecture $uname
87 exit 1
88 ;;
89 esac