1 dnl NTP top-level configure.ac -*- Autoconf -*-
3 m4_include([sntp/m4/version.m4])
8 [http://bugs.ntp.org./],
10 [http://www.ntp.org./]dnl
12 AC_CONFIG_MACRO_DIR([sntp/m4])
13 AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
16 AC_PRESERVE_HELP_ORDER
18 # Bump ntp_configure_cache_version for each change to configure.ac or
19 # .m4 files which invalidates cached values from previous configure
22 # If the change affects cache variables used only by the main NTP
23 # configure.ac, then only its version number should be bumped, while
24 # the subdir configure.ac version numbers should be unchanged. The
25 # same is true for a test/variable that is used only by one subdir
26 # being changed incompatibly; only that subdir's cache version needs
29 # If a change affects variables shared by all NTP configure scripts,
30 # please bump the version numbers of each. If you are not sure, the
31 # safe choice is to bump all on any cache-invalidating change.
33 # In order to avoid the risk of version stamp collision between -stable
34 # and -dev branches, do not simply increment the version, instead use
35 # the date YYYYMMDD optionally with -HHMM if there is more than one
38 ntp_configure_cache_version=20120806
40 # When the cache version of config.cache and configure do not
41 # match, NTP_CACHEVERSION will flush the cache.
43 NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
45 AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
47 dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
50 [AM_SILENT_RULES([yes])]
54 dnl the 'build' machine is where we run configure and compile
55 dnl the 'host' machine is where the resulting stuff runs.
56 AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
57 [canonical system (cpu-vendor-os) of where we should run])
58 AC_CONFIG_HEADERS([config.h])
61 ntp_atom_ok=${ntp_atom_ok=no}
62 ntp_oncore_ok=${ntp_oncore_ok=no}
63 ntp_parse_ok=${ntp_parse_ok=no}
64 ntp_ripe_ncc_ok=${ntp_parse_ok=no}
65 ntp_jupiter_ok=${ntp_jupiter_ok=no}
70 dnl # Do we need CXX for anything besides google test?
73 dnl AC_PROG_CC_C_O # called by NTP_COMPILER
78 NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
80 NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
82 dnl AM_PROG_AR req. automake 1.12
88 # So far, the only shared library we might use is libopts.
89 # It's a small library - we might as well use a static version of it.
92 AC_SUBST([LIBTOOL_DEPS])
94 # NTP has (so far) been relying on leading-edge autogen, which
95 # means we need the appropriate corresponding libopts as well.
96 # Therefore, by default:
97 # - use the version of libopts we ship with
99 # - build a static copy (AC_DISABLE_SHARED - done earlier)
100 case "${enable_local_libopts+set}" in
102 *) enable_local_libopts=yes ;;
104 case "${enable_libopts_install+set}" in
106 *) enable_libopts_install=no ;;
109 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
111 NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
115 AC_MSG_CHECKING([for deprecated --with-arlib])
117 AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
118 [ans=$withval], [ans=no])
119 AC_MSG_RESULT([$ans])
123 AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
127 dnl we need to check for cross compile tools for vxWorks here
129 AS_UNSET([ac_cv_prog_AWK])
130 AC_SUBST([AWK]) dnl scripts/ntpver.in
140 AC_PATH_PROG([PATH_PERL], [perl])
141 dnl Saving cached hardcoded paths rather than searching $PATH during a
142 dnl cached configure run is an optimization not worth the the cost of
143 dnl preventing newly-installed tools from being found. Short-circuit
144 dnl the caching after the tests so preset overrides still work.
145 AS_UNSET([ac_cv_path_PATH_PERL])
146 AC_PATH_PROG([PATH_TEST], [test])
147 AS_UNSET([ac_cv_path_PATH_TEST])
148 test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
149 AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
154 [--with-net-snmp-config],
169 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
174 PROG_NET_SNMP_CONFIG=$ans
175 case "$PROG_NET_SNMP_CONFIG" in
178 PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
181 AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
182 AS_UNSET([ac_cv_path_PATH_NET_SNMP_CONFIG])
185 AC_MSG_CHECKING([for net-snmp-config path])
186 AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
188 case "$PATH_NET_SNMP_CONFIG" in
190 [for net-snmp version],
191 [ntp_cv_net_snmp_version],
192 [ntp_cv_net_snmp_version=`$PATH_NET_SNMP_CONFIG --version`]
199 ac_link="$ac_link $VX_KERNEL"
203 # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
204 AC_SEARCH_LIBS([openlog], [gen syslog])
205 # XXX library list will be in ac_cv_search_openlog
207 # LIBSECCOMP is off by default -- needs testing with all the features
208 # Please send bug reports to loganaden@gmail.com
209 AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
213 [--enable-libseccomp],
214 [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
219 AC_MSG_RESULT([$ntp_ok])
225 [AC_DEFINE([LIBSECCOMP], [1],
226 [Define to any value to include libseccomp sandboxing.])]
232 #include <sys/prctl.h>
233 #include <linux/seccomp.h>
238 ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
250 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
264 , AC_DEFINE([KERN_SECCOMP], 1,
265 [Define to use libseccomp system call filtering.])
273 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
274 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
275 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
276 dnl does Strange Things with extra processes using the Posix-compatibility
277 dnl real-time library, so we don't want to use it.
279 dnl 081118 Harlan got tired of looking for a way to get the sched*()
280 dnl functions to link OK with either cc or gcc.
287 # HMS: Make sure we check for -lrt for clock_* before this...
288 case "$ac_cv_search_clock_gettime" in
289 '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
291 AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
295 AC_CHECK_HEADERS([bstring.h])
299 [DNSServiceRegister],
301 [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
302 [Use Rendezvous/DNS-SD registration])]
305 AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
307 AC_CHECK_HEADERS([memory.h netdb.h poll.h])
308 AC_CHECK_HEADERS([sgtty.h stdatomic.h])
310 AC_CHECK_HEADERS([stdlib.h string.h termio.h])
311 AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
315 AC_CHECK_HEADERS([utmpx.h])
316 case "$ac_cv_header_utmpx_h" in
320 AC_CHECK_HEADERS([utmp.h])
325 AC_CHECK_HEADERS([utmp.h utmpx.h])
330 # On Suns only (so far) getpass() truncates the typed password to 8
331 # characters, but getpassphrase() allows up to 257. Most systems'
332 # getpass() does not truncate, at least not so as to affect ntpq and
333 # ntpdc password prompts.
335 # So check for getpassphrase(), but only on Sun operating systems.
338 *-*-sunos*|*-*-solaris*)
339 AC_CHECK_FUNCS([getpassphrase])
343 AC_CHECK_HEADERS([net/if6.h])
344 AC_CHECK_HEADERS([net/route.h], [], [], [
345 #include <sys/types.h>
346 #include <sys/socket.h>
350 AC_CHECK_HEADERS([netinfo/ni.h])
351 case "$ac_cv_header_netinfo_ni_h" in
353 AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
355 AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
360 AC_CHECK_HEADERS([sys/ioctl.h])
363 AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
364 # HMS: Check sys/proc.h and sys/resource.h after some others
365 AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
366 case "$ac_cv_header_sched_h" in
370 AC_CHECK_HEADERS([sys/sched.h])
373 # HMS: Check sys/shm.h after some others
374 AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
375 # HMS: Checked sys/socket.h earlier
380 AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
383 AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
384 AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
387 AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
390 AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
394 case "$ac_cv_header_stdatomic_h" in
396 AC_CHECK_FUNCS([atomic_thread_fence])
398 [for atomic_thread_fence()],
399 [ntp_cv_func_atomic_thread_fence],
403 #include <stdatomic.h>
406 atomic_thread_fence(memory_order_seq_cst);
409 [ntp_cv_func_atomic_thread_fence=yes],
410 [ntp_cv_func_atomic_thread_fence=no]
421 AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
427 case "$ac_cv_func_ntp_gettime" in
431 AC_CHECK_FUNCS([__ntp_gettime])
432 case "$ac_cv_func___ntp_gettime" in
434 AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
435 AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
439 AC_CHECK_FUNCS([adjtimex])
440 case "$ac_cv_func_adjtimex" in
442 AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
443 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
447 AC_CHECK_FUNCS([__adjtimex])
448 case "$ac_cv_func___adjtimex" in
450 AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
451 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
452 AC_DEFINE([adjtimex], [__adjtimex], [deviant])
453 AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
459 case "$have_adjtimex" in
461 # nlist stuff is only needed for tickadj.
464 AC_SEARCH_LIBS([nlist], [elf ld mld])
465 # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
466 AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
467 # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
468 AC_CHECK_HEADERS([nlist.h sys/var.h])
469 case "$ac_cv_header_nlist_h" in
471 AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
473 [for n_un in struct nlist],
474 [ntp_cv_struct_nlist_n_un],
485 [ntp_cv_struct_nlist_n_un=yes],
486 [ntp_cv_struct_nlist_n_un=no]
489 case "$ntp_cv_struct_nlist_n_un" in
491 AC_DEFINE([NLIST_NAME_UNION], [1],
492 [does struct nlist use a name union?])
495 AC_SUBST([LDADD_NLIST])
498 AS_UNSET([saved_LIBS])
501 AC_CHECK_HEADERS([sys/proc.h], [], [], [
502 #ifdef HAVE_SYS_TYPES_H
503 # include <sys/types.h>
505 #ifdef HAVE_SYS_TIME_H
506 # include <sys/time.h>
510 AC_CHECK_HEADERS([sys/resource.h], [], [], [
511 #ifdef HAVE_SYS_TIME_H
512 # include <sys/time.h>
516 AC_CHECK_HEADERS([sys/shm.h], [], [], [
517 #ifdef HAVE_SYS_TYPES_H
518 # include <sys/types.h>
520 #ifdef HAVE_SYS_IPC_H
521 # include <sys/ipc.h>
525 AC_CHECK_HEADERS([sys/timex.h], [], [], [
526 #ifdef HAVE_SYS_TIME_H
527 # include <sys/time.h>
535 AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c
538 [for a fallback value for HZ],
541 ntp_cv_default_hz=100
543 alpha*-dec-osf4*|alpha*-dec-osf5*)
544 ntp_cv_default_hz=1024
547 ntp_cv_default_hz=256
552 AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
553 [What is the fallback value for HZ?])
556 [if we need to override the system's value for HZ],
557 [ntp_cv_override_hz],
559 ntp_cv_override_hz=no
561 alpha*-dec-osf4*|alpha*-dec-osf5*)
562 ntp_cv_override_hz=yes
565 ntp_cv_override_hz=yes
568 ntp_cv_override_hz=yes
571 ntp_cv_override_hz=yes
574 ntp_cv_override_hz=yes
579 case "$ntp_cv_override_hz" in
581 AC_DEFINE([OVERRIDE_HZ], [1],
582 [Do we need to override the system's idea of HZ?])
585 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
586 dnl [AC_TRY_LINK([#include <sys/types.h>
587 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
588 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
589 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
590 dnl AC_DEFINE(HAVE_UT_HOST)
593 dnl AC_MSG_CHECKING(if we can get the system boot time)
594 dnl AC_CACHE_VAL(su_cv_have_boot_time,
595 dnl [AC_EGREP_CPP(yes,
596 dnl [#ifdef HAVE_UTMPX_H
597 dnl #include <utmpx.h>
599 dnl #include <utmp.h>
604 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
605 dnl AC_MSG_RESULT($su_cv_have_boot_time)
608 [for struct rt_msghdr],
609 [ntp_cv_struct_rt_msghdr],
613 #include <sys/types.h>
614 #include <sys/socket.h>
616 #include <net/route.h>
622 [ntp_cv_struct_rt_msghdr=yes],
623 [ntp_cv_struct_rt_msghdr=no]
634 #include <sys/socket.h>
635 #include <linux/rtnetlink.h>
646 case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
648 AC_DEFINE([HAS_ROUTING_SOCKET], [1],
649 [Do we have a routing socket (rt_msghdr or rtattr)?])
650 case "$ntp_cv_rtattr" in
652 AC_DEFINE([HAVE_RTNETLINK], [1],
653 [Do we have Linux routing socket?])
658 [struct sigaction for sa_sigaction],
659 [ntp_cv_struct_sigaction_has_sa_sigaction],
666 struct sigaction act;
667 act.sa_sigaction = 0;
670 [ntp_cv_struct_sigaction_has_sa_sigaction=yes],
671 [ntp_cv_struct_sigaction_has_sa_sigaction=no]
674 case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
676 AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
680 [for struct ppsclockev],
681 [ntp_cv_struct_ppsclockev],
685 #ifdef HAVE_SYS_TYPES_H
686 # include <sys/types.h>
688 #ifdef HAVE_SYS_TERMIOS_H
689 # include <sys/termios.h>
691 #ifdef HAVE_SYS_TIME_H
692 # include <sys/time.h>
694 #ifdef HAVE_SYS_PPSCLOCK_H
695 # include <sys/ppsclock.h>
699 extern struct ppsclockev *pce;
703 [ntp_cv_struct_ppsclockev=yes],
704 [ntp_cv_struct_ppsclockev=no]
707 case "$ntp_cv_struct_ppsclockev" in
709 AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
710 [Does a system header define struct ppsclockev?])
713 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
716 [for struct snd_size],
717 [ntp_cv_struct_snd_size],
721 #ifdef HAVE_MACHINE_SOUNDCARD_H
722 # include <machine/soundcard.h>
724 #ifdef HAVE_SYS_SOUNDCARD_H
725 # include <sys/soundcard.h>
729 extern struct snd_size *ss;
733 [ntp_cv_struct_snd_size=yes],
734 [ntp_cv_struct_snd_size=no]
737 case "$ntp_cv_struct_snd_size" in
739 AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
740 [Do we have struct snd_size?])
745 [struct clockinfo for hz],
746 [ntp_cv_struct_clockinfo_has_hz],
750 #include <sys/time.h>
753 extern struct clockinfo *pc;
757 [ntp_cv_struct_clockinfo_has_hz=yes],
758 [ntp_cv_struct_clockinfo_has_hz=no]
761 case "$ntp_cv_struct_clockinfo_has_hz" in
763 AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
767 [struct clockinfo for tickadj],
768 [ntp_cv_struct_clockinfo_has_hz],
772 #include <sys/time.h>
775 extern struct clockinfo *pc;
779 [ntp_cv_struct_clockinfo_has_hz=yes],
780 [ntp_cv_struct_clockinfo_has_hz=no]
783 case "$ntp_cv_struct_clockinfo_has_hz" in
785 AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
788 case "$ntp_cv_struct_ntptimeval" in
791 [struct ntptimeval.time.tv_nsec],
795 #ifdef HAVE_SYS_TIME_H
796 # include <sys/time.h>
802 #ifdef HAVE_SYS_TIMEX_H
803 # include <sys/timex.h>
815 AC_CHECK_FUNCS([arc4random_buf])
820 LIBS="$LIBS $LDADD_LIBNTP"
821 AC_CHECK_FUNCS([daemon])
822 # XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
824 AS_UNSET([saved_LIBS])
833 AC_MSG_CHECKING([for isfinite with <math.h>])
851 AC_MSG_RESULT([$ans])
854 AC_DEFINE([HAVE_ISFINITE], [1])
860 AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
862 # kvm_open() is only used by tickadj. Also see above.
863 case "$ac_cv_header_kvm_h" in
865 AC_CHECK_FUNCS([kvm_open])
873 *) AC_CHECK_FUNCS([mkstemp])
876 AC_CHECK_FUNCS([mktime])
879 # XXX only verified thru AIX6.
883 # Just a stub in "old" Irix. Sigh.
885 # In the belief that the fix for bug 1223 fixes mlockall() under linux...
887 # # there, but more trouble than it is worth for now (resolver problems)
890 # Apparently there but not working in QNX. Sigh?
895 alpha*-dec-osf4*|alpha*-dec-osf5*)
896 # mlockall is there, as a #define calling memlk via <sys/mman.h>
897 # Not easy to test for - cheat.
898 AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
899 AC_CHECK_FUNCS([mlockall])
901 *) AC_CHECK_FUNCS([mlockall])
904 AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
907 # XXX only verified thru AIX6.
908 # Just a stub in AIX 4. Sigh.
911 # Just stubs in solaris2.5. Sigh.
913 *) AC_CHECK_FUNCS([sched_setscheduler])
916 AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
917 AC_CHECK_FUNCS([strdup strerror setrlimit strchr])
920 # XXX only verified thru AIX6.
933 AC_CHECK_FUNCS([timer_create])
939 # some OSes prefer _exit() in forked children to exit()
940 AC_CHECK_FUNCS([_exit])
941 ntp_worker_child_exit=exit
942 case "$ac_cv_func__exit::$host_os" in
944 ntp_worker_child_exit=_exit
947 ntp_worker_child_exit=_exit
950 AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
951 [routine worker child proc uses to exit.])
953 AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
957 # http://bugs.ntp.org/737
958 case "$ac_cv_func_recvmsg" in
961 [if we need extra help to define struct iovec],
962 [ntp_cv_struct_iovec_help],
965 for ntp_cv_struct_iovec_help in '0' '1'; do
969 #ifdef HAVE_SYS_TYPES_H
970 # include <sys/types.h>
972 #ifdef HAVE_SYS_SOCKET_H
973 # include <sys/socket.h>
975 #if $ntp_cv_struct_iovec_help
976 # include <sys/uio.h>
988 x = recvmsg(s, &mh, flags);
992 [compiled=yes ; break 1],
998 ntp_cv_struct_iovec_help=0
1000 AS_UNSET([compiled])
1003 case "$ntp_cv_struct_iovec_help" in
1005 AC_DEFINE([HAVE_SYS_UIO_H], [1],
1006 [Use sys/uio.h for struct iovec help])
1011 [number of arguments taken by setpgrp()],
1012 [ntp_cv_func_setpgrp_nargs],
1016 #ifdef HAVE_SYS_TYPES_H
1017 # include <sys/types.h>
1019 #ifdef HAVE_UNISTD_H
1020 # include <unistd.h>
1027 [ntp_cv_func_setpgrp_nargs=2],
1028 [ntp_cv_func_setpgrp_nargs=0]
1031 case "$ntp_cv_func_setpgrp_nargs" in
1033 AC_DEFINE([HAVE_SETPGRP_0], [1],
1034 [define if setpgrp takes 0 arguments])
1038 [if we need to declare 'errno'],
1039 [ntp_cv_decl_errno],
1051 [ntp_cv_decl_errno=no],
1052 [ntp_cv_decl_errno=yes]
1055 case "$ntp_cv_decl_errno" in
1057 AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
1060 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1061 dnl MT purposes. This makes the line "extern int h_errno" choke
1062 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1063 dnl without breaking any other platforms.
1066 [if we may declare 'h_errno'],
1067 [ntp_cv_decl_h_errno],
1071 #include <sys/types.h>
1072 #ifdef HAVE_NETINET_IN_H
1073 # include <netinet/in.h>
1075 #ifdef HAVE_ARPA_NAMESER_H
1076 # include <arpa/nameser.h>
1081 #ifdef HAVE_RESOLV_H
1082 # include <resolv.h>
1089 [ntp_cv_decl_h_errno=yes],
1090 [ntp_cv_decl_h_errno=no]
1093 case "$ntp_cv_decl_h_errno" in
1095 AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
1099 [if declaring 'syscall()' is ok],
1100 [ntp_cv_decl_syscall],
1104 #ifdef HAVE_SYS_TYPES_H
1105 # include <sys/types.h>
1107 #ifdef HAVE_UNISTD_H
1108 # include <unistd.h>
1112 extern int syscall (int, ...);
1115 [ntp_cv_decl_syscall=yes],
1116 [ntp_cv_decl_syscall=no]
1119 case "$ntp_cv_decl_syscall" in
1121 AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
1126 AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
1129 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1130 AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
1131 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1132 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1133 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1134 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1135 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1138 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1139 AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
1142 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1145 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1146 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1147 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1148 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1149 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1150 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1151 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1152 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1153 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1154 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1155 AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1156 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1157 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1158 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1159 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1160 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1163 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1164 AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
1167 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1172 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1173 AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
1174 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1175 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1176 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1177 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1178 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1179 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1180 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1181 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1182 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1183 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1184 AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
1185 case "`basename $ac_cv_prog_CC`" in
1187 *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1190 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1191 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1192 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1193 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1194 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1195 AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
1196 AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
1199 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1200 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1201 AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
1202 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1203 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1204 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1205 AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
1206 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1207 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1208 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1209 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1210 AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
1211 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1212 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1218 AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
1219 [Do we need to #define _SVID3 when we #include <termios.h>?])
1225 AC_DEFINE([NEED_RCVBUF_SLOP], [1],
1226 [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
1229 dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
1231 [if we will open the broadcast socket],
1232 [ntp_cv_var_open_bcast_socket],
1239 ntp_cv_var_open_bcast_socket=$ans
1242 case "$ntp_cv_var_open_bcast_socket" in
1244 AC_DEFINE([OPEN_BCAST_SOCKET], [1],
1245 [Should we open the broadcast socket?])
1250 AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
1251 [Do we want the HPUX FindConfig()?])
1254 dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
1256 [if process groups are set with -pid],
1257 [ntp_cv_arg_setpgrp_negpid],
1279 ntp_cv_arg_setpgrp_negpid=$ans
1282 case "$ntp_cv_arg_setpgrp_negpid" in
1284 AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
1285 [Do we set process groups with -pid?])
1289 [if we need a ctty for F_SETOWN],
1290 [ntp_cv_func_ctty_for_f_setown],
1299 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1300 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1301 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1302 # in $host may be followed by "aout", "ecoff", or "elf".
1303 *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
1306 *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
1322 ntp_cv_func_ctty_for_f_setown=$ans
1325 case "$ntp_cv_func_ctty_for_f_setown" in
1327 AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
1331 [if the OS clears cached routes when more specifics become available],
1332 [ntp_cv_os_routeupdates],
1342 ntp_cv_os_routeupdates=$ans
1345 case "$ntp_cv_os_routeupdates" in
1347 AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
1348 [need to recreate sockets on changed routing?])
1352 [if the wildcard socket needs REUSEADDR to bind other addresses],
1353 [ntp_cv_os_wildcardreuse],
1362 ntp_cv_os_wildcardreuse=$ans
1365 case "$ntp_cv_os_wildcardreuse" in
1367 AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
1368 [wildcard socket needs REUSEADDR to bind interface addresses])
1373 AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
1374 [Might nlist() values require an extra level of indirection (AIX)?])
1378 [for a minimum recommended value of tickadj],
1379 [ntp_cv_var_min_rec_tickadj],
1387 ntp_cv_var_min_rec_tickadj=$ans
1390 case "$ntp_cv_var_min_rec_tickadj" in
1394 AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
1395 [Should we recommend a minimum value for tickadj?])
1399 [if the TTY code permits PARENB and IGNPAR],
1400 [ntp_cv_no_parenb_ignpar],
1410 i?86-*-freebsd[[123]].*)
1419 ntp_cv_no_parenb_ignpar=$ans
1422 case "$ntp_cv_no_parenb_ignpar" in
1424 AC_DEFINE([NO_PARENB_IGNPAR], [1],
1425 [Is there a problem using PARENB and IGNPAR?])
1428 AC_MSG_CHECKING([if we're including processing time debugging code])
1432 [--enable-debug-timing],
1433 [- include processing time debugging code (costs performance)]
1435 [ntp_ok=$enableval],
1440 AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
1442 AC_MSG_RESULT([$ntp_ok])
1444 AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
1448 [--enable-dst-minutes],
1449 [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
1454 AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
1455 [The number of minutes in a DST adjustment])
1456 AC_MSG_RESULT([$ans])
1458 AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
1460 [ignore-dns-errors],
1462 [--enable-ignore-dns-errors],
1463 [- retry DNS queries on any error]
1470 AC_DEFINE([IGNORE_DNS_ERRORS], [1],
1471 [Retry queries on _any_ DNS error?])
1473 AC_MSG_RESULT([$ans])
1476 [availability of ntp_{adj,get}time()],
1477 [ntp_cv_var_ntp_syscalls],
1479 ntp_cv_var_ntp_syscalls=no
1480 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1482 ntp_cv_var_ntp_syscalls=libc
1485 ntp_cv_var_ntp_syscalls=inline
1491 #include <sys/syscall.h>
1492 #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
1496 [ntp_cv_var_ntp_syscalls=kernel]
1502 case "$ntp_cv_var_ntp_syscalls" in
1504 AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
1505 [Do we have ntp_{adj,get}time in libc?])
1508 AC_DEFINE([NTP_SYSCALLS_STD], [1],
1509 [Do we have ntp_{adj,get}time in the kernel?])
1514 [if sys/timex.h has STA_FLL],
1515 [ntp_cv_var_sta_fll],
1519 #include <sys/timex.h>
1524 [ntp_cv_var_sta_fll=yes],
1525 [ntp_cv_var_sta_fll=no]
1530 [if we have kernel PLL support],
1531 [ntp_cv_var_kernel_pll],
1532 [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
1533 case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
1535 ntp_cv_var_kernel_pll=no
1537 *) ntp_cv_var_kernel_pll=yes
1542 case "$ntp_cv_var_kernel_pll" in
1544 AC_DEFINE([KERNEL_PLL], [1],
1545 [Does the kernel support precision time discipline?])
1549 [if SIOCGIFCONF returns buffer size in the buffer],
1550 [ntp_cv_size_returned_in_buffer],
1564 ntp_cv_size_returned_in_buffer=$ans
1567 case "$ntp_cv_size_returned_in_buffer" in
1569 AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
1570 [Does SIOCGIFCONF return size in the buffer?])
1573 # Check for ioctls TIOCGPPSEV
1574 AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
1575 case "$ac_cv_header_termios_h" in
1579 #include <termios.h>
1594 AC_DEFINE([HAVE_TIOCGPPSEV], [1],
1595 [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1597 AC_MSG_RESULT([$ntp_ok])
1599 # Check for ioctls TIOCSPPS
1600 AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
1601 case "$ac_cv_header_termios_h" in
1605 #include <termios.h>
1620 AC_DEFINE([HAVE_TIOCSPPS], [1],
1621 [Do we have the TIOCSPPS ioctl (Solaris)?])
1623 AC_MSG_RESULT([$ntp_ok])
1625 # Check for ioctls CIOGETEV
1626 AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
1627 case "$ac_cv_header_sys_ppsclock_h" in
1631 #include <sys/ppsclock.h>
1646 AC_DEFINE([HAVE_CIOGETEV], [1],
1647 [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1649 AC_MSG_RESULT([$ntp_ok])
1651 # ATOM/PPSAPI stuff.
1655 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1657 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1658 # The PPSAPI needs struct timespec.
1659 # The PPSAPI also needs a timepps header.
1661 case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
1663 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
1664 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
1665 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1675 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1676 AC_CHECK_HEADER([linux/serial.h])
1677 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1679 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
1682 #include <sys/time.h>
1684 #include <sys/ppsclock.h>
1685 #include <linux/serial.h>
1693 #ifndef ASYNC_PPS_CD_POS
1696 #ifndef ASYNC_PPS_CD_NEG
1706 AC_MSG_RESULT([$ntp_ok])
1714 AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
1715 [Do we have the TIO serial stuff?])
1718 # Check for SHMEM_STATUS support
1719 AC_MSG_CHECKING([SHMEM_STATUS support])
1720 case "$ac_cv_header_sys_mman_h" in
1730 AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
1731 [Do we have support for SHMEM_STATUS?])
1733 AC_MSG_RESULT([$ntp_ok])
1737 # HPUX only, and by explicit request
1738 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
1743 [- Datum/Bancomm bc635/VME interface]
1745 [ntp_ok=$enableval],
1751 AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
1754 AC_MSG_RESULT([$ntp_ok])
1755 case "$ntp_ok$host" in
1757 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1760 #HPUX only, and only by explicit request
1761 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
1766 [- TrueTime GPS receiver/VME interface]
1768 [ntp_ok=$enableval],
1774 AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/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 AC_MSG_CHECKING([for PCL720 clock support])
1784 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1786 AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
1793 AC_MSG_RESULT([$ans])
1795 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
1799 [--enable-all-clocks],
1800 [+ include all suitable non-PARSE clocks:]
1802 [ntp_eac=$enableval],
1805 AC_MSG_RESULT([$ntp_eac])
1807 # HMS: Should we also require ntp_parse_ok?
1808 AC_MSG_CHECKING([if we have support for PARSE clocks])
1809 case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1816 AC_MSG_RESULT([$ntp_canparse])
1818 AC_MSG_CHECKING([if we have support for audio clocks])
1819 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
1822 AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
1824 *) ntp_canaudio=no ;;
1826 AC_MSG_RESULT([$ntp_canaudio])
1828 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1829 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1835 AC_MSG_RESULT([$ntp_canshm])
1837 # Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
1839 [for termios modem control],
1840 [ntp_cv_modem_control],
1844 #ifdef HAVE_UNISTD_H
1845 # include <unistd.h>
1847 #ifdef HAVE_TERMIOS_H
1848 # include <termios.h>
1850 #ifdef HAVE_SYS_IOCTL_H
1851 # include <sys/ioctl.h>
1855 int dtr = TIOCM_DTR;
1857 ioctl(1, TIOCMBIS, (char *)&dtr);
1860 [ntp_cv_modem_control=yes],
1861 [ntp_cv_modem_control=no]
1864 case "$ntp_eac::$ntp_cv_modem_control" in
1866 ntp_enable_all_modem_control_clocks=yes
1869 ntp_enable_all_modem_control_clocks=no
1873 # Requires modem control
1874 AC_MSG_CHECKING([ACTS modem service])
1879 [s ACTS modem service]
1881 [ntp_ok=$enableval],
1882 [ntp_ok=$ntp_enable_all_modem_control_clocks]
1887 AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
1890 AC_MSG_RESULT([$ntp_ok])
1892 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
1897 [+ Arbiter 1088A/B GPS receiver]
1899 [ntp_ok=$enableval],
1905 AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
1908 AC_MSG_RESULT([$ntp_ok])
1910 AC_MSG_CHECKING([Arcron MSF receiver])
1914 [--enable-ARCRON-MSF],
1915 [+ Arcron MSF receiver]
1917 [ntp_ok=$enableval],
1923 AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
1926 AC_MSG_RESULT([$ntp_ok])
1928 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
1933 [+ Austron 2200A/2201A GPS receiver]
1935 [ntp_ok=$enableval],
1941 AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
1944 AC_MSG_RESULT([$ntp_ok])
1946 AC_MSG_CHECKING([ATOM PPS interface])
1951 [s ATOM PPS interface]
1953 [ntp_ok=$enableval],
1956 case "$ntp_atom_ok" in
1962 AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
1965 AC_MSG_RESULT([$ntp_ok])
1967 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
1971 [--enable-CHRONOLOG],
1972 [+ Chrono-log K-series WWVB receiver]
1974 [ntp_ok=$enableval],
1980 AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
1983 AC_MSG_RESULT([$ntp_ok])
1985 AC_MSG_CHECKING([CHU modem/decoder])
1990 [+ CHU modem/decoder]
1992 [ntp_ok=$enableval],
1998 AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
2001 AC_MSG_RESULT([$ntp_ok])
2002 ntp_refclock_chu=$ntp_ok
2004 AC_MSG_CHECKING([CHU audio/decoder])
2008 [--enable-AUDIO-CHU],
2009 [s CHU audio/decoder]
2011 [ntp_ok=$enableval],
2013 case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
2019 AC_MSG_RESULT([$ntp_ok])
2020 # We used to check for sunos/solaris target...
2021 case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
2022 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
2026 AC_MSG_CHECKING([Datum Programmable Time System])
2031 [s Datum Programmable Time System]
2033 [ntp_ok=$enableval],
2035 case "$ac_cv_header_termios_h" in
2047 AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
2050 AC_MSG_RESULT([$ntp_ok])
2052 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2056 [--enable-DUMBCLOCK],
2057 [+ Dumb generic hh:mm:ss local clock]
2059 [ntp_ok=$enableval],
2065 AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
2068 AC_MSG_RESULT([$ntp_ok])
2070 AC_MSG_CHECKING([Forum Graphic GPS])
2075 [+ Forum Graphic GPS]
2077 [ntp_ok=$enableval],
2083 AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
2086 AC_MSG_RESULT([$ntp_ok])
2088 # Requires modem control
2089 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2094 [s Heath GC-1000 WWV/WWVH receiver]
2096 [ntp_ok=$enableval],
2097 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2102 AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
2105 AC_MSG_RESULT([$ntp_ok])
2107 AC_MSG_CHECKING([for hopf serial clock device])
2111 [--enable-HOPFSERIAL],
2112 [+ hopf serial clock device]
2114 [ntp_ok=$enableval],
2120 AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
2123 AC_MSG_RESULT([$ntp_ok])
2125 AC_MSG_CHECKING([for hopf PCI clock 6039])
2130 [+ hopf 6039 PCI board]
2132 [ntp_ok=$enableval],
2138 AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
2141 AC_MSG_RESULT([$ntp_ok])
2143 AC_MSG_CHECKING([HP 58503A GPS receiver])
2148 [+ HP 58503A GPS receiver]
2150 [ntp_ok=$enableval],
2156 AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
2159 AC_MSG_RESULT([$ntp_ok])
2161 AC_MSG_CHECKING([IRIG audio decoder])
2166 [s IRIG audio decoder]
2168 [ntp_ok=$enableval],
2170 case "$ntp_eac$ntp_canaudio" in
2179 AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
2182 AC_MSG_RESULT([$ntp_ok])
2183 case "$ntp_ok$ntp_canaudio" in
2184 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2187 AC_MSG_CHECKING([for JJY receiver])
2194 [ntp_ok=$enableval],
2200 AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
2203 AC_MSG_RESULT([$ntp_ok])
2205 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2210 [s Rockwell Jupiter GPS receiver]
2212 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2213 case "$ntp_jupiter_ok" in
2219 AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
2222 AC_MSG_RESULT([$ntp_ok])
2224 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2229 [+ Leitch CSD 5300 Master Clock System Driver]
2231 [ntp_ok=$enableval],
2237 AC_DEFINE([CLOCK_LEITCH], [1],
2238 [Leitch CSD 5300 Master Clock System Driver?])
2241 AC_MSG_RESULT([$ntp_ok])
2243 AC_MSG_CHECKING([local clock reference])
2247 [--enable-LOCAL-CLOCK],
2248 [+ local clock reference]
2250 [ntp_ok=$enableval],
2256 AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
2259 AC_MSG_RESULT([$ntp_ok])
2261 dnl Bug 340: longstanding unfixed bugs
2262 dnl AC_MSG_CHECKING([EES M201 MSF receiver])
2263 dnl AC_ARG_ENABLE([MSFEES],
2264 dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
2265 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2266 dnl if test "$ntp_ok" = "yes"; then
2267 dnl ntp_refclock=yes
2268 dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
2270 dnl AC_MSG_RESULT([$ntp_ok])
2273 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2278 [s Magnavox MX4200 GPS receiver]
2280 [ntp_ok=$enableval],
2282 case "$ac_cv_var_ppsclock" in
2295 AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
2298 AC_MSG_RESULT([$ntp_ok])
2299 case "$ntp_ok$host" in
2300 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
2303 AC_MSG_CHECKING([for NeoClock4X receiver])
2307 [--enable-NEOCLOCK4X],
2308 [+ NeoClock4X DCF77 / TDF receiver]
2310 [ntp_ok=$enableval],
2316 AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
2319 AC_MSG_RESULT([$ntp_ok])
2321 AC_MSG_CHECKING([NMEA GPS receiver])
2326 [+ NMEA GPS receiver]
2328 [ntp_ok=$enableval],
2334 AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
2337 AC_MSG_RESULT([$ntp_ok])
2339 AC_CHECK_FUNCS([strtoll])
2340 AC_MSG_CHECKING([for GPSD JSON receiver])
2345 [+ GPSD JSON receiver]
2347 [ntp_ok=$enableval],
2348 [case "$ac_cv_func_strtoll" in
2349 yes) ntp_ok=$ntp_eac ;;
2356 AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
2359 AC_MSG_RESULT([$ntp_ok])
2361 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2366 [s Motorola VP/UT Oncore GPS receiver]
2368 [ntp_ok=$enableval],
2371 case "$ntp_oncore_ok" in
2377 AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
2380 AC_MSG_RESULT([$ntp_ok])
2382 # Requires modem control
2383 AC_MSG_CHECKING([for Palisade clock])
2387 [--enable-PALISADE],
2390 [ntp_ok=$enableval],
2391 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2396 AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
2399 AC_MSG_RESULT([$ntp_ok])
2401 AC_MSG_CHECKING([Conrad parallel port radio clock])
2406 [+ Conrad parallel port radio clock]
2408 [ntp_ok=$enableval],
2414 AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
2417 AC_MSG_RESULT([$ntp_ok])
2419 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2424 [+ PST/Traconex 1020 WWV/WWVH receiver]
2426 [ntp_ok=$enableval],
2432 AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
2435 AC_MSG_RESULT([$ntp_ok])
2437 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2442 [- RIPENCC specific Trimble driver]
2444 [ntp_ok=$enableval],
2447 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2448 case "$ntp_ripe_ncc_ok" in
2454 AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
2457 AC_MSG_RESULT([$ntp_ok])
2459 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2460 # For *IX, we need sys/ipc.h and sys/shm.h.
2461 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2466 [s SHM clock attached thru shared memory]
2468 [ntp_ok=$enableval],
2470 case "$ntp_eac$ntp_canshm" in
2479 AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
2482 AC_MSG_RESULT([$ntp_ok])
2484 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2488 [--enable-SPECTRACOM],
2489 [+ Spectracom 8170/Netclock/2 WWVB receiver]
2491 [ntp_ok=$enableval],
2497 AC_DEFINE([CLOCK_SPECTRACOM], [1],
2498 [Spectracom 8170/Netclock/2 WWVB receiver])
2501 AC_MSG_RESULT([$ntp_ok])
2503 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2508 [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
2510 [ntp_ok=$enableval],
2512 case "$ac_cv_header_sys_tpro_h" in
2525 AC_DEFINE([CLOCK_TPRO], [1],
2526 [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2529 AC_MSG_RESULT([$ntp_ok])
2530 case "$ntp_ok$ac_cv_header_sys_tpro" in
2531 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2534 # Not on a vax-dec-bsd
2535 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2539 [--enable-TRUETIME],
2540 [s Kinemetrics/TrueTime receivers]
2542 [ntp_ok=$enableval],
2557 AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
2560 AC_MSG_RESULT([$ntp_ok])
2561 case "$ntp_ok$host" in
2562 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
2565 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2570 [- TrueTime 560 IRIG-B decoder]
2572 [ntp_ok=$enableval],
2578 AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
2581 AC_MSG_RESULT([$ntp_ok])
2583 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2588 [+ Ultralink WWVB receiver]
2590 [ntp_ok=$enableval],
2596 AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
2599 AC_MSG_RESULT([$ntp_ok])
2601 AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
2605 [--enable-TSYNCPCI],
2606 [s Spectracom TSYNC timing board]
2608 [ntp_ok=$enableval],
2622 AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
2625 AC_MSG_RESULT([$ntp_ok])
2627 AC_MSG_CHECKING([WWV receiver])
2632 [s WWV Audio receiver]
2634 [ntp_ok=$enableval],
2636 case "$ntp_eac$ntp_canaudio" in
2645 AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
2648 AC_MSG_RESULT([$ntp_ok])
2649 case "$ntp_ok$ntp_canaudio" in
2650 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2653 AC_MSG_CHECKING([for Zyfer receiver])
2658 [+ Zyfer GPStarplus receiver]
2660 [ntp_ok=$enableval],
2666 AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
2669 AC_MSG_RESULT([$ntp_ok])
2671 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2675 [--enable-parse-clocks],
2676 [- include all suitable PARSE clocks:]
2678 [ntp_eapc=$enableval],
2681 yes) ntp_eapc=$ntp_canparse ;;
2684 # Delete the next line one of these days
2688 AC_MSG_RESULT($ntp_eapc)
2690 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2692 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2695 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2703 AC_MSG_CHECKING([Diem Computime Radio Clock])
2707 [--enable-COMPUTIME],
2708 [s Diem Computime Radio Clock]
2710 [ntp_ok=$enableval],
2717 AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
2720 AC_MSG_RESULT([$ntp_ok])
2721 case "$ntp_ok$ntp_canparse" in
2723 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2726 AC_MSG_CHECKING([ELV/DCF7000 clock])
2731 [s ELV/DCF7000 clock]
2733 [ntp_ok=$enableval],
2740 AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
2743 AC_MSG_RESULT([$ntp_ok])
2744 case "$ntp_ok$ntp_canparse" in
2746 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2749 AC_MSG_CHECKING([HOPF 6021 clock])
2753 [--enable-HOPF6021],
2756 [ntp_ok=$enableval],
2763 AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
2766 AC_MSG_RESULT([$ntp_ok])
2767 case "$ntp_ok$ntp_canparse" in
2769 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2772 AC_MSG_CHECKING([Meinberg clocks])
2776 [--enable-MEINBERG],
2779 [ntp_ok=$enableval],
2786 AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
2789 AC_MSG_RESULT([$ntp_ok])
2790 case "$ntp_ok$ntp_canparse" in
2792 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2795 AC_MSG_CHECKING([DCF77 raw time code])
2800 [s DCF77 raw time code]
2802 [ntp_ok=$enableval],
2811 AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
2814 AC_MSG_RESULT([$ntp_ok])
2815 case "$ntp_ok$ntp_canparse" in
2817 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2820 case "$ntp_rawdcf" in
2822 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2823 [ntp_cv_rawdcf_parity],
2831 ntp_cv_rawdcf_parity=$ans
2834 case "$ntp_cv_rawdcf_parity" in
2836 AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
2837 [Should we not IGNPAR (Linux)?]) ;;
2841 AC_MSG_CHECKING([RCC 8000 clock])
2848 [ntp_ok=$enableval],
2855 AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
2858 AC_MSG_RESULT([$ntp_ok])
2859 case "$ntp_ok$ntp_canparse" in
2861 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2864 AC_MSG_CHECKING([Schmid DCF77 clock])
2869 [s Schmid DCF77 clock]
2871 [ntp_ok=$enableval],
2878 AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
2881 AC_MSG_RESULT([$ntp_ok])
2882 case "$ntp_ok$ntp_canparse" in
2884 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2887 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
2891 [--enable-TRIMTAIP],
2892 [s Trimble GPS receiver/TAIP protocol]
2894 [ntp_ok=$enableval],
2901 AC_DEFINE([CLOCK_TRIMTAIP], [1],
2902 [Trimble GPS receiver/TAIP protocol])
2905 AC_MSG_RESULT([$ntp_ok])
2906 case "$ntp_ok$ntp_canparse" in
2908 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2911 AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
2915 [--enable-TRIMTSIP],
2916 [s Trimble GPS receiver/TSIP protocol]
2918 [ntp_ok=$enableval],
2925 AC_DEFINE([CLOCK_TRIMTSIP], [1],
2926 [Trimble GPS receiver/TSIP protocol])
2929 AC_MSG_RESULT([$ntp_ok])
2930 case "$ntp_ok$ntp_canparse" in
2932 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2935 AC_MSG_CHECKING([WHARTON 400A Series clock])
2940 [s WHARTON 400A Series clock]
2942 [ntp_ok=$enableval],
2949 AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
2952 AC_MSG_RESULT([$ntp_ok])
2953 case "$ntp_ok$ntp_canparse" in
2955 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2958 AC_MSG_CHECKING([VARITEXT clock])
2962 [--enable-VARITEXT],
2965 [ntp_ok=$enableval],
2972 AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
2975 AC_MSG_RESULT([$ntp_ok])
2976 case "$ntp_ok$ntp_canparse" in
2978 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2981 AC_MSG_CHECKING(SEL240X clock)
2982 AC_ARG_ENABLE(SEL240X,
2983 AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
2984 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2985 if test "$ntp_ok" = "yes"; then
2988 AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
2990 AC_MSG_RESULT($ntp_ok)
2991 case "$ntp_ok$ntp_canparse" in
2993 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2997 AC_SUBST([LIBPARSE])
2998 AC_SUBST([MAKE_LIBPARSE])
2999 AC_SUBST([MAKE_LIBPARSE_KERNEL])
3000 AC_SUBST([MAKE_CHECK_Y2K])
3002 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3004 case "$ntp_libparse" in
3007 AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
3008 LIBPARSE=../libparse/libparse.a
3009 MAKE_LIBPARSE=libparse.a
3010 # HMS: check_y2k trips the 34 year problem now...
3011 false && MAKE_CHECK_Y2K=check_y2k
3013 AC_MSG_RESULT([$ans])
3019 # if we are using OpenSSL (--with-crypto), by default Autokey is enabled
3020 AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
3025 [+ support NTP Autokey protocol]
3027 [ntp_autokey=$enableval],
3028 [ntp_autokey=$ntp_openssl]
3030 case "$ntp_autokey" in
3034 case "$ntp_openssl" in
3036 AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
3040 AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
3046 AC_MSG_RESULT([$ntp_autokey])
3048 AC_SUBST([MAKE_CHECK_LAYOUT])
3049 AC_MSG_CHECKING([if we want to run check-layout])
3050 case "$cross_compiling$PATH_PERL" in
3052 MAKE_CHECK_LAYOUT=check-layout
3059 AC_MSG_RESULT([$ans])
3063 AC_MSG_CHECKING([if we can make dcf parse utilities])
3065 case "$ntp_parseutil" in
3068 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3075 AC_MSG_RESULT([$ans])
3077 AC_SUBST([MAKE_PARSEKMODULE])
3078 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3080 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3084 case "$ntp_cv_var_kernel_pll" in
3086 AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
3090 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3094 MAKE_PARSEKMODULE=parse
3095 AC_CHECK_HEADERS([strings.h])
3100 AC_MSG_RESULT([$ans])
3102 AC_MSG_CHECKING([if we need basic refclock support])
3103 case "$ntp_refclock" in
3105 AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
3108 AC_MSG_RESULT($ntp_refclock)
3110 dnl Things that can be made in clockstuff
3111 AC_SUBST([PROPDELAY], [propdelay])
3112 AC_SUBST([CHUTEST]) dnl needs work to compile
3114 AC_SUBST([MAKE_ADJTIMED])
3115 AC_MSG_CHECKING([if we want HP-UX adjtimed support])
3125 MAKE_ADJTIMED=adjtimed
3126 AC_DEFINE([NEED_HPUX_ADJTIME], [1],
3127 [Do we need HPUX adjtime() library support?])
3135 AC_MSG_RESULT([$ans])
3137 AC_MSG_CHECKING([if we want QNX adjtime support])
3147 AC_DEFINE([NEED_QNX_ADJTIME], [1],
3148 [Do we need the qnx adjtime call?])
3151 AC_MSG_RESULT([$ans])
3153 AC_MSG_CHECKING([if we can read kmem])
3155 # the default is to enable it if the system has the capability
3157 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3166 *-*-domainos) # Won't be found...
3186 # --enable-kmem / --disable-kmem controls if present
3191 [s read /dev/kmem for tick and/or tickadj]
3196 AC_MSG_RESULT([$ans])
3204 AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
3208 AC_MSG_CHECKING([if adjtime is accurate])
3210 # target-dependent defaults
3219 mips-sgi-irix[[456]]*)
3226 # XXX only verified thru AIX6.
3232 *-*-solaris2.[[01]])
3245 # --enable-accurate-adjtime / --disable-accurate-adjtime
3246 # override the default
3250 [--enable-accurate-adjtime],
3251 [s the adjtime() call is accurate]
3256 AC_MSG_RESULT([$ans])
3260 AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
3261 adjtime_is_accurate=yes
3264 adjtime_is_accurate=no
3269 [the name of 'tick' in the kernel],
3270 [ntp_cv_nlist_tick],
3274 m68*-hp-hpux*) # HP9000/300?
3284 # XXX only verified thru AIX6.
3303 ntp_cv_nlist_tick=$ans
3306 case "$ntp_cv_nlist_tick" in
3308 ;; # HMS: I think we can only get 'no' here...
3310 AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
3311 [What is the name of TICK in the kernel?])
3315 [for the units of 'tick'],
3324 ntp_cv_tick_nano=$ans
3327 case "$ntp_cv_tick_nano" in
3329 AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
3333 [the name of 'tickadj' in the kernel],
3334 [ntp_cv_nlist_tickadj],
3338 m68*-hp-hpux*) # HP9000/300?
3369 ans=no # hrestime_adj
3375 ntp_cv_nlist_tickadj=$ans
3378 case "$ntp_cv_nlist_tickadj" in
3380 ;; # HMS: I think we can only get 'no' here...
3382 AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
3383 [What is the name of TICKADJ in the kernel?])
3387 [for the units of 'tickadj'],
3388 [ntp_cv_tickadj_nano],
3396 ntp_cv_tickadj_nano=$ans
3399 case "$ntp_cv_tickadj_nano" in
3401 AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
3405 [half-heartedly for 'dosynctodr' in the kernel],
3406 [ntp_cv_nlist_dosynctodr],
3449 ntp_cv_nlist_dosynctodr=$ans
3452 case "$ntp_cv_nlist_dosynctodr" in
3456 AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
3457 [What is (probably) the name of DOSYNCTODR in the kernel?])
3462 [half-heartedly for 'noprintf' in the kernel],
3463 [ntp_cv_nlist_noprintf],
3500 ntp_cv_nlist_noprintf=$ans
3503 case "$ntp_cv_nlist_noprintf" in
3507 AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
3508 [What is (probably) the name of NOPRINTF in the kernel?])
3512 dnl The tick/tickadj sections were written by Skippy, who never learned
3513 dnl that it's impolite (horridly gross) to show your guts in public.
3516 dnl 10000 80 Unixware
3517 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3518 dnl 10000 150 sgi IRIX
3519 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3520 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3521 dnl 1000000L/hz 500/HZ other && NOKMEM
3522 dnl txc.tick 1 Linux
3523 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3524 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3525 dnl (RS6000 && !NOKMEM), SINIX MIPS
3527 dnl But we'll only use these "values" if we can't find anything else.
3529 AC_MSG_CHECKING([for a default value for 'tick'])
3531 # target-dependent default for tick
3535 AC_MSG_ERROR([tick needs work for cygwin])
3563 [--enable-tick=VALUE],
3564 [s force a value for 'tick']
3569 AC_MSG_RESULT([$ans])
3573 ;; # HMS: I think we can only get 'no' here...
3575 AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
3576 [Preset a value for 'tick'?])
3579 AC_MSG_CHECKING([for a default value for 'tickadj'])
3581 # target-specific default
3585 case "$adjtime_is_accurate" in
3600 *-*-domainos) # Skippy: won't be found...
3608 case "$adjtime_is_accurate" in
3634 [--enable-tickadj=VALUE],
3635 [s force a value for 'tickadj']
3640 AC_MSG_RESULT([$ans])
3642 default_tickadj=$ans
3644 case "$default_tickadj" in
3646 ;; # HMS: I think we can only get 'no' here...
3648 AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
3649 [Preset a value for 'tickadj'?]) ;;
3652 # Newer versions of ReliantUNIX round adjtime() values down to
3653 # 1/100s (system tick). Sigh ...
3654 # Unfortunately, there is no easy way to know if particular release
3655 # has this "feature" or any obvious way to test for it.
3658 AC_DEFINE([RELIANTUNIX_CLOCK], [1],
3659 [Do we want the ReliantUNIX clock hacks?])
3664 AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
3667 ntp_cv_make_tickadj=yes
3668 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3669 nonono) # Don't read KMEM, no presets. Bogus.
3670 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3671 ntp_cv_make_tickadj=no
3673 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3674 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3675 ntp_cv_make_tickadj=no
3677 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3678 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3679 ntp_cv_make_tickadj=no
3681 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3683 yesnono) # Read KMEM, no presets. Cool.
3685 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3686 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3688 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3690 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3692 *) # Generally bogus.
3693 AC_MSG_ERROR([This shouldn't happen.])
3697 AC_SUBST(MAKE_NTPTIME)
3698 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3700 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
3710 ac_cv_make_ntptime=$ans])
3711 case "$ac_cv_make_ntptime" in
3713 MAKE_NTPTIME=ntptime
3723 AC_SUBST([MAKE_TICKADJ])
3726 # tickadj is pretty useless on newer versions of ReliantUNIX
3728 ntp_cv_make_tickadj=no
3731 ntp_cv_make_tickadj=no
3734 # DLM says tickadj is a no-no starting with solaris2.5
3736 *-*-solaris2.1[[0-9]]*)
3737 ntp_cv_make_tickadj=no
3739 *-*-solaris2.[[0-4]]*) ;;
3740 *) ntp_cv_make_tickadj=no ;;
3744 ntp_cv_make_tickadj=no
3749 # Despite all the above, we always make tickadj. Setting
3750 # ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3751 # report that the configuration variable was cached. It may
3752 # be better to simply remove the hunk above, I did not want
3753 # to remove it if there is hope it will be used again.
3755 AS_UNSET([ntp_cv_make_tickadj])
3758 [if we want and can make the tickadj utility],
3759 [ntp_cv_make_tickadj],
3760 [ntp_cv_make_tickadj=yes]
3762 case "$ntp_cv_make_tickadj" in
3764 MAKE_TICKADJ=tickadj
3778 AC_SUBST([MAKE_TIMETRIM])
3780 [if we want and can make the timetrim utility],
3781 [ntp_cv_make_timetrim],
3785 ntp_cv_make_timetrim=yes
3788 ntp_cv_make_timetrim=yes
3791 ntp_cv_make_timetrim=no
3796 case "$ntp_cv_make_timetrim" in
3798 MAKE_TIMETRIM=timetrim
3807 AC_SUBST([MAKE_LIBNTPSIM])
3808 AC_SUBST([MAKE_NTPDSIM])
3810 AC_MSG_CHECKING([if we want to build the NTPD simulator])
3814 [--enable-simulator],
3815 [- build/install the NTPD simulator?]
3820 AC_MSG_RESULT([$ans])
3823 MAKE_NTPDSIM=ntpdsim
3824 MAKE_LIBNTPSIM=libntpsim.a
3839 LDFLAGS="$LDFLAGS -r"
3847 AC_MSG_CHECKING([if we want to build ntpsnmpd])
3852 [s Build ntpsnmpd MIB agent?]
3856 case "$PATH_NET_SNMP_CONFIG" in
3862 AC_MSG_RESULT([$ans])
3865 case "$PATH_NET_SNMP_CONFIG" in
3867 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
3868 # Bug 2815. This is a bit of a hack, but it works...
3869 case "$ntp_cv_net_snmp_version" in
3870 5.3*) SNMP_LIBS=`echo $SNMP_LIBS | $SED -e 's/-lnetsnmpagent/-lnetsnmpagent -lnetsnmpmibs/'`
3873 AC_SUBST([SNMP_LIBS])
3874 # HMS: we really want to separate CPPFLAGS and CFLAGS
3875 foo=`$PATH_NET_SNMP_CONFIG --cflags`
3881 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
3883 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
3887 AC_SUBST([SNMP_CPPFLAGS])
3888 AC_SUBST([SNMP_CFLAGS])
3891 save_CPPFLAGS=$CPPFLAGS
3894 CPPFLAGS=$SNMP_CPPFLAGS
3897 [net-snmp/net-snmp-config.h],
3898 [MAKE_NTPSNMPD=ntpsnmpd],
3899 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
3902 # Do this last, as we're messing up LIBS.
3903 # check -lnetsnmp for netsnmp_daemonize
3904 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
3907 [netsnmp_daemonize],
3913 AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
3914 [We need to provide netsnmp_daemonize()])
3918 AS_UNSET([save_CFLAGS])
3919 CPPFLAGS=$save_CPPFLAGS
3920 AS_UNSET([save_CPPFLAGS])
3922 AS_UNSET([save_LIBS])
3925 AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
3930 AC_SUBST([MAKE_NTPSNMPD])
3932 case "$MAKE_NTPSNMPD" in
3941 AC_MSG_CHECKING([if we should always slew the time])
3943 # target-specific defaults
3955 *-*-openvms*) # HMS: won't be found
3962 # --enable-slew-always / --disable-slew-always overrides default
3967 [--enable-slew-always],
3968 [s always slew the time]
3973 AC_MSG_RESULT([$ans])
3977 AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
3980 AC_MSG_CHECKING([if we should step and slew the time])
3995 *-*-solaris2.1[[0-9]]*)
3998 *-*-solaris2.[[012]]*)
4001 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
4011 [--enable-step-slew],
4012 [s step and slew the time]
4017 AC_MSG_RESULT([$ans])
4021 AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
4024 AC_MSG_CHECKING([if ntpdate should step the time])
4037 [--enable-ntpdate-step],
4038 [s if ntpdate should step the time]
4043 AC_MSG_RESULT([$ans])
4047 AC_DEFINE([FORCE_NTPDATE_STEP], [1],
4048 [force ntpdate to step the clock if !defined(STEP_SLEW) ?])
4052 AC_MSG_CHECKING([if we should sync TODR clock every hour])
4058 *-*-openvms*) # HMS: won't be found
4069 [--enable-hourly-todr-sync],
4070 [s if we should sync TODR hourly]
4075 AC_MSG_RESULT([$ans])
4077 case "$ac_cv_var_sync_todr" in
4079 AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
4083 AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4096 # Generic_105181-17 and higher
4117 # Generic_106541-07 and higher
4136 [--enable-kernel-fll-bug],
4137 [s if we should avoid a kernel FLL bug]
4142 AC_MSG_RESULT([$ans])
4146 AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
4150 AC_MSG_CHECKING([if we want new session key behavior])
4154 [--enable-bug1243-fix],
4155 [+ use unmodified autokey session keys]
4160 AC_MSG_RESULT([$ans])
4163 AC_DEFINE([DISABLE_BUG1243_FIX], [1],
4164 [use old autokey session key behavior?])
4168 AC_MSG_CHECKING([if we want the explicit 127.0.0.0/8 martian filter])
4172 [--enable-bug3020-fix],
4173 [+ Provide the explicit 127.0.0.0/8 martian filter]
4178 AC_MSG_RESULT([$ans])
4181 AC_DEFINE([ENABLE_BUG3020_FIX], [1],
4182 [Provide the explicit 127.0.0.0/8 martian filter?])
4186 AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
4189 *-*-solaris2.[[89]])
4192 *-*-solaris2.1[[0-9]]*)
4202 [--enable-irig-sawtooth],
4203 [s if we should enable the IRIG sawtooth filter]
4208 AC_MSG_RESULT([$ans])
4212 AC_DEFINE([IRIG_SUCKS], [1],
4213 [Should we use the IRIG sawtooth filter?])
4216 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4221 [- if we should enable the NIST lockclock scheme]
4227 AC_MSG_RESULT([$ans])
4231 AC_DEFINE([LOCKCLOCK], [1],
4232 [Should we align with the NIST lockclock scheme?]) ;;
4235 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4239 [--enable-ntp-signd],
4240 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4246 AC_MSG_RESULT([$ans])
4253 ntp_signd_path=/var/run/ntp_signd
4256 ntp_signd_path="$ans"
4259 case "$ntp_signd_path" in
4263 AC_DEFINE([HAVE_NTP_SIGND], [1],
4264 [Do we want support for Samba's signing daemon?])
4265 AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
4266 [Path to sign daemon rendezvous socket])
4270 AC_CHECK_HEADERS([libscf.h])
4272 case "$ac_cv_header_libscf_h" in
4282 # Look for a sysctl call to get the list of network interfaces.
4285 [for interface list sysctl],
4286 [ntp_cv_iflist_sysctl],
4289 #include <sys/param.h>
4290 #include <sys/sysctl.h>
4291 #include <sys/socket.h>
4292 #ifndef NET_RT_IFLIST
4296 [ntp_cv_iflist_sysctl=yes],
4297 [ntp_cv_iflist_sysctl=no]
4300 case "$ntp_cv_iflist_sysctl" in
4302 AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
4307 AC_MSG_CHECKING([if we want the saveconfig mechanism])
4311 [--enable-saveconfig],
4312 [+ saveconfig mechanism]
4314 [ntp_ok=$enableval],
4317 ntp_saveconfig_enabled=0
4320 ntp_saveconfig_enabled=1
4321 AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
4324 AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
4325 AC_MSG_RESULT([$ntp_ok])
4329 AC_MSG_CHECKING([if we want the experimental leap smear code])
4333 [--enable-leap-smear],
4334 [- experimental leap smear code]
4336 [ntp_ok=$enableval],
4339 ntp_leap_smear_enabled=0
4342 ntp_leap_smear_enabled=1
4343 AC_DEFINE([LEAP_SMEAR], [1], [leap smear mechanism])
4344 AC_SUBST([HAVE_LEAPSMEARINTERVAL])
4345 HAVE_LEAPSMEARINTERVAL="leapsmearinterval 0"
4348 AC_MSG_RESULT([$ntp_ok])
4352 AC_MSG_CHECKING([if we want dynamic interleave support])
4354 [dynamic-interleave],
4356 [--enable-dynamic-interleave],
4357 [- dynamic interleave support]
4359 [ntp_ok=$enableval],
4362 ntp_dynamic_interleave=0
4365 ntp_dynamic_interleave=1
4368 AC_DEFINE_UNQUOTED([DYNAMIC_INTERLEAVE], [$ntp_dynamic_interleave],
4369 [support dynamic interleave?])
4370 AC_MSG_RESULT([$ntp_ok])
4374 dnl gtest is needed for our tests subdirs. It would be nice if we could
4375 dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
4376 dnl can't be conditionalized.
4383 AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
4384 [Default location of crypto key info])
4386 AC_CONFIG_FILES([Makefile])
4387 AC_CONFIG_FILES([adjtimed/Makefile])
4388 AC_CONFIG_FILES([clockstuff/Makefile])
4389 AC_CONFIG_FILES([include/Makefile])
4390 AC_CONFIG_FILES([include/isc/Makefile])
4391 AC_CONFIG_FILES([kernel/Makefile])
4392 AC_CONFIG_FILES([kernel/sys/Makefile])
4393 AC_CONFIG_FILES([libntp/Makefile])
4394 AC_CONFIG_FILES([libparse/Makefile])
4395 AC_CONFIG_FILES([ntpd/Makefile])
4396 AC_CONFIG_FILES([ntpd/complete.conf], [sed -e '/^rlimit$/d' -e '/^$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf])
4397 AC_CONFIG_FILES([ntpdate/Makefile])
4398 AC_CONFIG_FILES([ntpdc/Makefile])
4399 AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
4400 AC_CONFIG_FILES([ntpq/Makefile])
4401 AC_CONFIG_FILES([ntpsnmpd/Makefile])
4402 AC_CONFIG_FILES([parseutil/Makefile])
4403 AC_CONFIG_FILES([scripts/Makefile])
4404 AC_CONFIG_FILES([scripts/build/Makefile])
4405 AC_CONFIG_FILES([scripts/build/genAuthors], [chmod +x scripts/build/genAuthors])
4406 AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
4407 AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
4408 AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
4409 AC_CONFIG_FILES([scripts/lib/Makefile])
4410 AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
4411 AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
4412 AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
4413 AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
4414 AC_CONFIG_FILES([scripts/ntptrace/Makefile])
4415 AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
4416 AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
4417 AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
4418 AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
4419 AC_CONFIG_FILES([scripts/update-leap/Makefile])
4420 AC_CONFIG_FILES([scripts/update-leap/update-leap], [chmod +x scripts/update-leap/update-leap])
4421 AC_CONFIG_FILES([tests/Makefile])
4422 AC_CONFIG_FILES([tests/bug-2803/Makefile])
4423 AC_CONFIG_FILES([tests/libntp/Makefile])
4424 AC_CONFIG_FILES([tests/ntpd/Makefile])
4425 AC_CONFIG_FILES([tests/ntpq/Makefile])
4426 AC_CONFIG_FILES([tests/sandbox/Makefile])
4427 AC_CONFIG_FILES([tests/sec-2853/Makefile])
4428 AC_CONFIG_FILES([util/Makefile])
4430 perllibdir="${datadir}/ntp/lib"
4431 AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
4433 calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
4434 AC_SUBST_FILE([calc_tickadj_opts])
4435 ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
4436 AC_SUBST_FILE([ntp_wait_opts])
4437 ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
4438 AC_SUBST_FILE([ntpsweep_opts])
4439 ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
4440 AC_SUBST_FILE([ntptrace_opts])
4441 summary_opts="$srcdir/scripts/summary-opts"
4442 AC_SUBST_FILE([summary_opts])
4443 plot_summary_opts="$srcdir/scripts/plot_summary-opts"
4444 AC_SUBST_FILE([plot_summary_opts])
4446 AC_CONFIG_SUBDIRS([sntp])