Skip to contentSkip to conversation

configure / meson: Move check for headers to meson.build

PATCH Applied Thomas Huth 6 participants 26 messages Nov 18, 2020 – Dec 13, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover configure / meson: Move check for headers to meson.build

The checks for header files can be done much shorter and nicer in meson.build. Let's move them there.

Thomas Huth (6):
configure: Remove the obsolete check for ifaddrs.h configure / meson: Move check for pty.h to meson.build configure / meson: Move check for drm.h to meson.build configure / meson: Move check for sys/signal.h to meson.build configure / meson: Move check for sys/signal.h to meson.build configure / meson: Move check for linux/btrfs.h to meson.build

 configure                 | 58 ---------------------------------------
 linux-user/ioctls.h       |  2 +-
 linux-user/syscall.c      |  4 +--
 linux-user/syscall_defs.h |  2 +-
 meson.build               |  5 ++++
 5 files changed, 9 insertions(+), 62 deletions(-)
Signature · 1 line
2.18.4
#12 lore raw

PATCH 4/6 configure / meson: Move check for sys/signal.h to meson.build

This check can be done in a much shorter way in meson.build

---
 configure   | 10 ----------
 meson.build |  1 +
 2 files changed, 1 insertion(+), 10 deletions(-)
configure +0 -10
index b3e1052a58..871e4bb9fb 100755
@@ -3088,13 +3088,6 @@ EOF
     fi
 fi
 
-#########################################
-# sys/signal.h check
-have_sys_signal_h=no
-if check_include "sys/signal.h" ; then
-  have_sys_signal_h=yes
-fi
-
 ##########################################
 # VTE probe
 
@@ -6184,9 +6177,6 @@ fi
 if test "$have_openpty" = "yes" ; then
     echo "HAVE_OPENPTY=y" >> $config_host_mak
 fi
-if test "$have_sys_signal_h" = "yes" ; then
-    echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
-fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
meson.build +1 -0
index d6b633f17f..054e40e9a5 100644
@@ -811,6 +811,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]
 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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
+config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
 arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
Signature · 1 line
2.18.4
#1 lore raw

PATCH 1/6 configure: Remove the obsolete check for ifaddrs.h

In reply to Thomas Huth

The code that used HAVE_IFADDRS_H has been removed in commit 0a27af918b ("io: use bind() to check for IPv4/6 availability"), so we don't need this check in the configure script anymore.

---
 configure | 11 -----------
 1 file changed, 11 deletions(-)
configure +0 -11
index 714e75b5d8..6c8f56c514 100755
@@ -3094,14 +3094,6 @@ EOF
     fi
 fi
 
-##########################################
-# getifaddrs (for tests/test-io-channel-socket )
-
-have_ifaddrs_h=yes
-if ! check_include "ifaddrs.h" ; then
-  have_ifaddrs_h=no
-fi
-
 #########################################
 # libdrm check
 have_drm_h=no
@@ -6199,9 +6191,6 @@ fi
 if test "$auth_pam" = "yes" ; then
     echo "CONFIG_AUTH_PAM=y" >> $config_host_mak
 fi
-if test "$have_ifaddrs_h" = "yes" ; then
-    echo "HAVE_IFADDRS_H=y" >> $config_host_mak
-fi
 if test "$have_drm_h" = "yes" ; then
   echo "HAVE_DRM_H=y" >> $config_host_mak
 fi
Signature · 1 line
2.18.4
#8 lore raw

PATCH 3/6 configure / meson: Move check for drm.h to meson.build

In reply to Thomas Huth

This check can be done in a much shorter way in meson.build

---
 configure   | 10 ----------
 meson.build |  1 +
 2 files changed, 1 insertion(+), 10 deletions(-)
configure +0 -10
index 5a5e486373..b3e1052a58 100755
@@ -3088,13 +3088,6 @@ EOF
     fi
 fi
 
