* [PATCH] qemu-kvm: Fix configure to respect --kerneldir
@ 2009-10-10 9:58 Jan Kiszka
2009-10-13 19:01 ` [PATCH v2] " Jan Kiszka
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2009-10-10 9:58 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm-devel
[-- Attachment #1: Type: text/plain, Size: 2162 bytes --]
This simplifies working with new features without having to update the
locally mirrored headers. It also reduces the diff to upstream.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
configure | 44 +++++++++++++++++++++++++++-----------------
1 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/configure b/configure
index 8866258..3a4318c 100755
--- a/configure
+++ b/configure
@@ -1346,23 +1346,7 @@ fi
##########################################
# kvm probe
if test "$kvm" != "no" ; then
- case "$cpu" in
- i386 | x86_64)
- kvm_arch="x86"
- ;;
- ppc)
- kvm_arch="powerpc"
- ;;
- *)
- kvm_arch="$cpu"
- ;;
- esac
-
- kvm_cflags="-I$source_path/kvm/include"
- kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch"
- kvm_cflags="$kvm_cflags -idirafter $source_path/compat"
-
- cat > $TMPC <<EOF
+ cat > $TMPC <<EOF
#include <linux/kvm.h>
#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
#error Invalid KVM version
@@ -1378,6 +1362,32 @@ if test "$kvm" != "no" ; then
#endif
int main(void) { return 0; }
EOF
+ if test "$kerneldir" != "" ; then
+ kvm_cflags=-I"$kerneldir"/include
+ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
+ -a -d "$kerneldir/arch/x86/include" ; then
+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
+ elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
+ elif test -d "$kerneldir/arch/$cpu/include" ; then
+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
+ fi
+ else
+ case "$cpu" in
+ i386 | x86_64)
+ kvm_arch="x86"
+ ;;
+ ppc)
+ kvm_arch="powerpc"
+ ;;
+ *)
+ kvm_arch="$cpu"
+ ;;
+ esac
+ kvm_cflags="-I$source_path/kvm/include"
+ kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch"
+ fi
+ kvm_cflags="$kvm_cflags -idirafter $source_path/compat"
if compile_prog "$kvm_cflags" "" ; then
kvm=yes
else
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH v2] qemu-kvm: Fix configure to respect --kerneldir
2009-10-10 9:58 [PATCH] qemu-kvm: Fix configure to respect --kerneldir Jan Kiszka
@ 2009-10-13 19:01 ` Jan Kiszka
2009-10-13 19:44 ` Marcelo Tosatti
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2009-10-13 19:01 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm-devel
[-- Attachment #1: Type: text/plain, Size: 2350 bytes --]
This simplifies working with new features without having to update the
locally mirrored headers. It also reduces the diff to upstream.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
v2: Rebase over git head
configure | 46 ++++++++++++++++++++++++++++------------------
1 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index 2341772..fdefcf6 100755
--- a/configure
+++ b/configure
@@ -1346,24 +1346,7 @@ fi
##########################################
# kvm probe
if test "$kvm" != "no" ; then
- case "$cpu" in
- i386 | x86_64)
- kvm_arch="x86"
- ;;
- ppc)
- kvm_arch="powerpc"
- ;;
- *)
- kvm_arch="$cpu"
- ;;
- esac
-
- kvm_cflags="-I$source_path/kvm/include"
- kvm_cflags="$kvm_cflags -include $source_path/kvm/include/linux/config.h"
- kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch"
- kvm_cflags="$kvm_cflags -idirafter $source_path/compat"
-
- cat > $TMPC <<EOF
+ cat > $TMPC <<EOF
#include <linux/kvm.h>
#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
#error Invalid KVM version
@@ -1379,6 +1362,33 @@ if test "$kvm" != "no" ; then
#endif
int main(void) { return 0; }
EOF
+ if test "$kerneldir" != "" ; then
+ kvm_cflags=-I"$kerneldir"/include
+ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
+ -a -d "$kerneldir/arch/x86/include" ; then
+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
+ elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
+ elif test -d "$kerneldir/arch/$cpu/include" ; then
+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
+ fi
+ else
+ case "$cpu" in
+ i386 | x86_64)
+ kvm_arch="x86"
+ ;;
+ ppc)
+ kvm_arch="powerpc"
+ ;;
+ *)
+ kvm_arch="$cpu"
+ ;;
+ esac
+ kvm_cflags="-I$source_path/kvm/include"
+ kvm_cflags="$kvm_cflags -include $source_path/kvm/include/linux/config.h"
+ kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch"
+ fi
+ kvm_cflags="$kvm_cflags -idirafter $source_path/compat"
if compile_prog "$kvm_cflags" "" ; then
kvm=yes
else
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-13 21:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-10 9:58 [PATCH] qemu-kvm: Fix configure to respect --kerneldir Jan Kiszka
2009-10-13 19:01 ` [PATCH v2] " Jan Kiszka
2009-10-13 19:44 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).