James Pike wrote:
> Hi,
>
> I compile my kernel with make O=/home/james/compile/linux-2.6.25.1
>
> kvm detects this as the kernel directory. However when building in the
> "kernel" directory of the project it fails (it tries to include
> linux/compiler.h which is only in /usr/src/linux/..).
>
> This used to work but started breaking in kvm-61 onwards. I want to use kvm
> 61 but I don't want to dirty up my kernel source tree if I can help it.
>
> I tried appending the source directory to the include path with -I but this
> lead to another missing include (asm/types.h), then I added /usr/include to
> the path as well and .. well it just got worse.
James,
I have the same problem with recent kvm project kernel/Makefile. My kernel
source is in /usr/src/linux. I hand patch kvm's kernel/Makefile every kvm
project release as follows:
--- ../original/kernel/Makefile 2008-04-28 11:54:18.000000000 -0600
+++ Makefile 2008-04-28 11:59:36.000000000 -0600
@@ -9,7 +9,7 @@
rpmrelease = devel
-LINUX = ../linux-2.6
+LINUX = /usr/src/linux
version = $(shell cd $(LINUX); git describe)
@@ -27,7 +27,8 @@
all::
# include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
$(MAKE) -C $(KERNELDIR) M=`pwd` \
- LINUXINCLUDE="-I`pwd`/include -Iinclude -I`pwd`/include-compat \
+ LINUXINCLUDE="-I`pwd`/include -Iinclude
-I/usr/src/linux/include \
+ -I`pwd`/include-compat \
-include include/linux/autoconf.h" \
"$$@"
That's _not_ a portable patch at the very least due to the literal paths. It
works for OpenSuSE 10.3 (a patched 2.6.17 kernel) and kvm at least up to
kvm-68.
Basically, the kernel source's include directory has to come earlier in the
include path priority than kvm's kernel/include/compat. I can't remember if the
change to the LINUX variable is actually necessary.
---
David.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel