Commit 641de51d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

configure: revamp real-time run-time library checks

Avoid linking with -lrt if not needed (e.g. recent GNU/libc),
simplify, and enable linking other library than libvlccore.
parent 56fd4ad5
......@@ -743,24 +743,21 @@ AS_IF([test "${SYS}" != "mingw32"], [
])
])
VLC_RESTORE_FLAGS
])
AC_SUBST(LIBPTHREAD)
AC_CHECK_LIB(rt, clock_nanosleep, [
VLC_ADD_LIBS([libvlccore],[-lrt])
], [
AC_CHECK_FUNC(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep, [
VLC_ADD_LIBS([libvlccore],[-lrt])
], [
AC_CHECK_LIB(posix4,nanosleep, [
VLC_ADD_LIBS([libvlccore],[-lposix4])
])
])
AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
LIBRT="$ac_cv_search_clock_nanosleep"
])
], [
AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
LIBRT="$ac_cv_search_nanosleep"
])
dnl HP/UX port
AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
])
])
AC_SUBST(LIBPTHREAD)
AC_SUBST(LIBRT)
dnl
dnl Check for headers
......
......@@ -188,7 +188,7 @@ libvlccore_la_LDFLAGS = \
libvlccore_la_LIBADD = $(LIBS_libvlccore) \
../compat/libcompat.la \
$(LTLIBINTL) $(LTLIBICONV) \
$(IDN_LIBS) $(LIBPTHREAD) $(SOCKET_LIBS) $(LIBDL) $(LIBM)
$(IDN_LIBS) $(LIBPTHREAD) $(SOCKET_LIBS) $(LIBRT) $(LIBDL) $(LIBM)
libvlccore_la_DEPENDENCIES = libvlccore.sym
if HAVE_WIN32
libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment