This introduces intermediate static library that is required for following remote protocol check. Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- src/locking/Makefile.inc.am | 34 ++-------------------------- src/locking/meson.build | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 32 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 3afc9803ce0..b8eac29d242 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -6,22 +6,10 @@ LOCK_DRIVER_SANLOCK_SOURCES = \ LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \ locking/sanlock_helper.c -LOCK_PROTOCOL_GENERATED = \ - locking/lock_protocol.h \ - locking/lock_protocol.c \ - $(NULL) - LOCK_DAEMON_GENERATED = \ locking/lock_daemon_dispatch_stubs.h $(NULL) -LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x - -LOCK_DRIVER_LOCKD_SOURCES = \ - locking/lock_driver_lockd.c \ - locking/lock_driver_lockd.h \ - $(NULL) - LOCK_DAEMON_SOURCES = \ locking/lock_daemon.h \ locking/lock_daemon.c \ @@ -55,23 +43,11 @@ lockdriver_LTLIBRARIES = if WITH_LIBVIRTD lockdriver_LTLIBRARIES += lockd.la -lockd_la_SOURCES = \ - $(LOCK_DRIVER_LOCKD_SOURCES) \ - $(NULL) -nodist_lockd_la_SOURCES = \ - $(LOCK_PROTOCOL_GENERATED) \ - $(NULL) -lockd_la_CFLAGS = \ - -I$(srcdir)/conf \ - -I$(srcdir)/locking \ - -I$(builddir)/locking \ - -I$(builddir)/rpc \ - $(XDR_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) +lockd_la_SOURCES = lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) lockd_la_LIBADD = \ libvirt.la \ + libvirt_lockd_impl.la \ $(GLIB_LIBS) \ $(XDR_LIBS) \ $(NULL) @@ -80,12 +56,6 @@ if WITH_DTRACE_PROBES lockd_la_LIBADD += libvirt_probes.lo endif WITH_DTRACE_PROBES -if WITH_SASL -lockd_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - if WITH_QEMU augeastest_DATA += locking/test_libvirt_lockd.aug nodist_conf_DATA += locking/qemu-lockd.conf diff --git a/src/locking/meson.build b/src/locking/meson.build index 18b2e3c72a6..d8255d00f64 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -1,9 +1,35 @@ +lock_protocol = 'lock_protocol.x' + lock_driver_sources = [ 'lock_manager.c', 'lock_driver_nop.c', 'domain_lock.c', ] +lock_driver_lockd_sources = [ + 'lock_driver_lockd.c', +] + +lock_protocol_generated = [] + +lock_protocol_generated += custom_target( + 'lock_protocol.h', + input: lock_protocol, + output: 'lock_protocol.h', + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], +) + +lock_protocol_generated += custom_target( + 'lock_protocol.c', + input: lock_protocol, + output: 'lock_protocol.c', + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], +) + lock_driver_lib = static_library( 'virt_lock_driver', [ @@ -18,3 +44,22 @@ lock_driver_lib = static_library( ) libvirt_libs += lock_driver_lib + +if conf.has('WITH_LIBVIRTD') + lockd_lib_impl = static_library( + 'lockd_impl', + [ + files(lock_driver_lockd_sources), + lock_protocol_generated, + ], + include_directories: [ + conf_inc_dir, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], + ) +endif -- 2.26.2