[vlc-commits] commit: Do not hardcode libdl (fix #3506) ( Rémi Denis-Courmont )
git at videolan.org
git at videolan.org
Sat Apr 10 12:48:55 CEST 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 10 13:48:34 2010 +0300| [6847291638d3a45992e6cb2213cbf9639d34797f] | committer: Rémi Denis-Courmont
Do not hardcode libdl (fix #3506)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6847291638d3a45992e6cb2213cbf9639d34797f
---
bin/Makefile.am | 2 +-
configure.ac | 24 ++++++++++++++++--------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 69e3773..ab03616 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -47,7 +47,7 @@ if HAVE_WIN32
vlc_LDADD += -lwininet vlc_win32_rc.$(OBJEXT)
vlc_DEPENDENCIES += vlc_win32_rc.$(OBJEXT)
else
-vlc_LDADD += -ldl
+vlc_LDADD += $(LIBDL)
endif
.rc.in.rc: $(top_builddir)/config.status
diff --git a/configure.ac b/configure.ac
index 4dcf240..5ed528e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -749,22 +749,30 @@ if test "${ac_cv_have_plugins}" = "no"; then
fi
# Only test for dlopen() if the others didn't work
+LIBDL=""
if test "${ac_cv_have_plugins}" = "no" -o "${SYS}" = "darwin"; then
AC_CHECK_HEADERS(dlfcn.h sys/dl.h)
ac_cv_my_have_dlopen=no
- AC_CHECK_FUNC(dlopen,
- ac_cv_my_have_dlopen=yes,
- AC_CHECK_LIB(dl, dlopen,
+ AC_CHECK_FUNC(dlopen, [
+ ac_cv_my_have_dlopen=yes
+ ], [
+ AC_CHECK_LIB(dl, dlopen, [
ac_cv_my_have_dlopen=yes
- VLC_ADD_LIBS([libvlccore realvideo lua],[-ldl]),
- AC_CHECK_LIB(svld, dlopen,
+ LIBDL="-ldl"
+ ], [
+ AC_CHECK_LIB(svld, dlopen, [
ac_cv_my_have_dlopen=yes
- VLC_ADD_LIBS([libvlccore],[-lsvld]))))
+ LIBDL="-lsvld"
+ ])
+ ])
+ ])
if test "${ac_cv_my_have_dlopen}" = "yes"; then
AC_DEFINE(HAVE_DL_DLOPEN, 1, [Define if you have the dlopen API])
ac_cv_have_plugins=yes
+ VLC_ADD_LIBS([libvlccore realvideo lua],[$LIBDL]),
fi
fi
+AC_SUBST(LIBDL)
if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
dnl Check for pthreads - borrowed from XMMS
@@ -2567,7 +2575,7 @@ AC_ARG_ENABLE(omxil,
if test "${enable_omxil}" = "yes"
then
VLC_ADD_PLUGIN([omxil])
- VLC_ADD_LIBS([omxil], [-ldl])
+ VLC_ADD_LIBS([omxil], [$LIBDL])
fi
dnl
@@ -3657,7 +3665,7 @@ if test "${enable_directfb}" = "yes"; then
LIBS="${LIBS_save}"
if test "${have_directfb}" = "true"; then
- LIBS_mydirectfb="${LIBS_new} -lz -ldl -ldirectfb -lfusion -ldirect -lpthread"
+ LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
fi
else
More information about the vlc-commits
mailing list