-#########################################
-# libdrm check
-have_drm_h=no
-if check_include "libdrm/drm.h" ; then
-    have_drm_h=yes
-fi
-
 #########################################
 # sys/signal.h check
 have_sys_signal_h=no
@@ -6185,9 +6178,6 @@ fi
 if test "$auth_pam" = "yes" ; then
     echo "CONFIG_AUTH_PAM=y" >> $config_host_mak
 fi
-if test "$have_drm_h" = "yes" ; then
-  echo "HAVE_DRM_H=y" >> $config_host_mak
-fi
 if test "$have_broken_size_max" = "yes" ; then
     echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
 fi
meson.build +1 -0
index 97a6445249..d6b633f17f 100644
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
 
Signature · 1 line
2.18.4
#17 lore raw

PATCH 5/6 configure / meson: Move check for sys/signal.h to meson.build

In reply to Thomas Huth

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_SYS_KCOV_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure            | 9 ---------
 linux-user/ioctls.h  | 2 +-
 linux-user/syscall.c | 2 +-
 meson.build          | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)
configure +0 -9
index 871e4bb9fb..8d40a0beb3 100755
@@ -4389,12 +4389,6 @@ if compile_prog "" "" ; then
   syncfs=yes
 fi
 
-# check for kcov support (kernel must be 4.4+, compiled with certain options)
-kcov=no
-if check_include sys/kcov.h ; then
-    kcov=yes
-fi
-
 # check for btrfs filesystem support (kernel must be 3.9+)
 btrfs=no
 if check_include linux/btrfs.h ; then
@@ -6092,9 +6086,6 @@ fi
 if test "$syncfs" = "yes" ; then
   echo "CONFIG_SYNCFS=y" >> $config_host_mak
 fi
-if test "$kcov" = "yes" ; then
-  echo "CONFIG_KCOV=y" >> $config_host_mak
-fi
 if test "$btrfs" = "yes" ; then
   echo "CONFIG_BTRFS=y" >> $config_host_mak
 fi
linux-user/ioctls.h +1 -1
index 585874f090..8efb4d38c0 100644
@@ -715,7 +715,7 @@
   IOCTL_IGNORE(TIOCSTOP)
 #endif
 
-#ifdef CONFIG_KCOV
+#ifdef HAVE_SYS_KCOV_H
   IOCTL(KCOV_ENABLE, 0, TYPE_NULL)
   IOCTL(KCOV_DISABLE, 0, TYPE_NULL)
   IOCTL(KCOV_INIT_TRACE, IOC_R, TYPE_ULONG)
linux-user/syscall.c +1 -1
index 27adee908e..063130be04 100644
@@ -73,7 +73,7 @@
 #ifdef CONFIG_SENDFILE
 #include <sys/sendfile.h>
 #endif
-#ifdef CONFIG_KCOV
+#ifdef HAVE_SYS_KCOV_H
 #include <sys/kcov.h>
 #endif
 
