mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-04 20:15:19 +00:00
build: fix 'make dist' on virgin checkout
'make dist' was depending on *protocol-structs files, which are stored in git but in turn depended on generated files. We still want to ship the protocol-structs files, but by renaming the tests to something not matching a file name, we separate 'make check' (which depends on the generated file) from 'make dist' (which only depends on the git files). After all, the tarball should never depend on a generated file not stored in git. I found one more case of a git file depending on a generated file, in a bogus virkeycode.c listing; but at least this one had no associated rules so it never broke 'make dist'. Reported by Wen Congyang. Latent bug has been present since commit62dee6f
, but only recently exposed by commit7bff56a
. * src/Makefile.am ($(srcdir)/util/virkeycode.c): Drop useless dependency. (BUILT_SOURCES): ...and build virkeymaps.h sooner. (PROTOCOL_STRUCTS): Rather than depend on the struct file... (check-local): ...convert things into a phony target of... (check-protocol): ...a new check. ($(srcdir)/remote_protocol-struct): Rename to isolate the distributed file from the conditional test. (PDWTAGS): Deal with rename. Swap to compare 'expected actual'. (cherry picked from commit9b5970c6c4
)
This commit is contained in:
parent
52c4d49ca3
commit
e570f87a3d
@ -111,12 +111,12 @@ UTIL_SOURCES = \
|
||||
EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
|
||||
$(srcdir)/util/virkeycode-mapgen.py
|
||||
|
||||
BUILT_SOURCES += $(srcdir)/util/virkeymaps.h
|
||||
|
||||
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \
|
||||
$(srcdir)/util/virkeycode-mapgen.py
|
||||
$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py <$(srcdir)/util/keymaps.csv >$@
|
||||
|
||||
$(srcdir)/util/virkeycode.c: $(srcdir)/util/virkeycode.h $(srcdir)/util/virkeymaps.h
|
||||
|
||||
EXTRA_DIST += util/threads-pthread.c util/threads-win32.c
|
||||
|
||||
# Internal generic driver infrastructure
|
||||
@ -289,7 +289,7 @@ PDWTAGS = \
|
||||
-e '}' \
|
||||
< $(@F)-t1 > $(@F)-t3; \
|
||||
case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
|
||||
diff -u $(@F)-t3 $@; st=$$?; rm -f $(@F)-t?; exit $$st; \
|
||||
diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
|
||||
fi; \
|
||||
else \
|
||||
echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
|
||||
@ -302,21 +302,24 @@ PROTOCOL_STRUCTS = \
|
||||
$(srcdir)/virnetprotocol-structs \
|
||||
$(srcdir)/virkeepaliveprotocol-structs
|
||||
if WITH_REMOTE
|
||||
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)
|
||||
|
||||
# The .o file that pdwtags parses is created as a side effect of running
|
||||
# libtool; but from make's perspective we depend on the .lo file.
|
||||
$(srcdir)/%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
|
||||
$(srcdir)/remote_protocol-struct $(srcdir)/qemu_protocol-struct: \
|
||||
$(srcdir)/%-struct: libvirt_driver_remote_la-%.lo
|
||||
$(PDWTAGS)
|
||||
$(srcdir)/virnetprotocol-structs: libvirt_net_rpc_la-virnetprotocol.lo
|
||||
$(PDWTAGS)
|
||||
$(srcdir)/virkeepaliveprotocol-structs: libvirt_net_rpc_la-virkeepaliveprotocol.lo
|
||||
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
|
||||
$(srcdir)/%-struct: libvirt_net_rpc_la-%.lo
|
||||
$(PDWTAGS)
|
||||
else !WITH_REMOTE
|
||||
# These generated files must live in git, because they cannot be re-generated
|
||||
# when configured --without-remote.
|
||||
$(PROTOCOL_STRUCTS):
|
||||
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
|
||||
# re-generated when configured --without-remote.
|
||||
check-protocol:
|
||||
endif
|
||||
EXTRA_DIST += $(PROTOCOL_STRUCTS)
|
||||
check-local: $(PROTOCOL_STRUCTS)
|
||||
check-local: check-protocol
|
||||
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
|
||||
|
||||
# Mock driver, covering domains, storage, networks, etc
|
||||
TEST_DRIVER_SOURCES = \
|
||||
|
Loading…
Reference in New Issue
Block a user