]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: add support for building daemon binaries
authorPavel Hrdina <phrdina@redhat.com>
Wed, 24 Jun 2020 11:28:43 +0000 (13:28 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:05 +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/admin/meson.build
src/meson.build
src/remote/Makefile.inc.am

index cad331f3f2e8b5e61d866e762308a9afb60eff1d..ab6912d410339f324a18b2a97ba3ed1b9e04edae 100644 (file)
@@ -7,7 +7,7 @@ admin_driver_protocol = files('admin_protocol.x')
 
 admin_driver_generated = []
 
-admin_driver_generated += custom_target(
+admin_protocol_h = custom_target(
   'admin_protocol.h',
   input: admin_driver_protocol,
   output: 'admin_protocol.h',
@@ -15,6 +15,7 @@ admin_driver_generated += custom_target(
     genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@',
   ],
 )
+admin_driver_generated += admin_protocol_h
 
 admin_driver_generated += custom_target(
   'admin_protocol.c',
@@ -95,3 +96,8 @@ admin_driver_lib = static_library(
 )
 
 admin_inc_dir = include_directories('.')
+
+admin_dep = declare_dependency(
+  include_directories: admin_inc_dir,
+  sources: [ admin_protocol_h ],
+)
index 77496addb84daea5ebb21479fb0c2eb5bc718bea..24d454946d7e1d0d90fc9083b713cad123c48aed 100644 (file)
@@ -140,6 +140,14 @@ libvirt_libs = []
 #   * install_dir - installation directory (optional, default libdir / 'libvirt' / 'connection-driver'
 virt_modules = []
 
+# virt_daemons:
+#   each entry is a dictionary with following items:
+#   * name - binary name (required)
+#   * sources - binary sources (optional, default remote_daemon_sources)
+#   * c_args - compile arguments (optional, default [])
+#   * include = include_directories (optional, default [])
+virt_daemons = []
+
 
 # list subdirectories
 
@@ -476,3 +484,47 @@ foreach module : virt_modules
   )
   set_variable('@0@_module'.format(module['name'].underscorify()), mod)
 endforeach
+
+
+# build libvirt daemons
+
+foreach daemon : virt_daemons
+  bin = executable(
+    daemon['name'],
+    [
+      daemon.get('sources', [ remote_daemon_sources, remote_daemon_generated ]),
+      dtrace_gen_objects,
+    ],
+    c_args: [
+      daemon.get('c_args', []),
+    ],
+    include_directories: [
+      conf_inc_dir,
+      remote_inc_dir,
+      daemon.get('include', []),
+    ],
+    dependencies: [
+      admin_dep,
+      access_dep,
+      dbus_dep,
+      gnutls_dep,
+      libnl_dep,
+      rpc_dep,
+      src_dep,
+      sasl_dep,
+      xdr_dep,
+    ],
+    link_with: [
+      admin_driver_lib,
+      libvirt_lib,
+      libvirt_lxc_lib,
+      libvirt_qemu_lib,
+    ],
+    link_args: [
+      libvirt_no_undefined,
+    ],
+    install: true,
+    install_dir: sbindir,
+    install_rpath: libdir,
+  )
+endforeach
index 9866903847e836784e9e444677949c910c59efc4..eb281a4c4da05f6f5e56c317fe35b9a9d7bcbb35 100644 (file)
@@ -1,46 +1,5 @@
 # vim: filetype=automake
 
-REMOTE_DAEMON_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(GNUTLS_CFLAGS) \
-       $(SASL_CFLAGS) \
-       $(XDR_CFLAGS) \
-       $(DBUS_CFLAGS) \
-       $(LIBNL_CFLAGS) \
-       -I$(srcdir)/access \
-       -I$(builddir)/access \
-       -I$(srcdir)/conf \
-       -I$(srcdir)/rpc \
-       -I$(builddir)/rpc \
-       -I$(builddir)/remote \
-       $(NULL)
-
-REMOTE_DAEMON_LD_FLAGS = \
-       $(AM_LDFLAGS) \
-       $(NO_UNDEFINED_LDFLAGS) \
-       $(NULL)
-
-REMOTE_DAEMON_LD_ADD = \
-       libvirt_driver_admin.la \
-       libvirt-lxc.la \
-       libvirt-qemu.la \
-       libvirt.la \
-       $(LIBXML_LIBS) \
-       $(GNUTLS_LIBS) \
-       $(SASL_LIBS) \
-       $(XDR_LIBS) \
-       $(DBUS_LIBS) \
-       $(LIBNL_LIBS) \
-       $(NULL)
-
-if WITH_DTRACE_PROBES
-REMOTE_DAEMON_LD_ADD += ../src/libvirt_probes.lo
-endif WITH_DTRACE_PROBES
-
-REMOTE_DAEMON_LD_ADD += \
-       $(GLIB_LIBS) \
-       $(NULL)
-
 LOGROTATE_FILES_IN += \
        remote/libvirtd.qemu.logrotate.in \
        remote/libvirtd.lxc.logrotate.in \