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

Revision 17268, 73.6 KB checked in by zacheiss, 23 years ago (diff)
Merge with ntp 4.1.1.
Line 
1dnl -*-fundamental-*-
2dnl Process this file with autoconf to produce a configure script.
3AC_INIT(ntpd/ntp_refclock.c)
4AC_CANONICAL_SYSTEM
5AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target")
6AM_CONFIG_HEADER(config.h)
7AC_ARG_PROGRAM
8AM_INIT_AUTOMAKE(ntp, 4.1.1)
9AC_PREREQ(2.49)
10
11ac_cv_var_oncore_ok=no
12ac_cv_var_atom_ok=no
13
14dnl Grab any initial CFLAGS so we can pick better defaults.
15iCFLAGS="$CFLAGS"
16
17dnl  we need to check for cross compile tools for vxWorks here
18AC_PROG_CC
19AC_PROG_CC_STDC
20AC_PROG_CPP
21
22case "$target" in
23 *-pc-cygwin*)
24    CFLAGS="$CFLAGS -DSYS_CYGWIN32"
25    ;;
26 i386-sequent-sysv4)
27    case "$CC" in
28     cc)
29        CFLAGS="$CFLAGS -Wc,+abi-socket"
30        ;;
31    esac
32    ;;
33 alpha*-dec-osf*)
34    case "$CC" in
35     cc)
36        CFLAGS="$CFLAGS -std1"
37        ;;
38    esac
39    ;;
40 *-*-mpeix*)
41    CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
42    LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
43    LIBS="$LIBS -lcurses"
44    ;;
45esac
46
47case "$host" in
48 $target)
49    ;;
50 *) case "$target" in
51     *-*-vxworks*)
52        # Quick and dirty sanity check
53        case "$VX_KERNEL" in
54         '') AC_MSG_ERROR(Please follow the directions in html/vxworks.html!)
55            ;;
56        esac
57        CFLAGS="$CFLAGS -DSYS_VXWORKS"
58        ;;
59    esac
60    ;;
61esac
62
63dnl  we need to check for cross compile tools for vxWorks here
64AC_PROG_AWK
65AC_PROG_MAKE_SET
66
67rm -f conftest*
68
69case "$GCC" in
70 yes)
71    CFLAGS="$CFLAGS -Wall"
72    # CFLAGS="$CFLAGS -Wcast-align"
73    CFLAGS="$CFLAGS -Wcast-qual"
74    # CFLAGS="$CFLAGS -Wconversion"
75    # CFLAGS="$CFLAGS -Werror"
76    CFLAGS="$CFLAGS -Wmissing-prototypes"
77    CFLAGS="$CFLAGS -Wpointer-arith"
78    CFLAGS="$CFLAGS -Wshadow"
79    CFLAGS="$CFLAGS -Wstrict-prototypes"
80    # CFLAGS="$CFLAGS -Wtraditional"
81    # CFLAGS="$CFLAGS -Wwrite-strings"
82
83    AC_CACHE_CHECK(whether ${CC-cc} -pipe works, ac_cv_prog_cc_pipe,
84    [echo 'void f(){}' > conftest.c
85    if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`" -a -s conftest.o; then
86      ac_cv_prog_cc_pipe=yes
87    else
88      ac_cv_prog_cc_pipe=no
89    fi
90    rm -f conftest*
91    ])
92
93    case "$ac_cv_prog_cc_pipe" in
94     yes)
95        CFLAGS="$CFLAGS -pipe"
96        ;;
97    esac
98    ;;
99esac
100
101ac_busted_vpath_in_make=no
102
103case "$target" in
104 *-next-nextstep3)
105    CFLAGS="$CFLAGS -posix"
106    ;;
107 *-*-irix6.1*)  # 64 bit only
108    # busted vpath?
109    ;;
110 *-*-irix6*)    # 6.2 (and later?)
111    ac_busted_vpath_in_make=yes
112    # don't pass -n32 to gcc, it cannot handle and doesn't need it
113    if test "$GCC" != yes; then
114      case "$CFLAGS" in
115       *-n32*) ;;
116       *-n64*) ;;
117       *) case "$iCFLAGS" in
118           '') CFLAGS="-O2 -g3 -n32" ;;
119           *)  CFLAGS="$CFLAGS -n32" ;;
120          esac
121          ;;
122      esac
123      case "$LDFLAGS" in
124       *-n32*) ;;
125       *-n64*) ;;
126       *) LDFLAGS="$LDFLAGS -n32" ;;
127      esac
128    fi
129    ;;
130 *-*-solaris2.5.1)
131    ac_busted_vpath_in_make=yes
132    ;;
133dnl This is currently commented out by bor.
134dnl The new versions of ReliantUNIX round adjtime() interval down
135dnl to 1/100s (system tick). This makes tickadj actually useless.
136dnl So, I'd better not use additional flags.
137dnl I leave it here just in case anybody has better idea
138dnl  mips-sni-sysv4* )
139dnl     #
140dnl     # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
141dnl     #
142dnl     if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
143dnl       CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
144dnl     fi
145dnl     ;;
146esac
147
148case "$ac_busted_vpath_in_make$srcdir" in
149 no*) ;;
150 yes.) ;;
151 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
152     '')
153        AC_MSG_ERROR(building outside of the main directory requires GNU make)
154        ;;
155     *) ;;
156    esac
157    ;;
158esac
159
160AC_SUBST(CFLAGS)dnl
161AC_SUBST(LDFLAGS)dnl
162
163AC_PROG_LN_S
164AC_PROG_GCC_TRADITIONAL
165AC_AIX
166AC_MINIX
167AC_ISC_POSIX
168AC_PROG_RANLIB
169AC_PATH_PROG(PATH_SH, sh)
170AC_PATH_PROG(PATH_PERL, perl)
171PATH_PERL=/usr/athena/bin/perl
172
173hs_ULONG_CONST
174
175case "$target" in
176 *-*-vxworks*)
177    ac_link="$ac_link $VX_KERNEL"
178    ;;
179esac
180
181AC_PROG_INSTALL
182
183case "$target" in
184 *-pc-cygwin*)
185    AC_CHECK_LIB(advapi32, main)
186    ;;
187esac
188AC_CHECK_LIB(elf, nlist)        dnl Only needed for tickadj...
189dnl AC_CHECK_LIB(kvm, main, , , -lelf)
190AC_CHECK_LIB(kvm, main)         dnl We already know about -lelf here...
191AC_CHECK_LIB(ld, nlist)
192AC_CHECK_LIB(mld, nlist)
193AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket))
194AC_CHECK_FUNC(openlog, ,
195  AC_CHECK_LIB(gen, openlog, ,
196  AC_CHECK_LIB(syslog, openlog, , , -lsocket)))
197AC_CHECK_LIB(readline, readline
198  AC_DEFINE(HAVE_LIBREADLINE)
199  LIBS="-lreadline -lcurses $LIBS"
200], , -lcurses)
201
202dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
203dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
204dnl so only use one of them.  Linux (glibc-2.1.2 and -2.2.2, at least)
205dnl does Strange Things with extra processes using the Posix-compatibility
206dnl real-time library, so we don't want to use it.
207
208case "$target" in
209 *-*-linux*) ;;
210 *)
211    AC_CHECK_LIB(rt, sched_setscheduler, ,
212        AC_CHECK_LIB(posix4, sched_setscheduler))
213    ;;
214esac
215
216AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
217
218AC_HEADER_STDC
219AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h memory.h netdb.h)
220AC_CHECK_HEADERS(poll.h resolv.h sched.h sgtty.h stdlib.h string.h termio.h)
221AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h utmp.h utmpx.h)
222AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in_system.h)
223AC_CHECK_HEADERS(netinet/in_systm.h netinet/in.h netinet/ip.h)
224AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO)])
225AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
226dnl AC_CHECK_HEADERS(sys/chudefs.h)
227AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
228case "$target" in
229 *-*-sunos4*) ;;
230 *) AC_CHECK_HEADERS(sys/ioctl.h)
231    ;;
232esac
233AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
234AC_CHECK_HEADERS(sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h)
235case "$target" in
236 *-*-sco*)
237    AC_CHECK_HEADERS(sys/sio.h)
238    ;;
239esac
240AC_CHECK_HEADERS(sys/select.h sys/signal.h sys/sockio.h sys/stat.h sys/stream.h)
241AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/termios.h)
242AC_CHECK_HEADERS(sys/time.h)
243AC_EGREP_CPP(yes,
244[#include <sys/timepps.h>
245#ifdef PPS_API_VERS_1
246yes
247#endif
248], AC_CHECK_HEADERS(sys/timepps.h))
249AC_CHECK_HEADERS(sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h)
250AC_HEADER_TIME
251case "$target" in
252*-convex-*)
253  AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
254  ;;
255*-*-bsdi*)
256  AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
257  ;;
258esac
259
260AC_CHECK_HEADER(nlist.h,
261[AC_DEFINE(NLIST_STRUCT)
262AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
263[AC_TRY_COMPILE([#include <nlist.h>],
264[struct nlist n; n.n_un.n_name = 0;],
265ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
266if test $ac_cv_struct_nlist_n_un = yes; then
267  AC_DEFINE(NLIST_NAME_UNION)
268fi
269])dnl
270
271AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
272[AC_TRY_COMPILE([],[
273volatile int x;],
274        ac_cv_c_volatile=yes,
275        ac_cv_c_volatile=no)
276])
277case "$ac_cv_c_volatile" in
278 yes)
279    ;;
280 *) AC_DEFINE(volatile,)
281    ;;
282esac
283
284case "$target" in
285 sparc-*-solaris2*)
286    # Assume that solaris2 is Ansi C...
287    ;;
288 *)
289    AM_C_PROTOTYPES
290    ;;
291esac
292AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
293[AC_TRY_COMPILE([
294extern int foo (short);
295int foo(short i) { return i; }],[
296int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
297])
298if test "$ac_cv_have_prototypes" = yes; then
299  AC_DEFINE(HAVE_PROTOTYPES)
300fi
301
302AC_C_CONST
303case "$host" in
304 $target)
305    AC_C_BIGENDIAN
306    ;;
307 *) case "$target" in
308     i*86-*-vxworks*)
309        # LITTLEENDIAN
310        ;;
311     *-*-vxworks*)
312        AC_DEFINE(WORDS_BIGENDIAN)
313        ;;
314     *) AC_MSG_ERROR(Cross-compiling needs explicit byte order)
315        ;;
316    esac
317    ;;
318esac
319AC_TYPE_SIGNAL
320AC_TYPE_OFF_T
321AC_TYPE_SIZE_T
322AC_CHECK_TYPE(time_t, long)
323AC_STRUCT_TM
324
325AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
326[ac_cv_var_default_hz=100
327case "$target" in
328 alpha*-dec-osf4*|alpha*-dec-osf5*)
329    ac_cv_var_default_hz=1024
330    ;;
331 mips-dec-ultrix4*)
332    ac_cv_var_default_hz=256
333    ;;
334esac])
335AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz)
336
337AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
338[ac_cv_var_override_hz=no
339case "$target" in
340 alpha*-dec-osf4*|alpha*-dec-osf5*)
341    ac_cv_var_override_hz=yes
342    ;;
343 mips-dec-ultrix4*)
344    ac_cv_var_override_hz=yes
345    ;;
346 *-*-freebsd*)
347    ac_cv_var_override_hz=yes
348    ;;
349 *-*-sunos4*)
350    ac_cv_var_override_hz=yes
351    ;;
352esac])
353case "$ac_cv_var_override_hz" in
354 yes)
355    AC_DEFINE(OVERRIDE_HZ)
356    ;;
357esac
358
359dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
360dnl [AC_TRY_LINK([#include <sys/types.h>
361dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
362dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
363dnl if test $su_cv_func_ut_host_in_utmp = yes; then
364dnl   AC_DEFINE(HAVE_UT_HOST)
365dnl fi
366
367dnl AC_MSG_CHECKING(if we can get the system boot time)
368dnl AC_CACHE_VAL(su_cv_have_boot_time,
369dnl [AC_EGREP_CPP(yes,
370dnl [#ifdef HAVE_UTMPX_H
371dnl #include <utmpx.h>
372dnl #else
373dnl #include <utmp.h>
374dnl #endif
375dnl #ifdef BOOT_TIME
376dnl yes
377dnl #endif
378dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
379dnl AC_MSG_RESULT($su_cv_have_boot_time)
380
381AC_CACHE_CHECK(
382  struct sigaction for sa_sigaction,
383  ac_cv_struct_sigaction_has_sa_sigaction,
384  [
385    AC_TRY_COMPILE(
386      [#include <signal.h>],
387      [struct sigaction act; act.sa_sigaction = 0;],
388      ac_cv_struct_sigaction_has_sa_sigaction=yes,
389      ac_cv_struct_sigaction_has_sa_sigaction=no
390    )
391  ]
392)
393if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
394  AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION)
395fi
396
397AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
398[AC_TRY_COMPILE([
399#include <sys/types.h>
400#ifdef HAVE_SYS_TERMIOS_H
401# include <sys/termios.h>
402#endif
403#ifdef HAVE_SYS_TIME_H
404# include <sys/time.h>
405#endif
406#ifdef HAVE_SYS_PPSCLOCK_H
407# include <sys/ppsclock.h>
408#endif],[
409extern struct ppsclockev *pce;
410return pce->serial;],
411        ac_cv_struct_ppsclockev=yes,
412        ac_cv_struct_ppsclockev=no)
413])
414if test $ac_cv_struct_ppsclockev = yes; then
415    AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV)
416fi
417
418AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
419[AC_TRY_COMPILE([
420#include <sys/types.h>
421#include <sys/socket.h>],[
422extern struct sockaddr *ps;
423return ps->sa_len;],
424        ac_cv_struct_sockaddr_has_sa_len=yes,
425        ac_cv_struct_sockaddr_has_sa_len=no)
426])
427if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
428    AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR)
429fi
430
431AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
432[AC_TRY_COMPILE([
433#include <sys/time.h>],[
434extern struct clockinfo *pc;
435return pc->hz;],
436        ac_cv_struct_clockinfo_has_hz=yes,
437        ac_cv_struct_clockinfo_has_hz=no)
438])
439if test $ac_cv_struct_clockinfo_has_hz = yes; then
440    AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO)
441fi
442
443AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
444[AC_TRY_COMPILE([
445#include <sys/time.h>],[
446extern struct clockinfo *pc;
447return pc->tickadj;],
448        ac_cv_struct_clockinfo_has_tickadj=yes,
449        ac_cv_struct_clockinfo_has_tickadj=no)
450])
451if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
452    AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO)
453fi
454
455AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
456[AC_TRY_COMPILE([
457#include <sys/time.h>
458/* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
459#ifdef HAVE_ERRNO_H
460# include <errno.h>
461#endif
462#ifdef HAVE_SYS_TIMEPPS_H
463# define FRAC 4294967296
464# include <sys/timepps.h>
465#endif],
466[struct timespec n;],
467ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
468if test $ac_cv_struct_timespec = yes; then
469  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
470fi
471
472AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
473[AC_TRY_COMPILE([
474#include <sys/time.h>
475#include <sys/timex.h>],
476[struct ntptimeval n;],
477ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
478if test $ac_cv_struct_ntptimeval = yes; then
479  AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
480fi
481
482AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
483[#ifdef HAVE_SYS_TIME_H
484#include <sys/time.h>
485#else
486# ifdef HAVE_TIME_H
487# include <time.h>
488# endif
489#endif
490#ifdef HAVE_SYS_TIMEX_H
491#include <sys/timex.h>
492#else
493# ifdef HAVE_TIMEX_H
494# include <timex.h>
495# endif
496#endif])
497
498AC_C_INLINE
499AC_C_CHAR_UNSIGNED              dnl CROSS_COMPILE?
500case "$host" in
501 $target)
502    AC_CHECK_SIZEOF(signed char)
503    ;;
504 *) case "$target" in
505     *-*-vxworks*)
506        AC_CHECK_SIZEOF(signed char, 1)
507        ;;
508     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_SIGNED_LONG)
509        ;;
510    esac
511    ;;
512esac
513
514case "$host" in
515 $target)
516    AC_CHECK_SIZEOF(int)
517    ;;
518 *) case "$target" in
519     *-*-vxworks*)
520        AC_CHECK_SIZEOF(int, 4)
521        ;;
522     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_INT)
523        ;;
524    esac
525    ;;
526esac
527
528case "$host" in
529 $target)
530    AC_CHECK_SIZEOF(long)
531    ;;
532 *) case "$target" in
533     *-*-vxworks*)
534        AC_CHECK_SIZEOF(long, 4)
535        ;;
536     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_LONG)
537        ;;
538    esac
539    ;;
540esac
541
542AC_CHECK_TYPES([s_char])
543case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
544 *yes)
545    # We have a typedef for s_char.  Might as well believe it...
546    ;;
547 no0no)
548    # We have signed chars, can't say 'signed char', no s_char typedef.
549    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
550    ;;
551 no1no)
552    # We have signed chars, can say 'signed char', no s_char typedef.
553    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
554    ;;
555 yes0no)
556    # We have unsigned chars, can't say 'signed char', no s_char typedef.
557    AC_MSG_ERROR(No way to specify a signed character!)
558    ;;
559 yes1no)
560    # We have unsigned chars, can say 'signed char', no s_char typedef.
561    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
562    ;;
563esac
564AC_TYPE_UID_T
565
566case "$target" in
567 *-*-linux*)
568    AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
569    ;;
570esac
571case "$target" in
572 *-*-aix4*)
573        # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
574        # (returning ENOSYS).  I didn't check 4.2.  If, in the future,
575        # IBM pulls its thumbs out long enough to implement clock_settime,
576        # this conditional will need to change.  Maybe use AC_TRY_RUN
577        # instead to try to set the time to itself and check errno.
578    ;;
579 *) AC_CHECK_FUNCS(clock_gettime clock_settime)
580    ;;
581esac
582AC_CHECK_FUNCS(daemon)
583AC_CHECK_FUNCS(finite, ,
584  [AC_CHECK_FUNCS(isfinite, ,
585    [AC_MSG_CHECKING(for isfinite with <math.h>)
586    _libs=$LIBS
587    LIBS="$LIBS -lm"
588    AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
589      [AC_MSG_RESULT(yes)
590      AC_DEFINE(HAVE_ISFINITE)],
591      AC_MSG_RESULT(no))
592    LIBS=$_libs])])
593AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage)
594AC_CHECK_FUNC(gettimeofday, ,[
595case "$target" in
596  *-*-mpeix*) ac_cv_func_gettimeofday=yes
597    ;;
598esac])
599case "$target" in
600 *-pc-cygwin*)
601    ;;
602 *) AC_CHECK_FUNCS(getuid)
603    ;;
604esac
605AC_CHECK_FUNCS(hstrerror K_open kvm_open memcpy memmove memset)
606case "$target" in
607 *-*-sco3.2v5.0.*)
608    # Just stubs.  Idiots.
609    ;;
610 *) AC_CHECK_FUNCS(mkstemp)
611    ;;
612esac
613AC_REPLACE_FUNCS(mktime)
614case "$target" in
615 *-*-aix4*)
616    # Just a stub.  Idiots.
617    ;;
618 *-*-irix*)
619    # Just stubs in Irix.  Idiots.
620    ;;
621 *-*-sco3.2v5.0.*)
622    # Just stubs.  Idiots.
623    ;;
624 alpha*-dec-osf4*|alpha*-dec-osf5*)
625    # mlockall is there, as a #define calling memlk via <sys/mman.h>
626    # Not easy to test for - cheat.
627    AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
628    AC_CHECK_FUNCS(mlockall)
629    ;;
630 *) AC_CHECK_FUNCS(mlockall)
631    ;;
632esac
633AC_CHECK_FUNCS(mrand48 srand48 nice nlist)
634case "$target" in
635 *-*-solaris2.6)
636    # Broken...
637    ;;
638 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
639    ;;
640esac
641AC_CHECK_FUNCS(plock pututline pututxline readlink rtprio)
642case "$ac_cv_func_mrand48" in
643 yes) ;;
644 *) AC_REPLACE_FUNCS(random) ;;
645esac
646case "$target" in
647 *-*-aix4*)
648    # Just a stub in AIX 4.  Idiots.
649    ;;
650 *-*-solaris2.5*)
651    # Just stubs in solaris2.5.  Idiots.
652    ;;
653 *) AC_CHECK_FUNCS(sched_setscheduler)
654    ;;
655esac
656AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
657AC_CHECK_FUNCS(settimeofday, ,[
658case "$target" in
659  *-*-mpeix*) ac_cv_func_settimeofday=yes
660    ;;
661esac])
662AC_CHECK_FUNCS(setvbuf sigaction)
663AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
664AC_REPLACE_FUNCS(snprintf strdup strerror)
665case "$target" in
666 *-*-aix4*)
667    # Just stubs.  Idiots.
668    ;;
669 *-*-netbsd*)
670    # Just stubs.  Idiots.
671    ;;
672 *-*-openbsd*)
673    # Just stubs.  Idiots.
674    ;;
675 *) AC_CHECK_FUNCS(timer_create timer_settime)
676    ;;
677esac
678case "$target" in
679 *-pc-cygwin*)
680    # I have no idea...
681    ;;
682 *) AC_CHECK_FUNCS(umask)
683    ;;
684esac
685AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
686
687AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
688[AC_TRY_COMPILE([#include <sys/time.h>],[
689gettimeofday((struct timeval*)0,(struct timezone*)0);
690settimeofday((struct timeval*)0,(struct timezone*)0);
691],
692        ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
693])
694if test $ac_cv_func_Xettimeofday_nargs = 1; then
695        AC_DEFINE(SYSV_TIMEOFDAY)
696fi
697
698AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
699[AC_TRY_COMPILE([
700#ifdef HAVE_SYS_TYPES_H
701# include <sys/types.h>
702#endif
703#ifdef HAVE_UNISTD_H
704# include <unistd.h>
705#endif
706],[setpgrp(0,0);],
707        ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
708])
709if test $ac_cv_func_setpgrp_nargs = 0; then
710        AC_DEFINE(HAVE_SETPGRP_0)
711fi
712
713save_CFLAGS=$CFLAGS
714CFLAGS="$CFLAGS -I$srcdir/include"
715
716AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
717ac_cv_func_qsort_argtype,
718[AC_TRY_COMPILE([
719#include "l_stdlib.h"
720
721#ifdef HAVE_PROTOTYPES
722#define P(x) x
723#else
724#define P(x) ()
725#endif
726
727extern void *base;
728extern sortfunc P((const void *, const void *));
729int sortfunc(a, b)
730  const void *a;
731  const void *b; { return 0; }
732],[
733qsort(base, 2, sizeof(char *), sortfunc);
734],
735        ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
736])
737case "$ac_cv_func_qsort_argtype" in
738 void)
739    AC_DEFINE(QSORT_USES_VOID_P)
740    ;;
741esac
742
743CFLAGS=$save_CFLAGS
744
745AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
746[AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
747#include <errno.h>
748#endif],
749  [errno = 0;],
750  ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
751case "$ac_cv_decl_errno" in
752 yes) AC_DEFINE(DECL_ERRNO) ;;
753esac
754
755dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
756dnl the clash.  <resolv.h> isn't currently used.
757dnl
758dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
759dnl MT purposes.  This makes the line "extern int h_errno" choke
760dnl the compiler.  Hopefully adding !defined(h_errno) fixes this
761dnl without breaking any other platforms.
762dnl
763AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
764[AC_TRY_COMPILE([#include <sys/types.h>
765#ifdef HAVE_NETINET_IN_H
766#include <netinet/in.h>
767#endif
768#ifdef HAVE_ARPA_NAMESER_H
769#include <arpa/nameser.h>
770#endif
771#ifdef HAVE_NETDB_H
772#include <netdb.h>
773#endif
774#ifdef HAVE_RESOLV_H
775#include <resolv.h>
776#endif],
777  [extern int h_errno;],
778  ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
779case "$ac_cv_decl_h_errno" in
780 yes) AC_DEFINE(DECL_H_ERRNO) ;;
781esac
782
783dnl See if char *sys_errlist[] is OK.
784AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
785[AC_TRY_COMPILE([#include <stdio.h>
786#ifdef HAVE_ERRNO_H
787#include <errno.h>
788#endif],
789  [extern char *sys_errlist[];
790],
791  ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
792case "$ac_cv_decl_sys_errlist" in
793 yes) AC_DEFINE(CHAR_SYS_ERRLIST) ;;
794esac
795
796AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
797[AC_TRY_COMPILE([
798#ifdef HAVE_SYS_TYPES_H
799# include <sys/types.h>
800#endif
801#ifdef HAVE_UNISTD_H
802# include <unistd.h>
803#endif
804#ifdef HAVE_PROTOTYPES
805#define P(x) x
806#else
807#define P(x) ()
808#endif
809],
810  [extern int syscall P((int, ...));],
811  ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
812case "$ac_cv_decl_syscall" in
813 yes) AC_DEFINE(DECL_SYSCALL) ;;
814esac
815
816case "$target" in
817 *-*-aix4.3.*)
818    AC_DEFINE(DECL_HSTRERROR_0)         # Needed for XLC under AIX 4.3.2
819    ;;
820 *-*-mpeix*)
821    AC_DEFINE(DECL_ADJTIME_0)
822    AC_DEFINE(DECL_INET_NTOA_0)
823    AC_DEFINE(DECL_MKTEMP_0)
824    AC_DEFINE(DECL_MRAND48_0)
825    AC_DEFINE(DECL_SELECT_0)
826    AC_DEFINE(DECL_SETITIMER_0)
827    AC_DEFINE(DECL_SRAND48_0)
828    AC_DEFINE(DECL_SYSLOG_0)
829    AC_DEFINE(DECL_TIMEOFDAY_0)
830    ;;
831 *-*-osf[[45]]*)
832    AC_DEFINE(DECL_PLOCK_0)
833    AC_DEFINE(DECL_STIME_1)
834    ;;
835 *-*-riscos4*)
836    AC_DEFINE(DECL_ADJTIME_0)
837    AC_DEFINE(DECL_BZERO_0)
838    AC_DEFINE(DECL_IOCTL_0)
839    AC_DEFINE(DECL_IPC_0)
840    AC_DEFINE(DECL_MEMMOVE_0)
841    AC_DEFINE(DECL_MKTEMP_0)
842    AC_DEFINE(DECL_RENAME_0)
843    AC_DEFINE(DECL_SELECT_0)
844    AC_DEFINE(DECL_SETITIMER_0)
845    AC_DEFINE(DECL_SETPRIORITY_0)
846    AC_DEFINE(DECL_STDIO_0)
847    AC_DEFINE(DECL_STRTOL_0)
848    AC_DEFINE(DECL_SYSLOG_0)
849    AC_DEFINE(DECL_TIME_0)
850    AC_DEFINE(DECL_TIMEOFDAY_0)
851    AC_DEFINE(DECL_TOLOWER_0)
852    ;;
853 *-*-solaris2*)
854    AC_DEFINE(DECL_MKSTEMP_0)
855    AC_DEFINE(DECL_SETPRIORITY_1)
856    case "$target" in
857     *-*-solaris2.4)
858        AC_DEFINE(DECL_TIMEOFDAY_0)
859        ;;
860    esac
861    ;;
862 *-*-sunos4*)
863    AC_DEFINE(DECL_ADJTIME_0)
864    AC_DEFINE(DECL_BCOPY_0)
865    AC_DEFINE(DECL_BZERO_0)
866    AC_DEFINE(DECL_IOCTL_0)
867    AC_DEFINE(DECL_IPC_0)
868    AC_DEFINE(DECL_MEMMOVE_0)
869    AC_DEFINE(DECL_MKTEMP_0)
870    AC_DEFINE(DECL_MKSTEMP_0)
871    AC_DEFINE(DECL_MRAND48_0)
872    AC_DEFINE(DECL_RENAME_0)
873    AC_DEFINE(DECL_SELECT_0)
874    AC_DEFINE(DECL_SETITIMER_0)
875    AC_DEFINE(DECL_SETPRIORITY_0)
876    AC_DEFINE(DECL_SIGVEC_0)
877    AC_DEFINE(DECL_SRAND48_0)
878    case "`basename $ac_cv_prog_CC`" in
879     acc*) ;;
880     *) AC_DEFINE(DECL_STDIO_0)
881        ;;
882    esac
883    AC_DEFINE(DECL_STRTOL_0)
884    AC_DEFINE(DECL_SYSLOG_0)
885    AC_DEFINE(DECL_TIME_0)
886    AC_DEFINE(DECL_TIMEOFDAY_0)
887    AC_DEFINE(DECL_TOLOWER_0)
888    AC_DEFINE(DECL_TOUPPER_0)
889    AC_DEFINE(DECL_STRERROR_0)
890    ;;
891 *-*-ultrix4*)
892    AC_DEFINE(DECL_ADJTIME_0)
893    AC_DEFINE(DECL_BZERO_0)
894    AC_DEFINE(DECL_CFSETISPEED_0)
895    AC_DEFINE(DECL_IOCTL_0)
896    AC_DEFINE(DECL_IPC_0)
897    AC_DEFINE(DECL_MKTEMP_0)
898    AC_DEFINE(DECL_MRAND48_0)
899    AC_DEFINE(DECL_NLIST_0)
900    AC_DEFINE(DECL_PLOCK_0)
901    AC_DEFINE(DECL_SELECT_0)
902    AC_DEFINE(DECL_SETITIMER_0)
903    AC_DEFINE(DECL_SETPRIORITY_0)
904    AC_DEFINE(DECL_SRAND48_0)
905    AC_DEFINE(DECL_STIME_0)
906    AC_DEFINE(DECL_SYSLOG_0)
907    AC_DEFINE(DECL_TIMEOFDAY_0)
908    ;;
909esac
910
911case "$target" in
912 *-*-sco3.2*)
913    AC_DEFINE(TERMIOS_NEEDS__SVID3)
914    ;;
915esac
916
917AC_CACHE_CHECK(if we should use a streams device for ifconfig,
918 ac_cv_var_use_streams_device_for_ifconfig,
919 ac_cv_var_use_streams_device_for_ifconfig=no)
920
921AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
922[ans=no
923case "$target" in
924 *-*-hpux[[567]]*)
925    ans=yes
926    ;;
927esac
928ac_cv_var_rcvbuf_slop=$ans])
929case "$ac_cv_var_rcvbuf_slop" in
930 yes) AC_DEFINE(NEED_RCVBUF_SLOP) ;;
931esac
932
933AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
934[ans=yes
935case "$target" in
936 *-*-domainos)
937    ans=no
938    ;;
939 *-*-linux*)
940    ans=no
941    ;;
942esac
943ac_cv_var_open_bcast_socket=$ans])
944case "$ac_cv_var_open_bcast_socket" in
945 yes) AC_DEFINE(OPEN_BCAST_SOCKET) ;;
946esac
947
948AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
949[ans=no
950case "$target" in
951 *-*-hpux*)
952    ans=yes
953    ;;
954esac
955ac_cv_var_hpux_findconfig=$ans])
956case "$ac_cv_var_hpux_findconfig" in
957 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG) ;;
958esac
959
960AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
961[case "$target" in
962 *-*-hpux[[567]]*)
963    ans=no
964    ;;
965 *-*-hpux*)
966    ans=yes
967    ;;
968 *-*-linux*)
969    ans=yes
970    ;;
971 *-*-sunos3*)
972    ans=yes
973    ;;
974 *-*-ultrix2*)
975    ans=yes
976    ;;
977 *)
978    ans=no
979    ;;
980esac
981ac_cv_arg_setpgrp_negpid=$ans])
982case "$ac_cv_arg_setpgrp_negpid" in
983 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN) ;;
984esac
985
986AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
987[case "$target" in
988 *-*-bsdi[[23]]*)
989    ans=yes
990    ;;
991 *-*-freebsd*)
992    ans=yes
993    ;;
994 *-*-netbsd*)
995    ans=yes
996    ;;
997 *-*-openbsd*)
998    ans=yes
999    ;;
1000 *-*-osf*)
1001    ans=yes
1002    ;;
1003 *) ans=no
1004    ;;
1005esac
1006ac_cv_func_ctty_for_f_setown=$ans])
1007case "$ac_cv_func_ctty_for_f_setown" in
1008 yes) AC_DEFINE(USE_FSETOWNCTTY) ;;
1009esac
1010
1011ntp_warning='GRONK'
1012AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
1013case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1014 yes*)
1015    ntp_warning=''
1016    ans='clock_settime()'
1017    ;;
1018 noyes*)
1019    ntp_warning='But clock_settime() would be better (if we had it)'
1020    ans='settimeofday()'
1021    ;;
1022 nonoyes)
1023    ntp_warning='Which is the worst of the three'
1024    ans='stime()'
1025    ;;
1026 *)
1027    case "$host" in
1028     $target) ntp_warning='Which leaves us with nothing to use!'
1029    ans=none
1030    ;;
1031esac
1032esac
1033AC_MSG_RESULT($ans)
1034case "$ntp_warning" in
1035 '') ;;
1036 *) AC_MSG_WARN(*** $ntp_warning ***)
1037    ;;
1038esac
1039
1040AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1041[case "$target" in
1042 *-*-solaris2.4*)
1043    ans=yes
1044    ;;
1045 *) ans=no
1046    ;;
1047esac
1048ac_cv_var_syscall_bug=$ans])
1049case "$ac_cv_var_syscall_bug" in
1050 yes) AC_DEFINE(SYSCALL_BUG) ;;
1051esac
1052
1053AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
1054[ case "$ac_cv_header_sys_stropts_h" in
1055  yes)
1056     ans=no
1057     # There must be a better way...
1058     case "$target" in
1059      *-*-ptx*)
1060         ans=yes
1061         ;;
1062     esac
1063     ;;
1064 esac
1065 ac_cv_var_streams_tli=$ans])
1066case "$ac_cv_var_streams_tli" in
1067 yes)
1068    AC_DEFINE(STREAMS_TLI)
1069    ;;
1070esac
1071
1072AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1073 AC_EGREP_CPP(yes,
1074  [#include <signal.h>
1075#ifdef SIGIO
1076   yes
1077#endif
1078  ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1079
1080dnl Override those system that have a losing SIGIO
1081AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1082[ans=no
1083case "$ac_cv_hdr_def_sigio" in
1084 yes)
1085    ans=yes
1086    case "$target" in
1087     alpha*-dec-osf4*|alpha*-dec-osf5*)
1088        ans=no
1089        ;;
1090     *-convex-*)
1091        ans=no
1092        ;;
1093     *-dec-*)
1094        ans=no
1095        ;;
1096     *-pc-cygwin*)
1097        ans=no
1098        ;;
1099     *-sni-sysv*)
1100        ans=no
1101        ;;
1102     *-univel-sysv*)
1103        ans=no
1104        ;;
1105     *-*-irix6*)
1106        ans=no
1107        ;;
1108     *-*-freebsd*)
1109        ans=no
1110        ;;
1111     *-*-linux*)
1112        ans=no
1113        ;;
1114    esac
1115    ;;
1116esac
1117ac_cv_var_signalled_io=$ans])
1118case "$ac_cv_var_signalled_io" in
1119 yes) AC_DEFINE(HAVE_SIGNALED_IO) ;;
1120esac
1121
1122AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1123 AC_EGREP_CPP(yes,
1124 [#include <signal.h>
1125#ifdef SIGPOLL
1126  yes
1127#endif
1128 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1129
1130AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1131 AC_EGREP_CPP(yes,
1132 [#include <signal.h>
1133#ifdef SIGSYS
1134  yes
1135#endif
1136 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1137
1138AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1139[ans=no
1140case "$ac_cv_hdr_def_sigpoll" in
1141 yes)
1142    case "$target" in
1143     mips-sgi-irix*)
1144        ans=no
1145        ;;
1146     vax-dec-bsd)
1147        ans=no
1148        ;;
1149     *-pc-cygwin*)
1150        ans=no
1151        ;;
1152     *-sni-sysv*)
1153        ans=no
1154        ;;
1155     *-*-aix4*)
1156        ans=no
1157        ;;
1158     *-*-hpux*)
1159        ans=no
1160        ;;
1161     *-*-linux*)
1162        ans=no
1163        ;;
1164     *-*-osf*)
1165        ans=no
1166        ;;
1167     *-*-sunos*)
1168        ans=no
1169        ;;
1170     *-*-ultrix*)
1171        ans=no
1172        ;;
1173     *) ans=yes
1174        ;;
1175    esac
1176    ;;
1177esac
1178ac_cv_var_use_udp_sigpoll=$ans])
1179case "$ac_cv_var_use_udp_sigpoll" in
1180 yes) AC_DEFINE(USE_UDP_SIGPOLL) ;;
1181esac
1182
1183AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1184[ans=no
1185case "$ac_cv_hdr_def_sigpoll" in
1186 yes)
1187    case "$target" in
1188     mips-sgi-irix*)
1189        ans=no
1190        ;;
1191     vax-dec-bsd)
1192        ans=no
1193        ;;
1194     *-pc-cygwin*)
1195        ans=no
1196        ;;
1197     *-sni-sysv*)
1198        ans=no
1199        ;;
1200     *-*-aix4*)
1201        ans=no
1202        ;;
1203     *-*-hpux*)
1204        ans=no
1205        ;;
1206     *-*-linux*)
1207        ans=no
1208        ;;
1209     *-*-osf*)
1210        ans=no
1211        ;;
1212     *-*-sunos*)
1213        ans=no
1214        ;;
1215     *-*-ultrix*)
1216        ans=no
1217        ;;
1218     *) ans=yes
1219        ;;
1220    esac
1221    ;;
1222esac
1223ac_cv_var_use_tty_sigpoll=$ans])
1224case "$ac_cv_var_use_tty_sigpoll" in
1225 yes) AC_DEFINE(USE_TTY_SIGPOLL) ;;
1226esac
1227
1228case "$ac_cv_header_sys_sio_h" in
1229 yes)
1230    AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1231     AC_EGREP_CPP(yes,
1232[#include <sys/sio.h>
1233#ifdef TIOCDCDTIMESTAMP
1234  yes
1235#endif
1236     ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1237    ;;
1238esac
1239
1240case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1241 yes)
1242    ac_cv_var_oncore_ok=yes
1243    ;;
1244esac
1245
1246AC_CACHE_CHECK(if nlist() values might require extra indirection,
1247ac_cv_var_nlist_extra_indirection,
1248[ans=no
1249case "$target" in
1250 *-*-aix*)
1251    ans=yes
1252    ;;
1253esac
1254ac_cv_var_nlist_extra_indirection=$ans])
1255case "$ac_cv_var_nlist_extra_indirection" in
1256 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION) ;;
1257esac
1258
1259AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1260ac_cv_var_min_rec_tickadj,
1261[ans=no
1262case "$target" in
1263 *-*-aix*)
1264    ans=40
1265    ;;
1266esac
1267ac_cv_var_min_rec_tickadj=$ans])
1268case "$ac_cv_var_min_rec_tickadj" in
1269 ''|no) ;;
1270 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj) ;;
1271esac
1272
1273AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1274ac_cv_var_no_parenb_ignpar,
1275[ans=no
1276case "$target" in
1277 i?86-*-linux*)
1278    ans=yes
1279    ;;
1280 mips-sgi-irix*)
1281    ans=yes
1282    ;;
1283 i?86-*-freebsd[[123]].*)
1284    ;;
1285 i?86-*-freebsd*)
1286    ans=yes
1287    ;;
1288esac
1289ac_cv_var_no_parenb_ignpar=$ans])
1290case "$ac_cv_var_no_parenb_ignpar" in
1291 yes) AC_DEFINE(NO_PARENB_IGNPAR) ;;
1292esac
1293
1294AC_MSG_CHECKING(if we're including debugging code)
1295AC_ARG_ENABLE(debugging,        [  --enable-debugging      + include debugging code],
1296    [ntp_ok=$enableval], [ntp_ok=yes])
1297if test "$ntp_ok" = "yes"; then
1298    AC_DEFINE(DEBUG)
1299fi
1300AC_MSG_RESULT($ntp_ok)
1301
1302AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1303AC_ARG_ENABLE(dst_minutes,      [  --enable-dst-minutes=60 + minutes per DST adjustment],
1304    [ans=$enableval], [ans=60])
1305AC_DEFINE_UNQUOTED(DSTMINUTES, $ans)
1306AC_MSG_RESULT($ans)
1307
1308AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1309 ac_cv_var_tty_clk,
1310 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1311  *yes*) ac_cv_var_tty_clk=yes ;;
1312 esac])
1313case "$ac_cv_var_tty_clk" in
1314 yes) AC_DEFINE(TTYCLK) ;;
1315esac
1316
1317AC_CACHE_CHECK(for the ppsclock streams module,
1318 ac_cv_var_ppsclock,
1319 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1320case "$ac_cv_var_ppsclock" in
1321 yes) AC_DEFINE(PPS) ;;
1322esac
1323
1324AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1325  [ac_cv_var_mcast=no
1326  case "$target" in
1327   i386-sequent-sysv4) ;;
1328   *) AC_EGREP_CPP(yes,
1329  [#include <netinet/in.h>
1330#ifdef IP_ADD_MEMBERSHIP
1331   yes
1332#endif
1333  ], ac_cv_var_mcast=yes) ;;
1334  esac])
1335case "$ac_cv_var_mcast" in
1336 yes) AC_DEFINE(MCAST) ;;
1337esac
1338
1339AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1340 [ac_cv_var_ntp_syscalls=no
1341 case "$ac_cv_func___adjtimex" in
1342  yes)
1343    ac_cv_var_ntp_syscalls=libc
1344    ;;
1345  *) case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
1346      yesyes)
1347        ac_cv_var_ntp_syscalls=libc
1348        ;;
1349      *) AC_EGREP_CPP(yes,
1350         [#include <sys/syscall.h>
1351#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1352           yes
1353#endif
1354          ], ac_cv_var_ntp_syscalls=kernel)
1355         ;;
1356     esac
1357     ;;
1358 esac])
1359case "$ac_cv_var_ntp_syscalls" in
1360 libc)
1361    AC_DEFINE(NTP_SYSCALLS_LIBC)
1362    ;;
1363 kernel)
1364    AC_DEFINE(NTP_SYSCALLS_STD)
1365    ;;
1366 *)
1367    ;;
1368esac
1369
1370AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1371[AC_EGREP_CPP(yes,
1372    [#include <sys/timex.h>
1373#ifdef STA_FLL
1374    yes
1375#endif
1376    ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
1377
1378AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
1379[dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
1380case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
1381 *no*)
1382    ac_cv_var_kernel_pll=no
1383    ;;
1384 *) ac_cv_var_kernel_pll=yes
1385    ;;
1386esac])
1387case "$ac_cv_var_kernel_pll" in
1388 yes)
1389    AC_DEFINE(KERNEL_PLL)
1390    ;;
1391esac
1392
1393AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1394  [ans=no
1395  case "$target" in
1396   *-fujitsu-uxp*)
1397      ans=yes
1398      ;;
1399   *-ncr-sysv4*)
1400      ans=yes
1401      ;;
1402   *-univel-sysv*)
1403      ans=yes
1404      ;;
1405  esac
1406  ac_cv_var_size_returned_in_buffer=$ans])
1407case "$ac_cv_var_size_returned_in_buffer" in
1408 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER) ;;
1409esac
1410
1411dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1412dnl [AC_ARG_ENABLE(gdt-surveying,       [  --enable-gdt-surveying   - include GDT survey code],
1413dnl     [ans=$enableval], [ans=no])
1414dnl ac_cv_var_gdt_surveying=$ans])
1415dnl case "$ac_cv_var_gdt_surveying" in
1416dnl  yes) AC_DEFINE(GDT_SURVEYING) ;;
1417dnl esac
1418
1419# Check for ioctls TIOCGPPSEV
1420AC_MSG_CHECKING(ioctl TIOCGPPSEV)
1421if test "$ac_cv_header_termios_h" = "yes"; then
1422    AC_EGREP_CPP(yes,
1423    [#include <termios.h>
1424#ifdef TIOCGPPSEV
1425         yes
1426#endif
1427         ], ntp_ok=yes, ntp_ok=no)
1428else
1429ntp_ok=no
1430fi
1431if test "$ntp_ok" = "yes"; then
1432    AC_DEFINE(HAVE_TIOCGPPSEV)
1433    ac_cv_var_oncore_ok=yes
1434fi
1435AC_MSG_RESULT($ntp_ok)
1436
1437# Check for ioctls TIOCSPPS
1438AC_MSG_CHECKING(ioctl TIOCSPPS)
1439if test "$ac_cv_header_termios_h" = "yes"; then
1440    AC_EGREP_CPP(yes,
1441    [#include <termios.h>
1442#ifdef TIOCSPPS
1443         yes
1444#endif
1445         ], ntp_ok=yes, ntp_ok=no)
1446else
1447    ntp_ok=no
1448fi
1449
1450if test "$ntp_ok" = "yes"; then
1451    AC_DEFINE(HAVE_TIOCSPPS)
1452fi
1453AC_MSG_RESULT($ntp_ok)
1454
1455# Check for ioctls CIOGETEV
1456AC_MSG_CHECKING(ioctl CIOGETEV)
1457if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
1458    AC_EGREP_CPP(yes,
1459    [#include <sys/ppsclock.h>
1460#ifdef CIOGETEV
1461         yes
1462#endif
1463         ], ntp_ok=yes, ntp_ok=no)
1464else
1465ntp_ok=no
1466fi
1467if test "$ntp_ok" = "yes"; then
1468    ac_cv_var_oncore_ok=yes
1469    AC_DEFINE(HAVE_CIOGETEV)
1470fi
1471AC_MSG_RESULT($ntp_ok)
1472
1473
1474# ATOM/PPSAPI stuff.
1475
1476# ATOM used to require struct timespec, but that's been fixed now.
1477
1478# case "$ac_cv_struct_timespec" in
1479#  'yes')
1480#     ac_cv_var_atom_ok=yes
1481#     ;;
1482# esac
1483ac_cv_var_atom_ok=yes
1484
1485# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1486
1487# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1488
1489# The PPSAPI needs ATOM
1490
1491# The PPSAPI needs struct timespec.
1492
1493case "$ac_cv_c_inline$ac_cv_struct_timespec$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h" in
1494 inlineyes*yes*)
1495    AC_DEFINE(HAVE_PPSAPI)
1496    ac_cv_var_oncore_ok=yes
1497    ;;
1498esac
1499
1500# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1501AC_CHECK_HEADER(linux/serial.h)
1502AC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
1503case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1504  yesyes)
1505    AC_EGREP_CPP(yes,
1506    [#include <sys/time.h>
1507typedef int u_int;
1508
1509#include <sys/ppsclock.h>
1510#include <linux/serial.h>
1511
1512#ifdef TIOCGSERIAL
1513#ifdef TIOCSSERIAL
1514#ifdef ASYNC_PPS_CD_POS
1515#ifdef ASYNC_PPS_CD_NEG
1516#ifdef CIOGETEV
1517         yes
1518#endif
1519#endif
1520#endif
1521#endif
1522#endif
1523         ], ntp_ok=yes)
1524        ;;
1525  *)
1526        ntp_ok=no
1527        ;;
1528esac
1529if test "$ntp_ok" = "yes"; then
1530    AC_DEFINE(HAVE_TIO_SERIAL_STUFF)
1531fi
1532AC_MSG_RESULT($ntp_ok)
1533
1534# Check for SHMEM_STATUS support
1535AC_MSG_CHECKING(SHMEM_STATUS support)
1536case "$ac_cv_header_sys_mman_h" in
1537 yes) ntp_ok=yes ;;
1538 *)   ntp_ok=no  ;;
1539esac
1540if test "$ntp_ok" = "yes"; then
1541    AC_DEFINE(ONCORE_SHMEM_STATUS)
1542fi
1543AC_MSG_RESULT($ntp_ok)
1544
1545dnl dnl These are for OPT_PROGRAMS in authstuff/
1546dnl AC_SUBST(AUTHCERT)
1547dnl AC_SUBST(AUTHSPEED)
1548dnl AC_SUBST(MD5DRIVER)
1549dnl AC_SUBST(KEYPARITY)
1550dnl AC_SUBST(MAKEIPFP)
1551dnl AC_SUBST(MAKEPC1)
1552dnl AC_SUBST(MAKEPC2)
1553dnl AC_SUBST(MAKESP)
1554dnl AC_SUBST(MKRANDKEYS)
1555dnl AC_SUBST(OMAKEIPFP)
1556dnl AC_SUBST(UNIXCERT)
1557
1558ntp_refclock=no
1559
1560AC_MSG_CHECKING(for hopf serial clock device)
1561AC_ARG_ENABLE(HOPFSERIAL,               [  --enable-HOPFSERIAL     + hopf serial clock device],
1562      [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1563  if test "$ntp_ok" = "yes"; then
1564      ntp_refclock=yes
1565      AC_DEFINE(CLOCK_HOPF_SERIAL)
1566  fi
1567  AC_MSG_RESULT($ntp_ok)
1568
1569AC_MSG_CHECKING(for hopf PCI clock 6039)
1570AC_ARG_ENABLE(HOPFPCI,          [  --enable-HOPFPCI        + hopf 6039 PCI board],
1571      [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1572if test "$ntp_ok" = "yes"; then
1573    ntp_refclock=yes
1574    AC_DEFINE(CLOCK_HOPF_PCI)
1575fi
1576AC_MSG_RESULT($ntp_ok)
1577
1578# HPUX only, and by explicit request
1579AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1580AC_ARG_ENABLE(BANCOMM,          [  --enable-BANCOMM        - Datum/Bancomm bc635/VME interface],
1581    [ntp_ok=$enableval], [ntp_ok=no])
1582if test "$ntp_ok" = "yes"; then
1583    ntp_refclock=yes
1584    AC_DEFINE(CLOCK_BANC)
1585fi
1586AC_MSG_RESULT($ntp_ok)
1587case "$ntp_ok$target" in
1588 yes*-*-hpux*) ;;
1589 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1590esac
1591
1592#HPUX only, and only by explicit request
1593AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1594AC_ARG_ENABLE(GPSVME,           [  --enable-GPSVME         - TrueTime GPS receiver/VME interface],
1595    [ntp_ok=$enableval], [ntp_ok=no])
1596if test "$ntp_ok" = "yes"; then
1597    ntp_refclock=yes
1598    AC_DEFINE(CLOCK_GPSVME)
1599fi
1600AC_MSG_RESULT($ntp_ok)
1601case "$ntp_ok$target" in
1602 yes*-*-hpux*) ;;
1603 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1604esac
1605
1606AC_MSG_CHECKING(for PCL720 clock support)
1607case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1608 yesyesyes)
1609    AC_DEFINE(CLOCK_PPS720)
1610    ans=yes
1611    ;;
1612 *)
1613    ans=no
1614    ;;
1615esac
1616AC_MSG_RESULT($ans)
1617
1618AC_MSG_CHECKING(for SHM clock attached thru shared memory)
1619AC_ARG_ENABLE(SHM,              [  --enable-SHM            - SHM clock attached thru shared memory],
1620    [ntp_ok=$enableval], [ntp_ok=no])
1621if test "$ntp_ok" = "yes"; then
1622    ntp_refclock=yes
1623    AC_DEFINE(CLOCK_SHM)
1624fi
1625AC_MSG_RESULT($ntp_ok)
1626
1627AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1628AC_ARG_ENABLE(all-clocks,       [  --enable-all-clocks     + include all suitable non-PARSE clocks:],
1629    [ntp_eac=$enableval], [ntp_eac=yes])
1630AC_MSG_RESULT($ntp_eac)
1631
1632AC_MSG_CHECKING(if we have support for PARSE clocks)
1633case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1634 yes*yes*)
1635    ntp_canparse=yes
1636    ;;
1637 *) ntp_canparse=no
1638    ;;
1639esac
1640AC_MSG_RESULT($ntp_canparse)
1641
1642AC_MSG_CHECKING([if we have support for audio clocks])
1643case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
1644 *yes*)
1645    ntp_canaudio=yes
1646    AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
1647    ;;
1648 *) ntp_canaudio=no ;;
1649esac
1650AC_MSG_RESULT($ntp_canaudio)
1651
1652# Requires modem control
1653AC_MSG_CHECKING(ACTS modem service)
1654AC_ARG_ENABLE(ACTS,             [  --enable-ACTS           + ACTS modem service],
1655    [ntp_ok=$enableval],
1656    [AC_EGREP_CPP(yes,
1657        [#include <termios.h>
1658#ifdef HAVE_SYS_IOCTL_H
1659#include <sys/ioctl.h>
1660#endif
1661#ifdef TIOCMBIS
1662         yes
1663#endif
1664         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1665if test "$ntp_ok" = "yes"; then
1666    ntp_refclock=yes
1667    AC_DEFINE(CLOCK_ACTS)
1668fi
1669AC_MSG_RESULT($ntp_ok)
1670
1671AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1672AC_ARG_ENABLE(ARBITER,          [  --enable-ARBITER        + Arbiter 1088A/B GPS receiver],
1673    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1674if test "$ntp_ok" = "yes"; then
1675    ntp_refclock=yes
1676    AC_DEFINE(CLOCK_ARBITER)
1677fi
1678AC_MSG_RESULT($ntp_ok)
1679
1680AC_MSG_CHECKING(Arcron MSF receiver)
1681AC_ARG_ENABLE(ARCRON_MSF,       [  --enable-ARCRON-MSF     + Arcron MSF receiver],
1682    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1683if test "$ntp_ok" = "yes"; then
1684    ntp_refclock=yes
1685    AC_DEFINE(CLOCK_ARCRON_MSF)
1686fi
1687AC_MSG_RESULT($ntp_ok)
1688
1689AC_MSG_CHECKING(ATOM PPS interface)
1690AC_ARG_ENABLE(ATOM,             [  --enable-ATOM           s ATOM PPS interface],
1691    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1692case "$ac_cv_var_atom_ok" in
1693 no) ntp_ok=no ;;
1694esac
1695if test "$ntp_ok" = "yes"; then
1696    ntp_refclock=yes
1697    AC_DEFINE(CLOCK_ATOM)
1698fi
1699AC_MSG_RESULT($ntp_ok)
1700
1701AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1702AC_ARG_ENABLE(AS2201,           [  --enable-AS2201         + Austron 2200A/2201A GPS receiver],
1703    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1704if test "$ntp_ok" = "yes"; then
1705    ntp_refclock=yes
1706    AC_DEFINE(CLOCK_AS2201)
1707fi
1708AC_MSG_RESULT($ntp_ok)
1709
1710AC_MSG_CHECKING(CHU modem/decoder)
1711AC_ARG_ENABLE(CHU,              [  --enable-CHU            - CHU modem/decoder],
1712    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1713if test "$ntp_ok" = "yes"; then
1714    ntp_refclock=yes
1715    AC_DEFINE(CLOCK_CHU)
1716fi
1717AC_MSG_RESULT($ntp_ok)
1718ac_refclock_chu=$ntp_ok
1719
1720AC_MSG_CHECKING(CHU audio/decoder)
1721AC_ARG_ENABLE(AUDIO-CHU,        [  --enable-AUDIO-CHU      s CHU audio/decoder],
1722    [ntp_ok=$enableval],
1723    [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
1724 *no*)  ntp_ok=no  ;;
1725 *)     ntp_ok=yes ;;
1726esac])
1727if test "$ntp_ok" = "yes"; then
1728    AC_DEFINE(AUDIO_CHU)
1729fi
1730AC_MSG_RESULT($ntp_ok)
1731# We used to check for sunos/solaris target...
1732case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
1733 yes*no*) AC_MSG_WARN(*** But the expected answer is...no ***) ;;
1734esac
1735
1736# Not under HP-UX
1737AC_MSG_CHECKING(Datum Programmable Time System)
1738AC_ARG_ENABLE(DATUM,            [  --enable-DATUM          s Datum Programmable Time System],
1739    [ntp_ok=$enableval],
1740    [case "$ac_cv_header_termios_h" in
1741    yes)
1742        ntp_ok=$ntp_eac
1743        ;;
1744    *) ntp_ok=no
1745        ;;
1746    esac])
1747if test "$ntp_ok" = "yes"; then
1748    ntp_refclock=yes
1749    AC_DEFINE(CLOCK_DATUM)
1750fi
1751AC_MSG_RESULT($ntp_ok)
1752
1753AC_MSG_CHECKING(Forum Graphic GPS)
1754AC_ARG_ENABLE(FG,               [  --enable-FG             + Forum Graphic GPS],
1755    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1756if test "$ntp_ok" = "yes"; then
1757    ntp_refclock=yes
1758    AC_DEFINE(CLOCK_FG)
1759fi
1760AC_MSG_RESULT($ntp_ok)
1761
1762# Requires modem control
1763AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1764AC_ARG_ENABLE(HEATH,            [  --enable-HEATH          s Heath GC-1000 WWV/WWVH receiver],
1765    [ntp_ok=$enableval],
1766    [AC_EGREP_CPP(yes,
1767        [#include <termios.h>
1768#ifdef HAVE_SYS_IOCTL_H
1769#include <sys/ioctl.h>
1770#endif
1771#ifdef TIOCMBIS
1772         yes
1773#endif
1774         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1775if test "$ntp_ok" = "yes"; then
1776    ntp_refclock=yes
1777    AC_DEFINE(CLOCK_HEATH)
1778fi
1779AC_MSG_RESULT($ntp_ok)
1780
1781AC_MSG_CHECKING(HP 58503A GPS receiver)
1782AC_ARG_ENABLE(HPGPS,            [  --enable-HPGPS          + HP 58503A GPS receiver],
1783    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1784if test "$ntp_ok" = "yes"; then
1785    ntp_refclock=yes
1786    AC_DEFINE(CLOCK_HPGPS)
1787fi
1788AC_MSG_RESULT($ntp_ok)
1789
1790AC_MSG_CHECKING(Sun IRIG audio decoder)
1791AC_ARG_ENABLE(IRIG,             [  --enable-IRIG           s Sun IRIG audio decoder],
1792    [ntp_ok=$enableval],
1793    [case "$ntp_eac$ntp_canaudio" in
1794     *no*)      ntp_ok=no  ;;
1795     *)         ntp_ok=yes ;;
1796    esac])
1797if test "$ntp_ok" = "yes"; then
1798    ntp_refclock=yes
1799    AC_DEFINE(CLOCK_IRIG)
1800fi
1801AC_MSG_RESULT($ntp_ok)
1802case "$ntp_ok$ntp_canaudio" in
1803 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1804esac
1805
1806AC_MSG_CHECKING(for JJY receiver)
1807AC_ARG_ENABLE(JJY,              [  --enable-JJY            + JJY receiver],
1808      [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1809if test "$ntp_ok" = "yes"; then
1810    ntp_refclock=yes
1811    AC_DEFINE(CLOCK_JJY)
1812fi
1813AC_MSG_RESULT($ntp_ok)
1814
1815AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
1816AC_ARG_ENABLE(LEITCH,           [  --enable-LEITCH         + Leitch CSD 5300 Master Clock System Driver],
1817    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1818if test "$ntp_ok" = "yes"; then
1819    ntp_refclock=yes
1820    AC_DEFINE(CLOCK_LEITCH)
1821fi
1822AC_MSG_RESULT($ntp_ok)
1823
1824AC_MSG_CHECKING(local clock reference)
1825AC_ARG_ENABLE(LOCAL-CLOCK,      [  --enable-LOCAL-CLOCK    + local clock reference],
1826    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1827if test "$ntp_ok" = "yes"; then
1828    ntp_refclock=yes
1829    AC_DEFINE(CLOCK_LOCAL)
1830fi
1831AC_MSG_RESULT($ntp_ok)
1832
1833AC_MSG_CHECKING(EES M201 MSF receiver)
1834AC_ARG_ENABLE(MSFEES,           [  --enable-MSFEES         + EES M201 MSF receiver],
1835    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1836if test "$ntp_ok" = "yes"; then
1837    ntp_refclock=yes
1838    AC_DEFINE(CLOCK_MSFEES)
1839fi
1840AC_MSG_RESULT($ntp_ok)
1841
1842# Not Ultrix
1843AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
1844AC_ARG_ENABLE(MX4200,           [  --enable-MX4200         s Magnavox MX4200 GPS receiver],
1845    [ntp_ok=$enableval],
1846    [case "$ac_cv_var_ppsclock" in
1847     yes) ntp_ok=$ntp_eac
1848        ;;
1849     *) ntp_ok=no
1850        ;;
1851    esac])
1852if test "$ntp_ok" = "yes"; then
1853    ntp_refclock=yes
1854    AC_DEFINE(CLOCK_MX4200)
1855fi
1856AC_MSG_RESULT($ntp_ok)
1857case "$ntp_ok$target" in
1858 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1859esac
1860
1861AC_MSG_CHECKING(NMEA GPS receiver)
1862AC_ARG_ENABLE(NMEA,             [  --enable-NMEA           + NMEA GPS receiver],
1863    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1864if test "$ntp_ok" = "yes"; then
1865    ntp_refclock=yes
1866    AC_DEFINE(CLOCK_NMEA)
1867fi
1868AC_MSG_RESULT($ntp_ok)
1869
1870AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
1871AC_ARG_ENABLE(ONCORE,           [  --enable-ONCORE         s Motorola VP/UT Oncore GPS receiver],
1872    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1873case "$ac_cv_var_oncore_ok" in
1874 no) ntp_ok=no ;;
1875esac
1876if test "$ntp_ok" = "yes"; then
1877    ntp_refclock=yes
1878    AC_DEFINE(CLOCK_ONCORE)
1879fi
1880AC_MSG_RESULT($ntp_ok)
1881
1882AC_MSG_CHECKING(for Palisade clock)
1883AC_ARG_ENABLE(PALISADE,         [  --enable-PALISADE       + Palisade clock],
1884    [ntp_ok=$enableval],
1885    [case "$ac_cv_header_termios_h" in
1886    yes)
1887        ntp_ok=$ntp_eac
1888        ;;
1889    *) ntp_ok=no
1890        ;;
1891    esac])
1892
1893if test "$ntp_ok" = "yes"; then
1894    ntp_refclock=yes
1895    AC_DEFINE(CLOCK_PALISADE)
1896fi
1897AC_MSG_RESULT($ntp_ok)
1898
1899AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
1900AC_ARG_ENABLE(PST,              [  --enable-PST            + PST/Traconex 1020 WWV/WWVH receiver],
1901    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1902if test "$ntp_ok" = "yes"; then
1903    ntp_refclock=yes
1904    AC_DEFINE(CLOCK_PST)
1905fi
1906AC_MSG_RESULT($ntp_ok)
1907
1908# Not Ultrix
1909AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
1910AC_ARG_ENABLE(JUPITER,          [  --enable-JUPITER        s Rockwell Jupiter GPS receiver],
1911    [ntp_ok=$enableval],
1912    [case "$ac_cv_var_ppsclock" in
1913#     yes) ntp_ok=$ntp_eac
1914#        ;;
1915     *) ntp_ok=no
1916        ;;
1917    esac])
1918if test "$ntp_ok" = "yes"; then
1919    ntp_refclock=yes
1920    AC_DEFINE(CLOCK_JUPITER)
1921fi
1922AC_MSG_RESULT($ntp_ok)
1923case "$ntp_ok$target" in
1924 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1925esac
1926
1927# Requires modem control
1928AC_MSG_CHECKING(PTB modem service)
1929AC_ARG_ENABLE(PTBACTS,          [  --enable-PTBACTS        s PTB modem service],
1930    [ntp_ok=$enableval],
1931    [AC_EGREP_CPP(yes,
1932        [#include <termios.h>
1933#ifdef HAVE_SYS_IOCTL_H
1934#include <sys/ioctl.h>
1935#endif
1936#ifdef TIOCMBIS
1937         yes
1938#endif
1939         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1940if test "$ntp_ok" = "yes"; then
1941    ntp_refclock=yes
1942    AC_DEFINE(CLOCK_PTBACTS)
1943fi
1944AC_MSG_RESULT($ntp_ok)
1945
1946AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
1947AC_ARG_ENABLE(TPRO,             [  --enable-TPRO           s KSI/Odetics TPRO/S GPS receiver/IRIG interface],
1948    [ntp_ok=$enableval],
1949    [case "$ac_cv_header_sys_tpro_h" in
1950     yes)
1951        ntp_ok=$ntp_eac
1952        ;;
1953     *) ntp_ok=no
1954        ;;
1955    esac])
1956if test "$ntp_ok" = "yes"; then
1957    ntp_refclock=yes
1958    AC_DEFINE(CLOCK_TPRO)
1959fi
1960AC_MSG_RESULT($ntp_ok)
1961case "$ntp_ok$ac_cv_header_sys_tpro" in
1962 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1963esac
1964
1965AC_MSG_CHECKING(TRAK 8810 GPS receiver)
1966AC_ARG_ENABLE(TRAK,             [  --enable-TRAK           + TRAK 8810 GPS receiver],
1967    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1968if test "$ntp_ok" = "yes"; then
1969    ntp_refclock=yes
1970    AC_DEFINE(CLOCK_TRAK)
1971fi
1972AC_MSG_RESULT($ntp_ok)
1973
1974AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
1975AC_ARG_ENABLE(CHRONOLOG,        [  --enable-CHRONOLOG      + Chrono-log K-series WWVB receiver],
1976    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1977if test "$ntp_ok" = "yes"; then
1978    ntp_refclock=yes
1979    AC_DEFINE(CLOCK_CHRONOLOG)
1980fi
1981AC_MSG_RESULT($ntp_ok)
1982
1983AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
1984AC_ARG_ENABLE(DUMBCLOCK,        [  --enable-DUMBCLOCK      + Dumb generic hh:mm:ss local clock],
1985    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1986if test "$ntp_ok" = "yes"; then
1987    ntp_refclock=yes
1988    AC_DEFINE(CLOCK_DUMBCLOCK)
1989fi
1990AC_MSG_RESULT($ntp_ok)
1991
1992AC_MSG_CHECKING(Conrad parallel port radio clock)
1993AC_ARG_ENABLE(PCF,              [  --enable-PCF            + Conrad parallel port radio clock],
1994    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1995if test "$ntp_ok" = "yes"; then
1996    ntp_refclock=yes
1997    AC_DEFINE(CLOCK_PCF)
1998fi
1999AC_MSG_RESULT($ntp_ok)
2000
2001AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
2002AC_ARG_ENABLE(SPECTRACOM,       [  --enable-SPECTRACOM     + Spectracom 8170/Netclock/2 WWVB receiver],
2003    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2004if test "$ntp_ok" = "yes"; then
2005    ntp_refclock=yes
2006    AC_DEFINE(CLOCK_SPECTRACOM)
2007fi
2008AC_MSG_RESULT($ntp_ok)
2009
2010# Not on a vax-dec-bsd
2011AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
2012AC_ARG_ENABLE(TRUETIME,         [  --enable-TRUETIME       s Kinemetrics/TrueTime receivers],
2013    [ntp_ok=$enableval],
2014    [case "$target" in
2015     vax-dec-bsd)
2016        ntp_ok=no
2017        ;;
2018     *)
2019        ntp_ok=$ntp_eac
2020        ;;
2021    esac])
2022if test "$ntp_ok" = "yes"; then
2023    ntp_refclock=yes
2024    AC_DEFINE(CLOCK_TRUETIME)
2025fi
2026AC_MSG_RESULT($ntp_ok)
2027case "$ntp_ok$target" in
2028 yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2029esac
2030
2031AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
2032AC_ARG_ENABLE(ULINK,            [  --enable-ULINK          + Ultralink WWVB receiver],
2033    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2034if test "$ntp_ok" = "yes"; then
2035    ntp_refclock=yes
2036    AC_DEFINE(CLOCK_ULINK)
2037fi
2038AC_MSG_RESULT($ntp_ok)
2039
2040AC_MSG_CHECKING(WWV receiver)
2041AC_ARG_ENABLE(WWV,              [  --enable-WWV            + WWV Audio receiver],
2042    [ntp_ok=$enableval],
2043    [case "$ntp_eac$ntp_canaudio" in
2044     *no*)      ntp_ok=no  ;;
2045     *)         ntp_ok=yes ;;
2046    esac])
2047if test "$ntp_ok" = "yes"; then
2048    ntp_refclock=yes
2049    AC_DEFINE(CLOCK_WWV)
2050fi
2051AC_MSG_RESULT($ntp_ok)
2052case "$ntp_ok$ntp_canaudio" in
2053 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2054esac
2055
2056# Requires modem control
2057AC_MSG_CHECKING(USNO modem service)
2058AC_ARG_ENABLE(USNO,             [  --enable-USNO           s USNO modem service],
2059    [ntp_ok=$enableval],
2060    [AC_EGREP_CPP(yes,
2061        [#include <termios.h>
2062#ifdef HAVE_SYS_IOCTL_H
2063#include <sys/ioctl.h>
2064#endif
2065#ifdef TIOCMBIS
2066         yes
2067#endif
2068         ], ntp_ok=$ntp_eac, ntp_ok=no)])
2069if test "$ntp_ok" = "yes"; then
2070    ntp_refclock=yes
2071    AC_DEFINE(CLOCK_USNO)
2072fi
2073AC_MSG_RESULT($ntp_ok)
2074
2075AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
2076AC_ARG_ENABLE(parse-clocks,     [  --enable-parse-clocks   - include all suitable PARSE clocks:],
2077    [ntp_eapc=$enableval],
2078    [case "$ntp_eac" in
2079     yes) ntp_eapc=$ntp_canparse ;;
2080     *) ntp_eapc=no ;;
2081    esac
2082    ntp_eapc=no])
2083AC_MSG_RESULT($ntp_eapc)
2084
2085case "$ntp_eac$ntp_eapc$ntp_canparse" in
2086 noyes*)
2087    AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
2088    ;;
2089 yesyesno)
2090    AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
2091    ;;
2092 *) ;;
2093esac
2094
2095ntp_libparse=no
2096ntp_parseutil=no
2097ntp_rawdcf=no
2098
2099AC_MSG_CHECKING(Diem Computime Radio Clock)
2100AC_ARG_ENABLE(COMPUTIME,        [  --enable-COMPUTIME      s Diem Computime Radio Clock],
2101    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2102if test "$ntp_ok" = "yes"; then
2103    ntp_libparse=yes
2104    ntp_refclock=yes
2105    AC_DEFINE(CLOCK_COMPUTIME)
2106fi
2107AC_MSG_RESULT($ntp_ok)
2108case "$ntp_ok$ntp_canparse" in
2109 yesno)
2110    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2111    ;;
2112esac
2113
2114AC_MSG_CHECKING(ELV/DCF7000 clock)
2115AC_ARG_ENABLE(DCF7000,          [  --enable-DCF7000        s ELV/DCF7000 clock],
2116    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2117if test "$ntp_ok" = "yes"; then
2118    ntp_libparse=yes
2119    ntp_refclock=yes
2120    AC_DEFINE(CLOCK_DCF7000)
2121fi
2122AC_MSG_RESULT($ntp_ok)
2123case "$ntp_ok$ntp_canparse" in
2124 yesno)
2125    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2126    ;;
2127esac
2128
2129AC_MSG_CHECKING(HOPF 6021 clock)
2130AC_ARG_ENABLE(HOPF6021,         [  --enable-HOPF6021       s HOPF 6021 clock],
2131    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2132if test "$ntp_ok" = "yes"; then
2133    ntp_libparse=yes
2134    ntp_refclock=yes
2135    AC_DEFINE(CLOCK_HOPF6021)
2136fi
2137AC_MSG_RESULT($ntp_ok)
2138case "$ntp_ok$ntp_canparse" in
2139 yesno)
2140    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2141    ;;
2142esac
2143
2144AC_MSG_CHECKING(Meinberg clocks)
2145AC_ARG_ENABLE(MEINBERG,         [  --enable-MEINBERG       s Meinberg clocks],
2146    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2147if test "$ntp_ok" = "yes"; then
2148    ntp_libparse=yes
2149    ntp_refclock=yes
2150    AC_DEFINE(CLOCK_MEINBERG)
2151fi
2152AC_MSG_RESULT($ntp_ok)
2153case "$ntp_ok$ntp_canparse" in
2154 yesno)
2155    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2156    ;;
2157esac
2158
2159AC_MSG_CHECKING(DCF77 raw time code)
2160AC_ARG_ENABLE(RAWDCF,           [  --enable-RAWDCF         s DCF77 raw time code],
2161    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2162if test "$ntp_ok" = "yes"; then
2163    ntp_libparse=yes
2164    ntp_parseutil=yes
2165    ntp_refclock=yes
2166    ntp_rawdcf=yes
2167    AC_DEFINE(CLOCK_RAWDCF)
2168fi
2169AC_MSG_RESULT($ntp_ok)
2170case "$ntp_ok$ntp_canparse" in
2171 yesno)
2172    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2173    ;;
2174esac
2175
2176case "$ntp_rawdcf" in
2177 yes)
2178    AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2179    ac_cv_var_rawdcf_parity,
2180    [ans=no
2181    case "$target" in
2182     *-*-linux*)
2183        ans=yes
2184        ;;
2185    esac
2186    ac_cv_var_rawdcf_parity=$ans])
2187    case "$ac_cv_var_rawdcf_parity" in
2188     yes) AC_DEFINE(RAWDCF_NO_IGNPAR) ;;
2189    esac
2190    ;;
2191
2192 *) # HMS: Is this a good idea?
2193    ac_cv_var_rawdcf_parity=no
2194    ;;
2195esac
2196
2197AC_MSG_CHECKING(RCC 8000 clock)
2198AC_ARG_ENABLE(RCC8000,          [  --enable-RCC8000        s RCC 8000 clock],
2199    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2200if test "$ntp_ok" = "yes"; then
2201    ntp_libparse=yes
2202    ntp_refclock=yes
2203    AC_DEFINE(CLOCK_RCC8000)
2204fi
2205AC_MSG_RESULT($ntp_ok)
2206case "$ntp_ok$ntp_canparse" in
2207 yesno)
2208    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2209    ;;
2210esac
2211
2212AC_MSG_CHECKING(Schmid DCF77 clock)
2213AC_ARG_ENABLE(SCHMID,           [  --enable-SCHMID         s Schmid DCF77 clock],
2214    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2215if test "$ntp_ok" = "yes"; then
2216    ntp_libparse=yes
2217    ntp_refclock=yes
2218    AC_DEFINE(CLOCK_SCHMID)
2219fi
2220AC_MSG_RESULT($ntp_ok)
2221case "$ntp_ok$ntp_canparse" in
2222 yesno)
2223    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2224    ;;
2225esac
2226
2227AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2228AC_ARG_ENABLE(TRIMTAIP,         [  --enable-TRIMTAIP       s Trimble GPS receiver/TAIP protocol],
2229    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2230if test "$ntp_ok" = "yes"; then
2231    ntp_libparse=yes
2232    ntp_refclock=yes
2233    AC_DEFINE(CLOCK_TRIMTAIP)
2234fi
2235AC_MSG_RESULT($ntp_ok)
2236case "$ntp_ok$ntp_canparse" in
2237 yesno)
2238    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2239    ;;
2240esac
2241
2242AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2243AC_ARG_ENABLE(TRIMTSIP,         [  --enable-TRIMTSIP       s Trimble GPS receiver/TSIP protocol],
2244    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2245if test "$ntp_ok" = "yes"; then
2246    ntp_libparse=yes
2247    ntp_refclock=yes
2248    AC_DEFINE(CLOCK_TRIMTSIP)
2249fi
2250AC_MSG_RESULT($ntp_ok)
2251case "$ntp_ok$ntp_canparse" in
2252 yesno)
2253    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2254    ;;
2255esac
2256
2257AC_MSG_CHECKING(WHARTON 400A Series clock)
2258AC_ARG_ENABLE(WHARTON,          [  --enable-WHARTON        s WHARTON 400A Series clock],
2259    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2260if test "$ntp_ok" = "yes"; then
2261    ntp_libparse=yes
2262    ntp_refclock=yes
2263    AC_DEFINE(CLOCK_WHARTON_400A)
2264fi
2265AC_MSG_RESULT($ntp_ok)
2266case "$ntp_ok$ntp_canparse" in
2267 yesno)
2268    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2269    ;;
2270esac
2271
2272AC_MSG_CHECKING(VARITEXT clock)
2273AC_ARG_ENABLE(VARITEXT,         [  --enable-VARITEXT       s VARITEXT clock],
2274    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2275if test "$ntp_ok" = "yes"; then
2276    ntp_libparse=yes
2277    ntp_refclock=yes
2278    AC_DEFINE(CLOCK_VARITEXT)
2279fi
2280AC_MSG_RESULT($ntp_ok)
2281case "$ntp_ok$ntp_canparse" in
2282 yesno)
2283    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2284    ;;
2285esac
2286AC_SUBST(LIBPARSE)
2287AC_SUBST(MAKE_LIBPARSE)
2288AC_SUBST(MAKE_LIBPARSE_KERNEL)
2289AC_SUBST(MAKE_CHECK_Y2K)
2290AC_MSG_CHECKING(if we need to make and use the parse libraries)
2291ans=no
2292case "$ntp_libparse" in
2293 yes)
2294    ans=yes
2295    AC_DEFINE(CLOCK_PARSE)
2296    LIBPARSE=../libparse/libparse.a
2297    MAKE_LIBPARSE=libparse.a
2298    MAKE_CHECK_Y2K=check_y2k
2299    AC_DEFINE(PPS_SAMPLE)
2300    AC_DEFINE(CLOCK_ATOM)
2301    ;;
2302esac
2303AC_MSG_RESULT($ans)
2304
2305AC_SUBST(RSAOBJS)
2306AC_SUBST(RSASRCS)
2307AC_SUBST(RSADIR)
2308AC_SUBST(RSAREF)
2309AC_SUBST(LIBRSAREF)
2310AC_SUBST(MAKE_LIBRSAREF)
2311
2312AC_SUBST(OPENSSL)
2313AC_SUBST(OPENSSL_INC)
2314AC_SUBST(OPENSSL_LIB)
2315
2316AC_SUBST(MAKE_NTP_GENKEYS)
2317
2318AC_MSG_CHECKING(for openssl library directory)
2319AC_ARG_WITH(openssl-libdir,
2320        AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
2321[ans=$withval], [ans=yes])
2322case "$ans" in
2323 no) ;;
2324 yes) # Look in:
2325    ans="/usr/lib /usr/local/lib /usr/local/ssl/lib"
2326    ;;
2327 *) # Look where they said
2328    ;;
2329esac
2330case "$ans" in
2331 no) ;;
2332 *) # Look for libcrypto.a and libssl.a:
2333    for i in $ans no
2334    do
2335        test -f $i/libcrypto.a -a -f $i/libssl.a && break
2336    done
2337    case "$i" in
2338     no)
2339        ans=no
2340        OPENSSL_LIB=
2341        ;;
2342     *) ans=$i
2343        OPENSSL_LIB=$ans
2344        ;;
2345    esac
2346    ;;
2347esac
2348AC_MSG_RESULT($ans)
2349
2350AC_MSG_CHECKING(for openssl include directory)
2351AC_ARG_WITH(openssl-incdir,
2352        AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
2353[ans=$withval], [ans=yes])
2354case "$ans" in
2355 no) ;;
2356 yes) # look in:
2357    ans="/usr/include /usr/local/include /usr/local/ssl/include"
2358    ;;
2359 *) # Look where they said
2360    ;;
2361esac
2362case "$ans" in
2363 no) ;;
2364 *) # look for openssl/opensslconf.h:
2365    for i in $ans no
2366    do
2367        test -f $i/openssl/opensslconf.h && break
2368    done
2369    case "$i" in
2370     no)
2371        ans=no
2372        OPENSSL_INC=
2373        ;;
2374     *) ans=$i
2375        OPENSSL_INC=$ans
2376        ;;
2377    esac
2378    ;;
2379esac
2380AC_MSG_RESULT($ans)
2381
2382AC_MSG_CHECKING(for the level of crypto support)
2383AC_ARG_WITH(crypto,
2384        AC_HELP_STRING([--with-crypto], [+ ={autokey,rsaref}]),
2385dnl     AC_HELP_STRING([--with-crypto], [+ ={autokey,openssl,rsaref}]),
2386[ans=$withval], [ans=yes])
2387case "$ans" in
2388 no) ;;
2389 yes|rsaref|openssl)
2390    case "$ans" in
2391     yes|rsaref) # Just "rsaref" when OpenSSL is ready
2392        ans=no
2393        ;;
2394     *)
2395        if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
2396        then
2397            ans=no
2398        else
2399            # We have OpenSSL inc/lib - use them.
2400            ans=openssl
2401            CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
2402            LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
2403            LIBS="$LIBS -lcrypto"
2404            AC_DEFINE(DES)
2405            AC_DEFINE(OPENSSL, , [Use OpenSSL?])
2406            AC_DEFINE(PUBKEY, , [Public key?])
2407        fi
2408        ;;
2409    esac
2410
2411    case "$ans" in
2412     no)
2413        if test -f $srcdir/rsaref2/source/digit.c
2414        then
2415            ans=rsaref
2416            RSAOBJS=digit.o
2417            RSASRCS="digit.c digit.h"
2418            RSADIR=rsaref2
2419        fi
2420        if test -f $srcdir/rsaeuro1/source/rsaeuro.h
2421        then
2422            ans=rsaref
2423            RSAOBJS="md4c.o shsc.o"
2424            RSASRCS="md4c.c shsc.c"
2425            RSADIR=rsaeuro1
2426        fi
2427        if test "$ans" = "rsaref"; then
2428            LIBRSAREF=../librsaref/librsaref.a
2429            MAKE_LIBRSAREF=librsaref.a
2430            AC_DEFINE(DES)
2431            AC_DEFINE(PUBKEY)
2432            AC_DEFINE(RSAREF, , [Use RSAREF?])
2433        fi
2434        ;;
2435    esac
2436    ;;
2437esac
2438AC_SUBST(AUTOKEY)
2439case "$ans" in
2440 no) ;;
2441 *)
2442    AC_DEFINE(AUTOKEY, , [Autokey?])
2443    AUTOKEY=1
2444    ;;
2445esac
2446AC_MSG_RESULT($ans)
2447
2448AC_MSG_CHECKING(if we want to compile with ElectricFence)
2449AC_ARG_WITH(electricfence,      [  --with-electricfence    - compile with ElectricFence malloc debugger],
2450[ans=$withval], [ans=no])
2451case "$ans" in
2452 no) ;;
2453 *)
2454    LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
2455    EF_PROGS="eftest tstheap"
2456    AC_SUBST(EF_PROGS)
2457    EF_LIBS=libefence.a
2458    AC_SUBST(EF_LIBS)
2459    ans=yes
2460    ;;
2461esac
2462AC_MSG_RESULT($ans)
2463
2464AC_SUBST(TESTDCF)
2465AC_SUBST(DCFD)
2466
2467AC_MSG_CHECKING(if we can make dcf parse utilities)
2468ans=no
2469if test "$ntp_parseutil" = "yes"; then
2470    case "$target" in
2471     *-*-sunos4*|*-*-solaris2*|*-*-linux*)
2472        ans="dcfd testdcf"
2473        DCFD=dcfd
2474        TESTDCF=testdcf
2475        ;;
2476    esac
2477fi
2478AC_MSG_RESULT($ans)
2479
2480AC_SUBST(MAKE_PARSEKMODULE)
2481AC_MSG_CHECKING(if we can build kernel streams modules for parse)
2482ans=no
2483case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
2484 yesyes)
2485    case "$target" in
2486     sparc-*-sunos4*)
2487        case "$ac_cv_var_kernel_pll" in
2488        yes)
2489            AC_DEFINE(PPS_SYNC)
2490            ;;
2491        esac
2492        ans=parsestreams
2493        MAKE_PARSEKMODULE=parsestreams.loadable_module.o
2494        ;;
2495     sparc-*-solaris2*)
2496        ans=parsesolaris
2497        MAKE_PARSEKMODULE=parse
2498        ;;
2499    esac
2500    ;;
2501esac
2502AC_MSG_RESULT($ans)
2503
2504AC_MSG_CHECKING(if we need basic refclock support)
2505if test "$ntp_refclock" = "yes"; then
2506    AC_DEFINE(REFCLOCK)
2507fi
2508AC_MSG_RESULT($ntp_refclock)
2509
2510dnl Things that can be made in clockstuff/
2511AC_SUBST(PROPDELAY)     dnl Set to "propdelay"
2512AC_SUBST(CHUTEST)       dnl Set to "chutest"
2513AC_SUBST(CLKTEST)       dnl Set to "clktest"
2514
2515AC_SUBST(MAKE_ADJTIMED)
2516AC_MSG_CHECKING(if we want HP-UX adjtimed support)
2517case "$target" in
2518 *-*-hpux[[56789]]*)
2519    ans=yes
2520    ;;
2521 *) ans=no
2522    ;;
2523esac
2524if test "$ans" = "yes"; then
2525    MAKE_ADJTIMED=adjtimed
2526    AC_DEFINE(NEED_HPUX_ADJTIME)
2527fi
2528AC_MSG_RESULT($ans)
2529
2530AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
2531[AC_ARG_ENABLE(kmem,            [  --enable-kmem           s read /dev/kmem for tick and/or tickadj],
2532    [ans=$enableval],
2533    [case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
2534     *yes*)
2535        ans=yes
2536        ;;
2537     *) ans=no
2538        ;;
2539    esac
2540    case "$target" in
2541     *-*-aix*)
2542        #ans=no
2543        ;;
2544     *-*-domainos)      # Won't be found...
2545        ans=no
2546        ;;
2547     *-*-hpux*)
2548        #ans=no
2549        ;;
2550     *-*-irix[[456]]*)
2551        ans=no
2552        ;;
2553     *-*-linux*)
2554        ans=no
2555        ;;
2556     *-*-winnt3.5)
2557        ans=no
2558        ;;
2559    esac
2560    ])
2561ac_cv_var_can_kmem=$ans])
2562
2563case "$ac_cv_var_can_kmem" in
2564 *yes*) ;;
2565 *) AC_DEFINE(NOKMEM) ;;
2566esac
2567
2568AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
2569[AC_ARG_ENABLE(accurate-adjtime, [  --enable-accurate-adjtime
2570                          s the adjtime() call is accurate],
2571    [ans=$enableval],
2572    [case "$target" in
2573      i386-sequent-ptx*)
2574         ans=no
2575         ;;
2576      i386-unknown-osf1*)
2577         ans=yes
2578         ;;
2579      mips-sgi-irix[[456]]*)
2580         ans=yes
2581         ;;
2582      *-fujitsu-uxp*)
2583         ans=yes
2584         ;;
2585      *-ibm-aix4*)
2586         ans=yes
2587         ;;
2588      *-*-linux*)
2589         ans=yes
2590         ;;
2591      *-*-solaris2.[[01]]*)
2592         ans=no
2593         ;;
2594      *-*-solaris2*)
2595         ans=yes
2596         ;;
2597      *) ans=no
2598         ;;
2599     esac
2600     ])
2601ac_cv_var_adjtime_is_accurate=$ans])
2602case "$ac_cv_var_adjtime_is_accurate" in
2603 yes) AC_DEFINE(ADJTIME_IS_ACCURATE) ;;
2604esac
2605
2606AC_CACHE_CHECK([the name of 'tick' in the kernel],
2607ac_cv_var_nlist_tick,
2608[ans=_tick
2609case "$target" in
2610 m68*-hp-hpux*) # HP9000/300?
2611    ans=_old_tick
2612    ;;
2613 *-apple-aux[[23]]*)
2614    ans=tick
2615    ;;
2616 *-hp-hpux*)
2617    ans=old_tick
2618    ;;
2619 *-ibm-aix[[34]]*)
2620    ans=no
2621    ;;
2622 *-*-mpeix*)
2623    ans=no
2624    ;;
2625 *-*-ptx*)
2626    ans=tick
2627    ;;
2628 *-*-sco3.2v[[45]]*)
2629    ans=no
2630    ;;
2631 *-*-solaris2*)
2632    ans=nsec_per_tick
2633    ;;
2634 *-*-sysv4*)
2635    ans=tick
2636    ;;
2637esac
2638ac_cv_var_nlist_tick=$ans])
2639case "$ac_cv_var_nlist_tick" in
2640 ''|no) ;;      # HMS: I think we can only get 'no' here...
2641 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick") ;;
2642esac
2643#
2644AC_CACHE_CHECK([for the units of 'tick'],
2645ac_cv_var_tick_nano,
2646[ans=usec
2647case "$target" in
2648 *-*-solaris2*)
2649    ans=nsec
2650    ;;
2651esac
2652ac_cv_var_tick_nano=$ans])
2653case "$ac_cv_var_tick_nano" in
2654 nsec)
2655    AC_DEFINE(TICK_NANO)
2656    ;;
2657esac
2658#
2659AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
2660ac_cv_var_nlist_tickadj,
2661[ans=_tickadj
2662case "$target" in
2663 m68*-hp-hpux*) # HP9000/300?
2664    ans=_tickadj
2665    ;;
2666 *-apple-aux[[23]]*)
2667    ans=tickadj
2668    ;;
2669 *-hp-hpux10*)
2670    ans=no
2671    ;;
2672 *-hp-hpux9*)
2673    ans=no
2674    ;;
2675 *-hp-hpux*)
2676    ans=tickadj
2677    ;;
2678 *-*-aix*)
2679    ans=tickadj
2680    ;;
2681 *-*-mpeix*)
2682    ans=no
2683    ;;
2684 *-*-ptx*)
2685    ans=tickadj
2686    ;;
2687 *-*-sco3.2v4*)
2688    ans=no
2689    ;;
2690 *-*-sco3.2v5.0*)
2691    ans=clock_drift
2692    ;;
2693 *-*-solaris2*)
2694    ans=no      # hrestime_adj
2695    ;;
2696 *-*-sysv4*)
2697    ans=tickadj
2698    ;;
2699esac
2700ac_cv_var_nlist_tickadj=$ans])
2701case "$ac_cv_var_nlist_tickadj" in
2702 ''|no) ;;      # HMS: I think we can only get 'no' here...
2703 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj") ;;
2704esac
2705#
2706AC_CACHE_CHECK([for the units of 'tickadj'],
2707ac_cv_var_tickadj_nano,
2708[ans=usec
2709case "$target" in
2710 *-*-solaris2*)
2711    ans=nsec
2712    ;;
2713esac
2714ac_cv_var_tickadj_nano=$ans])
2715case "$ac_cv_var_tickadj_nano" in
2716 nsec)
2717    AC_DEFINE(TICKADJ_NANO)
2718    ;;
2719esac
2720#
2721AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
2722ac_cv_var_nlist_dosynctodr,
2723[case "$target" in
2724 *-apple-aux[[23]]*)
2725    ans=no
2726    ;;
2727 *-sni-sysv*)
2728    ans=dosynctodr
2729    ;;
2730 *-*-aix*)
2731    ans=dosynctodr
2732    ;;
2733 *-*-hpux*)
2734    ans=no
2735    ;;
2736 *-*-mpeix*)
2737    ans=no
2738    ;;
2739 *-*-nextstep*)
2740    ans=_dosynctodr
2741    ;;
2742 *-*-ptx*)
2743    ans=doresettodr
2744    ;;
2745 *-*-sco3.2v4*)
2746    ans=no
2747    ;;
2748 *-*-sco3.2v5*)
2749    ans=track_rtc
2750    ;;
2751 *-*-solaris2*)
2752    ans=dosynctodr
2753    ;;
2754 *-*-sysv4*)
2755    ans=doresettodr
2756    ;;
2757 *)
2758    ans=_dosynctodr
2759    ;;
2760esac
2761ac_cv_var_nlist_dosynctodr=$ans])
2762case "$ac_cv_var_nlist_dosynctodr" in
2763 no) ;;
2764 *)  AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr")
2765     ;;
2766esac
2767#
2768AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
2769ac_cv_var_nlist_noprintf,
2770[case "$target" in
2771 *-apple-aux[[23]]*)
2772    ans=no
2773    ;;
2774 *-sni-sysv*)
2775    ans=noprintf
2776    ;;
2777 *-*-aix*)
2778    ans=noprintf
2779    ;;
2780 *-*-hpux*)
2781    ans=no
2782    ;;
2783 *-*-mpeix*)
2784    ans=no
2785    ;;
2786 *-*-ptx*)
2787    ans=noprintf
2788    ;;
2789 *-*-nextstep*)
2790    ans=_noprintf
2791    ;;
2792 *-*-solaris2*)
2793    ans=noprintf
2794    ;;
2795 *-*-sysv4*)
2796    ans=noprintf
2797    ;;
2798 *)
2799    ans=_noprintf
2800    ;;
2801esac
2802ac_cv_var_nlist_noprintf=$ans])
2803case "$ac_cv_var_nlist_noprintf" in
2804 no) ;;
2805 *)  AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf")
2806     ;;
2807esac
2808
2809dnl The tick/tickadj sections were written by Skippy, who never learned
2810dnl that it's impolite (horridly gross) to show your guts in public.
2811
2812dnl     tick            tickadj
2813dnl     10000           80          Unixware
2814dnl     1000000L/hz     tick/16     (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
2815dnl     10000           150         sgi IRIX
2816dnl     1000000L/hz     1000        RS6000 && NOKMEM
2817dnl     1000000L/hz     668         DOMAINOS && NOKMEM
2818dnl     1000000L/hz     500/HZ      other && NOKMEM
2819dnl     txc.tick        1           Linux
2820dnl     (every / 10)    50          WinNT - tickadj is roughly 500/hz
2821dnl     1000000L/hz     (nlist)     (Solaris && !ADJTIME_IS_ACCURATE),
2822dnl                                 (RS6000 && !NOKMEM), SINIX MIPS
2823
2824dnl But we'll only use these "values" if we can't find anything else.
2825
2826AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
2827[AC_ARG_ENABLE(tick,            [  --enable-tick=VALUE     s force a value for 'tick'],
2828    [ans=$enableval],
2829    [ans=no
2830     case "$target" in
2831      XXX-*-pc-cygwin*)
2832         ;;
2833      *-univel-sysv*)
2834         ans=10000
2835         ;;
2836      *-*-irix*)
2837         ans=10000
2838         ;;
2839      *-*-linux*)
2840         ans=txc.tick
2841         ;;
2842      *-*-mpeix*)
2843         ans=no
2844         ;;
2845      *-*-winnt3.5)
2846         ans='(every / 10)'
2847         ;;
2848      *)
2849         ans='1000000L/hz'
2850         ;;
2851     esac])
2852ac_cv_var_tick=$ans])
2853case "$ac_cv_var_tick" in
2854 ''|no) ;;      # HMS: I think we can only get 'no' here...
2855 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick) ;;
2856esac
2857
2858AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
2859[AC_ARG_ENABLE(tickadj,         [  --enable-tickadj=VALUE  s force a value for 'tickadj'],
2860  [ans=$enableval],
2861  [ans='500/hz'
2862  case "$target" in
2863   *-fujitsu-uxp*)
2864      case "$ac_cv_var_adjtime_is_accurate" in
2865       yes) ans='tick/16' ;;
2866      esac
2867      ;;
2868   XXX-*-pc-cygwin*)
2869      ans=no
2870      ;;
2871   *-univel-sysv*)
2872      ans=80
2873      ;;
2874   *-*-aix*)
2875      case "$ac_cv_var_can_kmem" in
2876       no) ans=1000 ;;
2877      esac
2878      ;;
2879   *-*-domainos)        # Skippy: won't be found...
2880      case "$ac_cv_var_can_kmem" in
2881       no) ans=668 ;;
2882      esac
2883      ;;
2884   *-*-hpux*)
2885      case "$ac_cv_var_adjtime_is_accurate" in
2886       yes) ans='tick/16' ;;
2887      esac
2888      ;;
2889   *-*-irix*)
2890      ans=150
2891      ;;
2892   *-*-mpeix*)
2893      ans=no
2894      ;;
2895   *-*-sco3.2v5.0*)
2896      ans=10000L/hz
2897      ;;
2898   *-*-solaris2*)
2899      case "$ac_cv_var_adjtime_is_accurate" in
2900       yes)
2901          #ans='tick/16'
2902          ;;
2903      esac
2904      ;;
2905   *-*-winnt3.5)
2906      ans=50
2907      ;;
2908  esac])
2909ac_cv_var_tickadj=$ans])
2910case "$ac_cv_var_tickadj" in
2911 ''|no) ;;      # HMS: I think we can only get 'no' here...
2912 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj) ;;
2913esac
2914
2915# Newer versions of ReliantUNIX round adjtime() values down to
2916# 1/100s (system tick). Sigh ...
2917# Unfortunately, there is no easy way to know if particular release
2918# has this "feature" or any obvious way to test for it.
2919case "$target" in
2920 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK) ;;
2921esac
2922
2923case "$target" in
2924 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK) ;;
2925esac
2926
2927ac_cv_make_tickadj=yes
2928case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
2929 nonono)        # Don't read KMEM, no presets.  Bogus.
2930    AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ.  No tickadj.)
2931    ac_cv_make_tickadj=no
2932    ;;
2933 nono*)         # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
2934    AC_MSG_WARN(Can't read kmem but no PRESET_TICK.  No tickadj.)
2935    ac_cv_make_tickadj=no
2936    ;;
2937 no*no)         # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Bogus.
2938    AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ.  No tickadj.)
2939    ac_cv_make_tickadj=no
2940    ;;
2941 no*)           # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ.  Cool.
2942    ;;
2943 yesnono)       # Read KMEM, no presets.  Cool.
2944    ;;
2945 yesno*)        # Read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
2946    AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK.  Please report this.)
2947    ;;
2948 yes*no)        # Read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Cool.
2949    ;;
2950 yes*)          # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
2951    ;;
2952 *)             # Generally bogus.
2953    AC_MSG_ERROR(This shouldn't happen.)
2954    ;;
2955esac
2956
2957AC_SUBST(MAKE_NTPTIME)
2958AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
2959[case "$target" in
2960 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
2961     yesyes)
2962        ans=yes
2963        ;;
2964     *)
2965        ans=no
2966        ;;
2967    esac
2968    ;;
2969esac
2970ac_cv_make_ntptime=$ans])
2971case "$ac_cv_make_ntptime" in
2972 yes)
2973    MAKE_NTPTIME=ntptime
2974    ;;
2975esac
2976
2977AC_SUBST(MAKE_TICKADJ)
2978case "$target" in
2979 mips-sni-sysv4*)
2980    # tickadj is pretty useless on newer versions of ReliantUNIX
2981    # Do not bother
2982    ac_cv_make_tickadj=no
2983    ;;
2984 *-*-irix*)
2985    ac_cv_make_tickadj=no
2986    ;;
2987 *-*-solaris2*)
2988    # DLM says tickadj is a no-no starting with solaris2.5
2989    case "$target" in
2990     *-*-solaris2.[0-4]*) ;;
2991     *) ac_cv_make_tickadj=no ;;
2992    esac
2993    ;;
2994esac
2995AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
2996ac_cv_make_tickadj=yes)
2997case "$ac_cv_make_tickadj" in
2998 yes)
2999    MAKE_TICKADJ=tickadj
3000    ;;
3001esac
3002
3003AC_SUBST(MAKE_TIMETRIM)
3004AC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
3005[case "$target" in
3006 *-*-irix*)
3007    ac_cv_make_timetrim=yes
3008    ;;
3009 *)
3010    ac_cv_make_timetrim=no
3011    ;;
3012esac])
3013case "$ac_cv_make_timetrim" in
3014 yes)
3015    MAKE_TIMETRIM=timetrim
3016    ;;
3017esac
3018
3019AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
3020[AC_ARG_ENABLE(udp-wildcard,    [  --enable-udp-wildcard   s use UDP wildcard delivery],
3021    [ans=$enableval],
3022    [ans=no
3023     case "$target" in
3024      *-fujitsu-uxp*)
3025         ans=yes
3026         ;;
3027      *-univel-sysv*)
3028         ans=yes
3029         ;;
3030      *-*-aix3.2*)
3031         ans=yes
3032         ;;
3033      *-*-aix4*)
3034         ans=yes
3035         ;;
3036      *-*-bsdi*)
3037         ans=yes
3038         ;;
3039      *-*-domainos)
3040         ans=yes
3041         ;;
3042      *-*-freebsd*)
3043        ans=yes
3044        ;;
3045      *-*-hpux*)
3046         ans=yes
3047         ;;
3048      *-*-irix6*)
3049         ans=yes
3050         ;;
3051      *-*-linux*)
3052         ans=yes
3053         ;;
3054      *-*-mpeix*)
3055         ans=yes
3056         ;;
3057      *-*-osf*)
3058         ans=yes
3059         ;;
3060      *-*-ptx*)
3061         ans=yes
3062         ;;
3063      *-*-solaris2*)
3064         ans=yes
3065         ;;
3066      *-*-sunos4*)
3067         ans=yes
3068         ;;
3069     esac])
3070ac_cv_var_udp_wildcard_delivery=$ans])
3071case "$ac_cv_var_udp_wildcard_delivery" in
3072 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY) ;;
3073esac
3074
3075case "$host" in
3076 $target)
3077    ;;
3078 *) case "$target" in
3079     *-*-vxworks*)
3080        LDFLAGS="$LDFLAGS -r"
3081        ;;
3082    esac
3083    ;;
3084esac
3085
3086AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3087[AC_ARG_ENABLE(slew-always,      [  --enable-slew-always    s always slew the time],
3088    [ans=$enableval],
3089    [case "$target" in
3090      *-apple-aux[[23]]*)
3091         ans=yes
3092         ;;
3093      *-*-bsdi[[012]]*)
3094         ans=no
3095         ;;
3096      *-*-bsdi*)
3097         ans=yes
3098         ;;
3099      *-*-openvms*)     # HMS: won't be found
3100         ans=yes
3101         ;;
3102      *) ans=no
3103         ;;
3104     esac
3105     ])
3106ac_cv_var_slew_always=$ans])
3107case "$ac_cv_var_slew_always" in
3108 yes) AC_DEFINE(SLEWALWAYS) ;;
3109esac
3110
3111AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3112[AC_ARG_ENABLE(step-slew,        [  --enable-step-slew      s step and slew the time],
3113    [ans=$enableval],
3114    [case "$target" in
3115      *-sni-sysv*)
3116         ans=yes
3117         ;;
3118      *-univel-sysv*)
3119         ans=no
3120         ;;
3121      *-*-ptx*)
3122         ans=yes
3123         ;;
3124      *-*-solaris2.[[012]]*)
3125         ans=yes
3126         ;;
3127      *-*-sysv4*)       # HMS: Does this catch Fujitsu UXP?
3128         ans=yes
3129         ;;
3130      *) ans=no
3131         ;;
3132     esac
3133     ])
3134ac_cv_var_step_slew=$ans])
3135case "$ac_cv_var_step_slew" in
3136 yes) AC_DEFINE(STEP_SLEW) ;;
3137esac
3138
3139AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3140[AC_ARG_ENABLE(ntpdate-step,     [  --enable-ntpdate-step   s if ntpdate should step the time],
3141    [ans=$enableval],
3142    [case "$target" in
3143      *-apple-aux[[23]]*)
3144         ans=yes
3145         ;;
3146      *) ans=no
3147         ;;
3148     esac
3149     ])
3150ac_cv_var_ntpdate_step=$ans])
3151case "$ac_cv_var_ntpdate_step" in
3152 yes) AC_DEFINE(FORCE_NTPDATE_STEP) ;;
3153esac
3154
3155AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3156[AC_ARG_ENABLE(hourly-todr-sync, [  --enable-hourly-todr-sync
3157                          s if we should sync TODR hourly],
3158    [ans=$enableval],
3159    [case "$target" in
3160      *-*-nextstep*)
3161         ans=yes
3162         ;;
3163      *-*-openvms*)     # HMS: won't be found
3164         ans=yes
3165         ;;
3166      *) ans=no
3167         ;;
3168     esac])
3169ac_cv_var_sync_todr=$ans])
3170case "$ac_cv_var_sync_todr" in
3171 yes) AC_DEFINE(DOSYNCTODR) ;;
3172esac
3173
3174AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3175[AC_ARG_ENABLE(kernel-fll-bug, [  --enable-kernel-fll-bug s if we should avoid a kernel FLL bug],
3176    [ans=$enableval],
3177    [case "$target" in
3178     *-*-solaris2.6)
3179         unamev=`uname -v`
3180         case "$unamev" in
3181          Generic_105181-*)
3182             old_IFS="$IFS"
3183             IFS="-"
3184             set $unamev
3185             IFS="$old_IFS"
3186             if test "$2" -ge 17
3187             then
3188                # Generic_105181-17 and higher
3189                ans=no
3190             else
3191                ans=yes
3192             fi
3193             ;;
3194          *) ans=yes
3195             ;;
3196         esac
3197         ;;
3198     *-*-solaris2.7)
3199         unamev=`uname -v`
3200         case "$unamev" in
3201          Generic_106541-*)
3202             old_IFS="$IFS"
3203             IFS="-"
3204             set $unamev
3205             IFS="$old_IFS"
3206             if test "$2" -ge 07
3207             then
3208                # Generic_106541-07 and higher
3209                ans=no
3210             else
3211                ans=yes
3212             fi
3213             ;;
3214          *) ans=yes
3215             ;;
3216         esac
3217         ;;
3218     *) ans=no
3219         ;;
3220    esac
3221    ])
3222ac_cv_var_kernel_fll_bug=$ans])
3223case "$ac_cv_var_kernel_fll_bug" in
3224 yes) AC_DEFINE(KERNEL_FLL_BUG) ;;
3225esac
3226
3227case "$host" in
3228 $target)
3229    ;;
3230 *) case "$target" in
3231     *-*-vxworks*)
3232        LDFLAGS="$LDFLAGS -r"
3233        ;;
3234    esac
3235    ;;
3236esac
3237
3238AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
3239
3240# This is necessary so that .o files in LIBOBJS are also built via
3241# the ANSI2KNR-filtering rules.
3242LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
3243
3244AC_CONFIG_FILES(Makefile adjtimed/Makefile clockstuff/Makefile \
3245ElectricFence/Makefile
3246include/Makefile kernel/Makefile kernel/sys/Makefile libntp/Makefile \
3247libparse/Makefile librsaref/Makefile ntpd/Makefile ntpdc/Makefile \
3248ntpdate/Makefile ntpq/Makefile ntptrace/Makefile parseutil/Makefile \
3249scripts/Makefile scripts/calc_tickadj scripts/checktime scripts/freq_adj \
3250scripts/mkver scripts/ntp-wait scripts/ntpsweep scripts/ntpver \
3251scripts/plot_summary scripts/summary util/Makefile)
3252AC_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]], [])
3253AC_OUTPUT
3254#test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
Note: See TracBrowser for help on using the repository browser.