[vlc-commits] configure: revamp real-time run-time library checks

Rémi Denis-Courmont git at videolan.org
Wed Dec 9 18:18:11 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec  9 19:00:25 2015 +0200| [641de51d46ad96f13cfaf6c68177a388b28a5f2e] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=641de51d46ad96f13cfaf6c68177a388b28a5f2e
---

 configure.ac    |   25 +++++++++++--------------
 src/Makefile.am |    2 +-
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2a45941..9cc640b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/src/Makefile.am b/src/Makefile.am
index 1db5d00..e0155dd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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)



More information about the vlc-commits mailing list