All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 25/26] configure: convert compiler tests to meson, part 5
Date: Tue,  8 Jun 2021 13:23:00 +0200	[thread overview]
Message-ID: <20210608112301.402434-26-pbonzini@redhat.com> (raw)
In-Reply-To: <20210608112301.402434-1-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure   | 101 ----------------------------------------------------
 meson.build |  26 ++++++++++++++
 2 files changed, 26 insertions(+), 101 deletions(-)

diff --git a/configure b/configure
index 87143ca00d..527a308470 100755
--- a/configure
+++ b/configure
@@ -3395,92 +3395,6 @@ EOF
   fi
 fi
 
-# Check for inotify functions when we are building linux-user
-# emulator.  This is done because older glibc versions don't
-# have syscall stubs for these implemented.  In that case we
-# don't provide them even if kernel supports them.
-#
-inotify=no
-cat > $TMPC << EOF
-#include <sys/inotify.h>
-
-int
-main(void)
-{
-	/* try to start inotify */
-	return inotify_init();
-}
-EOF
-if compile_prog "" "" ; then
-  inotify=yes
-fi
-
-inotify1=no
-cat > $TMPC << EOF
-#include <sys/inotify.h>
-
-int
-main(void)
-{
-    /* try to start inotify */
-    return inotify_init1(0);
-}
-EOF
-if compile_prog "" "" ; then
-  inotify1=yes
-fi
-
-# check if pipe2 is there
-pipe2=no
-cat > $TMPC << EOF
-#include <unistd.h>
-#include <fcntl.h>
-
-int main(void)
-{
-    int pipefd[2];
-    return pipe2(pipefd, O_CLOEXEC);
-}
-EOF
-if compile_prog "" "" ; then
-  pipe2=yes
-fi
-
-# check if accept4 is there
-accept4=no
-cat > $TMPC << EOF
-#include <sys/socket.h>
-#include <stddef.h>
-
-int main(void)
-{
-    accept4(0, NULL, NULL, SOCK_CLOEXEC);
-    return 0;
-}
-EOF
-if compile_prog "" "" ; then
-  accept4=yes
-fi
-
-# check if tee/splice is there. vmsplice was added same time.
-splice=no
-cat > $TMPC << EOF
-#include <unistd.h>
-#include <fcntl.h>
-#include <limits.h>
-
-int main(void)
-{
-    int len, fd = 0;
-    len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
-    splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
-    return 0;
-}
-EOF
-if compile_prog "" "" ; then
-  splice=yes
-fi
-
 ##########################################
 # libnuma probe
 
@@ -4720,24 +4634,9 @@ fi
 if test "$module_upgrades" = "yes"; then
   echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
 fi
-if test "$pipe2" = "yes" ; then
-  echo "CONFIG_PIPE2=y" >> $config_host_mak
-fi
-if test "$accept4" = "yes" ; then
-  echo "CONFIG_ACCEPT4=y" >> $config_host_mak
-fi
-if test "$splice" = "yes" ; then
-  echo "CONFIG_SPLICE=y" >> $config_host_mak
-fi
 if test "$have_usbfs" = "yes" ; then
   echo "CONFIG_USBFS=y" >> $config_host_mak
 fi
-if test "$inotify" = "yes" ; then
-  echo "CONFIG_INOTIFY=y" >> $config_host_mak
-fi
-if test "$inotify1" = "yes" ; then
-  echo "CONFIG_INOTIFY1=y" >> $config_host_mak
-fi
 if test "$gio" = "yes" ; then
     echo "CONFIG_GIO=y" >> $config_host_mak
     echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
diff --git a/meson.build b/meson.build
index e168e166ad..78fa30adbb 100644
--- a/meson.build
+++ b/meson.build
@@ -1271,6 +1271,7 @@ 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_ACCEPT4', cc.has_function('accept4'))
 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'))
