]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: check correct protocol.o file
authorEric Blake <eblake@redhat.com>
Fri, 5 Apr 2013 17:09:32 +0000 (11:09 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 9 Apr 2013 20:01:24 +0000 (14:01 -0600)
commitdfb42ed1e9fbec0265e41583aaf3b7d5c239e69d
treedd0fc57c49e01e8f872c028dccfa38aac27c5a80
parenta243e21c220c38bbe954cd80d2f4695a6cf33bdd
build: check correct protocol.o file

By default, libtool builds two .o files for every .lo rule:
src/foo.o - static builds
src/.libs/foo.o - shared library builds

But since commit ad42b34b disabled static builds, src/foo.o is
no longer built by default.  On a fresh checkout, this means our
protocol check rules using pdwtags were testing a missing file,
and thanks to a lousy behavior of pdwtags happily giving no output
and 0 exit status (http://bugzilla.redhat.com/949034), we were
merely claiming that "dwarves is too old" and skipping the test.

However, if you swap between branches and do incremental builds,
such as building v0.10.2-maint and then switching back to master,
you end up with src/foo.o being leftover from its 0.10.2 state,
and then 'make check' fails because the .o file does not match
the protocol-structs file due to API additions in the meantime.

A simpler fix would be to always look in .libs for the .o to
be parsed; but since it is possible to pass ./configure options
to tell libtool to do a static-only build with no shared .o,
I went with the approach of finding the newest of the two files,
whenever both exist.

* src/Makefile.am (PDWTAGS): Ensure we test just-built file.
(cherry picked from commit 5899e09e6112ff739cc4b9b9198d904fc88b698c)
src/Makefile.am