[MPlayer-dev-eng] [PATCH] Fix for clock_gettime() detection without librt

Brad Smith brad at comstyle.com
Sat Oct 30 00:03:33 EEST 2021


Fix clock_gettime() detection on OS's that do not have librt such as OpenBSD.


Index: configure
===================================================================
--- configure	(revision 38325)
+++ configure	(working copy)
@@ -4563,8 +4563,12 @@
 echocheck "clock_gettime()"
 clock_gettime=no
 def_clock_gettime='#undef HAVE_CLOCK_GETTIME'
-statement_check_broken stddef.h time.h 'struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp)' -lrt &&
-    { clock_gettime=yes ; def_clock_gettime='#define HAVE_CLOCK_GETTIME 1' ; extra_ldflags="$extra_ldflags -lrt" ; }
+statement_check_broken stddef.h time.h 'struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp)' &&
+    { clock_gettime=yes ; def_clock_gettime='#define HAVE_CLOCK_GETTIME 1' ; }
+if test "$clock_gettime" = no ; then
+  statement_check_broken stddef.h time.h 'struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp)' -lrt &&
+      { clock_gettime=yes ; def_clock_gettime='#define HAVE_CLOCK_GETTIME 1' ; extra_ldflags="$extra_ldflags -lrt" ; }
+fi
 echores "$clock_gettime"
 
 


More information about the MPlayer-dev-eng mailing list