[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] build: ensure 'make check' sees up-to-date config.h



Nehal J. Wani reported on IRC a rather interesting build failure:

In file included from util/virnetdevbridge.c:53:0:
/usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr'
 struct in6_addr {
        ^

I traced it to the fact that he ran 'git pull; make check' across
commit e62e0094.  What happened is that the configure changes
result in a new variable that was set to be defined on his system,
but config.h was not regenerated to contain the value of that
variable.  Running 'make' instead of 'make check' cleaned up the
problem.  A bit more investigation, and I see that in Makefile.am,
automake sticks rules that rebuild config.h as part of 'make all',
and that we also had a dependency 'check-local: all'; BUT the
rule for check-local is run only at the point when the top-level
directory is visited.  Automake documents that SUBDIRS should
contain an explicit '.' at the point the top-level should be
visited (defaulting to last, if it doesn't appear).  Sure enough,
with this patch, 'make check' now does the top-level 'all' rules,
which regenerates 'config.h' BEFORE compiling any code that might
depend on changed content of that file.

* Makefile.am (SUBDIRS): Put '.' first, not last.

Signed-off-by: Eric Blake <eblake redhat com>
---

Tough to argue the build-breaker rule on this one, since a
fresh checkout doesn't hit it (only a 'make check' without
a 'make', across an incremental build that happened to need
new configure substitutions).  So I'll wait for a review
for my one-liner.

 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4e24ecf..66cb677 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
 LCOV = lcov
 GENHTML = genhtml

-SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \
+SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \
   python tests po examples/domain-events/events-c examples/hellolibvirt \
   examples/dominfo examples/domsuspend examples/python examples/apparmor \
   examples/xml/nwfilter examples/openauth examples/systemtap
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]