22 --arch=ARCH architecture to compile for ($arch)
23 --cross-prefix=PREFIX prefix for cross compile
24 --prefix=PREFIX where to install things ($prefix)
25 --with-patched-kernel don't use external module
26 --with-kvm-trace Enable kvm_trace
27 --kerneldir=DIR kernel build directory ($kerneldir)
28 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
29 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
31 Any additional option is given to qemu's configure verbatim; including:
37 while [[ "$1" = -* ]]; do
41 if [[ "$opt" = *=* ]]; then
53 --with-patched-kernel)
75 qemu_opts
=("${qemu_opts[@]}" "$opt${hasarg:+=$arg}")
82 #libkvm_kerneldir=$(readlink -f kernel)
84 #if arch is an x86 arch set to i386
85 if [[ $arch = i?
86 ]]; then
89 #set parameters compiling
90 if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
91 target_exec
="x86_64-softmmu"
92 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
95 if [ "$arch" = "ia64" ]; then
96 target_exec
="ia64-softmmu"
99 if [ "$arch" = "powerpc" ]; then
100 target_exec
="ppcemb-softmmu"
101 qemu_cflags
="$qemu_cflags -I $PWD/libfdt"
102 qemu_ldflags
="$qemu_ldflags -L $PWD/libfdt"
105 # see if we have split build and source directories
106 #if [ -d "$kerneldir/include2" ]; then
107 # kernelsourcedir=${kerneldir%/*}/source
111 #(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
113 # ${cross_prefix:+"--cross-prefix=$cross_prefix"})
116 #(cd qemu; ./configure --target-list=$target_exec \
118 # --disable-gcc-check \
119 # --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
120 # --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
121 # --kernel-path="$libkvm_kerneldir" \
122 # --prefix="$prefix" \
123 # ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
124 # ${cross_prefix:+"--cpu=$arch"} "${qemu_opts[@]}"
128 cat <<EOF > config.mak
132 KERNELSOURCEDIR=$kernelsourcedir
133 LIBKVM_KERNELDIR=$libkvm_kerneldir
134 WANT_MODULE=$want_module
135 CROSS_COMPILE=$cross_prefix
138 OBJCOPY=$cross_prefix$objcopy
141 #cat <<EOF > kernel/config.kbuild
142 EXT_CONFIG_KVM_TRACE
=$kvm_trace