summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-04 21:30:07 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-04 21:30:07 +0200
commit745fa29c0fe4860a67da698c17057d687f1b9bc7 (patch)
treec500e90f45824f411f1b62db4647afb34aac8366
parentcb70ca95251e9140aa759d76d18b5fb6e5bfeeaf (diff)
detect the need for linking to libdl.so in configure
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac5
2 files changed, 5 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index bd39e68d..a8c917c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,7 +42,7 @@ deadbeef_SOURCES =\
sdkdir = $(pkgincludedir)
sdk_HEADERS = deadbeef.h
-deadbeef_LDADD = $(LDADD) $(DEPS_LIBS) $(ICONV_LIB) -lm -ldl -lpthread
+deadbeef_LDADD = $(LDADD) $(DEPS_LIBS) $(ICONV_LIB) $(DL_LIBS) -lm -lpthread
AM_CFLAGS = $(DEPS_CFLAGS) -std=c99
AM_CPPFLAGS = $(DEPS_CFLAGS)
diff --git a/configure.ac b/configure.ac
index 575d795c..ede78b60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,9 @@ if test "x$enable_staticlink" != "xno" ; then
STATICLINK=yes
fi
+dnl check for libdl
+AC_CHECK_LIB([dl], [main], [HAVE_DL=yes;DL_LIBS="-ldl";AC_SUBST(DL_LIBS)])
+
if test "x$enable_portable" != "xno" && test "x$enable_staticlink" != "xno" ; then
AC_DEFINE_UNQUOTED([PORTABLE], [1], [Define if building portable version])
PORTABLE=yes
@@ -450,7 +453,7 @@ fi
if test "x$enable_src" != "xno" ; then
if test "x$enable_staticlink" != "xno" ; then
- LIBSAMPLERATE_DEPS_LIBS="../../$LIB/libsamplerate.a -lpthread -ldl"
+ LIBSAMPLERATE_DEPS_LIBS="../../$LIB/libsamplerate.a -lpthread ${DL_LIBS}"
AC_SUBST(LIBSAMPLERATE_DEPS_LIBS)
HAVE_DSP_SRC=yes
else