From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] Make KVM compile on split source/object kernel configurations Date: Mon, 29 Sep 2008 20:32:57 +0200 Message-ID: <48E11F59.5070102@web.de> References: <48CE6F0E.6020601@suse.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig31E2B7ECDF419C76D8CFC1D9" Cc: "kvm@vger.kernel.org list" , Alexey Eremenko , "avi@qumranet.com Kivity" To: Alexander Graf Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:52703 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbYI2SdJ (ORCPT ); Mon, 29 Sep 2008 14:33:09 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig31E2B7ECDF419C76D8CFC1D9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Alexander Graf wrote: > Any further comments on this? I would really like to see KVM build > out-of-the-box on SUSE kernels (and kernels built with O=3D at the same= > time). > > Alex /me, too. And my colleagues @work. We carry around an old hack to build against SuSE, now waiting for your clean solution to be merged. Jan >=20 > On 15.09.2008, at 16:19, Alexander Graf wrote: >=20 >> KVM as is assumes that the kernel obj dir and the kernel source dir >> are at the same location. This is true for most self-built vanilla >> kernels, but some distributions split these up (e.g. SUSE). >> To keep compatible and have users have a good experience on building >> KVM on any distribution, this patch attempts to rebuild the logic from= >> the kernel Makefile as closely as possible. With it I successfully >> built KVM on a current SUSE system. >> >> Signed-off-by: Alexander Graf >> >> Please check and see if it breaks the build process for anyone else. >> Building with IA64 on SUSE-kernels is still broken due to similar but >> separate problems. >> >> >> diff --git a/configure b/configure >> index 3bb10ce..5e9cbab 100755 >> --- a/configure >> +++ b/configure >> @@ -1,6 +1,7 @@ >> #!/bin/bash >> >> prefix=3D/usr/local >> +kernelsourcedir=3D >> kerneldir=3D/lib/modules/$(uname -r)/build >> cc=3Dgcc >> ld=3Dld >> @@ -102,6 +103,11 @@ if [ "$arch" =3D "powerpc" ]; then >> qemu_ldflags=3D"$qemu_ldflags -L $PWD/libfdt" >> fi >> >> +# see if we have split build and source directories >> +if [ -d "$kerneldir/include2" ]; then >> + kernelsourcedir=3D${kerneldir%/*}/source >> +fi >> + >> #configure user dir >> (cd user; ./configure --prefix=3D"$prefix" >> --kerneldir=3D"$libkvm_kerneldir" \ >> --arch=3D"$arch" \ >> @@ -124,6 +130,7 @@ cat < config.mak >> ARCH=3D$arch >> PREFIX=3D$prefix >> KERNELDIR=3D$kerneldir >> +KERNELSOURCEDIR=3D$kernelsourcedir >> LIBKVM_KERNELDIR=3D$libkvm_kerneldir >> WANT_MODULE=3D$want_module >> CROSS_COMPILE=3D$cross_prefix >> diff --git a/kernel/Makefile b/kernel/Makefile >> index 3f5f6da..d2cf89c 100644 >> --- a/kernel/Makefile >> +++ b/kernel/Makefile >> @@ -36,7 +36,9 @@ hack-files =3D $(hack-files-$(ARCH_DIR)) >> all:: header-link prerequisite >> # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat= >> $(MAKE) -C $(KERNELDIR) M=3D`pwd` \ >> - LINUXINCLUDE=3D"-I`pwd`/include -Iinclude >> -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \ >> + LINUXINCLUDE=3D"-I`pwd`/include -Iinclude \ >> + $(if $(KERNELSOURCEDIR),-Iinclude2 >> -I$(KERNELSOURCEDIR)/include) \ >> + -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \ >> -include include/linux/autoconf.h \ >> -include `pwd`/$(ARCH_DIR)/external-module-compat.h" >> "$$@" >=20 > --=20 > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >=20 --------------enig31E2B7ECDF419C76D8CFC1D9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjhH14ACgkQniDOoMHTA+lshQCeO8a+XF8JhlFUqdDjDkG7JSmO yfEAn1O5IXahdHgVeHL7w2zk1w+tPzw1 =Fial -----END PGP SIGNATURE----- --------------enig31E2B7ECDF419C76D8CFC1D9--