configure: add option --without-clock-gettime

clock_gettime() will be ignored even if it is present
This commit is contained in:
Bryan Christianson 2016-08-23 01:03:24 +12:00 committed by Miroslav Lichvar
parent a8886603c2
commit f63e414024

16
configure vendored
View file

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