[libvirt] [PATCH 2/2] build: fix python in VPATH build

Jim Meyering jim at meyering.net
Wed Apr 28 16:00:46 UTC 2010

Eric Blake wrote:

> On 04/28/2010 04:29 AM, Jim Meyering wrote:
>> Eric Blake wrote:
>>> Match the fact that docs/Makefile.am dumps libvirt-api.xml in the
>>> build dir, not the source dir.
>>> * python/Makefile.am (API_DESC): Point make to the builddir for .xml files.
>>> * python/generator.py (buildStubs): Output in correct location.
>> Hi Eric,
>> Does this fix a failure or just ensure that we use more
>> up to date .xml files?
> It was an actual VPATH build failure.  <goes to look in scrollback
> buffer...>
> make[3]: Entering directory `/home/eblake/libvirt/build-rawhide/python'
> make[3]: *** No rule to make target `../../docs/libvirt-api.xml', needed
> by `generated.stamp'.  Stop.
>> With just your cfg.mk patch, I ran a srcdir ./autogen.sh && make distclean
>> followed by "make check syntax-check" from a non-srcdir build dir.
>> It succeeded.
>> The only potential down-side I see is that this requires running Python
>> (though only in a VPATH build?), to recreate a distributed file that is
>> available in $(srcdir).
> That chunk of python/Makefile.am is guarded by WITH_PYTHON.  So before
> the patch, the file libvirt-override-api.xml was only available in
> $(srcdir) if python was present _and_ builddir=srcdir; after the patch,
> it is only available in $(builddir) if python is present.  But since
> docs/libvirt-api.xml was only available in $(builddir), we might as well
> be consistent on the two .xml files.
> Should we be distributing a pre-built libvirt-api.xml and
> libvirt-override-api.xml?  If so, then we should ditch this patch and

I doubt we've documented the criteria libvirt uses for deciding whether
to distribute generated files.  However, one good reason to distribute
such files (generated by python scripts) is to be able to provide the
API xml files even to people who lack python support and to those who
choose to configure --without-python.

> instead do a patch to stick docs/libvirt-api.xml into $(srcdir) instead
> of $(builddir).  If not, then I need to tweak this patch to remove
> libvirt-override-api.xml from EXTRA_DIST.  Either way, I guess I need to
> test 'make dist' before proposing v2 of this patch.  Thoughts?

More information about the libvir-list mailing list