]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Link with -lrt for clock_gettime() if needed
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 15 Nov 2013 12:21:40 +0000 (13:21 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 15 Nov 2013 12:22:43 +0000 (13:22 +0100)
configure

index e508f597970278d44b369a45cf64ac98e6e49e94..98541f7940116376eb01747ebe8e94ea021ea00c 100755 (executable)
--- a/configure
+++ b/configure
@@ -454,7 +454,16 @@ if [ $feat_phc = "1" ] && [ $try_phc = "1" ] && \
   test_code '<linux/ptp_clock.h>' 'sys/ioctl.h linux/ptp_clock.h' '' '' \
     'ioctl(1, PTP_CLOCK_GETCAPS, 0);'
 then
+  if test_code 'clock_gettime()' 'time.h' '' '' 'clock_gettime(0, NULL);'; then
     add_def FEAT_PHC
+  else
+    if test_code 'clock_gettime() in -lrt' 'time.h' '' '-lrt' \
+      'clock_gettime(0, NULL);'
+    then
+      EXTRA_LIBS="$EXTRA_LIBS -lrt"
+      add_def FEAT_PHC
+    fi
+  fi
 fi
 
 if [ $try_setsched = "1" ] && \