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 <address@hidden>
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"