]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: build libvirt_driver_remote.a static library
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 06:26:42 +0000 (08:26 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:04 +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/meson.build
src/remote/Makefile.inc.am
src/remote/meson.build [new file with mode: 0644]

index a9edf67e2542c5d857a4e316b6d7c7a6e55a22c1..3aeded9d7c4ea94028903e193d5cdec885871bf8 100644 (file)
@@ -95,6 +95,8 @@ subdir('cpu')
 subdir('hypervisor')
 subdir('vmx')
 
+subdir('remote')
+
 subdir('admin')
 subdir('locking')
 subdir('logging')
index 631b974463f951c601ea96fbf987f33389b23250..2fbdfedbd035586db994754ea01d2544911ed95f 100644 (file)
@@ -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 (file)
index 0000000..383b265
--- /dev/null
@@ -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