summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-08 01:53:59 +0200
committerwm4 <wm4@nowhere>2013-07-08 01:53:59 +0200
commitbfe0207a7a7fed8e9fe8643fbd99d5f15abefaad (patch)
tree2947afaa046ae98d79437ae2e74379b0f21ce3c8
parentf630ee15972a6ce967658441994824322d8f5136 (diff)
downloadmpv-bfe0207a7a7fed8e9fe8643fbd99d5f15abefaad.tar.bz2
mpv-bfe0207a7a7fed8e9fe8643fbd99d5f15abefaad.tar.xz
configure: link with -lrt
In order to use clock_gettime() (which we need for use with pthread_cond_timedwait()), most glibc versions need to link with -lrt.
-rwxr-xr-xconfigure16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure b/configure
index 2c9b98e04d..9299a0c26d 100755
--- a/configure
+++ b/configure
@@ -1271,6 +1271,22 @@ else
fi
echores "$_pthreads"
+if test "$_pthreads" = yes ; then
+
+# Cargo-cult for -lrt, which is needed on not so recent glibc version for
+# clock_gettime. It's documented as required before before glibc 2.17, which
+# was released in december 2012. On newer glibc versions or on other systems,
+# this will hopefully do nothing.
+echocheck "linking with -lrt"
+_rt=no
+cc_check "-lrt" && _rt=yes
+if test "$_rt" = yes ; then
+ _ld_pthread="$_ld_pthread -lrt"
+fi
+echores "$_rt"
+
+fi
+
echocheck "stream cache"
_stream_cache="$_pthreads"
if test "$_stream_cache" = yes ; then