4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
17 # don't use uname if kerneldir is set
20 if [ -z "TMPDIR" ] ; then
29 --arch=ARCH architecture to compile for ($arch)
30 --cross-prefix=PREFIX prefix for cross compile
31 --prefix=PREFIX where to install things ($prefix)
32 --with-patched-kernel don't use external module
33 --with-kvm-trace Enable kvm_trace
34 --kerneldir=DIR kernel build directory ($kerneldir)
35 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
36 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
38 Any additional option is given to qemu's configure verbatim; including:
42 .
/configure
--help |
egrep "enable-|disable-" \
43 |
grep -v user |
grep -v system |
grep -v kqemu |
grep -v kvm \
45 |
sed -e"s/ enable/enable/g" |
sed -e "s/ disable/disable/g"
49 while [[ "$1" = -* ]]; do
53 if [[ "$opt" = *=* ]]; then
66 --with-patched-kernel)
88 qemu_opts
=("${qemu_opts[@]}" "$opt${hasarg:+=$arg}")
95 libkvm_kerneldir
=$
(readlink
-f kernel
)
99 arch
=${arch/#i?86/i386}
100 target_exec
="x86_64-softmmu"
101 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
104 target_exec
="ia64-softmmu"
107 target_exec
="ppcemb-softmmu"
108 qemu_cflags
="$qemu_cflags -I $PWD/libfdt"
109 qemu_ldflags
="$qemu_ldflags -L $PWD/libfdt"
116 #configure kernel module
119 --kerneldir="$kerneldir" \
121 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
122 ${kvm_trace:+"--with-kvm-trace"}
126 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
127 --arch="$arch" --processor="$processor" \
128 ${cross_prefix:+"--cross-prefix=$cross_prefix"})
131 (cd qemu
; .
/configure
--target-list=$target_exec \
133 --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
134 --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
135 --kerneldir="$libkvm_kerneldir" \
137 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
138 ${cross_prefix:+"--cpu=$arch"} "${qemu_opts[@]}"
142 cat <<EOF > config.mak
147 KERNELSOURCEDIR=$kernelsourcedir
148 LIBKVM_KERNELDIR=$libkvm_kerneldir
149 WANT_MODULE=$want_module
150 CROSS_COMPILE=$cross_prefix
153 OBJCOPY=$cross_prefix$objcopy