4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
21 --arch=ARCH architecture to compile for ($arch)
22 --cross-prefix=PREFIX prefix for cross compile
23 --prefix=PREFIX where to install things ($prefix)
24 --with-patched-kernel don't use external module
25 --kerneldir=DIR kernel build directory ($kerneldir)
26 --qemu-cc=CC specify compiler for qemu (must be gcc-3.x)
27 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
28 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
29 --enable-alsa enable alsa support for qemu
30 --disable-vnc-tls disable vnc tls support for qemu
31 --disable-gcc-check don't insist on gcc-3.x
32 CAUTION: this will break running without kvm
37 while [[ "$1" = -* ]]; do
40 if [[ "$opt" = *=* ]]; then
51 --with-patched-kernel)
89 libkvm_kerneldir
="$kerneldir"
90 if (( want_module
)); then
91 libkvm_kerneldir
=$
(readlink
-f kernel
)
94 #if arch is an x86 arch set to i386
95 if [[ $arch = i?
86 ]]; then
99 #set parameters compiling
100 if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
101 target_exec
="x86_64-softmmu"
102 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
105 if [ "$arch" = "ia64" ]; then
106 target_exec
="ia64-softmmu"
110 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
112 ${cross_prefix:+"--cross-prefix=$cross_prefix"})
115 (cd qemu
; .
/configure
--target-list=$target_exec \
117 --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
118 --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
119 --enable-kvm --kernel-path="$libkvm_kerneldir" \
120 ${enable_alsa:+"--enable-alsa"} \
121 ${disable_vnc_tls:+"--disable-vnc-tls"} \
122 ${disable_gcc_check:+"--disable-gcc-check"} \
124 ${qemu_cc:+"--cc=$qemu_cc"} \
125 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
126 ${cross_prefix:+"--cpu=$arch"}
130 cat <<EOF > config.mak
134 WANT_MODULE=$want_module
135 CROSS_COMPILE=$cross_prefix