From nobody Mon Feb 9 22:20:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549305707305399.6575242610513; Mon, 4 Feb 2019 10:41:47 -0800 (PST) Received: from localhost ([127.0.0.1]:47334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqjBd-0000Pe-4q for importer@patchew.org; Mon, 04 Feb 2019 13:41:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqj6l-0004xF-SD for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqj6h-0003Or-Ou for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:39 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:38890) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqj6g-0003M9-23 for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:35 -0500 Received: by mail-wr1-x42d.google.com with SMTP id v13so960550wrw.5 for ; Mon, 04 Feb 2019 10:36:31 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s132sm8836236wmf.28.2019.02.04.10.36.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fl7Qxg6KjRnOTV412EmkcaXx8hM9cp1SRVdU9sE2VNk=; b=P/fMDogO/kf5vGCwaQ/2+Nzosap4TOMKxtHuH4Jtwp447amyurObd5nIdvuk9rw3oo iakvTUkjpvRPpaXr+d1vALH8ApJ9wKX+NE+kTy5DtVcPLj/38Zt8rJbKuWB4wJ3HH8c1 osxkhC6ry7/RhC7txGAEzmhHeFTDtypYE72y+ONKN0/2suTe7W2kmWFXreftWY8nf4i0 ZKcuEW2fVzziMWBStBy3O45wn6/XRW9M9n/nFM2wjO3m27N/JbTTWd/Zhy5IjS6VLhqO hB9RSFOy/6CQHD8CH9pYWBp1QznbXjTB1+wD8fqpzzbBkxvX0u9ws3QmCgB24xHa7iNB Q2iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=fl7Qxg6KjRnOTV412EmkcaXx8hM9cp1SRVdU9sE2VNk=; b=EsrfU0XF8U3eOU7KD6vjkeNTHentCncW0chq8tgTnujypYNBjTpKgxEWNc+0wnYh+p /geNxbYR96/Kdbvx9TELVc/f617VCUdnmTGlOWYO5GFfF+XW6Z4kHpKZdiDMWrFd1yCu uHH1zpJet7WYOzAv1fCQ6kLcwvaBb3l3YQM5x+beKRSJosZZ/vhsK7lUugAQPOeBA3yq XQCcTGdi62vue1xRbp8jhFHl/tky7Uf3+eyO+A5qlOhX9GLYEHvWaUFsf3oFARj2C0N8 Ia1+KF5aNjA+FY+RPQFuQ9lRLpi12TRQXVSq7S8CnTObhpMwnhYNFu0sQ7+DhlEW4pDV lBmQ== X-Gm-Message-State: AHQUAuZvcmEBbJGXhBffh7nF4cTUSdVsepYsFYFQ3Ge0kkuAvR6T0x15 NdXHZ4wsBYkxnDchRAaN2Si3ADUJ X-Google-Smtp-Source: AHgI3IbJMLZ/dM9icVydGRgQa5ePyEjgVzJFYIDC9WFGs7pq6Q1gBcLcDaFQAZ24XdYIMx8GQdn10g== X-Received: by 2002:adf:ba05:: with SMTP id o5mr517913wrg.325.1549305390528; Mon, 04 Feb 2019 10:36:30 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 19:35:12 +0100 Message-Id: <1549305379-51117-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> References: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [PULL 10/77] configure: Add a proper check for openpty() in libutil X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Thomas Huth 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- 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=3D"$libs_qga -lrt" fi =20 -if test "$darwin" !=3D "yes" -a "$mingw32" !=3D "yes" -a "$solaris" !=3D y= es -a \ - "$haiku" !=3D "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=3D"-lutil $libs_softmmu" + libs_tools=3D"-lutil $libs_tools" + fi fi =20 ########################################## 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/str= ess$(EXESUF) rm $(INITRD_WORK_DIR)/init rmdir $(INITRD_WORK_DIR) =20 -ifeq ($(CONFIG_POSIX),y) -LIBS +=3D -lutil -endif - # QTest rules =20 TARGETS=3D$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) --=20 1.8.3.1