summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-11-17 13:35:28 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-01-06 10:21:20 +0100
commitecea3696b9296503f1e447cb5453d8c8a18b5e01 (patch)
tree219d103bee768dbd54a628080d6494f0e0080039 /meson.build
parent241611eab28c43b1e1dc87cbc9f97545b40eec1a (diff)
lzfse: convert to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build20
1 files changed, 17 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 8861434721..2a3a840103 100644
--- a/meson.build
+++ b/meson.build
@@ -691,10 +691,24 @@ if not get_option('bzip2').auto() or have_block
endif
endif
endif
+
liblzfse = not_found
-if 'CONFIG_LZFSE' in config_host
- liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
+if not get_option('lzfse').auto() or have_block
+ liblzfse = cc.find_library('lzfse', has_headers: ['lzfse.h'],
+ required: get_option('lzfse'),
+ static: enable_static)
+endif
+if liblzfse.found() and not cc.links('''
+ #include <lzfse.h>
+ int main(void) { lzfse_decode_scratch_size(); return 0; }''', dependencies: liblzfse)
+ liblzfse = not_found
+ if get_option('lzfse').enabled()
+ error('could not link liblzfse')
+ else
+ warning('could not link liblzfse, disabling')
+ endif
endif
+
oss = not_found
if 'CONFIG_AUDIO_OSS' in config_host
oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
@@ -2368,7 +2382,7 @@ summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_
summary_info += {'lzo support': lzo.found()}
summary_info += {'snappy support': snappy.found()}
summary_info += {'bzip2 support': libbzip2.found()}
-summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
+summary_info += {'lzfse support': liblzfse.found()}
summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}