]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix 'make dist' without dtrace
authorEric Blake <eblake@redhat.com>
Thu, 1 Dec 2011 16:02:53 +0000 (09:02 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 1 Dec 2011 17:15:48 +0000 (10:15 -0700)
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.

src/Makefile.am

index 4c9839766881bfe709546475d51135c6a20ad487..93bf54c10778be62e2cc7948f2d0bc921663583c 100644 (file)
@@ -202,11 +202,6 @@ REMOTE_DRIVER_GENERATED = \
                $(srcdir)/remote/qemu_protocol.h                \
                $(srcdir)/remote/qemu_client_bodies.h
 
-# The remote RPC driver needs probes.h
-if WITH_DTRACE
-REMOTE_DRIVER_GENERATED += probes.h
-endif
-
 REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
 QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
 REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL)
@@ -646,7 +641,6 @@ libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
 endif
 libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
 
-
 $(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)
 
 endif WITH_REMOTE
@@ -1283,6 +1277,9 @@ if WITH_DTRACE
 libvirt_la_BUILT_LIBADD += probes.o
 libvirt_la_DEPENDENCIES += probes.o
 nodist_libvirt_la_SOURCES = probes.h
+if WITH_REMOTE
+$(REMOTE_DRIVER_GENERATED): probes.h
+endif WITH_REMOTE
 
 BUILT_SOURCES += probes.h libvirt_probes.stp libvirt_functions.stp