From 6847291638d3a45992e6cb2213cbf9639d34797f Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 10 Apr 2010 13:48:34 +0300 Subject: [PATCH] Do not hardcode libdl (fix #3506) --- 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 69e3773a65..ab03616bb8 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 4dcf24032c..5ed528e3a2 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 -- 2.39.2