Currently the directories that are searched for each possible
kind of loadable module are created as a side effect of
installing the corresponding module, which means that their
availability depends on the exact list of features that have
been enabled.
Create them explicitly ahead of time instead, ensuring
consistency.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
meson.build | 5 +++++
src/locking/meson.build | 6 ++----
src/meson.build | 13 +++++++++++--
src/storage/meson.build | 2 --
src/storage_file/meson.build | 2 --
5 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/meson.build b/meson.build
index 1b0b717901..0bcab73ed8 100644
--- a/meson.build
+++ b/meson.build
@@ -134,6 +134,11 @@ if sshconfdir == ''
sshconfdir = sysconfdir / 'ssh' / 'ssh_config.d'
endif
+connection_driver_install_dir = libdir / 'libvirt' / 'connection-driver'
+storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend'
+storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
+lock_driver_install_dir = libdir / 'libvirt' / 'lock-driver'
+
# generate configmake.h header
diff --git a/src/locking/meson.build b/src/locking/meson.build
index c3dfcf2961..934e47593b 100644
--- a/src/locking/meson.build
+++ b/src/locking/meson.build
@@ -99,8 +99,6 @@ if conf.has('WITH_LIBVIRTD')
'lib': lockd_lib_impl,
}
- lockdriver_dir = libdir / 'libvirt' / 'lock-driver'
-
virt_modules += {
'name': 'lockd',
'name_prefix': '',
@@ -113,7 +111,7 @@ if conf.has('WITH_LIBVIRTD')
'link_args': [
libvirt_no_undefined,
],
- 'install_dir': lockdriver_dir,
+ 'install_dir': lock_driver_install_dir,
}
if conf.has('WITH_SANLOCK')
@@ -129,7 +127,7 @@ if conf.has('WITH_LIBVIRTD')
'link_args': [
libvirt_no_undefined,
],
- 'install_dir': lockdriver_dir,
+ 'install_dir': lock_driver_install_dir,
}
endif
diff --git a/src/meson.build b/src/meson.build
index cce89fac27..9413192a55 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -145,7 +145,7 @@ libvirt_libs = []
# * link_with - static libraries to link with (optional, default [])
# * link_whole - static libraries to include (optional, default [])
# * link_args - arguments for linker (optional, default [])
-# * install_dir - installation directory (optional, default libdir / 'libvirt'
/ 'connection-driver'
+# * install_dir - installation directory (optional, default
connection_driver_install_dir)
virt_modules = []
# virt_daemons:
@@ -611,7 +611,7 @@ foreach module : virt_modules
module.get('link_args', []),
],
install: true,
- install_dir: module.get('install_dir', libdir / 'libvirt' /
'connection-driver'),
+ install_dir: module.get('install_dir', connection_driver_install_dir),
install_rpath: libvirt_rpath,
)
set_variable('@0(a)_module'.format(module['name'].underscorify()), mod)
@@ -955,6 +955,15 @@ virt_install_dirs += [
localstatedir / 'lib' / 'libvirt' / 'boot',
]
+if conf.has('WITH_LIBVIRTD')
+ virt_install_dirs += [
+ connection_driver_install_dir,
+ storage_backend_install_dir,
+ storage_file_install_dir,
+ lock_driver_install_dir,
+ ]
+endif
+
meson.add_install_script(
meson_python_prog.full_path(), python3_prog.full_path(),
meson_install_dirs_prog.full_path(),
virt_install_dirs,
diff --git a/src/storage/meson.build b/src/storage/meson.build
index 404d6a6941..f6f28757ef 100644
--- a/src/storage/meson.build
+++ b/src/storage/meson.build
@@ -59,8 +59,6 @@ storage_backend_zfs_sources = [
'storage_backend_zfs.c',
]
-storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend'
-
if conf.has('WITH_STORAGE')
storage_driver_impl_lib = static_library(
'virt_storage_driver_impl',
diff --git a/src/storage_file/meson.build b/src/storage_file/meson.build
index 27c4e5a432..501ac99d75 100644
--- a/src/storage_file/meson.build
+++ b/src/storage_file/meson.build
@@ -10,8 +10,6 @@ storage_file_gluster_sources = [
'storage_file_backend_gluster.c',
]
-storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
-
virt_storage_file_lib = static_library(
'virt_storage_file',
[
--
2.48.1