From: Avi Kivity <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
diff --git a/Makefile.target b/Makefile.target
index 0041a46..abcccc8 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -134,6 +134,9 @@ endif
kvm.o: CFLAGS+=$(KVM_CFLAGS)
kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
+qemu-kvm.o qemu-kvm-x86.o device-assignment.o ioapic.o i8259.o kvm-tpr-opt.o: \
+ CFLAGS+=$(KVM_CFLAGS)
+
all: $(PROGS)
#########################################################
@@ -601,8 +604,7 @@ ifdef CONFIG_CS4231A
SOUND_HW += cs4231a.o
endif
-ifdef CONFIG_KVM_KERNEL_INC
-CFLAGS += -I $(CONFIG_KVM_KERNEL_INC)
+ifdef USE_KVM
DEPLIBS += libkvm.a
endif
@@ -827,7 +829,7 @@ $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
$(DEPLIBS)
FORCE:
libkvm.a: FORCE
- $(MAKE) -C ../kvm/libkvm
+ $(MAKE) -C ../kvm/libkvm KVM_CFLAGS="$(KVM_CFLAGS)"
if ! cmp -s libkvm.a ../kvm/libkvm/libkvm.a; then \
cp ../kvm/libkvm/libkvm.a . ; \
fi
diff --git a/configure b/configure
index a2b8c0f..fc0fb9b 100755
--- a/configure
+++ b/configure
@@ -199,9 +199,6 @@ signalfd="no"
eventfd="no"
cpu_emulation="yes"
-# qemu-kvm: use local kerneldir
-kerneldir="$(readlink -f kvm/kernel)"
-
# OS specific
if check_define __linux__ ; then
targetos="Linux"
@@ -815,8 +812,22 @@ fi
##########################################
# KVM probe
+case "$cpu" in
+ i386 | x86_64)
+ kvm_arch="x86"
+ ;;
+ *)
+ kvm_arch="$cpu"
+ ;;
+esac
+
+kvm_cflags=""
+
if test "$kvm" = "yes" ; then
+kvm_cflags="-I$source_path/kvm/kernel/include"
+kvm_cflags="$kvm_cflags -I$source_path/kvm/kernel/arch/$kvm_arch/include"
+
# test for KVM_CAP_PIT
cat > $TMPC <<EOF
@@ -826,7 +837,7 @@ cat > $TMPC <<EOF
#endif
int main(void) { return 0; }
EOF
- if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include -o $TMPE ${OS_CFLAGS}
$TMPC 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2>
/dev/null ; then
kvm_cap_pit="yes"
fi
@@ -839,7 +850,7 @@ cat > $TMPC <<EOF
#endif
int main(void) { return 0; }
EOF
- if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include -o $TMPE ${OS_CFLAGS}
$TMPC 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2>
/dev/null ; then
kvm_cap_device_assignment="yes"
fi
fi
@@ -1168,19 +1179,6 @@ if test "$kvm" = "yes" ; 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
- kvm_cflags=""
- fi
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
> /dev/null 2>/dev/null ; then
:
@@ -1897,7 +1895,7 @@ configure_kvm() {
\( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu"
= "powerpc" \); then
echo "#define USE_KVM 1" >> $config_h
echo "USE_KVM=1" >> $config_mak
- echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> "config-host.mak"
+ echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
if test $kvm_cap_pit = "yes" ; then
echo "USE_KVM_PIT=1" >> $config_mak
echo "#define USE_KVM_PIT 1" >> $config_h
diff --git a/kvm/libkvm/Makefile b/kvm/libkvm/Makefile
index 8811d84..727ce48 100644
--- a/kvm/libkvm/Makefile
+++ b/kvm/libkvm/Makefile
@@ -12,7 +12,7 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc
/dev/null \
CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall
CFLAGS += $(call cc-option, -fno-stack-protector, "")
CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
-CFLAGS += -I$(CONFIG_KVM_KERNEL_INC)
+CFLAGS += $(KVM_CFLAGS)
LDFLAGS += $(CFLAGS)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html