]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix 'make distcheck' issues
authorEric Blake <eblake@redhat.com>
Wed, 30 May 2012 17:30:18 +0000 (11:30 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 5 Jun 2012 15:20:12 +0000 (09:20 -0600)
We had a distributed file (remote_protocol.h, which in turn was
a prereq to remote_driver.c) depending on a generated file
(libvirt_probes.h), which is a no-no for a VPATH build from a
read-only source tree (no wonder 'make distcheck' tests precisely
that situation):

     File `libvirt_driver_remote.la' does not exist.
       File `libvirt_driver_remote_la-remote_driver.lo' does not exist.
             Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'.
            Must remake target `../../src/remote/remote_protocol.h'.
Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'.
make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src'
  GEN    ../../src/remote/remote_protocol.h
cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31.
make[3]: *** [../../src/remote/remote_protocol.h] Error 13

Rather than making distributed .c files depend on generated files, we
really want to ensure that compilation into .lo files is not attempted
until the generated files are present, done by this patch.  Since there
were two different sets of conditionally generated files that both
feed the .lo file, I had to introduce a new variable REMOTE_DRIVER_PREREQS
to keep automake happy.

After that fix, the next issue was that make treats './foo' and 'foo'
differently in determining whether an implicit %foo rule is applicable,
with the result that locking/qemu-sanlock.conf wasn't properly being
built at the right times.  Also, the output for using the .aug test
files was a bit verbose.

After fixing the src directory, the next error is related to the docs
directory, where the tarball is missing a stamp file and thus tries to
regenerate files that are already present:

  GEN    ../../docs/apibuild.py.stamp
Traceback (most recent call last):
  File "../../docs/apibuild.py", line 2511, in <module>
    rebuild("libvirt")
  File "../../docs/apibuild.py", line 2495, in rebuild
    builder.serialize()
  File "../../docs/apibuild.py", line 2424, in serialize
    output = open(filename, "w")
IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml'
make[5]: *** [../../docs/apibuild.py.stamp] Error 1

and fixing that exposed another case of a distributed file (generated
html) depending on a built file (libvirt.h), but only when doing an
in-tree build, because of a file glob.

* src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change...
(libvirt_driver_remote_la-remote_driver.lo): ...to the real
dependency.
($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that
rule gets run in time for test_libvirt_sanlock.aug.
(test_libvir*.aug): Cater to silent build.
(conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it
is trivial to regenerate.
* docs/Makefile.am (EXTRA_DIST): Ship our stamp file.
($(APIBUILD_STAMP)): Don't depend on generated file.

docs/Makefile.am
src/Makefile.am

index a03ca3e81a360503274d0d9cf62c775edd8c447b..88407b1b9a43fe4421465d5949185d298c7e737d 100644 (file)
@@ -202,11 +202,14 @@ python_generated_files = \
 
 APIBUILD=$(srcdir)/apibuild.py
 APIBUILD_STAMP=$(APIBUILD).stamp
+EXTRA_DIST += $(APIBUILD_STAMP)
 
 $(python_generated_files): $(APIBUILD_STAMP)
 
 $(APIBUILD_STAMP): $(srcdir)/apibuild.py \
-               $(srcdir)/../include/libvirt/*.h \
+               $(srcdir)/../include/libvirt/libvirt.h.in \
+               $(srcdir)/../include/libvirt/libvirt-qemu.h \
+               $(srcdir)/../include/libvirt/virterror.h \
                $(srcdir)/../src/libvirt.c \
                $(srcdir)/../src/libvirt-qemu.c \
                $(srcdir)/../src/util/virterror.c
index 5693fb44662c3ba0dc44d66e061d9c590b698559..dd1af6595e26c74a0130745174f9c0e6b81fabbb 100644 (file)
@@ -654,7 +654,8 @@ libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                 libvirt-net-rpc.la
 libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
 
-$(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)
+REMOTE_DRIVER_PREREQS = $(REMOTE_DRIVER_GENERATED)
+%remote_driver.lo: $(REMOTE_DRIVER_PREREQS)
 
 endif WITH_REMOTE
 
@@ -1130,7 +1131,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
 if WITH_QEMU
 test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
                $(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
-       $(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
 
 check-augeas-qemu: test_libvirtd_qemu.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1143,7 +1144,7 @@ endif
 if WITH_LXC
 test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
                $(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
-       $(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
 
 check-augeas-lxc: test_libvirtd_lxc.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1156,7 +1157,7 @@ endif
 if HAVE_SANLOCK
 test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
                locking/qemu-sanlock.conf $(AUG_GENTEST)
-       $(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
 
 check-augeas-sanlock: test_libvirt_sanlock.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1296,7 +1297,7 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo
 libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
 nodist_libvirt_la_SOURCES = libvirt_probes.h
 if WITH_REMOTE
-$(REMOTE_DRIVER_GENERATED): libvirt_probes.h
+REMOTE_DRIVER_PREREQS += libvirt_probes.h
 endif WITH_REMOTE
 
 BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
@@ -1370,12 +1371,12 @@ augeas_DATA += locking/libvirt_sanlock.aug
 augeastest_DATA += test_libvirt_sanlock.aug
 CLEANFILES += test_libvirt_sanlock.aug
 
-$(builddir)/locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
+locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
        $(AM_V_GEN)$(MKDIR_P) locking ; \
        cp $< $@
 
 if WITH_QEMU
-conf_DATA += locking/qemu-sanlock.conf
+nodist_conf_DATA = locking/qemu-sanlock.conf
 BUILT_SOURCES += locking/qemu-sanlock.conf
 DISTCLEANFILES += locking/qemu-sanlock.conf
 endif