kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RESEND] Make KVM compile on split source/object kernel configurations
@ 2008-10-07  9:47 Alexander Graf
  2008-10-07 14:42 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2008-10-07  9:47 UTC (permalink / raw)
  To: kvm; +Cc: alexey.eremenko, Avi Kivity, jan.kiszka

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

KVM as is assumes that the kernel obj dir and the kernel source dir are
at the same location. This is true for most self-built vanilla kernels,
but some distributions split these up (e.g. SUSE).
To keep compatible and have users have a good experience on building KVM
on any distribution, this patch attempts to rebuild the logic from the
kernel Makefile as closely as possible. With it I successfully built KVM
on a current SUSE system.


Signed-off-by: Alexander Graf <agraf@suse.de>





[-- Attachment #2: kvm-split-source-obj.diff --]
[-- Type: text/x-patch, Size: 1501 bytes --]

diff --git a/configure b/configure
index 3bb10ce..5e9cbab 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 prefix=/usr/local
+kernelsourcedir=
 kerneldir=/lib/modules/$(uname -r)/build
 cc=gcc
 ld=ld
@@ -102,6 +103,11 @@ if [ "$arch" = "powerpc" ]; then
     qemu_ldflags="$qemu_ldflags -L $PWD/libfdt"
 fi
 
+# see if we have split build and source directories
+if [ -d "$kerneldir/include2" ]; then
+    kernelsourcedir=${kerneldir%/*}/source
+fi
+
 #configure user dir
 (cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
           --arch="$arch" \
@@ -124,6 +130,7 @@ cat <<EOF > config.mak
 ARCH=$arch
 PREFIX=$prefix
 KERNELDIR=$kerneldir
+KERNELSOURCEDIR=$kernelsourcedir
 LIBKVM_KERNELDIR=$libkvm_kerneldir
 WANT_MODULE=$want_module
 CROSS_COMPILE=$cross_prefix
diff --git a/kernel/Makefile b/kernel/Makefile
index 3f5f6da..d2cf89c 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -36,7 +36,9 @@ hack-files = $(hack-files-$(ARCH_DIR))
 all:: header-link prerequisite
 #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
 	$(MAKE) -C $(KERNELDIR) M=`pwd` \
-		LINUXINCLUDE="-I`pwd`/include -Iinclude -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
+		LINUXINCLUDE="-I`pwd`/include -Iinclude \
+		$(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \
+		-Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
 		-include include/linux/autoconf.h \
 		-include `pwd`/$(ARCH_DIR)/external-module-compat.h"
 		"$$@"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [RESEND] Make KVM compile on split source/object kernel configurations
  2008-10-07  9:47 [PATCH] [RESEND] Make KVM compile on split source/object kernel configurations Alexander Graf
@ 2008-10-07 14:42 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-10-07 14:42 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm, alexey.eremenko, jan.kiszka

Alexander Graf wrote:
> KVM as is assumes that the kernel obj dir and the kernel source dir are
> at the same location. This is true for most self-built vanilla kernels,
> but some distributions split these up (e.g. SUSE).
> To keep compatible and have users have a good experience on building KVM
> on any distribution, this patch attempts to rebuild the logic from the
> kernel Makefile as closely as possible. With it I successfully built KVM
> on a current SUSE system.
>
>

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-07 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-07  9:47 [PATCH] [RESEND] Make KVM compile on split source/object kernel configurations Alexander Graf
2008-10-07 14:42 ` Avi Kivity

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).