]> git.proxmox.com Git - mirror_qemu.git/commitdiff
util/qemu-openpty.c: Don't assume pty.h is glibc-only
authorDavid CARLIER <devnexen@gmail.com>
Mon, 13 Jul 2020 13:36:09 +0000 (14:36 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Jul 2020 13:36:09 +0000 (14:36 +0100)
Instead of using an OS-specific ifdef test to select the "openpty()
is in pty.h" codepath, make configure check for the existence of
the header and use the new CONFIG_PTY instead.

This is necessary to build on Haiku, which also provides openpty()
via pty.h.

Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20200703145614.16684-3-peter.maydell@linaro.org
[PMM: Expanded commit message; rename to HAVE_PTY_H]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
configure
util/qemu-openpty.c

index c70b43d139459e64b7ffbd547042af966a63e727..978505611b192b327c7ca8173c3e8bde550d0adf 100755 (executable)
--- a/configure
+++ b/configure
@@ -2402,6 +2402,12 @@ else
   l2tpv3=no
 fi
 
+if check_include "pty.h" ; then
+  pty_h=yes
+else
+  pty_h=no
+fi
+
 #########################################
 # vhost interdependencies and host support
 
@@ -7893,6 +7899,9 @@ fi
 if test "$sheepdog" = "yes" ; then
   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 "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
     FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
index 4b8df96f383de64015a2a19bb92643319017f0f7..eb17f5b0bcec867e372d650cdc46c865ebe14ed3 100644 (file)
@@ -35,7 +35,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-#if defined(__GLIBC__)
+#if defined HAVE_PTY_H
 # include <pty.h>
 #elif defined CONFIG_BSD
 # include <termios.h>