]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: prepare sources for libvirt daemons
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 06:44:33 +0000 (08:44 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:05 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
src/remote/Makefile.inc.am
src/remote/meson.build

index 2ab3f1ec5081c2e9b56e432533214d880efd3a3f..9866903847e836784e9e444677949c910c59efc4 100644 (file)
@@ -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,21 +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)
-
-# Needed to build libvirt.pot, so must be listed outside
-# the WITH_REMOTE/WITH_LIBVIRTD conditionals
-BUILT_SOURCES += \
-       $(REMOTE_DAEMON_GENERATED) \
-       $(NULL)
-
 if WITH_LIBVIRTD
 
 sbin_PROGRAMS += libvirtd virtproxyd
@@ -368,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
index 3de6c5ee1f473cf1731b4437b401a951834eeead..1e3e3479c807d4a3d06b23c663c3536e563d9a1c 100644 (file)
@@ -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',