From patchwork Sat Oct 10 09:58:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 52917 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9AA2PJD007090 for ; Sat, 10 Oct 2009 10:02:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756862AbZJJJ7N (ORCPT ); Sat, 10 Oct 2009 05:59:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756770AbZJJJ7N (ORCPT ); Sat, 10 Oct 2009 05:59:13 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:51517 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756146AbZJJJ7M (ORCPT ); Sat, 10 Oct 2009 05:59:12 -0400 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id 6B789120CD14A; Sat, 10 Oct 2009 11:58:35 +0200 (CEST) Received: from [88.64.17.85] (helo=[192.168.1.10]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1MwYie-0000s0-00; Sat, 10 Oct 2009 11:58:32 +0200 Message-ID: <4AD05AC2.1030100@web.de> Date: Sat, 10 Oct 2009 11:58:26 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity , Marcelo Tosatti CC: kvm-devel Subject: [PATCH] qemu-kvm: Fix configure to respect --kerneldir X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+93vABHSXp8GPFqh2c7VqA5sXZIsD2g7Z/+UNQ RlIYjmSMgqp7PjuxEMMV+K8MNEjI0V0iP2slU+oYKGw3aIvVTf Cax/fKcls= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/configure b/configure index 8866258..3a4318c 100755 --- a/configure +++ b/configure @@ -1346,23 +1346,7 @@ fi ########################################## # kvm probe if test "$kvm" != "no" ; then - case "$cpu" in - i386 | x86_64) - kvm_arch="x86" - ;; - ppc) - kvm_arch="powerpc" - ;; - *) - kvm_arch="$cpu" - ;; - esac - - kvm_cflags="-I$source_path/kvm/include" - kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch" - kvm_cflags="$kvm_cflags -idirafter $source_path/compat" - - cat > $TMPC < $TMPC < #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12 #error Invalid KVM version @@ -1378,6 +1362,32 @@ if test "$kvm" != "no" ; then #endif int main(void) { return 0; } EOF + if test "$kerneldir" != "" ; then + kvm_cflags=-I"$kerneldir"/include + if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \ + -a -d "$kerneldir/arch/x86/include" ; then + kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include" + elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then + kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include" + elif test -d "$kerneldir/arch/$cpu/include" ; then + kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include" + fi + else + case "$cpu" in + i386 | x86_64) + kvm_arch="x86" + ;; + ppc) + kvm_arch="powerpc" + ;; + *) + kvm_arch="$cpu" + ;; + esac + kvm_cflags="-I$source_path/kvm/include" + kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch" + fi + kvm_cflags="$kvm_cflags -idirafter $source_path/compat" if compile_prog "$kvm_cflags" "" ; then kvm=yes else