Improve the pthread_condattr_setclock() test
authorBart Van Assche <bvanassche@acm.org>
Fri, 3 Jan 2020 20:52:47 +0000 (12:52 -0800)
committerBart Van Assche <bvanassche@acm.org>
Sat, 4 Jan 2020 00:40:37 +0000 (16:40 -0800)
Link with the pthread library if pthread_condattr_setclock() is not an
inline function.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
configure

index f7f082da25994e23c8a660ff802e6ceb40b40dbe..3a675a4691ef3fc37c6b14d0a21c292131bc8692 100755 (executable)
--- a/configure
+++ b/configure
@@ -720,8 +720,11 @@ int main(void)
 EOF
 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
   pthread_condattr_setclock=yes
+elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
+  pthread_condattr_setclock=yes
+  LIBS="$LIBS -lpthread"
 fi
-print_config "pthread_condattr_setclock() support" "$pthread_condattr_setclock"
+print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
 
 ##########################################
 # solaris aio probe