From patchwork Tue Feb 6 21:19:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 10204133 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 4F6F060247 for ; Tue, 6 Feb 2018 21:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43F52205FD for ; Tue, 6 Feb 2018 21:19:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3870928657; Tue, 6 Feb 2018 21:19:10 +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.2 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED 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 0D7F4205FD for ; Tue, 6 Feb 2018 21:19:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9DBE6E501; Tue, 6 Feb 2018 21:19:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6CF646E503 for ; Tue, 6 Feb 2018 21:19:04 +0000 (UTC) Received: from localhost.localdomain ([188.110.57.104]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MWT8s-1eBhKp3ana-00XeUk; Tue, 06 Feb 2018 22:19:01 +0100 From: Peter Seiderer To: dri-devel@lists.freedesktop.org Subject: [PATCH] configure/Makefile.am: use pkg-config to discover libatomic_ops Date: Tue, 6 Feb 2018 22:19:01 +0100 Message-Id: <20180206211901.24182-1-ps.report@gmx.net> X-Mailer: git-send-email 2.16.1 X-Provags-ID: V03:K0:N/IT20RjSYf65o/TX1nXrDVnKpahku5eyNTaJQmU/eihIu3yjGd BlpUq5VgBxKMbxzv1VbUHe4/veLgpXMWS11vvowx+pgCnlF/TPtKhREz3Air1dA6Iu8n9Ok NmAoem35Ct/5oHJF8ZbBSwFjEYP91D2o292pBas5NCWb+CDVltTDfXOR6iUWEaTb/PcWAOE s/z6KfvMOm+1+ab+Zyz1Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:myOzE4prRHU=:9+kXNtIxSJK433Iei29SNF LxfBN9uzpQreSGliDzInE79CLkrIkOOoF/9L3fIwaW+/+jslzsyI35ZHIUswIKm7M9Adqi5Ao kybxBMQWlAI80pcGYPBpKOPLdJpVsQPzp8L30fImY1yKk9SYGmXxaBPBA9l9KR9LuLYUHHtee 6F1t7swD7DoFR/cuYno0r7n+h5vwGqG6XuvgEjJ81xu+D3vHxrjItbFMz/syF9nJxJVcRIYZg KtzhuVe5r4Ztcn8can/FF7z+bStYni94dQZOBLFFM01iXpPMTfWznBTdjhxjXNCrvx/T+OTeq fnwH8M4MOwEDXiznhrUwNzjREcDvaPH0AQHrJdLvZaBzTWK4VyDhROUpaaylrD3MISoqL473Y er7F8bkfB4Ci8IVGIXHychsEvoYmuiaUN0niJZXEW02BnY5hHhr4zbqziHZiII2dEjaXSK5fW vxyJKF3A916r3d694hsySX1Uza2UL15NQDnakEYw2ylg+FJJXVZbJCBsbPDQeNSJfx8WIHQT2 stO6hkb2JBHX3kRpsBZnlC1rNtOTt8pKTUNY7O2MP6sxojIbJxbc5DOO9bMc5nPaoQf0IiJjr fgsTLp0yuxipJthWffVjGh07dmthVD3WnINvz+QPyqE4WyM8FRUBnzmPhA/1JHuvLmDD+KDoe w3LSKHbY3zl0fTxQn06TRiENkv/DB4oaeA6tTa00Dap1XDS55rsEPyfUJ5mJhNz3p2F5cGhYc 4ezgzqp7cxfLzOe7vkkHzXEn68vmYN3RT8FNZNSm9eanSalBS8zLEhQvqLJx015NXiZaPajUo VOvpkVRLnvW6IGbF0cTdFr2sBeM6A== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Bernd Kuhls MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thomas Petazzoni The configure script currently tests the availability of libatomic_ops by checking the presence of atomic_ops.h. While this is good enough as an availability test, it is not sufficient as on some platforms, libatomic_ops provides an actual shared library against which we should be linked to access libatomic_ops functionality. Therefore, we instead use PKG_CHECK_MODULES() to test the availability of libatomic_ops. Besides testing its availability, this also fills in the ATOMIC_OPS_LIBS variable with the list of libraries we need to link with to use libatomic_ops. All Mesa drivers that include xf86atomic.h have been updated to link against ATOMIC_OPS_LIBS. Of course, if we're not using libatomic_ops, ATOMIC_OPS_LIBS is empty, and we don't link against it. Signed-off-by: Thomas Petazzoni Signed-off-by: Peter Seiderer [Bernd: PKG_CHECK_MODULES should not fail when libatomic_ops is missing] Signed-off-by: Bernd Kuhls --- amdgpu/Makefile.am | 2 +- configure.ac | 2 +- etnaviv/Makefile.am | 3 ++- freedreno/Makefile.am | 3 ++- intel/Makefile.am | 3 ++- nouveau/Makefile.am | 2 +- omap/Makefile.am | 2 +- radeon/Makefile.am | 2 +- tegra/Makefile.am | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/amdgpu/Makefile.am b/amdgpu/Makefile.am index a1b0d05c..b2bcceff 100644 --- a/amdgpu/Makefile.am +++ b/amdgpu/Makefile.am @@ -36,7 +36,7 @@ AM_CPPFLAGS = -DAMDGPU_ASIC_ID_TABLE=\"${libdrmdatadir}/amdgpu.ids\" libdrm_amdgpu_la_LTLIBRARIES = libdrm_amdgpu.la libdrm_amdgpu_ladir = $(libdir) libdrm_amdgpu_la_LDFLAGS = -version-number 1:0:0 -no-undefined -libdrm_amdgpu_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_amdgpu_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @ATOMIC_OPS_LIBS@ libdrm_amdgpu_la_SOURCES = $(LIBDRM_AMDGPU_FILES) amdgpu_asic_id.lo: $(top_srcdir)/data/amdgpu.ids diff --git a/configure.ac b/configure.ac index 321ab2c0..1386d15c 100644 --- a/configure.ac +++ b/configure.ac @@ -247,7 +247,7 @@ AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, [ ]],[[]])], [drm_cv_atomic_primitives="Intel"],[]) if test "x$drm_cv_atomic_primitives" = "xnone"; then - AC_CHECK_HEADER([atomic_ops.h], drm_cv_atomic_primitives="libatomic-ops") + PKG_CHECK_MODULES(ATOMIC_OPS, [atomic_ops], drm_cv_atomic_primitives="libatomic-ops", true) fi # atomic functions defined in & libc on Solaris diff --git a/etnaviv/Makefile.am b/etnaviv/Makefile.am index be96ba86..669cf14f 100644 --- a/etnaviv/Makefile.am +++ b/etnaviv/Makefile.am @@ -12,7 +12,8 @@ libdrm_etnaviv_la_LDFLAGS = -version-number 1:0:0 -no-undefined libdrm_etnaviv_la_LIBADD = \ ../libdrm.la \ @PTHREADSTUBS_LIBS@ \ - @CLOCK_LIB@ + @CLOCK_LIB@ \ + @ATOMIC_OPS_LIBS@ libdrm_etnaviv_la_SOURCES = $(LIBDRM_ETNAVIV_FILES) diff --git a/freedreno/Makefile.am b/freedreno/Makefile.am index cbb0d031..238407e3 100644 --- a/freedreno/Makefile.am +++ b/freedreno/Makefile.am @@ -14,7 +14,8 @@ libdrm_freedreno_la_LDFLAGS = -version-number 1:0:0 -no-undefined libdrm_freedreno_la_LIBADD = \ ../libdrm.la \ @PTHREADSTUBS_LIBS@ \ - @CLOCK_LIB@ + @CLOCK_LIB@ \ + @ATOMIC_OPS_LIBS@ libdrm_freedreno_la_SOURCES = $(LIBDRM_FREEDRENO_FILES) if HAVE_FREEDRENO_KGSL diff --git a/intel/Makefile.am b/intel/Makefile.am index c52e8c08..f3635a64 100644 --- a/intel/Makefile.am +++ b/intel/Makefile.am @@ -38,7 +38,8 @@ libdrm_intel_la_LDFLAGS = -version-number 1:0:0 -no-undefined libdrm_intel_la_LIBADD = ../libdrm.la \ @PTHREADSTUBS_LIBS@ \ @PCIACCESS_LIBS@ \ - @CLOCK_LIB@ + @CLOCK_LIB@ \ + @ATOMIC_OPS_LIBS@ libdrm_intel_la_SOURCES = $(LIBDRM_INTEL_FILES) diff --git a/nouveau/Makefile.am b/nouveau/Makefile.am index 344a8445..a4e6a78b 100644 --- a/nouveau/Makefile.am +++ b/nouveau/Makefile.am @@ -10,7 +10,7 @@ AM_CFLAGS = \ libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la libdrm_nouveau_ladir = $(libdir) libdrm_nouveau_la_LDFLAGS = -version-number 2:0:0 -no-undefined -libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @ATOMIC_OPS_LIBS@ libdrm_nouveau_la_SOURCES = $(LIBDRM_NOUVEAU_FILES) diff --git a/omap/Makefile.am b/omap/Makefile.am index 599bb9de..524afee3 100644 --- a/omap/Makefile.am +++ b/omap/Makefile.am @@ -7,7 +7,7 @@ AM_CFLAGS = \ libdrm_omap_la_LTLIBRARIES = libdrm_omap.la libdrm_omap_ladir = $(libdir) libdrm_omap_la_LDFLAGS = -version-number 1:0:0 -no-undefined -libdrm_omap_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_omap_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @ATOMIC_OPS_LIBS@ libdrm_omap_la_SOURCES = omap_drm.c diff --git a/radeon/Makefile.am b/radeon/Makefile.am index e2415314..c27d3c75 100644 --- a/radeon/Makefile.am +++ b/radeon/Makefile.am @@ -33,7 +33,7 @@ AM_CFLAGS = \ libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la libdrm_radeon_ladir = $(libdir) libdrm_radeon_la_LDFLAGS = -version-number 1:0:1 -no-undefined -libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @ATOMIC_OPS_LIBS@ libdrm_radeon_la_SOURCES = $(LIBDRM_RADEON_FILES) diff --git a/tegra/Makefile.am b/tegra/Makefile.am index fb40be55..12abe8c4 100644 --- a/tegra/Makefile.am +++ b/tegra/Makefile.am @@ -9,7 +9,7 @@ AM_CFLAGS = \ libdrm_tegra_ladir = $(libdir) libdrm_tegra_la_LTLIBRARIES = libdrm_tegra.la libdrm_tegra_la_LDFLAGS = -version-number 0:0:0 -no-undefined -libdrm_tegra_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ +libdrm_tegra_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @ATOMIC_OPS_LIBS@ libdrm_tegra_la_SOURCES = \ private.h \