[libvirt] [PATCHv2 2/2] build: fix VPATH build of docs

Eric Blake eblake at redhat.com
Thu Apr 29 01:53:27 UTC 2010

On 04/28/2010 07:37 PM, Eric Blake wrote:
> The rule of thumb for generated files:
> If they are distributed, they should be generated in $(srcdir);
> otherwise, they should be built by the end user in $(builddir).

A minor clarification: a generated file must be machine-independent
before it is a candidate for distribution.  (For an obvious example, .o
files are generated, but are definitely machine-dependent, hence they
must live in $(builddir) and be built by the end user.  As another
example, configure and Makefile.in are generated but
machine-independent, while config.status and Makefile are generated but
machine-dependent, so only the former set belongs in the tarball.)  The
tools used for generating files are only optional if the tool is only
needed for generating files into $(srcdir) (back to our example, cc is
an end user prerequisite, but python can be optional for the end user
because in the case of ./configure --without-python, the only files
generated by python are already in the distribution).  Finally, remember
that tools that are optional for the end user are still mandatory for
the person running 'make dist', hence our bootstrap.conf should be sure
to list them to avoid a broken tarball just because the developer
providing the package was missing some optional prerequisites.

On a related point, in the case of libvirt, files generated by rpcgen
blur the boundary.  We allow the user to run their native rpcgen,
meaning that the end file can be somewhat machine-dependent, but the
version we ship in $(srcdir) must be generated by a particular flavor of
rpcgen which is known to produce machine-independent files.

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100428/054c8791/attachment-0001.sig>

More information about the libvir-list mailing list