From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLwBy-0005wk-Qy for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:33:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLwBt-0005r4-Pq for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:33:25 -0400 Received: from [199.232.76.173] (port=48648 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLwBt-0005qr-Fq for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:33:21 -0400 Received: from one.firstfloor.org ([213.235.205.2]:42562) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLwBs-00083U-SK for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:33:21 -0400 Received: from basil.firstfloor.org (p5B3CB7E5.dip0.t-ipconnect.de [91.60.183.229]) by one.firstfloor.org (Postfix) with ESMTP id 697401A98002 for ; Wed, 1 Jul 2009 11:33:19 +0200 (CEST) Date: Wed, 1 Jul 2009 11:33:19 +0200 From: Andi Kleen Message-ID: <20090701093319.GA12461@basil.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Set a useful default for kerneldir List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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.