Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
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 2d94ead73e1..afe44437b74 100644
--- a/src/admin/Makefile.inc.am
+++ b/src/admin/Makefile.inc.am
@@ -3,39 +3,9 @@
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)
-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
@@ -114,12 +84,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 00000000000..cf2f206e34a
--- /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 c7993517760..c2a4ccb17fd 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -81,3 +81,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 f6e8c7adba5..b8fbe0c38b1 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 ],
+)
--
2.26.2