@@ -1304,6 +1305,10 @@ config_host_data.set('CONFIG_FIEMAP',
 config_host_data.set('CONFIG_GETRANDOM',
                      cc.has_function('getrandom') and
                      cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK'))
+config_host_data.set('CONFIG_INOTIFY',
+                     cc.has_header_symbol('sys/inotify.h', 'inotify_init'))
+config_host_data.set('CONFIG_INOTIFY1',
+                     cc.has_header_symbol('sys/inotify.h', 'inotify_init1'))
 config_host_data.set('CONFIG_MACHINE_BSWAP_H',
                      cc.has_header_symbol('machine/bswap.h', 'bswap32',
                                           prefix: '''#include <sys/endian.h>
@@ -1341,6 +1346,15 @@ config_host_data.set('CONFIG_MADVISE', cc.compiles('''
 config_host_data.set('CONFIG_MEMFD', cc.compiles(gnu_source_prefix + '''
   #include <sys/mman.h>
   int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }'''))
+config_host_data.set('CONFIG_PIPE2', cc.compiles(gnu_source_prefix + '''
+  #include <unistd.h>
+  #include <fcntl.h>
+
+  int main(void)
+  {
+      int pipefd[2];
+      return pipe2(pipefd, O_CLOEXEC);
+  }'''))
 config_host_data.set('CONFIG_POSIX_MADVISE', cc.compiles(gnu_source_prefix + '''
   #include <sys/mman.h>
   #include <stddef.h>
@@ -1350,6 +1364,18 @@ config_host_data.set('CONFIG_SIGNALFD', cc.compiles('''
   #include <sys/syscall.h>
   #include <signal.h>
   int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }'''))
+config_host_data.set('CONFIG_SPLICE', cc.compiles(gnu_source_prefix + '''
+  #include <unistd.h>
+  #include <fcntl.h>
+  #include <limits.h>
+
+  int main(void)
+  {
+    int len, fd = 0;
+    len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
+    splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
+    return 0;
+  }'''))
 config_host_data.set('CONFIG_STATIC_ASSERT', cc.compiles('''
   _Static_assert(1, "success");
   int main(void) {
-- 
2.31.1




  parent reply	other threads:[~2021-06-08 11:33 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 11:22 [PATCH 00/22] Convert more checks to Meson Paolo Bonzini
2021-06-08 11:22 ` [PATCH 01/26] meson: drop unused CONFIG_GCRYPT_HMAC Paolo Bonzini
2021-06-08 17:37   ` Richard Henderson
2021-06-15 13:53   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 02/26] configure: drop unused variables for xts Paolo Bonzini
2021-06-08 12:15   ` Philippe Mathieu-Daudé
2021-06-08 17:38   ` Richard Henderson
2021-06-15 13:55   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 03/26] configure, meson: convert crypto detection to meson Paolo Bonzini
2021-06-08 19:16   ` Richard Henderson
2021-06-15 14:01   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 04/26] configure, meson: convert libtasn1 " Paolo Bonzini
2021-06-08 19:32   ` Richard Henderson
2021-06-15 14:04   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 05/26] configure, meson: convert pam " Paolo Bonzini
2021-06-08 19:45   ` Richard Henderson
2021-06-08 19:47     ` Richard Henderson
2021-06-08 20:20     ` Daniel P. Berrangé
2021-06-09 15:46       ` Richard Henderson
2021-06-09 15:57         ` Daniel P. Berrangé
2021-06-09 16:47           ` Richard Henderson
2021-06-15 13:58             ` Paolo Bonzini
2021-06-15 14:05   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 06/26] configure, meson: convert libusb " Paolo Bonzini
2021-06-15 14:06   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 07/26] configure, meson: convert libcacard " Paolo Bonzini
2021-06-15 14:08   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 08/26] configure, meson: convert libusbredir " Paolo Bonzini
2021-06-15 14:09   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 09/26] configure, meson: convert vte " Paolo Bonzini
2021-06-15 14:24   ` Daniel P. Berrangé
2021-06-15 15:12     ` Paolo Bonzini
2021-06-08 11:22 ` [PATCH 10/26] configure, meson: convert virgl " Paolo Bonzini
2021-06-15 14:25   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 11/26] configure, meson: convert libdaxctl " Paolo Bonzini
2021-06-15 14:37   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 12/26] configure, meson: convert libpmem " Paolo Bonzini
2021-06-15 14:37   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 13/26] configure, meson: convert liburing " Paolo Bonzini
2021-06-15 14:38   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 14/26] configure, meson: convert libxml2 " Paolo Bonzini
2021-06-15 14:44   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 15/26] meson: sort header tests Paolo Bonzini
2021-06-08 12:15   ` Philippe Mathieu-Daudé
2021-06-15 14:47   ` Daniel P. Berrangé
2021-06-15 15:16     ` Paolo Bonzini
2021-06-15 15:50       ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 16/26] meson: remove preadv from summary Paolo Bonzini
2021-06-15 14:48   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 17/26] configure, meson: move CONFIG_IVSHMEM to meson Paolo Bonzini
2021-06-15 14:50   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 18/26] configure: convert HAVE_BROKEN_SIZE_MAX " Paolo Bonzini
2021-06-15 14:51   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 19/26] configure: convert compiler tests to meson, part 1 Paolo Bonzini
2021-06-15 14:59   ` Daniel P. Berrangé
2021-06-15 15:15     ` Paolo Bonzini
2021-06-08 11:22 ` [PATCH 20/26] meson: store dependency('threads') in a variable Paolo Bonzini
2021-06-15 15:02   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 21/26] configure: convert compiler tests to meson, part 2 Paolo Bonzini
2021-06-15 15:03   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 22/26] configure: convert compiler tests to meson, part 3 Paolo Bonzini
2021-06-15 15:08   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 23/26] configure: convert CONFIG_STATIC_ASSERT tests to meson Paolo Bonzini
2021-06-08 12:17   ` Philippe Mathieu-Daudé
2021-06-15 15:08   ` Daniel P. Berrangé
2021-06-08 11:22 ` [PATCH 24/26] configure: convert compiler tests to meson, part 4 Paolo Bonzini
2021-06-15 15:13   ` Daniel P. Berrangé
2021-06-08 11:23 ` Paolo Bonzini [this message]
2021-06-15 15:15   ` [PATCH 25/26] configure: convert compiler tests to meson, part 5 Daniel P. Berrangé
2021-06-08 11:23 ` [PATCH 26/26] configure: convert compiler tests to meson, part 6 Paolo Bonzini
2021-06-15 15:17   ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210608112301.402434-26-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.