From patchwork Wed Apr 1 16:15:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 6141141 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B4F3EC058F for ; Wed, 1 Apr 2015 16:12:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5BA720148 for ; Wed, 1 Apr 2015 16:12:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2F79420154 for ; Wed, 1 Apr 2015 16:12:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31B866E1DF; Wed, 1 Apr 2015 09:12:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 523936E8BD for ; Wed, 1 Apr 2015 09:12:27 -0700 (PDT) Received: by wgdm6 with SMTP id m6so58786301wgd.2 for ; Wed, 01 Apr 2015 09:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kQDnxddeFnTJW6vYeyYTAGPb3ZA2HmApzW4VcUVc3SU=; b=JFL0fOUVSrjxnujp3AQTlAvOff7tulj/tR/nC790qWk+k+6nPPO/bz0QY1Z+Nenboa g6/oZyOb7Y1phafKqwzmuMdfDHy6pDGnGqdWe2dW51rpohIjvESaLJw0lUStpdTd9EeI aLH+C/wJnletECWmokwttWJ2jvTN5hHQC5cMT4pDuvb8ASfXp+MznoMeoApREZAXSeNa 2EeOHpsKayZW4OqT6VXDzeMxDQu/toeJ1CMzM03XPkeJEHYmI08KaAxa1xvQR8RwMvJ4 D+b3WM8vpeL4OL6m6QeXzUoPEJchOcQcBVRai1TNAN7Lb0uqJnnN+Kt69jTaZeSJLWno DUZw== X-Received: by 10.180.107.198 with SMTP id he6mr16994701wib.68.1427904746360; Wed, 01 Apr 2015 09:12:26 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by mx.google.com with ESMTPSA id ge8sm3319498wjc.32.2015.04.01.09.12.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Apr 2015 09:12:25 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 01/24] configure.ac: split -fvisibility and __attribute__((visibility)) checks Date: Wed, 1 Apr 2015 17:15:12 +0100 Message-Id: <1427904935-14387-2-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1427904935-14387-1-git-send-email-emil.l.velikov@gmail.com> References: <1427904935-14387-1-git-send-email-emil.l.velikov@gmail.com> Cc: Alan Coopersmith , Thierry Reding , 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The former does not imply the latter and vice-versa. One such example is the Sun compiler. v2: Add missing closing brakets. (Alan) Cc: Alan Coopersmith Cc: Thierry Reding Signed-off-by: Emil Velikov Reviewed-by: Alan Coopersmith --- configure.ac | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 155d577..76cf91e 100644 --- a/configure.ac +++ b/configure.ac @@ -415,12 +415,17 @@ if test "x$GCC" = xyes; then # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. CFLAGS=$save_CFLAGS + AC_SUBST([VISIBILITY_CFLAGS]) +fi - if test "x$VISIBILITY_CFLAGS" != x; then - AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler has -fvisibility support]) - fi +AC_MSG_CHECKING([whether $CC supports __attribute__((visibility))]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([ + int foo_default( void ) __attribute__((visibility("default"))); + int foo_hidden( void ) __attribute__((visibility("hidden"))); +])], HAVE_ATTRIBUTE_VISIBILITY="yes"; AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])); - AC_SUBST([VISIBILITY_CFLAGS]) +if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then + AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__((visibility))]) fi AC_SUBST(WARN_CFLAGS)