diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-10-07 15:08:18 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-10-14 09:50:57 +0200 |
commit | 96a63aeb3d6658b837523fee0df25300622e1dd0 (patch) | |
tree | 106527042cce1df1e465bee55c41ccb8e3e9f02a | |
parent | a76a1f6b764bf9076440eb1a70e8c7636793d7fe (diff) | |
download | 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>
-rwxr-xr-x | configure | 37 | ||||
-rw-r--r-- | meson.build | 19 |
2 files changed, 18 insertions, 38 deletions
@@ -2403,18 +2403,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 @@ -3843,21 +3831,6 @@ if test "$fortify_source" != "no"; then 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 have_membarrier=no @@ -4358,13 +4331,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 @@ -4569,9 +4535,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 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 |