From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: alsa-devel@alsa-project.org
Cc: "Jörg Krause" <joerg.krause@embedded.rocks>,
"Thomas De Schampheleire" <thomas.de.schampheleire@gmail.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: [PATCH alsa-lib] utils/alsa.m4: conditionally enable libdl in AM_PATH_ALSA m4 macro
Date: Thu, 1 Nov 2018 15:40:07 +0100 [thread overview]
Message-ID: <20181101144007.1507-1-thomas.petazzoni@bootlin.com> (raw)
From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
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 <thomas.de.schampheleire@gmail.com>
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
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)
--
2.14.4
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next reply other threads:[~2018-11-01 14:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-01 14:40 Thomas Petazzoni [this message]
2018-11-02 14:03 ` [PATCH alsa-lib] utils/alsa.m4: conditionally enable libdl in AM_PATH_ALSA m4 macro Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181101144007.1507-1-thomas.petazzoni@bootlin.com \
--to=thomas.petazzoni@bootlin.com \
--cc=alsa-devel@alsa-project.org \
--cc=joerg.krause@embedded.rocks \
--cc=thomas.de.schampheleire@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.