meson.build +1 -0
index 054e40e9a5..ab9571a354 100644
@@ -811,6 +811,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]
 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'))
 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('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
Signature · 1 line
2.18.4
#16 lore raw
In reply to Thomas Huth
Quoted 2 lines · Thomas Huth

The checks for header files can be done much shorter and nicer in meson.build. Let's move them there.

Nice, thanks. Let's route it through qemu-trivial unless Laurent complains.

Thanks,

Paolo

Quoted 15 lines

Thomas Huth (6):
configure: Remove the obsolete check for ifaddrs.h configure / meson: Move check for pty.h to meson.build configure / meson: Move check for drm.h to meson.build configure / meson: Move check for sys/signal.h to meson.build configure / meson: Move check for sys/signal.h to meson.build configure / meson: Move check for linux/btrfs.h to meson.build

  configure                 | 58 ---------------------------------------
  linux-user/ioctls.h       |  2 +-
  linux-user/syscall.c      |  4 +--
  linux-user/syscall_defs.h |  2 +-
  meson.build               |  5 ++++
  5 files changed, 9 insertions(+), 62 deletions(-)
#4 lore raw

PATCH 2/6 configure / meson: Move check for pty.h to meson.build

In reply to Thomas Huth

This check can be done in a much shorter way in meson.build

---
 configure   | 9 ---------
 meson.build | 1 +
 2 files changed, 1 insertion(+), 9 deletions(-)
configure +0 -9
index 6c8f56c514..5a5e486373 100755
@@ -2319,12 +2319,6 @@ else
   l2tpv3=no
 fi
 
-if check_include "pty.h" ; then
-  pty_h=yes
-else
-  pty_h=no
-fi
-
 cat > $TMPC <<EOF
 #include <sys/mman.h>
 int main(int argc, char *argv[]) {
@@ -6667,9 +6661,6 @@ if test "$sheepdog" = "yes" ; then
   add_to deprecated_features "sheepdog"
   echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
 fi
-if test "$pty_h" = "yes" ; then
-  echo "HAVE_PTY_H=y" >> $config_host_mak
-fi
 if test "$have_mlockall" = "yes" ; then
   echo "HAVE_MLOCKALL=y" >> $config_host_mak
 fi
meson.build +1 -0
index 7ddf983ff7..97a6445249 100644
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
Signature · 1 line
2.18.4
#22 lore raw

PATCH 6/6 configure / meson: Move check for linux/btrfs.h to meson.build

In reply to Thomas Huth

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_BTRFS_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure                 | 9 ---------
 linux-user/syscall.c      | 2 +-
 linux-user/syscall_defs.h | 2 +-
 meson.build               | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)
configure +0 -9
index 8d40a0beb3..1ba4bf9a3d 100755
@@ -4389,12 +4389,6 @@ if compile_prog "" "" ; then
   syncfs=yes
 fi
 
-# check for btrfs filesystem support (kernel must be 3.9+)
-btrfs=no
-if check_include linux/btrfs.h ; then
-    btrfs=yes
-fi
-
 # Search for bswap_32 function
 byteswap_h=no
 cat > $TMPC << EOF
@@ -6086,9 +6080,6 @@ fi
 if test "$syncfs" = "yes" ; then
   echo "CONFIG_SYNCFS=y" >> $config_host_mak
 fi
-if test "$btrfs" = "yes" ; then
-  echo "CONFIG_BTRFS=y" >> $config_host_mak
-fi
 if test "$inotify" = "yes" ; then
   echo "CONFIG_INOTIFY=y" >> $config_host_mak
 fi
linux-user/syscall.c +1 -1
index 063130be04..7bf99beb18 100644
@@ -112,7 +112,7 @@
 #include <linux/if_alg.h>
 #include <linux/rtc.h>
 #include <sound/asound.h>
-#ifdef CONFIG_BTRFS
+#ifdef HAVE_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 #ifdef HAVE_DRM_H
linux-user/syscall_defs.h +1 -1
index cabbfb762d..b934d0b606 100644
@@ -1006,7 +1006,7 @@ struct target_rtc_pll_info {
 #define TARGET_FS_IOC32_SETVERSION TARGET_IOW('v', 2, int)
 
 /* btrfs ioctls */
-#ifdef CONFIG_BTRFS
+#ifdef HAVE_BTRFS_H
 #define TARGET_BTRFS_IOC_SNAP_CREATE            TARGET_IOWU(BTRFS_IOCTL_MAGIC, 1)
 #define TARGET_BTRFS_IOC_SCAN_DEV               TARGET_IOWU(BTRFS_IOCTL_MAGIC, 4)
 #define TARGET_BTRFS_IOC_FORGET_DEV             TARGET_IOWU(BTRFS_IOCTL_MAGIC, 5)
meson.build +1 -0
index ab9571a354..bf62e260ed 100644
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
Signature · 1 line
2.18.4
#18 lore raw

Re: [PATCH 5/6] configure / meson: Move check for sys/signal.h to meson.build

In reply to Thomas Huth

On 11/18/20 11:10 AM, Thomas Huth wrote:

In the subject: s/signal/kcov/

Quoted 18 lines

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_SYS_KCOV_H to match the other HAVE_someheader_H symbols that we already have.

---

configure +1 -5
-# check for kcov support (kernel must be 4.4+, compiled with certain options)
-kcov=no
-if check_include sys/kcov.h ; then
-    kcov=yes
-fi
 
+config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h'))
 config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 6/6
#23 lore raw

Re: [PATCH 6/6] configure / meson: Move check for linux/btrfs.h to meson.build

In reply to Thomas Huth
Quoted 17 lines · Thomas Huth

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_BTRFS_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure                 | 9 ---------
 linux-user/syscall.c      | 2 +-
 linux-user/syscall_defs.h | 2 +-
 meson.build               | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)
configure +0 -0
index 8d40a0beb3..1ba4bf9a3d 100755

configure if compile_prog "" "" ; then · line 4392

Quoted 4 lines
configure +0 -1
@@ -4389,12 +4389,6 @@ if compile_prog "" "" ; then
   syncfs=yes
 fi
 
-# check for btrfs filesystem support (kernel must be 3.9+)

Assuming it is now OK to drop this comment:

Quoted 57 lines
configure +0 -8
-btrfs=no
-if check_include linux/btrfs.h ; then
-    btrfs=yes
-fi
-
 # Search for bswap_32 function
 byteswap_h=no
 cat > $TMPC << EOF
@@ -6086,9 +6080,6 @@ fi
 if test "$syncfs" = "yes" ; then
   echo "CONFIG_SYNCFS=y" >> $config_host_mak
 fi
-if test "$btrfs" = "yes" ; then
-  echo "CONFIG_BTRFS=y" >> $config_host_mak
-fi
 if test "$inotify" = "yes" ; then
   echo "CONFIG_INOTIFY=y" >> $config_host_mak
 fi
linux-user/syscall.c +1 -1
index 063130be04..7bf99beb18 100644
@@ -112,7 +112,7 @@
 #include <linux/if_alg.h>
 #include <linux/rtc.h>
 #include <sound/asound.h>
-#ifdef CONFIG_BTRFS
+#ifdef HAVE_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 #ifdef HAVE_DRM_H
linux-user/syscall_defs.h +1 -1
index cabbfb762d..b934d0b606 100644
@@ -1006,7 +1006,7 @@ struct target_rtc_pll_info {
 #define TARGET_FS_IOC32_SETVERSION TARGET_IOW('v', 2, int)
 
 /* btrfs ioctls */
-#ifdef CONFIG_BTRFS
+#ifdef HAVE_BTRFS_H
 #define TARGET_BTRFS_IOC_SNAP_CREATE            TARGET_IOWU(BTRFS_IOCTL_MAGIC, 1)
 #define TARGET_BTRFS_IOC_SCAN_DEV               TARGET_IOWU(BTRFS_IOCTL_MAGIC, 4)
 #define TARGET_BTRFS_IOC_FORGET_DEV             TARGET_IOWU(BTRFS_IOCTL_MAGIC, 5)
meson.build +1 -0
index ab9571a354..bf62e260ed 100644
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] configure: Remove the obsolete check for ifaddrs.h

In reply to Thomas Huth
Quoted 8 lines · Thomas Huth

The code that used HAVE_IFADDRS_H has been removed in commit 0a27af918b ("io: use bind() to check for IPv4/6 availability"), so we don't need this check in the configure script anymore.

---
 configure | 11 -----------
 1 file changed, 11 deletions(-)

r~

Reviewed-by on v1 5/6
#20 lore raw

Re: [PATCH 5/6] configure / meson: Move check for sys/signal.h to meson.build

In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_SYS_KCOV_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure            | 9 ---------
 linux-user/ioctls.h  | 2 +-
 linux-user/syscall.c | 2 +-
 meson.build          | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)

