Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/lxc/Makefile.inc.am | 60 ------------------------------------
src/lxc/meson.build | 67 +++++++++++++++++++++++++++++++++++++++++
src/meson.build | 1 +
3 files changed, 68 insertions(+), 60 deletions(-)
create mode 100644 src/lxc/meson.build
diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am
index 031aed14203..b0a12fdda50 100644
--- a/src/lxc/Makefile.inc.am
+++ b/src/lxc/Makefile.inc.am
@@ -21,29 +21,6 @@ LXC_GENERATED = \
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
-LXC_DRIVER_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_hostdev.c \
- lxc/lxc_hostdev.h \
- lxc/lxc_monitor.c \
- lxc/lxc_monitor.h \
- lxc/lxc_process.c \
- lxc/lxc_process.h \
- lxc/lxc_fuse.c \
- lxc/lxc_fuse.h \
- lxc/lxc_native.c \
- lxc/lxc_native.h \
- lxc/lxc_driver.c \
- lxc/lxc_driver.h \
- $(NULL)
-
LXC_CONTROLLER_SOURCES = \
lxc/lxc_conf.c \
lxc/lxc_conf.h \
@@ -70,7 +47,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \
if WITH_LXC
-noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = \
libvirt_driver_lxc_impl.la \
@@ -80,36 +56,6 @@ libvirt_driver_lxc_la_LIBADD = \
mod_LTLIBRARIES += libvirt_driver_lxc.la
libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
-libvirt_driver_lxc_impl_la_CFLAGS = \
- $(LIBNL_CFLAGS) \
- $(FUSE_CFLAGS) \
- $(XDR_CFLAGS) \
- -I$(srcdir)/access \
- -I$(builddir)/access \
- -I$(srcdir)/conf \
- -I$(builddir)/lxc \
- -I$(builddir)/rpc \
- -I$(srcdir)/hypervisor \
- $(AM_CFLAGS) \
- $(NULL)
-libvirt_driver_lxc_impl_la_LIBADD = \
- $(CAPNG_LIBS) \
- $(LIBNL_LIBS) \
- $(LIBXML_LIBS) \
- $(FUSE_LIBS) \
- $(NULL)
-
-if WITH_BLKID
-libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
-libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
-endif WITH_BLKID
-libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
-libvirt_driver_lxc_impl_la_SOURCES = \
- $(LXC_DRIVER_SOURCES)
-nodist_libvirt_driver_lxc_impl_la_SOURCES = \
- $(LXC_MONITOR_PROTOCOL_GENERATED) \
- $(LXC_MONITOR_GENERATED)
-
sbin_PROGRAMS += virtlxcd
@@ -258,12 +204,6 @@ uninstall-data-lxc:
endif WITH_LXC
-lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
- $(LXC_MONITOR_PROTOCOL) Makefile.am
- $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
- virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
- lxc/lxc_monitor_dispatch.h
-
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
diff --git a/src/lxc/meson.build b/src/lxc/meson.build
new file mode 100644
index 00000000000..438cedd287c
--- /dev/null
+++ b/src/lxc/meson.build
@@ -0,0 +1,67 @@
+lxc_driver_sources = [
+ 'lxc_cgroup.c',
+ 'lxc_conf.c',
+ 'lxc_container.c',
+ 'lxc_domain.c',
+ 'lxc_driver.c',
+ 'lxc_fuse.c',
+ 'lxc_hostdev.c',
+ 'lxc_monitor.c',
+ 'lxc_native.c',
+ 'lxc_process.c',
+]
+
+lxc_monitor_protocol = files('lxc_monitor_protocol.x')
+
+lxc_monitor_protocol_generated = []
+
+lxc_monitor_protocol_generated += custom_target(
+ 'lxc_monitor_protocol_h',
+ input: lxc_monitor_protocol,
+ output: 'lxc_monitor_protocol.h',
+ command: [ genprotocol_prog, rpcgen_prog, '-h', '@INPUT@',
'@OUTPUT@' ]
+)
+
+lxc_monitor_protocol_generated += custom_target(
+ 'lxc_monitor_protocol_c',
+ input: lxc_monitor_protocol,
+ output: 'lxc_monitor_protocol.c',
+ command: [ genprotocol_prog, rpcgen_prog, '-c', '@INPUT@',
'@OUTPUT@' ]
+)
+
+lxc_monitor_generated = custom_target(
+ 'lxc_monitor_dispatch_h',
+ input: lxc_monitor_protocol,
+ output: 'lxc_monitor_dispatch.h',
+ command: [
+ gendispatch_prog, '--mode=client',
+ 'virLXCMonitor', 'VIR_LXC_MONITOR', '@INPUT@'
+ ],
+ capture: true,
+)
+
+if conf.has('WITH_LXC')
+ lxc_driver_impl_lib = static_library(
+ 'virt_driver_lxc_impl',
+ [
+ lxc_driver_sources,
+ lxc_monitor_protocol_generated,
+ lxc_monitor_generated,
+ ],
+ dependencies: [
+ access_dep,
+ blkid_dep,
+ capng_dep,
+ fuse_dep,
+ libnl_dep,
+ secdriver_dep,
+ src_dep,
+ rpc_dep,
+ xdr_dep,
+ ],
+ include_directories: [
+ conf_inc_dir,
+ hypervisor_inc_dir,
+ ],
+ )
+endif
diff --git a/src/meson.build b/src/meson.build
index 44992fac02b..217ceb2d6ef 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -149,6 +149,7 @@ subdir('bhyve')
subdir('esx')
subdir('hyperv')
subdir('libxl')
+subdir('lxc')
subdir('openvz')
subdir('test')
subdir('vmware')
--
2.26.2