[libvirt PATCH 216/351] meson: src: build libvirt_lxc binary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/lxc/Makefile.inc.am | 88 -----------------------------------------
 src/lxc/meson.build     | 46 +++++++++++++++++++++
 2 files changed, 46 insertions(+), 88 deletions(-)

diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am
index 19546181e51..03f03ba13db 100644
--- a/src/lxc/Makefile.inc.am
+++ b/src/lxc/Makefile.inc.am
@@ -1,40 +1,5 @@
 # vim: filetype=automake
 
-LXC_MONITOR_PROTOCOL_GENERATED = \
-	lxc/lxc_monitor_protocol.h \
-	lxc/lxc_monitor_protocol.c \
-	$(NULL)
-
-LXC_MONITOR_GENERATED = \
-	lxc/lxc_monitor_dispatch.h \
-	$(NULL)
-
-LXC_CONTROLLER_GENERATED = \
-	lxc/lxc_controller_dispatch.h \
-	$(NULL)
-
-LXC_GENERATED = \
-	$(LXC_MONITOR_PROTOCOL_GENERATED) \
-	$(LXC_MONITOR_GENERATED) \
-	$(LXC_CONTROLLER_GENERATED) \
-	$(NULL)
-
-LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
-
-LXC_CONTROLLER_SOURCES = \
-	lxc/lxc_conf.c \
-	lxc/lxc_conf.h \
-	lxc/lxc_container.c \
-	lxc/lxc_container.h \
-	lxc/lxc_cgroup.c \
-	lxc/lxc_cgroup.h \
-	lxc/lxc_domain.c \
-	lxc/lxc_domain.h \
-	lxc/lxc_fuse.c \
-	lxc/lxc_fuse.h \
-	lxc/lxc_controller.c \
-	$(NULL)
-
 DRIVER_SOURCE_FILES += \
 	$(LXC_MONITOR_PROTOCOL_GENERATED) \
 	$(LXC_MONITOR_GENERATED) \
@@ -44,7 +9,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \
 	$(LXC_MONITOR_GENERATED) \
 	$(addprefix $(srcdir)/,$(LXC_DRIVER_SOURCES))
 
-
 if WITH_LXC
 
 nodist_conf_DATA += lxc/virtlxcd.conf
@@ -109,52 +73,6 @@ lxc/test_virtlxcd.aug: remote/test_libvirtd.aug.in \
 		-e 's/[@]DAEMON_NAME_UC[@]/Virtlxcd/' \
 		> $@ || rm -f $@
 
-libexec_PROGRAMS += libvirt_lxc
-
-libvirt_lxc_SOURCES = \
-	$(LXC_CONTROLLER_SOURCES) \
-	$(DATATYPES_SOURCES) \
-	$(NULL)
-nodist_libvirt_lxc_SOURCES = \
-	$(LXC_MONITOR_PROTOCOL_GENERATED) \
-	$(LXC_CONTROLLER_GENERATED) \
-	$(NULL)
-libvirt_lxc_LDFLAGS = \
-	$(AM_LDFLAGS) \
-	$(CAPNG_LIBS) \
-	$(LIBXML_LIBS) \
-	$(GLIB_LIBS) \
-	$(NULL)
-libvirt_lxc_LDADD = \
-	libvirt.la \
-	$(FUSE_LIBS) \
-	$(GLIB_LIBS) \
-	$(NULL)
-if WITH_DTRACE_PROBES
-libvirt_lxc_LDADD += libvirt_probes.lo
-endif WITH_DTRACE_PROBES
-libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
-libvirt_lxc_CFLAGS = \
-	-I$(srcdir)/conf \
-	-I$(builddir)/lxc \
-	-I$(builddir)/rpc \
-	-I$(srcdir)/hypervisor \
-	$(AM_CFLAGS) \
-	$(CAPNG_CFLAGS) \
-	$(LIBXML_CFLAGS) \
-	$(GLIB_CFLAGS) \
-	$(LIBNL_CFLAGS) \
-	$(FUSE_CFLAGS) \
-	$(DBUS_CFLAGS) \
-	$(XDR_CFLAGS) \
-	$(NULL)
-if WITH_BLKID
-libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
-libvirt_lxc_LDADD += $(BLKID_LIBS)
-endif WITH_BLKID
-libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
-
-
 if WITH_DTRACE_PROBES
 RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x
 endif
@@ -182,12 +100,6 @@ uninstall-data-lxc:
 
 endif WITH_LXC
 
-lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
-		$(REMOTE_PROTOCOL) Makefile.am
-	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
-	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
-	  lxc/lxc_controller_dispatch.h
-
 .PHONY: \
 	install-data-lxc \
 	uninstall-data-lxc \
diff --git a/src/lxc/meson.build b/src/lxc/meson.build
index a90083cdc3d..cf1f976573a 100644
--- a/src/lxc/meson.build
+++ b/src/lxc/meson.build
@@ -40,6 +40,26 @@ lxc_monitor_generated = custom_target(
   capture: true,
 )
 
+lxc_controller_sources = files(
+  'lxc_conf.c',
+  'lxc_container.c',
+  'lxc_cgroup.c',
+  'lxc_domain.c',
+  'lxc_fuse.c',
+  'lxc_controller.c',
+)
+
+lxc_controller_generated = custom_target(
+  'lxc_controller_dispatch_h',
+  input: lxc_monitor_protocol,
+  output: 'lxc_controller_dispatch.h',
+  command: [
+    gendispatch_prog, '--mode=server',
+    'virLXCMonitor', 'VIR_LXC_MONITOR', '@INPUT@'
+  ],
+  capture: true,
+)
+
 if conf.has('WITH_LXC')
   lxc_driver_impl_lib = static_library(
     'virt_driver_lxc_impl',
@@ -82,4 +102,30 @@ if conf.has('WITH_LXC')
       '-DMODULE_NAME="lxc"',
     ],
   }
+
+  virt_helpers += {
+    'name': 'libvirt_lxc',
+    'sources': [
+      lxc_controller_sources,
+      lxc_monitor_protocol_generated,
+      lxc_controller_generated,
+      datatypes_sources,
+      dtrace_gen_objects,
+    ],
+    'include': [
+      conf_inc_dir,
+      hypervisor_inc_dir,
+      include_directories('.'),
+    ],
+    'deps': [
+      blkid_dep,
+      capng_dep,
+      dbus_dep,
+      fuse_dep,
+      libnl_dep,
+      rpc_dep,
+      secdriver_dep,
+      xdr_dep,
+    ],
+  }
 endif
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux