From nobody Sat Feb 7 08:23:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580217280480669.0698434520427; Tue, 28 Jan 2020 05:14:40 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-BCqqzrNVPr6N9seFBqQH8g-1; Tue, 28 Jan 2020 08:14:37 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0FDFA800D5C; Tue, 28 Jan 2020 13:14:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 964458882D; Tue, 28 Jan 2020 13:14:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4AE3D1802228; Tue, 28 Jan 2020 13:14:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SDENUq019711 for ; Tue, 28 Jan 2020 08:14:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1B8641001DD8; Tue, 28 Jan 2020 13:14:23 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id E913F1001B08; Tue, 28 Jan 2020 13:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580217279; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1JialuvHFQq8MGWqTikxImyChWRMNCBSH0WOipra234=; b=cNZ7VSCpmY+GJ3CF+vpDcoSuZe6YxrHE4wVc6ouMDgnLoGolhau1zOaPW/OVrqPMuXl0ek FtoCTwkx/3/U6Q0RBeii1u9R5sKga3Z6YIjOLd5BqHWDdXkCtPgg9165rZGNFIU/QNiTp4 8Ofq3WxfQj05iMbM+lb9MfY0yFDyaWM= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 50/56] m4: add check for pthread library Date: Tue, 28 Jan 2020 13:11:31 +0000 Message-Id: <20200128131137.1762449-51-berrange@redhat.com> In-Reply-To: <20200128131137.1762449-1-berrange@redhat.com> References: <20200128131137.1762449-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: BCqqzrNVPr6N9seFBqQH8g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When we get rid of GNULIB, we need to check for -lpthread support. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- m4/virt-pthread.m4 | 26 ++++++++++++++------------ src/Makefile.am | 2 -- tests/Makefile.am | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/m4/virt-pthread.m4 b/m4/virt-pthread.m4 index 5b3750e8e9..0b52b40bb8 100644 --- a/m4/virt-pthread.m4 +++ b/m4/virt-pthread.m4 @@ -18,20 +18,24 @@ dnl . dnl =20 AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [ - old_LIBS=3D"$LIBS" + dnl Availability of pthread functions =20 - dnl Availability of pthread functions. Because of $LIB_PTHREAD, we - dnl cannot use AC_CHECK_FUNCS_ONCE. LIB_PTHREAD and LIBMULTITHREAD - dnl were set during gl_INIT by gnulib. - LIBS=3D"$LIBS $LIB_PTHREAD $LIBMULTITHREAD" - pthread_found=3Dyes - AC_CHECK_FUNCS([pthread_mutexattr_init]) - AC_CHECK_HEADER([pthread.h],,[pthread_found=3Dno]) + AC_SEARCH_LIBS([pthread_mutexattr_init],[pthread ""]) =20 - if test "$ac_cv_func_pthread_mutexattr_init:$pthread_found" !=3D "yes:ye= s" + if test "$ac_cv_func_pthread_mutexattr_init" =3D "no" then - AC_MSG_ERROR([A pthreads impl is required for building libvirt]) + AC_MSG_ERROR([libpthread is required for building libvirt]) fi + THREAD_LIBS=3D"" + if test "x$ac_cv_func_pthread_mutexattr_init" !=3D "x" + then + THREAD_LIBS=3D"-l$ac_cv_func_pthread_mutexattr_init" + fi + AC_SUBST([THREAD_LIBS]) + + AC_CHECK_HEADER([pthread.h],,[ + AC_MSG_ERROR([pthread.h is required for building libvirt]) + ]) =20 dnl At least mingw64-winpthreads #defines pthread_sigmask to 0, dnl which in turn causes compilation to complain about unused variables. @@ -51,6 +55,4 @@ AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [ AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1], [Define to 1 if pthread_sigmask is not a real function]) fi - - LIBS=3D"$old_LIBS" ]) diff --git a/src/Makefile.am b/src/Makefile.am index 58355c5337..87322521c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -130,8 +130,6 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am =20 =20 -THREAD_LIBS =3D $(LIB_PTHREAD) $(LTLIBMULTITHREAD) - SECDRIVER_CFLAGS =3D SECDRIVER_LIBS =3D if WITH_SECDRIVER_SELINUX diff --git a/tests/Makefile.am b/tests/Makefile.am index 19705c6b76..54b128833b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1511,7 +1511,7 @@ libshunload_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) =20 shunloadtest_SOURCES =3D \ shunloadtest.c -shunloadtest_LDADD =3D $(LIB_PTHREAD) $(DLOPEN_LIBS) +shunloadtest_LDADD =3D $(THREAD_LIBS) $(DLOPEN_LIBS) shunloadtest_DEPENDENCIES =3D libshunload.la =20 sysinfotest_SOURCES =3D \ --=20 2.24.1