• E
    build: fix 'make distcheck' issues · 7bff56a0
    Eric Blake 提交于
    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.
    7bff56a0
Makefile.am 53.5 KB