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.1.0)
11 ac_cv_var_oncore_ok=no
14 dnl Grab any initial CFLAGS so we can pick better defaults.
17 dnl we need to check for cross compile tools for vxWorks here
24 CFLAGS="$CFLAGS -DSYS_CYGWIN32"
29 CFLAGS="$CFLAGS -Wc,+Abi-socket"
36 CFLAGS="$CFLAGS -std1"
47 # Quick and dirty sanity check
49 '') AC_MSG_ERROR(Please follow the directions in html/vxworks.html!)
52 CFLAGS="$CFLAGS -DSYS_VXWORKS"
58 dnl we need to check for cross compile tools for vxWorks here
66 CFLAGS="$CFLAGS -Wall"
67 # CFLAGS="$CFLAGS -Wcast-align"
68 CFLAGS="$CFLAGS -Wcast-qual"
69 # CFLAGS="$CFLAGS -Wconversion"
70 # CFLAGS="$CFLAGS -Werror"
71 CFLAGS="$CFLAGS -Wmissing-prototypes"
72 CFLAGS="$CFLAGS -Wpointer-arith"
73 CFLAGS="$CFLAGS -Wshadow"
74 CFLAGS="$CFLAGS -Wstrict-prototypes"
75 # CFLAGS="$CFLAGS -Wtraditional"
76 # CFLAGS="$CFLAGS -Wwrite-strings"
78 AC_CACHE_CHECK(whether ${CC-cc} -pipe works, ac_cv_prog_cc_pipe,
79 [echo 'void f(){}' > conftest.c
80 if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`" -a -s conftest.o; then
81 ac_cv_prog_cc_pipe=yes
88 case "$ac_cv_prog_cc_pipe" in
90 CFLAGS="$CFLAGS -pipe"
96 ac_busted_vpath_in_make=no
100 CFLAGS="$CFLAGS -posix"
102 *-*-irix6.1*) # 64 bit only
105 *-*-irix6*) # 6.2 (and later?)
106 ac_busted_vpath_in_make=yes
107 # don't pass -n32 to gcc, it cannot handle and doesn't need it
108 if test "$GCC" != yes; then
112 *) case "$iCFLAGS" in
113 '') CFLAGS="-O2 -g3 -n32" ;;
114 *) CFLAGS="$CFLAGS -n32" ;;
121 *) LDFLAGS="$LDFLAGS -n32" ;;
126 ac_busted_vpath_in_make=yes
128 dnl This is currently commented out by bor.
129 dnl The new versions of ReliantUNIX round adjtime() interval down
130 dnl to 1/100s (system tick). This makes tickadj actually useless.
131 dnl So, I'd better not use additional flags.
132 dnl I leave it here just in case anybody has better idea
133 dnl mips-sni-sysv4* )
135 dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
137 dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
138 dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
143 case "$ac_busted_vpath_in_make$srcdir" in
146 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
148 AC_MSG_ERROR(building outside of the main directory requires GNU make)
159 AC_PROG_GCC_TRADITIONAL
164 AC_PATH_PROG(PATH_SH, sh)
165 AC_PATH_PROG(PATH_PERL, perl)
171 ac_link="$ac_link $VX_KERNEL"
179 AC_CHECK_LIB(advapi32, main)
182 AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
183 dnl AC_CHECK_LIB(kvm, main, , , -lelf)
184 AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
185 AC_CHECK_LIB(ld, nlist)
186 AC_CHECK_LIB(mld, nlist)
187 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket))
188 AC_CHECK_FUNC(openlog, , AC_CHECK_LIB(gen, openlog))
189 AC_CHECK_LIB(readline, readline)
191 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
192 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
193 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
194 dnl does Strange Things with extra processes using the Posix-compatibility
195 dnl real-time library, so we don't want to use it.
200 AC_CHECK_LIB(rt, sched_setscheduler, ,
201 AC_CHECK_LIB(posix4, sched_setscheduler))
205 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
208 AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h memory.h netdb.h)
209 AC_CHECK_HEADERS(poll.h resolv.h sched.h sgtty.h stdlib.h string.h termio.h)
210 AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h utmp.h utmpx.h)
211 AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in_systm.h netinet/in.h)
212 AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO)])
213 AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
214 dnl AC_CHECK_HEADERS(sys/chudefs.h)
215 AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
218 *) AC_CHECK_HEADERS(sys/ioctl.h)
221 AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
222 AC_CHECK_HEADERS(sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h)
225 AC_CHECK_HEADERS(sys/sio.h)
228 AC_CHECK_HEADERS(sys/select.h sys/sockio.h sys/stat.h sys/stream.h)
229 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/termios.h)
230 AC_CHECK_HEADERS(sys/time.h)
232 [#include <sys/timepps.h>
233 #ifdef PPS_API_VERS_1
236 ], AC_CHECK_HEADERS(sys/timepps.h))
237 AC_CHECK_HEADERS(sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h)
241 AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
244 AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
248 AC_CHECK_HEADER(nlist.h,
249 [AC_DEFINE(NLIST_STRUCT)
250 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
251 [AC_TRY_COMPILE([#include <nlist.h>],
252 [struct nlist n; n.n_un.n_name = 0;],
253 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
254 if test $ac_cv_struct_nlist_n_un = yes; then
255 AC_DEFINE(NLIST_NAME_UNION)
259 AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
262 ac_cv_c_volatile=yes,
265 case "$ac_cv_c_volatile" in
268 *) AC_DEFINE(volatile,)
274 # Assume that solaris2 is Ansi C...
280 AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
282 extern int foo (short);
283 int foo(short i) { return i; }],[
284 int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
286 if test "$ac_cv_have_prototypes" = yes; then
287 AC_DEFINE(HAVE_PROTOTYPES)
300 AC_DEFINE(WORDS_BIGENDIAN)
302 *) AC_MSG_ERROR(Cross-compiling needs explicit byte order)
310 AC_CHECK_TYPE(time_t, long)
313 AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
314 [ac_cv_var_default_hz=100
316 alpha*-dec-osf4*|alpha*-dec-osf5*)
317 ac_cv_var_default_hz=1024
320 ac_cv_var_default_hz=256
323 AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz)
325 AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
326 [ac_cv_var_override_hz=no
328 alpha*-dec-osf4*|alpha*-dec-osf5*)
329 ac_cv_var_override_hz=yes
332 ac_cv_var_override_hz=yes
335 ac_cv_var_override_hz=yes
338 ac_cv_var_override_hz=yes
341 case "$ac_cv_var_override_hz" in
343 AC_DEFINE(OVERRIDE_HZ)
347 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
348 dnl [AC_TRY_LINK([#include <sys/types.h>
349 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
350 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
351 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
352 dnl AC_DEFINE(HAVE_UT_HOST)
355 dnl AC_MSG_CHECKING(if we can get the system boot time)
356 dnl AC_CACHE_VAL(su_cv_have_boot_time,
357 dnl [AC_EGREP_CPP(yes,
358 dnl [#ifdef HAVE_UTMPX_H
359 dnl #include <utmpx.h>
361 dnl #include <utmp.h>
366 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
367 dnl AC_MSG_RESULT($su_cv_have_boot_time)
370 struct sigaction for sa_sigaction,
371 ac_cv_struct_sigaction_has_sa_sigaction,
374 [#include <signal.h>],
375 [struct sigaction act; act.sa_sigaction = 0;],
376 ac_cv_struct_sigaction_has_sa_sigaction=yes,
377 ac_cv_struct_sigaction_has_sa_sigaction=no
381 if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
382 AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION)
385 AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
387 #include <sys/types.h>
388 #ifdef HAVE_SYS_TERMIOS_H
389 # include <sys/termios.h>
391 #ifdef HAVE_SYS_TIME_H
392 # include <sys/time.h>
394 #ifdef HAVE_SYS_PPSCLOCK_H
395 # include <sys/ppsclock.h>
397 extern struct ppsclockev *pce;
398 return pce->serial;],
399 ac_cv_struct_ppsclockev=yes,
400 ac_cv_struct_ppsclockev=no)
402 if test $ac_cv_struct_ppsclockev = yes; then
403 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV)
406 AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
408 #include <sys/types.h>
409 #include <sys/socket.h>],[
410 extern struct sockaddr *ps;
412 ac_cv_struct_sockaddr_has_sa_len=yes,
413 ac_cv_struct_sockaddr_has_sa_len=no)
415 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
416 AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR)
419 AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
421 #include <sys/time.h>],[
422 extern struct clockinfo *pc;
424 ac_cv_struct_clockinfo_has_hz=yes,
425 ac_cv_struct_clockinfo_has_hz=no)
427 if test $ac_cv_struct_clockinfo_has_hz = yes; then
428 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO)
431 AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
433 #include <sys/time.h>],[
434 extern struct clockinfo *pc;
435 return pc->tickadj;],
436 ac_cv_struct_clockinfo_has_tickadj=yes,
437 ac_cv_struct_clockinfo_has_tickadj=no)
439 if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
440 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO)
443 AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
445 #include <sys/time.h>
446 /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
450 #ifdef HAVE_SYS_TIMEPPS_H
451 # define FRAC 4294967296
452 # include <sys/timepps.h>
454 [struct timespec n;],
455 ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
456 if test $ac_cv_struct_timespec = yes; then
457 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
460 AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
462 #include <sys/time.h>
463 #include <sys/timex.h>],
464 [struct ntptimeval n;],
465 ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
466 if test $ac_cv_struct_ntptimeval = yes; then
467 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
470 AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
471 [#ifdef HAVE_SYS_TIME_H
472 #include <sys/time.h>
478 #ifdef HAVE_SYS_TIMEX_H
479 #include <sys/timex.h>
487 AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
490 AC_CHECK_SIZEOF(signed char)
494 AC_CHECK_SIZEOF(signed char, 1)
496 *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_SIGNED_LONG)
508 AC_CHECK_SIZEOF(int, 4)
510 *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_INT)
518 AC_CHECK_SIZEOF(long)
522 AC_CHECK_SIZEOF(long, 4)
524 *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_LONG)
530 AC_CHECK_TYPES([s_char])
531 case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
533 # We have a typedef for s_char. Might as well believe it...
536 # We have signed chars, can't say 'signed char', no s_char typedef.
537 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
540 # We have signed chars, can say 'signed char', no s_char typedef.
541 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
544 # We have unsigned chars, can't say 'signed char', no s_char typedef.
545 AC_MSG_ERROR(No way to specify a signed character!)
548 # We have unsigned chars, can say 'signed char', no s_char typedef.
549 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
556 AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
561 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
562 # (returning ENOSYS). I didn't check 4.2. If, in the future,
563 # IBM pulls its thumbs out long enough to implement clock_settime,
564 # this conditional will need to change. Maybe use AC_TRY_RUN
565 # instead to try to set the time to itself and check errno.
567 *) AC_CHECK_FUNCS(clock_settime)
570 AC_CHECK_FUNCS(daemon)
571 AC_CHECK_FUNCS(finite, ,
572 [AC_CHECK_FUNCS(isfinite, ,
573 [AC_MSG_CHECKING(for isfinite with <math.h>)
576 AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
578 AC_DEFINE(HAVE_ISFINITE)],
581 AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage gettimeofday)
585 *) AC_CHECK_FUNCS(getuid)
588 AC_CHECK_FUNCS(hstrerror K_open kvm_open memcpy memmove memset)
591 # Just stubs. Idiots.
593 *) AC_CHECK_FUNCS(mkstemp)
596 AC_REPLACE_FUNCS(mktime)
599 # Just a stub. Idiots.
602 # Just stubs in Irix. Idiots.
605 # Just stubs. Idiots.
607 alpha*-dec-osf4*|alpha*-dec-osf5*)
608 # mlockall is there, as a #define calling memlk via <sys/mman.h>
609 # Not easy to test for - cheat.
610 AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
611 AC_CHECK_FUNCS(mlockall)
613 *) AC_CHECK_FUNCS(mlockall)
616 AC_CHECK_FUNCS(mrand48 srand48 nice nlist)
621 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
624 AC_CHECK_FUNCS(plock pututline pututxline readlink rtprio)
625 case "$ac_cv_func_mrand48" in
627 *) AC_REPLACE_FUNCS(random) ;;
631 # Just a stub in AIX 4. Idiots.
634 # Just stubs in solaris2.5. Idiots.
636 *) AC_CHECK_FUNCS(sched_setscheduler)
639 AC_CHECK_FUNCS(setlinebuf)
640 AC_CHECK_FUNCS(setpgid setpriority setsid settimeofday setvbuf sigaction)
641 AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
642 AC_REPLACE_FUNCS(snprintf strdup strerror)
645 # Just stubs. Idiots.
648 # Just stubs. Idiots.
651 # Just stubs. Idiots.
653 *) AC_CHECK_FUNCS(timer_create timer_settime)
660 *) AC_CHECK_FUNCS(umask)
663 AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
665 AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
666 [AC_TRY_COMPILE([#include <sys/time.h>],[
667 gettimeofday((struct timeval*)0,(struct timezone*)0);
668 settimeofday((struct timeval*)0,(struct timezone*)0);
670 ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
672 if test $ac_cv_func_Xettimeofday_nargs = 1; then
673 AC_DEFINE(SYSV_TIMEOFDAY)
676 AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
678 #ifdef HAVE_SYS_TYPES_H
679 # include <sys/types.h>
685 ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
687 if test $ac_cv_func_setpgrp_nargs = 0; then
688 AC_DEFINE(HAVE_SETPGRP_0)
692 CFLAGS="$CFLAGS -I$srcdir/include"
694 AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
695 ac_cv_func_qsort_argtype,
697 #include "l_stdlib.h"
699 #ifdef HAVE_PROTOTYPES
706 extern sortfunc P((const void *, const void *));
709 const void *b; { return 0; }
711 qsort(base, 2, sizeof(char *), sortfunc);
713 ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
715 case "$ac_cv_func_qsort_argtype" in
717 AC_DEFINE(QSORT_USES_VOID_P)
723 AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
724 [AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
728 ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
729 case "$ac_cv_decl_errno" in
730 yes) AC_DEFINE(DECL_ERRNO) ;;
733 dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
734 dnl the clash. <resolv.h> isn't currently used.
736 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
737 dnl MT purposes. This makes the line "extern int h_errno" choke
738 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
739 dnl without breaking any other platforms.
741 AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
742 [AC_TRY_COMPILE([#include <sys/types.h>
743 #ifdef HAVE_NETINET_IN_H
744 #include <netinet/in.h>
746 #ifdef HAVE_ARPA_NAMESER_H
747 #include <arpa/nameser.h>
755 [extern int h_errno;],
756 ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
757 case "$ac_cv_decl_h_errno" in
758 yes) AC_DEFINE(DECL_H_ERRNO) ;;
761 dnl See if char *sys_errlist[] is OK.
762 AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
763 [AC_TRY_COMPILE([#include <stdio.h>
767 [extern char *sys_errlist[];
769 ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
770 case "$ac_cv_decl_sys_errlist" in
771 yes) AC_DEFINE(CHAR_SYS_ERRLIST) ;;
774 AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
776 #ifdef HAVE_SYS_TYPES_H
777 # include <sys/types.h>
782 #ifdef HAVE_PROTOTYPES
788 [extern int syscall P((int, ...));],
789 ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
790 case "$ac_cv_decl_syscall" in
791 yes) AC_DEFINE(DECL_SYSCALL) ;;
796 AC_DEFINE(DECL_HSTRERROR_0) # Needed for XLC under AIX 4.3.2
799 AC_DEFINE(DECL_PLOCK_0)
800 AC_DEFINE(DECL_STIME_1)
803 AC_DEFINE(DECL_ADJTIME_0)
804 AC_DEFINE(DECL_BZERO_0)
805 AC_DEFINE(DECL_IOCTL_0)
806 AC_DEFINE(DECL_IPC_0)
807 AC_DEFINE(DECL_MEMMOVE_0)
808 AC_DEFINE(DECL_MKTEMP_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_STDIO_0)
814 AC_DEFINE(DECL_STRTOL_0)
815 AC_DEFINE(DECL_SYSLOG_0)
816 AC_DEFINE(DECL_TIME_0)
817 AC_DEFINE(DECL_TIMEOFDAY_0)
818 AC_DEFINE(DECL_TOLOWER_0)
821 AC_DEFINE(DECL_MKSTEMP_0)
822 AC_DEFINE(DECL_SETPRIORITY_1)
825 AC_DEFINE(DECL_TIMEOFDAY_0)
830 AC_DEFINE(DECL_ADJTIME_0)
831 AC_DEFINE(DECL_BCOPY_0)
832 AC_DEFINE(DECL_BZERO_0)
833 AC_DEFINE(DECL_IOCTL_0)
834 AC_DEFINE(DECL_IPC_0)
835 AC_DEFINE(DECL_MEMMOVE_0)
836 AC_DEFINE(DECL_MKTEMP_0)
837 AC_DEFINE(DECL_MKSTEMP_0)
838 AC_DEFINE(DECL_MRAND48_0)
839 AC_DEFINE(DECL_RENAME_0)
840 AC_DEFINE(DECL_SELECT_0)
841 AC_DEFINE(DECL_SETITIMER_0)
842 AC_DEFINE(DECL_SETPRIORITY_0)
843 AC_DEFINE(DECL_SIGVEC_0)
844 AC_DEFINE(DECL_SRAND48_0)
845 case "`basename $ac_cv_prog_CC`" in
847 *) AC_DEFINE(DECL_STDIO_0)
850 AC_DEFINE(DECL_STRTOL_0)
851 AC_DEFINE(DECL_SYSLOG_0)
852 AC_DEFINE(DECL_TIME_0)
853 AC_DEFINE(DECL_TIMEOFDAY_0)
854 AC_DEFINE(DECL_TOLOWER_0)
855 AC_DEFINE(DECL_TOUPPER_0)
856 AC_DEFINE(DECL_STRERROR_0)
859 AC_DEFINE(DECL_ADJTIME_0)
860 AC_DEFINE(DECL_BZERO_0)
861 AC_DEFINE(DECL_CFSETISPEED_0)
862 AC_DEFINE(DECL_IOCTL_0)
863 AC_DEFINE(DECL_IPC_0)
864 AC_DEFINE(DECL_MKTEMP_0)
865 AC_DEFINE(DECL_MRAND48_0)
866 AC_DEFINE(DECL_NLIST_0)
867 AC_DEFINE(DECL_PLOCK_0)
868 AC_DEFINE(DECL_SELECT_0)
869 AC_DEFINE(DECL_SETITIMER_0)
870 AC_DEFINE(DECL_SETPRIORITY_0)
871 AC_DEFINE(DECL_SRAND48_0)
872 AC_DEFINE(DECL_STIME_0)
873 AC_DEFINE(DECL_SYSLOG_0)
874 AC_DEFINE(DECL_TIMEOFDAY_0)
880 AC_DEFINE(TERMIOS_NEEDS__SVID3)
884 AC_CACHE_CHECK(if we should use a streams device for ifconfig,
885 ac_cv_var_use_streams_device_for_ifconfig,
886 ac_cv_var_use_streams_device_for_ifconfig=no)
888 AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
895 ac_cv_var_rcvbuf_slop=$ans])
896 case "$ac_cv_var_rcvbuf_slop" in
897 yes) AC_DEFINE(NEED_RCVBUF_SLOP) ;;
900 AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
910 ac_cv_var_open_bcast_socket=$ans])
911 case "$ac_cv_var_open_bcast_socket" in
912 yes) AC_DEFINE(OPEN_BCAST_SOCKET) ;;
915 AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
922 ac_cv_var_hpux_findconfig=$ans])
923 case "$ac_cv_var_hpux_findconfig" in
924 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG) ;;
927 AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
948 ac_cv_arg_setpgrp_negpid=$ans])
949 case "$ac_cv_arg_setpgrp_negpid" in
950 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN) ;;
953 AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
973 ac_cv_func_ctty_for_f_setown=$ans])
974 case "$ac_cv_func_ctty_for_f_setown" in
975 yes) AC_DEFINE(USE_FSETOWNCTTY) ;;
979 AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
980 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
983 ans='clock_settime()'
986 ntp_warning='But clock_settime() would be better (if we had it)'
990 ntp_warning='Which is the worst of the three'
995 $target) ntp_warning='Which leaves us with nothing to use!'
1001 case "$ntp_warning" in
1003 *) AC_MSG_WARN(*** $ntp_warning ***)
1007 AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1015 ac_cv_var_syscall_bug=$ans])
1016 case "$ac_cv_var_syscall_bug" in
1017 yes) AC_DEFINE(SYSCALL_BUG) ;;
1020 AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
1021 [ case "$ac_cv_header_sys_stropts_h" in
1024 # There must be a better way...
1032 ac_cv_var_streams_tli=$ans])
1033 case "$ac_cv_var_streams_tli" in
1035 AC_DEFINE(STREAMS_TLI)
1039 AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1041 [#include <signal.h>
1045 ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1047 dnl Override those system that have a losing SIGIO
1048 AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1050 case "$ac_cv_hdr_def_sigio" in
1054 alpha*-dec-osf4*|alpha*-dec-osf5*)
1084 ac_cv_var_signalled_io=$ans])
1085 case "$ac_cv_var_signalled_io" in
1086 yes) AC_DEFINE(HAVE_SIGNALED_IO) ;;
1089 AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1091 [#include <signal.h>
1095 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1097 AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1099 [#include <signal.h>
1103 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1105 AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1107 case "$ac_cv_hdr_def_sigpoll" in
1145 ac_cv_var_use_udp_sigpoll=$ans])
1146 case "$ac_cv_var_use_udp_sigpoll" in
1147 yes) AC_DEFINE(USE_UDP_SIGPOLL) ;;
1150 AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1152 case "$ac_cv_hdr_def_sigpoll" in
1190 ac_cv_var_use_tty_sigpoll=$ans])
1191 case "$ac_cv_var_use_tty_sigpoll" in
1192 yes) AC_DEFINE(USE_TTY_SIGPOLL) ;;
1195 case "$ac_cv_header_sys_sio_h" in
1197 AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1199 [#include <sys/sio.h>
1200 #ifdef TIOCDCDTIMESTAMP
1203 ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1207 case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1209 ac_cv_var_oncore_ok=yes
1213 AC_CACHE_CHECK(if nlist() values might require extra indirection,
1214 ac_cv_var_nlist_extra_indirection,
1221 ac_cv_var_nlist_extra_indirection=$ans])
1222 case "$ac_cv_var_nlist_extra_indirection" in
1223 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION) ;;
1226 AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1227 ac_cv_var_min_rec_tickadj,
1234 ac_cv_var_min_rec_tickadj=$ans])
1235 case "$ac_cv_var_min_rec_tickadj" in
1237 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj) ;;
1240 AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1241 ac_cv_var_no_parenb_ignpar,
1251 ac_cv_var_no_parenb_ignpar=$ans])
1252 case "$ac_cv_var_no_parenb_ignpar" in
1253 yes) AC_DEFINE(NO_PARENB_IGNPAR) ;;
1256 AC_MSG_CHECKING(if we're including debugging code)
1257 AC_ARG_ENABLE(debugging, [ --enable-debugging + include debugging code],
1258 [ntp_ok=$enableval], [ntp_ok=yes])
1259 if test "$ntp_ok" = "yes"; then
1262 AC_MSG_RESULT($ntp_ok)
1264 AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1265 AC_ARG_ENABLE(dst_minutes, [ --enable-dst-minutes=60 + minutes per DST adjustment],
1266 [ans=$enableval], [ans=60])
1267 AC_DEFINE_UNQUOTED(DSTMINUTES, $ans)
1270 AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1272 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1273 *yes*) ac_cv_var_tty_clk=yes ;;
1275 case "$ac_cv_var_tty_clk" in
1276 yes) AC_DEFINE(TTYCLK) ;;
1279 AC_CACHE_CHECK(for the ppsclock streams module,
1281 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1282 case "$ac_cv_var_ppsclock" in
1283 yes) AC_DEFINE(PPS) ;;
1286 AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1289 i386-sequent-sysv4) ;;
1290 *) AC_EGREP_CPP(yes,
1291 [#include <netinet/in.h>
1292 #ifdef IP_ADD_MEMBERSHIP
1295 ], ac_cv_var_mcast=yes) ;;
1297 case "$ac_cv_var_mcast" in
1298 yes) AC_DEFINE(MCAST) ;;
1301 AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1302 [ac_cv_var_ntp_syscalls=no
1303 case "$ac_cv_func___adjtimex" in
1305 ac_cv_var_ntp_syscalls=libc
1307 *) case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
1309 ac_cv_var_ntp_syscalls=libc
1311 *) AC_EGREP_CPP(yes,
1312 [#include <sys/syscall.h>
1313 #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1316 ], ac_cv_var_ntp_syscalls=kernel)
1321 case "$ac_cv_var_ntp_syscalls" in
1323 AC_DEFINE(NTP_SYSCALLS_LIBC)
1326 AC_DEFINE(NTP_SYSCALLS_STD)
1332 AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1334 [#include <sys/timex.h>
1338 ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
1340 AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
1341 [dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
1342 case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
1344 ac_cv_var_kernel_pll=no
1346 *) ac_cv_var_kernel_pll=yes
1349 case "$ac_cv_var_kernel_pll" in
1351 AC_DEFINE(KERNEL_PLL)
1355 AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1368 ac_cv_var_size_returned_in_buffer=$ans])
1369 case "$ac_cv_var_size_returned_in_buffer" in
1370 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER) ;;
1373 dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1374 dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
1375 dnl [ans=$enableval], [ans=no])
1376 dnl ac_cv_var_gdt_surveying=$ans])
1377 dnl case "$ac_cv_var_gdt_surveying" in
1378 dnl yes) AC_DEFINE(GDT_SURVEYING) ;;
1381 # Check for ioctls TIOCGPPSEV
1382 AC_MSG_CHECKING(ioctl TIOCGPPSEV)
1383 if test "$ac_cv_header_termios_h" = "yes"; then
1385 [#include <termios.h>
1389 ], ntp_ok=yes, ntp_ok=no)
1393 if test "$ntp_ok" = "yes"; then
1394 AC_DEFINE(HAVE_TIOCGPPSEV)
1395 ac_cv_var_oncore_ok=yes
1397 AC_MSG_RESULT($ntp_ok)
1399 # Check for ioctls TIOCSPPS
1400 AC_MSG_CHECKING(ioctl TIOCSPPS)
1401 if test "$ac_cv_header_termios_h" = "yes"; then
1403 [#include <termios.h>
1407 ], ntp_ok=yes, ntp_ok=no)
1412 if test "$ntp_ok" = "yes"; then
1413 AC_DEFINE(HAVE_TIOCSPPS)
1415 AC_MSG_RESULT($ntp_ok)
1417 # Check for ioctls CIOGETEV
1418 AC_MSG_CHECKING(ioctl CIOGETEV)
1419 if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
1421 [#include <sys/ppsclock.h>
1425 ], ntp_ok=yes, ntp_ok=no)
1429 if test "$ntp_ok" = "yes"; then
1430 ac_cv_var_oncore_ok=yes
1431 AC_DEFINE(HAVE_CIOGETEV)
1433 AC_MSG_RESULT($ntp_ok)
1436 # ATOM/PPSAPI stuff.
1438 # ATOM used to require struct timespec, but that's been fixed now.
1440 # case "$ac_cv_struct_timespec" in
1442 # ac_cv_var_atom_ok=yes
1445 ac_cv_var_atom_ok=yes
1447 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1449 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1451 # The PPSAPI needs ATOM
1453 # The PPSAPI needs struct timespec.
1455 case "$ac_cv_c_inline$ac_cv_struct_timespec$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h" in
1457 AC_DEFINE(HAVE_PPSAPI)
1458 ac_cv_var_oncore_ok=yes
1462 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1463 AC_CHECK_HEADER(linux/serial.h)
1464 AC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
1465 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1468 [#include <sys/time.h>
1471 #include <sys/ppsclock.h>
1472 #include <linux/serial.h>
1476 #ifdef ASYNC_PPS_CD_POS
1477 #ifdef ASYNC_PPS_CD_NEG
1491 if test "$ntp_ok" = "yes"; then
1492 AC_DEFINE(HAVE_TIO_SERIAL_STUFF)
1494 AC_MSG_RESULT($ntp_ok)
1496 # Check for SHMEM_STATUS support
1497 AC_MSG_CHECKING(SHMEM_STATUS support)
1498 case "$ac_cv_header_sys_mman_h" in
1502 if test "$ntp_ok" = "yes"; then
1503 AC_DEFINE(ONCORE_SHMEM_STATUS)
1505 AC_MSG_RESULT($ntp_ok)
1507 dnl dnl These are for OPT_PROGRAMS in authstuff/
1508 dnl AC_SUBST(AUTHCERT)
1509 dnl AC_SUBST(AUTHSPEED)
1510 dnl AC_SUBST(MD5DRIVER)
1511 dnl AC_SUBST(KEYPARITY)
1512 dnl AC_SUBST(MAKEIPFP)
1513 dnl AC_SUBST(MAKEPC1)
1514 dnl AC_SUBST(MAKEPC2)
1515 dnl AC_SUBST(MAKESP)
1516 dnl AC_SUBST(MKRANDKEYS)
1517 dnl AC_SUBST(OMAKEIPFP)
1518 dnl AC_SUBST(UNIXCERT)
1522 AC_MSG_CHECKING(for hopf serial clock device)
1523 AC_ARG_ENABLE(HOPFSERIAL, [ --enable-HOPFSERIAL + hopf serial clock device],
1524 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1525 if test "$ntp_ok" = "yes"; then
1527 AC_DEFINE(CLOCK_HOPF_SERIAL)
1529 AC_MSG_RESULT($ntp_ok)
1532 AC_MSG_CHECKING(for hopf PCI clock 6039)
1533 AC_ARG_ENABLE(HOPFPCI, [ --enable-HOPFPCI + hopf 6039 PCI board],
1534 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1535 if test "$ntp_ok" = "yes"; then
1537 AC_DEFINE(CLOCK_HOPF_PCI)
1539 AC_MSG_RESULT($ntp_ok)
1541 # HPUX only, and by explicit request
1542 AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1543 AC_ARG_ENABLE(BANCOMM, [ --enable-BANCOMM - Datum/Bancomm bc635/VME interface],
1544 [ntp_ok=$enableval], [ntp_ok=no])
1545 if test "$ntp_ok" = "yes"; then
1547 AC_DEFINE(CLOCK_BANC)
1549 AC_MSG_RESULT($ntp_ok)
1550 case "$ntp_ok$target" in
1552 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1555 #HPUX only, and only by explicit request
1556 AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1557 AC_ARG_ENABLE(GPSVME, [ --enable-GPSVME - TrueTime GPS receiver/VME interface],
1558 [ntp_ok=$enableval], [ntp_ok=no])
1559 if test "$ntp_ok" = "yes"; then
1561 AC_DEFINE(CLOCK_GPSVME)
1563 AC_MSG_RESULT($ntp_ok)
1564 case "$ntp_ok$target" in
1566 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1569 AC_MSG_CHECKING(for PCL720 clock support)
1570 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1572 AC_DEFINE(CLOCK_PPS720)
1581 AC_MSG_CHECKING(for SHM clock attached thru shared memory)
1582 AC_ARG_ENABLE(SHM, [ --enable-SHM - SHM clock attached thru shared memory],
1583 [ntp_ok=$enableval], [ntp_ok=no])
1584 if test "$ntp_ok" = "yes"; then
1586 AC_DEFINE(CLOCK_SHM)
1588 AC_MSG_RESULT($ntp_ok)
1590 AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1591 AC_ARG_ENABLE(all-clocks, [ --enable-all-clocks + include all suitable non-PARSE clocks:],
1592 [ntp_eac=$enableval], [ntp_eac=yes])
1593 AC_MSG_RESULT($ntp_eac)
1595 AC_MSG_CHECKING(if we have support for PARSE clocks)
1596 case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1603 AC_MSG_RESULT($ntp_canparse)
1605 AC_MSG_CHECKING([if we have support for audio clocks])
1606 case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
1609 AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
1611 *) ntp_canaudio=no ;;
1613 AC_MSG_RESULT($ntp_canaudio)
1615 # Requires modem control
1616 AC_MSG_CHECKING(ACTS modem service)
1617 AC_ARG_ENABLE(ACTS, [ --enable-ACTS + ACTS modem service],
1618 [ntp_ok=$enableval],
1620 [#include <termios.h>
1621 #ifdef HAVE_SYS_IOCTL_H
1622 #include <sys/ioctl.h>
1627 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1628 if test "$ntp_ok" = "yes"; then
1630 AC_DEFINE(CLOCK_ACTS)
1632 AC_MSG_RESULT($ntp_ok)
1634 AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1635 AC_ARG_ENABLE(ARBITER, [ --enable-ARBITER + Arbiter 1088A/B GPS receiver],
1636 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1637 if test "$ntp_ok" = "yes"; then
1639 AC_DEFINE(CLOCK_ARBITER)
1641 AC_MSG_RESULT($ntp_ok)
1643 AC_MSG_CHECKING(Arcron MSF receiver)
1644 AC_ARG_ENABLE(ARCRON_MSF, [ --enable-ARCRON-MSF + Arcron MSF receiver],
1645 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1646 if test "$ntp_ok" = "yes"; then
1648 AC_DEFINE(CLOCK_ARCRON_MSF)
1650 AC_MSG_RESULT($ntp_ok)
1652 AC_MSG_CHECKING(ATOM PPS interface)
1653 AC_ARG_ENABLE(ATOM, [ --enable-ATOM s ATOM PPS interface],
1654 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1655 case "$ac_cv_var_atom_ok" in
1658 if test "$ntp_ok" = "yes"; then
1660 AC_DEFINE(CLOCK_ATOM)
1662 AC_MSG_RESULT($ntp_ok)
1664 AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1665 AC_ARG_ENABLE(AS2201, [ --enable-AS2201 + Austron 2200A/2201A GPS receiver],
1666 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1667 if test "$ntp_ok" = "yes"; then
1669 AC_DEFINE(CLOCK_AS2201)
1671 AC_MSG_RESULT($ntp_ok)
1673 AC_MSG_CHECKING(CHU modem/decoder)
1674 AC_ARG_ENABLE(CHU, [ --enable-CHU - CHU modem/decoder],
1675 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1676 if test "$ntp_ok" = "yes"; then
1678 AC_DEFINE(CLOCK_CHU)
1680 AC_MSG_RESULT($ntp_ok)
1681 ac_refclock_chu=$ntp_ok
1683 AC_MSG_CHECKING(CHU audio/decoder)
1684 AC_ARG_ENABLE(AUDIO-CHU, [ --enable-AUDIO-CHU s CHU audio/decoder],
1685 [ntp_ok=$enableval],
1686 [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
1690 if test "$ntp_ok" = "yes"; then
1691 AC_DEFINE(AUDIO_CHU)
1693 AC_MSG_RESULT($ntp_ok)
1694 # We used to check for sunos/solaris target...
1695 case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
1696 yes*no*) AC_MSG_WARN(*** But the expected answer is...no ***) ;;
1700 AC_MSG_CHECKING(Datum Programmable Time System)
1701 AC_ARG_ENABLE(DATUM, [ --enable-DATUM s Datum Programmable Time System],
1702 [ntp_ok=$enableval],
1703 [case "$ac_cv_header_termios_h" in
1710 if test "$ntp_ok" = "yes"; then
1712 AC_DEFINE(CLOCK_DATUM)
1714 AC_MSG_RESULT($ntp_ok)
1716 AC_MSG_CHECKING(Forum Graphic GPS)
1717 AC_ARG_ENABLE(FG, [ --enable-FG + Forum Graphic GPS],
1718 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1719 if test "$ntp_ok" = "yes"; then
1723 AC_MSG_RESULT($ntp_ok)
1725 # Requires modem control
1726 AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1727 AC_ARG_ENABLE(HEATH, [ --enable-HEATH s Heath GC-1000 WWV/WWVH receiver],
1728 [ntp_ok=$enableval],
1730 [#include <termios.h>
1731 #ifdef HAVE_SYS_IOCTL_H
1732 #include <sys/ioctl.h>
1737 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1738 if test "$ntp_ok" = "yes"; then
1740 AC_DEFINE(CLOCK_HEATH)
1742 AC_MSG_RESULT($ntp_ok)
1744 AC_MSG_CHECKING(HP 58503A GPS receiver)
1745 AC_ARG_ENABLE(HPGPS, [ --enable-HPGPS + HP 58503A GPS receiver],
1746 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1747 if test "$ntp_ok" = "yes"; then
1749 AC_DEFINE(CLOCK_HPGPS)
1751 AC_MSG_RESULT($ntp_ok)
1753 AC_MSG_CHECKING(Sun IRIG audio decoder)
1754 AC_ARG_ENABLE(IRIG, [ --enable-IRIG s Sun IRIG audio decoder],
1755 [ntp_ok=$enableval],
1756 [case "$ntp_eac$ntp_canaudio" in
1760 if test "$ntp_ok" = "yes"; then
1762 AC_DEFINE(CLOCK_IRIG)
1764 AC_MSG_RESULT($ntp_ok)
1765 case "$ntp_ok$ntp_canaudio" in
1766 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1769 AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
1770 AC_ARG_ENABLE(LEITCH, [ --enable-LEITCH + Leitch CSD 5300 Master Clock System Driver],
1771 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1772 if test "$ntp_ok" = "yes"; then
1774 AC_DEFINE(CLOCK_LEITCH)
1776 AC_MSG_RESULT($ntp_ok)
1778 AC_MSG_CHECKING(local clock reference)
1779 AC_ARG_ENABLE(LOCAL-CLOCK, [ --enable-LOCAL-CLOCK + local clock reference],
1780 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1781 if test "$ntp_ok" = "yes"; then
1783 AC_DEFINE(CLOCK_LOCAL)
1785 AC_MSG_RESULT($ntp_ok)
1787 AC_MSG_CHECKING(EES M201 MSF receiver)
1788 AC_ARG_ENABLE(MSFEES, [ --enable-MSFEES + EES M201 MSF receiver],
1789 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1790 if test "$ntp_ok" = "yes"; then
1792 AC_DEFINE(CLOCK_MSFEES)
1794 AC_MSG_RESULT($ntp_ok)
1797 AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
1798 AC_ARG_ENABLE(MX4200, [ --enable-MX4200 s Magnavox MX4200 GPS receiver],
1799 [ntp_ok=$enableval],
1800 [case "$ac_cv_var_ppsclock" in
1801 yes) ntp_ok=$ntp_eac
1806 if test "$ntp_ok" = "yes"; then
1808 AC_DEFINE(CLOCK_MX4200)
1810 AC_MSG_RESULT($ntp_ok)
1811 case "$ntp_ok$target" in
1812 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1815 AC_MSG_CHECKING(NMEA GPS receiver)
1816 AC_ARG_ENABLE(NMEA, [ --enable-NMEA + NMEA GPS receiver],
1817 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1818 if test "$ntp_ok" = "yes"; then
1820 AC_DEFINE(CLOCK_NMEA)
1822 AC_MSG_RESULT($ntp_ok)
1824 AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
1825 AC_ARG_ENABLE(ONCORE, [ --enable-ONCORE s Motorola VP/UT Oncore GPS receiver],
1826 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1827 case "$ac_cv_var_oncore_ok" in
1830 if test "$ntp_ok" = "yes"; then
1832 AC_DEFINE(CLOCK_ONCORE)
1834 AC_MSG_RESULT($ntp_ok)
1836 AC_MSG_CHECKING(for Palisade clock)
1837 AC_ARG_ENABLE(PALISADE, [ --enable-PALISADE + Palisade clock],
1838 [ntp_ok=$enableval],
1839 [case "$ac_cv_header_termios_h" in
1847 if test "$ntp_ok" = "yes"; then
1849 AC_DEFINE(CLOCK_PALISADE)
1851 AC_MSG_RESULT($ntp_ok)
1853 AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
1854 AC_ARG_ENABLE(PST, [ --enable-PST + PST/Traconex 1020 WWV/WWVH receiver],
1855 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1856 if test "$ntp_ok" = "yes"; then
1858 AC_DEFINE(CLOCK_PST)
1860 AC_MSG_RESULT($ntp_ok)
1863 AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
1864 AC_ARG_ENABLE(JUPITER, [ --enable-JUPITER s Rockwell Jupiter GPS receiver],
1865 [ntp_ok=$enableval],
1866 [case "$ac_cv_var_ppsclock" in
1867 # yes) ntp_ok=$ntp_eac
1872 if test "$ntp_ok" = "yes"; then
1874 AC_DEFINE(CLOCK_JUPITER)
1876 AC_MSG_RESULT($ntp_ok)
1877 case "$ntp_ok$target" in
1878 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1881 # Requires modem control
1882 AC_MSG_CHECKING(PTB modem service)
1883 AC_ARG_ENABLE(PTBACTS, [ --enable-PTBACTS s PTB modem service],
1884 [ntp_ok=$enableval],
1886 [#include <termios.h>
1887 #ifdef HAVE_SYS_IOCTL_H
1888 #include <sys/ioctl.h>
1893 ], ntp_ok=$ntp_eac, ntp_ok=no)])
1894 if test "$ntp_ok" = "yes"; then
1896 AC_DEFINE(CLOCK_PTBACTS)
1898 AC_MSG_RESULT($ntp_ok)
1900 AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
1901 AC_ARG_ENABLE(TPRO, [ --enable-TPRO s KSI/Odetics TPRO/S GPS receiver/IRIG interface],
1902 [ntp_ok=$enableval],
1903 [case "$ac_cv_header_sys_tpro_h" in
1910 if test "$ntp_ok" = "yes"; then
1912 AC_DEFINE(CLOCK_TPRO)
1914 AC_MSG_RESULT($ntp_ok)
1915 case "$ntp_ok$ac_cv_header_sys_tpro" in
1916 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1919 AC_MSG_CHECKING(TRAK 8810 GPS receiver)
1920 AC_ARG_ENABLE(TRAK, [ --enable-TRAK + TRAK 8810 GPS receiver],
1921 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1922 if test "$ntp_ok" = "yes"; then
1924 AC_DEFINE(CLOCK_TRAK)
1926 AC_MSG_RESULT($ntp_ok)
1928 AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
1929 AC_ARG_ENABLE(CHRONOLOG, [ --enable-CHRONOLOG + Chrono-log K-series WWVB receiver],
1930 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1931 if test "$ntp_ok" = "yes"; then
1933 AC_DEFINE(CLOCK_CHRONOLOG)
1935 AC_MSG_RESULT($ntp_ok)
1937 AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
1938 AC_ARG_ENABLE(DUMBCLOCK, [ --enable-DUMBCLOCK + Dumb generic hh:mm:ss local clock],
1939 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1940 if test "$ntp_ok" = "yes"; then
1942 AC_DEFINE(CLOCK_DUMBCLOCK)
1944 AC_MSG_RESULT($ntp_ok)
1946 AC_MSG_CHECKING(Conrad parallel port radio clock)
1947 AC_ARG_ENABLE(PCF, [ --enable-PCF + Conrad parallel port radio clock],
1948 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1949 if test "$ntp_ok" = "yes"; then
1951 AC_DEFINE(CLOCK_PCF)
1953 AC_MSG_RESULT($ntp_ok)
1955 AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
1956 AC_ARG_ENABLE(SPECTRACOM, [ --enable-SPECTRACOM + Spectracom 8170/Netclock/2 WWVB receiver],
1957 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1958 if test "$ntp_ok" = "yes"; then
1960 AC_DEFINE(CLOCK_SPECTRACOM)
1962 AC_MSG_RESULT($ntp_ok)
1964 # Not on a vax-dec-bsd
1965 AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
1966 AC_ARG_ENABLE(TRUETIME, [ --enable-TRUETIME s Kinemetrics/TrueTime receivers],
1967 [ntp_ok=$enableval],
1976 if test "$ntp_ok" = "yes"; then
1978 AC_DEFINE(CLOCK_TRUETIME)
1980 AC_MSG_RESULT($ntp_ok)
1981 case "$ntp_ok$target" in
1982 yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1985 AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
1986 AC_ARG_ENABLE(ULINK, [ --enable-ULINK + Ultralink WWVB receiver],
1987 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1988 if test "$ntp_ok" = "yes"; then
1990 AC_DEFINE(CLOCK_ULINK)
1992 AC_MSG_RESULT($ntp_ok)
1994 AC_MSG_CHECKING(WWV receiver)
1995 AC_ARG_ENABLE(WWV, [ --enable-WWV + WWV Audio receiver],
1996 [ntp_ok=$enableval],
1997 [case "$ntp_eac$ntp_canaudio" in
2001 if test "$ntp_ok" = "yes"; then
2003 AC_DEFINE(CLOCK_WWV)
2005 AC_MSG_RESULT($ntp_ok)
2006 case "$ntp_ok$ntp_canaudio" in
2007 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2010 # Requires modem control
2011 AC_MSG_CHECKING(USNO modem service)
2012 AC_ARG_ENABLE(USNO, [ --enable-USNO s USNO modem service],
2013 [ntp_ok=$enableval],
2015 [#include <termios.h>
2016 #ifdef HAVE_SYS_IOCTL_H
2017 #include <sys/ioctl.h>
2022 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2023 if test "$ntp_ok" = "yes"; then
2025 AC_DEFINE(CLOCK_USNO)
2027 AC_MSG_RESULT($ntp_ok)
2029 AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
2030 AC_ARG_ENABLE(parse-clocks, [ --enable-parse-clocks - include all suitable PARSE clocks:],
2031 [ntp_eapc=$enableval],
2033 yes) ntp_eapc=$ntp_canparse ;;
2037 AC_MSG_RESULT($ntp_eapc)
2039 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2041 AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
2044 AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
2053 AC_MSG_CHECKING(Diem Computime Radio Clock)
2054 AC_ARG_ENABLE(COMPUTIME, [ --enable-COMPUTIME s Diem Computime Radio Clock],
2055 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2056 if test "$ntp_ok" = "yes"; then
2059 AC_DEFINE(CLOCK_COMPUTIME)
2061 AC_MSG_RESULT($ntp_ok)
2062 case "$ntp_ok$ntp_canparse" in
2064 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2068 AC_MSG_CHECKING(ELV/DCF7000 clock)
2069 AC_ARG_ENABLE(DCF7000, [ --enable-DCF7000 s ELV/DCF7000 clock],
2070 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2071 if test "$ntp_ok" = "yes"; then
2074 AC_DEFINE(CLOCK_DCF7000)
2076 AC_MSG_RESULT($ntp_ok)
2077 case "$ntp_ok$ntp_canparse" in
2079 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2083 AC_MSG_CHECKING(HOPF 6021 clock)
2084 AC_ARG_ENABLE(HOPF6021, [ --enable-HOPF6021 s HOPF 6021 clock],
2085 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2086 if test "$ntp_ok" = "yes"; then
2089 AC_DEFINE(CLOCK_HOPF6021)
2091 AC_MSG_RESULT($ntp_ok)
2092 case "$ntp_ok$ntp_canparse" in
2094 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2098 AC_MSG_CHECKING(Meinberg clocks)
2099 AC_ARG_ENABLE(MEINBERG, [ --enable-MEINBERG s Meinberg clocks],
2100 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2101 if test "$ntp_ok" = "yes"; then
2104 AC_DEFINE(CLOCK_MEINBERG)
2106 AC_MSG_RESULT($ntp_ok)
2107 case "$ntp_ok$ntp_canparse" in
2109 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2113 AC_MSG_CHECKING(DCF77 raw time code)
2114 AC_ARG_ENABLE(RAWDCF, [ --enable-RAWDCF s DCF77 raw time code],
2115 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2116 if test "$ntp_ok" = "yes"; then
2121 AC_DEFINE(CLOCK_RAWDCF)
2123 AC_MSG_RESULT($ntp_ok)
2124 case "$ntp_ok$ntp_canparse" in
2126 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2130 case "$ntp_rawdcf" in
2132 AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2133 ac_cv_var_rawdcf_parity,
2140 ac_cv_var_rawdcf_parity=$ans])
2141 case "$ac_cv_var_rawdcf_parity" in
2142 yes) AC_DEFINE(RAWDCF_NO_IGNPAR) ;;
2146 *) # HMS: Is this a good idea?
2147 ac_cv_var_rawdcf_parity=no
2151 AC_MSG_CHECKING(RCC 8000 clock)
2152 AC_ARG_ENABLE(RCC8000, [ --enable-RCC8000 s RCC 8000 clock],
2153 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2154 if test "$ntp_ok" = "yes"; then
2157 AC_DEFINE(CLOCK_RCC8000)
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(Schmid DCF77 clock)
2167 AC_ARG_ENABLE(SCHMID, [ --enable-SCHMID s Schmid DCF77 clock],
2168 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2169 if test "$ntp_ok" = "yes"; then
2172 AC_DEFINE(CLOCK_SCHMID)
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_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2182 AC_ARG_ENABLE(TRIMTAIP, [ --enable-TRIMTAIP s Trimble GPS receiver/TAIP protocol],
2183 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2184 if test "$ntp_ok" = "yes"; then
2187 AC_DEFINE(CLOCK_TRIMTAIP)
2189 AC_MSG_RESULT($ntp_ok)
2190 case "$ntp_ok$ntp_canparse" in
2192 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2196 AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2197 AC_ARG_ENABLE(TRIMTSIP, [ --enable-TRIMTSIP s Trimble GPS receiver/TSIP protocol],
2198 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2199 if test "$ntp_ok" = "yes"; then
2202 AC_DEFINE(CLOCK_TRIMTSIP)
2204 AC_MSG_RESULT($ntp_ok)
2205 case "$ntp_ok$ntp_canparse" in
2207 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2211 AC_MSG_CHECKING(WHARTON 400A Series clock)
2212 AC_ARG_ENABLE(WHARTON, [ --enable-WHARTON s WHARTON 400A Series clock],
2213 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2214 if test "$ntp_ok" = "yes"; then
2217 AC_DEFINE(CLOCK_WHARTON_400A)
2219 AC_MSG_RESULT($ntp_ok)
2220 case "$ntp_ok$ntp_canparse" in
2222 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2226 AC_MSG_CHECKING(VARITEXT clock)
2227 AC_ARG_ENABLE(VARITEXT, [ --enable-VARITEXT s VARITEXT clock],
2228 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2229 if test "$ntp_ok" = "yes"; then
2232 AC_DEFINE(CLOCK_VARITEXT)
2234 AC_MSG_RESULT($ntp_ok)
2235 case "$ntp_ok$ntp_canparse" in
2237 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2241 AC_SUBST(MAKE_LIBPARSE)
2242 AC_SUBST(MAKE_LIBPARSE_KERNEL)
2243 AC_SUBST(MAKE_CHECK_Y2K)
2244 AC_MSG_CHECKING(if we need to make and use the parse libraries)
2246 case "$ntp_libparse" in
2249 AC_DEFINE(CLOCK_PARSE)
2250 LIBPARSE=../libparse/libparse.a
2251 MAKE_LIBPARSE=libparse.a
2252 MAKE_CHECK_Y2K=check_y2k
2253 AC_DEFINE(PPS_SAMPLE)
2254 AC_DEFINE(CLOCK_ATOM)
2264 AC_SUBST(MAKE_LIBRSAREF)
2267 AC_SUBST(OPENSSL_INC)
2268 AC_SUBST(OPENSSL_LIB)
2270 AC_SUBST(MAKE_NTP_GENKEYS)
2272 AC_MSG_CHECKING(for openssl library directory)
2273 AC_ARG_WITH(openssl-libdir,
2274 AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
2275 [ans=$withval], [ans=yes])
2279 ans="/usr/lib /usr/local/lib /usr/local/ssl/lib"
2281 *) # Look where they said
2286 *) # Look for libcrypto.a and libssl.a:
2289 test -f $i/libcrypto.a -a -f $i/libssl.a && break
2304 AC_MSG_CHECKING(for openssl include directory)
2305 AC_ARG_WITH(openssl-incdir,
2306 AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
2307 [ans=$withval], [ans=yes])
2311 ans="/usr/include /usr/local/include /usr/local/ssl/include"
2313 *) # Look where they said
2318 *) # look for openssl/opensslconf.h:
2321 test -f $i/openssl/opensslconf.h && break
2336 AC_MSG_CHECKING(for the level of crypto support)
2338 AC_HELP_STRING([--with-crypto], [+ ={autokey,rsaref}]),
2339 dnl AC_HELP_STRING([--with-crypto], [+ ={autokey,openssl,rsaref}]),
2340 [ans=$withval], [ans=yes])
2345 yes|rsaref) # Just "rsaref" when OpenSSL is ready
2349 if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
2353 # We have OpenSSL inc/lib - use them.
2355 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
2356 LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
2357 LIBS="$LIBS -lcrypto"
2359 AC_DEFINE(OPENSSL, , [Use OpenSSL?])
2360 AC_DEFINE(PUBKEY, , [Public key?])
2367 if test -f $srcdir/rsaref2/source/digit.c
2371 RSASRCS="digit.c digit.h"
2374 if test -f $srcdir/rsaeuro1/source/rsaeuro.h
2377 RSAOBJS="md4c.o shsc.o"
2378 RSASRCS="md4c.c shsc.c"
2381 if test "$ans" = "rsaref"; then
2382 LIBRSAREF=../librsaref/librsaref.a
2383 MAKE_LIBRSAREF=librsaref.a
2386 AC_DEFINE(RSAREF, , [Use RSAREF?])
2396 AC_DEFINE(AUTOKEY, , [Autokey?])
2402 AC_MSG_CHECKING(if we want to compile with ElectricFence)
2403 AC_ARG_WITH(electricfence, [ --with-electricfence - compile with ElectricFence malloc debugger],
2404 [ans=$withval], [ans=no])
2408 LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
2409 EF_PROGS="eftest tstheap"
2421 AC_MSG_CHECKING(if we can make dcf parse utilities)
2423 if test "$ntp_parseutil" = "yes"; then
2425 *-*-sunos4*|*-*-solaris2*|*-*-linux*)
2434 AC_SUBST(MAKE_PARSEKMODULE)
2435 AC_MSG_CHECKING(if we can build kernel streams modules for parse)
2437 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
2441 case "$ac_cv_var_kernel_pll" in
2447 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
2451 MAKE_PARSEKMODULE=parse
2458 AC_MSG_CHECKING(if we need basic refclock support)
2459 if test "$ntp_refclock" = "yes"; then
2462 AC_MSG_RESULT($ntp_refclock)
2464 dnl Things that can be made in clockstuff/
2465 AC_SUBST(PROPDELAY) dnl Set to "propdelay"
2466 AC_SUBST(CHUTEST) dnl Set to "chutest"
2467 AC_SUBST(CLKTEST) dnl Set to "clktest"
2469 AC_SUBST(MAKE_ADJTIMED)
2470 AC_MSG_CHECKING(if we want HP-UX adjtimed support)
2478 if test "$ans" = "yes"; then
2479 MAKE_ADJTIMED=adjtimed
2480 AC_DEFINE(NEED_HPUX_ADJTIME)
2484 AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
2485 [AC_ARG_ENABLE(kmem, [ --enable-kmem s read /dev/kmem for tick and/or tickadj],
2487 [case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
2498 *-*-domainos) # Won't be found...
2515 ac_cv_var_can_kmem=$ans])
2517 case "$ac_cv_var_can_kmem" in
2519 *) AC_DEFINE(NOKMEM) ;;
2522 AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
2523 [AC_ARG_ENABLE(accurate-adjtime, [ --enable-accurate-adjtime
2524 s the adjtime() call is accurate],
2533 mips-sgi-irix[[456]]*)
2545 *-*-solaris2.[[01]]*)
2555 ac_cv_var_adjtime_is_accurate=$ans])
2556 case "$ac_cv_var_adjtime_is_accurate" in
2557 yes) AC_DEFINE(ADJTIME_IS_ACCURATE) ;;
2560 AC_CACHE_CHECK([the name of 'tick' in the kernel],
2561 ac_cv_var_nlist_tick,
2564 m68*-hp-hpux*) # HP9000/300?
2589 ac_cv_var_nlist_tick=$ans])
2590 case "$ac_cv_var_nlist_tick" in
2591 ''|no) ;; # HMS: I think we can only get 'no' here...
2592 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick") ;;
2595 AC_CACHE_CHECK([for the units of 'tick'],
2596 ac_cv_var_tick_nano,
2603 ac_cv_var_tick_nano=$ans])
2604 case "$ac_cv_var_tick_nano" in
2606 AC_DEFINE(TICK_NANO)
2610 AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
2611 ac_cv_var_nlist_tickadj,
2614 m68*-hp-hpux*) # HP9000/300?
2642 ans=no # hrestime_adj
2648 ac_cv_var_nlist_tickadj=$ans])
2649 case "$ac_cv_var_nlist_tickadj" in
2650 ''|no) ;; # HMS: I think we can only get 'no' here...
2651 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj") ;;
2654 AC_CACHE_CHECK([for the units of 'tickadj'],
2655 ac_cv_var_tickadj_nano,
2662 ac_cv_var_tickadj_nano=$ans])
2663 case "$ac_cv_var_tickadj_nano" in
2665 AC_DEFINE(TICKADJ_NANO)
2669 AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
2670 ac_cv_var_nlist_dosynctodr,
2706 ac_cv_var_nlist_dosynctodr=$ans])
2707 case "$ac_cv_var_nlist_dosynctodr" in
2709 *) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr")
2713 AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
2714 ac_cv_var_nlist_noprintf,
2744 ac_cv_var_nlist_noprintf=$ans])
2745 case "$ac_cv_var_nlist_noprintf" in
2747 *) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf")
2751 dnl The tick/tickadj sections were written by Skippy, who never learned
2752 dnl that it's impolite (horridly gross) to show your guts in public.
2755 dnl 10000 80 Unixware
2756 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
2757 dnl 10000 150 sgi IRIX
2758 dnl 1000000L/hz 1000 RS6000 && NOKMEM
2759 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
2760 dnl 1000000L/hz 500/HZ other && NOKMEM
2761 dnl txc.tick 1 Linux
2762 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
2763 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
2764 dnl (RS6000 && !NOKMEM), SINIX MIPS
2766 dnl But we'll only use these "values" if we can't find anything else.
2768 AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
2769 [AC_ARG_ENABLE(tick, [ --enable-tick=VALUE s force a value for 'tick'],
2791 ac_cv_var_tick=$ans])
2792 case "$ac_cv_var_tick" in
2793 ''|no) ;; # HMS: I think we can only get 'no' here...
2794 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick) ;;
2797 AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
2798 [AC_ARG_ENABLE(tickadj, [ --enable-tickadj=VALUE s force a value for 'tickadj'],
2803 case "$ac_cv_var_adjtime_is_accurate" in
2804 yes) ans='tick/16' ;;
2814 case "$ac_cv_var_can_kmem" in
2818 *-*-domainos) # Skippy: won't be found...
2819 case "$ac_cv_var_can_kmem" in
2824 case "$ac_cv_var_adjtime_is_accurate" in
2825 yes) ans='tick/16' ;;
2835 case "$ac_cv_var_adjtime_is_accurate" in
2845 ac_cv_var_tickadj=$ans])
2846 case "$ac_cv_var_tickadj" in
2847 ''|no) ;; # HMS: I think we can only get 'no' here...
2848 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj) ;;
2851 # Newer versions of ReliantUNIX round adjtime() values down to
2852 # 1/100s (system tick). Sigh ...
2853 # Unfortunately, there is no easy way to know if particular release
2854 # has this "feature" or any obvious way to test for it.
2856 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK) ;;
2860 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK) ;;
2863 ac_cv_make_tickadj=yes
2864 case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
2865 nonono) # Don't read KMEM, no presets. Bogus.
2866 AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.)
2867 ac_cv_make_tickadj=no
2869 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
2870 AC_MSG_WARN(Can't read kmem but no PRESET_TICK. No tickadj.)
2871 ac_cv_make_tickadj=no
2873 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
2874 AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ. No tickadj.)
2875 ac_cv_make_tickadj=no
2877 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
2879 yesnono) # Read KMEM, no presets. Cool.
2881 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
2882 AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.)
2884 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
2886 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
2888 *) # Generally bogus.
2889 AC_MSG_ERROR(This shouldn't happen.)
2893 AC_SUBST(MAKE_NTPTIME)
2894 AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
2896 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
2906 ac_cv_make_ntptime=$ans])
2907 case "$ac_cv_make_ntptime" in
2909 MAKE_NTPTIME=ntptime
2913 AC_SUBST(MAKE_TICKADJ)
2916 # tickadj is pretty useless on newer versions of ReliantUNIX
2918 ac_cv_make_tickadj=no
2921 ac_cv_make_tickadj=no
2924 # DLM says tickadj is a no-no starting with solaris2.5
2926 *-*-solaris2.[0-4]*) ;;
2927 *) ac_cv_make_tickadj=no ;;
2931 AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
2932 ac_cv_make_tickadj=yes)
2933 case "$ac_cv_make_tickadj" in
2935 MAKE_TICKADJ=tickadj
2939 AC_SUBST(MAKE_TIMETRIM)
2940 AC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
2943 ac_cv_make_timetrim=yes
2946 ac_cv_make_timetrim=no
2949 case "$ac_cv_make_timetrim" in
2951 MAKE_TIMETRIM=timetrim
2955 AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
2956 [AC_ARG_ENABLE(udp-wildcard, [ --enable-udp-wildcard s use UDP wildcard delivery],
3003 ac_cv_var_udp_wildcard_delivery=$ans])
3004 case "$ac_cv_var_udp_wildcard_delivery" in
3005 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY) ;;
3011 *) case "$target" in
3013 LDFLAGS="$LDFLAGS -r"
3019 AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3020 [AC_ARG_ENABLE(slew-always, [ --enable-slew-always s always slew the time],
3032 *-*-openvms*) # HMS: won't be found
3039 ac_cv_var_slew_always=$ans])
3040 case "$ac_cv_var_slew_always" in
3041 yes) AC_DEFINE(SLEWALWAYS) ;;
3044 AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3045 [AC_ARG_ENABLE(step-slew, [ --enable-step-slew s step and slew the time],
3057 *-*-solaris2.[[012]]*)
3060 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
3067 ac_cv_var_step_slew=$ans])
3068 case "$ac_cv_var_step_slew" in
3069 yes) AC_DEFINE(STEP_SLEW) ;;
3072 AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3073 [AC_ARG_ENABLE(ntpdate-step, [ --enable-ntpdate-step s if ntpdate should step the time],
3083 ac_cv_var_ntpdate_step=$ans])
3084 case "$ac_cv_var_ntpdate_step" in
3085 yes) AC_DEFINE(FORCE_NTPDATE_STEP) ;;
3088 AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3089 [AC_ARG_ENABLE(hourly-todr-sync, [ --enable-hourly-todr-sync
3090 s if we should sync TODR hourly],
3096 *-*-openvms*) # HMS: won't be found
3102 ac_cv_var_sync_todr=$ans])
3103 case "$ac_cv_var_sync_todr" in
3104 yes) AC_DEFINE(DOSYNCTODR) ;;
3107 AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3108 [AC_ARG_ENABLE(kernel-fll-bug, [ --enable-kernel-fll-bug s if we should avoid a kernel FLL bug],
3121 # Generic_105181-17 and higher
3141 # Generic_106541-07 and higher
3155 ac_cv_var_kernel_fll_bug=$ans])
3156 case "$ac_cv_var_kernel_fll_bug" in
3157 yes) AC_DEFINE(KERNEL_FLL_BUG) ;;
3163 *) case "$target" in
3165 LDFLAGS="$LDFLAGS -r"
3171 AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
3173 # This is necessary so that .o files in LIBOBJS are also built via
3174 # the ANSI2KNR-filtering rules.
3175 LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
3177 AC_CONFIG_FILES(Makefile adjtimed/Makefile clockstuff/Makefile \
3178 ElectricFence/Makefile
3179 include/Makefile kernel/Makefile kernel/sys/Makefile libntp/Makefile \
3180 libparse/Makefile librsaref/Makefile ntpd/Makefile ntpdc/Makefile \
3181 ntpdate/Makefile ntpq/Makefile ntptrace/Makefile parseutil/Makefile \
3182 scripts/Makefile scripts/calc_tickadj scripts/checktime scripts/freq_adj \
3183 scripts/mkver scripts/ntp-wait scripts/ntpsweep scripts/ntpver \
3184 scripts/plot_summary scripts/summary util/Makefile)
3185 AC_CONFIG_COMMANDS(default, [[chmod +x scripts/calc_tickadj scripts/checktime scripts/freq_adj scripts/mkver scripts/ntp-wait scripts/ntpsweep scripts/ntpver scripts/plot_summary scripts/summary]], [])
3187 #test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])