4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
6 qemu_cc
=$
(ls /usr
/bin
/gcc3
* /usr
/bin
/gcc-3
* 2>/dev
/null |
tail -n1)
15 --prefix=PREFIX where to install things ($prefix)
16 --with-patched-kernel don't use external module
17 --kerneldir=DIR kernel build directory ($kerneldir)
18 --qemu-cc="$qemu_cc" compiler for qemu (needs gcc3.x) ($qemu_cc)
19 --disable-gcc-check don't insist on gcc-3.x
20 - this will break running without kvm
26 # prefer gcc if its version is 3.* ( over a compat-gcc )
27 # do it before parsing command line arguments to enable the user
28 # to specify a specific gcc he/she likes.
29 if gcc
-v 2>&1 |
grep -q 'gcc *version *3\.[2-4]\.[0-9]'; then
33 while [[ "$1" = -* ]]; do
36 if [[ "$opt" = *=* ]]; then
47 --with-patched-kernel)
65 if [[ -z "$qemu_cc" ]]; then
66 echo "$0: cannot locate gcc 3.x. please install it or specify with --qemu-cc"
70 libkvm_kerneldir
="$kerneldir"
71 if (( want_module
)); then
72 libkvm_kerneldir
=$
(readlink
-f kernel
)
76 if [[ $
(uname
-m) = i?
86 ]]; then
83 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir")
84 (cd qemu
; .
/configure
--target-list=$
(target_cpu
)-softmmu --cc="$qemu_cc" \
85 --disable-kqemu --extra-cflags="-I $PWD/../user" \
86 --extra-ldflags="-L $PWD/../user" \
87 --enable-kvm --kernel-path="$libkvm_kerneldir" \
89 ${disable_gcc_check:+"--disable-gcc-check"} \
95 cat <<EOF > config.mak
98 WANT_MODULE=$want_module