From patchwork Thu Nov 1 14:40:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 10664105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF8F51734 for ; Thu, 1 Nov 2018 15:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0E1A2BFAE for ; Thu, 1 Nov 2018 15:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D500C2BFBB; Thu, 1 Nov 2018 15:17:06 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D2762BFAF for ; Thu, 1 Nov 2018 15:17:03 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B9C622678CA; Thu, 1 Nov 2018 15:40:13 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2C13D2677D0; Thu, 1 Nov 2018 15:40:11 +0100 (CET) Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by alsa0.perex.cz (Postfix) with ESMTP id 3C2B92677D0 for ; Thu, 1 Nov 2018 15:40:09 +0100 (CET) Received: by mail.bootlin.com (Postfix, from userid 110) id C6DB020790; Thu, 1 Nov 2018 15:40:08 +0100 (CET) Received: from localhost (132.230.147.77.rev.sfr.net [77.147.230.132]) by mail.bootlin.com (Postfix) with ESMTPSA id 74A0020726; Thu, 1 Nov 2018 15:40:08 +0100 (CET) From: Thomas Petazzoni To: alsa-devel@alsa-project.org Date: Thu, 1 Nov 2018 15:40:07 +0100 Message-Id: <20181101144007.1507-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.14.4 MIME-Version: 1.0 Cc: =?utf-8?q?J=C3=B6rg_Krause?= , Thomas De Schampheleire , Thomas Petazzoni Subject: [alsa-devel] [PATCH alsa-lib] utils/alsa.m4: conditionally enable libdl in AM_PATH_ALSA m4 macro X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thomas De Schampheleire The AM_PATH_ALSA macro in utils/alsa.m4 unconditionally uses -ldl. This breaks compilation of alsa-utils (and probably other packages using this macro) for targets that do not support dynamic loading. This patch updates the macro to check if dlopen is available, and use that result to conditionally add -ldl to the list of libraries. Signed-off-by: Thomas De Schampheleire Signed-off-by: Jörg Krause Signed-off-by: Thomas Petazzoni --- utils/alsa.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/alsa.m4 b/utils/alsa.m4 index e12310df..a5c5a292 100644 --- a/utils/alsa.m4 +++ b/utils/alsa.m4 @@ -44,6 +44,8 @@ if test "$alsa_inc_prefix" != "" ; then fi AC_MSG_RESULT($ALSA_CFLAGS) +AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")]) + dnl add any special lib dirs AC_MSG_CHECKING(for ALSA LDFLAGS) if test "$alsa_prefix" != "" ; then @@ -52,7 +54,7 @@ if test "$alsa_prefix" != "" ; then fi dnl add the alsa library -ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread" LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS)