From: Avi Kivity <[email protected]>

If we find an external module in kvm/kernel/, build it.

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/Makefile b/Makefile
index 521eddd..f4f6317 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 cc7f9f1..fc58ace 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_ar...@]}")
+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"
--
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

Reply via email to