source: trunk/third/xntp/configure.in @ 10921

Revision 10921, 51.0 KB checked in by brlewis, 27 years ago (diff)
Set lbindir and lsbindir if not already set by Athena config.site
Line 
1dnl -*-fundamental-*-
2dnl Process this file with autoconf to produce a configure script.
3AC_INIT(xntpd/ntp_refclock.c)
4AM_INIT_AUTOMAKE(xntp3, 5.91)
5AC_CANONICAL_SYSTEM
6AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target")
7AM_CONFIG_HEADER(config.h)
8AC_ARG_PROGRAM
9
10dnl  we need to check for cross compile tools for vxWorks here
11AC_PROG_CC
12AC_PROG_CPP
13
14case "$host" in
15 $target)
16    ;;
17 *) case "$target" in
18     *-*-vxworks*)
19        # Quick and dirty sanity check
20        case "$VX_KERNEL" in
21         '') AC_MSG_ERROR(Please follow the directions in html/vxworks.html!)
22            ;;
23        esac
24        CFLAGS="$CFLAGS -DSYS_VXWORKS"
25        ;;
26    esac
27    ;;
28esac
29
30dnl  we need to check for cross compile tools for vxWorks here
31AC_PROG_AWK
32AC_PROG_MAKE_SET
33
34rm -f conftest*
35
36case "$GCC" in
37 yes)
38    CFLAGS="$CFLAGS -Wall"
39    # CFLAGS="$CFLAGS -Wtraditional"
40    # CFLAGS="$CFLAGS -Wshadow"
41    # CFLAGS="$CFLAGS -Wwrite-strings"
42    # CFLAGS="$CFLAGS -Wconversion"
43    # CFLAGS="$CFLAGS -Wpointer-arith"
44    # CFLAGS="$CFLAGS -Wcast-qual"
45    # CFLAGS="$CFLAGS -Wcast-align"
46    # CFLAGS="$CFLAGS -Wstrict-prototypes"
47
48    AC_CACHE_CHECK(whether ${CC-cc} accepts -pipe, ac_cv_prog_cc_pipe,
49    [echo 'void f(){}' > conftest.c
50    if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`"; then
51      ac_cv_prog_cc_pipe=yes
52    else
53      ac_cv_prog_cc_pipe=no
54    fi
55    rm -f conftest*
56    ])
57
58    case "$ac_cv_prog_cc_pipe" in
59     yes)
60        CFLAGS="$CFLAGS -pipe"
61        ;;
62    esac
63    ;;
64esac
65
66ac_busted_vpath_in_make=no
67
68case "$target" in
69 *-*-irix6.1*)  # 64 bit only
70    ;;
71 *-*-irix6*)    # 6.2 (and later?)
72    ac_busted_vpath_in_make=yes
73    case "$CFLAGS" in
74     *-n32*) ;;
75     *-n64*) ;;
76     *) CFLAGS="$CFLAGS -n32" ;;
77    esac
78    case "$LDFLAGS" in
79     *-n32*) ;;
80     *-n64*) ;;
81     *) LDFLAGS="$LDFLAGS -n32" ;;
82    esac
83    ;;
84esac
85
86case "$ac_busted_vpath_in_make$srcdir" in
87 no*) ;;
88 yes.) ;;
89 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
90     '')
91        AC_MSG_ERROR(building outside of the main directory requires GNU make)
92        ;;
93     *) ;;
94    esac
95    ;;
96esac
97
98AC_SUBST(CFLAGS)dnl
99AC_SUBST(LDFLAGS)dnl
100
101AC_PROG_LN_S
102AC_PROG_GCC_TRADITIONAL
103AC_AIX
104AC_MINIX
105AC_ISC_POSIX
106AC_PROG_RANLIB
107
108case "$target" in
109 *-*-vxworks*)
110    ac_link="$ac_link $VX_KERNEL"
111    ;;
112esac
113
114AC_PROG_INSTALL
115
116dnl We might need this for other systems...
117check_libnsl=yes
118check_libsocket=yes
119changequote(<<, >>)dnl
120case "$target" in
121 *-*-irix[56]*)
122    check_libnsl=no
123    check_libsocket=no
124    ;;
125esac
126changequote([, ])dnl
127
128check_libgen=no
129case "$target" in
130 *-univel-sysv4.2*)
131    check_libgen=yes
132    ;;
133esac
134
135AC_CHECK_LIB(elf, nlist)
136case "$check_libgen" in
137 yes)
138    AC_CHECK_LIB(gen, openlog)
139    ;;
140esac
141dnl AC_CHECK_LIB(kvm, main, , , -lelf)
142AC_CHECK_LIB(kvm, main)         dnl We already know about -lelf here...
143AC_CHECK_LIB(ld, nlist)
144AC_CHECK_LIB(mld, nlist)
145case "$check_libnsl" in
146 yes)
147    AC_CHECK_LIB(nsl, gethostbyaddr, , , -lsocket)
148    ;;
149esac
150AC_CHECK_LIB(posix4, main)      dnl What function can we look for?
151case "$check_libsocket" in
152 yes)
153    AC_CHECK_LIB(socket, socket)
154    ;;
155esac
156
157AC_HEADER_STDC
158AC_CHECK_HEADERS(errno.h fcntl.h memory.h sched.h sgtty.h stdlib.h string.h)
159AC_CHECK_HEADERS(termio.h termios.h unistd.h utmp.h utmpx.h)
160AC_CHECK_HEADERS(net/if.h netinet/in.h netinet/ip.h sys/bsd_audioirig.h)
161AC_CHECK_HEADERS(sys/chudefs.h sys/clkdefs.h sys/file.h)
162case "$target" in
163 *-*-sunos4*) ;;
164 *) AC_CHECK_HEADERS(sys/ioctl.h)
165    ;;
166esac
167AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
168AC_CHECK_HEADERS(sys/proc.h sys/resource.h)
169case "$target" in
170 *-*-sco3.2v4.2)
171    ;;
172 *)
173    AC_CHECK_HEADERS(sys/select.h)
174    ;;
175esac
176AC_CHECK_HEADERS(sys/sockio.h sys/stat.h sys/stream.h sys/stropts.h)
177AC_CHECK_HEADERS(sys/sysctl.h sys/time.h sys/timers.h sys/timex.h sys/tpro.h)
178AC_CHECK_HEADERS(sys/types.h)
179AC_HEADER_TIME
180case "$target" in
181*-convex-*)
182  AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
183  ;;
184*-*-bsdi*)
185  AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
186  ;;
187esac
188
189AC_CHECK_HEADER(nlist.h,
190[AC_DEFINE(NLIST_STRUCT)
191AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
192[AC_TRY_COMPILE([#include <nlist.h>],
193[struct nlist n; n.n_un.n_name = 0;],
194ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
195if test $ac_cv_struct_nlist_n_un = yes; then
196  AC_DEFINE(NLIST_NAME_UNION)
197fi
198])dnl
199
200AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
201[AC_TRY_COMPILE([],[
202volatile int x;],
203        ac_cv_c_volatile=yes,
204        ac_cv_c_volatile=no)
205])
206case "$ac_cv_c_volatile" in
207 yes)
208    ;;
209 *) AC_DEFINE(volatile,)
210    ;;
211esac
212
213AC_C_CONST
214case "$host" in
215 $target)
216    AC_C_BIGENDIAN
217    ;;
218 *) case "$target" in
219     i*86-*-vxworks*)
220        # LITTLEENDIAN
221        ;;
222     *-*-vxworks*)
223        AC_DEFINE(WORDS_BIGENDIAN)
224        ;;
225     *) AC_MSG_ERROR(Cross-compiling needs explicit byte order)
226        ;;
227    esac
228    ;;
229esac
230AC_TYPE_SIGNAL
231AC_STRUCT_TM
232
233AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
234[ac_cv_var_default_hz=100
235case "$target" in
236 alpha-dec-osf4*)
237    ac_cv_var_default_hz=1024
238    ;;
239 mips-dec-ultrix4*)
240    ac_cv_var_default_hz=256
241    ;;
242esac])
243AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz)
244
245AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
246[ac_cv_var_override_hz=no
247case "$target" in
248 alpha-dec-osf4*)
249    ac_cv_var_override_hz=yes
250    ;;
251 mips-dec-ultrix4*)
252    ac_cv_var_override_hz=yes
253    ;;
254 *-*-freebsd*)
255    ac_cv_var_override_hz=yes
256    ;;
257 *-*-sunos4*)
258    ac_cv_var_override_hz=yes
259    ;;
260esac])
261case "$ac_cv_var_override_hz" in
262 yes)
263    AC_DEFINE(OVERRIDE_HZ)
264    ;;
265esac
266
267dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
268dnl [AC_TRY_LINK([#include <sys/types.h>
269dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
270dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
271dnl if test $su_cv_func_ut_host_in_utmp = yes; then
272dnl   AC_DEFINE(HAVE_UT_HOST)
273dnl fi
274
275dnl AC_MSG_CHECKING(if we can get the system boot time)
276dnl AC_CACHE_VAL(su_cv_have_boot_time,
277dnl [AC_EGREP_CPP(yes,
278dnl [#ifdef HAVE_UTMPX_H
279dnl #include <utmpx.h>
280dnl #else
281dnl #include <utmp.h>
282dnl #endif
283dnl #ifdef BOOT_TIME
284dnl yes
285dnl #endif
286dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
287dnl AC_MSG_RESULT($su_cv_have_boot_time)
288
289AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
290[AC_TRY_COMPILE([
291#include <sys/types.h>
292#include <sys/socket.h>],[
293extern struct sockaddr *ps;
294return ps->sa_len;],
295        ac_cv_struct_sockaddr_has_sa_len=yes,
296        ac_cv_struct_sockaddr_has_sa_len=no)
297])
298if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
299    AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR)
300fi
301
302AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
303[AC_TRY_COMPILE([
304#include <sys/time.h>],[
305extern struct clockinfo *pc;
306return pc->hz;],
307        ac_cv_struct_clockinfo_has_hz=yes,
308        ac_cv_struct_clockinfo_has_hz=no)
309])
310if test $ac_cv_struct_clockinfo_has_hz = yes; then
311    AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO)
312fi
313
314AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
315[AC_TRY_COMPILE([
316#include <sys/time.h>],[
317extern struct clockinfo *pc;
318return pc->tickadj;],
319        ac_cv_struct_clockinfo_has_tickadj=yes,
320        ac_cv_struct_clockinfo_has_tickadj=no)
321])
322if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
323    AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO)
324fi
325
326AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
327[AC_TRY_COMPILE([
328extern int foo (short);
329int foo(short i) { return i; }],[
330int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
331])
332if test "$ac_cv_have_prototypes" = yes; then
333  AC_DEFINE(HAVE_PROTOTYPES)
334fi
335
336AC_C_CHAR_UNSIGNED              dnl CROSS_COMPILE?
337case "$host" in
338 $target)
339    AC_CHECK_SIZEOF(signed char)
340    ;;
341 *) case "$target" in
342     *-*-vxworks*)
343        AC_CHECK_SIZEOF(signed char, 1)
344        ;;
345     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_SIGNED_LONG)
346        ;;
347    esac
348    ;;
349esac
350
351case "$host" in
352 $target)
353    AC_CHECK_SIZEOF(int)
354    ;;
355 *) case "$target" in
356     *-*-vxworks*)
357        AC_CHECK_SIZEOF(int, 4)
358        ;;
359     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_INT)
360        ;;
361    esac
362    ;;
363esac
364
365case "$host" in
366 $target)
367    AC_CHECK_SIZEOF(long)
368    ;;
369 *) case "$target" in
370     *-*-vxworks*)
371        AC_CHECK_SIZEOF(long, 4)
372        ;;
373     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_LONG)
374        ;;
375    esac
376    ;;
377esac
378
379AC_CHECK_TYPE(s_char, signed char)
380case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
381 *yes)
382    # We have a typedef for s_char.  Might as well believe it...
383    ;;
384 no0no)
385    # We have signed chars, can't say 'signed char', no s_char typedef.
386    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
387    ;;
388 no1no)
389    # We have signed chars, can say 'signed char', no s_char typedef.
390    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
391    ;;
392 yes0no)
393    # We have unsigned chars, can't say 'signed char', no s_char typedef.
394    AC_MSG_ERROR(No way to specify a signed character!)
395    ;;
396 yes1no)
397    # We have unsigned chars, can say 'signed char', no s_char typedef.
398    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
399    ;;
400esac
401AC_TYPE_UID_T
402
403case "$target" in
404 *-*-linux*)
405    AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
406    ;;
407esac
408AC_CHECK_FUNCS(clock_settime daemon getbootfile getdtablesize getrusage)
409AC_CHECK_FUNCS(gettimeofday getuid K_open kvm_open memcpy memmove memset)
410AC_CHECK_FUNCS(mkstemp)
411case "$target" in
412 *-*-irix*)
413    # Just stubs in Irix.  Idiots.
414    ;;
415 *) AC_CHECK_FUNCS(mlockall)
416    ;;
417esac
418AC_CHECK_FUNCS(nice nlist ntp_adjtime ntp_gettime plock)
419AC_CHECK_FUNCS(pututline pututxline rtprio)
420case "$target" in
421 *-*-solaris2.5*)
422    # Just stubs in solaris2.5.  Idiots.
423    ;;
424 *) AC_CHECK_FUNCS(sched_setscheduler)
425    ;;
426esac
427AC_CHECK_FUNCS(setlinebuf)
428AC_CHECK_FUNCS(setpgid setpriority setsid settimeofday setvbuf sigaction)
429AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
430AC_CHECK_FUNCS(timer_create timer_settime umask uname updwtmp updwtmpx)
431AC_CHECK_FUNCS(vsprintf)
432
433AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
434[AC_TRY_COMPILE([#include <sys/time.h>],[
435gettimeofday((struct timeval*)0,(struct timezone*)0);
436settimeofday((struct timeval*)0,(struct timezone*)0);
437],
438        ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
439])
440if test $ac_cv_func_Xettimeofday_nargs = 1; then
441        AC_DEFINE(SYSV_TIMEOFDAY)
442fi
443
444AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
445[AC_TRY_COMPILE([
446#ifdef HAVE_SYS_TYPES_H
447# include <sys/types.h>
448#endif
449#ifdef HAVE_UNISTD_H
450# include <unistd.h>
451#endif
452],[setpgrp(0,0);],
453        ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
454])
455if test $ac_cv_func_setpgrp_nargs = 0; then
456        AC_DEFINE(HAVE_SETPGRP_0)
457fi
458
459save_CFLAGS=$CFLAGS
460CFLAGS="$CFLAGS -I$srcdir/include"
461
462AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
463ac_cv_func_qsort_argtype,
464[AC_TRY_COMPILE([
465#include "l_stdlib.h"
466
467#ifdef HAVE_PROTOTYPES
468#define P(x) x
469#else
470#define P(x) ()
471#endif
472
473extern void *base;
474extern sortfunc P((const void *, const void *));
475int sortfunc(a, b)
476  const void *a;
477  const void *b; { return 0; }
478],[
479qsort(base, 2, sizeof(char *), sortfunc);
480],
481        ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
482])
483case "$ac_cv_func_qsort_argtype" in
484 void)
485    AC_DEFINE(QSORT_USES_VOID_P)
486    ;;
487esac
488
489CFLAGS=$save_CFLAGS
490
491dnl See if char *sys_errlist[] is OK.
492dnl If you get the quoting right on the next line, you tried something I didn't.
493AC_CACHE_CHECK(if declaring 'char *sys_errlist[]' is ok, ac_cv_decl_sys_errlist,
494[AC_TRY_COMPILE([#include <stdio.h>
495#ifdef HAVE_ERRNO_H
496#include <errno.h>
497#endif],
498  changequote(<<, >>)dnl
499  <<extern char *sys_errlist[];>>
500  changequote([, ]),
501  ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
502case "$ac_cv_decl_sys_errlist" in
503 yes) AC_DEFINE(CHAR_SYS_ERRLIST) ;;
504esac
505
506AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
507[AC_TRY_COMPILE([
508#ifdef HAVE_SYS_TYPES_H
509# include <sys/types.h>
510#endif
511#ifdef HAVE_UNISTD_H
512# include <unistd.h>
513#endif
514#ifdef HAVE_PROTOTYPES
515#define P(x) x
516#else
517#define P(x) ()
518#endif
519],
520  [extern int syscall P((int, struct timeval *, struct timeval *));],
521  ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
522case "$ac_cv_decl_syscall" in
523 yes) AC_DEFINE(DECL_SYSCALL) ;;
524esac
525
526case "$target" in
527 *-*-osf4*)
528    AC_DEFINE(DECL_PLOCK_0)
529    ;;
530 *-*-riscos4*)
531    AC_DEFINE(DECL_ADJTIME_0)
532    AC_DEFINE(DECL_BZERO_0)
533    AC_DEFINE(DECL_IOCTL_0)
534    AC_DEFINE(DECL_IPC_0)
535    AC_DEFINE(DECL_MEMMOVE_0)
536    AC_DEFINE(DECL_MKTEMP_0)
537    AC_DEFINE(DECL_RENAME_0)
538    AC_DEFINE(DECL_SELECT_0)
539    AC_DEFINE(DECL_SETITIMER_0)
540    AC_DEFINE(DECL_SETPRIORITY_0)
541    AC_DEFINE(DECL_STDIO_0)
542    AC_DEFINE(DECL_STRTOL_0)
543    AC_DEFINE(DECL_SYSLOG_0)
544    AC_DEFINE(DECL_TIME_0)
545    AC_DEFINE(DECL_TIMEOFDAY_0)
546    AC_DEFINE(DECL_TOLOWER_0)
547    ;;
548 *-*-solaris2*)
549    AC_DEFINE(DECL_MKSTEMP_0)
550    AC_DEFINE(DECL_SETPRIORITY_1)
551    ;;
552 *-*-sunos4*)
553    AC_DEFINE(DECL_ADJTIME_0)
554    AC_DEFINE(DECL_BCOPY_0)
555    AC_DEFINE(DECL_BZERO_0)
556    AC_DEFINE(DECL_IOCTL_0)
557    AC_DEFINE(DECL_IPC_0)
558    AC_DEFINE(DECL_MEMMOVE_0)
559    AC_DEFINE(DECL_MKTEMP_0)
560    AC_DEFINE(DECL_RENAME_0)
561    AC_DEFINE(DECL_SELECT_0)
562    AC_DEFINE(DECL_SETITIMER_0)
563    AC_DEFINE(DECL_SETPRIORITY_0)
564    AC_DEFINE(DECL_SIGVEC_0)
565    case "`basename $ac_cv_prog_CC`" in
566     acc*) ;;
567     *) AC_DEFINE(DECL_STDIO_0)
568        ;;
569    esac
570    AC_DEFINE(DECL_STRTOL_0)
571    AC_DEFINE(DECL_SYSLOG_0)
572    AC_DEFINE(DECL_TIME_0)
573    AC_DEFINE(DECL_TIMEOFDAY_0)
574    AC_DEFINE(DECL_TOLOWER_0)
575    ;;
576esac
577
578AC_CACHE_CHECK(if we should use a streams device for ifconfig,
579 ac_cv_var_use_streams_device_for_ifconfig,
580 ac_cv_var_use_streams_device_for_ifconfig=no)
581
582AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
583[ans=no
584changequote(<<, >>)dnl
585case "$target" in
586 *-*-hpux[567]*)
587    ans=yes
588    ;;
589esac
590changequote([, ])dnl
591ac_cv_var_rcvbuf_slop=$ans])
592case "$ac_cv_var_rcvbuf_slop" in
593 yes) AC_DEFINE(NEED_RCVBUF_SLOP) ;;
594esac
595
596AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
597[ans=yes
598case "$target" in
599 *-*-domainos)
600    ans=no
601    ;;
602 *-*-linux*)
603    ans=no
604    ;;
605esac
606ac_cv_var_open_bcast_socket=$ans])
607case "$ac_cv_var_open_bcast_socket" in
608 yes) AC_DEFINE(OPEN_BCAST_SOCKET) ;;
609esac
610
611AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
612[ans=no
613case "$target" in
614 *-*-hpux*)
615    ans=yes
616    ;;
617esac
618ac_cv_var_hpux_findconfig=$ans])
619case "$ac_cv_var_hpux_findconfig" in
620 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG) ;;
621esac
622
623AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
624[changequote(<<, >>)dnl
625case "$target" in
626 *-*-hpux[567]*)
627    ans=no
628    ;;
629 *-*-hpux*)
630    ans=yes
631    ;;
632 *-*-linux*)
633    ans=yes
634    ;;
635 *-*-sunos3*)
636    ans=yes
637    ;;
638 *-*-ultrix2*)
639    ans=yes
640    ;;
641 *)
642    ans=no
643    ;;
644esac
645changequote([, ])dnl
646ac_cv_arg_setpgrp_negpid=$ans])
647case "$ac_cv_arg_setpgrp_negpid" in
648 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN) ;;
649esac
650
651AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
652[case "$target" in
653 *-*-bsdi2*)
654    ans=yes
655    ;;
656 *-*-freebsd*)
657    ans=yes
658    ;;
659 *-*-osf*)
660    ans=yes
661    ;;
662 *) ans=no
663    ;;
664esac
665ac_cv_func_ctty_for_f_setown=$ans])
666case "$ac_cv_func_ctty_for_f_setown" in
667 yes) AC_DEFINE(USE_FSETOWNCTTY) ;;
668esac
669
670ntp_warning='GRONK'
671AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
672case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
673 yes*)
674    ntp_warning=''
675    ans='clock_settime()'
676    ;;
677 noyes*)
678    ntp_warning='But clock_settime() would be better (if we had it)'
679    ans='settimeofday()'
680    ;;
681 nonoyes)
682    ntp_warning='Which is the worst of the three'
683    ans='stime()'
684    ;;
685 *)
686    case "$host" in
687     $target) ntp_warning='Which leaves us with nothing to use!'
688    ans=none
689    ;;
690esac
691esac
692AC_MSG_RESULT($ans)
693case "$ntp_warning" in
694 '') ;;
695 *) AC_MSG_WARN(*** $ntp_warning ***)
696    ;;
697esac
698
699AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
700[case "$target" in
701 *-*-solaris2.4*)
702    ans=yes
703    ;;
704 *) ans=no
705    ;;
706esac
707ac_cv_var_syscall_bug=$ans])
708case "$ac_cv_var_syscall_bug" in
709 yes) AC_DEFINE(SYSCALL_BUG) ;;
710esac
711
712AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
713[ case "$ac_cv_header_sys_stropts_h" in
714  yes)
715     ans=no
716     # There must be a better way...
717     case "$target" in
718      *-sni-sysv*)
719         ans=yes
720         ;;
721      *-*-ptx*)
722         ans=yes
723         ;;
724     esac
725     ;;
726 esac
727 ac_cv_var_streams_tli=$ans])
728case "$ac_cv_var_streams_tli" in
729 yes)
730    AC_DEFINE(STREAMS_TLI)
731    ;;
732esac
733
734AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
735 AC_EGREP_CPP(yes,
736  [#include <signal.h>
737#ifdef SIGIO
738   yes
739#endif
740  ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
741
742dnl Override those system that have a losing SIGIO
743AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
744[ans=no
745case "$ac_cv_hdr_def_sigio" in
746 yes)
747    ans=yes
748    case "$target" in
749     alpha-dec-osf4*)
750        ans=no
751        ;;
752     *-convex-*)
753        ans=no
754        ;;
755     *-dec-*)
756        ans=no
757        ;;
758     *-sni-sysv*)
759        ans=no
760        ;;
761     *-univel-sysv*)
762        ans=no
763        ;;
764     *-*-irix6*)
765        ans=no
766        ;;
767     *-*-linux*)
768        ans=no
769        ;;
770    esac
771    ;;
772esac
773ac_cv_var_signalled_io=$ans])
774case "$ac_cv_var_signalled_io" in
775 yes) AC_DEFINE(HAVE_SIGNALED_IO) ;;
776esac
777
778AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
779 AC_EGREP_CPP(yes,
780 [#include <signal.h>
781#ifdef SIGPOLL
782  yes
783#endif
784 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
785
786AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
787 AC_EGREP_CPP(yes,
788 [#include <signal.h>
789#ifdef SIGSYS
790  yes
791#endif
792 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
793
794AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
795[ans=no
796case "$ac_cv_hdr_def_sigpoll" in
797 yes)
798    changequote(<<, >>)dnl
799    case "$target" in
800     mips-sgi-irix*)
801        ans=no
802        ;;
803     vax-dec-bsd)
804        ans=no
805        ;;
806     *-sni-sysv*)
807        ans=no
808        ;;
809     *-*-aix4*)
810        ans=no
811        ;;
812     *-*-hpux*)
813        ans=no
814        ;;
815     *-*-linux*)
816        ans=no
817        ;;
818     *-*-osf*)
819        ans=no
820        ;;
821     *-*-sunos*)
822        ans=no
823        ;;
824     *-*-ultrix*)
825        ans=no
826        ;;
827     *) ans=yes
828        ;;
829    esac
830    changequote([, ])dnl
831    ;;
832esac
833ac_cv_var_use_udp_sigpoll=$ans])
834case "$ac_cv_var_use_udp_sigpoll" in
835 yes) AC_DEFINE(USE_UDP_SIGPOLL) ;;
836esac
837
838AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
839[ans=no
840case "$ac_cv_hdr_def_sigpoll" in
841 yes)
842    case "$target" in
843     mips-sgi-irix*)
844        ans=no
845        ;;
846     vax-dec-bsd)
847        ans=no
848        ;;
849     *-sni-sysv*)
850        ans=no
851        ;;
852     *-*-aix4*)
853        ans=no
854        ;;
855     *-*-hpux*)
856        ans=no
857        ;;
858     *-*-linux*)
859        ans=no
860        ;;
861     *-*-osf*)
862        ans=no
863        ;;
864     *-*-sunos*)
865        ans=no
866        ;;
867     *-*-ultrix*)
868        ans=no
869        ;;
870     *) ans=yes
871        ;;
872    esac
873    ;;
874esac
875ac_cv_var_use_tty_sigpoll=$ans])
876case "$ac_cv_var_use_tty_sigpoll" in
877 yes) AC_DEFINE(USE_TTY_SIGPOLL) ;;
878esac
879
880AC_CACHE_CHECK(if nlist() values might require extra indirection,
881ac_cv_var_nlist_extra_indirection,
882[ans=no
883case "$target" in
884 *-*-aix*)
885    ans=yes
886    ;;
887esac
888ac_cv_var_nlist_extra_indirection=$ans])
889case "$ac_cv_var_nlist_extra_indirection" in
890 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION) ;;
891esac
892
893AC_CACHE_CHECK(for a minimum recommended value of tickadj,
894ac_cv_var_min_rec_tickadj,
895[ans=no
896case "$target" in
897 *-*-aix*)
898    ans=40
899    ;;
900esac
901ac_cv_var_min_rec_tickadj=$ans])
902case "$ac_cv_var_min_rec_tickadj" in
903 ''|no) ;;
904 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj) ;;
905esac
906
907AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
908ac_cv_var_no_parenb_ignpar,
909[ans=no
910case "$target" in
911 mips-sgi-irix*)
912    ans=yes
913    ;;
914esac
915ac_cv_var_no_parenb_ignpar=$ans])
916case "$ac_cv_var_no_parenb_ignpar" in
917 yes) AC_DEFINE(NO_PARENB_IGNPAR) ;;
918esac
919
920AC_MSG_CHECKING(if we're including debugging code)
921AC_ARG_ENABLE(debugging,        [  --enable-debugging       + include debugging code],
922    [ntp_ok=$enableval], [ntp_ok=yes])
923if test "$ntp_ok" = "yes"; then
924    AC_DEFINE(DEBUG)
925fi
926AC_MSG_RESULT($ntp_ok)
927
928AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
929 ac_cv_var_tty_clk,
930 ac_cv_var_tty_clk=$ac_cv_header_sys_clkdefs_h)
931case "$ac_cv_var_tty_clk" in
932 yes) AC_DEFINE(TTYCLK) ;;
933esac
934
935AC_CACHE_CHECK(for the ppsclock streams module,
936 ac_cv_var_ppsclock,
937 ac_cv_var_ppsclock=$ac_cv_header_sys_ppsclock_h)
938case "$ac_cv_var_ppsclock" in
939 yes) AC_DEFINE(PPS) ;;
940esac
941
942AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
943 AC_EGREP_CPP(yes,
944  [#include <netinet/in.h>
945#ifdef IP_ADD_MEMBERSHIP
946   yes
947#endif
948  ], ac_cv_var_mcast=yes, ac_cv_var_mcast=no))
949case "$ac_cv_var_mcast" in
950 yes) AC_DEFINE(MCAST) ;;
951esac
952
953AC_CACHE_CHECK([availability of ntp_{adj,get}time()], ac_cv_var_ntp_syscalls,
954 [ac_cv_var_ntp_syscalls=no
955 case "$ac_cv_func___adjtimex$ac_cv_func___ntp_gettime" in
956  yesyes)
957    ac_cv_var_ntp_syscalls=libc
958    ;;
959  *) case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
960      yesyes)
961        ac_cv_var_ntp_syscalls=libc
962        ;;
963      *) AC_EGREP_CPP(yes,
964         [#include <sys/syscall.h>
965#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
966           yes
967#endif
968          ], ac_cv_var_ntp_syscalls=kernel)
969         ;;
970     esac
971     ;;
972 esac])
973case "$ac_cv_var_ntp_syscalls" in
974 libc)
975    AC_DEFINE(NTP_SYSCALLS_LIBC)
976    ;;
977 kernel)
978    AC_DEFINE(NTP_SYSCALLS_STD)
979    ;;
980 *)
981    ;;
982esac
983
984AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
985[AC_EGREP_CPP(yes,
986    [#include <sys/timex.h>
987#ifdef STA_FLL
988    yes
989#endif
990    ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
991
992AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
993[dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
994case "$ac_cv_header_sys_timex_h$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
995 *no*)
996    ac_cv_var_kernel_pll=no
997    ;;
998 *) ac_cv_var_kernel_pll=yes
999    ;;
1000esac])
1001case "$ac_cv_var_kernel_pll" in
1002 yes)
1003    AC_DEFINE(KERNEL_PLL)
1004    ;;
1005esac
1006
1007AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1008  [ans=no
1009  case "$target" in
1010   *-fujitsu-uxp*)
1011      ans=yes
1012      ;;
1013   *-ncr-sysv4*)
1014      ans=yes
1015      ;;
1016   *-univel-sysv*)
1017      ans=yes
1018      ;;
1019  esac
1020  ac_cv_var_size_returned_in_buffer=$ans])
1021case "$ac_cv_var_size_returned_in_buffer" in
1022 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER) ;;
1023esac
1024
1025AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1026[AC_ARG_ENABLE(gdt-surveying,   [  --enable-gdt-surveying   - include GDT survey code],
1027    [ans=$enableval], [ans=no])
1028ac_cv_var_gdt_surveying=$ans])
1029case "$ac_cv_var_gdt_surveying" in
1030 yes) AC_DEFINE(GDT_SURVEYING) ;;
1031esac
1032
1033AC_CACHE_CHECK(if we want to use MD5 authentication, ac_cv_var_use_md5,
1034[AC_ARG_ENABLE(md5,             [  --enable-md5             + include support for MD5 keys],
1035    [ans=$enableval], [ans=yes])
1036ac_cv_var_use_md5=$ans])
1037case "$ac_cv_var_use_md5" in
1038 yes) AC_DEFINE(MD5) ;;
1039esac
1040
1041AC_CACHE_CHECK(if we want to use DES authentication, ac_cv_var_use_des,
1042[AC_ARG_ENABLE(des,             [  --enable-des             + include support for DES keys],
1043    [ans=$enableval], [ans=yes])
1044ac_cv_var_use_des=$ans])
1045case "$ac_cv_var_use_des" in
1046 yes) AC_DEFINE(DES) ;;
1047esac
1048
1049dnl These are for OPT_PROGRAMS in authstuff/
1050AC_SUBST(AUTHCERT)
1051AC_SUBST(AUTHSPEED)
1052AC_SUBST(MD5DRIVER)
1053AC_SUBST(KEYPARITY)
1054AC_SUBST(MAKEIPFP)
1055AC_SUBST(MAKEPC1)
1056AC_SUBST(MAKEPC2)
1057AC_SUBST(MAKESP)
1058AC_SUBST(MKRANDKEYS)
1059AC_SUBST(OMAKEIPFP)
1060AC_SUBST(UNIXCERT)
1061
1062ntp_refclock=no
1063
1064# HPUX only, and by explicit request
1065AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1066AC_ARG_ENABLE(BANCOMM,          [  --enable-BANCOMM         - Datum/Bancomm bc635/VME interface],
1067    [ntp_ok=$enableval], [ntp_ok=no])
1068if test "$ntp_ok" = "yes"; then
1069    ntp_refclock=yes
1070    AC_DEFINE(BANC)
1071fi
1072AC_MSG_RESULT($ntp_ok)
1073case "$ntp_ok$target" in
1074 yes*-*-hpux*) ;;
1075 yes*) AC_WARN(*** But the expected answer is... no ***) ;;
1076esac
1077
1078#HPUX only, and only by explicit request
1079AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1080AC_ARG_ENABLE(GPSVME,           [  --enable-GPSVME          - TrueTime GPS receiver/VME interface],
1081    [ntp_ok=$enableval], [ntp_ok=no])
1082if test "$ntp_ok" = "yes"; then
1083    ntp_refclock=yes
1084    AC_DEFINE(GPSVME)
1085fi
1086AC_MSG_RESULT($ntp_ok)
1087case "$ntp_ok$target" in
1088 yes*-*-hpux*) ;;
1089 yes*) AC_WARN(*** But the expected answer is... no ***) ;;
1090esac
1091
1092AC_MSG_CHECKING(for PCL720 clock support)
1093case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1094 yesyesyes)
1095    AC_DEFINE(PPS720)
1096    ans=yes
1097    ;;
1098 *)
1099    ans=no
1100    ;;
1101esac
1102AC_MSG_RESULT($ans)
1103
1104AC_MSG_CHECKING(for SHM clock attached thru shared memory)
1105AC_ARG_ENABLE(SHM,              [  --enable-SHM             - SHM clock attached thru shared memory],
1106    [ntp_ok=$enableval], [ntp_ok=no])
1107if test "$ntp_ok" = "yes"; then
1108    ntp_refclock=yes
1109    AC_DEFINE(SHM_CLOCK)
1110fi
1111AC_MSG_RESULT($ntp_ok)
1112
1113AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1114AC_ARG_ENABLE(all-clocks,       [  --enable-all-clocks      + include all suitable non-PARSE clocks:],
1115    [ntp_eac=$enableval], [ntp_eac=yes])
1116AC_MSG_RESULT($ntp_eac)
1117
1118AC_MSG_CHECKING(if we have support for PARSE clocks)
1119case "$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1120 *yes*)
1121    ntp_canparse=yes
1122    ;;
1123 *) ntp_canparse=no
1124    ;;
1125esac
1126AC_MSG_RESULT($ntp_canparse)
1127
1128# Requires modem control
1129AC_MSG_CHECKING(ACTS modem service)
1130AC_ARG_ENABLE(ACTS,             [  --enable-ACTS             + ACTS modem service],
1131    [ntp_ok=$enableval],
1132    [AC_EGREP_CPP(yes,
1133        [#include <termios.h>
1134#ifdef TIOCMBIS
1135         yes
1136#endif
1137         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1138if test "$ntp_ok" = "yes"; then
1139    ntp_refclock=yes
1140    AC_DEFINE(ACTS)
1141fi
1142AC_MSG_RESULT($ntp_ok)
1143
1144AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1145AC_ARG_ENABLE(ARBITER,          [  --enable-ARBITER          + Arbiter 1088A/B GPS receiver],
1146    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1147if test "$ntp_ok" = "yes"; then
1148    ntp_refclock=yes
1149    AC_DEFINE(ARBITER)
1150fi
1151AC_MSG_RESULT($ntp_ok)
1152
1153AC_MSG_CHECKING(Arcron MSF receiver)
1154AC_ARG_ENABLE(ARCRON_MSF,       [  --enable-ARCRON-MSF       + Arcron MSF receiver],
1155    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1156if test "$ntp_ok" = "yes"; then
1157    ntp_refclock=yes
1158    AC_DEFINE(ARCRON_MSF)
1159fi
1160AC_MSG_RESULT($ntp_ok)
1161
1162AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1163AC_ARG_ENABLE(AS2201,           [  --enable-AS2201           + Austron 2200A/2201A GPS receiver],
1164    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1165if test "$ntp_ok" = "yes"; then
1166    ntp_refclock=yes
1167    AC_DEFINE(AS2201)
1168fi
1169AC_MSG_RESULT($ntp_ok)
1170
1171AC_MSG_CHECKING(PPS interface)
1172AC_ARG_ENABLE(ATOM,             [  --enable-ATOM             + PPS interface],
1173    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1174if test "$ntp_ok" = "yes"; then
1175    ntp_refclock=yes
1176    AC_DEFINE(ATOM)
1177fi
1178AC_MSG_RESULT($ntp_ok)
1179
1180AC_MSG_CHECKING(CHU modem/decoder)
1181AC_ARG_ENABLE(CHU,              [  --enable-CHU              s CHU modem/decoder],
1182    [ntp_ok=$enableval],
1183    [case "$ntp_eac$ac_cv_header_sys_chudefs_h" in
1184     yesyes)
1185        ntp_ok=yes
1186        ;;
1187     *) ntp_ok=no
1188        ;;
1189    esac])
1190if test "$ntp_ok" = "yes"; then
1191    ntp_refclock=yes
1192    AC_DEFINE(CHUCLK)
1193fi
1194AC_MSG_RESULT($ntp_ok)
1195case "$ntp_ok$ac_cv_header_sys_chudefs_h" in
1196 yesno) AC_WARN(*** But the expected answer is... no ***) ;;
1197esac
1198
1199# Not under HP-UX
1200AC_MSG_CHECKING(Datum Programmable Time System)
1201AC_ARG_ENABLE(DATUM,            [  --enable-DATUM            s Datum Programmable Time System],
1202    [ntp_ok=$enableval],
1203    [case "$ac_cv_header_termios_h" in
1204    yes)
1205        ntp_ok=$ntp_eac
1206        ;;
1207    *) ntp_ok=no
1208        ;;
1209    esac])
1210if test "$ntp_ok" = "yes"; then
1211    ntp_refclock=yes
1212    AC_DEFINE(DATUM)
1213fi
1214AC_MSG_RESULT($ntp_ok)
1215
1216# Requires modem control
1217AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1218AC_ARG_ENABLE(HEATH,            [  --enable-HEATH            s Heath GC-1000 WWV/WWVH receiver],
1219    [ntp_ok=$enableval],
1220    [AC_EGREP_CPP(yes,
1221        [#include <termios.h>
1222#ifdef TIOCMBIS
1223         yes
1224#endif
1225         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1226if test "$ntp_ok" = "yes"; then
1227    ntp_refclock=yes
1228    AC_DEFINE(HEATH)
1229fi
1230AC_MSG_RESULT($ntp_ok)
1231
1232AC_MSG_CHECKING(HP 58503A GPS receiver)
1233AC_ARG_ENABLE(HPGPS,            [  --enable-HPGPS            + HP 58503A GPS receiver],
1234    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1235if test "$ntp_ok" = "yes"; then
1236    ntp_refclock=yes
1237    AC_DEFINE(HPGPS)
1238fi
1239AC_MSG_RESULT($ntp_ok)
1240
1241AC_MSG_CHECKING(Sun IRIG audio decoder)
1242AC_ARG_ENABLE(IRIG,             [  --enable-IRIG             s Sun IRIG audio decoder],
1243    [ntp_ok=$enableval],
1244    [case "$ac_cv_header_sys_bsd_audioirig_h" in
1245     yes)
1246        ntp_ok=$ntp_eac
1247        ;;
1248     *) ntp_ok=no
1249        ;;
1250    esac])
1251if test "$ntp_ok" = "yes"; then
1252    ntp_refclock=yes
1253    AC_DEFINE(IRIG)
1254fi
1255AC_MSG_RESULT($ntp_ok)
1256case "$ntp_ok$ac_cv_header_sys_bsd_audioirig_h" in
1257 yesno) AC_WARN(*** But the expected answer is... no ***) ;;
1258esac
1259
1260AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
1261AC_ARG_ENABLE(LEITCH,           [  --enable-LEITCH           + Leitch CSD 5300 Master Clock System Driver],
1262    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1263if test "$ntp_ok" = "yes"; then
1264    ntp_refclock=yes
1265    AC_DEFINE(LEITCH)
1266fi
1267AC_MSG_RESULT($ntp_ok)
1268
1269AC_MSG_CHECKING(local clock reference)
1270AC_ARG_ENABLE(LOCAL-CLOCK,      [  --enable-LOCAL-CLOCK      + local clock reference],
1271    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1272if test "$ntp_ok" = "yes"; then
1273    ntp_refclock=yes
1274    AC_DEFINE(LOCAL_CLOCK)
1275fi
1276AC_MSG_RESULT($ntp_ok)
1277
1278AC_MSG_CHECKING(EES M201 MSF receiver)
1279AC_ARG_ENABLE(MSFEES,           [  --enable-MSFEES           + EES M201 MSF receiver],
1280    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1281if test "$ntp_ok" = "yes"; then
1282    ntp_refclock=yes
1283    AC_DEFINE(MSFEES)
1284fi
1285AC_MSG_RESULT($ntp_ok)
1286
1287# Not Ultrix
1288AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
1289AC_ARG_ENABLE(MX4200,           [  --enable-MX4200           s Magnavox MX4200 GPS receiver],
1290    [ntp_ok=$enableval],
1291    [case "$ac_cv_var_ppsclock" in
1292     yes) ntp_ok=$ntp_eac
1293        ;;
1294     *) ntp_ok=no
1295        ;;
1296    esac])
1297if test "$ntp_ok" = "yes"; then
1298    ntp_refclock=yes
1299    AC_DEFINE(MX4200)
1300fi
1301AC_MSG_RESULT($ntp_ok)
1302case "$ntp_ok$target" in
1303 yes*-*-ultrix*) AC_WARN(*** But the expected answer is... no ***) ;;
1304esac
1305
1306AC_MSG_CHECKING(NMEA GPS receiver)
1307AC_ARG_ENABLE(NMEA,             [  --enable-NMEA             + NMEA GPS receiver],
1308    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1309if test "$ntp_ok" = "yes"; then
1310    ntp_refclock=yes
1311    AC_DEFINE(NMEA)
1312fi
1313AC_MSG_RESULT($ntp_ok)
1314
1315AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
1316AC_ARG_ENABLE(PST,              [  --enable-PST              + PST/Traconex 1020 WWV/WWVH receiver],
1317    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1318if test "$ntp_ok" = "yes"; then
1319    ntp_refclock=yes
1320    AC_DEFINE(PST)
1321fi
1322AC_MSG_RESULT($ntp_ok)
1323
1324# Requires modem control
1325AC_MSG_CHECKING(PTB modem service)
1326AC_ARG_ENABLE(PTBACTS,          [  --enable-PTBACTS          s PTB modem service],
1327    [ntp_ok=$enableval],
1328    [AC_EGREP_CPP(yes,
1329        [#include <termios.h>
1330#ifdef TIOCMBIS
1331         yes
1332#endif
1333         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1334if test "$ntp_ok" = "yes"; then
1335    ntp_refclock=yes
1336    AC_DEFINE(PTBACTS)
1337fi
1338AC_MSG_RESULT($ntp_ok)
1339
1340AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
1341AC_ARG_ENABLE(TPRO,             [  --enable-TPRO             s KSI/Odetics TPRO/S GPS receiver/IRIG interface],
1342    [ntp_ok=$enableval],
1343    [case "$ac_cv_header_sys_tpro_h" in
1344     yes)
1345        ntp_ok=$ntp_eac
1346        ;;
1347     *) ntp_ok=no
1348        ;;
1349    esac])
1350if test "$ntp_ok" = "yes"; then
1351    ntp_refclock=yes
1352    AC_DEFINE(TPRO)
1353fi
1354AC_MSG_RESULT($ntp_ok)
1355case "$ntp_ok$ac_cv_header_sys_tpro" in
1356 yesno) AC_WARN(*** But the expected answer is... no ***) ;;
1357esac
1358
1359AC_MSG_CHECKING(TRAK 8810 GPS receiver)
1360AC_ARG_ENABLE(TRAK,             [  --enable-TRAK             + TRAK 8810 GPS receiver],
1361    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1362if test "$ntp_ok" = "yes"; then
1363    ntp_refclock=yes
1364    AC_DEFINE(TRAK)
1365fi
1366AC_MSG_RESULT($ntp_ok)
1367
1368# Not on a vax-dec-bsd
1369AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
1370AC_ARG_ENABLE(TRUETIME,         [  --enable-TRUETIME         s Kinemetrics/TrueTime receivers],
1371    [ntp_ok=$enableval],
1372    [case "$target" in
1373     vax-dec-bsd)
1374        ntp_ok=no
1375        ;;
1376     *)
1377        ntp_ok=$ntp_eac
1378        ;;
1379    esac])
1380if test "$ntp_ok" = "yes"; then
1381    ntp_refclock=yes
1382    AC_DEFINE(TRUETIME)
1383fi
1384AC_MSG_RESULT($ntp_ok)
1385case "$ntp_ok$target" in
1386 yesvax-dec-bsd) AC_WARN(*** But the expected answer is... no ***) ;;
1387esac
1388
1389AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
1390AC_ARG_ENABLE(WWVB,             [  --enable-WWVB             + Spectracom 8170/Netclock/2 WWVB receiver],
1391    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1392if test "$ntp_ok" = "yes"; then
1393    ntp_refclock=yes
1394    AC_DEFINE(WWVB)
1395fi
1396AC_MSG_RESULT($ntp_ok)
1397
1398# Requires modem control
1399AC_MSG_CHECKING(USNO modem service)
1400AC_ARG_ENABLE(USNO,             [  --enable-USNO             s USNO modem service],
1401    [ntp_ok=$enableval],
1402    [AC_EGREP_CPP(yes,
1403        [#include <termios.h>
1404#ifdef TIOCMBIS
1405         yes
1406#endif
1407         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1408if test "$ntp_ok" = "yes"; then
1409    ntp_refclock=yes
1410    AC_DEFINE(USNO)
1411fi
1412AC_MSG_RESULT($ntp_ok)
1413
1414AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
1415AC_ARG_ENABLE(parse-clocks,     [  --enable-parse-clocks    - include all suitable PARSE clocks:],
1416    [ntp_eapc=$enableval], [ntp_eapc=no])
1417AC_MSG_RESULT($ntp_eapc)
1418
1419case "$ntp_eac$ntp_eapc$ntp_canparse" in
1420 noyes*)
1421    AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
1422    ;;
1423 yesyesno)
1424    AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported!)
1425    ;;
1426 *) ;;
1427esac
1428
1429ntp_libparse=no
1430ntp_parseutil=no
1431ntp_rawdcf=no
1432
1433AC_MSG_CHECKING(Diem Computime Radio Clock)
1434AC_ARG_ENABLE(COMPUTIME,        [  --enable-COMPUTIME        - Diem Cumputime Radio Clock],
1435    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1436if test "$ntp_ok" = "yes"; then
1437    ntp_libparse=yes
1438    ntp_refclock=yes
1439    AC_DEFINE(CLOCK_COMPUTIME)
1440fi
1441AC_MSG_RESULT($ntp_ok)
1442case "$ntp_ok$ntp_canparse" in
1443 yesno)
1444    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1445    ;;
1446esac
1447
1448AC_MSG_CHECKING(ELV/DCF7000 clock)
1449AC_ARG_ENABLE(DCF7000,          [  --enable-DCF7000          - ELV/DCF7000 clock],
1450    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1451if test "$ntp_ok" = "yes"; then
1452    ntp_libparse=yes
1453    ntp_refclock=yes
1454    AC_DEFINE(CLOCK_DCF7000)
1455fi
1456AC_MSG_RESULT($ntp_ok)
1457case "$ntp_ok$ntp_canparse" in
1458 yesno)
1459    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1460    ;;
1461esac
1462
1463AC_MSG_CHECKING(HOPF 6021 clock)
1464AC_ARG_ENABLE(HOPF6021,         [  --enable-HOPF6021         - HOPF 6021 clock],
1465    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1466if test "$ntp_ok" = "yes"; then
1467    ntp_libparse=yes
1468    ntp_refclock=yes
1469    AC_DEFINE(CLOCK_HOPF6021)
1470fi
1471AC_MSG_RESULT($ntp_ok)
1472case "$ntp_ok$ntp_canparse" in
1473 yesno)
1474    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1475    ;;
1476esac
1477
1478AC_MSG_CHECKING(Meinberg clocks)
1479AC_ARG_ENABLE(MEINBERG,         [  --enable-MEINBERG         - Meinberg clocks],
1480    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1481if test "$ntp_ok" = "yes"; then
1482    ntp_libparse=yes
1483    ntp_refclock=yes
1484    AC_DEFINE(CLOCK_MEINBERG)
1485fi
1486AC_MSG_RESULT($ntp_ok)
1487case "$ntp_ok$ntp_canparse" in
1488 yesno)
1489    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1490    ;;
1491esac
1492
1493AC_MSG_CHECKING(DCF77 raw time code)
1494AC_ARG_ENABLE(RAWDCF,           [  --enable-RAWDCF           - DCF77 raw time code],
1495    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1496if test "$ntp_ok" = "yes"; then
1497    ntp_libparse=yes
1498    ntp_parseutil=yes
1499    ntp_refclock=yes
1500    ntp_rawdcf=yes
1501    AC_DEFINE(CLOCK_RAWDCF)
1502fi
1503AC_MSG_RESULT($ntp_ok)
1504case "$ntp_ok$ntp_canparse" in
1505 yesno)
1506    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1507    ;;
1508esac
1509
1510case "$ntp_rawdcf" in
1511 yes)
1512    AC_CACHE_CHECK(if we must enable parity for RAWDCF,
1513    ac_cv_var_rawdcf_parity,
1514    [ans=no
1515    case "$target" in
1516     *-*-linux*)
1517        ans=yes
1518        ;;
1519    esac
1520    ac_cv_var_rawdcf_parity=$ans])
1521    case "$ac_cv_var_rawdcf_parity" in
1522     yes) AC_DEFINE(RAWDCF_NO_IGNPAR) ;;
1523    esac
1524
1525    AC_CACHE_CHECK(if we are powering the DCF77 from DTR,
1526    ac_cv_var_dtr_powers_dcf77,
1527    [ans=no
1528    case "$target" in
1529     *-*-linux*)
1530        ans=yes
1531        ;;
1532    esac
1533    ac_cv_var_dtr_powers_dcf77=$ans])
1534    case "$ac_cv_var_dtr_powers_dcf77" in
1535     yes) AC_DEFINE(RAWDCF_SETDTR) ;;
1536    esac
1537    ;;
1538 *) # HMS: Is this a good idea?
1539    ac_cv_var_rawdcf_parity=no
1540    ac_cv_var_dtr_powers_dcf77=no
1541    ;;
1542esac
1543
1544AC_MSG_CHECKING(RCC 8000 clock)
1545AC_ARG_ENABLE(RCC8000,          [  --enable-RCC8000          - RCC 8000 clock],
1546    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1547if test "$ntp_ok" = "yes"; then
1548    ntp_libparse=yes
1549    ntp_refclock=yes
1550    AC_DEFINE(CLOCK_RCC8000)
1551fi
1552AC_MSG_RESULT($ntp_ok)
1553case "$ntp_ok$ntp_canparse" in
1554 yesno)
1555    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1556    ;;
1557esac
1558
1559AC_MSG_CHECKING(Schmid DCF77 clock)
1560AC_ARG_ENABLE(SCHMID,           [  --enable-SCHMID           - Schmid DCF77 clock],
1561    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1562if test "$ntp_ok" = "yes"; then
1563    ntp_libparse=yes
1564    ntp_refclock=yes
1565    AC_DEFINE(CLOCK_SCHMID)
1566fi
1567AC_MSG_RESULT($ntp_ok)
1568case "$ntp_ok$ntp_canparse" in
1569 yesno)
1570    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1571    ;;
1572esac
1573
1574AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
1575AC_ARG_ENABLE(TRIMTAIP,         [  --enable-TRIMTAIP         - Trimble GPS receiver/TAIP protocol],
1576    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1577if test "$ntp_ok" = "yes"; then
1578    ntp_libparse=yes
1579    ntp_refclock=yes
1580    AC_DEFINE(CLOCK_TRIMTAIP)
1581fi
1582AC_MSG_RESULT($ntp_ok)
1583case "$ntp_ok$ntp_canparse" in
1584 yesno)
1585    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1586    ;;
1587esac
1588
1589AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
1590AC_ARG_ENABLE(TRIMTSIP,         [  --enable-TRIMTSIP         - Trimble GPS receiver/TSIP protocol],
1591    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
1592if test "$ntp_ok" = "yes"; then
1593    ntp_libparse=yes
1594    ntp_refclock=yes
1595    AC_DEFINE(CLOCK_TRIMTSIP)
1596fi
1597AC_MSG_RESULT($ntp_ok)
1598case "$ntp_ok$ntp_canparse" in
1599 yesno)
1600    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
1601    ;;
1602esac
1603AC_SUBST(LIBPARSE)
1604AC_SUBST(MAKE_LIBPARSE)
1605AC_SUBST(MAKE_LIBPARSE_KERNEL)
1606AC_MSG_CHECKING(if we need to make and use the parse libraries)
1607ans=no
1608case "$ntp_libparse" in
1609 yes)
1610    ans=yes
1611    AC_DEFINE(PARSE)
1612    LIBPARSE=../libparse/libparse.a
1613    MAKE_LIBPARSE=libparse.a
1614    ;;
1615esac
1616AC_MSG_RESULT($ans)
1617
1618AC_SUBST(TESTDCF)
1619AC_SUBST(DCFD)
1620AC_MSG_CHECKING(if we need dcf parse utilities)
1621ans=no
1622if test "$ntp_parseutil" = "yes"; then
1623    case "$target" in
1624     *-*-sunos4*|*-*-solaris2*)
1625        ans="dcfd testdcf"
1626        DCFD=dcfd
1627        TESTDCF=testdcf
1628        ;;
1629    esac
1630fi
1631AC_MSG_RESULT($ans)
1632
1633AC_SUBST(MAKE_PARSEKMODULE)
1634AC_MSG_CHECKING(if we can build kernel streams modules for parse)
1635ans=no
1636if test "$ntp_parseutil$ac_cv_header_sys_stropts_h" = "yesyes"; then
1637    case "$target" in
1638     sparc-*-sunos4*)
1639        case "$ac_cv_var_kernel_pll" in
1640        yes)
1641            AC_DEFINE(PPS_SYNC)
1642            ;;
1643        esac
1644        ans=parsestreams
1645        MAKE_PARSEKMODULE=parsestreams.loadable_module.o
1646        ;;
1647     sparc-*-solaris2*)
1648        ans=parsesolaris
1649        MAKE_PARSEKMODULE=parse
1650        ;;
1651    esac
1652fi
1653AC_MSG_RESULT($ans)
1654
1655AC_MSG_CHECKING(if we need basic refclock support)
1656if test "$ntp_refclock" = "yes"; then
1657    AC_DEFINE(REFCLOCK)
1658fi
1659AC_MSG_RESULT($ntp_refclock)
1660
1661dnl Things that can be made in clockstuff/
1662AC_SUBST(PROPDELAY)     dnl Set to "propdelay"
1663AC_SUBST(CHUTEST)       dnl Set to "chutest"
1664AC_SUBST(CLKTEST)       dnl Set to "clktest"
1665
1666AC_SUBST(MAKE_ADJTIMED)
1667AC_MSG_CHECKING(if we want HP-UX adjtimed support)
1668changequote(<<, >>)dnl
1669case "$target" in
1670 *-*-hpux[56789]*)
1671    ans=yes
1672    ;;
1673 *) ans=no
1674    ;;
1675esac
1676changequote([, ])dnl
1677if test "$ans" = "yes"; then
1678    MAKE_ADJTIMED=adjtimed
1679    AC_DEFINE(NEED_HPUX_ADJTIME)
1680fi
1681AC_MSG_RESULT($ans)
1682
1683AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
1684[AC_ARG_ENABLE(kmem,            [  --enable-kmem            s read /dev/kmem for tick and/or tickadj],
1685    [ans=$enableval],
1686    [changequote(<<, >>)dnl
1687    case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
1688     *yes*)
1689        ans=yes
1690        ;;
1691     *) ans=no
1692        ;;
1693    esac
1694    case "$target" in
1695     *-*-aix*)
1696        #ans=no
1697        ;;
1698     *-*-domainos)      # Won't be found...
1699        ans=no
1700        ;;
1701     *-*-hpux*)
1702        #ans=no
1703        ;;
1704     *-*-irix[456]*)
1705        ans=no
1706        ;;
1707     *-*-linux*)
1708        ans=no
1709        ;;
1710     *-*-winnt3.5)
1711        ans=no
1712        ;;
1713    esac
1714    changequote([, ])dnl
1715    ])
1716ac_cv_var_can_kmem=$ans])
1717
1718case "$ac_cv_var_can_kmem" in
1719 *yes*) ;;
1720 *) AC_DEFINE(NOKMEM) ;;
1721esac
1722
1723AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
1724[AC_ARG_ENABLE(accurate-adjtime, [  --enable-accurate-adjtime s the adjtime() call is accurate],
1725    [ans=$enableval],
1726    [changequote(<<, >>)dnl
1727    case "$target" in
1728      i386-sequent-ptx*)
1729         ans=no
1730         ;;
1731      i386-unknown-osf1*)
1732         ans=yes
1733         ;;
1734      mips-sgi-irix[456]*)
1735         ans=yes
1736         ;;
1737      *-fujitsu-uxp*)
1738         ans=yes
1739         ;;
1740      *-ibm-aix4*)
1741         ans=yes
1742         ;;
1743      *-*-linux*)
1744         ans=yes
1745         ;;
1746      *-*-solaris2.[01]*)
1747         ans=no
1748         ;;
1749      *-*-solaris2*)
1750         ans=yes
1751         ;;
1752      *) ans=no
1753         ;;
1754     esac
1755     changequote([, ])dnl
1756     ])
1757ac_cv_var_adjtime_is_accurate=$ans])
1758case "$ac_cv_var_adjtime_is_accurate" in
1759 yes) AC_DEFINE(ADJTIME_IS_ACCURATE) ;;
1760esac
1761
1762AC_CACHE_CHECK([the name of 'tick' in the kernel],
1763ac_cv_var_nlist_tick,
1764[changequote(<<, >>)dnl
1765ans=_tick
1766case "$target" in
1767 m68*-hp-hpux*) # HP9000/300?
1768    ans=_old_tick
1769    ;;
1770 *-apple-aux[23]*)
1771    ans=tick
1772    ;;
1773 *-hp-hpux*)
1774    ans=old_tick
1775    ;;
1776 *-ibm-aix[34]*)
1777    ans=no
1778    ;;
1779 *-*-ptx*)
1780    ans=tick
1781    ;;
1782 *-*-sco3.2v[45]*)
1783    ans=no
1784    ;;
1785 *-*-solaris2*)
1786    ans=nsec_per_tick
1787    ;;
1788 *-*-sysv4*)
1789    ans=tick
1790    ;;
1791esac
1792changequote([, ])dnl
1793ac_cv_var_nlist_tick=$ans])
1794case "$ac_cv_var_nlist_tick" in
1795 ''|no) ;;      # HMS: I think we can only get 'no' here...
1796 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick") ;;
1797esac
1798#
1799AC_CACHE_CHECK([for the units of 'tick'],
1800ac_cv_var_tick_nano,
1801[changequote(<<, >>)dnl
1802ans=usec
1803case "$target" in
1804 *-*-solaris2*)
1805    ans=nsec
1806    ;;
1807esac
1808changequote([, ])dnl
1809ac_cv_var_tick_nano=$ans])
1810case "$ac_cv_var_tick_nano" in
1811 nsec)
1812    AC_DEFINE(TICK_NANO)
1813    ;;
1814esac
1815#
1816AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
1817ac_cv_var_nlist_tickadj,
1818[changequote(<<, >>)dnl
1819ans=_tickadj
1820case "$target" in
1821 m68*-hp-hpux*) # HP9000/300?
1822    ans=_tickadj
1823    ;;
1824 *-apple-aux[23]*)
1825    ans=tickadj
1826    ;;
1827 *-hp-hpux10*)
1828    ans=no
1829    ;;
1830 *-hp-hpux9*)
1831    ans=no
1832    ;;
1833 *-hp-hpux*)
1834    ans=tickadj
1835    ;;
1836 *-*-aix*)
1837    ans=tickadj
1838    ;;
1839 *-*-ptx*)
1840    ans=tickadj
1841    ;;
1842 *-*-sco3.2v4*)
1843    ans=stickadj
1844    ;;
1845 *-*-sco3.2v5.0*)
1846    ans=clock_drift
1847    ;;
1848 *-*-solaris2*)
1849    ans=no      # hrestime_adj
1850    ;;
1851 *-*-sysv4*)
1852    ans=tickadj
1853    ;;
1854esac
1855changequote([, ])dnl
1856ac_cv_var_nlist_tickadj=$ans])
1857case "$ac_cv_var_nlist_tickadj" in
1858 ''|no) ;;      # HMS: I think we can only get 'no' here...
1859 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj") ;;
1860esac
1861#
1862AC_CACHE_CHECK([for the units of 'tickadj'],
1863ac_cv_var_tickadj_nano,
1864[changequote(<<, >>)dnl
1865ans=usec
1866case "$target" in
1867 *-*-solaris2*)
1868    ans=nsec
1869    ;;
1870esac
1871changequote([, ])dnl
1872ac_cv_var_tickadj_nano=$ans])
1873case "$ac_cv_var_tickadj_nano" in
1874 nsec)
1875    AC_DEFINE(TICKADJ_NANO)
1876    ;;
1877esac
1878#
1879AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
1880ac_cv_var_nlist_dosynctodr,
1881[changequote(<<, >>)dnl
1882case "$target" in
1883 *-apple-aux[23]*)
1884    ans=no
1885    ;;
1886 *-sni-sysv*)
1887    ans=dosynctodr
1888    ;;
1889 *-*-aix*)
1890    ans=dosynctodr
1891    ;;
1892 *-*-hpux*)
1893    ans=no
1894    ;;
1895 *-*-nextstep*)
1896    ans=_dosynctodr
1897    ;;
1898 *-*-ptx*)
1899    ans=doresettodr
1900    ;;
1901 *-*-sco3.2v4*)
1902    ans=no
1903    ;;
1904 *-*-sco3.2v5*)
1905    ans=track_rtc
1906    ;;
1907 *-*-solaris2*)
1908    ans=dosynctodr
1909    ;;
1910 *-*-sysv4*)
1911    ans=doresettodr
1912    ;;
1913 *)
1914    ans=_dosynctodr
1915    ;;
1916esac
1917changequote([, ])dnl
1918ac_cv_var_nlist_dosynctodr=$ans])
1919case "$ac_cv_var_nlist_dosynctodr" in
1920 no) ;;
1921 *)  AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr")
1922     ;;
1923esac
1924#
1925AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
1926ac_cv_var_nlist_noprintf,
1927[changequote(<<, >>)dnl
1928case "$target" in
1929 *-apple-aux[23]*)
1930    ans=no
1931    ;;
1932 *-sni-sysv*)
1933    ans=noprintf
1934    ;;
1935 *-*-aix*)
1936    ans=noprintf
1937    ;;
1938 *-*-hpux*)
1939    ans=no
1940    ;;
1941 *-*-ptx*)
1942    ans=noprintf
1943    ;;
1944 *-*-nextstep*)
1945    ans=_noprintf
1946    ;;
1947 *-*-solaris2*)
1948    ans=noprintf
1949    ;;
1950 *-*-sysv4*)
1951    ans=noprintf
1952    ;;
1953 *)
1954    ans=_noprintf
1955    ;;
1956esac
1957changequote([, ])dnl
1958ac_cv_var_nlist_noprintf=$ans])
1959case "$ac_cv_var_nlist_noprintf" in
1960 no) ;;
1961 *)  AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf")
1962     ;;
1963esac
1964
1965dnl The tick/tickadj sections were written by Skippy, who never learned
1966dnl that it's impolite (horridly gross) to show your guts in public.
1967
1968dnl     tick            tickadj
1969dnl     10000           80          Unixware
1970dnl     1000000L/hz     tick/16     (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
1971dnl     10000           150         sgi IRIX
1972dnl     1000000L/hz     1000        RS6000 && NOKMEM
1973dnl     1000000L/hz     668         DOMAINOS && NOKMEM
1974dnl     1000000L/hz     500/HZ      other && NOKMEM
1975dnl     txc.tick        1           Linux
1976dnl     (every / 10)    50          WinNT - tickadj is roughly 500/hz
1977dnl     1000000L/hz     (nlist)     (Solaris && !ADJTIME_IS_ACCURATE),
1978dnl                                 (RS6000 && !NOKMEM), SINIX MIPS
1979
1980dnl But we'll only use these "values" if we can't find anything else.
1981
1982AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
1983[AC_ARG_ENABLE(tick,            [  --enable-tick=VALUE      s force a value for 'tick'],
1984    [ans=$enableval],
1985    [ans=no
1986     case "$target" in
1987      *-univel-sysv*)
1988         ans=10000
1989         ;;
1990      *-*-irix*)
1991         ans=10000
1992         ;;
1993      *-*-linux*)
1994         ans=txc.tick
1995         ;;
1996      *-*-winnt3.5)
1997         ans='(every / 10)'
1998         ;;
1999      *)
2000         ans='1000000L/hz'
2001         ;;
2002     esac])
2003ac_cv_var_tick=$ans])
2004case "$ac_cv_var_tick" in
2005 ''|no) ;;      # HMS: I think we can only get 'no' here...
2006 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick) ;;
2007esac
2008
2009AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
2010[AC_ARG_ENABLE(tickadj,         [  --enable-tickadj=VALUE   s force a value for 'tickadj'],
2011  [ans=$enableval],
2012  [ans='500/hz'
2013  case "$target" in
2014   *-fujitsu-uxp*)
2015      case "$ac_cv_var_adjtime_is_accurate" in
2016       yes) ans='tick/16' ;;
2017      esac
2018      ;;
2019   *-univel-sysv*)
2020      ans=80
2021      ;;
2022   *-*-aix*)
2023      case "$ac_cv_var_can_kmem" in
2024       no) ans=1000 ;;
2025      esac
2026      ;;
2027   *-*-domainos)        # Skippy: won't be found...
2028      case "$ac_cv_var_can_kmem" in
2029       no) ans=668 ;;
2030      esac
2031      ;;
2032   *-*-hpux*)
2033      case "$ac_cv_var_adjtime_is_accurate" in
2034       yes) ans='tick/16' ;;
2035      esac
2036      ;;
2037   *-*-irix*)
2038      ans=150
2039      ;;
2040   *-*-sco3.2v4*)
2041      ans=1000000L/hz
2042      ;;
2043   *-*-sco3.2v5.0*)
2044      ans=1000000L/hz
2045      ;;
2046   *-*-solaris2*)
2047      case "$ac_cv_var_adjtime_is_accurate" in
2048       yes)
2049          #ans='tick/16'
2050          ;;
2051      esac
2052      ;;
2053   *-*-winnt3.5)
2054      ans=50
2055      ;;
2056  esac])
2057ac_cv_var_tickadj=$ans])
2058case "$ac_cv_var_tickadj" in
2059 ''|no) ;;      # HMS: I think we can only get 'no' here...
2060 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj) ;;
2061esac
2062
2063case "$target" in
2064 *-*-sco3.2v4*) AC_DEFINE(SCO3_TICKADJ) ;;
2065 *-*-sco3.2v5*) AC_DEFINE(SCO5_TICKADJ) ;;
2066esac
2067
2068case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
2069 nonono)        # Don't read KMEM, no presets.  Bogus.
2070    AC_MSG_ERROR(Can't read kmem but no PRESET_TICK or PRESET_TICKADJ)
2071    ;;
2072 nono*)         # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
2073    AC_MSG_ERROR(Can't read kmem but no PRESET_TICK)
2074    ;;
2075 no*no)         # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Bogus.
2076    AC_MSG_ERROR(Can't read kmem but no PRESET_TICKADJ)
2077    ;;
2078 no*)           # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ.  Cool.
2079    ;;
2080 yesnono)       # Read KMEM, no presets.  Cool.
2081    ;;
2082 yesno*)        # Read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
2083    AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK.  Please report this.)
2084    ;;
2085 yes*no)        # Read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Cool.
2086    ;;
2087 yes*)          # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
2088    ;;
2089 *)             # Generally bogus.
2090    AC_MSG_ERROR(This shouldn't happen.)
2091    ;;
2092esac
2093
2094AC_SUBST(MAKE_TICKADJ)
2095MAKE_TICKADJ=tickadj
2096
2097AC_SUBST(MAKE_NTPTIME)
2098AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
2099[case "$ac_cv_var_kernel_pll$ac_cv_hdr_def_sigsys" in
2100 yes*)
2101    ans=yes
2102    ;;
2103 *)
2104    ans=no
2105    ;;
2106esac;
2107ac_cv_make_ntptime=$ans])
2108case "$ac_cv_make_ntptime" in
2109 yes)
2110    MAKE_NTPTIME=ntptime
2111    ;;
2112esac
2113
2114AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
2115[AC_ARG_ENABLE(udp-wildcard,    [  --enable-udp-wildcard    s use UDP wildcard delivery],
2116    [ans=$enableval],
2117    [ans=no
2118     case "$target" in
2119      *-fujitsu-uxp*)
2120         ans=yes
2121         ;;
2122      *-univel-sysv*)
2123         ans=yes
2124         ;;
2125      *-*-aix3.2*)
2126         ans=yes
2127         ;;
2128      *-*-aix4*)
2129         ans=yes
2130         ;;
2131      *-*-bsdi*)
2132         ans=yes
2133         ;;
2134      *-*-domainos)
2135         ans=yes
2136         ;;
2137      *-*-freebsd*)
2138        ans=yes
2139        ;;
2140      *-*-hpux*)
2141         ans=yes
2142         ;;
2143      *-*-irix6*)
2144         ans=yes
2145         ;;
2146      *-*-linux*)
2147         ans=yes
2148         ;;
2149      *-*-osf*)
2150         ans=yes
2151         ;;
2152      *-*-ptx*)
2153         ans=yes
2154         ;;
2155      *-*-solaris2*)
2156         ans=yes
2157         ;;
2158      *-*-sunos4*)
2159         ans=yes
2160         ;;
2161     esac])
2162ac_cv_var_udp_wildcard_delivery=$ans])
2163case "$ac_cv_var_udp_wildcard_delivery" in
2164 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY) ;;
2165esac
2166
2167AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
2168[AC_ARG_ENABLE(slew-always,      [  --enable-slew-always     s always slew the time],
2169    [ans=$enableval],
2170    [changequote(<<, >>)dnl
2171    case "$target" in
2172      *-apple-aux[23]*)
2173         ans=yes
2174         ;;
2175      *-*-bsdi[012]*)
2176         ans=no
2177         ;;
2178      *-*-bsdi*)
2179         ans=yes
2180         ;;
2181      *-*-openvms*)     # HMS: won't be found
2182         ans=yes
2183         ;;
2184      *) ans=no
2185         ;;
2186     esac
2187     changequote([, ])dnl
2188     ])
2189ac_cv_var_slew_always=$ans])
2190case "$ac_cv_var_slew_always" in
2191 yes) AC_DEFINE(SLEWALWAYS) ;;
2192esac
2193
2194AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
2195[AC_ARG_ENABLE(step-slew,        [  --enable-step-slew       s step and slew the time],
2196    [ans=$enableval],
2197    [changequote(<<, >>)dnl
2198    case "$target" in
2199      *-sni-sysv*)
2200         ans=yes
2201         ;;
2202      *-univel-sysv*)
2203         ans=no
2204         ;;
2205      *-*-ptx*)
2206         ans=yes
2207         ;;
2208      *-*-solaris2.[012]*)
2209         ans=yes
2210         ;;
2211      *-*-sysv4*)       # HMS: Does this catch Fujitsu UXP?
2212         ans=yes
2213         ;;
2214      *) ans=no
2215         ;;
2216     esac
2217     changequote([, ])dnl
2218     ])
2219ac_cv_var_step_slew=$ans])
2220case "$ac_cv_var_step_slew" in
2221 yes) AC_DEFINE(STEP_SLEW) ;;
2222esac
2223
2224AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
2225[AC_ARG_ENABLE(ntpdate-step,     [  --enable-ntpdate-step    s if ntpdate should step the time],
2226    [ans=$enableval],
2227    [changequote(<<, >>)dnl
2228    case "$target" in
2229      *-apple-aux[23]*)
2230         ans=yes
2231         ;;
2232      *) ans=no
2233         ;;
2234     esac
2235     changequote([, ])dnl
2236     ])
2237ac_cv_var_ntpdate_step=$ans])
2238case "$ac_cv_var_ntpdate_step" in
2239 yes) AC_DEFINE(FORCE_NTPDATE_STEP) ;;
2240esac
2241
2242AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
2243[AC_ARG_ENABLE(hourly-todr-sync, [  --enable-hourly-todr-sync s if we should sync TODR hourly],
2244    [ans=$enableval],
2245    [case "$target" in
2246      *-*-nextstep*)
2247         ans=yes
2248         ;;
2249      *-*-openvms*)     # HMS: won't be found
2250         ans=yes
2251         ;;
2252      *) ans=no
2253         ;;
2254     esac])
2255ac_cv_var_sync_todr=$ans])
2256case "$ac_cv_var_sync_todr" in
2257 yes) AC_DEFINE(DOSYNCTODR) ;;
2258esac
2259
2260case "$host" in
2261 $target)
2262    ;;
2263 *) case "$target" in
2264     *-*-vxworks*)
2265        LDFLAGS="$LDFLAGS -r"
2266        ;;
2267    esac
2268    ;;
2269esac
2270
2271# Set lbindir and lsbindir if not already set by Athena config.site
2272test -z "$lbindir" && lbindir='${bindir}'
2273test -z "$lsbindir" && lsbindir='${sbindir}'
2274AC_SUBST(lbindir)
2275AC_SUBST(lsbindir)
2276
2277AC_OUTPUT(Makefile adjtimed/Makefile authstuff/Makefile clockstuff/Makefile \
2278include/Makefile kernel/Makefile kernel/sys/Makefile libntp/Makefile \
2279libparse/Makefile ntpdate/Makefile ntpq/Makefile ntptrace/Makefile \
2280parseutil/Makefile xntpd/Makefile \
2281xntpdc/Makefile util/Makefile, \
2282[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
2283
Note: See TracBrowser for help on using the repository browser.