aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-05-14 17:04:28 +0300
committerAvi Kivity <avi@redhat.com>2009-05-14 18:49:47 +0300
commit22d239bcee126742df46938ee8ddc7c6b9209e23 (patch)
treecc6c7a14658a179ad896fc197a5492c3472fcd7e
parent43c8806e4d84d99f24e8678c557730352588aab0 (diff)
Add support for building the kvm external module
If we find an external module in kvm/kernel/, build it. Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--Makefile15
-rwxr-xr-xconfigure12
2 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 521eddd20..f4f631738 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,18 @@ endif
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
+ifeq ($(KVM_KMOD),yes)
+
+.PHONEY: kvm-kmod
+
+all: kvm-kmod
+
+kvm-kmod:
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C kvm/kernel V="$(V)" )
+
+
+endif
+
subdir-%:
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
@@ -297,6 +309,9 @@ endif
for d in $(TARGET_DIRS); do \
$(MAKE) -C $$d $@ || exit 1 ; \
done
+ifeq ($(KVM_KMOD),yes)
+ $(MAKE) -C kvm/kernel $@
+endif
# various test targets
test speed: all
diff --git a/configure b/configure
index cc7f9f195..fc58acef6 100755
--- a/configure
+++ b/configure
@@ -210,6 +210,7 @@ pkgversion=" ($(kvm_version))"
signalfd="no"
eventfd="no"
cpu_emulation="yes"
+kvm_kmod="no"
# OS specific
if check_define __linux__ ; then
@@ -1397,6 +1398,15 @@ else
binsuffix="/bin"
fi
+if test -f kvm/kernel/configure; then
+ kvm_kmod="yes"
+ kmod_args=()
+ if test -n "$kerneldir"; then
+ kmod_args+=("--kerneldir=$kerneldir")
+ fi
+ (cd kvm/kernel; ./configure "${kmod_args[@]}")
+fi
+
echo "Install prefix $prefix"
echo "BIOS directory $prefix$datasuffix"
echo "binary directory $prefix$binsuffix"
@@ -1819,6 +1829,8 @@ if test "$kvm" = "yes" ; then
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
fi
+echo "KVM_KMOD=$kvm_kmod" >> $config_mak
+
tools=
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
tools="qemu-img\$(EXESUF) $tools"