From patchwork Thu Mar 30 17:01:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 9654851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43545602BD for ; Thu, 30 Mar 2017 17:05:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C870285C8 for ; Thu, 30 Mar 2017 17:05:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 214A8285CF; Thu, 30 Mar 2017 17:05:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E550A285C8 for ; Thu, 30 Mar 2017 17:05:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C37126E929; Thu, 30 Mar 2017 17:05:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53CEE6E929 for ; Thu, 30 Mar 2017 17:05:35 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id w43so13840272wrb.1 for ; Thu, 30 Mar 2017 10:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/zkNphutrGp54GJixzEGgEsSghfn8UZMORxCXKBTPDc=; b=Qxp/gupjaLTX5im/tCWWOvGNhjGOfwViq+jrq7vFJwvWtJQ84i7Pta/wauq5ks2wzb vqk4NCj1tik7TkLJrL9NpWwSQuu5NcMfmNejVpR3RPKqMlg2zQhyluy2pC+m7qf+AnkG itgM325JbeNuVYDjT/W3gk2EU8gtGc899A9tTOjfUPkl/mVnZ7vBgvID5Ov+QAPiWq0W RQy+kreZZ8sdagUEeDTDIF39dgtFHv1ZUdXELlP5YpihhFViZGAPwTqRrUtb7ADcxnHp xVPwmPl9X6nIEF/op1XNL3an1D/aE2vOr0/XubdrvEabpmK4QBQ9O+caESqg4TKmVSAT fPGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/zkNphutrGp54GJixzEGgEsSghfn8UZMORxCXKBTPDc=; b=U11+5Z+O7tfBTISvIdRfd4Y9EP3L0LEzSCHyh7iCfh+yXdumfdPCXUioNwWPIWLhmY Xw4YnE1Md7pQQgm7U2sgPKZrqlq9uWH8XjJWPoJqoE40LJiDeMFrlcyso3hxX5IL98no XfAVEjXQbc7kQMeI+olsgj6nbZHun6/N7b17SYd2LCSjsjgHInTHUq2HT4O24Rs622sE It2QKYXD0m0RbH7MMF0CWEDHpGPfiP3/KPuh68HZfoU6O3pp4QqqSpJAhQ2M4ucMFx1a UagfBLFLAWHenmJskLCkuA7dFQW3dVtrxwe1+AjTDvzHQXNGOhwzeKSl4ek8Ol+NjOma mVxw== X-Gm-Message-State: AFeK/H0pTPB+3hRoQsTy1PhZ6aWWnAdXwSv7CsxFQSLRv7KWKOZ/I1PKs+l+vZUbzReW/w== X-Received: by 10.223.173.82 with SMTP id p76mr684539wrc.137.1490893533755; Thu, 30 Mar 2017 10:05:33 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk (bakora.collabora.co.uk. [46.17.161.148]) by smtp.gmail.com with ESMTPSA id y69sm2303572wmh.27.2017.03.30.10.05.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 10:05:32 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] configure.ac: bring back pthread-stubs check Date: Thu, 30 Mar 2017 18:01:12 +0100 Message-Id: <20170330170112.18519-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.11.1 Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Accidentally removed with earlier commit. Although rather than simply adding the check for all platforms, use the same heuristics as we do in mesa. Namely: pthread-stubs is a thing only for BSD platforms. Everyone else should have lightweight pthread API in their C runtime library. Fixes: 4ecd1ef010b ("xf86drm: fix null termination of string buffer") Signed-off-by: Emil Velikov Reviewed-by: Eric Engestrom --- configure.ac | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 9ac8929b..18b7e8ba 100644 --- a/configure.ac +++ b/configure.ac @@ -61,10 +61,22 @@ AC_CHECK_HEADERS([sys/sysctl.h sys/select.h]) LT_PREREQ([2.2]) LT_INIT([disable-static]) - - -AC_SUBST(PTHREADSTUBS_CFLAGS) -AC_SUBST(PTHREADSTUBS_LIBS) +dnl pthread-stubs is mandatory on BSD platforms, due to the nature of the +dnl project. Even then there's a notable issue as described in the project README +case "$host_os" in +linux* | cygwin* | darwin* | solaris* | gnu*) + pthread_stubs_possible="no" + ;; +* ) + pthread_stubs_possible="yes" + ;; +esac + +if test "x$pthread_stubs_possible" = xyes; then + PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs >= 0.4) + AC_SUBST(PTHREADSTUBS_CFLAGS) + AC_SUBST(PTHREADSTUBS_LIBS) +fi pkgconfigdir=${libdir}/pkgconfig AC_SUBST(pkgconfigdir)