[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/76] configure: Add a proper check for openpty() in
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 09/76] configure: Add a proper check for openpty() in libutil |
Date: |
Tue, 5 Feb 2019 19:14:19 +0100 |
From: Thomas Huth <address@hidden>
On Linux (and maybe some BSDs), we require libutil for the openpty()
function. However, this library is not available on some other systems, so
we currently use a fragile if-statement in the configure script to check
whether we need the library or not. Unfortunately, we also hard-coded a
"-lutil" in the tests/Makefile.include file, so this breaks the build on
Solaris, for example (see buglink below). To fix the issue, add the "-lutil"
to "libs_tools" in the configure script instead, then this gets properly
propagated to the tests, too.
And while we're at it, also replace the fragile if-statement in the confi-
gure script with a proper link-check for the availability of this function.
Buglink: https://bugs.launchpad.net/qemu/+bug/1777252
Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
configure | 12 ++++++++++--
tests/Makefile.include | 4 ----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/configure b/configure
index 3d89870..f6a51e0 100755
--- a/configure
+++ b/configure
@@ -4612,9 +4612,17 @@ elif compile_prog "" "$pthread_lib -lrt" ; then
libs_qga="$libs_qga -lrt"
fi
-if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
- "$haiku" != "yes" ; then
+# Check whether we need to link libutil for openpty()
+cat > $TMPC << EOF
+extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
+int main(void) { return openpty(0, 0, 0, 0, 0); }
+EOF
+
+if ! compile_prog "" "" ; then
+ if compile_prog "" "-lutil" ; then
libs_softmmu="-lutil $libs_softmmu"
+ libs_tools="-lutil $libs_tools"
+ fi
fi
##########################################
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 75ad9c0..b39e989 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -798,10 +798,6 @@ tests/migration/initrd-stress.img:
tests/migration/stress$(EXESUF)
rm $(INITRD_WORK_DIR)/init
rmdir $(INITRD_WORK_DIR)
-ifeq ($(CONFIG_POSIX),y)
-LIBS += -lutil
-endif
-
# QTest rules
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
--
1.8.3.1
- [Qemu-devel] [PULL 06/76] tap: flush STDOUT on newline, (continued)
- [Qemu-devel] [PULL 06/76] tap: flush STDOUT on newline, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 02/76] vhost-user-test: signal data_cond when s->rings changes, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 07/76] cpu-exec: add assert_no_pages_locked() after longjmp, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 23/76] i386: remove the 'INTEL_PT' CPUID bit from named CPU models, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 10/76] cpus: ignore ESRCH in qemu_cpu_kick_thread(), Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 08/76] cpu-exec: reset BQL after longjmp in cpu_exec_step_atomic, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 03/76] vhost-user-test: support VHOST_USER_PROTOCOL_F_CROSS_ENDIAN, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 22/76] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 20/76] optionrom/pvh: load initrd from fw_cfg, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 13/76] pvh: Add x86/HVM direct boot ABI header file, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 09/76] configure: Add a proper check for openpty() in libutil,
Paolo Bonzini <=
- [Qemu-devel] [PULL 15/76] pvh: load initrd and expose it through fw_cfg, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 24/76] Revert "i386: Add CPUID bit for PCONFIG", Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 19/76] hw/i386/pc: use PVH option rom, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 26/76] contrib/elf2dmp: fix elf.h including, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 12/76] elf-ops.h: Add get_elf_note_type(), Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 21/76] hw/i386/pc: enable PVH only for machine type >= 4.0, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 27/76] contrib/elf2dmp: use GLib in ELF processing, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 29/76] contrib/elf2dmp: fix structures definitions, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 28/76] contrib/elf2dmp: use GLib in PDB processing, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 32/76] monitor: do not use QTAILQ_FOREACH_SAFE across critical sections, Paolo Bonzini, 2019/02/05