]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: add io-uring-event-loop option
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Oct 2021 15:07:27 +0000 (17:07 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Oct 2021 15:07:27 +0000 (17:07 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
meson.build
meson_options.txt

index bef89f452738e8883bc5bbd64839aca07b8a18a8..a4125962f4b1c99d8e6010792c6088134f308433 100644 (file)
@@ -59,6 +59,7 @@ logpath = get_option('log-path')
 lxcpathprefix = get_option('config-path')
 rootfsmount = get_option('rootfs-mount-dir')
 runtimepath = join_paths(prefixdir, get_option('runtime-path'))
+wants_io_uring = get_option('io-uring-event-loop')
 
 conf.set_quoted('BINDIR',                      bindir)
 conf.set_quoted('DATADIR',                     datadir)
@@ -279,6 +280,11 @@ foreach ident : [
        conf.set10('HAVE_' + ident[0].to_upper(), have)
 endforeach
 
+if wants_io_uring == true
+       liburing = dependency('liburing')
+       conf.set10('HAVE_LIBURING', liburing.found())
+endif
+
 sh = find_program('sh')
 git = find_program('git', required : false)
 time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"').stdout().strip()
@@ -383,6 +389,17 @@ subdir('src/include')
 subdir('src/lxc/tools/include')
 subdir('src/lxc')
 
+liblxc_dependencies = [threads,
+                      libseccomp,
+                      libcap,
+                      libopenssl,
+                      libselinux,
+                      libapparmor]
+
+if wants_io_uring == true
+       liblxc_dependencies += [liburing]
+endif
+
 liblxc = shared_library(
         'lxc',
         version : liblxc_version,
@@ -390,22 +407,12 @@ liblxc = shared_library(
         link_args : ['-DPIC'],
         c_args : ['-DPIC'],
         link_whole : [liblxc_static],
-        dependencies : [threads,
-                       libseccomp,
-                       libcap,
-                       libopenssl,
-                       libselinux,
-                       libapparmor],
+        dependencies: liblxc_dependencies,
         install : true)
 
 liblxc_dep = declare_dependency(
                link_with: liblxc,
-               dependencies : [threads,
-                               libseccomp,
-                               libcap,
-                               libopenssl,
-                               libselinux,
-                               libapparmor])
+               dependencies: liblxc_dependencies)
 
 dummy_config_data = configuration_data()
 dummy_config_data.set_quoted('DUMMY_VARIABLE', '1')
@@ -543,6 +550,7 @@ foreach tuple : [
         ['libcap'],
         ['static libcap'],
         ['openssl'],
+        ['liburing'],
 ]
 
         if tuple.length() >= 2
index 0989055df04244f721feb2e974fa5c54313d84ff..ac1e05032b7150dcf97d418593a5931996a26f36 100644 (file)
@@ -36,3 +36,6 @@ option('user-network-conf', type : 'string', value : 'lxc/lxc-usernet',
 
 option('user-network-db', type : 'string', value : 'lxc/nics',
        description : 'user network database')
+
+option('io-uring-event-loop', type : 'boolean', value: 'false',
+       description : 'enable io-uring based event loop')