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, "$host", [canonical system (cpu-vendor-os) string])
6 AM_CONFIG_HEADER(config.h)
8 AM_INIT_AUTOMAKE(ntp, 4.2.0)
12 ac_cv_var_oncore_ok=no
13 ac_cv_var_ripe_ncc_ok=no
14 ac_cv_var_jupiter_ok=no
16 dnl Grab any initial CFLAGS so we can pick better defaults.
19 dnl check these early to avoid autoconf warnings
23 dnl we need to check for cross compile tools for vxWorks here
30 CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
33 CFLAGS="$CFLAGS -DSYS_CYGWIN32"
38 CFLAGS="$CFLAGS -Wc,+abi-socket"
43 CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
44 LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
49 AC_CACHE_CHECK(if we should use /dev/clockctl, ac_clockctl,
50 [AC_ARG_ENABLE(clockctl,
51 AC_HELP_STRING([--enable-clockctl], [Use /dev/clockctl for non-root time control]),
62 # End of AC_CACHE_CHECK for clockctl
63 AC_CHECK_HEADERS(sys/clockctl.h)
64 case "$ac_clockctl$ac_cv_header_sys_clockctl_h" in
66 AC_DEFINE(HAVE_CLOCKCTL, ,[[Use /dev/clockctl?]])
75 # Quick and dirty sanity check
77 '') AC_MSG_ERROR(Please follow the directions in html/vxworks.html!)
80 CFLAGS="$CFLAGS -DSYS_VXWORKS"
86 dnl we need to check for cross compile tools for vxWorks here
94 CFLAGS="$CFLAGS -Wall"
95 # CFLAGS="$CFLAGS -Wcast-align"
96 CFLAGS="$CFLAGS -Wcast-qual"
97 # CFLAGS="$CFLAGS -Wconversion"
98 # CFLAGS="$CFLAGS -Werror"
99 CFLAGS="$CFLAGS -Wmissing-prototypes"
100 CFLAGS="$CFLAGS -Wpointer-arith"
101 CFLAGS="$CFLAGS -Wshadow"
102 CFLAGS="$CFLAGS -Wstrict-prototypes"
103 # CFLAGS="$CFLAGS -Wtraditional"
104 # CFLAGS="$CFLAGS -Wwrite-strings"
109 ac_busted_vpath_in_make=no
113 CFLAGS="$CFLAGS -posix"
115 *-*-irix6.1*) # 64 bit only
118 *-*-irix6*) # 6.2 (and later?)
119 ac_busted_vpath_in_make=yes
120 # don't pass -n32 to gcc, it cannot handle and doesn't need it
121 if test "$GCC" != yes; then
126 *) case "$iCFLAGS" in
127 '') CFLAGS="-O2 -g3 -n32" ;;
128 *) CFLAGS="$CFLAGS -n32" ;;
136 *) LDFLAGS="$LDFLAGS -n32" ;;
141 ac_busted_vpath_in_make=yes
144 ac_busted_vpath_in_make=yes
146 dnl This is currently commented out by bor.
147 dnl The new versions of ReliantUNIX round adjtime() interval down
148 dnl to 1/100s (system tick). This makes tickadj actually useless.
149 dnl So, I'd better not use additional flags.
150 dnl I leave it here just in case anybody has better idea
151 dnl mips-sni-sysv4* )
153 dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
155 dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
156 dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
161 case "$ac_busted_vpath_in_make$srcdir" in
164 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
166 AC_MSG_ERROR(building outside of the main directory requires GNU make)
177 AC_PROG_GCC_TRADITIONAL
181 AC_PATH_PROG(PATH_SH, sh)
182 AC_PATH_PROG(PATH_PERL, perl)
188 ac_link="$ac_link $VX_KERNEL"
196 AC_CHECK_LIB(advapi32, main)
199 AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
200 dnl AC_CHECK_LIB(kvm, main, , , -lelf)
201 AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
202 AC_CHECK_LIB(ld, nlist)
203 AC_CHECK_LIB(mld, nlist)
204 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket))
205 AC_CHECK_FUNC(openlog, ,
206 AC_CHECK_LIB(gen, openlog, ,
207 AC_CHECK_LIB(syslog, openlog, , , -lsocket)))
208 AC_CHECK_LIB(md5, MD5Init, ,
209 AC_CHECK_LIB(md, MD5Init))
210 AC_CHECK_FUNCS(MD5Init)
211 dnl HMS: What a hack...
212 AC_CHECK_HEADERS(readline/history.h readline/readline.h)
213 case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
217 AC_CHECK_LIB(readline, readline, ,
218 AC_MSG_NOTICE([Trying again with -lcurses])
219 unset ac_cv_lib_readline_readline
220 AC_CHECK_LIB(readline, readline,
221 LIBS="-lreadline -lcurses $LIBS"
222 AC_DEFINE(HAVE_LIBREADLINE)
223 AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
224 AC_CHECK_LIB(edit, readline,
225 LIBS="-ledit -lcurses"
226 AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
227 AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
231 AC_SUBST(READLINE_LIBS)
236 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
237 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
238 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
239 dnl does Strange Things with extra processes using the Posix-compatibility
240 dnl real-time library, so we don't want to use it.
245 AC_CHECK_LIB(rt, sched_setscheduler, ,
246 AC_CHECK_LIB(posix4, sched_setscheduler))
250 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
253 AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h)
254 # HMS: Lame, but fast.
255 if test -f /etc/redhat-release
259 AC_CHECK_HEADERS(md5.h)
261 AC_CHECK_HEADERS(memory.h netdb.h poll.h)
262 AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
263 AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
266 AC_CHECK_HEADERS(utmpx.h)
267 case "$ac_cv_header_utmpx_h" in
269 *) AC_CHECK_HEADERS(utmp.h) ;;
272 *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
274 AC_CHECK_HEADERS(arpa/nameser.h)
275 AC_CHECK_HEADERS(net/if.h, [], [],
276 [#if HAVE_SYS_SOCKET_H
277 #include <sys/socket.h>
280 AC_CHECK_HEADERS(net/if6.h)
281 AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
282 AC_CHECK_HEADERS(netinet/in.h)
283 AC_CHECK_HEADERS(netinet/ip.h, [], [],
284 [#if HAVE_SYS_TYPES_H
285 #include <sys/types.h>
287 #if HAVE_NETINET_IN_H
288 #include <netinet/in.h>
290 #if HAVE_NETINET_IN_SYSTM_H
291 #include <netinet/in_systm.h>
294 AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
295 AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
296 dnl AC_CHECK_HEADERS(sys/chudefs.h)
297 AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
300 *) AC_CHECK_HEADERS(sys/ioctl.h)
303 AC_CHECK_HEADERS(sys/ipc.h)
304 AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
305 AC_CHECK_HEADERS(sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h)
308 AC_CHECK_HEADERS(sys/sio.h)
311 AC_CHECK_HEADERS(sys/select.h sys/shm.h sys/signal.h sys/sockio.h)
312 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
313 AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
314 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
315 AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
317 [#include <sys/timepps.h>
318 #ifdef PPS_API_VERS_1
321 ], [AC_CHECK_HEADERS(sys/timepps.h)])
322 AC_CHECK_HEADERS(sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h)
326 AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
329 AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
333 AC_CHECK_HEADER(nlist.h,
334 [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
335 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
336 [AC_TRY_COMPILE([#include <nlist.h>],
337 [struct nlist n; n.n_un.n_name = 0;],
338 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
339 if test $ac_cv_struct_nlist_n_un = yes; then
340 AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
344 dnl AC_CHECK_HEADERS(net/if.h, [], [],
345 dnl [#if HAVE_SYS_TYPES_H
346 dnl # include <sys/types.h>
348 dnl #if HAVE_SYS_SOCKET_H
349 dnl # include <sys/socket.h>
353 AC_CHECK_HEADERS(resolv.h, [], [],
354 [#if HAVE_SYS_TYPES_H
355 #include <sys/types.h>
357 #if HAVE_NETINET_IN_H
358 #include <netinet/in.h>
360 #if HAVE_ARPA_NAMESER_H
361 #include <arpa/nameser.h>
365 AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
368 ac_cv_c_volatile=yes,
371 case "$ac_cv_c_volatile" in
374 *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
380 # Assume that solaris2 is Ansi C...
386 AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
388 extern int foo (short);
389 int foo(short i) { return i; }],[
390 int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
392 if test "$ac_cv_have_prototypes" = yes; then
393 AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
401 AC_CHECK_TYPE(time_t, long)
404 AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
405 [AC_TRY_COMPILE([#include <sys/types.h>],
406 [u_int8_t len = 42; return 0;],
407 ac_cv_type_u_int8_t=yes,
408 ac_cv_type_u_int8_t=no)
410 if test $ac_cv_type_u_int8_t = yes; then
411 AC_DEFINE(HAVE_TYPE_U_INT8_T,1,Does u_int8_t exist)
414 AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
415 [AC_TRY_COMPILE([#include <sys/types.h>],
416 [u_int64_t len = 42; return 0;],
417 ac_cv_type_u_int64_t=yes,
418 ac_cv_type_u_int64_t=no)
420 if test $ac_cv_type_u_int64_t = yes; then
421 AC_DEFINE(HAVE_TYPE_U_INT64_T,1,Does u_int64_t exist)
424 AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
425 [ac_cv_var_default_hz=100
427 alpha*-dec-osf4*|alpha*-dec-osf5*)
428 ac_cv_var_default_hz=1024
431 ac_cv_var_default_hz=256
434 AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
436 AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
437 [ac_cv_var_override_hz=no
439 alpha*-dec-osf4*|alpha*-dec-osf5*)
440 ac_cv_var_override_hz=yes
443 ac_cv_var_override_hz=yes
446 ac_cv_var_override_hz=yes
449 ac_cv_var_override_hz=yes
452 case "$ac_cv_var_override_hz" in
454 AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
458 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
459 dnl [AC_TRY_LINK([#include <sys/types.h>
460 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
461 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
462 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
463 dnl AC_DEFINE(HAVE_UT_HOST)
466 dnl AC_MSG_CHECKING(if we can get the system boot time)
467 dnl AC_CACHE_VAL(su_cv_have_boot_time,
468 dnl [AC_EGREP_CPP(yes,
469 dnl [#ifdef HAVE_UTMPX_H
470 dnl #include <utmpx.h>
472 dnl #include <utmp.h>
477 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
478 dnl AC_MSG_RESULT($su_cv_have_boot_time)
481 struct sigaction for sa_sigaction,
482 ac_cv_struct_sigaction_has_sa_sigaction,
485 [#include <signal.h>],
486 [struct sigaction act; act.sa_sigaction = 0;],
487 ac_cv_struct_sigaction_has_sa_sigaction=yes,
488 ac_cv_struct_sigaction_has_sa_sigaction=no
492 if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
493 AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
496 AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
498 #include <sys/types.h>
499 #ifdef HAVE_SYS_TERMIOS_H
500 # include <sys/termios.h>
502 #ifdef HAVE_SYS_TIME_H
503 # include <sys/time.h>
505 #ifdef HAVE_SYS_PPSCLOCK_H
506 # include <sys/ppsclock.h>
508 extern struct ppsclockev *pce;
509 return pce->serial;],
510 ac_cv_struct_ppsclockev=yes,
511 ac_cv_struct_ppsclockev=no)
513 if test $ac_cv_struct_ppsclockev = yes; then
514 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
517 AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
519 #include <sys/types.h>
520 #include <sys/socket.h>],[
521 extern struct sockaddr *ps;
523 ac_cv_struct_sockaddr_has_sa_len=yes,
524 ac_cv_struct_sockaddr_has_sa_len=no)
526 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
527 AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
530 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
531 ac_cv_have_ss_family_in_struct_ss, [
534 #include <sys/types.h>
535 #include <sys/socket.h>
537 [ struct sockaddr_storage s; s.ss_family = 1; ],
538 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
539 [ ac_cv_have_ss_family_in_struct_ss="no" ],
542 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
543 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
545 # Hack around a problem...
547 *-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
552 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
553 ac_cv_have___ss_family_in_struct_ss, [
556 #include <sys/types.h>
557 #include <sys/socket.h>
559 [ struct sockaddr_storage s; s.__ss_family = 1; ],
560 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
561 [ ac_cv_have___ss_family_in_struct_ss="no" ]
564 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
565 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
568 AH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
569 [/* Handle ss_family */
570 #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
571 # define ss_family __ss_family
572 # define ss_len __ss_len
573 #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
575 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
577 AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
579 #ifdef HAVE_MACHINE_SOUNDCARD_H
580 # include <machine/soundcard.h>
582 #ifdef HAVE_SYS_SOUNDCARD_H
583 # include <sys/soundcard.h>
585 extern struct snd_size *ss;
586 return ss->rec_size;],
587 ac_cv_struct_snd_size=yes,
588 ac_cv_struct_snd_size=no)
590 case "$ac_cv_struct_snd_size" in
591 yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
596 AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
598 #include <sys/time.h>],[
599 extern struct clockinfo *pc;
601 ac_cv_struct_clockinfo_has_hz=yes,
602 ac_cv_struct_clockinfo_has_hz=no)
604 if test $ac_cv_struct_clockinfo_has_hz = yes; then
605 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
608 AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
610 #include <sys/time.h>],[
611 extern struct clockinfo *pc;
612 return pc->tickadj;],
613 ac_cv_struct_clockinfo_has_tickadj=yes,
614 ac_cv_struct_clockinfo_has_tickadj=no)
616 if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
617 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
620 AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
622 #include <sys/time.h>
623 /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
627 #ifdef HAVE_SYS_TIMEPPS_H
628 # define FRAC 4294967296
629 # include <sys/timepps.h>
631 [struct timespec n;],
632 ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
633 if test $ac_cv_struct_timespec = yes; then
634 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
637 AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
639 #include <sys/time.h>
640 #include <sys/timex.h>],
641 [struct ntptimeval n;],
642 ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
643 if test $ac_cv_struct_ntptimeval = yes; then
644 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
647 AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
648 [#ifdef HAVE_SYS_TIME_H
649 #include <sys/time.h>
655 #ifdef HAVE_SYS_TIMEX_H
656 #include <sys/timex.h>
664 AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
665 AC_CHECK_SIZEOF(signed char)
667 AC_CHECK_SIZEOF(long)
669 AC_CHECK_TYPES([s_char])
670 case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
672 # We have a typedef for s_char. Might as well believe it...
675 # We have signed chars, can't say 'signed char', no s_char typedef.
676 AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
679 # We have signed chars, can say 'signed char', no s_char typedef.
680 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
683 # We have unsigned chars, can't say 'signed char', no s_char typedef.
684 AC_MSG_ERROR(No way to specify a signed character!)
687 # We have unsigned chars, can say 'signed char', no s_char typedef.
688 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
695 AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
700 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
701 # (returning ENOSYS). I didn't check 4.2. If, in the future,
702 # IBM pulls its thumbs out long enough to implement clock_settime,
703 # this conditional will need to change. Maybe use AC_TRY_RUN
704 # instead to try to set the time to itself and check errno.
706 *) AC_CHECK_FUNCS(clock_gettime clock_settime)
709 AC_CHECK_FUNCS(daemon)
710 AC_CHECK_FUNCS(finite, ,
711 [AC_CHECK_FUNCS(isfinite, ,
712 [AC_MSG_CHECKING(for isfinite with <math.h>)
715 AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
717 AC_DEFINE(HAVE_ISFINITE)],
720 AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage)
721 AC_CHECK_FUNC(gettimeofday, ,[
723 *-*-mpeix*) ac_cv_func_gettimeofday=yes
729 *) AC_CHECK_FUNCS(getuid)
732 AC_CHECK_FUNCS(hstrerror)
733 AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
734 AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
737 # Just stubs. Idiots.
739 *) AC_CHECK_FUNCS(mkstemp)
742 AC_CHECK_FUNCS(mktime)
745 # Just a stub. Idiots.
748 # Just a stub in "old" Irix. Idiots.
751 # Apparently there but not working in QNX. Idiots?
754 # Just a stub. Idiots.
756 alpha*-dec-osf4*|alpha*-dec-osf5*)
757 # mlockall is there, as a #define calling memlk via <sys/mman.h>
758 # Not easy to test for - cheat.
759 AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
760 AC_CHECK_FUNCS(mlockall)
762 *) AC_CHECK_FUNCS(mlockall)
765 AC_CHECK_FUNCS(mrand48 srand48 nice nlist)
770 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
773 AC_CHECK_FUNCS(plock pututline pututxline readlink rtprio)
774 case "$ac_cv_func_mrand48" in
776 *) AC_REPLACE_FUNCS(random) ;;
780 # Just a stub in AIX 4. Idiots.
783 # Just stubs in solaris2.5. Idiots.
785 *) AC_CHECK_FUNCS(sched_setscheduler)
788 AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
789 AC_CHECK_FUNCS(setrlimit)
790 AC_CHECK_FUNCS(settimeofday, ,[
792 *-*-mpeix*) ac_cv_func_settimeofday=yes
795 AC_CHECK_FUNCS(setvbuf sigaction)
796 AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
797 AC_CHECK_FUNCS(snprintf strdup strerror strstr)
798 AC_CHECK_FUNCS(timegm)
801 # Just stubs. Idiots.
804 # Just stubs. Idiots.
807 # Just stubs. Idiots.
810 # Just stubs. Idiots.
812 *) AC_CHECK_FUNCS(timer_create timer_settime)
819 *) AC_CHECK_FUNCS(umask)
822 AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
826 AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
830 AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
831 [AC_TRY_COMPILE([#include <sys/time.h>],[
832 gettimeofday((struct timeval*)0,(struct timezone*)0);
833 settimeofday((struct timeval*)0,(struct timezone*)0);
835 ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
837 if test $ac_cv_func_Xettimeofday_nargs = 1; then
838 AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
841 AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
843 #ifdef HAVE_SYS_TYPES_H
844 # include <sys/types.h>
850 ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
852 if test $ac_cv_func_setpgrp_nargs = 0; then
853 AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
857 CFLAGS="$CFLAGS -I$srcdir/include"
859 AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
860 ac_cv_func_qsort_argtype,
862 #include "l_stdlib.h"
864 #ifdef HAVE_PROTOTYPES
871 extern sortfunc P((const void *, const void *));
874 const void *b; { return 0; }
876 qsort(base, 2, sizeof(char *), sortfunc);
878 ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
880 case "$ac_cv_func_qsort_argtype" in
882 AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
888 AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
889 [AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
893 ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
894 case "$ac_cv_decl_errno" in
895 yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
898 dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
899 dnl the clash. <resolv.h> isn't currently used.
901 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
902 dnl MT purposes. This makes the line "extern int h_errno" choke
903 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
904 dnl without breaking any other platforms.
906 AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
907 [AC_TRY_COMPILE([#include <sys/types.h>
908 #ifdef HAVE_NETINET_IN_H
909 #include <netinet/in.h>
911 #ifdef HAVE_ARPA_NAMESER_H
912 #include <arpa/nameser.h>
920 [extern int h_errno;],
921 ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
922 case "$ac_cv_decl_h_errno" in
923 yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
926 dnl See if char *sys_errlist[] is OK.
927 AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
928 [AC_TRY_COMPILE([#include <stdio.h>
932 [extern char *sys_errlist[];
934 ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
935 case "$ac_cv_decl_sys_errlist" in
936 yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
939 AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
941 #ifdef HAVE_SYS_TYPES_H
942 # include <sys/types.h>
947 #ifdef HAVE_PROTOTYPES
953 [extern int syscall P((int, ...));],
954 ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
955 case "$ac_cv_decl_syscall" in
956 yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
961 AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style]) # Needed for XLC under AIX 4.3.2
964 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
965 AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
966 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
967 AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
968 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
969 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
970 AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
971 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
972 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
975 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
976 AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
979 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
982 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
983 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
984 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
985 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
986 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
987 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
988 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
989 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
990 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
991 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
992 AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
993 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
994 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
995 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
996 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
997 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1000 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1001 AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
1004 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1009 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1010 AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
1011 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1012 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1013 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1014 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1015 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1016 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1017 AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
1018 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1019 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1020 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1021 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1022 AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
1023 AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
1024 case "`basename $ac_cv_prog_CC`" in
1026 *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1029 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1030 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1031 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1032 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1033 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1034 AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
1035 AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
1038 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1039 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1040 AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
1041 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1042 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1043 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1044 AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
1045 AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
1046 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1047 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1048 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1049 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1050 AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
1051 AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
1052 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1053 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1059 AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
1063 AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
1070 ac_cv_var_rcvbuf_slop=$ans])
1071 case "$ac_cv_var_rcvbuf_slop" in
1072 yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
1075 AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
1082 ac_cv_var_open_bcast_socket=$ans])
1083 case "$ac_cv_var_open_bcast_socket" in
1084 yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
1087 AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
1094 ac_cv_var_hpux_findconfig=$ans])
1095 case "$ac_cv_var_hpux_findconfig" in
1096 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
1099 AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
1120 ac_cv_arg_setpgrp_negpid=$ans])
1121 case "$ac_cv_arg_setpgrp_negpid" in
1122 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
1125 AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
1145 ac_cv_func_ctty_for_f_setown=$ans])
1146 case "$ac_cv_func_ctty_for_f_setown" in
1147 yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
1151 AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
1152 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1155 ans='clock_settime()'
1158 ntp_warning='But clock_settime() would be better (if we had it)'
1159 ans='settimeofday()'
1162 ntp_warning='Which is the worst of the three'
1167 $host) ntp_warning='Which leaves us with nothing to use!'
1173 case "$ntp_warning" in
1175 *) AC_MSG_WARN(*** $ntp_warning ***)
1179 AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1187 ac_cv_var_syscall_bug=$ans])
1188 case "$ac_cv_var_syscall_bug" in
1189 yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1192 AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
1193 [ case "$ac_cv_header_sys_stropts_h" in
1196 # There must be a better way...
1204 ac_cv_var_streams_tli=$ans])
1205 case "$ac_cv_var_streams_tli" in
1207 AC_DEFINE(STREAMS_TLI, 1, [Do we have STREAMS/TLI? (Can we replace this with HAVE_SYS_STROPTS_H?)])
1211 AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1213 [#include <signal.h>
1217 ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1219 dnl Override those system that have a losing SIGIO
1220 AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1222 case "$ac_cv_hdr_def_sigio" in
1226 alpha*-dec-osf4*|alpha*-dec-osf5*)
1259 ac_cv_var_signalled_io=$ans])
1260 case "$ac_cv_var_signalled_io" in
1261 yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1264 AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1266 [#include <signal.h>
1270 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1272 AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1274 [#include <signal.h>
1278 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1280 AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1282 case "$ac_cv_hdr_def_sigpoll" in
1326 ac_cv_var_use_udp_sigpoll=$ans])
1327 case "$ac_cv_var_use_udp_sigpoll" in
1328 yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1331 AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1333 case "$ac_cv_hdr_def_sigpoll" in
1377 ac_cv_var_use_tty_sigpoll=$ans])
1378 case "$ac_cv_var_use_tty_sigpoll" in
1379 yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
1382 case "$ac_cv_header_sys_sio_h" in
1384 AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1386 [#include <sys/sio.h>
1387 #ifdef TIOCDCDTIMESTAMP
1390 ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1394 case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1396 ac_cv_var_oncore_ok=yes
1400 AC_CACHE_CHECK(if nlist() values might require extra indirection,
1401 ac_cv_var_nlist_extra_indirection,
1408 ac_cv_var_nlist_extra_indirection=$ans])
1409 case "$ac_cv_var_nlist_extra_indirection" in
1410 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
1413 AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1414 ac_cv_var_min_rec_tickadj,
1421 ac_cv_var_min_rec_tickadj=$ans])
1422 case "$ac_cv_var_min_rec_tickadj" in
1424 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
1427 AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1428 ac_cv_var_no_parenb_ignpar,
1437 i?86-*-freebsd[[123]].*)
1446 ac_cv_var_no_parenb_ignpar=$ans])
1447 case "$ac_cv_var_no_parenb_ignpar" in
1448 yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
1451 AC_MSG_CHECKING(if we're including debugging code)
1452 AC_ARG_ENABLE(debugging, [ --enable-debugging + include debugging code],
1453 [ntp_ok=$enableval], [ntp_ok=yes])
1454 if test "$ntp_ok" = "yes"; then
1455 AC_DEFINE(DEBUG, 1, [Enable debugging?])
1457 AC_MSG_RESULT($ntp_ok)
1459 AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1460 AC_ARG_ENABLE(dst_minutes, [ --enable-dst-minutes=60 + minutes per DST adjustment],
1461 [ans=$enableval], [ans=60])
1462 AC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
1465 AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1467 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1468 *yes*) ac_cv_var_tty_clk=yes ;;
1470 case "$ac_cv_var_tty_clk" in
1471 yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
1474 AC_CACHE_CHECK(for the ppsclock streams module,
1476 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1477 case "$ac_cv_var_ppsclock" in
1478 yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
1481 AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1484 i386-sequent-sysv4) ;;
1485 *) AC_EGREP_CPP(yes,
1486 [#include <netinet/in.h>
1487 #ifdef IP_ADD_MEMBERSHIP
1490 ], ac_cv_var_mcast=yes) ;;
1492 case "$ac_cv_var_mcast" in
1493 yes) AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?]) ;;
1496 AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1497 [ac_cv_var_ntp_syscalls=no
1498 case "$ac_cv_func___adjtimex" in
1500 ac_cv_var_ntp_syscalls=libc
1502 *) case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
1504 ac_cv_var_ntp_syscalls=libc
1506 *) AC_EGREP_CPP(yes,
1507 [#include <sys/syscall.h>
1508 #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1511 ], ac_cv_var_ntp_syscalls=kernel)
1516 case "$ac_cv_var_ntp_syscalls" in
1518 AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
1521 AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
1527 AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1529 [#include <sys/timex.h>
1533 ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
1535 AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
1536 [dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
1537 case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
1539 ac_cv_var_kernel_pll=no
1541 *) ac_cv_var_kernel_pll=yes
1544 case "$ac_cv_var_kernel_pll" in
1546 AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
1550 AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1563 ac_cv_var_size_returned_in_buffer=$ans])
1564 case "$ac_cv_var_size_returned_in_buffer" in
1565 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
1568 dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1569 dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
1570 dnl [ans=$enableval], [ans=no])
1571 dnl ac_cv_var_gdt_surveying=$ans])
1572 dnl case "$ac_cv_var_gdt_surveying" in
1573 dnl yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
1576 # Check for ioctls TIOCGPPSEV
1577 AC_MSG_CHECKING(ioctl TIOCGPPSEV)
1578 if test "$ac_cv_header_termios_h" = "yes"; then
1580 [#include <termios.h>
1584 ], ntp_ok=yes, ntp_ok=no)
1588 if test "$ntp_ok" = "yes"; then
1589 AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1590 ac_cv_var_oncore_ok=yes
1592 AC_MSG_RESULT($ntp_ok)
1594 # Check for ioctls TIOCSPPS
1595 AC_MSG_CHECKING(ioctl TIOCSPPS)
1596 if test "$ac_cv_header_termios_h" = "yes"; then
1598 [#include <termios.h>
1602 ], ntp_ok=yes, ntp_ok=no)
1607 if test "$ntp_ok" = "yes"; then
1608 AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
1610 AC_MSG_RESULT($ntp_ok)
1612 # Check for ioctls CIOGETEV
1613 AC_MSG_CHECKING(ioctl CIOGETEV)
1614 if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
1616 [#include <sys/ppsclock.h>
1620 ], ntp_ok=yes, ntp_ok=no)
1624 if test "$ntp_ok" = "yes"; then
1625 ac_cv_var_oncore_ok=yes
1626 AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1628 AC_MSG_RESULT($ntp_ok)
1631 # ATOM/PPSAPI stuff.
1633 # ATOM used to require struct timespec, but that's been fixed now.
1635 # case "$ac_cv_struct_timespec" in
1637 # ac_cv_var_atom_ok=yes
1640 ac_cv_var_atom_ok=yes
1642 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1644 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1646 # The PPSAPI needs ATOM
1648 # The PPSAPI needs struct timespec.
1650 case "$ac_cv_c_inline$ac_cv_struct_timespec$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h" in
1652 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1653 ac_cv_var_oncore_ok=yes
1654 ac_cv_var_ripe_ncc_ok=yes
1655 ac_cv_var_jupiter_ok=yes
1659 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1660 AC_CHECK_HEADER(linux/serial.h)
1661 AC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
1662 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1665 [#include <sys/time.h>
1668 #include <sys/ppsclock.h>
1669 #include <linux/serial.h>
1673 #ifdef ASYNC_PPS_CD_POS
1674 #ifdef ASYNC_PPS_CD_NEG
1688 if test "$ntp_ok" = "yes"; then
1689 AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
1691 AC_MSG_RESULT($ntp_ok)
1693 # Check for SHMEM_STATUS support
1694 AC_MSG_CHECKING(SHMEM_STATUS support)
1695 case "$ac_cv_header_sys_mman_h" in
1699 if test "$ntp_ok" = "yes"; then
1700 AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
1702 AC_MSG_RESULT($ntp_ok)
1704 dnl dnl These are for OPT_PROGRAMS in authstuff/
1705 dnl AC_SUBST(AUTHCERT)
1706 dnl AC_SUBST(AUTHSPEED)
1707 dnl AC_SUBST(MD5DRIVER)
1708 dnl AC_SUBST(KEYPARITY)
1709 dnl AC_SUBST(MAKEIPFP)
1710 dnl AC_SUBST(MAKEPC1)
1711 dnl AC_SUBST(MAKEPC2)
1712 dnl AC_SUBST(MAKESP)
1713 dnl AC_SUBST(MKRANDKEYS)
1714 dnl AC_SUBST(OMAKEIPFP)
1715 dnl AC_SUBST(UNIXCERT)
1719 # HPUX only, and by explicit request
1720 AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1721 AC_ARG_ENABLE(BANCOMM,
1722 AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
1723 [ntp_ok=$enableval], [ntp_ok=no])
1724 if test "$ntp_ok" = "yes"; then
1726 AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
1728 AC_MSG_RESULT($ntp_ok)
1729 case "$ntp_ok$host" in
1731 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1734 #HPUX only, and only by explicit request
1735 AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1736 AC_ARG_ENABLE(GPSVME,
1737 AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
1738 [ntp_ok=$enableval], [ntp_ok=no])
1739 if test "$ntp_ok" = "yes"; then
1741 AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
1743 AC_MSG_RESULT($ntp_ok)
1744 case "$ntp_ok$host" in
1746 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1749 AC_MSG_CHECKING(for PCL720 clock support)
1750 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1752 AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
1761 AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1762 AC_ARG_ENABLE(all-clocks,
1763 AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
1764 [ntp_eac=$enableval], [ntp_eac=yes])
1765 AC_MSG_RESULT($ntp_eac)
1767 AC_MSG_CHECKING(if we have support for PARSE clocks)
1768 case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1775 AC_MSG_RESULT($ntp_canparse)
1777 AC_MSG_CHECKING([if we have support for audio clocks])
1778 case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
1781 AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
1783 *) ntp_canaudio=no ;;
1785 AC_MSG_RESULT($ntp_canaudio)
1787 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1788 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1794 AC_MSG_RESULT($ntp_canshm)
1796 # Requires modem control
1797 AC_MSG_CHECKING(ACTS modem service)
1799 AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
1800 [ntp_ok=$enableval],
1802 [#include <termios.h>
1803 #ifdef HAVE_SYS_IOCTL_H
1804 #include <sys/ioctl.h>
1809 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1810 if test "$ntp_ok" = "yes"; then
1812 AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
1814 AC_MSG_RESULT($ntp_ok)
1816 AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1817 AC_ARG_ENABLE(ARBITER,
1818 AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
1819 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1820 if test "$ntp_ok" = "yes"; then
1822 AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
1824 AC_MSG_RESULT($ntp_ok)
1826 AC_MSG_CHECKING(Arcron MSF receiver)
1827 AC_ARG_ENABLE(ARCRON_MSF,
1828 AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
1829 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1830 if test "$ntp_ok" = "yes"; then
1832 AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
1834 AC_MSG_RESULT($ntp_ok)
1836 AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1837 AC_ARG_ENABLE(AS2201,
1838 AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
1839 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1840 if test "$ntp_ok" = "yes"; then
1842 AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
1844 AC_MSG_RESULT($ntp_ok)
1846 AC_MSG_CHECKING(ATOM PPS interface)
1848 AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
1849 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1850 case "$ac_cv_var_atom_ok" in
1853 if test "$ntp_ok" = "yes"; then
1855 AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
1857 AC_MSG_RESULT($ntp_ok)
1859 AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
1860 AC_ARG_ENABLE(CHRONOLOG,
1861 AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
1862 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1863 if test "$ntp_ok" = "yes"; then
1865 AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
1867 AC_MSG_RESULT($ntp_ok)
1869 AC_MSG_CHECKING(CHU modem/decoder)
1871 AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
1872 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1873 if test "$ntp_ok" = "yes"; then
1875 AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
1877 AC_MSG_RESULT($ntp_ok)
1878 ac_refclock_chu=$ntp_ok
1880 AC_MSG_CHECKING(CHU audio/decoder)
1881 AC_ARG_ENABLE(AUDIO-CHU,
1882 AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
1883 [ntp_ok=$enableval],
1884 [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
1888 if test "$ntp_ok" = "yes"; then
1889 AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
1891 AC_MSG_RESULT($ntp_ok)
1892 # We used to check for sunos/solaris target...
1893 case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
1894 yes*no*) AC_MSG_WARN(*** But the expected answer is...no ***) ;;
1898 AC_MSG_CHECKING(Datum Programmable Time System)
1899 AC_ARG_ENABLE(DATUM,
1900 AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
1901 [ntp_ok=$enableval],
1902 [case "$ac_cv_header_termios_h" in
1909 if test "$ntp_ok" = "yes"; then
1911 AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
1913 AC_MSG_RESULT($ntp_ok)
1915 AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
1916 AC_ARG_ENABLE(DUMBCLOCK,
1917 AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
1918 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1919 if test "$ntp_ok" = "yes"; then
1921 AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
1923 AC_MSG_RESULT($ntp_ok)
1925 AC_MSG_CHECKING(Forum Graphic GPS)
1927 AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
1928 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1929 if test "$ntp_ok" = "yes"; then
1931 AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
1933 AC_MSG_RESULT($ntp_ok)
1935 # Requires modem control
1936 AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1937 AC_ARG_ENABLE(HEATH,
1938 AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
1939 [ntp_ok=$enableval],
1941 [#include <termios.h>
1942 #ifdef HAVE_SYS_IOCTL_H
1943 #include <sys/ioctl.h>
1948 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1949 if test "$ntp_ok" = "yes"; then
1951 AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
1953 AC_MSG_RESULT($ntp_ok)
1955 AC_MSG_CHECKING(for hopf serial clock device)
1956 AC_ARG_ENABLE(HOPFSERIAL,
1957 AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
1958 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1959 if test "$ntp_ok" = "yes"; then
1961 AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
1963 AC_MSG_RESULT($ntp_ok)
1965 AC_MSG_CHECKING(for hopf PCI clock 6039)
1966 AC_ARG_ENABLE(HOPFPCI,
1967 AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
1968 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1969 if test "$ntp_ok" = "yes"; then
1971 AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
1973 AC_MSG_RESULT($ntp_ok)
1975 AC_MSG_CHECKING(HP 58503A GPS receiver)
1976 AC_ARG_ENABLE(HPGPS,
1977 AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
1978 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1979 if test "$ntp_ok" = "yes"; then
1981 AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
1983 AC_MSG_RESULT($ntp_ok)
1985 AC_MSG_CHECKING(IRIG audio decoder)
1987 AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
1988 [ntp_ok=$enableval],
1989 [case "$ntp_eac$ntp_canaudio" in
1993 if test "$ntp_ok" = "yes"; then
1995 AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
1997 AC_MSG_RESULT($ntp_ok)
1998 case "$ntp_ok$ntp_canaudio" in
1999 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2002 AC_MSG_CHECKING(for JJY receiver)
2004 AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
2005 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2006 if test "$ntp_ok" = "yes"; then
2008 AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
2010 AC_MSG_RESULT($ntp_ok)
2012 AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
2013 AC_ARG_ENABLE(JUPITER,
2014 AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
2015 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2016 case "$ac_cv_var_jupiter_ok" in
2019 if test "$ntp_ok" = "yes"; then
2021 AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
2023 AC_MSG_RESULT($ntp_ok)
2025 AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
2026 AC_ARG_ENABLE(LEITCH,
2027 AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
2028 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2029 if test "$ntp_ok" = "yes"; then
2031 AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
2033 AC_MSG_RESULT($ntp_ok)
2035 AC_MSG_CHECKING(local clock reference)
2036 AC_ARG_ENABLE(LOCAL-CLOCK,
2037 AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
2038 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2039 if test "$ntp_ok" = "yes"; then
2041 AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
2043 AC_MSG_RESULT($ntp_ok)
2045 AC_MSG_CHECKING(EES M201 MSF receiver)
2046 AC_ARG_ENABLE(MSFEES,
2047 AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
2048 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2049 if test "$ntp_ok" = "yes"; then
2051 AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
2053 AC_MSG_RESULT($ntp_ok)
2056 AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
2057 AC_ARG_ENABLE(MX4200,
2058 AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
2059 [ntp_ok=$enableval],
2060 [case "$ac_cv_var_ppsclock" in
2061 yes) ntp_ok=$ntp_eac
2066 if test "$ntp_ok" = "yes"; then
2068 AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
2070 AC_MSG_RESULT($ntp_ok)
2071 case "$ntp_ok$host" in
2072 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2075 AC_MSG_CHECKING(for NeoClock4X receiver)
2076 AC_ARG_ENABLE(NEOCLOCK4X,
2077 AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
2078 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2079 if test "$ntp_ok" = "yes"; then
2081 AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
2083 AC_MSG_RESULT($ntp_ok)
2085 AC_MSG_CHECKING(NMEA GPS receiver)
2087 AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
2088 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2089 if test "$ntp_ok" = "yes"; then
2091 AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
2093 AC_MSG_RESULT($ntp_ok)
2095 AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
2096 AC_ARG_ENABLE(ONCORE,
2097 AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
2098 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2099 case "$ac_cv_var_oncore_ok" in
2102 if test "$ntp_ok" = "yes"; then
2104 AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
2106 AC_MSG_RESULT($ntp_ok)
2108 AC_MSG_CHECKING(for Palisade clock)
2109 AC_ARG_ENABLE(PALISADE,
2110 AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
2111 [ntp_ok=$enableval],
2112 [case "$ac_cv_header_termios_h" in
2120 if test "$ntp_ok" = "yes"; then
2122 AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
2124 AC_MSG_RESULT($ntp_ok)
2126 AC_MSG_CHECKING(Conrad parallel port radio clock)
2128 AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
2129 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2130 if test "$ntp_ok" = "yes"; then
2132 AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
2134 AC_MSG_RESULT($ntp_ok)
2136 AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
2138 AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
2139 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2140 if test "$ntp_ok" = "yes"; then
2142 AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
2144 AC_MSG_RESULT($ntp_ok)
2146 # Requires modem control
2147 AC_MSG_CHECKING(PTB modem service)
2148 AC_ARG_ENABLE(PTBACTS,
2149 AC_HELP_STRING([--enable-PTBACTS], [s PTB modem service]),
2150 [ntp_ok=$enableval],
2152 [#include <termios.h>
2153 #ifdef HAVE_SYS_IOCTL_H
2154 #include <sys/ioctl.h>
2159 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2160 if test "$ntp_ok" = "yes"; then
2162 AC_DEFINE(CLOCK_PTBACTS, 1, [PTB modem service])
2164 AC_MSG_RESULT($ntp_ok)
2166 AC_MSG_CHECKING(RIPENCC specific Trimble driver)
2167 AC_ARG_ENABLE(RIPENCC,
2168 AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
2169 [ntp_ok=$enableval], [ntp_ok=no])
2170 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2171 case "$ac_cv_var_ripe_ncc_ok" in
2174 if test "$ntp_ok" = "yes"; then
2176 AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
2178 AC_MSG_RESULT($ntp_ok)
2180 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2181 # For *IX, we need sys/ipc.h and sys/shm.h.
2182 AC_MSG_CHECKING(for SHM clock attached thru shared memory)
2184 AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
2185 [ntp_ok=$enableval],
2186 [case "$ntp_eac$ntp_canshm" in
2190 if test "$ntp_ok" = "yes"; then
2192 AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
2194 AC_MSG_RESULT($ntp_ok)
2196 AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
2197 AC_ARG_ENABLE(SPECTRACOM,
2198 AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
2199 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2200 if test "$ntp_ok" = "yes"; then
2202 AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
2204 AC_MSG_RESULT($ntp_ok)
2206 AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
2208 AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
2209 [ntp_ok=$enableval],
2210 [case "$ac_cv_header_sys_tpro_h" in
2217 if test "$ntp_ok" = "yes"; then
2219 AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2221 AC_MSG_RESULT($ntp_ok)
2222 case "$ntp_ok$ac_cv_header_sys_tpro" in
2223 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2226 AC_MSG_CHECKING(TRAK 8810 GPS receiver)
2228 AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
2229 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2230 if test "$ntp_ok" = "yes"; then
2232 AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
2234 AC_MSG_RESULT($ntp_ok)
2236 # Not on a vax-dec-bsd
2237 AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
2238 AC_ARG_ENABLE(TRUETIME,
2239 AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
2240 [ntp_ok=$enableval],
2249 if test "$ntp_ok" = "yes"; then
2251 AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
2253 AC_MSG_RESULT($ntp_ok)
2254 case "$ntp_ok$host" in
2255 yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2258 AC_MSG_CHECKING(TrueTime 560 IRIG-B decoder)
2259 AC_ARG_ENABLE(TT560,
2260 AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
2261 [ntp_ok=$enableval], [ntp_ok=no])
2262 if test "$ntp_ok" = "yes"; then
2264 AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
2266 AC_MSG_RESULT($ntp_ok)
2268 AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
2269 AC_ARG_ENABLE(ULINK,
2270 AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
2271 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2272 if test "$ntp_ok" = "yes"; then
2274 AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
2276 AC_MSG_RESULT($ntp_ok)
2278 # Requires modem control
2279 AC_MSG_CHECKING(USNO modem service)
2281 AC_HELP_STRING([--enable-USNO], [s USNO modem service]),
2282 [ntp_ok=$enableval],
2284 [#include <termios.h>
2285 #ifdef HAVE_SYS_IOCTL_H
2286 #include <sys/ioctl.h>
2291 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2292 if test "$ntp_ok" = "yes"; then
2294 AC_DEFINE(CLOCK_USNO, 1, [USNO modem service])
2296 AC_MSG_RESULT($ntp_ok)
2298 AC_MSG_CHECKING(WWV receiver)
2300 AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2301 [ntp_ok=$enableval],
2302 [case "$ntp_eac$ntp_canaudio" in
2306 if test "$ntp_ok" = "yes"; then
2308 AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2310 AC_MSG_RESULT($ntp_ok)
2311 case "$ntp_ok$ntp_canaudio" in
2312 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2315 AC_MSG_CHECKING(for Zyfer receiver)
2316 AC_ARG_ENABLE(ZYFER,
2317 AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
2318 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2319 if test "$ntp_ok" = "yes"; then
2321 AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
2323 AC_MSG_RESULT($ntp_ok)
2325 AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
2326 AC_ARG_ENABLE(parse-clocks, [ --enable-parse-clocks - include all suitable PARSE clocks:],
2327 [ntp_eapc=$enableval],
2329 yes) ntp_eapc=$ntp_canparse ;;
2333 AC_MSG_RESULT($ntp_eapc)
2335 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2337 AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
2340 AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
2349 AC_MSG_CHECKING(Diem Computime Radio Clock)
2350 AC_ARG_ENABLE(COMPUTIME,
2351 AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
2352 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2353 if test "$ntp_ok" = "yes"; then
2356 AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
2358 AC_MSG_RESULT($ntp_ok)
2359 case "$ntp_ok$ntp_canparse" in
2361 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2365 AC_MSG_CHECKING(ELV/DCF7000 clock)
2366 AC_ARG_ENABLE(DCF7000,
2367 AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
2368 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2369 if test "$ntp_ok" = "yes"; then
2372 AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
2374 AC_MSG_RESULT($ntp_ok)
2375 case "$ntp_ok$ntp_canparse" in
2377 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2381 AC_MSG_CHECKING(HOPF 6021 clock)
2382 AC_ARG_ENABLE(HOPF6021,
2383 AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
2384 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2385 if test "$ntp_ok" = "yes"; then
2388 AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
2390 AC_MSG_RESULT($ntp_ok)
2391 case "$ntp_ok$ntp_canparse" in
2393 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2397 AC_MSG_CHECKING(Meinberg clocks)
2398 AC_ARG_ENABLE(MEINBERG,
2399 AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
2400 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2401 if test "$ntp_ok" = "yes"; then
2404 AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
2406 AC_MSG_RESULT($ntp_ok)
2407 case "$ntp_ok$ntp_canparse" in
2409 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2413 AC_MSG_CHECKING(DCF77 raw time code)
2414 AC_ARG_ENABLE(RAWDCF,
2415 AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
2416 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2417 if test "$ntp_ok" = "yes"; then
2422 AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
2424 AC_MSG_RESULT($ntp_ok)
2425 case "$ntp_ok$ntp_canparse" in
2427 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2431 case "$ntp_rawdcf" in
2433 AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2434 ac_cv_var_rawdcf_parity,
2441 ac_cv_var_rawdcf_parity=$ans])
2442 case "$ac_cv_var_rawdcf_parity" in
2443 yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
2447 *) # HMS: Is this a good idea?
2448 ac_cv_var_rawdcf_parity=no
2452 AC_MSG_CHECKING(RCC 8000 clock)
2453 AC_ARG_ENABLE(RCC8000,
2454 AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
2455 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2456 if test "$ntp_ok" = "yes"; then
2459 AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
2461 AC_MSG_RESULT($ntp_ok)
2462 case "$ntp_ok$ntp_canparse" in
2464 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2468 AC_MSG_CHECKING(Schmid DCF77 clock)
2469 AC_ARG_ENABLE(SCHMID,
2470 AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
2471 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2472 if test "$ntp_ok" = "yes"; then
2475 AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
2477 AC_MSG_RESULT($ntp_ok)
2478 case "$ntp_ok$ntp_canparse" in
2480 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2484 AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2485 AC_ARG_ENABLE(TRIMTAIP,
2486 AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
2487 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2488 if test "$ntp_ok" = "yes"; then
2491 AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
2493 AC_MSG_RESULT($ntp_ok)
2494 case "$ntp_ok$ntp_canparse" in
2496 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2500 AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2501 AC_ARG_ENABLE(TRIMTSIP,
2502 AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
2503 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2504 if test "$ntp_ok" = "yes"; then
2507 AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
2509 AC_MSG_RESULT($ntp_ok)
2510 case "$ntp_ok$ntp_canparse" in
2512 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2516 AC_MSG_CHECKING(WHARTON 400A Series clock)
2517 AC_ARG_ENABLE(WHARTON,
2518 AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
2519 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2520 if test "$ntp_ok" = "yes"; then
2523 AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
2525 AC_MSG_RESULT($ntp_ok)
2526 case "$ntp_ok$ntp_canparse" in
2528 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2532 AC_MSG_CHECKING(VARITEXT clock)
2533 AC_ARG_ENABLE(VARITEXT,
2534 AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
2535 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2536 if test "$ntp_ok" = "yes"; then
2539 AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
2541 AC_MSG_RESULT($ntp_ok)
2542 case "$ntp_ok$ntp_canparse" in
2544 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2548 AC_SUBST(MAKE_LIBPARSE)
2549 AC_SUBST(MAKE_LIBPARSE_KERNEL)
2550 AC_SUBST(MAKE_CHECK_Y2K)
2551 AC_MSG_CHECKING(if we need to make and use the parse libraries)
2553 case "$ntp_libparse" in
2556 AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
2557 LIBPARSE=../libparse/libparse.a
2558 MAKE_LIBPARSE=libparse.a
2559 MAKE_CHECK_Y2K=check_y2k
2560 AC_DEFINE(PPS_SAMPLE, 1, [PPS auxiliary interface for ATOM?])
2561 AC_DEFINE(CLOCK_ATOM)
2570 # AC_SUBST(LIBRSAREF)
2571 # AC_SUBST(MAKE_LIBRSAREF)
2574 AC_SUBST(OPENSSL_INC)
2575 AC_SUBST(OPENSSL_LIB)
2577 AC_SUBST(MAKE_NTP_KEYGEN)
2579 AC_MSG_CHECKING(for openssl library directory)
2580 AC_ARG_WITH(openssl-libdir,
2581 AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
2582 [ans=$withval], [ans=yes])
2586 ans="/usr/lib /usr/lib/openssl /usr/local/lib /usr/local/ssl/lib"
2588 *) # Look where they said
2593 *) # Look for libcrypto.a and libssl.a:
2598 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
2601 test -f $i/libcrypto.a -a -f $i/libssl.a && break
2618 AC_MSG_CHECKING(for openssl include directory)
2619 AC_ARG_WITH(openssl-incdir,
2620 AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
2621 [ans=$withval], [ans=yes])
2625 ans="/usr/include /usr/local/include /usr/local/ssl/include"
2627 *) # Look where they said
2632 *) # look for openssl/opensslconf.h:
2635 test -f $i/openssl/opensslconf.h && break
2651 AC_HELP_STRING([--with-crypto], [+ =openssl]),
2652 [ans=$withval], [ans=yes])
2656 if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
2660 # We have OpenSSL inc/lib - use them.
2662 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
2663 LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
2664 AC_SUBST(LCRYPTO, [-lcrypto])
2665 MAKE_NTP_KEYGEN=ntp-keygen
2666 AC_DEFINE(OPENSSL, , [Use OpenSSL?])
2667 AC_CHECK_FUNCS(EVP_md2 EVP_mdc2)
2671 AC_MSG_CHECKING(for the level of crypto support)
2674 AC_MSG_CHECKING(if we want to compile with ElectricFence)
2675 AC_ARG_WITH(electricfence,
2676 AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
2677 [ans=$withval], [ans=no])
2681 LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
2682 EF_PROGS="eftest tstheap"
2691 AC_MSG_CHECKING(if we want to try SNTP)
2693 AC_HELP_STRING([--with-sntp], [- Build SNTP?]),
2694 [ans=$withval], [ans=no])
2708 AC_MSG_CHECKING(if we can make dcf parse utilities)
2710 if test "$ntp_parseutil" = "yes"; then
2712 *-*-sunos4*|*-*-solaris2*|*-*-linux*)
2721 AC_SUBST(MAKE_PARSEKMODULE)
2722 AC_MSG_CHECKING(if we can build kernel streams modules for parse)
2724 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
2728 case "$ac_cv_var_kernel_pll" in
2730 AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
2734 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
2738 MAKE_PARSEKMODULE=parse
2745 AC_MSG_CHECKING(if we need basic refclock support)
2746 if test "$ntp_refclock" = "yes"; then
2747 AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
2749 AC_MSG_RESULT($ntp_refclock)
2751 dnl Things that can be made in clockstuff/
2752 AC_SUBST(PROPDELAY) dnl Set to "propdelay"
2753 AC_SUBST(CHUTEST) dnl Set to "chutest"
2754 AC_SUBST(CLKTEST) dnl Set to "clktest"
2756 AC_SUBST(MAKE_ADJTIMED)
2757 AC_MSG_CHECKING(if we want HP-UX adjtimed support)
2765 if test "$ans" = "yes"; then
2766 MAKE_ADJTIMED=adjtimed
2767 AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
2771 AC_MSG_CHECKING(if we want QNX adjtime support)
2779 if test "$ans" = "yes"; then
2780 AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
2784 AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
2785 [AC_ARG_ENABLE(kmem, [ --enable-kmem s read /dev/kmem for tick and/or tickadj],
2787 [case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
2798 *-*-domainos) # Won't be found...
2818 ac_cv_var_can_kmem=$ans])
2820 case "$ac_cv_var_can_kmem" in
2822 *) AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?]) ;;
2825 AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
2826 [AC_ARG_ENABLE(accurate-adjtime, [ --enable-accurate-adjtime
2827 s the adjtime() call is accurate],
2836 mips-sgi-irix[[456]]*)
2848 *-*-solaris2.[[01]])
2861 ac_cv_var_adjtime_is_accurate=$ans])
2862 case "$ac_cv_var_adjtime_is_accurate" in
2863 yes) AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?]) ;;
2866 AC_CACHE_CHECK([the name of 'tick' in the kernel],
2867 ac_cv_var_nlist_tick,
2870 m68*-hp-hpux*) # HP9000/300?
2898 ac_cv_var_nlist_tick=$ans])
2899 case "$ac_cv_var_nlist_tick" in
2900 ''|no) ;; # HMS: I think we can only get 'no' here...
2901 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
2904 AC_CACHE_CHECK([for the units of 'tick'],
2905 ac_cv_var_tick_nano,
2912 ac_cv_var_tick_nano=$ans])
2913 case "$ac_cv_var_tick_nano" in
2915 AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
2919 AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
2920 ac_cv_var_nlist_tickadj,
2923 m68*-hp-hpux*) # HP9000/300?
2954 ans=no # hrestime_adj
2960 ac_cv_var_nlist_tickadj=$ans])
2961 case "$ac_cv_var_nlist_tickadj" in
2962 ''|no) ;; # HMS: I think we can only get 'no' here...
2963 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
2966 AC_CACHE_CHECK([for the units of 'tickadj'],
2967 ac_cv_var_tickadj_nano,
2974 ac_cv_var_tickadj_nano=$ans])
2975 case "$ac_cv_var_tickadj_nano" in
2977 AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
2981 AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
2982 ac_cv_var_nlist_dosynctodr,
3021 ac_cv_var_nlist_dosynctodr=$ans])
3022 case "$ac_cv_var_nlist_dosynctodr" in
3024 *) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
3028 AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
3029 ac_cv_var_nlist_noprintf,
3062 ac_cv_var_nlist_noprintf=$ans])
3063 case "$ac_cv_var_nlist_noprintf" in
3065 *) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
3069 dnl The tick/tickadj sections were written by Skippy, who never learned
3070 dnl that it's impolite (horridly gross) to show your guts in public.
3073 dnl 10000 80 Unixware
3074 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3075 dnl 10000 150 sgi IRIX
3076 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3077 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3078 dnl 1000000L/hz 500/HZ other && NOKMEM
3079 dnl txc.tick 1 Linux
3080 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3081 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3082 dnl (RS6000 && !NOKMEM), SINIX MIPS
3084 dnl But we'll only use these "values" if we can't find anything else.
3086 AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
3087 [AC_ARG_ENABLE(tick, [ --enable-tick=VALUE s force a value for 'tick'],
3115 ac_cv_var_tick=$ans])
3116 case "$ac_cv_var_tick" in
3117 ''|no) ;; # HMS: I think we can only get 'no' here...
3118 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick, [Preset a value for 'tick'?]) ;;
3121 AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
3122 [AC_ARG_ENABLE(tickadj, [ --enable-tickadj=VALUE s force a value for 'tickadj'],
3127 case "$ac_cv_var_adjtime_is_accurate" in
3128 yes) ans='tick/16' ;;
3138 case "$ac_cv_var_can_kmem" in
3142 *-*-domainos) # Skippy: won't be found...
3143 case "$ac_cv_var_can_kmem" in
3148 case "$ac_cv_var_adjtime_is_accurate" in
3149 yes) ans='tick/16' ;;
3162 case "$ac_cv_var_adjtime_is_accurate" in
3175 ac_cv_var_tickadj=$ans])
3176 case "$ac_cv_var_tickadj" in
3177 ''|no) ;; # HMS: I think we can only get 'no' here...
3178 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj, [Preset a value for 'tickadj'?]) ;;
3181 # Newer versions of ReliantUNIX round adjtime() values down to
3182 # 1/100s (system tick). Sigh ...
3183 # Unfortunately, there is no easy way to know if particular release
3184 # has this "feature" or any obvious way to test for it.
3186 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
3190 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
3193 ac_cv_make_tickadj=yes
3194 case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
3195 nonono) # Don't read KMEM, no presets. Bogus.
3196 AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.)
3197 ac_cv_make_tickadj=no
3199 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3200 AC_MSG_WARN(Can't read kmem but no PRESET_TICK. No tickadj.)
3201 ac_cv_make_tickadj=no
3203 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3204 AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ. No tickadj.)
3205 ac_cv_make_tickadj=no
3207 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3209 yesnono) # Read KMEM, no presets. Cool.
3211 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3212 AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.)
3214 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3216 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3218 *) # Generally bogus.
3219 AC_MSG_ERROR(This shouldn't happen.)
3223 AC_SUBST(MAKE_NTPTIME)
3224 AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
3226 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
3236 ac_cv_make_ntptime=$ans])
3237 case "$ac_cv_make_ntptime" in
3239 MAKE_NTPTIME=ntptime
3243 AC_SUBST(MAKE_TICKADJ)
3246 # tickadj is pretty useless on newer versions of ReliantUNIX
3248 ac_cv_make_tickadj=no
3251 ac_cv_make_tickadj=no
3254 # DLM says tickadj is a no-no starting with solaris2.5
3256 *-*-solaris2.1[[0-9]]*)
3257 ac_cv_make_tickadj=no
3259 *-*-solaris2.[[0-4]]*) ;;
3260 *) ac_cv_make_tickadj=no ;;
3264 ac_cv_make_tickadj=no
3267 AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
3268 ac_cv_make_tickadj=yes)
3269 case "$ac_cv_make_tickadj" in
3271 MAKE_TICKADJ=tickadj
3275 AC_SUBST(MAKE_TIMETRIM)
3276 AC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
3279 ac_cv_make_timetrim=yes
3282 ac_cv_make_timetrim=yes
3285 ac_cv_make_timetrim=no
3288 case "$ac_cv_make_timetrim" in
3290 MAKE_TIMETRIM=timetrim
3294 AC_SUBST(MAKE_LIBNTPSIM)
3295 AC_SUBST(MAKE_NTPDSIM)
3296 AC_CACHE_CHECK([if we want to build the NTPD simulator], ac_cv_var_ntpd_sim,
3297 [AC_ARG_ENABLE(simulator,
3298 AC_HELP_STRING([--enable-simulator], [- build/install the NTPD simulator?]),
3299 [ans=$enableval], [ans=no])
3300 ac_cv_var_ntpd_sim=$ans])
3301 case "$ac_cv_var_ntpd_sim" in
3303 MAKE_NTPDSIM=ntpdsim
3304 MAKE_LIBNTPSIM=libntpsim.a
3308 AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
3309 [AC_ARG_ENABLE(udp-wildcard, [ --enable-udp-wildcard s use UDP wildcard delivery],
3362 ac_cv_var_udp_wildcard_delivery=$ans])
3363 case "$ac_cv_var_udp_wildcard_delivery" in
3364 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY, 1, [use UDP Wildcard Delivery?]) ;;
3372 LDFLAGS="$LDFLAGS -r"
3378 AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3379 [AC_ARG_ENABLE(slew-always, [ --enable-slew-always s always slew the time],
3391 *-*-openvms*) # HMS: won't be found
3398 ac_cv_var_slew_always=$ans])
3399 case "$ac_cv_var_slew_always" in
3400 yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
3403 AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3404 [AC_ARG_ENABLE(step-slew, [ --enable-step-slew s step and slew the time],
3416 *-*-solaris2.1[[0-9]]*)
3419 *-*-solaris2.[[012]]*)
3422 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
3429 ac_cv_var_step_slew=$ans])
3430 case "$ac_cv_var_step_slew" in
3431 yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
3434 AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3435 [AC_ARG_ENABLE(ntpdate-step, [ --enable-ntpdate-step s if ntpdate should step the time],
3445 ac_cv_var_ntpdate_step=$ans])
3446 case "$ac_cv_var_ntpdate_step" in
3447 yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
3450 AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3451 [AC_ARG_ENABLE(hourly-todr-sync, [ --enable-hourly-todr-sync
3452 s if we should sync TODR hourly],
3458 *-*-openvms*) # HMS: won't be found
3464 ac_cv_var_sync_todr=$ans])
3465 case "$ac_cv_var_sync_todr" in
3466 yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
3469 AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3470 [AC_ARG_ENABLE(kernel-fll-bug, [ --enable-kernel-fll-bug s if we should avoid a kernel FLL bug],
3483 # Generic_105181-17 and higher
3503 # Generic_106541-07 and higher
3517 ac_cv_var_kernel_fll_bug=$ans])
3518 case "$ac_cv_var_kernel_fll_bug" in
3519 yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
3522 AC_CACHE_CHECK(if we should use the IRIG sawtooth filter, ac_cv_var_irig_sucks,
3523 [AC_ARG_ENABLE(irig-sawtooth,
3524 AC_HELP_STRING([--enable-irig-sawtooth], [s if we should enable the IRIG sawtooth filter]),
3527 *-*-solaris2.[[89]])
3530 *-*-solaris2.1[[0-9]]*)
3537 ac_cv_var_irig_sucks=$ans])
3538 case "$ac_cv_var_irig_sucks" in
3539 yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
3542 AC_CACHE_CHECK(if we should enable NIST lockclock scheme, ac_cv_var_nist_lockclock,
3543 [AC_ARG_ENABLE(nist,
3544 AC_HELP_STRING([--enable-nist], [- if we should enable the NIST lockclock scheme]),
3545 [ans=$enableval],[ans=no])
3546 ac_cv_var_nist_lockclock=$ans])
3547 case "$ac_cv_var_nist_lockclock" in
3548 yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
3555 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
3556 AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[ISC: struct sockaddr as sa_len?])
3559 AC_MSG_CHECKING(for IPv6 structures)
3561 #include <sys/types.h>
3562 #include <sys/socket.h>
3563 #include <netinet/in.h>],
3564 [struct sockaddr_in6 sin6; return (0);],
3570 AC_MSG_CHECKING([for struct if_laddrconf])
3572 #include <sys/types.h>
3573 #include <net/if6.h>
3574 ],[ struct if_laddrconf a; ],
3576 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, ,
3577 [ISC: have struct if_laddrconf?])],
3578 [AC_MSG_RESULT(no)])
3580 AC_MSG_CHECKING([for struct if_laddrreq])
3582 #include <sys/types.h>
3583 #include <net/if6.h>
3584 ],[ struct if_laddrreq a; ],
3586 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, ,
3587 [ISC: have struct if_laddrreq?])],
3588 [AC_MSG_RESULT(no)])
3590 case "$found_ipv6" in
3592 AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[ISC: Have IPv6?])
3593 AC_DEFINE(WANT_IPV6, ,[ISC: Want IPv6?])
3595 AC_MSG_CHECKING(for in6_pktinfo)
3597 #include <sys/types.h>
3598 #include <sys/socket.h>
3599 #include <netinet/in.h>
3600 $isc_netinetin6_hack
3601 $isc_netinet6in6_hack
3603 [struct in6_pktinfo xyzzy; return (0);],
3605 AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, ,
3606 [ISC: Have struct in6_pktinfo?])],
3607 [AC_MSG_RESULT(no -- disabling runtime ipv6 support)])
3609 AC_MSG_CHECKING(for in6addr_any)
3611 #include <sys/types.h>
3612 #include <sys/socket.h>
3613 #include <netinet/in.h>
3614 $isc_netinetin6_hack
3615 $isc_netinet6in6_hack
3618 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
3619 [AC_MSG_RESULT(yes)],
3621 AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, ,
3622 [ISC: Need in6addr_any?])]
3628 # Look for a sysctl call to get the list of network interfaces.
3630 AC_MSG_CHECKING(for interface list sysctl)
3631 AC_EGREP_CPP(found_rt_iflist, [
3632 #include <sys/param.h>
3633 #include <sys/sysctl.h>
3634 #include <sys/socket.h>
3635 #ifdef NET_RT_IFLIST
3640 AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[ISC: Use iflist_sysctl?])],
3641 [AC_MSG_RESULT(no)])
3648 LDFLAGS="$LDFLAGS -r"
3654 AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
3657 if test -d $srcdir/arlib
3660 AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
3661 [ans=$withval], [ans=no])
3666 AC_CONFIG_SUBDIRS(arlib)
3671 AC_CONFIG_FILES(Makefile)
3672 AC_CONFIG_FILES(ElectricFence/Makefile)
3673 AC_CONFIG_FILES(adjtimed/Makefile)
3674 AC_CONFIG_FILES(clockstuff/Makefile)
3675 AC_CONFIG_FILES(include/Makefile)
3676 AC_CONFIG_FILES(include/isc/Makefile)
3677 AC_CONFIG_FILES(kernel/Makefile)
3678 AC_CONFIG_FILES(kernel/sys/Makefile)
3679 AC_CONFIG_FILES(libntp/Makefile)
3680 AC_CONFIG_FILES(libparse/Makefile)
3681 AC_CONFIG_FILES(ntpd/Makefile)
3682 AC_CONFIG_FILES(ntpdate/Makefile)
3683 AC_CONFIG_FILES(ntpdc/Makefile)
3684 AC_CONFIG_FILES(ntpdc/nl.pl, [chmod +x ntpdc/nl.pl])
3685 AC_CONFIG_FILES(ntpq/Makefile)
3686 AC_CONFIG_FILES(parseutil/Makefile)
3687 AC_CONFIG_FILES(scripts/Makefile)
3688 AC_CONFIG_FILES(scripts/calc_tickadj, [chmod +x scripts/calc_tickadj])
3689 AC_CONFIG_FILES(scripts/checktime, [chmod +x scripts/checktime])
3690 AC_CONFIG_FILES(scripts/freq_adj, [chmod +x scripts/freq_adj])
3691 AC_CONFIG_FILES(scripts/mkver, [chmod +x scripts/mkver])
3692 AC_CONFIG_FILES(scripts/ntp-wait, [chmod +x scripts/ntp-wait])
3693 AC_CONFIG_FILES(scripts/ntpsweep, [chmod +x scripts/ntpsweep])
3694 AC_CONFIG_FILES(scripts/ntptrace, [chmod +x scripts/ntptrace])
3695 AC_CONFIG_FILES(scripts/ntpver, [chmod +x scripts/ntpver])
3696 AC_CONFIG_FILES(scripts/plot_summary, [chmod +x scripts/plot_summary])
3697 AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary])
3698 AC_CONFIG_FILES(util/Makefile)
3700 case "$MAKE_SNTP" in
3703 AC_CONFIG_SUBDIRS(sntp)