stubs: replace stubs with lnot if applicable
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Aug 2019 13:12:18 +0000 (15:12 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Dec 2019 18:32:48 +0000 (19:32 +0100)
The stubs mechanism relies on static libraries and compilation order,
which is a bit brittle and should be avoided unless necessary.
Replace it with Boolean operations on CONFIG_* symbols.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Makefile.objs
crypto/Makefile.objs
util/Makefile.objs

index 6807c8b0d5507a0acba1fed455b0a57050d78508..02bf5ce11da02866961f0bce4255cf2139e4ea3a 100644 (file)
@@ -1,6 +1,6 @@
 #######################################################################
 # Common libraries for tools and emulators
-stub-obj-y = stubs/ util/ crypto/
+stub-obj-y = stubs/
 util-obj-y = crypto/ util/ qobject/ qapi/
 
 chardev-obj-y = chardev/
index 58014d175fced8e1e4fdc39fb73a1024b6039d48..c2a371b0b43c75b48c4f09c50fae230707be6b57 100644 (file)
@@ -22,6 +22,7 @@ crypto-obj-y += secret.o
 crypto-obj-y += pbkdf.o
 crypto-obj-$(CONFIG_NETTLE) += pbkdf-nettle.o
 crypto-obj-$(if $(CONFIG_NETTLE),n,$(CONFIG_GCRYPT)) += pbkdf-gcrypt.o
+crypto-obj-$(if $(CONFIG_NETTLE),n,$(if $(CONFIG_GCRYPT),n,y)) += pbkdf-stub.o
 crypto-obj-y += ivgen.o
 crypto-obj-y += ivgen-essiv.o
 crypto-obj-y += ivgen-plain.o
@@ -32,8 +33,6 @@ crypto-obj-y += block.o
 crypto-obj-y += block-qcow.o
 crypto-obj-y += block-luks.o
 
-stub-obj-y += pbkdf-stub.o
-
 util-obj-$(CONFIG_GCRYPT) += random-gcrypt.o
 util-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o
 util-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += random-platform.o
index df124af1c5647345d2a9d60d12bb41a543b39eb7..63599d62aab4711388591292026d89a9c76cd7bf 100644 (file)
@@ -52,8 +52,7 @@ util-obj-y += stats64.o
 util-obj-y += systemd.o
 util-obj-y += iova-tree.o
 util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o
+util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o
 util-obj-$(CONFIG_LINUX) += vfio-helpers.o
 util-obj-$(CONFIG_POSIX) += drm.o
 util-obj-y += guest-random.o
-
-stub-obj-y += filemonitor-stub.o