qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 19/26] configure: convert compiler tests to meson, part 1


From: Paolo Bonzini
Subject: Re: [PATCH 19/26] configure: convert compiler tests to meson, part 1
Date: Tue, 15 Jun 2021 17:15:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 15/06/21 16:59, Daniel P. Berrangé wrote:
  config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device)
+config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))

Why add this here rather than with the other CONFIG_ checks ?

Because despite the different name it's just a header check. I chose to keep similar cc.has_* symbols together, and sorthed them alphabetically. It should in theory make it easier to look for examples when adding new tests to meson.build.

  config_host_data.set('HAVE_BTRFS_H', cc.has_header('linux/btrfs.h'))
  config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h'))
  config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h'))
@@ -1267,9 +1270,39 @@ config_host_data.set('HAVE_SYS_DISK_H', 
cc.has_header('sys/disk.h'))
  config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
  config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h'))
+config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime'))
+config_host_data.set('CONFIG_DUP3', cc.has_function('dup3'))
+config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate'))
+config_host_data.set('CONFIG_POSIX_FALLOCATE', 
cc.has_function('posix_fallocate'))
+config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll'))
  config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include 
<sys/uio.h>'))
+config_host_data.set('CONFIG_SENDFILE', cc.has_function('sendfile'))
+config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and 
cc.has_function('unshare'))
+config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs'))
+config_host_data.set('CONFIG_SYNC_FILE_RANGE', 
cc.has_function('sync_file_range'))
+config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
+config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: 
util))
  config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: 
'#include <stdlib.h>'))

This function looks even more out of place

+config_host_data.set('CONFIG_BYTESWAP_H',
+                     cc.has_header_symbol('byteswap.h', 'bswap_32'))
+config_host_data.set('CONFIG_EPOLL_CREATE1',
+                     cc.has_header_symbol('sys/epoll.h', 'epoll_create1'))

Why not sort next to CONFIG_EPOLL

+config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE',
+                     cc.has_header_symbol('linux/falloc.h', 
'FALLOC_FL_PUNCH_HOLE') and
+                     cc.has_header_symbol('linux/falloc.h', 
'FALLOC_FL_KEEP_SIZE'))
+config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE',
+                     cc.has_header_symbol('linux/falloc.h', 
'FALLOC_FL_ZERO_RANGE'))

And next to CONFIG_FALLOCATE ?

+config_host_data.set('CONFIG_FIEMAP',
+                     cc.has_header('linux/fiemap.h') and
+                     cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP'))
+config_host_data.set('CONFIG_MACHINE_BSWAP_H',
+                     cc.has_header_symbol('machine/bswap.h', 'bswap32',
+                                          prefix: '''#include <sys/endian.h>
+                                                     #include 
<sys/types.h>'''))
+config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK',
+                     cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK'))
+
  # Some versions of Mac OS X incorrectly define SIZE_MAX
  config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
      #include <stdint.h>
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c
index 47fdae5b21..cf65a0b161 100644
--- a/ui/vnc-auth-sasl.c
+++ b/ui/vnc-auth-sasl.c
@@ -33,7 +33,7 @@
   * files that use SASL API need to disable -Wdeprecated-declarations.
   */
  #ifdef CONFIG_DARWIN
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"

Why this change now ?

Botched rebase.

  #endif
/* Max amount of data we send/recv for SASL steps to prevent DOS */
diff --git a/util/meson.build b/util/meson.build
index 97fad44105..7fe9da60ab 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -3,7 +3,9 @@ util_ss.add(files('osdep.c', 'cutils.c', 'unicode.c', 
'qemu-timer-common.c'))
  util_ss.add(when: 'CONFIG_ATOMIC64', if_false: files('atomic64.c'))
  util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c'))
  util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c'))
-util_ss.add(when: 'CONFIG_EPOLL_CREATE1', if_true: files('fdmon-epoll.c'))
+if config_host_data.get('CONFIG_EPOLL_CREATE1')
+  util_ss.add(files('fdmon-epoll.c'))
+endif


Why does this need to change  ?

Because CONFIG_EPOLL_CREATE1 is not anymore part of config-host.mak (which is where config_host comes from; "when" clauses look at config_host).

  util_ss.add(when: ['CONFIG_LINUX_IO_URING', linux_io_uring], if_true: 
files('fdmon-io_uring.c'))
  util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c'))
  util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c'))

Regards,
Daniel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]