]> xenbits.xensource.com Git - libvirt.git/commit
build: use library rather than cross-directory compilation
authorEric Blake <eblake@redhat.com>
Sun, 8 Sep 2013 02:49:17 +0000 (20:49 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 9 Sep 2013 18:04:03 +0000 (12:04 -0600)
commit012c25e88c6cfa114ee7656c5f9678f1a488d26d
treea3cf0f1998244de24e77523b0a6a862c54d26488
parent073e157533691e20a91a8977faa664b0d052858d
build: use library rather than cross-directory compilation

If we use subdir-objects with automake, any reference to a
cross-directory .c file will result in automake creating
rules that track dependency in the cross directory.  But this
presents a problem during 'make distclean' - if the cross
directory is cleaned up first, then the daemon directory will
be left with dangling references to .Po dependency files that
no longer exist.

Meanwhile, referring to the cross-directory .c file means
that we are compiling the file twice - once in src, and once
in daemon.  Better is to compile just once in src into a
convenience library, and then use that library from daemon.

The tests directory had a similar situation of a cross-directory
.c file; to solve that, we actually need a convenience library.

* daemon/Makefile.am (DAEMON_SOURCES): Drop .c files...
(libvirtd_LDADD): ...and instead use library.
(libvirtd_conf_la_SOURCES): Declare a new convenience library.
(libvirtd_LDFLAGS): Drop duplicate flag.
* tests/Makefile.am (libvirtdconftest_SOURCES): Drop .c file...
(libvirtdconftest_LDADD): ..and instead use library.

Signed-off-by: Eric Blake <eblake@redhat.com>
daemon/Makefile.am
tests/Makefile.am