4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
19 --arch=ARCH architecture to compile for ($arch)
20 --cross-prefix=PREFIX prefix for cross compile
21 --prefix=PREFIX where to install things ($prefix)
22 --with-patched-kernel don't use external module
23 --kerneldir=DIR kernel build directory ($kerneldir)
24 --qemu-cc=CC specify compiler for qemu (must be gcc-3.x)
25 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
26 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
28 Any additional option is given to qemu's configure verbatim; including:
30 --disable-gcc-check don't insist on gcc-3.x
31 CAUTION: this will break running without kvm
34 .
/configure
--help |
egrep "enable-|disable-" \
35 |
grep -v user |
grep -v system |
grep -v kqemu |
grep -v kvm \
37 |
sed -e"s/ enable/enable/g" |
sed -e "s/ disable/disable/g"
41 while [[ "$1" = -* ]]; do
44 if [[ "$opt" = *=* ]]; then
55 --with-patched-kernel)
77 qemu_opts
="$qemu_opts $opt"
84 libkvm_kerneldir
="$kerneldir"
85 if (( want_module
)); then
86 libkvm_kerneldir
=$
(readlink
-f kernel
)
89 #if arch is an x86 arch set to i386
90 if [[ $arch = i?
86 ]]; then
94 #set parameters compiling
95 if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
96 target_exec
="x86_64-softmmu"
97 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
100 if [ "$arch" = "ia64" ]; then
101 target_exec
="ia64-softmmu"
105 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
107 ${cross_prefix:+"--cross-prefix=$cross_prefix"})
109 (cd libkvm
; ln -sf "$kerneldir/include/asm-$arch" asm
)
112 (cd qemu
; .
/configure
--target-list=$target_exec \
114 --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
115 --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
116 --enable-kvm --kernel-path="$libkvm_kerneldir" \
118 ${qemu_cc:+"--cc=$qemu_cc"} \
119 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
120 ${cross_prefix:+"--cpu=$arch"} $qemu_opts
124 cat <<EOF > config.mak
128 WANT_MODULE=$want_module
129 CROSS_COMPILE=$cross_prefix