]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Detect if pthread_condattr_setclock is available
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 7 Sep 2018 17:11:02 +0000 (13:11 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 8 Sep 2018 16:00:17 +0000 (12:00 -0400)
Auto-detect if pthread_condattr_setclock is available and if
it is not allow the code to compile around the issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac
lib/frr_pthread.h

index 09a6f364fb30981c971a6e33c8c32b6fc0dd7ef7..f1ffd43f5bd7537becde5ac78f9905c11ac5a81c 100755 (executable)
@@ -313,6 +313,13 @@ AX_PTHREAD([
   AC_MSG_FAILURE([This FRR version needs pthreads])
 ])
 
+AC_SEARCH_LIBS([pthread_condattr_setclock], [],
+               [frr_cv_pthread_condattr_setclock=yes],
+               [frr_cv_pthread_condattr_setclock=no])
+if test "$frr_cv_pthread_condattr_setclock" = yes; then
+  AC_DEFINE(HAVE_PTHREAD_CONDATTR_SETCLOCK, 1, [Have pthread.h pthread_condattr_setclock])
+fi
+
 dnl --------------
 dnl Check programs
 dnl --------------
index cc4fc74337b940abd82f42ad8d4b78bd8ee6326d..732e2925fef67246b6e2b9a6184b2b223ea59ea5 100644 (file)
@@ -234,4 +234,8 @@ void frr_pthread_yield(void);
  */
 uint32_t frr_pthread_get_id(void);
 
+#ifndef HAVE_PTHREAD_CONDATTR_SETCLOCK
+#define pthread_condattr_setclock(A, B)
+#endif
+
 #endif /* _FRR_PTHREAD_H */