[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/24] configure, meson: move remaining HAVE_* compiler tests
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson |
Date: |
Tue, 12 Oct 2021 13:12:51 +0200 |
Remove some special cases by moving them to Meson.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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>
---
configure | 37 -------------------------------------
meson.build | 22 ++++++++++++++++++++--
2 files changed, 20 insertions(+), 39 deletions(-)
diff --git a/configure b/configure
index 499c84859d..52f89b05d6 100755
--- a/configure
+++ b/configure
@@ -2401,18 +2401,6 @@ else
l2tpv3=no
fi
-cat > $TMPC <<EOF
-#include <sys/mman.h>
-int main(int argc, char *argv[]) {
- return mlockall(MCL_FUTURE);
-}
-EOF
-if compile_prog "" "" ; then
- have_mlockall=yes
-else
- have_mlockall=no
-fi
-
#########################################
# vhost interdependencies and host support
@@ -3840,21 +3828,6 @@ if test "$fortify_source" != "no"; then
fi
fi
-##########################################
-# check if struct fsxattr is available via linux/fs.h
-
-have_fsxattr=no
-cat > $TMPC << EOF
-#include <linux/fs.h>
-struct fsxattr foo;
-int main(void) {
- return 0;
-}
-EOF
-if compile_prog "" "" ; then
- have_fsxattr=yes
-fi
-
##########################################
# check for usable membarrier system call
if test "$membarrier" = "yes"; then
@@ -4356,13 +4329,6 @@ if test "$gdbus_codegen" != "" ; then
fi
echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
-# 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.
-if test "$have_fsxattr" = "yes" ; then
- echo "HAVE_FSXATTR=y" >> $config_host_mak
-fi
if test "$xen" = "enabled" ; then
echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >>
$config_host_mak
@@ -4567,9 +4533,6 @@ fi
if test "$parallels" = "yes" ; then
echo "CONFIG_PARALLELS=y" >> $config_host_mak
fi
-if test "$have_mlockall" = "yes" ; then
- echo "HAVE_MLOCKALL=y" >> $config_host_mak
-fi
if test "$plugins" = "yes" ; then
echo "CONFIG_PLUGIN=y" >> $config_host_mak
diff --git a/meson.build b/meson.build
index b551080523..c712963170 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>
@@ -1609,7 +1626,8 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not
cc.compiles('''
return printf("%zu", SIZE_MAX);
}''', args: ['-Werror']))
-ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
+ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target
+ 'HAVE_GDB_BIN']
arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
strings = ['CONFIG_IASL']
foreach k, v: config_host
@@ -1624,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
--
2.31.1
- [PATCH v2 03/24] configure, meson: move audio driver detection to Meson, (continued)
- [PATCH v2 03/24] configure, meson: move audio driver detection to Meson, Paolo Bonzini, 2021/10/12
- [PATCH v2 09/24] trace: move configuration from configure to Meson, Paolo Bonzini, 2021/10/12
- [PATCH v2 11/24] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object, Paolo Bonzini, 2021/10/12
- [PATCH v2 06/24] kconfig: split CONFIG_SPARSE_MEM from fuzzing, Paolo Bonzini, 2021/10/12
- [PATCH v2 07/24] configure, meson: move fuzzing configuration to Meson, Paolo Bonzini, 2021/10/12
- [PATCH v2 08/24] trace: simple: pass trace_file unmodified to config-host.h, Paolo Bonzini, 2021/10/12
- [PATCH v2 10/24] configure, meson: move CONFIG_HOST_DSOSUF to Meson, Paolo Bonzini, 2021/10/12
- [PATCH v2 12/24] configure, meson: remove CONFIG_GCOV from config-host.mak, Paolo Bonzini, 2021/10/12
- [PATCH v2 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson,
Paolo Bonzini <=
- [PATCH v2 15/24] configure, meson: move libaio check to meson.build, Paolo Bonzini, 2021/10/12
- [PATCH v2 18/24] configure, meson: move Spice configure handling to meson, Paolo Bonzini, 2021/10/12
- [PATCH v2 14/24] configure, meson: move pthread_setname_np checks to Meson, Paolo Bonzini, 2021/10/12
- [PATCH v2 16/24] configure, meson: move vde detection to meson, Paolo Bonzini, 2021/10/12