From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] qemu-kvm: Fix configure to respect --kerneldir Date: Sat, 10 Oct 2009 11:58:26 +0200 Message-ID: <4AD05AC2.1030100@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3C9603F26345B726DE52F431" Cc: kvm-devel To: Avi Kivity , Marcelo Tosatti Return-path: 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 Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3C9603F26345B726DE52F431 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable This simplifies working with new features without having to update the locally mirrored headers. It also reduces the diff to upstream. Signed-off-by: Jan Kiszka --- configure | 44 +++++++++++++++++++++++++++----------------- 1 files changed, 27 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 8866258..3a4318c 100755 --- a/configure +++ b/configure @@ -1346,23 +1346,7 @@ fi ########################################## # kvm probe if test "$kvm" !=3D "no" ; then - case "$cpu" in - i386 | x86_64) - kvm_arch=3D"x86" - ;; - ppc) - kvm_arch=3D"powerpc" - ;; - *) - kvm_arch=3D"$cpu" - ;; - esac - - kvm_cflags=3D"-I$source_path/kvm/include" - kvm_cflags=3D"$kvm_cflags -I$source_path/kvm/include/$kvm_arch" - kvm_cflags=3D"$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" !=3D "no" ; then #endif int main(void) { return 0; } EOF + if test "$kerneldir" !=3D "" ; then + kvm_cflags=3D-I"$kerneldir"/include + if test \( "$cpu" =3D "i386" -o "$cpu" =3D "x86_64" \) \ + -a -d "$kerneldir/arch/x86/include" ; then + kvm_cflags=3D"$kvm_cflags -I$kerneldir/arch/x86/include" + elif test "$cpu" =3D "ppc" -a -d "$kerneldir/arch/powerpc/include" ; th= en + kvm_cflags=3D"$kvm_cflags -I$kerneldir/arch/powerpc/include" + elif test -d "$kerneldir/arch/$cpu/include" ; then + kvm_cflags=3D"$kvm_cflags -I$kerneldir/arch/$cpu/include" + fi + else + case "$cpu" in + i386 | x86_64) + kvm_arch=3D"x86" + ;; + ppc) + kvm_arch=3D"powerpc" + ;; + *) + kvm_arch=3D"$cpu" + ;; + esac + kvm_cflags=3D"-I$source_path/kvm/include" + kvm_cflags=3D"$kvm_cflags -I$source_path/kvm/include/$kvm_arch" + fi + kvm_cflags=3D"$kvm_cflags -idirafter $source_path/compat" if compile_prog "$kvm_cflags" "" ; then kvm=3Dyes else --------------enig3C9603F26345B726DE52F431 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkrQWscACgkQitSsb3rl5xSzfACgvs6pmwQk7AN2ZI8Hho5zJT/1 7QkAmQHmluMvTyvgRzHhiDlhLk/5Kcfc =dchM -----END PGP SIGNATURE----- --------------enig3C9603F26345B726DE52F431--