2 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(ntpd/ntp_refclock.c)
5 AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target")
6 AM_CONFIG_HEADER(config.h)
8 AM_INIT_AUTOMAKE(ntp, 4.0.99b)
11 ac_cv_var_oncore_ok=no
13 dnl Grab any initial CFLAGS so we can pick better defaults.
16 dnl we need to check for cross compile tools for vxWorks here
22 CFLAGS="$CFLAGS -DSYS_CYGWIN32"
27 CFLAGS="$CFLAGS -Wc,+Abi-socket"
34 CFLAGS="$CFLAGS -std1"
45 # Quick and dirty sanity check
47 '') AC_MSG_ERROR(Please follow the directions in html/vxworks.html!)
50 CFLAGS="$CFLAGS -DSYS_VXWORKS"
56 dnl we need to check for cross compile tools for vxWorks here
64 CFLAGS="$CFLAGS -Wall"
65 # CFLAGS="$CFLAGS -Wtraditional"
66 CFLAGS="$CFLAGS -Wshadow"
67 # CFLAGS="$CFLAGS -Wwrite-strings"
68 CFLAGS="$CFLAGS -Wconversion"
69 CFLAGS="$CFLAGS -Wpointer-arith"
70 CFLAGS="$CFLAGS -Wcast-qual"
71 # CFLAGS="$CFLAGS -Wcast-align"
72 CFLAGS="$CFLAGS -Wstrict-prototypes"
74 AC_CACHE_CHECK(whether ${CC-cc} -pipe works, ac_cv_prog_cc_pipe,
75 [echo 'void f(){}' > conftest.c
76 if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`" -a -s conftest.o; then
77 ac_cv_prog_cc_pipe=yes
84 case "$ac_cv_prog_cc_pipe" in
86 CFLAGS="$CFLAGS -pipe"
92 ac_busted_vpath_in_make=no
95 *-*-irix6.1*) # 64 bit only
97 *-*-irix6*) # 6.2 (and later?)
98 ac_busted_vpath_in_make=yes
99 # don't pass -n32 to gcc, it cannot handle and doesn't need it
100 if test "$GCC" != yes; then
104 *) case "$iCFLAGS" in
105 '') CFLAGS="-O2 -g3 -n32" ;;
106 *) CFLAGS="$CFLAGS -n32" ;;
113 *) LDFLAGS="$LDFLAGS -n32" ;;
118 CFLAGS="$CFLAGS -posix" ;;
120 ac_busted_vpath_in_make=yes
122 dnl This is currently commented out by bor.
123 dnl The new versions of ReliantUNIX round adjtime() interval down
124 dnl to 1/100s (system tick). This makes tickadj actually useless.
125 dnl So, I'd better not use additional flags.
126 dnl I leave it here just in case anybody has better idea
127 dnl mips-sni-sysv4* )
129 dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
131 dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
132 dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
137 case "$ac_busted_vpath_in_make$srcdir" in
140 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
142 AC_MSG_ERROR(building outside of the main directory requires GNU make)
153 AC_PROG_GCC_TRADITIONAL
158 AC_PATH_PROG(PATH_SH, sh)
162 ac_link="$ac_link $VX_KERNEL"
170 AC_CHECK_LIB(advapi32, main)
173 AC_CHECK_LIB(elf, nlist)
174 dnl AC_CHECK_LIB(kvm, main, , , -lelf)
175 AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
176 AC_CHECK_LIB(ld, nlist)
177 AC_CHECK_LIB(mld, nlist)
178 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket))
179 AC_CHECK_FUNC(openlog, , AC_CHECK_LIB(gen, openlog))
181 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
182 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
183 dnl so only use one of them
184 AC_CHECK_LIB(rt, sched_setscheduler, ,
185 AC_CHECK_LIB(posix4, sched_setscheduler))
186 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
189 AC_CHECK_HEADERS(bstring.h errno.h fcntl.h memory.h netdb.h poll.h resolv.h)
190 AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h termios.h)
191 AC_CHECK_HEADERS(timepps.h timex.h unistd.h utmp.h utmpx.h)
192 AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in_systm.h netinet/in.h)
193 AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO)])
194 AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
195 dnl AC_CHECK_HEADERS(sys/chudefs.h)
196 AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
199 *) AC_CHECK_HEADERS(sys/ioctl.h)
202 AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
203 AC_CHECK_HEADERS(sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h)
206 AC_CHECK_HEADERS(sys/sio.h)
209 AC_CHECK_HEADERS(sys/select.h sys/sockio.h sys/stat.h sys/stream.h)
210 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/termios.h)
211 AC_CHECK_HEADERS(sys/time.h)
213 [#include <sys/timepps.h>
214 #ifdef PPS_API_VERS_1
217 ], AC_CHECK_HEADERS(sys/timepps.h))
218 AC_CHECK_HEADERS(sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h)
222 AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
225 AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
229 AC_CHECK_HEADER(nlist.h,
230 [AC_DEFINE(NLIST_STRUCT)
231 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
232 [AC_TRY_COMPILE([#include <nlist.h>],
233 [struct nlist n; n.n_un.n_name = 0;],
234 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
235 if test $ac_cv_struct_nlist_n_un = yes; then
236 AC_DEFINE(NLIST_NAME_UNION)
240 AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
243 ac_cv_c_volatile=yes,
246 case "$ac_cv_c_volatile" in
249 *) AC_DEFINE(volatile,)
255 # Assume that solaris2 is Ansi C...
261 AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
263 extern int foo (short);
264 int foo(short i) { return i; }],[
265 int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
267 if test "$ac_cv_have_prototypes" = yes; then
268 AC_DEFINE(HAVE_PROTOTYPES)
281 AC_DEFINE(WORDS_BIGENDIAN)
283 *) AC_MSG_ERROR(Cross-compiling needs explicit byte order)
291 AC_CHECK_TYPE(time_t, long)
294 AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
295 [ac_cv_var_default_hz=100
297 alpha*-dec-osf4*|alpha*-dec-osf5*)
298 ac_cv_var_default_hz=1024
301 ac_cv_var_default_hz=256
304 AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz)
306 AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
307 [ac_cv_var_override_hz=no
309 alpha*-dec-osf4*|alpha*-dec-osf5*)
310 ac_cv_var_override_hz=yes
313 ac_cv_var_override_hz=yes
316 ac_cv_var_override_hz=yes
319 ac_cv_var_override_hz=yes
322 case "$ac_cv_var_override_hz" in
324 AC_DEFINE(OVERRIDE_HZ)
328 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
329 dnl [AC_TRY_LINK([#include <sys/types.h>
330 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
331 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
332 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
333 dnl AC_DEFINE(HAVE_UT_HOST)
336 dnl AC_MSG_CHECKING(if we can get the system boot time)
337 dnl AC_CACHE_VAL(su_cv_have_boot_time,
338 dnl [AC_EGREP_CPP(yes,
339 dnl [#ifdef HAVE_UTMPX_H
340 dnl #include <utmpx.h>
342 dnl #include <utmp.h>
347 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
348 dnl AC_MSG_RESULT($su_cv_have_boot_time)
351 struct sigaction for sa_sigaction,
352 ac_cv_struct_sigaction_has_sa_sigaction,
355 [#include <signal.h>],
356 [struct sigaction act; act.sa_sigaction = 0;],
357 ac_cv_struct_sigaction_has_sa_sigaction=yes,
358 ac_cv_struct_sigaction_has_sa_sigaction=no
362 if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
363 AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION)
366 AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
368 #include <sys/types.h>
369 #ifdef HAVE_SYS_TERMIOS_H
370 # include <sys/termios.h>
372 #ifdef HAVE_SYS_TIME_H
373 # include <sys/time.h>
375 #ifdef HAVE_SYS_PPSCLOCK_H
376 # include <sys/ppsclock.h>
378 extern struct ppsclockev *pce;
379 return pce->serial;],
380 ac_cv_struct_ppsclockev=yes,
381 ac_cv_struct_ppsclockev=no)
383 if test $ac_cv_struct_ppsclockev = yes; then
384 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV)
387 AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
389 #include <sys/types.h>
390 #include <sys/socket.h>],[
391 extern struct sockaddr *ps;
393 ac_cv_struct_sockaddr_has_sa_len=yes,
394 ac_cv_struct_sockaddr_has_sa_len=no)
396 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
397 AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR)
400 AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
402 #include <sys/time.h>],[
403 extern struct clockinfo *pc;
405 ac_cv_struct_clockinfo_has_hz=yes,
406 ac_cv_struct_clockinfo_has_hz=no)
408 if test $ac_cv_struct_clockinfo_has_hz = yes; then
409 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO)
412 AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
414 #include <sys/time.h>],[
415 extern struct clockinfo *pc;
416 return pc->tickadj;],
417 ac_cv_struct_clockinfo_has_tickadj=yes,
418 ac_cv_struct_clockinfo_has_tickadj=no)
420 if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
421 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO)
424 AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
426 #include <sys/time.h>
427 #include <sys/timex.h>],
428 [struct ntptimeval n;],
429 ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
430 if test $ac_cv_struct_ntptimeval = yes; then
431 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
434 AC_CACHE_CHECK(struct ntptimeval for time.tv_nsec, ac_cv_struct_ntptimeval_tv_nsec,
436 #ifdef HAVE_SYS_TIME_H
437 #include <sys/time.h>
443 #ifdef HAVE_SYS_TIMEX_H
444 #include <sys/timex.h>
450 extern struct ntptimeval *ntv;
451 return ntv->time.tv_nsec;],
452 ac_cv_struct_ntptimeval_tv_nsec=yes,
453 ac_cv_struct_ntptimeval_tv_nsec=no)
455 if test "$ac_cv_struct_ntptimeval_tv_nsec" = "yes"; then
456 AC_DEFINE(HAVE_TV_NSEC_IN_NTPTIMEVAL)
459 AC_CACHE_CHECK([for struct timespec in struct ntptimeval], ac_cv_struct_ntptimeval_timespec,
460 [AC_TRY_COMPILE([#include <sys/time.h>
461 #include <sys/timex.h>],
462 [struct ntptimeval n; n.time.tv_nsec = 0;],
463 ac_cv_struct_ntptimeval_timespec=yes, ac_cv_struct_ntptimeval_timespec=no)])
464 if test $ac_cv_struct_ntptimeval_timespec = yes; then
465 AC_DEFINE(TIMESPEC_IN_NTPTIMEVAL, 1, [Does ntptimeval use struct timespec?])
469 AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
472 AC_CHECK_SIZEOF(signed char)
476 AC_CHECK_SIZEOF(signed char, 1)
478 *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_SIGNED_LONG)
490 AC_CHECK_SIZEOF(int, 4)
492 *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_INT)
500 AC_CHECK_SIZEOF(long)
504 AC_CHECK_SIZEOF(long, 4)
506 *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_LONG)
512 AC_CHECK_TYPE(s_char, signed char)
513 case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
515 # We have a typedef for s_char. Might as well believe it...
518 # We have signed chars, can't say 'signed char', no s_char typedef.
519 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
522 # We have signed chars, can say 'signed char', no s_char typedef.
523 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
526 # We have unsigned chars, can't say 'signed char', no s_char typedef.
527 AC_MSG_ERROR(No way to specify a signed character!)
530 # We have unsigned chars, can say 'signed char', no s_char typedef.
531 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
538 AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
543 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
544 # (returning ENOSYS). I didn't check 4.2. If, in the future,
545 # IBM pulls its thumbs out long enough to implement clock_settime,
546 # this conditional will need to change. Maybe use AC_TRY_RUN
547 # instead to try to set the time to itself and check errno.
549 *) AC_CHECK_FUNCS(clock_settime)
552 AC_CHECK_FUNCS(daemon getbootfile getdtablesize getrusage)
553 AC_CHECK_FUNCS(gettimeofday)
557 *) AC_CHECK_FUNCS(getuid)
560 AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
563 # Just stubs. Idiots.
565 *) AC_CHECK_FUNCS(mkstemp)
568 AC_REPLACE_FUNCS(mktime)
571 # Just a stub. Idiots.
574 # Just stubs in Irix. Idiots.
577 # Just stubs. Idiots.
579 alpha*-dec-osf4*|alpha*-dec-osf5*)
580 # mlockall is there, as a #define calling memlk via <sys/mman.h>
581 # Not easy to test for - cheat.
582 AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
583 AC_CHECK_FUNCS(mlockall)
585 *) AC_CHECK_FUNCS(mlockall)
588 AC_CHECK_FUNCS(nice nlist)
593 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
596 AC_CHECK_FUNCS(plock pututline pututxline rtprio)
597 AC_CHECK_FUNCS(random srandom mrand48 srand48)
600 # Just a stub in AIX 4. Idiots.
603 # Just stubs in solaris2.5. Idiots.
605 *) AC_CHECK_FUNCS(sched_setscheduler)
608 AC_CHECK_FUNCS(setlinebuf)
609 AC_CHECK_FUNCS(setpgid setpriority setsid settimeofday setvbuf sigaction)
610 AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
611 AC_REPLACE_FUNCS(strerror)
614 # Just stubs. Idiots.
617 # Just stubs. Idiots.
620 # Just stubs. Idiots.
622 *) AC_CHECK_FUNCS(timer_create timer_settime)
629 *) AC_CHECK_FUNCS(umask)
632 AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
634 AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
635 [AC_TRY_COMPILE([#include <sys/time.h>],[
636 gettimeofday((struct timeval*)0,(struct timezone*)0);
637 settimeofday((struct timeval*)0,(struct timezone*)0);
639 ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
641 if test $ac_cv_func_Xettimeofday_nargs = 1; then
642 AC_DEFINE(SYSV_TIMEOFDAY)
645 AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
647 #ifdef HAVE_SYS_TYPES_H
648 # include <sys/types.h>
654 ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
656 if test $ac_cv_func_setpgrp_nargs = 0; then
657 AC_DEFINE(HAVE_SETPGRP_0)
661 CFLAGS="$CFLAGS -I$srcdir/include"
663 AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
664 ac_cv_func_qsort_argtype,
666 #include "l_stdlib.h"
668 #ifdef HAVE_PROTOTYPES
675 extern sortfunc P((const void *, const void *));
678 const void *b; { return 0; }
680 qsort(base, 2, sizeof(char *), sortfunc);
682 ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
684 case "$ac_cv_func_qsort_argtype" in
686 AC_DEFINE(QSORT_USES_VOID_P)
692 AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
693 [AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
697 ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
698 case "$ac_cv_decl_errno" in
699 yes) AC_DEFINE(DECL_ERRNO) ;;
702 dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
703 dnl the clash. <resolv.h> isn't currently used.
705 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
706 dnl MT purposes. This makes the line "extern int h_errno" choke
707 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
708 dnl without breaking any other platforms.
710 AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
711 [AC_TRY_COMPILE([#include <sys/types.h>
712 #ifdef HAVE_NETINET_IN_H
713 #include <netinet/in.h>
715 #ifdef HAVE_ARPA_NAMESER_H
716 #include <arpa/nameser.h>
724 [extern int h_errno;],
725 ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
726 case "$ac_cv_decl_h_errno" in
727 yes) AC_DEFINE(DECL_H_ERRNO) ;;
730 dnl See if char *sys_errlist[] is OK.
731 dnl If you get the quoting right on the next line, you tried something I didn't.
732 AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
733 [AC_TRY_COMPILE([#include <stdio.h>
737 changequote(<<, >>)dnl
738 <<extern char *sys_errlist[];>>
740 ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
741 case "$ac_cv_decl_sys_errlist" in
742 yes) AC_DEFINE(CHAR_SYS_ERRLIST) ;;
745 AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
747 #ifdef HAVE_SYS_TYPES_H
748 # include <sys/types.h>
753 #ifdef HAVE_PROTOTYPES
759 [extern int syscall P((int, ...));],
760 ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
761 case "$ac_cv_decl_syscall" in
762 yes) AC_DEFINE(DECL_SYSCALL) ;;
766 changequote(<<, >>)dnl
769 AC_DEFINE(DECL_PLOCK_0)
770 AC_DEFINE(DECL_STIME_1)
773 AC_DEFINE(DECL_ADJTIME_0)
774 AC_DEFINE(DECL_BZERO_0)
775 AC_DEFINE(DECL_IOCTL_0)
776 AC_DEFINE(DECL_IPC_0)
777 AC_DEFINE(DECL_MEMMOVE_0)
778 AC_DEFINE(DECL_MKTEMP_0)
779 AC_DEFINE(DECL_RENAME_0)
780 AC_DEFINE(DECL_SELECT_0)
781 AC_DEFINE(DECL_SETITIMER_0)
782 AC_DEFINE(DECL_SETPRIORITY_0)
783 AC_DEFINE(DECL_STDIO_0)
784 AC_DEFINE(DECL_STRTOL_0)
785 AC_DEFINE(DECL_SYSLOG_0)
786 AC_DEFINE(DECL_TIME_0)
787 AC_DEFINE(DECL_TIMEOFDAY_0)
788 AC_DEFINE(DECL_TOLOWER_0)
791 AC_DEFINE(DECL_MKSTEMP_0)
792 AC_DEFINE(DECL_SETPRIORITY_1)
795 AC_DEFINE(DECL_TIMEOFDAY_0)
800 AC_DEFINE(DECL_ADJTIME_0)
801 AC_DEFINE(DECL_BCOPY_0)
802 AC_DEFINE(DECL_BZERO_0)
803 AC_DEFINE(DECL_IOCTL_0)
804 AC_DEFINE(DECL_IPC_0)
805 AC_DEFINE(DECL_MEMMOVE_0)
806 AC_DEFINE(DECL_MKTEMP_0)
807 AC_DEFINE(DECL_MKSTEMP_0)
808 AC_DEFINE(DECL_MRAND48_0)
809 AC_DEFINE(DECL_RENAME_0)
810 AC_DEFINE(DECL_SELECT_0)
811 AC_DEFINE(DECL_SETITIMER_0)
812 AC_DEFINE(DECL_SETPRIORITY_0)
813 AC_DEFINE(DECL_SIGVEC_0)
814 AC_DEFINE(DECL_SRAND48_0)
815 case "`basename $ac_cv_prog_CC`" in
817 *) AC_DEFINE(DECL_STDIO_0)
820 AC_DEFINE(DECL_STRTOL_0)
821 AC_DEFINE(DECL_SYSLOG_0)
822 AC_DEFINE(DECL_TIME_0)
823 AC_DEFINE(DECL_TIMEOFDAY_0)
824 AC_DEFINE(DECL_TOLOWER_0)
825 AC_DEFINE(DECL_TOUPPER_0)
828 AC_DEFINE(DECL_ADJTIME_0)
829 AC_DEFINE(DECL_BZERO_0)
830 AC_DEFINE(DECL_CFSETISPEED_0)
831 AC_DEFINE(DECL_IOCTL_0)
832 AC_DEFINE(DECL_IPC_0)
833 AC_DEFINE(DECL_MKTEMP_0)
834 AC_DEFINE(DECL_MRAND48_0)
835 AC_DEFINE(DECL_NLIST_0)
836 AC_DEFINE(DECL_PLOCK_0)
837 AC_DEFINE(DECL_SELECT_0)
838 AC_DEFINE(DECL_SETITIMER_0)
839 AC_DEFINE(DECL_SETPRIORITY_0)
840 AC_DEFINE(DECL_SRAND48_0)
841 AC_DEFINE(DECL_STIME_0)
842 AC_DEFINE(DECL_SYSLOG_0)
843 AC_DEFINE(DECL_TIMEOFDAY_0)
849 AC_DEFINE(TERMIOS_NEEDS__SVID3)
853 AC_CACHE_CHECK(if we should use a streams device for ifconfig,
854 ac_cv_var_use_streams_device_for_ifconfig,
855 ac_cv_var_use_streams_device_for_ifconfig=no)
857 AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
859 changequote(<<, >>)dnl
866 ac_cv_var_rcvbuf_slop=$ans])
867 case "$ac_cv_var_rcvbuf_slop" in
868 yes) AC_DEFINE(NEED_RCVBUF_SLOP) ;;
871 AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
881 ac_cv_var_open_bcast_socket=$ans])
882 case "$ac_cv_var_open_bcast_socket" in
883 yes) AC_DEFINE(OPEN_BCAST_SOCKET) ;;
886 AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
893 ac_cv_var_hpux_findconfig=$ans])
894 case "$ac_cv_var_hpux_findconfig" in
895 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG) ;;
898 AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
899 [changequote(<<, >>)dnl
921 ac_cv_arg_setpgrp_negpid=$ans])
922 case "$ac_cv_arg_setpgrp_negpid" in
923 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN) ;;
926 AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
943 ac_cv_func_ctty_for_f_setown=$ans])
944 case "$ac_cv_func_ctty_for_f_setown" in
945 yes) AC_DEFINE(USE_FSETOWNCTTY) ;;
949 AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
950 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
953 ans='clock_settime()'
956 ntp_warning='But clock_settime() would be better (if we had it)'
960 ntp_warning='Which is the worst of the three'
965 $target) ntp_warning='Which leaves us with nothing to use!'
971 case "$ntp_warning" in
973 *) AC_MSG_WARN(*** $ntp_warning ***)
977 AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
985 ac_cv_var_syscall_bug=$ans])
986 case "$ac_cv_var_syscall_bug" in
987 yes) AC_DEFINE(SYSCALL_BUG) ;;
990 AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
991 [ case "$ac_cv_header_sys_stropts_h" in
994 # There must be a better way...
1002 ac_cv_var_streams_tli=$ans])
1003 case "$ac_cv_var_streams_tli" in
1005 AC_DEFINE(STREAMS_TLI)
1009 AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1011 [#include <signal.h>
1015 ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1017 dnl Override those system that have a losing SIGIO
1018 AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1020 case "$ac_cv_hdr_def_sigio" in
1024 alpha*-dec-osf4*|alpha*-dec-osf5*)
1054 ac_cv_var_signalled_io=$ans])
1055 case "$ac_cv_var_signalled_io" in
1056 yes) AC_DEFINE(HAVE_SIGNALED_IO) ;;
1059 AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1061 [#include <signal.h>
1065 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1067 AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1069 [#include <signal.h>
1073 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1075 AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1077 case "$ac_cv_hdr_def_sigpoll" in
1079 changequote(<<, >>)dnl
1114 changequote([, ])dnl
1117 ac_cv_var_use_udp_sigpoll=$ans])
1118 case "$ac_cv_var_use_udp_sigpoll" in
1119 yes) AC_DEFINE(USE_UDP_SIGPOLL) ;;
1122 AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1124 case "$ac_cv_hdr_def_sigpoll" in
1162 ac_cv_var_use_tty_sigpoll=$ans])
1163 case "$ac_cv_var_use_tty_sigpoll" in
1164 yes) AC_DEFINE(USE_TTY_SIGPOLL) ;;
1167 case "$ac_cv_header_sys_sio_h" in
1169 AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1171 [#include <sys/sio.h>
1172 #ifdef TIOCDCDTIMESTAMP
1175 ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1179 case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1181 ac_cv_var_oncore_ok=yes
1185 AC_CACHE_CHECK(if nlist() values might require extra indirection,
1186 ac_cv_var_nlist_extra_indirection,
1193 ac_cv_var_nlist_extra_indirection=$ans])
1194 case "$ac_cv_var_nlist_extra_indirection" in
1195 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION) ;;
1198 AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1199 ac_cv_var_min_rec_tickadj,
1206 ac_cv_var_min_rec_tickadj=$ans])
1207 case "$ac_cv_var_min_rec_tickadj" in
1209 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj) ;;
1212 AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1213 ac_cv_var_no_parenb_ignpar,
1223 ac_cv_var_no_parenb_ignpar=$ans])
1224 case "$ac_cv_var_no_parenb_ignpar" in
1225 yes) AC_DEFINE(NO_PARENB_IGNPAR) ;;
1228 AC_MSG_CHECKING(if we're including debugging code)
1229 AC_ARG_ENABLE(debugging, [ --enable-debugging + include debugging code],
1230 [ntp_ok=$enableval], [ntp_ok=yes])
1231 if test "$ntp_ok" = "yes"; then
1234 AC_MSG_RESULT($ntp_ok)
1236 AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1237 AC_ARG_ENABLE(dst_minutes, [ --enable-dst-minutes=60 + minutes per DST adjustment],
1238 [ans=$enableval], [ans=60])
1239 AC_DEFINE_UNQUOTED(DSTMINUTES, $ans)
1242 AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1244 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1245 *yes*) ac_cv_var_tty_clk=yes ;;
1247 case "$ac_cv_var_tty_clk" in
1248 yes) AC_DEFINE(TTYCLK) ;;
1251 AC_CACHE_CHECK(for the ppsclock streams module,
1253 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1254 case "$ac_cv_var_ppsclock" in
1255 yes) AC_DEFINE(PPS) ;;
1258 AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1261 i386-sequent-sysv4) ;;
1262 *) AC_EGREP_CPP(yes,
1263 [#include <netinet/in.h>
1264 #ifdef IP_ADD_MEMBERSHIP
1267 ], ac_cv_var_mcast=yes) ;;
1269 case "$ac_cv_var_mcast" in
1270 yes) AC_DEFINE(MCAST) ;;
1273 AC_CACHE_CHECK([availability of ntp_{adj,get}time()], ac_cv_var_ntp_syscalls,
1274 [ac_cv_var_ntp_syscalls=no
1275 case "$ac_cv_func___adjtimex" in
1277 ac_cv_var_ntp_syscalls=libc
1279 *) case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
1281 ac_cv_var_ntp_syscalls=libc
1283 *) AC_EGREP_CPP(yes,
1284 [#include <sys/syscall.h>
1285 #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1288 ], ac_cv_var_ntp_syscalls=kernel)
1293 case "$ac_cv_var_ntp_syscalls" in
1295 AC_DEFINE(NTP_SYSCALLS_LIBC)
1298 AC_DEFINE(NTP_SYSCALLS_STD)
1304 AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1306 [#include <sys/timex.h>
1310 ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
1312 AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
1313 [dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
1314 case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
1316 ac_cv_var_kernel_pll=no
1318 *) ac_cv_var_kernel_pll=yes
1321 case "$ac_cv_var_kernel_pll" in
1323 AC_DEFINE(KERNEL_PLL)
1327 AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1340 ac_cv_var_size_returned_in_buffer=$ans])
1341 case "$ac_cv_var_size_returned_in_buffer" in
1342 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER) ;;
1345 dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1346 dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
1347 dnl [ans=$enableval], [ans=no])
1348 dnl ac_cv_var_gdt_surveying=$ans])
1349 dnl case "$ac_cv_var_gdt_surveying" in
1350 dnl yes) AC_DEFINE(GDT_SURVEYING) ;;
1353 AC_CACHE_CHECK(if we want to use MD5 authentication, ac_cv_var_use_md5,
1354 [AC_ARG_ENABLE(md5, [ --enable-md5 + include support for MD5 keys],
1355 [ans=$enableval], [ans=yes])
1356 ac_cv_var_use_md5=$ans])
1357 case "$ac_cv_var_use_md5" in
1358 yes) AC_DEFINE(MD5) ;;
1361 # Check for ioctls TIOCGPPSEV
1362 AC_MSG_CHECKING(ioctl TIOCGPPSEV)
1363 if test "$ac_cv_header_termios_h" = "yes"; then
1365 [#include <termios.h>
1369 ], ntp_ok=yes, ntp_ok=no)
1373 if test "$ntp_ok" = "yes"; then
1374 AC_DEFINE(HAVE_TIOCGPPSEV)
1375 ac_cv_var_oncore_ok=yes
1377 AC_MSG_RESULT($ntp_ok)
1379 # Check for ioctls TIOCSPPS
1380 AC_MSG_CHECKING(ioctl TIOCSPPS)
1381 if test "$ac_cv_header_termios_h" = "yes"; then
1383 [#include <termios.h>
1387 ], ntp_ok=yes, ntp_ok=no)
1392 if test "$ntp_ok" = "yes"; then
1393 AC_DEFINE(HAVE_TIOCSPPS)
1395 AC_MSG_RESULT($ntp_ok)
1397 # Check for ioctls CIOGETEV
1398 AC_MSG_CHECKING(ioctl CIOGETEV)
1399 if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
1401 [#include <sys/ppsclock.h>
1405 ], ntp_ok=yes, ntp_ok=no)
1409 if test "$ntp_ok" = "yes"; then
1410 ac_cv_var_oncore_ok=yes
1411 AC_DEFINE(HAVE_CIOGETEV)
1413 AC_MSG_RESULT($ntp_ok)
1415 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1416 # there is NO way that I can tell to tell if a given OS is using timespec or
1417 # timeval so just set it here for the one case that is KNOWN to use timespec.
1419 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h" in
1421 AC_DEFINE(HAVE_PPSAPI)
1422 ac_cv_var_oncore_ok=yes
1423 AC_DEFINE(HAVE_TIMESPEC)
1427 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1428 AC_CHECK_HEADER(linux/serial.h)
1429 AC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
1430 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1433 [#include <sys/time.h>
1436 #include <sys/ppsclock.h>
1437 #include <linux/serial.h>
1441 #ifdef ASYNC_PPS_CD_POS
1442 #ifdef ASYNC_PPS_CD_NEG
1456 if test "$ntp_ok" = "yes"; then
1457 AC_DEFINE(HAVE_TIO_SERIAL_STUFF)
1459 AC_MSG_RESULT($ntp_ok)
1461 # Check for SHMEM_STATUS support
1462 AC_MSG_CHECKING(SHMEM_STATUS support)
1463 case "$ac_cv_header_sys_mman_h" in
1467 if test "$ntp_ok" = "yes"; then
1468 AC_DEFINE(ONCORE_SHMEM_STATUS)
1470 AC_MSG_RESULT($ntp_ok)
1472 dnl dnl These are for OPT_PROGRAMS in authstuff/
1473 dnl AC_SUBST(AUTHCERT)
1474 dnl AC_SUBST(AUTHSPEED)
1475 dnl AC_SUBST(MD5DRIVER)
1476 dnl AC_SUBST(KEYPARITY)
1477 dnl AC_SUBST(MAKEIPFP)
1478 dnl AC_SUBST(MAKEPC1)
1479 dnl AC_SUBST(MAKEPC2)
1480 dnl AC_SUBST(MAKESP)
1481 dnl AC_SUBST(MKRANDKEYS)
1482 dnl AC_SUBST(OMAKEIPFP)
1483 dnl AC_SUBST(UNIXCERT)
1487 # HPUX only, and by explicit request
1488 AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1489 AC_ARG_ENABLE(BANCOMM, [ --enable-BANCOMM - Datum/Bancomm bc635/VME interface],
1490 [ntp_ok=$enableval], [ntp_ok=no])
1491 if test "$ntp_ok" = "yes"; then
1493 AC_DEFINE(CLOCK_BANC)
1495 AC_MSG_RESULT($ntp_ok)
1496 case "$ntp_ok$target" in
1498 yes*) AC_WARN(*** But the expected answer is... no ***) ;;
1501 #HPUX only, and only by explicit request
1502 AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1503 AC_ARG_ENABLE(GPSVME, [ --enable-GPSVME - TrueTime GPS receiver/VME interface],
1504 [ntp_ok=$enableval], [ntp_ok=no])
1505 if test "$ntp_ok" = "yes"; then
1507 AC_DEFINE(CLOCK_GPSVME)
1509 AC_MSG_RESULT($ntp_ok)
1510 case "$ntp_ok$target" in
1512 yes*) AC_WARN(*** But the expected answer is... no ***) ;;
1515 AC_MSG_CHECKING(for PCL720 clock support)
1516 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1518 AC_DEFINE(CLOCK_PPS720)
1527 AC_MSG_CHECKING(for SHM clock attached thru shared memory)
1528 AC_ARG_ENABLE(SHM, [ --enable-SHM - SHM clock attached thru shared memory],
1529 [ntp_ok=$enableval], [ntp_ok=no])
1530 if test "$ntp_ok" = "yes"; then
1532 AC_DEFINE(CLOCK_SHM)
1534 AC_MSG_RESULT($ntp_ok)
1536 AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1537 AC_ARG_ENABLE(all-clocks, [ --enable-all-clocks + include all suitable non-PARSE clocks:],
1538 [ntp_eac=$enableval], [ntp_eac=yes])
1539 AC_MSG_RESULT($ntp_eac)
1541 AC_MSG_CHECKING(if we have support for PARSE clocks)
1542 case "$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1549 AC_MSG_RESULT($ntp_canparse)
1551 AC_MSG_CHECKING([if we have support for audio clocks])
1552 case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
1553 *yes*) ntp_canaudio=yes ;;
1554 *) ntp_canaudio=no ;;
1556 AC_MSG_RESULT($ntp_canaudio)
1558 # Requires modem control
1559 AC_MSG_CHECKING(ACTS modem service)
1560 AC_ARG_ENABLE(ACTS, [ --enable-ACTS + ACTS modem service],
1561 [ntp_ok=$enableval],
1563 [#include <termios.h>
1564 #ifdef HAVE_SYS_IOCTL_H
1565 #include <sys/ioctl.h>
1570 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1571 if test "$ntp_ok" = "yes"; then
1573 AC_DEFINE(CLOCK_ACTS)
1575 AC_MSG_RESULT($ntp_ok)
1577 AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1578 AC_ARG_ENABLE(ARBITER, [ --enable-ARBITER + Arbiter 1088A/B GPS receiver],
1579 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1580 if test "$ntp_ok" = "yes"; then
1582 AC_DEFINE(CLOCK_ARBITER)
1584 AC_MSG_RESULT($ntp_ok)
1586 AC_MSG_CHECKING(Arcron MSF receiver)
1587 AC_ARG_ENABLE(ARCRON_MSF, [ --enable-ARCRON-MSF + Arcron MSF receiver],
1588 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1589 if test "$ntp_ok" = "yes"; then
1591 AC_DEFINE(CLOCK_ARCRON_MSF)
1593 AC_MSG_RESULT($ntp_ok)
1595 AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1596 AC_ARG_ENABLE(AS2201, [ --enable-AS2201 + Austron 2200A/2201A GPS receiver],
1597 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1598 if test "$ntp_ok" = "yes"; then
1600 AC_DEFINE(CLOCK_AS2201)
1602 AC_MSG_RESULT($ntp_ok)
1604 AC_MSG_CHECKING(PPS interface)
1605 AC_ARG_ENABLE(ATOM, [ --enable-ATOM + PPS interface],
1606 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1607 if test "$ntp_ok" = "yes"; then
1609 AC_DEFINE(CLOCK_ATOM)
1611 AC_MSG_RESULT($ntp_ok)
1613 AC_MSG_CHECKING(CHU modem/decoder)
1614 AC_ARG_ENABLE(CHU, [ --enable-CHU - CHU modem/decoder],
1615 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1616 if test "$ntp_ok" = "yes"; then
1618 AC_DEFINE(CLOCK_CHU)
1620 AC_MSG_RESULT($ntp_ok)
1621 ac_refclock_chu=$ntp_ok
1623 AC_MSG_CHECKING(CHU audio/decoder)
1624 AC_ARG_ENABLE(AUDIO-CHU, [ --enable-AUDIO-CHU s CHU audio/decoder],
1625 [ntp_ok=$enableval],
1626 [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
1630 if test "$ntp_ok" = "yes"; then
1631 AC_DEFINE(AUDIO_CHU)
1633 AC_MSG_RESULT($ntp_ok)
1634 # We used to check for sunos/solaris target...
1635 case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
1636 yes*no*) AC_WARN(*** But the expected answer is...no ***) ;;
1640 AC_MSG_CHECKING(Datum Programmable Time System)
1641 AC_ARG_ENABLE(DATUM, [ --enable-DATUM s Datum Programmable Time System],
1642 [ntp_ok=$enableval],
1643 [case "$ac_cv_header_termios_h" in
1650 if test "$ntp_ok" = "yes"; then
1652 AC_DEFINE(CLOCK_DATUM)
1654 AC_MSG_RESULT($ntp_ok)
1656 AC_MSG_CHECKING(Forum Graphic GPS)
1657 AC_ARG_ENABLE(FG, [ --enable-FG + Forum Graphic GPS],
1658 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1659 if test "$ntp_ok" = "yes"; then
1663 AC_MSG_RESULT($ntp_ok)
1665 # Requires modem control
1666 AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1667 AC_ARG_ENABLE(HEATH, [ --enable-HEATH s Heath GC-1000 WWV/WWVH receiver],
1668 [ntp_ok=$enableval],
1670 [#include <termios.h>
1671 #ifdef HAVE_SYS_IOCTL_H
1672 #include <sys/ioctl.h>
1677 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1678 if test "$ntp_ok" = "yes"; then
1680 AC_DEFINE(CLOCK_HEATH)
1682 AC_MSG_RESULT($ntp_ok)
1684 AC_MSG_CHECKING(HP 58503A GPS receiver)
1685 AC_ARG_ENABLE(HPGPS, [ --enable-HPGPS + HP 58503A GPS receiver],
1686 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1687 if test "$ntp_ok" = "yes"; then
1689 AC_DEFINE(CLOCK_HPGPS)
1691 AC_MSG_RESULT($ntp_ok)
1693 AC_MSG_CHECKING(Sun IRIG audio decoder)
1694 AC_ARG_ENABLE(IRIG, [ --enable-IRIG s Sun IRIG audio decoder],
1695 [ntp_ok=$enableval],
1696 [case "$ntp_eac$ntp_canaudio" in
1700 if test "$ntp_ok" = "yes"; then
1702 AC_DEFINE(CLOCK_IRIG)
1704 AC_MSG_RESULT($ntp_ok)
1705 case "$ntp_ok$ntp_canaudio" in
1706 yesno) AC_WARN(*** But the expected answer is... no ***) ;;
1709 AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
1710 AC_ARG_ENABLE(LEITCH, [ --enable-LEITCH + Leitch CSD 5300 Master Clock System Driver],
1711 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1712 if test "$ntp_ok" = "yes"; then
1714 AC_DEFINE(CLOCK_LEITCH)
1716 AC_MSG_RESULT($ntp_ok)
1718 AC_MSG_CHECKING(local clock reference)
1719 AC_ARG_ENABLE(LOCAL-CLOCK, [ --enable-LOCAL-CLOCK + local clock reference],
1720 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1721 if test "$ntp_ok" = "yes"; then
1723 AC_DEFINE(CLOCK_LOCAL)
1725 AC_MSG_RESULT($ntp_ok)
1727 AC_MSG_CHECKING(EES M201 MSF receiver)
1728 AC_ARG_ENABLE(MSFEES, [ --enable-MSFEES + EES M201 MSF receiver],
1729 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1730 if test "$ntp_ok" = "yes"; then
1732 AC_DEFINE(CLOCK_MSFEES)
1734 AC_MSG_RESULT($ntp_ok)
1737 AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
1738 AC_ARG_ENABLE(MX4200, [ --enable-MX4200 s Magnavox MX4200 GPS receiver],
1739 [ntp_ok=$enableval],
1740 [case "$ac_cv_var_ppsclock" in
1741 yes) ntp_ok=$ntp_eac
1746 if test "$ntp_ok" = "yes"; then
1748 AC_DEFINE(CLOCK_MX4200)
1750 AC_MSG_RESULT($ntp_ok)
1751 case "$ntp_ok$target" in
1752 yes*-*-ultrix*) AC_WARN(*** But the expected answer is... no ***) ;;
1755 AC_MSG_CHECKING(NMEA GPS receiver)
1756 AC_ARG_ENABLE(NMEA, [ --enable-NMEA + NMEA GPS receiver],
1757 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1758 if test "$ntp_ok" = "yes"; then
1760 AC_DEFINE(CLOCK_NMEA)
1762 AC_MSG_RESULT($ntp_ok)
1764 AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
1765 AC_ARG_ENABLE(ONCORE, [ --enable-ONCORE + Motorola VP/UT Oncore GPS receiver],
1766 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1767 case "$ac_cv_var_oncore_ok" in
1770 if test "$ntp_ok" = "yes"; then
1772 AC_DEFINE(CLOCK_ONCORE)
1774 AC_MSG_RESULT($ntp_ok)
1776 AC_MSG_CHECKING(for Palisade clock)
1777 AC_ARG_ENABLE(PALISADE, [ --enable-PALISADE + Palisade clock],
1778 [ntp_ok=$enableval],
1779 [case "$ac_cv_header_termios_h" in
1787 if test "$ntp_ok" = "yes"; then
1789 AC_DEFINE(CLOCK_PALISADE)
1791 AC_MSG_RESULT($ntp_ok)
1793 AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
1794 AC_ARG_ENABLE(PST, [ --enable-PST + PST/Traconex 1020 WWV/WWVH receiver],
1795 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1796 if test "$ntp_ok" = "yes"; then
1798 AC_DEFINE(CLOCK_PST)
1800 AC_MSG_RESULT($ntp_ok)
1803 AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
1804 AC_ARG_ENABLE(JUPITER, [ --enable-JUPITER s Rockwell Jupiter GPS receiver],
1805 [ntp_ok=$enableval],
1806 [case "$ac_cv_var_ppsclock" in
1807 # yes) ntp_ok=$ntp_eac
1812 if test "$ntp_ok" = "yes"; then
1814 AC_DEFINE(CLOCK_JUPITER)
1816 AC_MSG_RESULT($ntp_ok)
1817 case "$ntp_ok$target" in
1818 yes*-*-ultrix*) AC_WARN(*** But the expected answer is... no ***) ;;
1821 # Requires modem control
1822 AC_MSG_CHECKING(PTB modem service)
1823 AC_ARG_ENABLE(PTBACTS, [ --enable-PTBACTS s PTB modem service],
1824 [ntp_ok=$enableval],
1826 [#include <termios.h>
1827 #ifdef HAVE_SYS_IOCTL_H
1828 #include <sys/ioctl.h>
1833 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1834 if test "$ntp_ok" = "yes"; then
1836 AC_DEFINE(CLOCK_PTBACTS)
1838 AC_MSG_RESULT($ntp_ok)
1840 AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
1841 AC_ARG_ENABLE(TPRO, [ --enable-TPRO s KSI/Odetics TPRO/S GPS receiver/IRIG interface],
1842 [ntp_ok=$enableval],
1843 [case "$ac_cv_header_sys_tpro_h" in
1850 if test "$ntp_ok" = "yes"; then
1852 AC_DEFINE(CLOCK_TPRO)
1854 AC_MSG_RESULT($ntp_ok)
1855 case "$ntp_ok$ac_cv_header_sys_tpro" in
1856 yesno) AC_WARN(*** But the expected answer is... no ***) ;;
1859 AC_MSG_CHECKING(TRAK 8810 GPS receiver)
1860 AC_ARG_ENABLE(TRAK, [ --enable-TRAK + TRAK 8810 GPS receiver],
1861 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1862 if test "$ntp_ok" = "yes"; then
1864 AC_DEFINE(CLOCK_TRAK)
1866 AC_MSG_RESULT($ntp_ok)
1868 AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
1869 AC_ARG_ENABLE(CHRONOLOG, [ --enable-CHRONOLOG + Chrono-log K-series WWVB receiver],
1870 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1871 if test "$ntp_ok" = "yes"; then
1873 AC_DEFINE(CLOCK_CHRONOLOG)
1875 AC_MSG_RESULT($ntp_ok)
1877 AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
1878 AC_ARG_ENABLE(DUMBCLOCK, [ --enable-DUMBCLOCK + Dumb generic hh:mm:ss local clock],
1879 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1880 if test "$ntp_ok" = "yes"; then
1882 AC_DEFINE(CLOCK_DUMBCLOCK)
1884 AC_MSG_RESULT($ntp_ok)
1886 AC_MSG_CHECKING(Conrad parallel port radio clock)
1887 AC_ARG_ENABLE(PCF, [ --enable-PCF + Conrad parallel port radio clock],
1888 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1889 if test "$ntp_ok" = "yes"; then
1891 AC_DEFINE(CLOCK_PCF)
1893 AC_MSG_RESULT($ntp_ok)
1895 AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
1896 AC_ARG_ENABLE(SPECTRACOM, [ --enable-SPECTRACOM + Spectracom 8170/Netclock/2 WWVB receiver],
1897 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1898 if test "$ntp_ok" = "yes"; then
1900 AC_DEFINE(CLOCK_SPECTRACOM)
1902 AC_MSG_RESULT($ntp_ok)
1904 # Not on a vax-dec-bsd
1905 AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
1906 AC_ARG_ENABLE(TRUETIME, [ --enable-TRUETIME s Kinemetrics/TrueTime receivers],
1907 [ntp_ok=$enableval],
1916 if test "$ntp_ok" = "yes"; then
1918 AC_DEFINE(CLOCK_TRUETIME)
1920 AC_MSG_RESULT($ntp_ok)
1921 case "$ntp_ok$target" in
1922 yesvax-dec-bsd) AC_WARN(*** But the expected answer is... no ***) ;;
1925 AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
1926 AC_ARG_ENABLE(ULINK, [ --enable-ULINK + Ultralink WWVB receiver],
1927 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1928 if test "$ntp_ok" = "yes"; then
1930 AC_DEFINE(CLOCK_ULINK)
1932 AC_MSG_RESULT($ntp_ok)
1934 AC_MSG_CHECKING(WWV receiver)
1935 AC_ARG_ENABLE(WWV, [ --enable-WWV + WWV Audio receiver],
1936 [ntp_ok=$enableval],
1937 [case "$ntp_eac$ntp_canaudio" in
1941 if test "$ntp_ok" = "yes"; then
1943 AC_DEFINE(CLOCK_WWV)
1945 AC_MSG_RESULT($ntp_ok)
1946 case "$ntp_ok$ntp_canaudio" in
1947 yesno) AC_WARN(*** But the expected answer is... no ***) ;;
1950 # Requires modem control
1951 AC_MSG_CHECKING(USNO modem service)
1952 AC_ARG_ENABLE(USNO, [ --enable-USNO s USNO modem service],
1953 [ntp_ok=$enableval],
1955 [#include <termios.h>
1956 #ifdef HAVE_SYS_IOCTL_H
1957 #include <sys/ioctl.h>
1962 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1963 if test "$ntp_ok" = "yes"; then
1965 AC_DEFINE(CLOCK_USNO)
1967 AC_MSG_RESULT($ntp_ok)
1969 AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
1970 AC_ARG_ENABLE(parse-clocks, [ --enable-parse-clocks - include all suitable PARSE clocks:],
1971 [ntp_eapc=$enableval],
1973 yes) ntp_eapc=$ntp_canparse ;;
1977 AC_MSG_RESULT($ntp_eapc)
1979 case "$ntp_eac$ntp_eapc$ntp_canparse" in
1981 AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
1984 AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
1993 AC_MSG_CHECKING(Diem Computime Radio Clock)
1994 AC_ARG_ENABLE(COMPUTIME, [ --enable-COMPUTIME s Diem Computime Radio Clock],
1995 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1996 if test "$ntp_ok" = "yes"; then
1999 AC_DEFINE(CLOCK_COMPUTIME)
2001 AC_MSG_RESULT($ntp_ok)
2002 case "$ntp_ok$ntp_canparse" in
2004 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2008 AC_MSG_CHECKING(ELV/DCF7000 clock)
2009 AC_ARG_ENABLE(DCF7000, [ --enable-DCF7000 s ELV/DCF7000 clock],
2010 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2011 if test "$ntp_ok" = "yes"; then
2014 AC_DEFINE(CLOCK_DCF7000)
2016 AC_MSG_RESULT($ntp_ok)
2017 case "$ntp_ok$ntp_canparse" in
2019 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2023 AC_MSG_CHECKING(HOPF 6021 clock)
2024 AC_ARG_ENABLE(HOPF6021, [ --enable-HOPF6021 s HOPF 6021 clock],
2025 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2026 if test "$ntp_ok" = "yes"; then
2029 AC_DEFINE(CLOCK_HOPF6021)
2031 AC_MSG_RESULT($ntp_ok)
2032 case "$ntp_ok$ntp_canparse" in
2034 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2038 AC_MSG_CHECKING(Meinberg clocks)
2039 AC_ARG_ENABLE(MEINBERG, [ --enable-MEINBERG s Meinberg clocks],
2040 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2041 if test "$ntp_ok" = "yes"; then
2044 AC_DEFINE(CLOCK_MEINBERG)
2046 AC_MSG_RESULT($ntp_ok)
2047 case "$ntp_ok$ntp_canparse" in
2049 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2053 AC_MSG_CHECKING(DCF77 raw time code)
2054 AC_ARG_ENABLE(RAWDCF, [ --enable-RAWDCF s DCF77 raw time code],
2055 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2056 if test "$ntp_ok" = "yes"; then
2061 AC_DEFINE(CLOCK_RAWDCF)
2063 AC_MSG_RESULT($ntp_ok)
2064 case "$ntp_ok$ntp_canparse" in
2066 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2070 case "$ntp_rawdcf" in
2072 AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2073 ac_cv_var_rawdcf_parity,
2080 ac_cv_var_rawdcf_parity=$ans])
2081 case "$ac_cv_var_rawdcf_parity" in
2082 yes) AC_DEFINE(RAWDCF_NO_IGNPAR) ;;
2086 *) # HMS: Is this a good idea?
2087 ac_cv_var_rawdcf_parity=no
2091 AC_MSG_CHECKING(RCC 8000 clock)
2092 AC_ARG_ENABLE(RCC8000, [ --enable-RCC8000 s RCC 8000 clock],
2093 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2094 if test "$ntp_ok" = "yes"; then
2097 AC_DEFINE(CLOCK_RCC8000)
2099 AC_MSG_RESULT($ntp_ok)
2100 case "$ntp_ok$ntp_canparse" in
2102 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2106 AC_MSG_CHECKING(Schmid DCF77 clock)
2107 AC_ARG_ENABLE(SCHMID, [ --enable-SCHMID s Schmid DCF77 clock],
2108 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2109 if test "$ntp_ok" = "yes"; then
2112 AC_DEFINE(CLOCK_SCHMID)
2114 AC_MSG_RESULT($ntp_ok)
2115 case "$ntp_ok$ntp_canparse" in
2117 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2121 AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2122 AC_ARG_ENABLE(TRIMTAIP, [ --enable-TRIMTAIP s Trimble GPS receiver/TAIP protocol],
2123 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2124 if test "$ntp_ok" = "yes"; then
2127 AC_DEFINE(CLOCK_TRIMTAIP)
2129 AC_MSG_RESULT($ntp_ok)
2130 case "$ntp_ok$ntp_canparse" in
2132 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2136 AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2137 AC_ARG_ENABLE(TRIMTSIP, [ --enable-TRIMTSIP s Trimble GPS receiver/TSIP protocol],
2138 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2139 if test "$ntp_ok" = "yes"; then
2142 AC_DEFINE(CLOCK_TRIMTSIP)
2144 AC_MSG_RESULT($ntp_ok)
2145 case "$ntp_ok$ntp_canparse" in
2147 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2151 AC_MSG_CHECKING(WHARTON 400A Series clock)
2152 AC_ARG_ENABLE(WHARTON, [ --enable-WHARTON s WHARTON 400A Series clock],
2153 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2154 if test "$ntp_ok" = "yes"; then
2157 AC_DEFINE(CLOCK_WHARTON_400A)
2159 AC_MSG_RESULT($ntp_ok)
2160 case "$ntp_ok$ntp_canparse" in
2162 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2166 AC_MSG_CHECKING(VARITEXT clock)
2167 AC_ARG_ENABLE(VARITEXT, [ --enable-VARITEXT s VARITEXT clock],
2168 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2169 if test "$ntp_ok" = "yes"; then
2172 AC_DEFINE(CLOCK_VARITEXT)
2174 AC_MSG_RESULT($ntp_ok)
2175 case "$ntp_ok$ntp_canparse" in
2177 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2181 AC_SUBST(MAKE_LIBPARSE)
2182 AC_SUBST(MAKE_LIBPARSE_KERNEL)
2183 AC_SUBST(MAKE_CHECK_Y2K)
2184 AC_MSG_CHECKING(if we need to make and use the parse libraries)
2186 case "$ntp_libparse" in
2189 AC_DEFINE(CLOCK_PARSE)
2190 LIBPARSE=../libparse/libparse.a
2191 MAKE_LIBPARSE=libparse.a
2192 MAKE_CHECK_Y2K=check_y2k
2193 AC_DEFINE(PPS_SAMPLE)
2194 AC_DEFINE(CLOCK_ATOM)
2201 AC_SUBST(MAKE_LIBRSAREF)
2202 AC_MSG_CHECKING(if we need to make and use the RSAREF library)
2204 if test -f $srcdir/rsaref2/source/rsa.c
2207 LIBRSAREF=../librsaref/librsaref.a
2208 MAKE_LIBRSAREF=librsaref.a
2216 AC_MSG_CHECKING(if we can make dcf parse utilities)
2218 if test "$ntp_parseutil" = "yes"; then
2220 *-*-sunos4*|*-*-solaris2*|*-*-linux*)
2229 AC_SUBST(MAKE_PARSEKMODULE)
2230 AC_MSG_CHECKING(if we can build kernel streams modules for parse)
2232 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
2236 case "$ac_cv_var_kernel_pll" in
2242 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
2246 MAKE_PARSEKMODULE=parse
2253 AC_MSG_CHECKING(if we need basic refclock support)
2254 if test "$ntp_refclock" = "yes"; then
2257 AC_MSG_RESULT($ntp_refclock)
2259 dnl Things that can be made in clockstuff/
2260 AC_SUBST(PROPDELAY) dnl Set to "propdelay"
2261 AC_SUBST(CHUTEST) dnl Set to "chutest"
2262 AC_SUBST(CLKTEST) dnl Set to "clktest"
2264 AC_SUBST(MAKE_ADJTIMED)
2265 AC_MSG_CHECKING(if we want HP-UX adjtimed support)
2266 changequote(<<, >>)dnl
2274 changequote([, ])dnl
2275 if test "$ans" = "yes"; then
2276 MAKE_ADJTIMED=adjtimed
2277 AC_DEFINE(NEED_HPUX_ADJTIME)
2281 AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
2282 [AC_ARG_ENABLE(kmem, [ --enable-kmem s read /dev/kmem for tick and/or tickadj],
2284 [changequote(<<, >>)dnl
2285 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
2296 *-*-domainos) # Won't be found...
2312 changequote([, ])dnl
2314 ac_cv_var_can_kmem=$ans])
2316 case "$ac_cv_var_can_kmem" in
2318 *) AC_DEFINE(NOKMEM) ;;
2321 AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
2322 [AC_ARG_ENABLE(accurate-adjtime, [ --enable-accurate-adjtime
2323 s the adjtime() call is accurate],
2325 [changequote(<<, >>)dnl
2333 mips-sgi-irix[456]*)
2354 changequote([, ])dnl
2356 ac_cv_var_adjtime_is_accurate=$ans])
2357 case "$ac_cv_var_adjtime_is_accurate" in
2358 yes) AC_DEFINE(ADJTIME_IS_ACCURATE) ;;
2361 AC_CACHE_CHECK([the name of 'tick' in the kernel],
2362 ac_cv_var_nlist_tick,
2363 [changequote(<<, >>)dnl
2366 m68*-hp-hpux*) # HP9000/300?
2391 changequote([, ])dnl
2392 ac_cv_var_nlist_tick=$ans])
2393 case "$ac_cv_var_nlist_tick" in
2394 ''|no) ;; # HMS: I think we can only get 'no' here...
2395 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick") ;;
2398 AC_CACHE_CHECK([for the units of 'tick'],
2399 ac_cv_var_tick_nano,
2400 [changequote(<<, >>)dnl
2407 changequote([, ])dnl
2408 ac_cv_var_tick_nano=$ans])
2409 case "$ac_cv_var_tick_nano" in
2411 AC_DEFINE(TICK_NANO)
2415 AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
2416 ac_cv_var_nlist_tickadj,
2417 [changequote(<<, >>)dnl
2420 m68*-hp-hpux*) # HP9000/300?
2448 ans=no # hrestime_adj
2454 changequote([, ])dnl
2455 ac_cv_var_nlist_tickadj=$ans])
2456 case "$ac_cv_var_nlist_tickadj" in
2457 ''|no) ;; # HMS: I think we can only get 'no' here...
2458 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj") ;;
2461 AC_CACHE_CHECK([for the units of 'tickadj'],
2462 ac_cv_var_tickadj_nano,
2463 [changequote(<<, >>)dnl
2470 changequote([, ])dnl
2471 ac_cv_var_tickadj_nano=$ans])
2472 case "$ac_cv_var_tickadj_nano" in
2474 AC_DEFINE(TICKADJ_NANO)
2478 AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
2479 ac_cv_var_nlist_dosynctodr,
2480 [changequote(<<, >>)dnl
2516 changequote([, ])dnl
2517 ac_cv_var_nlist_dosynctodr=$ans])
2518 case "$ac_cv_var_nlist_dosynctodr" in
2520 *) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr")
2524 AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
2525 ac_cv_var_nlist_noprintf,
2526 [changequote(<<, >>)dnl
2556 changequote([, ])dnl
2557 ac_cv_var_nlist_noprintf=$ans])
2558 case "$ac_cv_var_nlist_noprintf" in
2560 *) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf")
2564 dnl The tick/tickadj sections were written by Skippy, who never learned
2565 dnl that it's impolite (horridly gross) to show your guts in public.
2568 dnl 10000 80 Unixware
2569 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
2570 dnl 10000 150 sgi IRIX
2571 dnl 1000000L/hz 1000 RS6000 && NOKMEM
2572 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
2573 dnl 1000000L/hz 500/HZ other && NOKMEM
2574 dnl txc.tick 1 Linux
2575 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
2576 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
2577 dnl (RS6000 && !NOKMEM), SINIX MIPS
2579 dnl But we'll only use these "values" if we can't find anything else.
2581 AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
2582 [AC_ARG_ENABLE(tick, [ --enable-tick=VALUE s force a value for 'tick'],
2604 ac_cv_var_tick=$ans])
2605 case "$ac_cv_var_tick" in
2606 ''|no) ;; # HMS: I think we can only get 'no' here...
2607 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick) ;;
2610 AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
2611 [AC_ARG_ENABLE(tickadj, [ --enable-tickadj=VALUE s force a value for 'tickadj'],
2616 case "$ac_cv_var_adjtime_is_accurate" in
2617 yes) ans='tick/16' ;;
2627 case "$ac_cv_var_can_kmem" in
2631 *-*-domainos) # Skippy: won't be found...
2632 case "$ac_cv_var_can_kmem" in
2637 case "$ac_cv_var_adjtime_is_accurate" in
2638 yes) ans='tick/16' ;;
2648 case "$ac_cv_var_adjtime_is_accurate" in
2658 ac_cv_var_tickadj=$ans])
2659 case "$ac_cv_var_tickadj" in
2660 ''|no) ;; # HMS: I think we can only get 'no' here...
2661 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj) ;;
2664 # Newer versions of ReliantUNIX round adjtime() values down to
2665 # 1/100s (system tick). Sigh ...
2666 # Unfortunately, there is no easy way to know if particular release
2667 # has this "feature" or any obvious way to test for it.
2669 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK) ;;
2673 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK) ;;
2676 ac_cv_make_tickadj=yes
2677 case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
2678 nonono) # Don't read KMEM, no presets. Bogus.
2679 AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.)
2680 ac_cv_make_tickadj=no
2682 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
2683 AC_MSG_WARN(Can't read kmem but no PRESET_TICK. No tickadj.)
2684 ac_cv_make_tickadj=no
2686 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
2687 AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ. No tickadj.)
2688 ac_cv_make_tickadj=no
2690 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
2692 yesnono) # Read KMEM, no presets. Cool.
2694 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
2695 AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.)
2697 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
2699 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
2701 *) # Generally bogus.
2702 AC_MSG_ERROR(This shouldn't happen.)
2708 # tickadj is pretty useless on newer versions of ReliantUNIX
2710 ac_cv_make_tickadj=no
2713 # DLM says tickadj is a no-no starting with solaris2.5
2715 *-*-solaris2.[0-4]*) ;;
2716 *) ac_cv_make_tickadj=no ;;
2721 AC_SUBST(MAKE_TICKADJ)
2722 AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
2723 ac_cv_make_tickadj=yes)
2724 case "$ac_cv_make_tickadj" in
2726 MAKE_TICKADJ=tickadj
2730 AC_SUBST(MAKE_NTPTIME)
2731 AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
2733 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
2743 ac_cv_make_ntptime=$ans])
2744 case "$ac_cv_make_ntptime" in
2746 MAKE_NTPTIME=ntptime
2750 AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
2751 [AC_ARG_ENABLE(udp-wildcard, [ --enable-udp-wildcard s use UDP wildcard delivery],
2798 ac_cv_var_udp_wildcard_delivery=$ans])
2799 case "$ac_cv_var_udp_wildcard_delivery" in
2800 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY) ;;
2806 *) case "$target" in
2808 LDFLAGS="$LDFLAGS -r"
2814 AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
2815 [AC_ARG_ENABLE(slew-always, [ --enable-slew-always s always slew the time],
2817 [changequote(<<, >>)dnl
2828 *-*-openvms*) # HMS: won't be found
2834 changequote([, ])dnl
2836 ac_cv_var_slew_always=$ans])
2837 case "$ac_cv_var_slew_always" in
2838 yes) AC_DEFINE(SLEWALWAYS) ;;
2841 AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
2842 [AC_ARG_ENABLE(step-slew, [ --enable-step-slew s step and slew the time],
2844 [changequote(<<, >>)dnl
2855 *-*-solaris2.[012]*)
2858 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
2864 changequote([, ])dnl
2866 ac_cv_var_step_slew=$ans])
2867 case "$ac_cv_var_step_slew" in
2868 yes) AC_DEFINE(STEP_SLEW) ;;
2871 AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
2872 [AC_ARG_ENABLE(ntpdate-step, [ --enable-ntpdate-step s if ntpdate should step the time],
2874 [changequote(<<, >>)dnl
2882 changequote([, ])dnl
2884 ac_cv_var_ntpdate_step=$ans])
2885 case "$ac_cv_var_ntpdate_step" in
2886 yes) AC_DEFINE(FORCE_NTPDATE_STEP) ;;
2889 AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
2890 [AC_ARG_ENABLE(hourly-todr-sync, [ --enable-hourly-todr-sync
2891 s if we should sync TODR hourly],
2897 *-*-openvms*) # HMS: won't be found
2903 ac_cv_var_sync_todr=$ans])
2904 case "$ac_cv_var_sync_todr" in
2905 yes) AC_DEFINE(DOSYNCTODR) ;;
2908 AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
2909 [AC_ARG_ENABLE(kernel-fll-bug, [ --enable-kernel-fll-bug s if we should avoid a kernel FLL bug],
2911 [changequote(<<, >>)dnl
2917 case "`uname -v`" in
2928 changequote([, ])dnl
2930 ac_cv_var_kernel_fll_bug=$ans])
2931 case "$ac_cv_var_kernel_fll_bug" in
2932 yes) AC_DEFINE(KERNEL_FLL_BUG) ;;
2938 *) case "$target" in
2940 LDFLAGS="$LDFLAGS -r"
2946 # This is necessary so that .o files in LIBOBJS are also built via
2947 # the ANSI2KNR-filtering rules.
2948 LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
2950 AC_OUTPUT(Makefile adjtimed/Makefile clockstuff/Makefile \
2951 include/Makefile kernel/Makefile kernel/sys/Makefile libntp/Makefile \
2952 libparse/Makefile librsaref/Makefile ntpd/Makefile ntpdc/Makefile \
2953 ntpdate/Makefile ntpq/Makefile ntptrace/Makefile parseutil/Makefile \
2954 scripts/Makefile scripts/mkver scripts/ntpver util/Makefile,
2955 [chmod +x scripts/ntpver scripts/mkver])
2956 #test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])