[libvirt] [PATCH] build: fix 'make dist' without dtrace

Eric Blake eblake at redhat.com
Thu Dec 1 17:17:04 UTC 2011

probes.h can only be generated on Linux, and then only with dtrace
installed.  If it is part of the tarball, then either 'make dist'
will fail if you don't have that setup, or we would have to start
keeping probes.h in libvirt.git.  Since we only need it to be
generated when dtrace is in use, it's better to avoid shipping
it in the first place, and avoid tracking it in git.

Meanwhile, there is a build dependency - since the RPC code is
generated, it can be built early; but when dtrace is enabled, we
must ensure probes.h is built even earlier.  Commit 1afcfbdd tried
to fix this, but did so in a way that added probes.h into the
tarball, and broke VPATH as well.  Commit ecbca767 fixed VPATH,
but didn't fix the more fundamental problem.  This patch solves
the issue by adding a dependency instead.

Tested with 'make dist' in a clean VPATH builds, for both
'./configure --without-dtrace' and './configure --with-dtrace';
all configurations were able to correctly build a tarball, and
the dtrace configuration no longer sticks probes.h in the tarball.

* src/Makefile.am (REMOTE_DRIVER_GENERATED): Don't ship probes.h;
rather, make it a dependency.

Pushing under the build-breaker rule, since I reproduced a
failure with './configure --without-dtrace && make dist' without
this patch.

 src/Makefile.am |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 4c98397..93bf54c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -202,11 +202,6 @@ REMOTE_DRIVER_GENERATED = \
 		$(srcdir)/remote/qemu_protocol.h		\

-# The remote RPC driver needs probes.h
 REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
 QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
@@ -646,7 +641,6 @@ libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
 libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)

 $(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)

@@ -1283,6 +1277,9 @@ if WITH_DTRACE
 libvirt_la_BUILT_LIBADD += probes.o
 libvirt_la_DEPENDENCIES += probes.o
 nodist_libvirt_la_SOURCES = probes.h

 BUILT_SOURCES += probes.h libvirt_probes.stp libvirt_functions.stp


More information about the libvir-list mailing list