r~

Reviewed-by on v1 6/6
#24 lore raw

Re: [PATCH 6/6] configure / meson: Move check for linux/btrfs.h to meson.build

In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_BTRFS_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure                 | 9 ---------
 linux-user/syscall.c      | 2 +-
 linux-user/syscall_defs.h | 2 +-
 meson.build               | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)

r~

#3 lore raw

Re: [PATCH 1/6] configure: Remove the obsolete check for ifaddrs.h

In reply to Thomas Huth

Le 18/11/2020 à 18:10, Thomas Huth a écrit :

Quoted 30 lines

The code that used HAVE_IFADDRS_H has been removed in commit 0a27af918b ("io: use bind() to check for IPv4/6 availability"), so we don't need this check in the configure script anymore.

---
 configure | 11 -----------
 1 file changed, 11 deletions(-)
configure +0 -8
index 714e75b5d8..6c8f56c514 100755
@@ -3094,14 +3094,6 @@ EOF
     fi
 fi
 
-##########################################
-# getifaddrs (for tests/test-io-channel-socket )
-
-have_ifaddrs_h=yes
-if ! check_include "ifaddrs.h" ; then
-  have_ifaddrs_h=no
-fi
-
 #########################################
 # libdrm check
 have_drm_h=no

configure fi · line 6196

