configure: Add a proper check for openpty() in libutil
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 <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6aaa24f9d4
commit
d99e97e691
12
configure
vendored
12
configure
vendored
@ -4612,9 +4612,17 @@ elif compile_prog "" "$pthread_lib -lrt" ; then
|
|||||||
libs_qga="$libs_qga -lrt"
|
libs_qga="$libs_qga -lrt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
|
# Check whether we need to link libutil for openpty()
|
||||||
"$haiku" != "yes" ; then
|
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_softmmu="-lutil $libs_softmmu"
|
||||||
|
libs_tools="-lutil $libs_tools"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
@ -798,10 +798,6 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
|
|||||||
rm $(INITRD_WORK_DIR)/init
|
rm $(INITRD_WORK_DIR)/init
|
||||||
rmdir $(INITRD_WORK_DIR)
|
rmdir $(INITRD_WORK_DIR)
|
||||||
|
|
||||||
ifeq ($(CONFIG_POSIX),y)
|
|
||||||
LIBS += -lutil
|
|
||||||
endif
|
|
||||||
|
|
||||||
# QTest rules
|
# QTest rules
|
||||||
|
|
||||||
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
|
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
|
||||||
|
Loading…
Reference in New Issue
Block a user