]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: build libvirt_driver_lxc_impl.a static library
authorPavel Hrdina <phrdina@redhat.com>
Wed, 17 Jun 2020 23:09:50 +0000 (01:09 +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/lxc/Makefile.inc.am
src/lxc/meson.build [new file with mode: 0644]
src/meson.build

index 1154999ae5ad0f2b9f5c6e664beaec0c4c89e16a..8cf7acebc1ab1432ce49cf83e84a12637b1e10ff 100644 (file)
@@ -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 \
@@ -71,7 +48,6 @@ BUILT_SOURCES += $(LXC_GENERATED)
 
 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 \
@@ -81,36 +57,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
 
@@ -259,12 +205,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 (file)
index 0000000..438cedd
--- /dev/null
@@ -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
index 5ab02c569f3a5c8a329c63acecee53978867a245..f7a00f1e953ea5c314f68a14963f0a5819e10436 100644 (file)
@@ -158,6 +158,7 @@ subdir('bhyve')
 subdir('esx')
 subdir('hyperv')
 subdir('libxl')
+subdir('lxc')
 subdir('openvz')
 subdir('test')
 subdir('vmware')