Quoted 9 lines
configure +0 -3
@@ -6199,9 +6191,6 @@ fi
 if test "$auth_pam" = "yes" ; then
     echo "CONFIG_AUTH_PAM=y" >> $config_host_mak
 fi
-if test "$have_ifaddrs_h" = "yes" ; then
-    echo "HAVE_IFADDRS_H=y" >> $config_host_mak
-fi
 if test "$have_drm_h" = "yes" ; then
   echo "HAVE_DRM_H=y" >> $config_host_mak
 fi

Applied to my trivial-patches branch.

Thanks,
Laurent

#7 lore raw

Re: [PATCH 2/6] configure / meson: Move check for pty.h to meson.build

In reply to Thomas Huth

Le 18/11/2020 à 18:10, Thomas Huth a écrit :

Quoted 41 lines

This check can be done in a much shorter way in meson.build

---
 configure   | 9 ---------
 meson.build | 1 +
 2 files changed, 1 insertion(+), 9 deletions(-)
configure +0 -9
index 6c8f56c514..5a5e486373 100755
@@ -2319,12 +2319,6 @@ else
   l2tpv3=no
 fi
 
-if check_include "pty.h" ; then
-  pty_h=yes
-else
-  pty_h=no
-fi
-
 cat > $TMPC <<EOF
 #include <sys/mman.h>
 int main(int argc, char *argv[]) {
@@ -6667,9 +6661,6 @@ if test "$sheepdog" = "yes" ; then
   add_to deprecated_features "sheepdog"
   echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
 fi
-if test "$pty_h" = "yes" ; then
-  echo "HAVE_PTY_H=y" >> $config_host_mak
-fi
 if test "$have_mlockall" = "yes" ; then
   echo "HAVE_MLOCKALL=y" >> $config_host_mak
 fi
meson.build +0 -0
index 7ddf983ff7..97a6445249 100644

meson.build config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0] · line 814

Quoted 7 lines
meson.build +1 -0
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target

Applied to my trivial-patches branch.

Thanks,
Laurent

#11 lore raw

Re: [PATCH 3/6] configure / meson: Move check for drm.h to meson.build

In reply to Thomas Huth

Le 18/11/2020 à 18:10, Thomas Huth a écrit :

Quoted 42 lines

This check can be done in a much shorter way in meson.build

---
 configure   | 10 ----------
 meson.build |  1 +
 2 files changed, 1 insertion(+), 10 deletions(-)
configure +0 -10
index 5a5e486373..b3e1052a58 100755
@@ -3088,13 +3088,6 @@ EOF
     fi
 fi
 
