mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
meson: move libmpathpersist test
This is the first compiler/linker test that has been moved to Meson. Add more section headings to keep things clearer. This also fixes static linking to libmpathpersist, which has a dependency on libmultipath but no pkg-config file to describe it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f01496a314
commit
6ec0e15d95
3 changed files with 80 additions and 80 deletions
81
meson.build
81
meson.build
|
@ -86,6 +86,14 @@ if 'SPARSE_CFLAGS' in config_host
|
|||
'compile_commands.json'])
|
||||
endif
|
||||
|
||||
###########################################
|
||||
# Target-specific checks and dependencies #
|
||||
###########################################
|
||||
|
||||
if targetos != 'linux' and get_option('mpath').enabled()
|
||||
error('Multipath is supported only on Linux')
|
||||
endif
|
||||
|
||||
m = cc.find_library('m', required: false)
|
||||
util = cc.find_library('util', required: false)
|
||||
winmm = []
|
||||
|
@ -117,6 +125,11 @@ elif targetos == 'haiku'
|
|||
cc.find_library('network'),
|
||||
cc.find_library('bsd')]
|
||||
endif
|
||||
|
||||
################
|
||||
# Dependencies #
|
||||
################
|
||||
|
||||
# The path to glib.h is added to all compilation commands. This was
|
||||
# grandfathered in from the QEMU Makefiles.
|
||||
add_project_arguments(config_host['GLIB_CFLAGS'].split(),
|
||||
|
@ -223,10 +236,6 @@ if 'CONFIG_SPICE' in config_host
|
|||
link_args: config_host['SPICE_LIBS'].split())
|
||||
endif
|
||||
rt = cc.find_library('rt', required: false)
|
||||
libmpathpersist = not_found
|
||||
if config_host.has_key('CONFIG_MPATH')
|
||||
libmpathpersist = cc.find_library('mpathpersist')
|
||||
endif
|
||||
libdl = not_found
|
||||
if 'CONFIG_PLUGIN' in config_host
|
||||
libdl = cc.find_library('dl', required: true)
|
||||
|
@ -258,8 +267,64 @@ if 'CONFIG_CURL' in config_host
|
|||
endif
|
||||
libudev = not_found
|
||||
if targetos == 'linux' and (have_system or have_tools)
|
||||
libudev = dependency('libudev', static: enable_static)
|
||||
libudev = dependency('libudev',
|
||||
required: get_option('mpath').enabled(),
|
||||
static: enable_static)
|
||||
endif
|
||||
|
||||
mpathpersist = not_found
|
||||
mpathpersist_new_api = false
|
||||
if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
|
||||
mpath_test_source_new = '''
|
||||
#include <libudev.h>
|
||||
#include <mpath_persist.h>
|
||||
unsigned mpath_mx_alloc_len = 1024;
|
||||
int logsink;
|
||||
static struct config *multipath_conf;
|
||||
extern struct udev *udev;
|
||||
extern struct config *get_multipath_config(void);
|
||||
extern void put_multipath_config(struct config *conf);
|
||||
struct udev *udev;
|
||||
struct config *get_multipath_config(void) { return multipath_conf; }
|
||||
void put_multipath_config(struct config *conf) { }
|
||||
int main(void) {
|
||||
udev = udev_new();
|
||||
multipath_conf = mpath_lib_init();
|
||||
return 0;
|
||||
}'''
|
||||
mpath_test_source_old = '''
|
||||
#include <libudev.h>
|
||||
#include <mpath_persist.h>
|
||||
unsigned mpath_mx_alloc_len = 1024;
|
||||
int logsink;
|
||||
int main(void) {
|
||||
struct udev *udev = udev_new();
|
||||
mpath_lib_init(udev);
|
||||
return 0;
|
||||
}'''
|
||||
libmultipath = cc.find_library('multipath',
|
||||
required: get_option('mpath'),
|
||||
static: enable_static)
|
||||
libmpathpersist = cc.find_library('mpathpersist',
|
||||
required: get_option('mpath'),
|
||||
static: enable_static)
|
||||
if libmultipath.found() and libmpathpersist.found() and libudev.found()
|
||||
mpathlibs = [libmultipath, libmpathpersist, libudev]
|
||||
if cc.links(mpath_test_source_new, dependencies: mpathlibs)
|
||||
mpathpersist = declare_dependency(dependencies: mpathlibs)
|
||||
mpathpersist_new_api = true
|
||||
elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
|
||||
mpathpersist = declare_dependency(dependencies: mpathlibs)
|
||||
else
|
||||
if get_option('mpath').enabled()
|
||||
error('Cannot detect libmpathpersist API')
|
||||
else
|
||||
warning('Cannot detect libmpathpersist API, disabling')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
brlapi = not_found
|
||||
if 'CONFIG_BRLAPI' in config_host
|
||||
brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
|
||||
|
@ -441,6 +506,8 @@ has_gettid = cc.has_function('gettid')
|
|||
# Create config-host.h
|
||||
|
||||
config_host_data.set('CONFIG_LIBUDEV', libudev.found())
|
||||
config_host_data.set('CONFIG_MPATH', mpathpersist.found())
|
||||
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
|
||||
config_host_data.set('CONFIG_SDL', sdl.found())
|
||||
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
|
||||
config_host_data.set('CONFIG_VNC', vnc.found())
|
||||
|
@ -1205,7 +1272,7 @@ if have_tools
|
|||
|
||||
executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
|
||||
dependencies: [authz, crypto, io, qom, qemuutil,
|
||||
libcap_ng, libudev, libmpathpersist],
|
||||
libcap_ng, mpathpersist],
|
||||
install: true)
|
||||
endif
|
||||
|
||||
|
@ -1342,7 +1409,7 @@ summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
|
|||
summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
|
||||
summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
|
||||
summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
|
||||
summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')}
|
||||
summary_info += {'Multipath support': mpathpersist.found()}
|
||||
summary_info += {'VNC support': vnc.found()}
|
||||
if vnc.found()
|
||||
summary_info += {'VNC SASL support': sasl.found()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue