diff --git a/configure b/configure index 9857295..16accf4 100755 --- a/configure +++ b/configure @@ -100,6 +100,7 @@ For better control, use the options below. --without-seccomp Don't use seccomp even if it is available --disable-asyncdns Disable asynchronous name resolving --disable-forcednsretry Don't retry on permanent DNS error + --without-clock-gettime Don't use clock_gettime() even if it is available --enable-ntp-signd Enable support for MS-SNTP authentication in Samba --with-ntp-era=SECONDS Specify earliest assumed NTP time in seconds since 1970-01-01 [50*365 days ago] @@ -215,6 +216,7 @@ try_setsched=0 try_lockmem=0 feat_asyncdns=1 feat_forcednsretry=1 +try_clock_gettime=1 feat_ntp_signd=0 ntp_era_split="" default_user="root" @@ -320,6 +322,9 @@ do --disable-forcednsretry) feat_forcednsretry=0 ;; + --without-clock-gettime) + try_clock_gettime=0 + ;; --enable-ntp-signd) feat_ntp_signd=1 ;; @@ -569,18 +574,18 @@ 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" + fi fi fi @@ -688,6 +693,7 @@ then fi if [ $feat_refclock = "1" ] && [ $feat_phc = "1" ] && [ $try_phc = "1" ] && \ + grep '#define HAVE_CLOCK_GETTIME' config.h > /dev/null && \ test_code '' 'sys/ioctl.h linux/ptp_clock.h' '' '' \ 'ioctl(1, PTP_CLOCK_GETCAPS, 0);' then