-#########################################
-# libdrm check
-have_drm_h=no
-if check_include "libdrm/drm.h" ; then
-    have_drm_h=yes
-fi
-
 #########################################
 # sys/signal.h check
 have_sys_signal_h=no
@@ -6185,9 +6178,6 @@ fi
 if test "$auth_pam" = "yes" ; then
     echo "CONFIG_AUTH_PAM=y" >> $config_host_mak
 fi
-if test "$have_drm_h" = "yes" ; then
-  echo "HAVE_DRM_H=y" >> $config_host_mak
-fi
 if test "$have_broken_size_max" = "yes" ; then
     echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
 fi
meson.build +0 -0
index 97a6445249..d6b633f17f 100644

meson.build config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0] · line 814

Quoted 7 lines
meson.build +1 -0
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
 

Applied to my trivial-patches branch.

Thanks,
Laurent

#15 lore raw

Re: [PATCH 4/6] configure / meson: Move check for sys/signal.h to meson.build

In reply to Thomas Huth

Le 18/11/2020 à 18:10, Thomas Huth a écrit :

Quoted 42 lines

This check can be done in a much shorter way in meson.build

---
 configure   | 10 ----------
 meson.build |  1 +
 2 files changed, 1 insertion(+), 10 deletions(-)
configure +0 -10
index b3e1052a58..871e4bb9fb 100755
@@ -3088,13 +3088,6 @@ EOF
     fi
 fi
 
-#########################################
-# sys/signal.h check
-have_sys_signal_h=no
-if check_include "sys/signal.h" ; then
-  have_sys_signal_h=yes
-fi
-
 ##########################################
 # VTE probe
 
@@ -6184,9 +6177,6 @@ fi
 if test "$have_openpty" = "yes" ; then
     echo "HAVE_OPENPTY=y" >> $config_host_mak
 fi
-if test "$have_sys_signal_h" = "yes" ; then
-    echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
-fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
meson.build +0 -0
index d6b633f17f..054e40e9a5 100644

meson.build config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2] · line 817

Quoted 7 lines
meson.build +1 -0
@@ -811,6 +811,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]
 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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
+config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
 arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']

Applied to my trivial-patches branch.

Thanks,
Laurent

#21 lore raw

Re: [PATCH 5/6] configure / meson: Move check for sys/signal.h to meson.build

In reply to Thomas Huth

Le 18/11/2020 à 18:10, Thomas Huth a écrit :

Quoted 71 lines

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_SYS_KCOV_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure            | 9 ---------
 linux-user/ioctls.h  | 2 +-
 linux-user/syscall.c | 2 +-
 meson.build          | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)
configure +0 -9
index 871e4bb9fb..8d40a0beb3 100755
@@ -4389,12 +4389,6 @@ if compile_prog "" "" ; then
   syncfs=yes
 fi
 
-# check for kcov support (kernel must be 4.4+, compiled with certain options)
-kcov=no
-if check_include sys/kcov.h ; then
-    kcov=yes
-fi
-
 # check for btrfs filesystem support (kernel must be 3.9+)
 btrfs=no
 if check_include linux/btrfs.h ; then
@@ -6092,9 +6086,6 @@ fi
 if test "$syncfs" = "yes" ; then
   echo "CONFIG_SYNCFS=y" >> $config_host_mak
 fi
-if test "$kcov" = "yes" ; then
-  echo "CONFIG_KCOV=y" >> $config_host_mak
-fi
 if test "$btrfs" = "yes" ; then
   echo "CONFIG_BTRFS=y" >> $config_host_mak
 fi
linux-user/ioctls.h +1 -1
index 585874f090..8efb4d38c0 100644
@@ -715,7 +715,7 @@
   IOCTL_IGNORE(TIOCSTOP)
 #endif
 
