Signed-off-by: Pavel Hrdina <phrd...@redhat.com>
---
 src/remote/Makefile.inc.am | 45 --------------------------------------
 src/remote/meson.build     | 24 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 421f7337217..9866903847e 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -1,22 +1,5 @@
 # vim: filetype=automake
 
-REMOTE_DAEMON_GENERATED = \
-       remote/remote_daemon_dispatch_stubs.h \
-       remote/lxc_daemon_dispatch_stubs.h \
-       remote/qemu_daemon_dispatch_stubs.h \
-       $(NULL)
-
-REMOTE_DAEMON_SOURCES = \
-       remote/remote_daemon.c \
-       remote/remote_daemon.h \
-       remote/remote_daemon_config.c \
-       remote/remote_daemon_config.h \
-       remote/remote_daemon_dispatch.c \
-       remote/remote_daemon_dispatch.h \
-       remote/remote_daemon_stream.c \
-       remote/remote_daemon_stream.h \
-       $(NULL)
-
 REMOTE_DAEMON_CFLAGS = \
        $(AM_CFLAGS) \
        $(GNUTLS_CFLAGS) \
@@ -118,15 +101,6 @@ OPENRC_CONF_FILES += \
        remote/virtproxyd.confd \
        $(NULL)
 
-REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
-LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
-QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
-REMOTE_DRIVER_PROTOCOL = \
-       $(REMOTE_PROTOCOL) \
-       $(QEMU_PROTOCOL) \
-       $(LXC_PROTOCOL) \
-       $(NULL)
-
 if WITH_LIBVIRTD
 
 sbin_PROGRAMS += libvirtd virtproxyd
@@ -362,22 +336,3 @@ virtproxy%.socket: remote/libvirt%.socket.in 
$(top_builddir)/config.status
 virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \
                        $(top_builddir)/config.status
        $(AM_V_GEN)cp $< $@
-
-
-remote/remote_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
-               $(REMOTE_PROTOCOL) Makefile.am
-       $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
-         --mode=server remote REMOTE $(REMOTE_PROTOCOL) \
-         > remote/remote_daemon_dispatch_stubs.h
-
-remote/lxc_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
-               $(LXC_PROTOCOL) Makefile.am
-       $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
-         --mode=server lxc LXC $(LXC_PROTOCOL) \
-         > remote/lxc_daemon_dispatch_stubs.h
-
-remote/qemu_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
-               $(QEMU_PROTOCOL) Makefile.am
-       $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
-         --mode=server qemu QEMU $(QEMU_PROTOCOL) \
-         > remote/qemu_daemon_dispatch_stubs.h
diff --git a/src/remote/meson.build b/src/remote/meson.build
index 3de6c5ee1f4..1e3e3479c80 100644
--- a/src/remote/meson.build
+++ b/src/remote/meson.build
@@ -39,6 +39,30 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
   )
 endforeach
 
+remote_daemon_sources = files(
+  'remote_daemon.c',
+  'remote_daemon_config.c',
+  'remote_daemon_dispatch.c',
+  'remote_daemon_stream.c',
+)
+
+remote_daemon_generated = []
+
+foreach name : [ 'remote', 'qemu', 'lxc' ]
+  protocol_x = '@0@_protocol.x'.format(name)
+  dispatch_h = '@0@_daemon_dispatch_stubs.h'.format(name)
+
+  remote_daemon_generated += custom_target(
+    dispatch_h,
+    input: protocol_x,
+    output: dispatch_h,
+    command: [
+      gendispatch_prog, '--mode=server', name, name.to_upper(), '@INPUT@',
+    ],
+    capture: true,
+  )
+endforeach
+
 if conf.has('WITH_REMOTE')
   remote_driver_lib = static_library(
     'virt_remote_driver',
-- 
2.26.2

Reply via email to