1 dnl ######################################################################
2 dnl Common m4sh code for libntp and clients
4 dnl Any configure tests which libntp or libisc code depends upon should
5 dnl be here or in another m4 macro used by the top-level and sntp
6 dnl configure.ac files, so that libntp can be moved into the sntp
7 dnl subpackage while retaining access to such test results.
9 AC_DEFUN([NTP_LIBNTP], [
11 AC_REQUIRE([NTP_CROSSCOMPILE])
13 # HMS: Save $LIBS and empty it.
14 # any LIBS we add here should go in to LDADD_LIBNTP
15 AC_SUBST([LDADD_LIBNTP])
19 dnl The contents of NTP_PROG_CC used to be here...
22 # [Bug 2332] because we need to know if we are using GNU ld...
33 ac_busted_vpath_in_make=no
35 *-*-irix6.1*) # 64 bit only
38 *-*-irix6*) # 6.2 (and later?)
39 ac_busted_vpath_in_make=yes
42 ac_busted_vpath_in_make=yes
45 ac_busted_vpath_in_make=yes
49 case "$ac_busted_vpath_in_make$srcdir" in
52 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
54 AC_MSG_ERROR([building outside of the main directory requires GNU make])
63 # XXX only verified thru AIX6. But...
64 # Ken Link says this is fine for AIX 5.3 and 7.1, and sees no reason
65 # that this support would be in 5.3, removed in 6, and added back.
67 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
68 # (returning ENOSYS). I didn't check 4.2. If, in the future,
69 # IBM pulls its thumbs out long enough to implement clock_settime,
70 # this conditional will need to change. Maybe use AC_TRY_RUN
71 # instead to try to set the time to itself and check errno.
74 HMS_SEARCH_LIBS([LDADD_LIBNTP], [clock_gettime], [rt])
75 AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
79 AC_CHECK_FUNCS([getclock stime timegm strlcpy strlcat])
83 AC_SUBST([LDADD_LIBUTIL])
84 HMS_SEARCH_LIBS([LDADD_LIBUTIL], [snprintb], [util],
85 [AC_DEFINE([USE_SNPRINTB], 1, [OK to use snprintb()?])])
87 dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
88 dnl due to an incomplete type (a union) mpinfou used in an array. gcc3
89 dnl compiles it without complaint. The mpinfou union is defined later
90 dnl in the resulting preprocessed source than the spu_info array in
91 dnl /usr/include/machine/sys/getppdp.h:
92 dnl extern union mpinfou spu_info[];
93 dnl triggering the error. Our strategy is on HP-UX only, test compile
94 dnl net/if.h. If that fails, try adding a duplicate definition of
95 dnl mpinfou, and if that helps add it to confdefs.h (used for further
96 dnl configure tests) and config.h.
98 AC_CHECK_HEADERS([errno.h sys/socket.h sys/types.h time.h])
99 AC_CHECK_HEADERS([net/if.h], [], [], [
100 #ifdef HAVE_SYS_SOCKET_H
101 # include <sys/socket.h>
107 [if net/if.h requires mpinfou predeclaration],
108 [ntp_cv_predecl_mpinfou],
110 np_cv_predecl_mpinfou=no
111 case "$ac_cv_header_net_if_h" in
116 typedef union mpinfou {
117 struct pdk_mpinfo *pdkptr;
118 struct mpinfo *pikptr;
120 #ifdef HAVE_SYS_SOCKET_H
121 # include <sys/socket.h>
129 ntp_cv_predecl_mpinfou=yes
130 ac_cv_header_net_if_h=yes
136 case "$ntp_cv_predecl_mpinfou" in
138 cat >>confdefs.h <<_ACEOF
139 #ifndef MPINFOU_PREDECLARED
140 # define MPINFOU_PREDECLARED
141 typedef union mpinfou {
142 struct pdk_mpinfo *pdkptr;
143 struct mpinfo *pikptr;
148 #ifndef MPINFOU_PREDECLARED
149 # define MPINFOU_PREDECLARED
150 typedef union mpinfou {
151 struct pdk_mpinfo *pdkptr;
152 struct mpinfo *pikptr;
161 AC_CHECK_HEADERS([linux/if_addr.h], [], [], [
162 #ifdef HAVE_SYS_SOCKET_H
163 # include <sys/socket.h>
168 AC_CHECK_HEADERS([arpa/nameser.h sys/param.h sys/time.h sys/timers.h])
169 # sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
170 AC_CHECK_HEADERS([sys/sysctl.h], [], [], [
171 #if defined HAVE_SYS_PARAM_H
172 # include <sys/param.h>
175 AC_CHECK_HEADERS([netinet/in_system.h netinet/in_systm.h netinet/in.h])
177 AC_CHECK_HEADERS([resolv.h], [], [], [
178 #ifdef HAVE_SYS_TYPES_H
179 # include <sys/types.h>
181 #ifdef HAVE_NETINET_IN_H
182 # include <netinet/in.h>
184 #ifdef HAVE_ARPA_NAMESER_H
185 # include <arpa/nameser.h>
189 AC_CHECK_HEADERS([net/if_var.h], [], [], [
191 # include <sys/types.h>
193 #ifdef HAVE_SYS_SOCKET_H
194 # include <sys/socket.h>
196 #ifdef HAVE_NETINET_IN_H
197 # include <netinet/in.h>
204 AC_CHECK_HEADERS([netinet/ip.h netinet/in_var.h], [], [], [
205 #ifdef HAVE_SYS_TYPES_H
206 # include <sys/types.h>
208 #ifdef HAVE_SYS_SOCKET_H
209 # include <sys/socket.h>
214 #ifdef HAVE_NETINET_IN_H
215 # include <netinet/in.h>
217 #ifdef HAVE_NET_IF_VAR_H
218 # include <net/if_var.h>
220 #ifdef HAVE_NETINET_IN_SYSTM_H
221 # include <netinet/in_systm.h>
225 # HMS: Do we need to check for -lsocket before or after these tests?
226 HMS_SEARCH_LIBS([LDADD_LIBNTP], [inet_pton], [nsl])
227 HMS_SEARCH_LIBS([LDADD_LIBNTP], [inet_ntop], [resolv], , , [-lnsl])
229 # [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to
230 # avoid keying on the OS name: If we find socket functions in
231 # libsocket, next try for them in libxnet without libsocket, if found,
232 # list both. If we simply tested libxnet first, we would find the
233 # functions there and never add libsocket. See also [Bug 660]
234 # http://bugs.ntp.org/show_bug.cgi?id=660#c9
236 HMS_SEARCH_LIBS([LDADD_LIBNTP], [setsockopt], [socket])
237 case "$ac_cv_search_setsockopt" in
240 HMS_SEARCH_LIBS([LDADD_LIBNTP], [getsockopt], [xnet])
241 # XXX Possible trouble here - reading the comments above and looking at the
242 # code below I wonder if we'll add -lxnet when we don't need it.
243 # Also, do we need to add -lxnet to LDADD_LIBNTP, or perhaps see if it's
244 # there when it is not needed?
245 case "$ac_cv_search_getsockopt" in
247 LIBS="-lxnet -lsocket $saved_LIBS"
249 *) LIBS="-lsocket $saved_LIBS"
254 AS_UNSET([saved_LIBS])
256 # Bug 2427 - look for recvmsg here.
257 AC_CHECK_FUNCS([recvmsg])
261 case "$ac_cv_c_inline" in
265 AC_DEFINE([HAVE_INLINE], [1], [inline keyword or macro available])
266 AC_SUBST([HAVE_INLINE])
270 AC_CHECK_SIZEOF([time_t])
271 AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
272 AC_CHECK_SIZEOF([signed char])
273 AC_CHECK_TYPES([s_char, long long])
274 AC_CHECK_SIZEOF([short])
275 AC_CHECK_SIZEOF([int])
276 AC_CHECK_SIZEOF([long])
278 case "$ac_cv_type_long_long" in
282 AC_CHECK_SIZEOF([long long])
286 case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
288 # We have a typedef for s_char. Might as well believe it...
291 # We have signed chars, can't say 'signed char', no s_char typedef.
292 AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
293 [Do we need an s_char typedef?])
296 # We have signed chars, can say 'signed char', no s_char typedef.
297 AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
298 [Do we need an s_char typedef?])
301 # We have unsigned chars, can't say 'signed char', no s_char typedef.
302 AC_MSG_ERROR([No way to specify a signed character!])
305 # We have unsigned chars, can say 'signed char', no s_char typedef.
306 AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
307 [Do we need an s_char typedef?])
313 m4_divert_text([HELP_ENABLE],
314 [AS_HELP_STRING([defaults:],
315 [+ yes, - no, s system-specific])])
319 # check if we can compile with pthreads
320 AC_CHECK_HEADERS([semaphore.h])
321 AC_CHECK_FUNCS([socketpair])
324 [AS_HELP_STRING([--enable-thread-support],
325 [s use threads (+ if available)])],
327 [enable_thread_support=yes]
330 case "$enable_thread_support" in
333 OL_THREAD_CHECK([ol_found_pthreads=yes])
334 case "$ol_found_pthreads" in
337 LIBS="$LTHREAD_LIBS $LIBS"
338 saved_CFLAGS="$CFLAGS"
339 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
340 AC_CHECK_FUNCS([sem_timedwait])
342 AS_UNSET([saved_LIBS])
343 CFLAGS="$saved_CFLAGS"
344 AS_UNSET([saved_CFLAGS])
345 case "$ac_cv_func_sem_timedwait" in
347 PTHREAD_LIBS="$LTHREAD_LIBS"
349 # Bug 2332: With GCC we need to force a reference to libgcc_s
350 # (if libgcc_s exists) or the combination of
351 # threads + setuid + mlockall does not work on linux because
352 # thread cancellation fails to load libgcc_s with dlopen().
353 # We have to pass this all as linker options to avoid argument
354 # reordering by libtool.
355 case "$GCC$with_gnu_ld" in
357 AC_CHECK_LIB([gcc_s], [exit],
358 [PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"])
364 AC_SUBST([PTHREAD_LIBS])
365 case "$have_pthreads" in
367 CFLAGS_NTP="$CFLAGS_NTP $PTHREAD_CFLAGS"
369 LIBS="$LTHREAD_LIBS $LIBS"
370 saved_CFLAGS="$CFLAGS"
371 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
376 AC_INCLUDES_DEFAULT()
380 LIBISC_PTHREADS_NOTHREADS=pthreads
381 AC_DEFINE([ISC_PLATFORM_USETHREADS], [1],
382 [enable libisc thread support?])
384 # We'd like to use sigwait() too
406 case "$host:$have_sigwait" in
414 case "$have_sigwait" in
416 ac_cv_func_sigwait=yes
417 AC_DEFINE([HAVE_SIGWAIT], [1], [sigwait() available?])
420 AC_CHECK_FUNCS([pthread_attr_getstacksize])
421 AC_CHECK_FUNCS([pthread_attr_setstacksize sysconf])
424 *-freebsd5.[[012]]|*-freebsd5.[[012]].*)
426 *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*|*-freebsd6.*)
427 AC_DEFINE([NEED_PTHREAD_SCOPE_SYSTEM], [1],
428 [use PTHREAD_SCOPE_SYSTEM?])
430 *-bsdi3.*|*-bsdi4.0*)
431 AC_DEFINE([NEED_PTHREAD_INIT], [1], [pthread_init() required?])
434 AC_DEFINE([HAVE_LINUXTHREADS], [1], [using Linux pthread?])
437 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1])
438 AC_CHECK_FUNCS([pthread_setconcurrency])
439 case "$ac_cv_func_pthread_setconcurrency" in
441 AC_DEFINE([CALL_PTHREAD_SETCONCURRENCY], [1],
445 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
446 AC_DEFINE([HAVE_UNIXWARE_SIGWAIT], [1], [deviant sigwait?])
449 hack_shutup_pthreadonceinit=no
452 hack_shutup_pthreadonceinit=yes
455 hack_shutup_pthreadonceinit=yes
459 [if extra braces are needed for PTHREAD_ONCE_INIT],
460 [ntp_cv_braces_around_pthread_once_init],
467 static pthread_once_t once_test =
471 [ntp_cv_braces_around_pthread_once_init=no],
472 [ntp_cv_braces_around_pthread_once_init=yes]
475 case "$ntp_cv_braces_around_pthread_once_init" in
477 hack_shutup_pthreadonceinit=yes
481 case "$hack_shutup_pthreadonceinit" in
483 AC_DEFINE([ISC_PLATFORM_BRACEPTHREADONCEINIT], [1],
484 [Enclose PTHREAD_ONCE_INIT in extra braces?])
487 AS_UNSET([saved_LIBS])
488 CFLAGS="$saved_CFLAGS"
489 AS_UNSET([saved_CFLAGS])
492 LIBISC_PTHREADS_NOTHREADS=nothreads
495 AC_SUBST([LIBISC_PTHREADS_NOTHREADS])
496 AM_CONDITIONAL([PTHREADS], [test "$have_pthreads" != "no"])
498 AC_DEFUN([NTP_BEFORE_HW_FUNC_VSNPRINTF], [
499 AC_BEFORE([$0], [HW_FUNC_VSNPRINTF])dnl
500 AC_BEFORE([$0], [HW_FUNC_SNPRINTF])dnl
503 [AS_HELP_STRING([--enable-c99-snprintf], [s force replacement])],
504 [force_c99_snprintf=$enableval],
505 [force_c99_snprintf=no]
507 case "$force_c99_snprintf" in
509 hw_force_rpl_snprintf=yes
510 hw_force_rpl_vsnprintf=yes
513 [snprinte],dnl sorted in config.h just before #define snprintf
515 #if !defined(_KERNEL) && !defined(PARSESTREAM)
517 * stdio.h must be included after _GNU_SOURCE is defined
518 * but before #define snprintf rpl_snprintf
524 #if !defined(_KERNEL) && !defined(PARSESTREAM)
525 # if defined(HW_WANT_RPL_VSNPRINTF)
526 # if defined(__cplusplus)
530 int rpl_vsnprintf(char *, size_t, const char *, va_list);
531 # if defined(__cplusplus)
535 # if defined(HW_WANT_RPL_SNPRINTF)
536 # if defined(__cplusplus)
539 int rpl_snprintf(char *, size_t, const char *, ...);
540 # if defined(__cplusplus)
544 #endif /* !defined(_KERNEL) && !defined(PARSESTREAM) */
546 ]) dnl end of AC_DEFUN of NTP_BEFORE_HW_FUNC_VSNPRINTF
548 AC_DEFUN([NTP_C99_SNPRINTF], [
549 AC_REQUIRE([NTP_BEFORE_HW_FUNC_VSNPRINTF])dnl
550 AC_REQUIRE([HW_FUNC_VSNPRINTF])dnl
551 AC_REQUIRE([HW_FUNC_SNPRINTF])dnl
552 ]) dnl end of DEFUN of NTP_C99_SNPRINTF
556 dnl C99-snprintf does not handle %m
557 case "$hw_use_rpl_vsnprintf:$hw_cv_func_vsnprintf" in
560 [if vsnprintf expands "%m" to strerror(errno)],
561 [ntp_cv_vsnprintf_percent_m],
588 rc = vsnprintf(dst, sz, fmt, ap);
599 strcpy(sbuf, strerror(ENOENT));
601 slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m",
603 return strcmp(sbuf, pbuf);
606 [ntp_cv_vsnprintf_percent_m=yes],
607 [ntp_cv_vsnprintf_percent_m=no],
608 [ntp_cv_vsnprintf_percent_m=no]
611 case "$ntp_cv_vsnprintf_percent_m" in
613 AC_DEFINE([VSNPRINTF_PERCENT_M], [1],
614 [vsnprintf expands "%m" to strerror(errno)])
618 AC_CHECK_HEADERS([sys/clockctl.h])
624 [s Use /dev/clockctl for non-root clock control]
626 [ntp_use_dev_clockctl=$enableval],
627 [ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h]
630 AC_MSG_CHECKING([if we should use /dev/clockctl])
631 AC_MSG_RESULT([$ntp_use_dev_clockctl])
634 AC_CHECK_HEADERS([sys/capability.h sys/prctl.h])
636 AC_MSG_CHECKING([if we have linux capabilities (libcap)])
638 case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
642 ntp_have_linuxcaps=no
644 *) ntp_have_linuxcaps=yes
649 ntp_have_linuxcaps=no
656 [--enable-linuxcaps],
657 [+ Use Linux capabilities for non-root clock control]
659 [ntp_have_linuxcaps=$enableval]
662 AC_MSG_RESULT([$ntp_have_linuxcaps])
664 case "$ntp_have_linuxcaps" in
666 AC_DEFINE([HAVE_LINUX_CAPABILITIES], [1],
667 [Do we have Linux capabilities?])
673 AC_CHECK_HEADERS([priv.h])
675 AC_MSG_CHECKING([if we have solaris privileges])
677 case "$ac_cv_header_priv_h" in
683 [ntp_have_solarisprivs=yes],
684 [ntp_have_solarisprivs=no]
693 [--enable-solarisprivs],
694 [+ Use Solaris privileges for non-root clock control]
696 [ntp_have_solarisprivs=$enableval]
700 case "$ntp_have_solarisprivs" in
702 AC_DEFINE([HAVE_SOLARIS_PRIVS], [1],
703 [Are Solaris privileges available?])
706 AC_MSG_RESULT([$ntp_have_solarisprivs])
708 case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs" in
710 AC_DEFINE([HAVE_DROPROOT], [1],
711 [Can we drop root privileges?])
716 AC_SEARCH_LIBS([res_9_init], [resolv])
718 *) AC_SEARCH_LIBS([res_init], [resolv])
722 #HMS: Why do we do this check so "early"?
723 AC_CHECK_FUNCS([res_init], , [AC_CHECK_FUNCS([__res_init])])
725 # We also need -lsocket, but we have tested for that already.
726 AC_CHECK_FUNC([inet_ntop], [],
727 [AC_DEFINE([ISC_PLATFORM_NEEDNTOP], [1], [ISC: provide inet_ntop()])])
728 AC_CHECK_FUNC([inet_pton], [],
729 [AC_DEFINE([ISC_PLATFORM_NEEDPTON], [1], [ISC: provide inet_pton()])])
731 AC_CHECK_TYPES([uintptr_t, int32, u_int32])
733 AH_VERBATIM([TYPEDEF_UINTPTR_T],
734 [/* Provide a typedef for uintptr_t? */
735 #ifndef HAVE_UINTPTR_T
736 typedef unsigned int uintptr_t;
737 #define HAVE_UINTPTR_T 1
740 case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in
743 [for int32 with DNS headers included],
744 [ntp_cv_type_int32_with_dns],
748 #ifdef HAVE_ARPA_NAMESER_H
749 # include <arpa/nameser.h>
754 size_t cb = sizeof(int32);
757 [ntp_cv_type_int32_with_dns=yes],
758 [ntp_cv_type_int32_with_dns=no]
761 case "$ntp_cv_type_int32_with_dns" in
763 AC_DEFINE([HAVE_INT32_ONLY_WITH_DNS], [1],
764 [int32 type in DNS headers, not others.])
768 case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in
771 [for u_int32 with DNS headers included],
772 [ntp_cv_type_u_int32_with_dns],
776 #ifdef HAVE_ARPA_NAMESER_H
777 # include <arpa/nameser.h>
782 size_t cb = sizeof(u_int32);
785 [ntp_cv_type_u_int32_with_dns=yes],
786 [ntp_cv_type_u_int32_with_dns=no]
789 case "$ntp_cv_type_u_int32_with_dns" in
791 AC_DEFINE([HAVE_U_INT32_ONLY_WITH_DNS], [1],
792 [u_int32 type in DNS headers, not others.])
801 #ifdef HAVE_SYS_TIME_H
802 # include <sys/time.h>
811 [for struct timespec],
812 [ntp_cv_struct_timespec],
816 #include <sys/time.h>
817 /* Under SunOS, timespec is in sys/timepps.h,
818 which needs errno.h and FRAC */
822 #ifdef HAVE_SYS_TIMEPPS_H
823 # define FRAC 4294967296
824 # include <sys/timepps.h>
831 [ntp_cv_struct_timespec=yes],
832 [ntp_cv_struct_timespec=no]
835 case "$ntp_cv_struct_timespec" in
837 AC_DEFINE([HAVE_STRUCT_TIMESPEC], [1], [struct timespec declared?])
841 [for struct ntptimeval],
842 [ntp_cv_struct_ntptimeval],
846 #include <sys/time.h>
847 #include <sys/timex.h>
853 [ntp_cv_struct_ntptimeval=yes],
854 [ntp_cv_struct_ntptimeval=no]
857 case "$ntp_cv_struct_ntptimeval" in
859 AC_DEFINE([HAVE_STRUCT_NTPTIMEVAL], [1],
860 [Do we have struct ntptimeval?])
868 #ifdef HAVE_SYS_TYPES_H
869 # include <sys/types.h>
874 AC_SEARCH_LIBS([MD5Init], [md5 md])
875 AC_CHECK_FUNCS([MD5Init sysconf getdtablesize sigaction sigset sigvec])
879 [ntp_cv_hdr_def_sigio],
888 [ntp_cv_hdr_def_sigio=yes],
889 [ntp_cv_hdr_def_sigio=no]
893 dnl Override those system that have a losing SIGIO
894 AC_MSG_CHECKING([if we want to use SIGIO])
896 case "$ntp_cv_hdr_def_sigio" in
900 alpha*-dec-osf4*|alpha*-dec-osf5*)
944 AC_DEFINE([HAVE_SIGNALED_IO], [1],
945 [Can we use SIGIO for tcp and udp IO?])
947 AC_MSG_RESULT([$ans])
951 [ntp_cv_hdr_def_sigpoll],
960 [ntp_cv_hdr_def_sigpoll=yes],
961 [ntp_cv_hdr_def_sigpoll=no]
965 AC_MSG_CHECKING([if we can use SIGPOLL for UDP I/O])
967 case "$ntp_cv_hdr_def_sigpoll" in
986 # XXX Only verified thru AIX6
1023 AC_DEFINE([USE_UDP_SIGPOLL], [1], [Can we use SIGPOLL for UDP?])
1025 AC_MSG_RESULT([$ans])
1027 AC_MSG_CHECKING([if we can use SIGPOLL for TTY I/O])
1029 case "$ntp_cv_hdr_def_sigpoll" in
1048 # XXX Only verified thru AIX6
1082 AC_DEFINE([USE_TTY_SIGPOLL], [1], [Can we use SIGPOLL for tty IO?])
1084 AC_MSG_RESULT([$ans])
1087 [number of arguments to gettimeofday()],
1088 [ntp_cv_func_Xettimeofday_nargs],
1092 #include <sys/time.h>
1099 [ntp_cv_func_Xettimeofday_nargs=2],
1100 [ntp_cv_func_Xettimeofday_nargs=1]
1103 case "$ntp_cv_func_Xettimeofday_nargs" in
1105 AC_DEFINE([SYSV_TIMEOFDAY], [1], [Does Xettimeofday take 1 arg?])
1108 AC_CHECK_FUNCS([settimeofday], ,[
1110 *-*-mpeix*) ac_cv_func_settimeofday=yes
1114 AC_MSG_CHECKING([if we'll use clock_settime or settimeofday or stime])
1117 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1120 ans='clock_settime()'
1123 ntp_warning='But clock_settime() would be better (if we had it)'
1124 ans='settimeofday()'
1127 ntp_warning='Which is the worst of the three'
1133 ntp_warning='Which leaves us with nothing to use!'
1136 AC_MSG_RESULT([$ans])
1137 case "$ntp_warning" in
1141 AC_MSG_WARN([*** $ntp_warning ***])
1146 dnl add to LDADD_LIBNTP set by ntp_compiler.m4
1147 LDADD_LIBNTP="$LDADD_LIBNTP $LIBS"
1152 dnl ======================================================================