-#ifdef CONFIG_KCOV
+#ifdef HAVE_SYS_KCOV_H
   IOCTL(KCOV_ENABLE, 0, TYPE_NULL)
   IOCTL(KCOV_DISABLE, 0, TYPE_NULL)
   IOCTL(KCOV_INIT_TRACE, IOC_R, TYPE_ULONG)
linux-user/syscall.c +1 -1
index 27adee908e..063130be04 100644
@@ -73,7 +73,7 @@
 #ifdef CONFIG_SENDFILE
 #include <sys/sendfile.h>
 #endif
-#ifdef CONFIG_KCOV
+#ifdef HAVE_SYS_KCOV_H
 #include <sys/kcov.h>
 #endif
 
meson.build +0 -0
index 054e40e9a5..ab9571a354 100644

meson.build config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2] · line 817

Quoted 7 lines
meson.build +1 -0
@@ -811,6 +811,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]
 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'))
 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('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h'))
 
 ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target

Applied to my trivial-patches branch with fixed subject.

Thanks,
Laurent

#25 lore raw

Re: [PATCH 6/6] configure / meson: Move check for linux/btrfs.h to meson.build

In reply to Thomas Huth

Le 18/11/2020 à 18:10, Thomas Huth a écrit :

Quoted 71 lines

This check can be done in a much shorter way in meson.build. And while we're at it, rename the #define to HAVE_BTRFS_H to match the other HAVE_someheader_H symbols that we already have.

---
 configure                 | 9 ---------
 linux-user/syscall.c      | 2 +-
 linux-user/syscall_defs.h | 2 +-
 meson.build               | 1 +
 4 files changed, 3 insertions(+), 11 deletions(-)
configure +0 -9
index 8d40a0beb3..1ba4bf9a3d 100755
@@ -4389,12 +4389,6 @@ if compile_prog "" "" ; then
   syncfs=yes
 fi
 
-# check for btrfs filesystem support (kernel must be 3.9+)
-btrfs=no
-if check_include linux/btrfs.h ; then
-    btrfs=yes
-fi
-
 # Search for bswap_32 function
 byteswap_h=no
 cat > $TMPC << EOF
@@ -6086,9 +6080,6 @@ fi
 if test "$syncfs" = "yes" ; then
   echo "CONFIG_SYNCFS=y" >> $config_host_mak
 fi
-if test "$btrfs" = "yes" ; then
-  echo "CONFIG_BTRFS=y" >> $config_host_mak
-fi
 if test "$inotify" = "yes" ; then
   echo "CONFIG_INOTIFY=y" >> $config_host_mak
 fi
linux-user/syscall.c +1 -1
index 063130be04..7bf99beb18 100644
@@ -112,7 +112,7 @@
 #include <linux/if_alg.h>
 #include <linux/rtc.h>
 #include <sound/asound.h>
-#ifdef CONFIG_BTRFS
+#ifdef HAVE_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 #ifdef HAVE_DRM_H
linux-user/syscall_defs.h +1 -1
index cabbfb762d..b934d0b606 100644
@@ -1006,7 +1006,7 @@ struct target_rtc_pll_info {
 #define TARGET_FS_IOC32_SETVERSION TARGET_IOW('v', 2, int)
 
 /* btrfs ioctls */
-#ifdef CONFIG_BTRFS
+#ifdef HAVE_BTRFS_H
 #define TARGET_BTRFS_IOC_SNAP_CREATE            TARGET_IOWU(BTRFS_IOCTL_MAGIC, 1)
 #define TARGET_BTRFS_IOC_SCAN_DEV               TARGET_IOWU(BTRFS_IOCTL_MAGIC, 4)
 #define TARGET_BTRFS_IOC_FORGET_DEV             TARGET_IOWU(BTRFS_IOCTL_MAGIC, 5)
meson.build +0 -0
index ab9571a354..bf62e260ed 100644

meson.build config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0] · line 814

Quoted 7 lines
meson.build +1 -0
@@ -808,6 +808,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
 
+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'))
 config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))

Applied to my trivial-patches branch.

Thanks,
Laurent