2020-05-05 08:14:34 +00:00
|
|
|
src_inc_dir = include_directories('.')
|
|
|
|
|
|
|
|
src_dep = declare_dependency(
|
|
|
|
compile_args: [
|
|
|
|
'-DIN_LIBVIRT',
|
|
|
|
'-Dabs_top_builddir="@0@"'.format(meson.build_root()),
|
|
|
|
'-Dabs_top_srcdir="@0@"'.format(meson.source_root()),
|
|
|
|
] + coverage_flags + win32_flags,
|
|
|
|
dependencies: [
|
|
|
|
glib_dep,
|
|
|
|
libxml_dep,
|
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
libvirt_inc,
|
|
|
|
src_inc_dir,
|
|
|
|
top_inc_dir,
|
|
|
|
],
|
|
|
|
link_args: (
|
|
|
|
libvirt_relro
|
|
|
|
+ libvirt_no_indirect
|
|
|
|
+ coverage_flags
|
|
|
|
+ driver_modules_flags
|
|
|
|
+ win32_link_flags
|
|
|
|
),
|
|
|
|
)
|
2020-06-25 13:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
# define secdriver_dep
|
|
|
|
|
|
|
|
secdriver_dep = []
|
|
|
|
if conf.has('WITH_SECDRIVER_SELINUX')
|
|
|
|
secdriver_dep += selinux_dep
|
|
|
|
endif
|
|
|
|
if conf.has('WITH_SECDRIVER_APPARMOR')
|
|
|
|
secdriver_dep += apparmor_dep
|
|
|
|
endif
|
2020-07-27 06:16:48 +00:00
|
|
|
|
|
|
|
|
2020-06-25 13:41:34 +00:00
|
|
|
# Internal generic driver infrastructure
|
|
|
|
|
|
|
|
datatypes_sources = [
|
|
|
|
'datatypes.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2020-07-27 06:16:48 +00:00
|
|
|
# generate systemtap files
|
|
|
|
|
|
|
|
systemtap_dir = datadir / 'systemtap' / 'tapset'
|
|
|
|
|
|
|
|
dtrace_gen_headers = []
|
|
|
|
dtrace_gen_objects = []
|
|
|
|
|
|
|
|
if conf.has('WITH_DTRACE_PROBES')
|
|
|
|
infile = 'libvirt_probes.d'
|
|
|
|
out_h = 'libvirt_probes.h'
|
|
|
|
out_o = 'libvirt_probes.o'
|
|
|
|
out_stp = 'libvirt_probes.stp'
|
|
|
|
|
|
|
|
dtrace_gen_headers += custom_target(
|
|
|
|
out_h,
|
|
|
|
input: infile,
|
|
|
|
output: out_h,
|
|
|
|
command: [ dtrace_prog, '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ],
|
|
|
|
)
|
|
|
|
|
|
|
|
dtrace_gen_objects += custom_target(
|
|
|
|
out_o,
|
|
|
|
input: infile,
|
|
|
|
output: out_o,
|
|
|
|
command: [ dtrace_prog, '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ],
|
|
|
|
)
|
|
|
|
|
|
|
|
custom_target(
|
|
|
|
out_stp,
|
|
|
|
input: infile,
|
|
|
|
output: out_stp,
|
|
|
|
command: [
|
|
|
|
meson_python_prog, python3_prog.path(), dtrace2systemtap_prog.path(),
|
|
|
|
bindir, sbindir, libdir, '@INPUT@'
|
|
|
|
],
|
|
|
|
capture: true,
|
|
|
|
install: true,
|
|
|
|
install_dir: systemtap_dir,
|
|
|
|
)
|
|
|
|
endif
|
2020-07-27 06:17:48 +00:00
|
|
|
|
|
|
|
|
2020-07-27 06:35:58 +00:00
|
|
|
# symbol files
|
|
|
|
|
|
|
|
public_sym_file = 'libvirt_public.syms'
|
|
|
|
|
|
|
|
used_sym_files = [
|
|
|
|
'libvirt_private.syms',
|
|
|
|
'libvirt_driver_modules.syms',
|
|
|
|
]
|
|
|
|
|
|
|
|
generated_sym_files = []
|
|
|
|
|
|
|
|
sym_files = []
|
|
|
|
|
|
|
|
if host_machine.system() == 'linux'
|
|
|
|
used_sym_files += 'libvirt_linux.syms'
|
|
|
|
else
|
|
|
|
sym_files += 'libvirt_linux.syms'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if conf.has('WITH_SASL')
|
|
|
|
used_sym_files += 'libvirt_sasl.syms'
|
|
|
|
else
|
|
|
|
sym_files += 'libvirt_sasl.syms'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if conf.has('WITH_LIBSSH')
|
|
|
|
used_sym_files += 'libvirt_libssh.syms'
|
|
|
|
else
|
|
|
|
sym_files += 'libvirt_libssh.syms'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if conf.has('WITH_SSH2')
|
|
|
|
used_sym_files += 'libvirt_libssh2.syms'
|
|
|
|
else
|
|
|
|
sym_files += 'libvirt_libssh2.syms'
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2020-07-27 06:39:38 +00:00
|
|
|
# variables filled by subdirectories
|
|
|
|
|
|
|
|
libvirt_libs = []
|
|
|
|
|
|
|
|
|
2020-07-27 06:17:48 +00:00
|
|
|
# list subdirectories
|
|
|
|
|
2020-06-17 23:07:25 +00:00
|
|
|
subdir('cpu_map')
|
|
|
|
|
2020-07-27 06:17:48 +00:00
|
|
|
subdir('util')
|
|
|
|
|
|
|
|
src_dep = declare_dependency(
|
|
|
|
dependencies: [ src_dep ],
|
|
|
|
include_directories: [ util_inc_dir ],
|
|
|
|
)
|
2020-04-30 17:33:38 +00:00
|
|
|
|
|
|
|
subdir('conf')
|
2020-07-27 09:06:06 +00:00
|
|
|
subdir('rpc')
|
2020-06-17 22:57:13 +00:00
|
|
|
subdir('access')
|
2020-05-18 13:01:32 +00:00
|
|
|
subdir('cpu')
|
2020-07-27 06:22:41 +00:00
|
|
|
|
2020-03-11 13:44:58 +00:00
|
|
|
subdir('hypervisor')
|
2020-06-17 22:58:52 +00:00
|
|
|
subdir('vmx')
|
|
|
|
|
2020-07-27 06:26:42 +00:00
|
|
|
subdir('remote')
|
|
|
|
|
2020-07-27 06:22:41 +00:00
|
|
|
subdir('admin')
|
2020-06-17 23:00:56 +00:00
|
|
|
subdir('locking')
|
2020-03-13 10:25:23 +00:00
|
|
|
subdir('logging')
|
2020-07-27 06:27:28 +00:00
|
|
|
subdir('security')
|
2020-06-17 22:59:17 +00:00
|
|
|
|
2020-07-27 06:23:40 +00:00
|
|
|
subdir('esx')
|
2020-07-27 06:24:55 +00:00
|
|
|
subdir('hyperv')
|
2020-06-17 23:00:10 +00:00
|
|
|
subdir('openvz')
|
2020-06-17 23:00:22 +00:00
|
|
|
subdir('test')
|
2020-06-17 22:59:17 +00:00
|
|
|
subdir('vmware')
|
2020-06-17 23:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
driver_sources = [
|
|
|
|
'driver.c',
|
|
|
|
'libvirt.c',
|
|
|
|
'libvirt-domain.c',
|
|
|
|
'libvirt-domain-checkpoint.c',
|
|
|
|
'libvirt-domain-snapshot.c',
|
|
|
|
'libvirt-host.c',
|
|
|
|
'libvirt-interface.c',
|
|
|
|
'libvirt-network.c',
|
|
|
|
'libvirt-nodedev.c',
|
|
|
|
'libvirt-nwfilter.c',
|
|
|
|
'libvirt-secret.c',
|
|
|
|
'libvirt-storage.c',
|
|
|
|
'libvirt-stream.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
driver_lib = static_library(
|
|
|
|
'virt_driver',
|
|
|
|
[
|
|
|
|
driver_sources,
|
|
|
|
datatypes_sources,
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
curl_dep,
|
|
|
|
dlopen_dep,
|
|
|
|
gnutls_dep,
|
|
|
|
rpc_dep,
|
|
|
|
src_dep,
|
|
|
|
xdr_dep,
|
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
conf_inc_dir,
|
|
|
|
],
|
|
|
|
)
|
2020-07-27 06:35:58 +00:00
|
|
|
|
2020-07-27 06:39:38 +00:00
|
|
|
libvirt_libs += driver_lib
|
|
|
|
|
2020-07-27 06:35:58 +00:00
|
|
|
|
|
|
|
# symbol files for libvirt.so
|
|
|
|
|
|
|
|
# Build our version script. This is composed of three parts:
|
|
|
|
#
|
|
|
|
# 1. libvirt_public.syms - public API. These functions are always
|
|
|
|
# present in the library and should never change incompatibly.
|
|
|
|
#
|
|
|
|
# 2. libvirt_private.syms - private API. These symbols are private and
|
|
|
|
# semantics may change on every release, hence the version number is
|
|
|
|
# spliced in at build time. This ensures that if libvirtd, virsh, or a
|
|
|
|
# driver module was built against one libvirt release, it will refuse to
|
|
|
|
# load with another where symbols may have same names but different
|
|
|
|
# semantics. Such symbols should never be visible in an (installed)
|
|
|
|
# public header file.
|
|
|
|
#
|
|
|
|
# 3. libvirt_*.syms - dynamic private API. Like libvirt_private.syms,
|
|
|
|
# except that build options (such as --enable-debug) can mean these
|
|
|
|
# symbols aren't present at all.
|
|
|
|
|
|
|
|
libvirt_syms = custom_target(
|
|
|
|
'libvirt.syms',
|
|
|
|
input: [ public_sym_file ] + used_sym_files + generated_sym_files,
|
|
|
|
output: 'libvirt.syms',
|
|
|
|
command: [
|
|
|
|
meson_python_prog, python3_prog.path(), meson_gen_sym_prog.path(),
|
|
|
|
'@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@',
|
|
|
|
],
|
|
|
|
)
|
2020-07-27 06:39:38 +00:00
|
|
|
libvirt_syms_file = libvirt_syms
|
2020-07-27 06:35:58 +00:00
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
libvirt_def = custom_target(
|
|
|
|
'libvirt.def',
|
|
|
|
input: libvirt_syms,
|
|
|
|
output: 'libvirt.def',
|
|
|
|
command: [
|
|
|
|
meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(),
|
|
|
|
'@INPUT@', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
)
|
2020-07-27 06:39:38 +00:00
|
|
|
libvirt_syms_file = libvirt_def
|
2020-07-27 06:35:58 +00:00
|
|
|
endif
|
2020-07-27 06:39:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
# libvirt.so library
|
|
|
|
|
|
|
|
libvirt_syms_flags = '@0@@1@'.format(
|
|
|
|
version_script_flags,
|
|
|
|
libvirt_syms_file.full_path(),
|
|
|
|
)
|
|
|
|
|
|
|
|
libvirt_lib = shared_library(
|
|
|
|
'virt',
|
|
|
|
dtrace_gen_objects,
|
|
|
|
dependencies: [
|
|
|
|
src_dep,
|
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
libvirt_flat_namespace,
|
|
|
|
libvirt_no_undefined,
|
|
|
|
libvirt_nodelete,
|
|
|
|
libvirt_syms_flags,
|
|
|
|
],
|
|
|
|
link_whole: [
|
|
|
|
libvirt_libs,
|
|
|
|
],
|
|
|
|
link_depends: [
|
|
|
|
libvirt_syms_file,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
version: libvirt_lib_version,
|
|
|
|
soversion: libvirt_so_version,
|
|
|
|
)
|
2020-06-17 23:07:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
# libvirt-qemu.syms symbol files
|
|
|
|
|
|
|
|
libvirt_qemu_syms = meson.current_source_dir() / 'libvirt_qemu.syms'
|
|
|
|
libvirt_qemu_syms_file = libvirt_qemu_syms
|
|
|
|
libvirt_qemu_syms_path = libvirt_qemu_syms
|
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
libvirt_qemu_def = custom_target(
|
|
|
|
'libvirt_qemu.def',
|
|
|
|
input: libvirt_qemu_syms,
|
|
|
|
output: 'libvirt_qemu.def',
|
|
|
|
command: [
|
|
|
|
meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(),
|
|
|
|
'@INPUT@', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
libvirt_qemu_syms_file = libvirt_qemu_def
|
|
|
|
libvirt_qemu_syms_path = libvirt_qemu_def.full_path()
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
# libvirt-qemu.so
|
|
|
|
|
|
|
|
libvirt_qemu_syms_flags = '@0@@1@'.format(
|
|
|
|
version_script_flags,
|
|
|
|
libvirt_qemu_syms_path,
|
|
|
|
)
|
|
|
|
|
|
|
|
libvirt_qemu_lib = shared_library(
|
|
|
|
'virt-qemu',
|
|
|
|
'libvirt-qemu.c',
|
|
|
|
dependencies: [
|
|
|
|
src_dep,
|
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
libvirt_nodelete,
|
|
|
|
libvirt_qemu_syms_flags,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libvirt_lib,
|
|
|
|
],
|
|
|
|
link_depends: [
|
|
|
|
libvirt_qemu_syms_file,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_rpath: libdir,
|
|
|
|
version: libvirt_lib_version,
|
|
|
|
soversion: libvirt_so_version,
|
|
|
|
)
|