From: Pavel Hrdina Date: Mon, 27 Jul 2020 06:26:42 +0000 (+0200) Subject: meson: src: build libvirt_driver_remote.a static library X-Git-Tag: v6.7.0-rc1~458 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2161755db35ee01dfd7f72346f20a3bd5eb2bf48;p=thirdparty%2Flibvirt.git meson: src: build libvirt_driver_remote.a static library Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- diff --git a/src/meson.build b/src/meson.build index a9edf67e25..3aeded9d7c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -95,6 +95,8 @@ subdir('cpu') subdir('hypervisor') subdir('vmx') +subdir('remote') + subdir('admin') subdir('locking') subdir('logging') diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 631b974463..2fbdfedbd0 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -1,22 +1,5 @@ # vim: filetype=automake -REMOTE_DRIVER_GENERATED = \ - remote/remote_protocol.c \ - remote/remote_protocol.h \ - remote/remote_client_bodies.h \ - remote/lxc_protocol.c \ - remote/lxc_protocol.h \ - remote/lxc_client_bodies.h \ - remote/qemu_protocol.c \ - remote/qemu_protocol.h \ - remote/qemu_client_bodies.h \ - $(NULL) - -REMOTE_DRIVER_SOURCES = \ - remote/remote_driver.c \ - remote/remote_driver.h \ - $(NULL) - REMOTE_DAEMON_GENERATED = \ remote/remote_daemon_dispatch_stubs.h \ remote/lxc_daemon_dispatch_stubs.h \ @@ -144,46 +127,12 @@ REMOTE_DRIVER_PROTOCOL = \ $(LXC_PROTOCOL) \ $(NULL) -DRIVER_SOURCE_FILES += \ - $(REMOTE_DRIVER_GENERATED) \ - $(addprefix $(srcdir)/,$(REMOTE_DRIVER_SOURCES)) - # Needed to build libvirt.pot, so must be listed outside # the WITH_REMOTE/WITH_LIBVIRTD conditionals BUILT_SOURCES += \ - $(REMOTE_DRIVER_GENERATED) \ $(REMOTE_DAEMON_GENERATED) \ $(NULL) -if WITH_REMOTE -noinst_LTLIBRARIES += libvirt_driver_remote.la -libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la -libvirt_driver_remote_la_CFLAGS = \ - $(XDR_CFLAGS) \ - -I$(srcdir)/conf \ - -I$(srcdir)/rpc \ - -I$(builddir)/rpc \ - -I$(builddir)/remote \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_remote_la_SOURCES = \ - $(REMOTE_DRIVER_SOURCES) -nodist_libvirt_driver_remote_la_SOURCES = \ - $(REMOTE_DRIVER_GENERATED) - -if WITH_DTRACE_PROBES -nodist_libvirt_driver_remote_la_SOURCES += libvirt_probes.h -endif WITH_DTRACE_PROBES - -if WITH_SASL -libvirt_driver_remote_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - -endif WITH_REMOTE - if WITH_REMOTE USED_SYM_FILES += $(srcdir)/libvirt_remote.syms else ! WITH_REMOTE @@ -427,24 +376,6 @@ virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \ $(AM_V_GEN)cp $< $@ -remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - remote REMOTE $(REMOTE_PROTOCOL) \ - > remote/remote_client_bodies.h - -remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - lxc LXC $(LXC_PROTOCOL) \ - > remote/lxc_client_bodies.h - -remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - qemu QEMU $(QEMU_PROTOCOL) \ - > remote/qemu_client_bodies.h - 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 \ diff --git a/src/remote/meson.build b/src/remote/meson.build new file mode 100644 index 0000000000..383b265ea2 --- /dev/null +++ b/src/remote/meson.build @@ -0,0 +1,59 @@ +remote_driver_sources = [ + 'remote_driver.c', +] + +remote_driver_generated = [] + +foreach name : [ 'remote', 'qemu', 'lxc' ] + client_bodies_h = '@0@_client_bodies.h'.format(name) + protocol_c = '@0@_protocol.c'.format(name) + protocol_h = '@0@_protocol.h'.format(name) + protocol_x = '@0@_protocol.x'.format(name) + + remote_driver_generated += custom_target( + client_bodies_h, + input: protocol_x, + output: client_bodies_h, + command: [ + gendispatch_prog, '--mode=client', name, name.to_upper(), '@INPUT@', + ], + capture: true, + ) + + remote_driver_generated += custom_target( + protocol_h, + input: protocol_x, + output: protocol_h, + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], + ) + + remote_driver_generated += custom_target( + protocol_c, + input: protocol_x, + output: protocol_c, + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], + ) +endforeach + +if conf.has('WITH_REMOTE') + remote_driver_lib = static_library( + 'virt_remote_driver', + [ + remote_driver_sources, + remote_driver_generated, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif