From patchwork Tue Oct 13 19:01:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 53484 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 n9DJIDvu008873 for ; Tue, 13 Oct 2009 19:18:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751733AbZJMTJC (ORCPT ); Tue, 13 Oct 2009 15:09:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753174AbZJMTJC (ORCPT ); Tue, 13 Oct 2009 15:09:02 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:46651 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbZJMTJB (ORCPT ); Tue, 13 Oct 2009 15:09:01 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 906AD12FAE1B3; Tue, 13 Oct 2009 21:01:17 +0200 (CEST) Received: from [88.65.44.9] (helo=[192.168.1.10]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1MxmcW-0000RQ-00; Tue, 13 Oct 2009 21:01:17 +0200 Message-ID: <4AD4CE75.1000603@web.de> Date: Tue, 13 Oct 2009 21:01:09 +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: Marcelo Tosatti CC: kvm-devel Subject: [PATCH v2] qemu-kvm: Fix configure to respect --kerneldir References: <4AD05AC2.1030100@web.de> In-Reply-To: <4AD05AC2.1030100@web.de> X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+tK4b5fYEHW05MGy9e0Swd+CCJjmdbTZR9w2ra PNZohe3i+gyETI0gbJykXgrXETbLC1dpy6OFfGrRrQvtJPTo3N VwWCSTkOo= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/configure b/configure index 2341772..fdefcf6 100755 --- a/configure +++ b/configure @@ -1346,24 +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 -include $source_path/kvm/include/linux/config.h" - 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 @@ -1379,6 +1362,33 @@ 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 -include $source_path/kvm/include/linux/config.h" + 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