2
dnl Process this file with autoconf to produce a configure script.
3
m4_include([version.m4])
4
AC_INIT(ntp, VERSION_NUMBER)
7
AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) string])
8
AM_CONFIG_HEADER(config.h)
13
ac_cv_var_oncore_ok=no
14
ac_cv_var_ripe_ncc_ok=no
15
ac_cv_var_jupiter_ok=no
17
dnl Grab any initial CFLAGS so we can pick better defaults.
20
dnl check these early to avoid autoconf warnings
24
dnl we need to check for cross compile tools for vxWorks here
31
CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
34
CFLAGS="$CFLAGS -DSYS_CYGWIN32"
39
CFLAGS="$CFLAGS -Wc,+abi-socket"
44
CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
45
LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
50
AC_CACHE_CHECK(if we should use /dev/clockctl, ac_clockctl,
51
[AC_ARG_ENABLE(clockctl,
52
AC_HELP_STRING([--enable-clockctl], [Use /dev/clockctl for non-root clock control]),
63
# End of AC_CACHE_CHECK for clockctl
64
AC_CHECK_HEADERS(sys/clockctl.h)
65
case "$ac_clockctl$ac_cv_header_sys_clockctl_h" in
67
AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
71
AC_CACHE_CHECK(if we have linux capabilities (libcap), ac_linuxcaps,
72
[AC_ARG_ENABLE(linuxcaps,
73
AC_HELP_STRING([--enable-linuxcaps], [Use Linux capabilities for non-root clock control]),
77
# End of AC_CACHE_CHECK for linuxcaps
78
AC_CHECK_HEADERS(sys/capability.h)
79
AC_CHECK_HEADERS(sys/prctl.h)
80
case "$ac_linuxcaps$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
82
AC_DEFINE(HAVE_LINUX_CAPABILITIES, ,[Do we have Linux capabilities?])
83
AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
94
# Quick and dirty sanity check
96
'') AC_MSG_ERROR(Please follow the directions in html/vxworks.html!)
99
CFLAGS="$CFLAGS -DSYS_VXWORKS"
105
dnl we need to check for cross compile tools for vxWorks here
113
CFLAGS="$CFLAGS -Wall"
114
# CFLAGS="$CFLAGS -Wcast-align"
115
CFLAGS="$CFLAGS -Wcast-qual"
116
# CFLAGS="$CFLAGS -Wconversion"
117
# CFLAGS="$CFLAGS -Werror"
118
CFLAGS="$CFLAGS -Wmissing-prototypes"
119
CFLAGS="$CFLAGS -Wpointer-arith"
120
CFLAGS="$CFLAGS -Wshadow"
121
CFLAGS="$CFLAGS -Wstrict-prototypes"
122
# CFLAGS="$CFLAGS -Wtraditional"
123
# CFLAGS="$CFLAGS -Wwrite-strings"
128
ac_busted_vpath_in_make=no
132
CFLAGS="$CFLAGS -posix"
134
*-*-irix6.1*) # 64 bit only
137
*-*-irix6*) # 6.2 (and later?)
138
ac_busted_vpath_in_make=yes
139
# don't pass -n32 to gcc, it cannot handle and doesn't need it
140
if test "$GCC" != yes; then
145
*) case "$iCFLAGS" in
146
'') CFLAGS="-O2 -g3 -n32" ;;
147
*) CFLAGS="$CFLAGS -n32" ;;
155
*) LDFLAGS="$LDFLAGS -n32" ;;
160
ac_busted_vpath_in_make=yes
163
ac_busted_vpath_in_make=yes
165
dnl This is currently commented out by bor.
166
dnl The new versions of ReliantUNIX round adjtime() interval down
167
dnl to 1/100s (system tick). This makes tickadj actually useless.
168
dnl So, I'd better not use additional flags.
169
dnl I leave it here just in case anybody has better idea
170
dnl mips-sni-sysv4* )
172
dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
174
dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
175
dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
180
case "$ac_busted_vpath_in_make$srcdir" in
183
*) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
185
AC_MSG_ERROR(building outside of the main directory requires GNU make)
196
AC_PROG_GCC_TRADITIONAL
200
AC_PATH_PROG(PATH_SH, sh)
201
AC_PATH_PROG(PATH_PERL, perl)
207
ac_link="$ac_link $VX_KERNEL"
215
AC_CHECK_LIB(advapi32, main)
218
AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
219
dnl AC_CHECK_LIB(kvm, main, , , -lelf)
220
AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
221
AC_CHECK_LIB(ld, nlist)
222
AC_CHECK_LIB(mld, nlist)
223
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket))
224
AC_CHECK_FUNC(openlog, ,
225
AC_CHECK_LIB(gen, openlog, ,
226
AC_CHECK_LIB(syslog, openlog, , , -lsocket)))
227
AC_CHECK_LIB(md5, MD5Init, ,
228
AC_CHECK_LIB(md, MD5Init))
229
AC_CHECK_FUNCS(MD5Init)
230
dnl HMS: What a hack...
231
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
232
case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
236
AC_CHECK_LIB(readline, readline, ,
237
AC_MSG_NOTICE([Trying again with -lcurses])
238
unset ac_cv_lib_readline_readline
239
AC_CHECK_LIB(readline, readline,
240
LIBS="-lreadline -lcurses $LIBS"
241
AC_DEFINE(HAVE_LIBREADLINE)
242
AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
243
AC_CHECK_LIB(edit, readline,
244
LIBS="-ledit -lcurses"
245
AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
246
AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
250
AC_SUBST(READLINE_LIBS)
255
dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
256
dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
257
dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
258
dnl does Strange Things with extra processes using the Posix-compatibility
259
dnl real-time library, so we don't want to use it.
264
AC_CHECK_LIB(rt, sched_setscheduler, ,
265
AC_CHECK_LIB(posix4, sched_setscheduler))
269
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
272
AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h)
273
# HMS: Lame, but fast.
274
if test -f /etc/redhat-release
278
AC_CHECK_HEADERS(md5.h)
280
AC_CHECK_HEADERS(memory.h netdb.h poll.h)
281
AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
282
AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
285
AC_CHECK_HEADERS(utmpx.h)
286
case "$ac_cv_header_utmpx_h" in
288
*) AC_CHECK_HEADERS(utmp.h) ;;
291
*) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
293
AC_CHECK_HEADERS(arpa/nameser.h)
294
AC_CHECK_HEADERS(net/if.h, [], [],
295
[#if HAVE_SYS_SOCKET_H
296
#include <sys/socket.h>
299
AC_CHECK_HEADERS(net/if6.h)
300
AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
301
AC_CHECK_HEADERS(netinet/in.h)
302
AC_CHECK_HEADERS(netinet/ip.h, [], [],
303
[#if HAVE_SYS_TYPES_H
304
#include <sys/types.h>
306
#if HAVE_NETINET_IN_H
307
#include <netinet/in.h>
309
#if HAVE_NETINET_IN_SYSTM_H
310
#include <netinet/in_systm.h>
313
AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
314
AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
315
dnl AC_CHECK_HEADERS(sys/chudefs.h)
316
AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h sys/var.h)
319
*) AC_CHECK_HEADERS(sys/ioctl.h)
322
AC_CHECK_HEADERS(sys/ipc.h)
323
AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
324
AC_CHECK_HEADERS(sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h)
327
AC_CHECK_HEADERS(sys/sio.h)
330
AC_CHECK_HEADERS(sys/select.h sys/shm.h sys/signal.h sys/sockio.h)
333
*) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
336
AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
337
AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
338
AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
340
[#include <sys/timepps.h>
341
#ifdef PPS_API_VERS_1
344
], [AC_CHECK_HEADERS(sys/timepps.h)])
345
AC_CHECK_HEADERS(sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h)
349
AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
352
AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
356
AC_CHECK_HEADER(nlist.h,
357
[AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
358
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
359
[AC_TRY_COMPILE([#include <nlist.h>],
360
[struct nlist n; n.n_un.n_name = 0;],
361
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
362
if test $ac_cv_struct_nlist_n_un = yes; then
363
AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
367
AC_CHECK_HEADER(libelf/nlist.h,
368
[AC_DEFINE(LIBELF_NLIST_STRUCT, 1, [nlist stuff])
369
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
370
[AC_TRY_COMPILE([#include <libelf/nlist.h>],
371
[struct nlist n; n.n_un.n_name = 0;],
372
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
373
if test $ac_cv_struct_nlist_n_un = yes; then
374
AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
378
dnl AC_CHECK_HEADERS(net/if.h, [], [],
379
dnl [#if HAVE_SYS_TYPES_H
380
dnl # include <sys/types.h>
382
dnl #if HAVE_SYS_SOCKET_H
383
dnl # include <sys/socket.h>
387
AC_CHECK_HEADERS(resolv.h, [], [],
388
[#if HAVE_SYS_TYPES_H
389
#include <sys/types.h>
391
#if HAVE_NETINET_IN_H
392
#include <netinet/in.h>
394
#if HAVE_ARPA_NAMESER_H
395
#include <arpa/nameser.h>
399
AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
402
ac_cv_c_volatile=yes,
405
case "$ac_cv_c_volatile" in
408
*) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
414
# Assume that solaris2 is Ansi C...
420
AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
422
extern int foo (short);
423
int foo(short i) { return i; }],[
424
int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
426
if test "$ac_cv_have_prototypes" = yes; then
427
AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
435
AC_CHECK_TYPE(time_t, long)
438
AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
439
[AC_TRY_COMPILE([#include <sys/types.h>],
440
[u_int8_t len = 42; return 0;],
441
ac_cv_type_u_int8_t=yes,
442
ac_cv_type_u_int8_t=no)
444
if test $ac_cv_type_u_int8_t = yes; then
445
AC_DEFINE(HAVE_TYPE_U_INT8_T,1,Does u_int8_t exist)
448
AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
449
[AC_TRY_COMPILE([#include <sys/types.h>],
450
[u_int64_t len = 42; return 0;],
451
ac_cv_type_u_int64_t=yes,
452
ac_cv_type_u_int64_t=no)
454
if test $ac_cv_type_u_int64_t = yes; then
455
AC_DEFINE(HAVE_TYPE_U_INT64_T,1,Does u_int64_t exist)
458
AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
459
[ac_cv_var_default_hz=100
461
alpha*-dec-osf4*|alpha*-dec-osf5*)
462
ac_cv_var_default_hz=1024
465
ac_cv_var_default_hz=256
468
AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
470
AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
471
[ac_cv_var_override_hz=no
473
alpha*-dec-osf4*|alpha*-dec-osf5*)
474
ac_cv_var_override_hz=yes
477
ac_cv_var_override_hz=yes
480
ac_cv_var_override_hz=yes
483
ac_cv_var_override_hz=yes
486
case "$ac_cv_var_override_hz" in
488
AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
492
dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
493
dnl [AC_TRY_LINK([#include <sys/types.h>
494
dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
495
dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
496
dnl if test $su_cv_func_ut_host_in_utmp = yes; then
497
dnl AC_DEFINE(HAVE_UT_HOST)
500
dnl AC_MSG_CHECKING(if we can get the system boot time)
501
dnl AC_CACHE_VAL(su_cv_have_boot_time,
502
dnl [AC_EGREP_CPP(yes,
503
dnl [#ifdef HAVE_UTMPX_H
504
dnl #include <utmpx.h>
506
dnl #include <utmp.h>
511
dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
512
dnl AC_MSG_RESULT($su_cv_have_boot_time)
515
struct sigaction for sa_sigaction,
516
ac_cv_struct_sigaction_has_sa_sigaction,
519
[#include <signal.h>],
520
[struct sigaction act; act.sa_sigaction = 0;],
521
ac_cv_struct_sigaction_has_sa_sigaction=yes,
522
ac_cv_struct_sigaction_has_sa_sigaction=no
526
if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
527
AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
530
AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
532
#include <sys/types.h>
533
#ifdef HAVE_SYS_TERMIOS_H
534
# include <sys/termios.h>
536
#ifdef HAVE_SYS_TIME_H
537
# include <sys/time.h>
539
#ifdef HAVE_SYS_PPSCLOCK_H
540
# include <sys/ppsclock.h>
542
extern struct ppsclockev *pce;
543
return pce->serial;],
544
ac_cv_struct_ppsclockev=yes,
545
ac_cv_struct_ppsclockev=no)
547
if test $ac_cv_struct_ppsclockev = yes; then
548
AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
551
AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
553
#include <sys/types.h>
554
#include <sys/socket.h>],[
555
extern struct sockaddr *ps;
557
ac_cv_struct_sockaddr_has_sa_len=yes,
558
ac_cv_struct_sockaddr_has_sa_len=no)
560
if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
561
AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
564
AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage,
566
#include <sys/types.h>
567
#include <sys/socket.h>
568
#include <netinet/in.h>
570
extern struct sockaddr_storage *ss;
572
ac_cv_struct_sockaddr_storage=yes,
573
ac_cv_struct_sockaddr_storage=no)
575
if test $ac_cv_struct_sockaddr_storage = yes; then
576
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
579
AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
580
ac_cv_have_ss_family_in_struct_ss, [
583
#include <sys/types.h>
584
#include <sys/socket.h>
586
[ struct sockaddr_storage s; s.ss_family = 1; ],
587
[ ac_cv_have_ss_family_in_struct_ss="yes" ],
588
[ ac_cv_have_ss_family_in_struct_ss="no" ],
591
if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
592
AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
594
# Hack around a problem...
596
*-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
601
AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
602
ac_cv_have___ss_family_in_struct_ss, [
605
#include <sys/types.h>
606
#include <sys/socket.h>
608
[ struct sockaddr_storage s; s.__ss_family = 1; ],
609
[ ac_cv_have___ss_family_in_struct_ss="yes" ],
610
[ ac_cv_have___ss_family_in_struct_ss="no" ]
613
if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
614
AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
617
AH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
618
[/* Handle ss_family */
619
#if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
620
# define ss_family __ss_family
621
# define ss_len __ss_len
622
#endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
624
case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
626
AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
628
#ifdef HAVE_MACHINE_SOUNDCARD_H
629
# include <machine/soundcard.h>
631
#ifdef HAVE_SYS_SOUNDCARD_H
632
# include <sys/soundcard.h>
634
extern struct snd_size *ss;
635
return ss->rec_size;],
636
ac_cv_struct_snd_size=yes,
637
ac_cv_struct_snd_size=no)
639
case "$ac_cv_struct_snd_size" in
640
yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
645
AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
647
#include <sys/time.h>],[
648
extern struct clockinfo *pc;
650
ac_cv_struct_clockinfo_has_hz=yes,
651
ac_cv_struct_clockinfo_has_hz=no)
653
if test $ac_cv_struct_clockinfo_has_hz = yes; then
654
AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
657
AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
659
#include <sys/time.h>],[
660
extern struct clockinfo *pc;
661
return pc->tickadj;],
662
ac_cv_struct_clockinfo_has_tickadj=yes,
663
ac_cv_struct_clockinfo_has_tickadj=no)
665
if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
666
AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
669
AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
671
#include <sys/time.h>
672
/* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
676
#ifdef HAVE_SYS_TIMEPPS_H
677
# define FRAC 4294967296
678
# include <sys/timepps.h>
680
[struct timespec n;],
681
ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
682
if test $ac_cv_struct_timespec = yes; then
683
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
686
AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
688
#include <sys/time.h>
689
#include <sys/timex.h>],
690
[struct ntptimeval n;],
691
ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
692
if test $ac_cv_struct_ntptimeval = yes; then
693
AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
696
AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
697
[#ifdef HAVE_SYS_TIME_H
698
#include <sys/time.h>
704
#ifdef HAVE_SYS_TIMEX_H
705
#include <sys/timex.h>
713
AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
714
AC_CHECK_SIZEOF(signed char)
716
AC_CHECK_SIZEOF(long)
718
AC_CHECK_TYPES([s_char])
719
case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
721
# We have a typedef for s_char. Might as well believe it...
724
# We have signed chars, can't say 'signed char', no s_char typedef.
725
AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
728
# We have signed chars, can say 'signed char', no s_char typedef.
729
AC_DEFINE(NEED_S_CHAR_TYPEDEF)
732
# We have unsigned chars, can't say 'signed char', no s_char typedef.
733
AC_MSG_ERROR(No way to specify a signed character!)
736
# We have unsigned chars, can say 'signed char', no s_char typedef.
737
AC_DEFINE(NEED_S_CHAR_TYPEDEF)
744
AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
749
# (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
750
# (returning ENOSYS). I didn't check 4.2. If, in the future,
751
# IBM pulls its thumbs out long enough to implement clock_settime,
752
# this conditional will need to change. Maybe use AC_TRY_RUN
753
# instead to try to set the time to itself and check errno.
755
*) AC_CHECK_FUNCS(clock_gettime clock_settime)
758
AC_CHECK_FUNCS(daemon)
759
AC_CHECK_FUNCS(finite, ,
760
[AC_CHECK_FUNCS(isfinite, ,
761
[AC_MSG_CHECKING(for isfinite with <math.h>)
764
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
766
AC_DEFINE(HAVE_ISFINITE)],
769
AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage)
770
AC_CHECK_FUNC(gettimeofday, ,[
772
*-*-mpeix*) ac_cv_func_gettimeofday=yes
778
*) AC_CHECK_FUNCS(getuid)
781
AC_CHECK_FUNCS(hstrerror)
782
AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
783
AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
786
# Just stubs. Idiots.
788
*) AC_CHECK_FUNCS(mkstemp)
791
AC_CHECK_FUNCS(mktime)
794
# Just a stub. Idiots.
797
# Just a stub in "old" Irix. Idiots.
800
# Apparently there but not working in QNX. Idiots?
803
# Just a stub. Idiots.
805
alpha*-dec-osf4*|alpha*-dec-osf5*)
806
# mlockall is there, as a #define calling memlk via <sys/mman.h>
807
# Not easy to test for - cheat.
808
AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
809
AC_CHECK_FUNCS(mlockall)
811
*) AC_CHECK_FUNCS(mlockall)
814
AC_CHECK_FUNCS(mrand48 srand48 nice nlist)
819
*) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
822
AC_CHECK_FUNCS(plock pututline pututxline readlink rtprio)
823
case "$ac_cv_func_mrand48" in
825
*) AC_REPLACE_FUNCS(random) ;;
829
# Just a stub in AIX 4. Idiots.
832
# Just stubs in solaris2.5. Idiots.
834
*) AC_CHECK_FUNCS(sched_setscheduler)
837
AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
838
AC_CHECK_FUNCS(setrlimit)
839
AC_CHECK_FUNCS(settimeofday, ,[
841
*-*-mpeix*) ac_cv_func_settimeofday=yes
844
AC_CHECK_FUNCS(setvbuf sigaction)
845
AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
846
AC_CHECK_FUNCS(snprintf strdup strerror strstr)
847
AC_CHECK_FUNCS(timegm)
850
# Just stubs. Idiots.
853
# Just stubs. Idiots.
856
# Just stubs. Idiots.
859
# Just stubs. Idiots.
861
*) AC_CHECK_FUNCS(timer_create timer_settime)
868
*) AC_CHECK_FUNCS(umask)
871
AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
875
AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
879
AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
880
[AC_TRY_COMPILE([#include <sys/time.h>],[
881
gettimeofday((struct timeval*)0,(struct timezone*)0);
882
settimeofday((struct timeval*)0,(struct timezone*)0);
884
ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
886
if test $ac_cv_func_Xettimeofday_nargs = 1; then
887
AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
890
AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
892
#ifdef HAVE_SYS_TYPES_H
893
# include <sys/types.h>
899
ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
901
if test $ac_cv_func_setpgrp_nargs = 0; then
902
AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
906
CFLAGS="$CFLAGS -I$srcdir/include"
908
AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
909
ac_cv_func_qsort_argtype,
911
#include "l_stdlib.h"
913
#ifdef HAVE_PROTOTYPES
920
extern sortfunc P((const void *, const void *));
923
const void *b; { return 0; }
925
qsort(base, 2, sizeof(char *), sortfunc);
927
ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
929
case "$ac_cv_func_qsort_argtype" in
931
AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
937
AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
938
[AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
942
ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
943
case "$ac_cv_decl_errno" in
944
yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
947
dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
948
dnl the clash. <resolv.h> isn't currently used.
950
dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
951
dnl MT purposes. This makes the line "extern int h_errno" choke
952
dnl the compiler. Hopefully adding !defined(h_errno) fixes this
953
dnl without breaking any other platforms.
955
AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
956
[AC_TRY_COMPILE([#include <sys/types.h>
957
#ifdef HAVE_NETINET_IN_H
958
#include <netinet/in.h>
960
#ifdef HAVE_ARPA_NAMESER_H
961
#include <arpa/nameser.h>
969
[extern int h_errno;],
970
ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
971
case "$ac_cv_decl_h_errno" in
972
yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
975
dnl See if char *sys_errlist[] is OK.
976
AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
977
[AC_TRY_COMPILE([#include <stdio.h>
981
[extern char *sys_errlist[];
983
ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
984
case "$ac_cv_decl_sys_errlist" in
985
yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
988
AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
990
#ifdef HAVE_SYS_TYPES_H
991
# include <sys/types.h>
996
#ifdef HAVE_PROTOTYPES
1002
[extern int syscall P((int, ...));],
1003
ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
1004
case "$ac_cv_decl_syscall" in
1005
yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
1010
AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style]) # Needed for XLC under AIX 4.3.2
1013
AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1014
AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
1015
AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1016
AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
1017
AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1018
AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1019
AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
1020
AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1021
AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1024
AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1025
AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
1028
AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1031
AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1032
AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1033
AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1034
AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1035
AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1036
AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1037
AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1038
AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1039
AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1040
AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1041
AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1042
AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1043
AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1044
AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1045
AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1046
AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1049
AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1050
AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
1053
AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1058
AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1059
AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
1060
AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1061
AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1062
AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1063
AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1064
AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1065
AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1066
AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
1067
AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1068
AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1069
AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1070
AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1071
AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
1072
AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
1073
case "`basename $ac_cv_prog_CC`" in
1075
*) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1078
AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1079
AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1080
AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1081
AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1082
AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1083
AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
1084
AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
1087
AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1088
AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1089
AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
1090
AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1091
AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1092
AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1093
AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
1094
AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
1095
AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1096
AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1097
AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1098
AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1099
AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
1100
AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
1101
AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1102
AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1108
AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
1112
AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
1119
ac_cv_var_rcvbuf_slop=$ans])
1120
case "$ac_cv_var_rcvbuf_slop" in
1121
yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
1124
AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
1131
ac_cv_var_open_bcast_socket=$ans])
1132
case "$ac_cv_var_open_bcast_socket" in
1133
yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
1136
AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
1143
ac_cv_var_hpux_findconfig=$ans])
1144
case "$ac_cv_var_hpux_findconfig" in
1145
yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
1148
AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
1169
ac_cv_arg_setpgrp_negpid=$ans])
1170
case "$ac_cv_arg_setpgrp_negpid" in
1171
yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
1174
AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
1194
ac_cv_func_ctty_for_f_setown=$ans])
1195
case "$ac_cv_func_ctty_for_f_setown" in
1196
yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
1200
AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
1201
case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1204
ans='clock_settime()'
1207
ntp_warning='But clock_settime() would be better (if we had it)'
1208
ans='settimeofday()'
1211
ntp_warning='Which is the worst of the three'
1216
$host) ntp_warning='Which leaves us with nothing to use!'
1222
case "$ntp_warning" in
1224
*) AC_MSG_WARN(*** $ntp_warning ***)
1228
AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1236
ac_cv_var_syscall_bug=$ans])
1237
case "$ac_cv_var_syscall_bug" in
1238
yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1241
AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
1242
[ case "$ac_cv_header_sys_stropts_h" in
1245
# There must be a better way...
1253
ac_cv_var_streams_tli=$ans])
1254
case "$ac_cv_var_streams_tli" in
1256
AC_DEFINE(STREAMS_TLI, 1, [Do we have STREAMS/TLI? (Can we replace this with HAVE_SYS_STROPTS_H?)])
1260
AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1262
[#include <signal.h>
1266
], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1268
dnl Override those system that have a losing SIGIO
1269
AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1271
case "$ac_cv_hdr_def_sigio" in
1275
alpha*-dec-osf4*|alpha*-dec-osf5*)
1308
ac_cv_var_signalled_io=$ans])
1309
case "$ac_cv_var_signalled_io" in
1310
yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1313
AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1315
[#include <signal.h>
1319
], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1321
AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1323
[#include <signal.h>
1327
], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1329
AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1331
case "$ac_cv_hdr_def_sigpoll" in
1375
ac_cv_var_use_udp_sigpoll=$ans])
1376
case "$ac_cv_var_use_udp_sigpoll" in
1377
yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1380
AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1382
case "$ac_cv_hdr_def_sigpoll" in
1426
ac_cv_var_use_tty_sigpoll=$ans])
1427
case "$ac_cv_var_use_tty_sigpoll" in
1428
yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
1431
case "$ac_cv_header_sys_sio_h" in
1433
AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1435
[#include <sys/sio.h>
1436
#ifdef TIOCDCDTIMESTAMP
1439
], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1443
case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1445
ac_cv_var_oncore_ok=yes
1449
AC_CACHE_CHECK(if nlist() values might require extra indirection,
1450
ac_cv_var_nlist_extra_indirection,
1457
ac_cv_var_nlist_extra_indirection=$ans])
1458
case "$ac_cv_var_nlist_extra_indirection" in
1459
yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
1462
AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1463
ac_cv_var_min_rec_tickadj,
1470
ac_cv_var_min_rec_tickadj=$ans])
1471
case "$ac_cv_var_min_rec_tickadj" in
1473
*) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
1476
AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1477
ac_cv_var_no_parenb_ignpar,
1486
i?86-*-freebsd[[123]].*)
1495
ac_cv_var_no_parenb_ignpar=$ans])
1496
case "$ac_cv_var_no_parenb_ignpar" in
1497
yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
1500
AC_MSG_CHECKING(if we're including debugging code)
1501
AC_ARG_ENABLE(debugging, [ --enable-debugging + include debugging code],
1502
[ntp_ok=$enableval], [ntp_ok=yes])
1503
if test "$ntp_ok" = "yes"; then
1504
AC_DEFINE(DEBUG, 1, [Enable debugging?])
1506
AC_MSG_RESULT($ntp_ok)
1508
AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1509
AC_ARG_ENABLE(dst_minutes, [ --enable-dst-minutes=60 + minutes per DST adjustment],
1510
[ans=$enableval], [ans=60])
1511
AC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
1514
AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1516
[case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1517
*yes*) ac_cv_var_tty_clk=yes ;;
1519
case "$ac_cv_var_tty_clk" in
1520
yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
1523
AC_CACHE_CHECK(for the ppsclock streams module,
1525
ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1526
case "$ac_cv_var_ppsclock" in
1527
yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
1530
AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1533
i386-sequent-sysv4) ;;
1534
*) AC_EGREP_CPP(yes,
1535
[#include <netinet/in.h>
1536
#ifdef IP_ADD_MEMBERSHIP
1539
], ac_cv_var_mcast=yes) ;;
1541
case "$ac_cv_var_mcast" in
1542
yes) AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?]) ;;
1545
AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1546
[ac_cv_var_ntp_syscalls=no
1547
case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
1549
ac_cv_var_ntp_syscalls=libc
1551
*) case "$ac_cv_func___adjtimex" in
1553
ac_cv_var_ntp_syscalls=adjtimex
1555
*) AC_EGREP_CPP(yes,
1556
[#include <sys/syscall.h>
1557
#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1560
], ac_cv_var_ntp_syscalls=kernel)
1565
case "$ac_cv_var_ntp_syscalls" in
1567
AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
1570
AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
1576
AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1578
[#include <sys/timex.h>
1582
], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
1584
AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
1585
[dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
1586
case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
1588
ac_cv_var_kernel_pll=no
1590
*) ac_cv_var_kernel_pll=yes
1593
case "$ac_cv_var_kernel_pll" in
1595
AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
1599
AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1612
ac_cv_var_size_returned_in_buffer=$ans])
1613
case "$ac_cv_var_size_returned_in_buffer" in
1614
yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
1617
dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1618
dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
1619
dnl [ans=$enableval], [ans=no])
1620
dnl ac_cv_var_gdt_surveying=$ans])
1621
dnl case "$ac_cv_var_gdt_surveying" in
1622
dnl yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
1625
# Check for ioctls TIOCGPPSEV
1626
AC_MSG_CHECKING(ioctl TIOCGPPSEV)
1627
if test "$ac_cv_header_termios_h" = "yes"; then
1629
[#include <termios.h>
1633
], ntp_ok=yes, ntp_ok=no)
1637
if test "$ntp_ok" = "yes"; then
1638
AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1639
ac_cv_var_oncore_ok=yes
1641
AC_MSG_RESULT($ntp_ok)
1643
# Check for ioctls TIOCSPPS
1644
AC_MSG_CHECKING(ioctl TIOCSPPS)
1645
if test "$ac_cv_header_termios_h" = "yes"; then
1647
[#include <termios.h>
1651
], ntp_ok=yes, ntp_ok=no)
1656
if test "$ntp_ok" = "yes"; then
1657
AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
1659
AC_MSG_RESULT($ntp_ok)
1661
# Check for ioctls CIOGETEV
1662
AC_MSG_CHECKING(ioctl CIOGETEV)
1663
if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
1665
[#include <sys/ppsclock.h>
1669
], ntp_ok=yes, ntp_ok=no)
1673
if test "$ntp_ok" = "yes"; then
1674
ac_cv_var_oncore_ok=yes
1675
AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1677
AC_MSG_RESULT($ntp_ok)
1680
# ATOM/PPSAPI stuff.
1682
# ATOM used to require struct timespec, but that's been fixed now.
1684
# case "$ac_cv_struct_timespec" in
1686
# ac_cv_var_atom_ok=yes
1689
ac_cv_var_atom_ok=yes
1691
# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1693
# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1695
# The PPSAPI needs ATOM
1697
# The PPSAPI needs struct timespec.
1699
case "$ac_cv_c_inline$ac_cv_struct_timespec$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h" in
1701
AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1702
ac_cv_var_oncore_ok=yes
1703
ac_cv_var_ripe_ncc_ok=yes
1704
ac_cv_var_jupiter_ok=yes
1708
# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1709
AC_CHECK_HEADER(linux/serial.h)
1710
AC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
1711
case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1714
[#include <sys/time.h>
1717
#include <sys/ppsclock.h>
1718
#include <linux/serial.h>
1722
#ifdef ASYNC_PPS_CD_POS
1723
#ifdef ASYNC_PPS_CD_NEG
1737
if test "$ntp_ok" = "yes"; then
1738
AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
1740
AC_MSG_RESULT($ntp_ok)
1742
# Check for SHMEM_STATUS support
1743
AC_MSG_CHECKING(SHMEM_STATUS support)
1744
case "$ac_cv_header_sys_mman_h" in
1748
if test "$ntp_ok" = "yes"; then
1749
AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
1751
AC_MSG_RESULT($ntp_ok)
1753
dnl dnl These are for OPT_PROGRAMS in authstuff/
1754
dnl AC_SUBST(AUTHCERT)
1755
dnl AC_SUBST(AUTHSPEED)
1756
dnl AC_SUBST(MD5DRIVER)
1757
dnl AC_SUBST(KEYPARITY)
1758
dnl AC_SUBST(MAKEIPFP)
1759
dnl AC_SUBST(MAKEPC1)
1760
dnl AC_SUBST(MAKEPC2)
1761
dnl AC_SUBST(MAKESP)
1762
dnl AC_SUBST(MKRANDKEYS)
1763
dnl AC_SUBST(OMAKEIPFP)
1764
dnl AC_SUBST(UNIXCERT)
1768
# HPUX only, and by explicit request
1769
AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1770
AC_ARG_ENABLE(BANCOMM,
1771
AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
1772
[ntp_ok=$enableval], [ntp_ok=no])
1773
if test "$ntp_ok" = "yes"; then
1775
AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
1777
AC_MSG_RESULT($ntp_ok)
1778
case "$ntp_ok$host" in
1780
yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1783
#HPUX only, and only by explicit request
1784
AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1785
AC_ARG_ENABLE(GPSVME,
1786
AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
1787
[ntp_ok=$enableval], [ntp_ok=no])
1788
if test "$ntp_ok" = "yes"; then
1790
AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
1792
AC_MSG_RESULT($ntp_ok)
1793
case "$ntp_ok$host" in
1795
yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1798
AC_MSG_CHECKING(for PCL720 clock support)
1799
case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1801
AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
1810
AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1811
AC_ARG_ENABLE(all-clocks,
1812
AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
1813
[ntp_eac=$enableval], [ntp_eac=yes])
1814
AC_MSG_RESULT($ntp_eac)
1816
AC_MSG_CHECKING(if we have support for PARSE clocks)
1817
case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1824
AC_MSG_RESULT($ntp_canparse)
1826
AC_MSG_CHECKING([if we have support for audio clocks])
1827
case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
1830
AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
1832
*) ntp_canaudio=no ;;
1834
AC_MSG_RESULT($ntp_canaudio)
1836
AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1837
case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1843
AC_MSG_RESULT($ntp_canshm)
1845
# Requires modem control
1846
AC_MSG_CHECKING(ACTS modem service)
1848
AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
1849
[ntp_ok=$enableval],
1851
[#include <termios.h>
1852
#ifdef HAVE_SYS_IOCTL_H
1853
#include <sys/ioctl.h>
1858
], ntp_ok=$ntp_eac, ntp_ok=no)])
1859
if test "$ntp_ok" = "yes"; then
1861
AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
1863
AC_MSG_RESULT($ntp_ok)
1865
AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1866
AC_ARG_ENABLE(ARBITER,
1867
AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
1868
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1869
if test "$ntp_ok" = "yes"; then
1871
AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
1873
AC_MSG_RESULT($ntp_ok)
1875
AC_MSG_CHECKING(Arcron MSF receiver)
1876
AC_ARG_ENABLE(ARCRON_MSF,
1877
AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
1878
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1879
if test "$ntp_ok" = "yes"; then
1881
AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
1883
AC_MSG_RESULT($ntp_ok)
1885
AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1886
AC_ARG_ENABLE(AS2201,
1887
AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
1888
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1889
if test "$ntp_ok" = "yes"; then
1891
AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
1893
AC_MSG_RESULT($ntp_ok)
1895
AC_MSG_CHECKING(ATOM PPS interface)
1897
AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
1898
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1899
case "$ac_cv_var_atom_ok" in
1902
if test "$ntp_ok" = "yes"; then
1904
AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
1906
AC_MSG_RESULT($ntp_ok)
1908
AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
1909
AC_ARG_ENABLE(CHRONOLOG,
1910
AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
1911
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1912
if test "$ntp_ok" = "yes"; then
1914
AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
1916
AC_MSG_RESULT($ntp_ok)
1918
AC_MSG_CHECKING(CHU modem/decoder)
1920
AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
1921
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1922
if test "$ntp_ok" = "yes"; then
1924
AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
1926
AC_MSG_RESULT($ntp_ok)
1927
ac_refclock_chu=$ntp_ok
1929
AC_MSG_CHECKING(CHU audio/decoder)
1930
AC_ARG_ENABLE(AUDIO-CHU,
1931
AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
1932
[ntp_ok=$enableval],
1933
[case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
1937
if test "$ntp_ok" = "yes"; then
1938
AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
1940
AC_MSG_RESULT($ntp_ok)
1941
# We used to check for sunos/solaris target...
1942
case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
1943
yes*no*) AC_MSG_WARN(*** But the expected answer is...no ***) ;;
1947
AC_MSG_CHECKING(Datum Programmable Time System)
1948
AC_ARG_ENABLE(DATUM,
1949
AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
1950
[ntp_ok=$enableval],
1951
[case "$ac_cv_header_termios_h" in
1958
if test "$ntp_ok" = "yes"; then
1960
AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
1962
AC_MSG_RESULT($ntp_ok)
1964
AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
1965
AC_ARG_ENABLE(DUMBCLOCK,
1966
AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
1967
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1968
if test "$ntp_ok" = "yes"; then
1970
AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
1972
AC_MSG_RESULT($ntp_ok)
1974
AC_MSG_CHECKING(Forum Graphic GPS)
1976
AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
1977
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1978
if test "$ntp_ok" = "yes"; then
1980
AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
1982
AC_MSG_RESULT($ntp_ok)
1984
# Requires modem control
1985
AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1986
AC_ARG_ENABLE(HEATH,
1987
AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
1988
[ntp_ok=$enableval],
1990
[#include <termios.h>
1991
#ifdef HAVE_SYS_IOCTL_H
1992
#include <sys/ioctl.h>
1997
], ntp_ok=$ntp_eac, ntp_ok=no)])
1998
if test "$ntp_ok" = "yes"; then
2000
AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
2002
AC_MSG_RESULT($ntp_ok)
2004
AC_MSG_CHECKING(for hopf serial clock device)
2005
AC_ARG_ENABLE(HOPFSERIAL,
2006
AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
2007
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2008
if test "$ntp_ok" = "yes"; then
2010
AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
2012
AC_MSG_RESULT($ntp_ok)
2014
AC_MSG_CHECKING(for hopf PCI clock 6039)
2015
AC_ARG_ENABLE(HOPFPCI,
2016
AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
2017
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2018
if test "$ntp_ok" = "yes"; then
2020
AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
2022
AC_MSG_RESULT($ntp_ok)
2024
AC_MSG_CHECKING(HP 58503A GPS receiver)
2025
AC_ARG_ENABLE(HPGPS,
2026
AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
2027
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2028
if test "$ntp_ok" = "yes"; then
2030
AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
2032
AC_MSG_RESULT($ntp_ok)
2034
AC_MSG_CHECKING(IRIG audio decoder)
2036
AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
2037
[ntp_ok=$enableval],
2038
[case "$ntp_eac$ntp_canaudio" in
2042
if test "$ntp_ok" = "yes"; then
2044
AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
2046
AC_MSG_RESULT($ntp_ok)
2047
case "$ntp_ok$ntp_canaudio" in
2048
yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2051
AC_MSG_CHECKING(for JJY receiver)
2053
AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
2054
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2055
if test "$ntp_ok" = "yes"; then
2057
AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
2059
AC_MSG_RESULT($ntp_ok)
2061
AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
2062
AC_ARG_ENABLE(JUPITER,
2063
AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
2064
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2065
case "$ac_cv_var_jupiter_ok" in
2068
if test "$ntp_ok" = "yes"; then
2070
AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
2072
AC_MSG_RESULT($ntp_ok)
2074
AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
2075
AC_ARG_ENABLE(LEITCH,
2076
AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
2077
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2078
if test "$ntp_ok" = "yes"; then
2080
AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
2082
AC_MSG_RESULT($ntp_ok)
2084
AC_MSG_CHECKING(local clock reference)
2085
AC_ARG_ENABLE(LOCAL-CLOCK,
2086
AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
2087
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2088
if test "$ntp_ok" = "yes"; then
2090
AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
2092
AC_MSG_RESULT($ntp_ok)
2094
AC_MSG_CHECKING(EES M201 MSF receiver)
2095
AC_ARG_ENABLE(MSFEES,
2096
AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
2097
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2098
if test "$ntp_ok" = "yes"; then
2100
AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
2102
AC_MSG_RESULT($ntp_ok)
2105
AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
2106
AC_ARG_ENABLE(MX4200,
2107
AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
2108
[ntp_ok=$enableval],
2109
[case "$ac_cv_var_ppsclock" in
2110
yes) ntp_ok=$ntp_eac
2115
if test "$ntp_ok" = "yes"; then
2117
AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
2119
AC_MSG_RESULT($ntp_ok)
2120
case "$ntp_ok$host" in
2121
yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2124
AC_MSG_CHECKING(for NeoClock4X receiver)
2125
AC_ARG_ENABLE(NEOCLOCK4X,
2126
AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
2127
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2128
if test "$ntp_ok" = "yes"; then
2130
AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
2132
AC_MSG_RESULT($ntp_ok)
2134
AC_MSG_CHECKING(NMEA GPS receiver)
2136
AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
2137
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2138
if test "$ntp_ok" = "yes"; then
2140
AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
2142
AC_MSG_RESULT($ntp_ok)
2144
AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
2145
AC_ARG_ENABLE(ONCORE,
2146
AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
2147
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2148
case "$ac_cv_var_oncore_ok" in
2151
if test "$ntp_ok" = "yes"; then
2153
AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
2155
AC_MSG_RESULT($ntp_ok)
2157
AC_MSG_CHECKING(for Palisade clock)
2158
AC_ARG_ENABLE(PALISADE,
2159
AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
2160
[ntp_ok=$enableval],
2161
[case "$ac_cv_header_termios_h" in
2169
if test "$ntp_ok" = "yes"; then
2171
AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
2173
AC_MSG_RESULT($ntp_ok)
2175
AC_MSG_CHECKING(Conrad parallel port radio clock)
2177
AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
2178
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2179
if test "$ntp_ok" = "yes"; then
2181
AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
2183
AC_MSG_RESULT($ntp_ok)
2185
AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
2187
AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
2188
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2189
if test "$ntp_ok" = "yes"; then
2191
AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
2193
AC_MSG_RESULT($ntp_ok)
2195
# Requires modem control
2196
AC_MSG_CHECKING(PTB modem service)
2197
AC_ARG_ENABLE(PTBACTS,
2198
AC_HELP_STRING([--enable-PTBACTS], [s PTB modem service]),
2199
[ntp_ok=$enableval],
2201
[#include <termios.h>
2202
#ifdef HAVE_SYS_IOCTL_H
2203
#include <sys/ioctl.h>
2208
], ntp_ok=$ntp_eac, ntp_ok=no)])
2209
if test "$ntp_ok" = "yes"; then
2211
AC_DEFINE(CLOCK_PTBACTS, 1, [PTB modem service])
2213
AC_MSG_RESULT($ntp_ok)
2215
AC_MSG_CHECKING(RIPENCC specific Trimble driver)
2216
AC_ARG_ENABLE(RIPENCC,
2217
AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
2218
[ntp_ok=$enableval], [ntp_ok=no])
2219
# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2220
case "$ac_cv_var_ripe_ncc_ok" in
2223
if test "$ntp_ok" = "yes"; then
2225
AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
2227
AC_MSG_RESULT($ntp_ok)
2229
# Danny Meyer says SHM compiles (with a few warnings) under Win32.
2230
# For *IX, we need sys/ipc.h and sys/shm.h.
2231
AC_MSG_CHECKING(for SHM clock attached thru shared memory)
2233
AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
2234
[ntp_ok=$enableval],
2235
[case "$ntp_eac$ntp_canshm" in
2239
if test "$ntp_ok" = "yes"; then
2241
AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
2243
AC_MSG_RESULT($ntp_ok)
2245
AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
2246
AC_ARG_ENABLE(SPECTRACOM,
2247
AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
2248
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2249
if test "$ntp_ok" = "yes"; then
2251
AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
2253
AC_MSG_RESULT($ntp_ok)
2255
AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
2257
AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
2258
[ntp_ok=$enableval],
2259
[case "$ac_cv_header_sys_tpro_h" in
2266
if test "$ntp_ok" = "yes"; then
2268
AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2270
AC_MSG_RESULT($ntp_ok)
2271
case "$ntp_ok$ac_cv_header_sys_tpro" in
2272
yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2275
AC_MSG_CHECKING(TRAK 8810 GPS receiver)
2277
AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
2278
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2279
if test "$ntp_ok" = "yes"; then
2281
AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
2283
AC_MSG_RESULT($ntp_ok)
2285
# Not on a vax-dec-bsd
2286
AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
2287
AC_ARG_ENABLE(TRUETIME,
2288
AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
2289
[ntp_ok=$enableval],
2298
if test "$ntp_ok" = "yes"; then
2300
AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
2302
AC_MSG_RESULT($ntp_ok)
2303
case "$ntp_ok$host" in
2304
yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2307
AC_MSG_CHECKING(TrueTime 560 IRIG-B decoder)
2308
AC_ARG_ENABLE(TT560,
2309
AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
2310
[ntp_ok=$enableval], [ntp_ok=no])
2311
if test "$ntp_ok" = "yes"; then
2313
AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
2315
AC_MSG_RESULT($ntp_ok)
2317
AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
2318
AC_ARG_ENABLE(ULINK,
2319
AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
2320
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2321
if test "$ntp_ok" = "yes"; then
2323
AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
2325
AC_MSG_RESULT($ntp_ok)
2327
# Requires modem control
2328
AC_MSG_CHECKING(USNO modem service)
2330
AC_HELP_STRING([--enable-USNO], [s USNO modem service]),
2331
[ntp_ok=$enableval],
2333
[#include <termios.h>
2334
#ifdef HAVE_SYS_IOCTL_H
2335
#include <sys/ioctl.h>
2340
], ntp_ok=$ntp_eac, ntp_ok=no)])
2341
if test "$ntp_ok" = "yes"; then
2343
AC_DEFINE(CLOCK_USNO, 1, [USNO modem service])
2345
AC_MSG_RESULT($ntp_ok)
2347
AC_MSG_CHECKING(WWV receiver)
2349
AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2350
[ntp_ok=$enableval],
2351
[case "$ntp_eac$ntp_canaudio" in
2355
if test "$ntp_ok" = "yes"; then
2357
AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2359
AC_MSG_RESULT($ntp_ok)
2360
case "$ntp_ok$ntp_canaudio" in
2361
yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2364
AC_MSG_CHECKING(for Zyfer receiver)
2365
AC_ARG_ENABLE(ZYFER,
2366
AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
2367
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2368
if test "$ntp_ok" = "yes"; then
2370
AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
2372
AC_MSG_RESULT($ntp_ok)
2374
AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
2375
AC_ARG_ENABLE(parse-clocks, [ --enable-parse-clocks - include all suitable PARSE clocks:],
2376
[ntp_eapc=$enableval],
2378
yes) ntp_eapc=$ntp_canparse ;;
2382
AC_MSG_RESULT($ntp_eapc)
2384
case "$ntp_eac$ntp_eapc$ntp_canparse" in
2386
AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
2389
AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
2398
AC_MSG_CHECKING(Diem Computime Radio Clock)
2399
AC_ARG_ENABLE(COMPUTIME,
2400
AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
2401
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2402
if test "$ntp_ok" = "yes"; then
2405
AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
2407
AC_MSG_RESULT($ntp_ok)
2408
case "$ntp_ok$ntp_canparse" in
2410
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2414
AC_MSG_CHECKING(ELV/DCF7000 clock)
2415
AC_ARG_ENABLE(DCF7000,
2416
AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
2417
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2418
if test "$ntp_ok" = "yes"; then
2421
AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
2423
AC_MSG_RESULT($ntp_ok)
2424
case "$ntp_ok$ntp_canparse" in
2426
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2430
AC_MSG_CHECKING(HOPF 6021 clock)
2431
AC_ARG_ENABLE(HOPF6021,
2432
AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
2433
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2434
if test "$ntp_ok" = "yes"; then
2437
AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
2439
AC_MSG_RESULT($ntp_ok)
2440
case "$ntp_ok$ntp_canparse" in
2442
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2446
AC_MSG_CHECKING(Meinberg clocks)
2447
AC_ARG_ENABLE(MEINBERG,
2448
AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
2449
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2450
if test "$ntp_ok" = "yes"; then
2453
AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
2455
AC_MSG_RESULT($ntp_ok)
2456
case "$ntp_ok$ntp_canparse" in
2458
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2462
AC_MSG_CHECKING(DCF77 raw time code)
2463
AC_ARG_ENABLE(RAWDCF,
2464
AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
2465
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2466
if test "$ntp_ok" = "yes"; then
2471
AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
2473
AC_MSG_RESULT($ntp_ok)
2474
case "$ntp_ok$ntp_canparse" in
2476
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2480
case "$ntp_rawdcf" in
2482
AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2483
ac_cv_var_rawdcf_parity,
2490
ac_cv_var_rawdcf_parity=$ans])
2491
case "$ac_cv_var_rawdcf_parity" in
2492
yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
2496
*) # HMS: Is this a good idea?
2497
ac_cv_var_rawdcf_parity=no
2501
AC_MSG_CHECKING(RCC 8000 clock)
2502
AC_ARG_ENABLE(RCC8000,
2503
AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
2504
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2505
if test "$ntp_ok" = "yes"; then
2508
AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
2510
AC_MSG_RESULT($ntp_ok)
2511
case "$ntp_ok$ntp_canparse" in
2513
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2517
AC_MSG_CHECKING(Schmid DCF77 clock)
2518
AC_ARG_ENABLE(SCHMID,
2519
AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
2520
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2521
if test "$ntp_ok" = "yes"; then
2524
AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
2526
AC_MSG_RESULT($ntp_ok)
2527
case "$ntp_ok$ntp_canparse" in
2529
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2533
AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2534
AC_ARG_ENABLE(TRIMTAIP,
2535
AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
2536
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2537
if test "$ntp_ok" = "yes"; then
2540
AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
2542
AC_MSG_RESULT($ntp_ok)
2543
case "$ntp_ok$ntp_canparse" in
2545
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2549
AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2550
AC_ARG_ENABLE(TRIMTSIP,
2551
AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
2552
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2553
if test "$ntp_ok" = "yes"; then
2556
AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
2558
AC_MSG_RESULT($ntp_ok)
2559
case "$ntp_ok$ntp_canparse" in
2561
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2565
AC_MSG_CHECKING(WHARTON 400A Series clock)
2566
AC_ARG_ENABLE(WHARTON,
2567
AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
2568
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2569
if test "$ntp_ok" = "yes"; then
2572
AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
2574
AC_MSG_RESULT($ntp_ok)
2575
case "$ntp_ok$ntp_canparse" in
2577
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2581
AC_MSG_CHECKING(VARITEXT clock)
2582
AC_ARG_ENABLE(VARITEXT,
2583
AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
2584
[ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2585
if test "$ntp_ok" = "yes"; then
2588
AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
2590
AC_MSG_RESULT($ntp_ok)
2591
case "$ntp_ok$ntp_canparse" in
2593
AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2597
AC_SUBST(MAKE_LIBPARSE)
2598
AC_SUBST(MAKE_LIBPARSE_KERNEL)
2599
AC_SUBST(MAKE_CHECK_Y2K)
2600
AC_MSG_CHECKING(if we need to make and use the parse libraries)
2602
case "$ntp_libparse" in
2605
AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
2606
LIBPARSE=../libparse/libparse.a
2607
MAKE_LIBPARSE=libparse.a
2608
# HMS: check_y2k trips the 34 year problem now...
2609
0 && MAKE_CHECK_Y2K=check_y2k
2610
AC_DEFINE(PPS_SAMPLE, 1, [PPS auxiliary interface for ATOM?])
2611
AC_DEFINE(CLOCK_ATOM)
2620
# AC_SUBST(LIBRSAREF)
2621
# AC_SUBST(MAKE_LIBRSAREF)
2624
AC_SUBST(OPENSSL_INC)
2625
AC_SUBST(OPENSSL_LIB)
2627
AC_SUBST(MAKE_NTP_KEYGEN)
2629
AC_MSG_CHECKING(for openssl library directory)
2630
AC_ARG_WITH(openssl-libdir,
2631
AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
2632
[ans=$withval], [ans=yes])
2636
ans="/usr/lib /usr/lib/openssl /usr/local/lib /usr/local/ssl/lib"
2638
*) # Look where they said
2643
*) # Look for libcrypto.a and libssl.a:
2648
test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
2651
test -f $i/libcrypto.a -a -f $i/libssl.a && break
2668
AC_MSG_CHECKING(for openssl include directory)
2669
AC_ARG_WITH(openssl-incdir,
2670
AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
2671
[ans=$withval], [ans=yes])
2675
ans="/usr/include /usr/local/include /usr/local/ssl/include"
2677
*) # Look where they said
2682
*) # look for openssl/opensslconf.h:
2685
test -f $i/openssl/opensslconf.h && break
2701
AC_HELP_STRING([--with-crypto], [+ =openssl]),
2702
[ans=$withval], [ans=yes])
2706
if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
2710
# We have OpenSSL inc/lib - use them.
2712
CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
2713
LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
2714
AC_SUBST(LCRYPTO, [-lcrypto])
2715
MAKE_NTP_KEYGEN=ntp-keygen
2716
AC_DEFINE(OPENSSL, , [Use OpenSSL?])
2717
AC_CHECK_FUNCS(EVP_md2 EVP_mdc2)
2721
AC_MSG_CHECKING(for the level of crypto support)
2724
AC_MSG_CHECKING(if we want to compile with ElectricFence)
2725
AC_ARG_WITH(electricfence,
2726
AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
2727
[ans=$withval], [ans=no])
2731
LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
2732
EF_PROGS="eftest tstheap"
2741
AC_MSG_CHECKING(if we want to try SNTP)
2743
AC_HELP_STRING([--with-sntp], [- Build SNTP?]),
2744
[ans=$withval], [ans=no])
2758
AC_MSG_CHECKING(if we can make dcf parse utilities)
2760
if test "$ntp_parseutil" = "yes"; then
2762
*-*-sunos4*|*-*-solaris2*|*-*-linux*)
2771
AC_SUBST(MAKE_PARSEKMODULE)
2772
AC_MSG_CHECKING(if we can build kernel streams modules for parse)
2774
case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
2778
case "$ac_cv_var_kernel_pll" in
2780
AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
2784
MAKE_PARSEKMODULE=parsestreams.loadable_module.o
2788
MAKE_PARSEKMODULE=parse
2795
AC_MSG_CHECKING(if we need basic refclock support)
2796
if test "$ntp_refclock" = "yes"; then
2797
AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
2799
AC_MSG_RESULT($ntp_refclock)
2801
dnl Things that can be made in clockstuff/
2802
AC_SUBST(PROPDELAY) dnl Set to "propdelay"
2803
AC_SUBST(CHUTEST) dnl Set to "chutest"
2804
AC_SUBST(CLKTEST) dnl Set to "clktest"
2806
AC_SUBST(MAKE_ADJTIMED)
2807
AC_MSG_CHECKING(if we want HP-UX adjtimed support)
2815
if test "$ans" = "yes"; then
2816
MAKE_ADJTIMED=adjtimed
2817
AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
2821
AC_MSG_CHECKING(if we want QNX adjtime support)
2829
if test "$ans" = "yes"; then
2830
AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
2834
AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
2835
[AC_ARG_ENABLE(kmem, [ --enable-kmem s read /dev/kmem for tick and/or tickadj],
2837
[case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
2848
*-*-domainos) # Won't be found...
2868
ac_cv_var_can_kmem=$ans])
2870
case "$ac_cv_var_can_kmem" in
2872
*) AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?]) ;;
2875
AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
2876
[AC_ARG_ENABLE(accurate-adjtime, [ --enable-accurate-adjtime
2877
s the adjtime() call is accurate],
2886
mips-sgi-irix[[456]]*)
2898
*-*-solaris2.[[01]])
2911
ac_cv_var_adjtime_is_accurate=$ans])
2912
case "$ac_cv_var_adjtime_is_accurate" in
2913
yes) AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?]) ;;
2916
AC_CACHE_CHECK([the name of 'tick' in the kernel],
2917
ac_cv_var_nlist_tick,
2920
m68*-hp-hpux*) # HP9000/300?
2948
ac_cv_var_nlist_tick=$ans])
2949
case "$ac_cv_var_nlist_tick" in
2950
''|no) ;; # HMS: I think we can only get 'no' here...
2951
*) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
2954
AC_CACHE_CHECK([for the units of 'tick'],
2955
ac_cv_var_tick_nano,
2962
ac_cv_var_tick_nano=$ans])
2963
case "$ac_cv_var_tick_nano" in
2965
AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
2969
AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
2970
ac_cv_var_nlist_tickadj,
2973
m68*-hp-hpux*) # HP9000/300?
3004
ans=no # hrestime_adj
3010
ac_cv_var_nlist_tickadj=$ans])
3011
case "$ac_cv_var_nlist_tickadj" in
3012
''|no) ;; # HMS: I think we can only get 'no' here...
3013
*) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
3016
AC_CACHE_CHECK([for the units of 'tickadj'],
3017
ac_cv_var_tickadj_nano,
3024
ac_cv_var_tickadj_nano=$ans])
3025
case "$ac_cv_var_tickadj_nano" in
3027
AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
3031
AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
3032
ac_cv_var_nlist_dosynctodr,
3071
ac_cv_var_nlist_dosynctodr=$ans])
3072
case "$ac_cv_var_nlist_dosynctodr" in
3074
*) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
3078
AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
3079
ac_cv_var_nlist_noprintf,
3112
ac_cv_var_nlist_noprintf=$ans])
3113
case "$ac_cv_var_nlist_noprintf" in
3115
*) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
3119
dnl The tick/tickadj sections were written by Skippy, who never learned
3120
dnl that it's impolite (horridly gross) to show your guts in public.
3123
dnl 10000 80 Unixware
3124
dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3125
dnl 10000 150 sgi IRIX
3126
dnl 1000000L/hz 1000 RS6000 && NOKMEM
3127
dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3128
dnl 1000000L/hz 500/HZ other && NOKMEM
3129
dnl txc.tick 1 Linux
3130
dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3131
dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3132
dnl (RS6000 && !NOKMEM), SINIX MIPS
3134
dnl But we'll only use these "values" if we can't find anything else.
3136
AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
3137
[AC_ARG_ENABLE(tick, [ --enable-tick=VALUE s force a value for 'tick'],
3165
ac_cv_var_tick=$ans])
3166
case "$ac_cv_var_tick" in
3167
''|no) ;; # HMS: I think we can only get 'no' here...
3168
*) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick, [Preset a value for 'tick'?]) ;;
3171
AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
3172
[AC_ARG_ENABLE(tickadj, [ --enable-tickadj=VALUE s force a value for 'tickadj'],
3177
case "$ac_cv_var_adjtime_is_accurate" in
3178
yes) ans='tick/16' ;;
3188
case "$ac_cv_var_can_kmem" in
3192
*-*-domainos) # Skippy: won't be found...
3193
case "$ac_cv_var_can_kmem" in
3198
case "$ac_cv_var_adjtime_is_accurate" in
3199
yes) ans='tick/16' ;;
3212
case "$ac_cv_var_adjtime_is_accurate" in
3225
ac_cv_var_tickadj=$ans])
3226
case "$ac_cv_var_tickadj" in
3227
''|no) ;; # HMS: I think we can only get 'no' here...
3228
*) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj, [Preset a value for 'tickadj'?]) ;;
3231
# Newer versions of ReliantUNIX round adjtime() values down to
3232
# 1/100s (system tick). Sigh ...
3233
# Unfortunately, there is no easy way to know if particular release
3234
# has this "feature" or any obvious way to test for it.
3236
mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
3240
*-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
3243
ac_cv_make_tickadj=yes
3244
case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
3245
nonono) # Don't read KMEM, no presets. Bogus.
3246
AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.)
3247
ac_cv_make_tickadj=no
3249
nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3250
AC_MSG_WARN(Can't read kmem but no PRESET_TICK. No tickadj.)
3251
ac_cv_make_tickadj=no
3253
no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3254
AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ. No tickadj.)
3255
ac_cv_make_tickadj=no
3257
no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3259
yesnono) # Read KMEM, no presets. Cool.
3261
yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3262
AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.)
3264
yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3266
yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3268
*) # Generally bogus.
3269
AC_MSG_ERROR(This shouldn't happen.)
3273
AC_SUBST(MAKE_NTPTIME)
3274
AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
3276
*) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
3286
ac_cv_make_ntptime=$ans])
3287
case "$ac_cv_make_ntptime" in
3289
MAKE_NTPTIME=ntptime
3293
AC_SUBST(MAKE_TICKADJ)
3296
# tickadj is pretty useless on newer versions of ReliantUNIX
3298
ac_cv_make_tickadj=no
3301
ac_cv_make_tickadj=no
3304
# DLM says tickadj is a no-no starting with solaris2.5
3306
*-*-solaris2.1[[0-9]]*)
3307
ac_cv_make_tickadj=no
3309
*-*-solaris2.[[0-4]]*) ;;
3310
*) ac_cv_make_tickadj=no ;;
3314
ac_cv_make_tickadj=no
3317
AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
3318
ac_cv_make_tickadj=yes)
3319
case "$ac_cv_make_tickadj" in
3321
MAKE_TICKADJ=tickadj
3325
AC_SUBST(MAKE_TIMETRIM)
3326
AC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
3329
ac_cv_make_timetrim=yes
3332
ac_cv_make_timetrim=yes
3335
ac_cv_make_timetrim=no
3338
case "$ac_cv_make_timetrim" in
3340
MAKE_TIMETRIM=timetrim
3344
AC_SUBST(MAKE_LIBNTPSIM)
3345
AC_SUBST(MAKE_NTPDSIM)
3346
AC_CACHE_CHECK([if we want to build the NTPD simulator], ac_cv_var_ntpd_sim,
3347
[AC_ARG_ENABLE(simulator,
3348
AC_HELP_STRING([--enable-simulator], [- build/install the NTPD simulator?]),
3349
[ans=$enableval], [ans=no])
3350
ac_cv_var_ntpd_sim=$ans])
3351
case "$ac_cv_var_ntpd_sim" in
3353
MAKE_NTPDSIM=ntpdsim
3354
MAKE_LIBNTPSIM=libntpsim.a
3358
AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
3359
[AC_ARG_ENABLE(udp-wildcard, [ --enable-udp-wildcard s use UDP wildcard delivery],
3412
ac_cv_var_udp_wildcard_delivery=$ans])
3413
case "$ac_cv_var_udp_wildcard_delivery" in
3414
yes) AC_DEFINE(UDP_WILDCARD_DELIVERY, 1, [use UDP Wildcard Delivery?]) ;;
3422
LDFLAGS="$LDFLAGS -r"
3428
AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3429
[AC_ARG_ENABLE(slew-always, [ --enable-slew-always s always slew the time],
3441
*-*-openvms*) # HMS: won't be found
3448
ac_cv_var_slew_always=$ans])
3449
case "$ac_cv_var_slew_always" in
3450
yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
3453
AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3454
[AC_ARG_ENABLE(step-slew, [ --enable-step-slew s step and slew the time],
3466
*-*-solaris2.1[[0-9]]*)
3469
*-*-solaris2.[[012]]*)
3472
*-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
3479
ac_cv_var_step_slew=$ans])
3480
case "$ac_cv_var_step_slew" in
3481
yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
3484
AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3485
[AC_ARG_ENABLE(ntpdate-step, [ --enable-ntpdate-step s if ntpdate should step the time],
3495
ac_cv_var_ntpdate_step=$ans])
3496
case "$ac_cv_var_ntpdate_step" in
3497
yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
3500
AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3501
[AC_ARG_ENABLE(hourly-todr-sync, [ --enable-hourly-todr-sync
3502
s if we should sync TODR hourly],
3508
*-*-openvms*) # HMS: won't be found
3514
ac_cv_var_sync_todr=$ans])
3515
case "$ac_cv_var_sync_todr" in
3516
yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
3519
AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3520
[AC_ARG_ENABLE(kernel-fll-bug, [ --enable-kernel-fll-bug s if we should avoid a kernel FLL bug],
3533
# Generic_105181-17 and higher
3553
# Generic_106541-07 and higher
3567
ac_cv_var_kernel_fll_bug=$ans])
3568
case "$ac_cv_var_kernel_fll_bug" in
3569
yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
3572
AC_CACHE_CHECK(if we should use the IRIG sawtooth filter, ac_cv_var_irig_sucks,
3573
[AC_ARG_ENABLE(irig-sawtooth,
3574
AC_HELP_STRING([--enable-irig-sawtooth], [s if we should enable the IRIG sawtooth filter]),
3577
*-*-solaris2.[[89]])
3580
*-*-solaris2.1[[0-9]]*)
3587
ac_cv_var_irig_sucks=$ans])
3588
case "$ac_cv_var_irig_sucks" in
3589
yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
3592
AC_CACHE_CHECK(if we should enable NIST lockclock scheme, ac_cv_var_nist_lockclock,
3593
[AC_ARG_ENABLE(nist,
3594
AC_HELP_STRING([--enable-nist], [- if we should enable the NIST lockclock scheme]),
3595
[ans=$enableval],[ans=no])
3596
ac_cv_var_nist_lockclock=$ans])
3597
case "$ac_cv_var_nist_lockclock" in
3598
yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
3601
AC_CACHE_CHECK(if we should cache bad destination addresses, ac_cv_errorcache,
3602
[AC_ARG_ENABLE(errorcache,
3603
AC_HELP_STRING([--enable-errorcache], [- if we should enable caching bad IP destinations]),
3604
[ans=$enableval],[ans=no])
3605
ac_cv_errorcache=$ans])
3606
case "$ac_cv_errorcache" in
3607
yes) AC_DEFINE(ERRORCACHE, 10, [Should we cache bad destination addresses?]) ;;
3608
no) AC_DEFINE(ERRORCACHE, 0, [Should we cache bad destination addresses?]) ;;
3615
if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
3616
AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[ISC: struct sockaddr as sa_len?])
3619
AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [use IPv6?]))
3621
case "$enable_ipv6" in
3624
powerpc-ibm-aix4*) ;;
3626
AC_DEFINE(WANT_IPV6, ,[ISC: Want IPv6?])
3634
AC_MSG_CHECKING(for IPv6 structures)
3636
#include <sys/types.h>
3637
#include <sys/socket.h>
3638
#include <netinet/in.h>],
3639
[struct sockaddr_in6 sin6; return (0);],
3646
# See whether IPv6 support is provided via a Kame add-on.
3647
# This is done before other IPv6 linking tests so LIBS is properly set.
3649
AC_MSG_CHECKING(for Kame IPv6 support)
3651
[ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
3652
use_kame="$withval", use_kame="no")
3658
kame_path=/usr/local/v6
3661
kame_path="$use_kame"
3670
if test -f $kame_path/lib/libinet6.a; then
3671
AC_MSG_RESULT($kame_path/lib/libinet6.a)
3672
LIBS="-L$kame_path/lib -linet6 $LIBS"
3674
AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
3676
Please choose the proper path with the following command:
3678
configure --with-kame=PATH
3685
# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
3686
# Including it on Kame-using platforms is very bad, though, because
3687
# Kame uses #error against direct inclusion. So include it on only
3688
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
3689
# This is done before the in6_pktinfo check because that's what
3690
# netinet6/in6.h is needed for.
3694
ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
3695
LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
3696
isc_netinet6in6_hack="#include <netinet6/in6.h>"
3699
ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
3700
LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
3701
isc_netinet6in6_hack=""
3705
AC_MSG_CHECKING([for struct if_laddrconf])
3707
#include <sys/types.h>
3708
#include <net/if6.h>
3709
],[ struct if_laddrconf a; ],
3711
AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, ,
3712
[ISC: have struct if_laddrconf?])],
3713
[AC_MSG_RESULT(no)])
3715
AC_MSG_CHECKING([for struct if_laddrreq])
3717
#include <sys/types.h>
3718
#include <net/if6.h>
3719
],[ struct if_laddrreq a; ],
3721
AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, ,
3722
[ISC: have struct if_laddrreq?])],
3723
[AC_MSG_RESULT(no)])
3725
case "$found_ipv6" in
3727
AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[ISC: Have IPv6?])
3729
AC_MSG_CHECKING(for in6_pktinfo)
3731
#include <sys/types.h>
3732
#include <sys/socket.h>
3733
#include <netinet/in.h>
3734
$isc_netinetin6_hack
3735
$isc_netinet6in6_hack
3737
[struct in6_pktinfo xyzzy; return (0);],
3739
AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, ,
3740
[ISC: Have struct in6_pktinfo?])],
3741
[AC_MSG_RESULT(no -- disabling runtime ipv6 support)])
3743
AC_MSG_CHECKING(for in6addr_any)
3745
#include <sys/types.h>
3746
#include <sys/socket.h>
3747
#include <netinet/in.h>
3748
$isc_netinetin6_hack
3749
$isc_netinet6in6_hack
3752
[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
3753
[AC_MSG_RESULT(yes)],
3755
AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, ,
3756
[ISC: Need in6addr_any?])]
3762
# Look for a sysctl call to get the list of network interfaces.
3764
AC_MSG_CHECKING(for interface list sysctl)
3765
AC_EGREP_CPP(found_rt_iflist, [
3766
#include <sys/param.h>
3767
#include <sys/sysctl.h>
3768
#include <sys/socket.h>
3769
#ifdef NET_RT_IFLIST
3774
AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[ISC: Use iflist_sysctl?])],
3775
[AC_MSG_RESULT(no)])
3784
LDFLAGS="$LDFLAGS -r"
3790
AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
3793
if test -d $srcdir/arlib
3796
AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
3797
[ans=$withval], [ans=no])
3802
AC_CONFIG_SUBDIRS(arlib)
3807
AC_CONFIG_FILES(Makefile)
3808
AC_CONFIG_FILES(ElectricFence/Makefile)
3809
AC_CONFIG_FILES(adjtimed/Makefile)
3810
AC_CONFIG_FILES(clockstuff/Makefile)
3811
AC_CONFIG_FILES(include/Makefile)
3812
AC_CONFIG_FILES(include/isc/Makefile)
3813
AC_CONFIG_FILES(kernel/Makefile)
3814
AC_CONFIG_FILES(kernel/sys/Makefile)
3815
AC_CONFIG_FILES(libntp/Makefile)
3816
AC_CONFIG_FILES(libparse/Makefile)
3817
AC_CONFIG_FILES(ntpd/Makefile)
3818
AC_CONFIG_FILES(ntpdate/Makefile)
3819
AC_CONFIG_FILES(ntpdc/Makefile)
3820
AC_CONFIG_FILES(ntpdc/nl.pl, [chmod +x ntpdc/nl.pl])
3821
AC_CONFIG_FILES(ntpq/Makefile)
3822
AC_CONFIG_FILES(parseutil/Makefile)
3823
AC_CONFIG_FILES(scripts/Makefile)
3824
AC_CONFIG_FILES(scripts/calc_tickadj, [chmod +x scripts/calc_tickadj])
3825
AC_CONFIG_FILES(scripts/checktime, [chmod +x scripts/checktime])
3826
AC_CONFIG_FILES(scripts/freq_adj, [chmod +x scripts/freq_adj])
3827
AC_CONFIG_FILES(scripts/mkver, [chmod +x scripts/mkver])
3828
AC_CONFIG_FILES(scripts/ntp-wait, [chmod +x scripts/ntp-wait])
3829
AC_CONFIG_FILES(scripts/ntpsweep, [chmod +x scripts/ntpsweep])
3830
AC_CONFIG_FILES(scripts/ntptrace, [chmod +x scripts/ntptrace])
3831
AC_CONFIG_FILES(scripts/ntpver, [chmod +x scripts/ntpver])
3832
AC_CONFIG_FILES(scripts/plot_summary, [chmod +x scripts/plot_summary])
3833
AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary])
3834
AC_CONFIG_FILES(util/Makefile)
3836
case "$MAKE_SNTP" in
3839
AC_CONFIG_SUBDIRS(sntp)