kvm: qemu: provide a reset method for virtio
[kvm-userspace.git] / user / configure
blob081e8b03b0d35606e3dc70312eab01c22b0a7587
1 #!/bin/bash
3 prefix=/usr/local
4 kerneldir=/lib/modules/$(uname -r)/build
5 cc=gcc
6 ld=ld
7 objcopy=objcopy
8 arch=`uname -m | sed -e s/i.86/i386/`
9 cross_prefix=
11 usage() {
12 cat <<-EOF
13 Usage: $0 [options]
15 Options include:
16 --arch=ARCH architecture to compile for ($arch)
17 --cross-prefix=PREFIX cross compiler prefix
18 --cc=CC c compiler to use ($cc)
19 --ld=LD ld linker to use ($ld)
20 --prefix=PREFIX where to install things ($prefix)
21 --kerneldir=DIR kernel build directory for kvm.h ($kerneldir)
22 EOF
23 exit 1
26 while [[ "$1" = -* ]]; do
27 opt="$1"; shift
28 arg=
29 if [[ "$opt" = *=* ]]; then
30 arg="${opt#*=}"
31 opt="${opt%%=*}"
33 case "$opt" in
34 --prefix)
35 prefix="$arg"
37 --kerneldir)
38 kerneldir="$arg"
40 --arch)
41 arch="$arg"
43 --cross-prefix)
44 cross_prefix="$arg"
46 --cc)
47 cc="$arg"
49 --ld)
50 ld="$arg"
52 --help)
53 usage
56 usage
58 esac
59 done
61 cat <<EOF > config.mak
62 PREFIX=$prefix
63 KERNELDIR=$(readlink -f $kerneldir)
64 ARCH=$arch
65 CC=$cross_prefix$cc
66 LD=$cross_prefix$ld
67 OBJCOPY=$cross_prefix$objcopy
68 EOF