* [Qemu-devel] [PATCH] Set a useful default for kerneldir
@ 2009-07-01 9:33 Andi Kleen
2009-07-01 13:31 ` Anthony Liguori
2009-07-09 19:00 ` Anthony Liguori
0 siblings, 2 replies; 5+ messages in thread
From: Andi Kleen @ 2009-07-01 9:33 UTC (permalink / raw)
To: qemu-devel
When no explicit kerneldir is specified use the standard
/lib/modules/$(uname -r)/build
convention to find the kernel includes. This should work out of the box
on a large number of distributions.
Also support separate objdirs.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/configure b/configure
index eb9d73a..8c2491d 100755
--- a/configure
+++ b/configure
@@ -1148,6 +1148,13 @@ if test "$kvm" = "yes" ; then
#endif
int main(void) { return 0; }
EOF
+ if test "$kerneldir" = "" ; then
+ kerneldir="/lib/modules/`uname -r`/build"
+ if test -d "$kerneldir/source" ; then
+ kerneldir="$kerneldir/source"
+ fi
+ fi
+ echo "Kerneldir $kerneldir"
if test "$kerneldir" != "" ; then
kvm_cflags=-I"$kerneldir"/include
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Set a useful default for kerneldir
2009-07-01 9:33 [Qemu-devel] [PATCH] Set a useful default for kerneldir Andi Kleen
@ 2009-07-01 13:31 ` Anthony Liguori
2009-07-01 13:40 ` Andi Kleen
2009-07-01 15:10 ` Avi Kivity
2009-07-09 19:00 ` Anthony Liguori
1 sibling, 2 replies; 5+ messages in thread
From: Anthony Liguori @ 2009-07-01 13:31 UTC (permalink / raw)
To: Andi Kleen; +Cc: qemu-devel
Andi Kleen wrote:
> When no explicit kerneldir is specified use the standard
> /lib/modules/$(uname -r)/build
> convention to find the kernel includes. This should work out of the box
> on a large number of distributions.
>
> Also support separate objdirs.
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
The reason we don't specify an explicit include is that it makes it
possible to have a cross compiler with headers installed in the cross
compilers root. If you default to /lib/modules, you have to explicitly
override it when cross compiling.
Another option would be to just include the KVM headers in QEMU.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Set a useful default for kerneldir
2009-07-01 13:31 ` Anthony Liguori
@ 2009-07-01 13:40 ` Andi Kleen
2009-07-01 15:10 ` Avi Kivity
1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2009-07-01 13:40 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Andi Kleen, qemu-devel
On Wed, Jul 01, 2009 at 08:31:39AM -0500, Anthony Liguori wrote:
> The reason we don't specify an explicit include is that it makes it
> possible to have a cross compiler with headers installed in the cross
> compilers root. If you default to /lib/modules, you have to explicitly
> override it when cross compiling.
You can still override it for special cases. This is just a better
default than /usr/include which is near always wrong.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Set a useful default for kerneldir
2009-07-01 13:31 ` Anthony Liguori
2009-07-01 13:40 ` Andi Kleen
@ 2009-07-01 15:10 ` Avi Kivity
1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2009-07-01 15:10 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Andi Kleen, qemu-devel
On 07/01/2009 04:31 PM, Anthony Liguori wrote:
> Andi Kleen wrote:
>> When no explicit kerneldir is specified use the standard
>> /lib/modules/$(uname -r)/build
>> convention to find the kernel includes. This should work out of the
>> box on a large number of distributions.
>>
>> Also support separate objdirs.
>>
>> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> The reason we don't specify an explicit include is that it makes it
> possible to have a cross compiler with headers installed in the cross
> compilers root. If you default to /lib/modules, you have to
> explicitly override it when cross compiling.
>
> Another option would be to just include the KVM headers in QEMU.
Or to have kvm-kmod install the headers in /usr/local/include. I'm wary
about that though, it makes qemu features depend on the installation
order of qemu and kvm-kmod.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Set a useful default for kerneldir
2009-07-01 9:33 [Qemu-devel] [PATCH] Set a useful default for kerneldir Andi Kleen
2009-07-01 13:31 ` Anthony Liguori
@ 2009-07-09 19:00 ` Anthony Liguori
1 sibling, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2009-07-09 19:00 UTC (permalink / raw)
To: Andi Kleen; +Cc: qemu-devel
Andi Kleen wrote:
> When no explicit kerneldir is specified use the standard
> /lib/modules/$(uname -r)/build
> convention to find the kernel includes. This should work out of the box
> on a large number of distributions.
>
> Also support separate objdirs.
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> diff --git a/configure b/configure
> index eb9d73a..8c2491d 100755
> --- a/configure
> +++ b/configure
> @@ -1148,6 +1148,13 @@ if test "$kvm" = "yes" ; then
> #endif
> int main(void) { return 0; }
> EOF
> + if test "$kerneldir" = "" ; then
> + kerneldir="/lib/modules/`uname -r`/build"
> + if test -d "$kerneldir/source" ; then
> + kerneldir="$kerneldir/source"
> + fi
> + fi
> + echo "Kerneldir $kerneldir"
>
This is the wrong place for this echo. They're all unified in a block
further down in the code.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-07-09 19:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-01 9:33 [Qemu-devel] [PATCH] Set a useful default for kerneldir Andi Kleen
2009-07-01 13:31 ` Anthony Liguori
2009-07-01 13:40 ` Andi Kleen
2009-07-01 15:10 ` Avi Kivity
2009-07-09 19:00 ` Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.