summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini2021-10-07 15:08:18 +0200
committerPaolo Bonzini2021-10-14 09:50:57 +0200
commit96a63aeb3d6658b837523fee0df25300622e1dd0 (patch)
tree106527042cce1df1e465bee55c41ccb8e3e9f02a /meson.build
parentmeson: HAVE_GDB_BIN is not used by C code (diff)
downloadqemu-96a63aeb3d6658b837523fee0df25300622e1dd0.tar.gz
qemu-96a63aeb3d6658b837523fee0df25300622e1dd0.tar.xz
qemu-96a63aeb3d6658b837523fee0df25300622e1dd0.zip
configure, meson: move remaining HAVE_* compiler tests to Meson
Remove some special cases by moving them to Meson. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211007130829.632254-8-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build19
1 files changed, 18 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index bdcedf2eef..e8e728bf72 100644
--- a/meson.build
+++ b/meson.build
@@ -1601,6 +1601,23 @@ config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
return 0;
}'''))
+config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
+ #include <sys/mman.h>
+ int main(int argc, char *argv[]) {
+ return mlockall(MCL_FUTURE);
+ }'''))
+
+# Work around a system header bug with some kernel/XFS header
+# versions where they both try to define 'struct fsxattr':
+# xfs headers will not try to redefine structs from linux headers
+# if this macro is set.
+config_host_data.set('HAVE_FSXATTR', cc.links('''
+ #include <linux/fs.h>'
+ struct fsxattr foo;
+ int main(void) {
+ return 0;
+ }'''))
+
# Some versions of Mac OS X incorrectly define SIZE_MAX
config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
#include <stdint.h>
@@ -1625,7 +1642,7 @@ foreach k, v: config_host
config_host_data.set('HOST_' + v.to_upper(), 1)
elif strings.contains(k)
config_host_data.set_quoted(k, v)
- elif k.startswith('CONFIG_') or k.startswith('HAVE_')
+ elif k.startswith('CONFIG_')
config_host_data.set(k, v == 'y' ? 1 : v)
endif
endforeach