From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeSCo-0007Te-Lb for qemu-devel@nongnu.org; Tue, 22 Sep 2015 14:22:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeSCl-0001w6-FY for qemu-devel@nongnu.org; Tue, 22 Sep 2015 14:22:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeSCl-0001vq-5D for qemu-devel@nongnu.org; Tue, 22 Sep 2015 14:22:15 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id B6394AC85C for ; Tue, 22 Sep 2015 18:22:14 +0000 (UTC) References: <1442939759-9862-1-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <56019C51.6050600@redhat.com> Date: Tue, 22 Sep 2015 12:22:09 -0600 MIME-Version: 1.0 In-Reply-To: <1442939759-9862-1-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IsowdWqd7NxIFFsLE2ONEdHJKRB8btUxp" Subject: Re: [Qemu-devel] [PATCH] docs: describe the QEMU build system structure / design List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IsowdWqd7NxIFFsLE2ONEdHJKRB8btUxp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2015 10:35 AM, Daniel P. Berrange wrote: > Developers who are new to QEMU, or have a background familiarity > with GNU autotools can have trouble getting their head around the s/autotools/autotools,/ > home-grown QEMU build system. This document attempts to explain > the structure / design of the configure script and the various > Makefile pieces that live across the source tree. >=20 > Signed-off-by: Daniel P. Berrange > --- > docs/build-system.txt | 493 ++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 493 insertions(+) > create mode 100644 docs/build-system.txt >=20 > +Stage 1: configure > + > +In contrast to autoconf scripts, QEMU's configure is expected to be > +silent while it is checking for features. It will only display output > +when an error occurrs, or to show the final feature enablement summary= s/occurrs/occurs/ > +on completion. > + > +Adding new checks to the configure script usually comprises the > +following tasks > + > + - Initialize one or more variables with the default feature state. > + > + Ideally features should auto-detect whether they are present, > + so try to avoid hardcoding the initial state to either enabled > + or disabled, as that forces the user to pass a --{dis,en}able-XXX > + flag on every invokation of configure s/invokation/invocation/ > +Stage 2: makefiles > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +Although the source code is spread across multiple subdirectories, the= > +build system should be considered largely non-recursive in nature, in > +contrast to common practices seen with automake. There is some recursi= ve > +invokation of make, but this is related to the things being built, > +rather than the source directory structure. s/invokation/invocation/ Mention that we require GNU make. > +Module structure > +---------------- > + > +There are a number of key outputs of the QEMU build system > + > + - Tools - qemu-img, qemu-nbd, qga (guest agent), etc > + - System emulators - qemu-system-$ARCH > + - Userspace emulators - qemu-$ARCH > + - Unit tests > + > +The source code is highly modularized, split across many files to > +facilitate building of all of these components with as little duplicat= ed > +compilation as possible. There can be considered to be two distinct > +groups of files, those which are independant of the QEMU emulation > +target and those which are dependant on the QEMU emulation target. Throughout this section: s/(in)?dependant/dependent/ > + > +Statically defined files > +------------------------ > +The recursive invokation will end up processing the toplevel s/invokation/invocation/ > + > +Dynamically created files > +------------------------- > + > +The following files are generated dynamically by configure in order to= > +control the behaviour of the staticaly defined makefiles. This avoids s/staticaly/statically/ > + > +It is also used as a dependancy checking mechanism. If make sees that s/dependancy/dependency/ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IsowdWqd7NxIFFsLE2ONEdHJKRB8btUxp 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWAZxRAAoJEKeha0olJ0NqMUEH/3VQpo/SWZkttdH6Vq9OYkyG 9NmGUpQiGMSI2DRPDVnrf8mQ0/c5WGAWTE8rCBFP3B2BoY9O2rj9L5mlB1RFDyO/ bRspXPPLzUYYk9+26maweqAfQ73nasl59YHLpxt7VA6txrIoBSmYKKY3BNlALSHh PdKoRU6YjMLa9GBL9lNorQRDt9yhW7Cb7dBmYrDHf1/w6ZWY6w2Wp9OUrZVrvjZp SxKhlmVDlLIQxX5xMcFn8Ly23jRvJbHTvCrLiso5YloThpcVOis+pueMQ/kXgKHm majF9JvlLM6Inj+ZIbfMXgHlIVy9EQ1vZd93mfwxulGqHRaSHGnZePNsUM0j0zo= =Qi26 -----END PGP SIGNATURE----- --IsowdWqd7NxIFFsLE2ONEdHJKRB8btUxp--