[chrony-dev] [PATCH] Add option --without-clock-gettime to disable clock_gettime even if present

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


clock_gettime() will be ignored even if it is present
---
 configure | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 9857295..d1fee97 100755
--- a/configure
+++ b/configure
@@ -85,6 +85,7 @@ For better control, use the options below.
   --readline-lib-dir=DIR Specify where readline lib directory is
   --with-ncurses-library=DIR Specify where ncurses lib directory is
   --disable-sechash      Disable support for hashes other than MD5
+  --without-clock-gettime Don't use clock_gettime even if it is available
   --without-nss          Don't use NSS even if it is available
   --without-tomcrypt     Don't use libtomcrypt even if it is available
   --disable-cmdmon       Disable command and monitoring support
@@ -194,6 +195,7 @@ feat_readline=1
 try_readline=1
 try_editline=1
 feat_sechash=1
+try_clock_gettime=1
 try_nss=1
 try_tomcrypt=1
 feat_rtc=1
@@ -338,6 +340,9 @@ do
     --disable-sechash )
       feat_sechash=0
     ;;
+    --without-clock-gettime )
+      try_clock_gettime=0
+    ;;
     --without-nss )
       try_nss=0
     ;;
@@ -569,18 +574,20 @@ then
   fi
 fi
 
-if test_code 'clock_gettime()' 'time.h' '' '' \
-  'clock_gettime(CLOCK_REALTIME, NULL);'
-then
-  add_def HAVE_CLOCK_GETTIME
-else
-  if test_code 'clock_gettime() in -lrt' 'time.h' '' '-lrt' \
+if [ $try_clock_gettime = "1" ]; then
+  if test_code 'clock_gettime()' 'time.h' '' '' \
     'clock_gettime(CLOCK_REALTIME, NULL);'
   then
     add_def HAVE_CLOCK_GETTIME
-    EXTRA_LIBS="$EXTRA_LIBS -lrt"
   else
-    try_phc=0
+    if test_code 'clock_gettime() in -lrt' 'time.h' '' '-lrt' \
+      'clock_gettime(CLOCK_REALTIME, NULL);'
+    then
+      add_def HAVE_CLOCK_GETTIME
+      EXTRA_LIBS="$EXTRA_LIBS -lrt"
+    else
+      try_phc=0
+    fi
   fi
 fi
 
-- 
2.8.4 (Apple Git-73)


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/