From cb91468c984b9481b99cc2e522300849dabe30a7 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Mon, 27 Jul 2020 08:22:41 +0200 Subject: [PATCH] meson: src: build libvirt_driver_admin.a static lib Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- src/admin/Makefile.inc.am | 36 ---------------------------- src/admin/meson.build | 50 +++++++++++++++++++++++++++++++++++++++ src/meson.build | 2 ++ src/rpc/meson.build | 5 ++++ 4 files changed, 57 insertions(+), 36 deletions(-) create mode 100644 src/admin/meson.build diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index 93f0fb2bc2..37692e77e3 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -3,41 +3,11 @@ ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x ADMIN_PROTOCOL_GENERATED = \ - admin/admin_protocol.c \ - admin/admin_protocol.h \ admin/admin_client.h \ - admin/admin_server_dispatch_stubs.h \ $(NULL) BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED) -admin/admin_server_dispatch.c: admin/admin_server_dispatch_stubs.h - -noinst_LTLIBRARIES += libvirt_driver_admin.la -libvirt_driver_admin_la_SOURCES = \ - admin/admin_server.c \ - admin/admin_server.h \ - admin/admin_server_dispatch.c \ - admin/admin_server_dispatch.h \ - $(NULL) -nodist_libvirt_driver_admin_la_SOURCES = \ - $(ADMIN_PROTOCOL_GENERATED) -libvirt_driver_admin_la_CFLAGS = \ - $(AM_CFLAGS) \ - $(XDR_CFLAGS) \ - -I$(top_srcdir)/src/admin \ - -I$(top_builddir)/src/admin \ - -I$(top_srcdir)/src/util \ - -I$(top_builddir)/src/rpc \ - $(NULL) -libvirt_driver_admin_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) - -if WITH_SASL -libvirt_driver_admin_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - GENERATED_SYM_FILES += admin/libvirt_admin.syms admin/libvirt_admin.def ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms @@ -116,12 +86,6 @@ admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \ admin ADMIN $(ADMIN_PROTOCOL) \ > admin/admin_client.h -admin/admin_server_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ - $(ADMIN_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \ - admin ADMIN $(ADMIN_PROTOCOL) \ - > admin/admin_server_dispatch_stubs.h - admin/libvirt_admin.syms: admin/libvirt_admin_public.syms $(ADMIN_SYM_FILES) \ $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-tmp $@ ; \ diff --git a/src/admin/meson.build b/src/admin/meson.build new file mode 100644 index 0000000000..cf2f206e34 --- /dev/null +++ b/src/admin/meson.build @@ -0,0 +1,50 @@ +admin_driver_sources = [ + 'admin_server.c', + 'admin_server_dispatch.c', +] + +admin_driver_protocol = files('admin_protocol.x') + +admin_driver_generated = [] + +admin_driver_generated += custom_target( + 'admin_protocol.h', + input: admin_driver_protocol, + output: 'admin_protocol.h', + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], +) + +admin_driver_generated += custom_target( + 'admin_protocol.c', + input: admin_driver_protocol, + output: 'admin_protocol.c', + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], +) + +admin_driver_generated += custom_target( + 'admin_server_dispatch_stubs.h', + input: admin_driver_protocol, + output: 'admin_server_dispatch_stubs.h', + command: [ + gendispatch_prog, '--mode=server', 'admin', 'ADMIN', '@INPUT@', + ], + capture: true, +) + +admin_driver_lib = static_library( + 'virt_admin_driver', + [ + admin_driver_sources, + admin_driver_generated, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], +) diff --git a/src/meson.build b/src/meson.build index 818331988b..8a5f680f93 100644 --- a/src/meson.build +++ b/src/meson.build @@ -90,3 +90,5 @@ src_dep = declare_dependency( subdir('conf') subdir('rpc') subdir('access') + +subdir('admin') diff --git a/src/rpc/meson.build b/src/rpc/meson.build index f6e8c7adba..b8fbe0c38b 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -107,3 +107,8 @@ virt_rpc_client_lib = static_library( ) rpc_inc_dir = include_directories('.') + +rpc_dep = declare_dependency( + include_directories: [ rpc_inc_dir ], + sources: [ rpc_gen_headers ], +)