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])
15 AC_PRESERVE_HELP_ORDER
17 # Bump ntp_configure_cache_version for each change to configure.ac or
18 # .m4 files which invalidates cached values from previous configure
21 # If the change affects cache variables used only by the main NTP
22 # configure.ac, then only its version number should be bumped, while
23 # the subdir configure.ac version numbers should be unchanged. The
24 # same is true for a test/variable that is used only by one subdir
25 # being changed incompatibly; only that subdir's cache version needs
28 # If a change affects variables shared by all NTP configure scripts,
29 # please bump the version numbers of each. If you are not sure, the
30 # safe choice is to bump all on any cache-invalidating change.
32 # In order to avoid the risk of version stamp collision between -stable
33 # and -dev branches, do not simply increment the version, instead use
34 # the date YYYYMMDD optionally with -HHMM if there is more than one
37 ntp_configure_cache_version=20120806
39 # When the cache version of config.cache and configure do not
40 # match, NTP_CACHEVERSION will flush the cache.
42 NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
44 AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
46 dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
49 [AM_SILENT_RULES([yes])]
53 dnl the 'build' machine is where we run configure and compile
54 dnl the 'host' machine is where the resulting stuff runs.
55 AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
56 [canonical system (cpu-vendor-os) of where we should run])
57 AC_CONFIG_HEADERS([config.h])
60 ntp_atom_ok=${ntp_atom_ok=no}
61 ntp_oncore_ok=${ntp_oncore_ok=no}
62 ntp_parse_ok=${ntp_parse_ok=no}
63 ntp_ripe_ncc_ok=${ntp_parse_ok=no}
64 ntp_jupiter_ok=${ntp_jupiter_ok=no}
73 NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
75 NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
77 dnl AM_PROG_AR req. automake 1.12
83 # So far, the only shared library we might use is libopts.
84 # It's a small library - we might as well use a static version of it.
87 AC_SUBST([LIBTOOL_DEPS])
89 # NTP has (so far) been relying on leading-edge autogen, which
90 # means we need the appropriate corresponding libopts as well.
91 # Therefore, by default:
92 # - use the version of libopts we ship with
94 # - build a static copy (AC_DISABLE_SHARED - done earlier)
95 case "${enable_local_libopts+set}" in
97 *) enable_local_libopts=yes ;;
99 case "${enable_libopts_install+set}" in
101 *) enable_libopts_install=no ;;
104 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
106 NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
110 AC_MSG_CHECKING([for deprecated --with-arlib])
112 AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
113 [ans=$withval], [ans=no])
114 AC_MSG_RESULT([$ans])
118 AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
122 dnl we need to check for cross compile tools for vxWorks here
124 AS_UNSET([ac_cv_prog_AWK])
125 AC_SUBST([AWK]) dnl scripts/ntpver.in
135 AC_PATH_PROG([PATH_PERL], [perl])
136 dnl Saving cached hardcoded paths rather than searching $PATH during a
137 dnl cached configure run is an optimization not worth the the cost of
138 dnl preventing newly-installed tools from being found. Short-circuit
139 dnl the caching after the tests so preset overrides still work.
140 AS_UNSET([ac_cv_path_PATH_PERL])
141 AC_PATH_PROG([PATH_TEST], [test])
142 AS_UNSET([ac_cv_path_PATH_TEST])
143 test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
144 AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
149 [--with-net-snmp-config],
164 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
169 PROG_NET_SNMP_CONFIG=$ans
170 AC_MSG_CHECKING([for net-snmp-config path])
171 case "$PROG_NET_SNMP_CONFIG" in
174 PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
177 AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
178 AS_UNSET([ac_cv_path_PATH_NET_SNMP_CONFIG])
181 AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
185 ac_link="$ac_link $VX_KERNEL"
189 # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
190 AC_SEARCH_LIBS([openlog], [gen syslog])
191 # XXX library list will be in ac_cv_search_openlog
193 # LIBSECCOMP is off by default -- needs testing with all the features
194 # Please send bug reports to loganaden@gmail.com
195 AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
199 [--enable-libseccomp],
200 [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
205 AC_MSG_RESULT([$ntp_ok])
211 [AC_DEFINE([LIBSECCOMP], [1],
212 [Define to any value to include libseccomp sandboxing.])]
218 #include <sys/prctl.h>
219 #include <linux/seccomp.h>
224 ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
236 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
250 , AC_DEFINE([KERN_SECCOMP], 1,
251 [Define to use libseccomp system call filtering.])
259 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
260 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
261 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
262 dnl does Strange Things with extra processes using the Posix-compatibility
263 dnl real-time library, so we don't want to use it.
265 dnl 081118 Harlan got tired of looking for a way to get the sched*()
266 dnl functions to link OK with either cc or gcc.
273 # HMS: Make sure we check for -lrt for clock_* before this...
274 case "$ac_cv_search_clock_gettime" in
275 '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
277 AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
281 AC_CHECK_HEADERS([bstring.h])
285 [DNSServiceRegister],
287 [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
288 [Use Rendezvous/DNS-SD registration])]
291 AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
293 AC_CHECK_HEADERS([memory.h netdb.h poll.h])
294 AC_CHECK_HEADERS([sgtty.h stdlib.h string.h termio.h])
295 AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
299 AC_CHECK_HEADERS([utmpx.h])
300 case "$ac_cv_header_utmpx_h" in
304 AC_CHECK_HEADERS([utmp.h])
309 AC_CHECK_HEADERS([utmp.h utmpx.h])
314 # On Suns only (so far) getpass() truncates the typed password to 8
315 # characters, but getpassphrase() allows up to 257. Most systems'
316 # getpass() does not truncate, at least not so as to affect ntpq and
317 # ntpdc password prompts.
319 # So check for getpassphrase(), but only on Sun operating systems.
322 *-*-sunos*|*-*-solaris*)
323 AC_CHECK_FUNCS([getpassphrase])
327 AC_CHECK_HEADERS([net/if6.h])
328 AC_CHECK_HEADERS([net/route.h], [], [], [
329 #include <sys/types.h>
330 #include <sys/socket.h>
334 AC_CHECK_HEADERS([netinfo/ni.h])
335 case "$ac_cv_header_netinfo_ni_h" in
337 AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
339 AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
344 AC_CHECK_HEADERS([sys/ioctl.h])
347 AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
348 # HMS: Check sys/proc.h and sys/resource.h after some others
349 AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
350 case "$ac_cv_header_sched_h" in
354 AC_CHECK_HEADERS([sys/sched.h])
357 # HMS: Check sys/shm.h after some others
358 AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
359 # HMS: Checked sys/socket.h earlier
364 AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
367 AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
368 AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
371 AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
374 AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
383 AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
389 case "$ac_cv_func_ntp_gettime" in
393 AC_CHECK_FUNCS([__ntp_gettime])
394 case "$ac_cv_func___ntp_gettime" in
396 AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
397 AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
401 AC_CHECK_FUNCS([adjtimex])
402 case "$ac_cv_func_adjtimex" in
404 AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
405 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
409 AC_CHECK_FUNCS([__adjtimex])
410 case "$ac_cv_func___adjtimex" in
412 AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
413 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
414 AC_DEFINE([adjtimex], [__adjtimex], [deviant])
415 AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
421 case "$have_adjtimex" in
423 # nlist stuff is only needed for tickadj.
426 AC_SEARCH_LIBS([nlist], [elf ld mld])
427 # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
428 AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
429 # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
430 AC_CHECK_HEADERS([nlist.h sys/var.h])
431 case "$ac_cv_header_nlist_h" in
433 AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
435 [for n_un in struct nlist],
436 [ntp_cv_struct_nlist_n_un],
447 [ntp_cv_struct_nlist_n_un=yes],
448 [ntp_cv_struct_nlist_n_un=no]
451 case "$ntp_cv_struct_nlist_n_un" in
453 AC_DEFINE([NLIST_NAME_UNION], [1],
454 [does struct nlist use a name union?])
457 AC_SUBST([LDADD_NLIST])
460 AS_UNSET([saved_LIBS])
463 AC_CHECK_HEADERS([sys/proc.h], [], [], [
464 #ifdef HAVE_SYS_TYPES_H
465 # include <sys/types.h>
467 #ifdef HAVE_SYS_TIME_H
468 # include <sys/time.h>
472 AC_CHECK_HEADERS([sys/resource.h], [], [], [
473 #ifdef HAVE_SYS_TIME_H
474 # include <sys/time.h>
478 AC_CHECK_HEADERS([sys/shm.h], [], [], [
479 #ifdef HAVE_SYS_TYPES_H
480 # include <sys/types.h>
482 #ifdef HAVE_SYS_IPC_H
483 # include <sys/ipc.h>
487 AC_CHECK_HEADERS([sys/timex.h], [], [], [
488 #ifdef HAVE_SYS_TIME_H
489 # include <sys/time.h>
495 AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c
498 [for a fallback value for HZ],
501 ntp_cv_default_hz=100
503 alpha*-dec-osf4*|alpha*-dec-osf5*)
504 ntp_cv_default_hz=1024
507 ntp_cv_default_hz=256
512 AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
513 [What is the fallback value for HZ?])
516 [if we need to override the system's value for HZ],
517 [ntp_cv_override_hz],
519 ntp_cv_override_hz=no
521 alpha*-dec-osf4*|alpha*-dec-osf5*)
522 ntp_cv_override_hz=yes
525 ntp_cv_override_hz=yes
528 ntp_cv_override_hz=yes
531 ntp_cv_override_hz=yes
534 ntp_cv_override_hz=yes
539 case "$ntp_cv_override_hz" in
541 AC_DEFINE([OVERRIDE_HZ], [1],
542 [Do we need to override the system's idea of HZ?])
545 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
546 dnl [AC_TRY_LINK([#include <sys/types.h>
547 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
548 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
549 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
550 dnl AC_DEFINE(HAVE_UT_HOST)
553 dnl AC_MSG_CHECKING(if we can get the system boot time)
554 dnl AC_CACHE_VAL(su_cv_have_boot_time,
555 dnl [AC_EGREP_CPP(yes,
556 dnl [#ifdef HAVE_UTMPX_H
557 dnl #include <utmpx.h>
559 dnl #include <utmp.h>
564 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
565 dnl AC_MSG_RESULT($su_cv_have_boot_time)
568 [for struct rt_msghdr],
569 [ntp_cv_struct_rt_msghdr],
573 #include <sys/types.h>
574 #include <sys/socket.h>
576 #include <net/route.h>
582 [ntp_cv_struct_rt_msghdr=yes],
583 [ntp_cv_struct_rt_msghdr=no]
594 #include <sys/socket.h>
595 #include <linux/rtnetlink.h>
606 case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
608 AC_DEFINE([HAS_ROUTING_SOCKET], [1],
609 [Do we have a routing socket (rt_msghdr or rtattr)?])
610 case "$ntp_cv_rtattr" in
612 AC_DEFINE([HAVE_RTNETLINK], [1],
613 [Do we have Linux routing socket?])
618 [struct sigaction for sa_sigaction],
619 [ntp_cv_struct_sigaction_has_sa_sigaction],
626 struct sigaction act;
627 act.sa_sigaction = 0;
630 [ntp_cv_struct_sigaction_has_sa_sigaction=yes],
631 [ntp_cv_struct_sigaction_has_sa_sigaction=no]
634 case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
636 AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
640 [for struct ppsclockev],
641 [ntp_cv_struct_ppsclockev],
645 #ifdef HAVE_SYS_TYPES_H
646 # include <sys/types.h>
648 #ifdef HAVE_SYS_TERMIOS_H
649 # include <sys/termios.h>
651 #ifdef HAVE_SYS_TIME_H
652 # include <sys/time.h>
654 #ifdef HAVE_SYS_PPSCLOCK_H
655 # include <sys/ppsclock.h>
659 extern struct ppsclockev *pce;
663 [ntp_cv_struct_ppsclockev=yes],
664 [ntp_cv_struct_ppsclockev=no]
667 case "$ntp_cv_struct_ppsclockev" in
669 AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
670 [Does a system header define struct ppsclockev?])
673 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
676 [for struct snd_size],
677 [ntp_cv_struct_snd_size],
681 #ifdef HAVE_MACHINE_SOUNDCARD_H
682 # include <machine/soundcard.h>
684 #ifdef HAVE_SYS_SOUNDCARD_H
685 # include <sys/soundcard.h>
689 extern struct snd_size *ss;
693 [ntp_cv_struct_snd_size=yes],
694 [ntp_cv_struct_snd_size=no]
697 case "$ntp_cv_struct_snd_size" in
699 AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
700 [Do we have struct snd_size?])
705 [struct clockinfo for hz],
706 [ntp_cv_struct_clockinfo_has_hz],
710 #include <sys/time.h>
713 extern struct clockinfo *pc;
717 [ntp_cv_struct_clockinfo_has_hz=yes],
718 [ntp_cv_struct_clockinfo_has_hz=no]
721 case "$ntp_cv_struct_clockinfo_has_hz" in
723 AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
727 [struct clockinfo for tickadj],
728 [ntp_cv_struct_clockinfo_has_hz],
732 #include <sys/time.h>
735 extern struct clockinfo *pc;
739 [ntp_cv_struct_clockinfo_has_hz=yes],
740 [ntp_cv_struct_clockinfo_has_hz=no]
743 case "$ntp_cv_struct_clockinfo_has_hz" in
745 AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
748 case "$ntp_cv_struct_ntptimeval" in
751 [struct ntptimeval.time.tv_nsec],
755 #ifdef HAVE_SYS_TIME_H
756 # include <sys/time.h>
762 #ifdef HAVE_SYS_TIMEX_H
763 # include <sys/timex.h>
775 AC_CHECK_FUNCS([arc4random_buf])
780 LIBS="$LIBS $LDADD_LIBNTP"
781 AC_CHECK_FUNCS([daemon])
782 # XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
784 AS_UNSET([saved_LIBS])
793 AC_MSG_CHECKING([for isfinite with <math.h>])
811 AC_MSG_RESULT([$ans])
814 AC_DEFINE([HAVE_ISFINITE], [1])
820 AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
822 # kvm_open() is only used by tickadj. Also see above.
823 case "$ac_cv_header_kvm_h" in
825 AC_CHECK_FUNCS([kvm_open])
833 *) AC_CHECK_FUNCS([mkstemp])
836 AC_CHECK_FUNCS([mktime])
839 # XXX only verified thru AIX6.
843 # Just a stub in "old" Irix. Sigh.
845 # In the belief that the fix for bug 1223 fixes mlockall() under linux...
847 # # there, but more trouble than it is worth for now (resolver problems)
850 # Apparently there but not working in QNX. Sigh?
855 alpha*-dec-osf4*|alpha*-dec-osf5*)
856 # mlockall is there, as a #define calling memlk via <sys/mman.h>
857 # Not easy to test for - cheat.
858 AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
859 AC_CHECK_FUNCS([mlockall])
861 *) AC_CHECK_FUNCS([mlockall])
864 AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
867 # XXX only verified thru AIX6.
868 # Just a stub in AIX 4. Sigh.
871 # Just stubs in solaris2.5. Sigh.
873 *) AC_CHECK_FUNCS([sched_setscheduler])
876 AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
877 AC_CHECK_FUNCS([strdup strerror setrlimit strchr])
880 # XXX only verified thru AIX6.
893 AC_CHECK_FUNCS([timer_create])
899 # HMS: Only if we are doing the MLOCKALL stuff...
900 AC_MSG_CHECKING([for the default number of 4k stack pages])
904 [--with-stack-limit],
905 [? =50 (200 for openbsd) 4k pages]
922 *) AC_MSG_ERROR(["--with-stack-limit requires an integer argument."])
925 AC_MSG_RESULT([$ans])
926 AC_DEFINE_UNQUOTED([DFLT_RLIMIT_STACK], [$ans],
927 [Default number of 4k pages for RLIMIT_STACK])
929 # HMS: only if we have RLIMIT_MEMLOCK
930 AC_MSG_CHECKING([for the default number of megabytes to MEMLOCK])
945 *) AC_MSG_ERROR(["--with-memlock requires an integer argument."])
948 AC_MSG_RESULT([$ans])
949 AC_DEFINE_UNQUOTED([DFLT_RLIMIT_MEMLOCK], [$ans],
950 [Default number of megabytes for RLIMIT_MEMLOCK])
953 # some OSes prefer _exit() in forked children to exit()
954 AC_CHECK_FUNCS([_exit])
955 ntp_worker_child_exit=exit
956 case "$ac_cv_func__exit::$host_os" in
958 ntp_worker_child_exit=_exit
961 ntp_worker_child_exit=_exit
964 AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
965 [routine worker child proc uses to exit.])
967 AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
971 # http://bugs.ntp.org/737
972 case "$ac_cv_func_recvmsg" in
975 [if we need extra help to define struct iovec],
976 [ntp_cv_struct_iovec_help],
979 for ntp_cv_struct_iovec_help in '0' '1'; do
983 #ifdef HAVE_SYS_TYPES_H
984 # include <sys/types.h>
986 #ifdef HAVE_SYS_SOCKET_H
987 # include <sys/socket.h>
989 #if $ntp_cv_struct_iovec_help
990 # include <sys/uio.h>
1002 x = recvmsg(s, &mh, flags);
1006 [compiled=yes ; break 1],
1012 ntp_cv_struct_iovec_help=0
1014 AS_UNSET([compiled])
1017 case "$ntp_cv_struct_iovec_help" in
1019 AC_DEFINE([HAVE_SYS_UIO_H], [1],
1020 [Use sys/uio.h for struct iovec help])
1025 [number of arguments taken by setpgrp()],
1026 [ntp_cv_func_setpgrp_nargs],
1030 #ifdef HAVE_SYS_TYPES_H
1031 # include <sys/types.h>
1033 #ifdef HAVE_UNISTD_H
1034 # include <unistd.h>
1041 [ntp_cv_func_setpgrp_nargs=2],
1042 [ntp_cv_func_setpgrp_nargs=0]
1045 case "$ntp_cv_func_setpgrp_nargs" in
1047 AC_DEFINE([HAVE_SETPGRP_0], [1],
1048 [define if setpgrp takes 0 arguments])
1052 [if we need to declare 'errno'],
1053 [ntp_cv_decl_errno],
1065 [ntp_cv_decl_errno=no],
1066 [ntp_cv_decl_errno=yes]
1069 case "$ntp_cv_decl_errno" in
1071 AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
1074 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1075 dnl MT purposes. This makes the line "extern int h_errno" choke
1076 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1077 dnl without breaking any other platforms.
1080 [if we may declare 'h_errno'],
1081 [ntp_cv_decl_h_errno],
1085 #include <sys/types.h>
1086 #ifdef HAVE_NETINET_IN_H
1087 # include <netinet/in.h>
1089 #ifdef HAVE_ARPA_NAMESER_H
1090 # include <arpa/nameser.h>
1095 #ifdef HAVE_RESOLV_H
1096 # include <resolv.h>
1103 [ntp_cv_decl_h_errno=yes],
1104 [ntp_cv_decl_h_errno=no]
1107 case "$ntp_cv_decl_h_errno" in
1109 AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
1113 [if declaring 'syscall()' is ok],
1114 [ntp_cv_decl_syscall],
1118 #ifdef HAVE_SYS_TYPES_H
1119 # include <sys/types.h>
1121 #ifdef HAVE_UNISTD_H
1122 # include <unistd.h>
1126 extern int syscall (int, ...);
1129 [ntp_cv_decl_syscall=yes],
1130 [ntp_cv_decl_syscall=no]
1133 case "$ntp_cv_decl_syscall" in
1135 AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
1140 AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
1143 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1144 AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
1145 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1146 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1147 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1148 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1149 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1152 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1153 AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
1156 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1159 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1160 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1161 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1162 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1163 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1164 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1165 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1166 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1167 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1168 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1169 AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1170 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1171 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1172 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1173 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1174 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1177 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1178 AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
1181 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1186 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1187 AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
1188 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1189 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1190 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1191 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1192 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1193 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1194 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1195 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1196 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1197 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1198 AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
1199 case "`basename $ac_cv_prog_CC`" in
1201 *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1204 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1205 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1206 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1207 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1208 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1209 AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
1210 AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
1213 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1214 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1215 AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
1216 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1217 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1218 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1219 AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
1220 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1221 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1222 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1223 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1224 AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
1225 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1226 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1232 AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
1233 [Do we need to #define _SVID3 when we #include <termios.h>?])
1239 AC_DEFINE([NEED_RCVBUF_SLOP], [1],
1240 [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
1243 dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
1245 [if we will open the broadcast socket],
1246 [ntp_cv_var_open_bcast_socket],
1253 ntp_cv_var_open_bcast_socket=$ans
1256 case "$ntp_cv_var_open_bcast_socket" in
1258 AC_DEFINE([OPEN_BCAST_SOCKET], [1],
1259 [Should we open the broadcast socket?])
1264 AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
1265 [Do we want the HPUX FindConfig()?])
1268 dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
1270 [if process groups are set with -pid],
1271 [ntp_cv_arg_setpgrp_negpid],
1293 ntp_cv_arg_setpgrp_negpid=$ans
1296 case "$ntp_cv_arg_setpgrp_negpid" in
1298 AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
1299 [Do we set process groups with -pid?])
1303 [if we need a ctty for F_SETOWN],
1304 [ntp_cv_func_ctty_for_f_setown],
1313 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1314 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1315 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1316 # in $host may be followed by "aout", "ecoff", or "elf".
1317 *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
1320 *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
1336 ntp_cv_func_ctty_for_f_setown=$ans
1339 case "$ntp_cv_func_ctty_for_f_setown" in
1341 AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
1345 [if the OS clears cached routes when more specifics become available],
1346 [ntp_cv_os_routeupdates],
1356 ntp_cv_os_routeupdates=$ans
1359 case "$ntp_cv_os_routeupdates" in
1361 AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
1362 [need to recreate sockets on changed routing?])
1366 [if the wildcard socket needs REUSEADDR to bind other addresses],
1367 [ntp_cv_os_wildcardreuse],
1376 ntp_cv_os_wildcardreuse=$ans
1379 case "$ntp_cv_os_wildcardreuse" in
1381 AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
1382 [wildcard socket needs REUSEADDR to bind interface addresses])
1387 AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
1388 [Might nlist() values require an extra level of indirection (AIX)?])
1392 [for a minimum recommended value of tickadj],
1393 [ntp_cv_var_min_rec_tickadj],
1401 ntp_cv_var_min_rec_tickadj=$ans
1404 case "$ntp_cv_var_min_rec_tickadj" in
1408 AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
1409 [Should we recommend a minimum value for tickadj?])
1413 [if the TTY code permits PARENB and IGNPAR],
1414 [ntp_cv_no_parenb_ignpar],
1424 i?86-*-freebsd[[123]].*)
1433 ntp_cv_no_parenb_ignpar=$ans
1436 case "$ntp_cv_no_parenb_ignpar" in
1438 AC_DEFINE([NO_PARENB_IGNPAR], [1],
1439 [Is there a problem using PARENB and IGNPAR?])
1442 AC_MSG_CHECKING([if we're including processing time debugging code])
1446 [--enable-debug-timing],
1447 [- include processing time debugging code (costs performance)]
1449 [ntp_ok=$enableval],
1454 AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
1456 AC_MSG_RESULT([$ntp_ok])
1458 AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
1462 [--enable-dst-minutes],
1463 [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
1468 AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
1469 [The number of minutes in a DST adjustment])
1470 AC_MSG_RESULT([$ans])
1472 AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
1474 [ignore-dns-errors],
1476 [--enable-ignore-dns-errors],
1477 [- retry DNS queries on any error]
1484 AC_DEFINE([IGNORE_DNS_ERRORS], [1],
1485 [Retry queries on _any_ DNS error?])
1487 AC_MSG_RESULT([$ans])
1490 [availability of ntp_{adj,get}time()],
1491 [ntp_cv_var_ntp_syscalls],
1493 ntp_cv_var_ntp_syscalls=no
1494 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1496 ntp_cv_var_ntp_syscalls=libc
1499 ntp_cv_var_ntp_syscalls=inline
1505 #include <sys/syscall.h>
1506 #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
1510 [ntp_cv_var_ntp_syscalls=kernel]
1516 case "$ntp_cv_var_ntp_syscalls" in
1518 AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
1519 [Do we have ntp_{adj,get}time in libc?])
1522 AC_DEFINE([NTP_SYSCALLS_STD], [1],
1523 [Do we have ntp_{adj,get}time in the kernel?])
1528 [if sys/timex.h has STA_FLL],
1529 [ntp_cv_var_sta_fll],
1533 #include <sys/timex.h>
1538 [ntp_cv_var_sta_fll=yes],
1539 [ntp_cv_var_sta_fll=no]
1544 [if we have kernel PLL support],
1545 [ntp_cv_var_kernel_pll],
1546 [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
1547 case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
1549 ntp_cv_var_kernel_pll=no
1551 *) ntp_cv_var_kernel_pll=yes
1556 case "$ntp_cv_var_kernel_pll" in
1558 AC_DEFINE([KERNEL_PLL], [1],
1559 [Does the kernel support precision time discipline?])
1563 [if SIOCGIFCONF returns buffer size in the buffer],
1564 [ntp_cv_size_returned_in_buffer],
1578 ntp_cv_size_returned_in_buffer=$ans
1581 case "$ntp_cv_size_returned_in_buffer" in
1583 AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
1584 [Does SIOCGIFCONF return size in the buffer?])
1587 # Check for ioctls TIOCGPPSEV
1588 AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
1589 case "$ac_cv_header_termios_h" in
1593 #include <termios.h>
1608 AC_DEFINE([HAVE_TIOCGPPSEV], [1],
1609 [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1611 AC_MSG_RESULT([$ntp_ok])
1613 # Check for ioctls TIOCSPPS
1614 AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
1615 case "$ac_cv_header_termios_h" in
1619 #include <termios.h>
1634 AC_DEFINE([HAVE_TIOCSPPS], [1],
1635 [Do we have the TIOCSPPS ioctl (Solaris)?])
1637 AC_MSG_RESULT([$ntp_ok])
1639 # Check for ioctls CIOGETEV
1640 AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
1641 case "$ac_cv_header_sys_ppsclock_h" in
1645 #include <sys/ppsclock.h>
1660 AC_DEFINE([HAVE_CIOGETEV], [1],
1661 [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1663 AC_MSG_RESULT([$ntp_ok])
1665 # ATOM/PPSAPI stuff.
1669 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1671 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1672 # The PPSAPI needs struct timespec.
1673 # The PPSAPI also needs a timepps header.
1675 case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
1677 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
1678 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
1679 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1689 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1690 AC_CHECK_HEADER([linux/serial.h])
1691 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1693 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
1696 #include <sys/time.h>
1698 #include <sys/ppsclock.h>
1699 #include <linux/serial.h>
1707 #ifndef ASYNC_PPS_CD_POS
1710 #ifndef ASYNC_PPS_CD_NEG
1720 AC_MSG_RESULT([$ntp_ok])
1728 AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
1729 [Do we have the TIO serial stuff?])
1732 # Check for SHMEM_STATUS support
1733 AC_MSG_CHECKING([SHMEM_STATUS support])
1734 case "$ac_cv_header_sys_mman_h" in
1744 AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
1745 [Do we have support for SHMEM_STATUS?])
1747 AC_MSG_RESULT([$ntp_ok])
1751 # HPUX only, and by explicit request
1752 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
1757 [- Datum/Bancomm bc635/VME interface]
1759 [ntp_ok=$enableval],
1765 AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
1768 AC_MSG_RESULT([$ntp_ok])
1769 case "$ntp_ok$host" in
1771 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1774 #HPUX only, and only by explicit request
1775 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
1780 [- TrueTime GPS receiver/VME interface]
1782 [ntp_ok=$enableval],
1788 AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
1791 AC_MSG_RESULT([$ntp_ok])
1792 case "$ntp_ok$host" in
1794 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1797 AC_MSG_CHECKING([for PCL720 clock support])
1798 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1800 AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
1807 AC_MSG_RESULT([$ans])
1809 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
1813 [--enable-all-clocks],
1814 [+ include all suitable non-PARSE clocks:]
1816 [ntp_eac=$enableval],
1819 AC_MSG_RESULT([$ntp_eac])
1821 # HMS: Should we also require ntp_parse_ok?
1822 AC_MSG_CHECKING([if we have support for PARSE clocks])
1823 case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1830 AC_MSG_RESULT([$ntp_canparse])
1832 AC_MSG_CHECKING([if we have support for audio clocks])
1833 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
1836 AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
1838 *) ntp_canaudio=no ;;
1840 AC_MSG_RESULT([$ntp_canaudio])
1842 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1843 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1849 AC_MSG_RESULT([$ntp_canshm])
1851 # Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
1853 [for termios modem control],
1854 [ntp_cv_modem_control],
1858 #ifdef HAVE_UNISTD_H
1859 # include <unistd.h>
1861 #ifdef HAVE_TERMIOS_H
1862 # include <termios.h>
1864 #ifdef HAVE_SYS_IOCTL_H
1865 # include <sys/ioctl.h>
1869 int dtr = TIOCM_DTR;
1871 ioctl(1, TIOCMBIS, (char *)&dtr);
1874 [ntp_cv_modem_control=yes],
1875 [ntp_cv_modem_control=no]
1878 case "$ntp_eac::$ntp_cv_modem_control" in
1880 ntp_enable_all_modem_control_clocks=yes
1883 ntp_enable_all_modem_control_clocks=no
1887 # Requires modem control
1888 AC_MSG_CHECKING([ACTS modem service])
1893 [s ACTS modem service]
1895 [ntp_ok=$enableval],
1896 [ntp_ok=$ntp_enable_all_modem_control_clocks]
1901 AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
1904 AC_MSG_RESULT([$ntp_ok])
1906 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
1911 [+ Arbiter 1088A/B GPS receiver]
1913 [ntp_ok=$enableval],
1919 AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
1922 AC_MSG_RESULT([$ntp_ok])
1924 AC_MSG_CHECKING([Arcron MSF receiver])
1928 [--enable-ARCRON-MSF],
1929 [+ Arcron MSF receiver]
1931 [ntp_ok=$enableval],
1937 AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
1940 AC_MSG_RESULT([$ntp_ok])
1942 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
1947 [+ Austron 2200A/2201A GPS receiver]
1949 [ntp_ok=$enableval],
1955 AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
1958 AC_MSG_RESULT([$ntp_ok])
1960 AC_MSG_CHECKING([ATOM PPS interface])
1965 [s ATOM PPS interface]
1967 [ntp_ok=$enableval],
1970 case "$ntp_atom_ok" in
1976 AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
1979 AC_MSG_RESULT([$ntp_ok])
1981 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
1985 [--enable-CHRONOLOG],
1986 [+ Chrono-log K-series WWVB receiver]
1988 [ntp_ok=$enableval],
1994 AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
1997 AC_MSG_RESULT([$ntp_ok])
1999 AC_MSG_CHECKING([CHU modem/decoder])
2004 [+ CHU modem/decoder]
2006 [ntp_ok=$enableval],
2012 AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
2015 AC_MSG_RESULT([$ntp_ok])
2016 ntp_refclock_chu=$ntp_ok
2018 AC_MSG_CHECKING([CHU audio/decoder])
2022 [--enable-AUDIO-CHU],
2023 [s CHU audio/decoder]
2025 [ntp_ok=$enableval],
2027 case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
2033 AC_MSG_RESULT([$ntp_ok])
2034 # We used to check for sunos/solaris target...
2035 case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
2036 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
2040 AC_MSG_CHECKING([Datum Programmable Time System])
2045 [s Datum Programmable Time System]
2047 [ntp_ok=$enableval],
2049 case "$ac_cv_header_termios_h" in
2061 AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
2064 AC_MSG_RESULT([$ntp_ok])
2066 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2070 [--enable-DUMBCLOCK],
2071 [+ Dumb generic hh:mm:ss local clock]
2073 [ntp_ok=$enableval],
2079 AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
2082 AC_MSG_RESULT([$ntp_ok])
2084 AC_MSG_CHECKING([Forum Graphic GPS])
2089 [+ Forum Graphic GPS]
2091 [ntp_ok=$enableval],
2097 AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
2100 AC_MSG_RESULT([$ntp_ok])
2102 # Requires modem control
2103 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2108 [s Heath GC-1000 WWV/WWVH receiver]
2110 [ntp_ok=$enableval],
2111 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2116 AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
2119 AC_MSG_RESULT([$ntp_ok])
2121 AC_MSG_CHECKING([for hopf serial clock device])
2125 [--enable-HOPFSERIAL],
2126 [+ hopf serial clock device]
2128 [ntp_ok=$enableval],
2134 AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
2137 AC_MSG_RESULT([$ntp_ok])
2139 AC_MSG_CHECKING([for hopf PCI clock 6039])
2144 [+ hopf 6039 PCI board]
2146 [ntp_ok=$enableval],
2152 AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
2155 AC_MSG_RESULT([$ntp_ok])
2157 AC_MSG_CHECKING([HP 58503A GPS receiver])
2162 [+ HP 58503A GPS receiver]
2164 [ntp_ok=$enableval],
2170 AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
2173 AC_MSG_RESULT([$ntp_ok])
2175 AC_MSG_CHECKING([IRIG audio decoder])
2180 [s IRIG audio decoder]
2182 [ntp_ok=$enableval],
2184 case "$ntp_eac$ntp_canaudio" in
2193 AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
2196 AC_MSG_RESULT([$ntp_ok])
2197 case "$ntp_ok$ntp_canaudio" in
2198 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2201 AC_MSG_CHECKING([for JJY receiver])
2208 [ntp_ok=$enableval],
2214 AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
2217 AC_MSG_RESULT([$ntp_ok])
2219 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2224 [s Rockwell Jupiter GPS receiver]
2226 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2227 case "$ntp_jupiter_ok" in
2233 AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
2236 AC_MSG_RESULT([$ntp_ok])
2238 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2243 [+ Leitch CSD 5300 Master Clock System Driver]
2245 [ntp_ok=$enableval],
2251 AC_DEFINE([CLOCK_LEITCH], [1],
2252 [Leitch CSD 5300 Master Clock System Driver?])
2255 AC_MSG_RESULT([$ntp_ok])
2257 AC_MSG_CHECKING([local clock reference])
2261 [--enable-LOCAL-CLOCK],
2262 [+ local clock reference]
2264 [ntp_ok=$enableval],
2270 AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
2273 AC_MSG_RESULT([$ntp_ok])
2275 dnl Bug 340: longstanding unfixed bugs
2276 dnl AC_MSG_CHECKING([EES M201 MSF receiver])
2277 dnl AC_ARG_ENABLE([MSFEES],
2278 dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
2279 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2280 dnl if test "$ntp_ok" = "yes"; then
2281 dnl ntp_refclock=yes
2282 dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
2284 dnl AC_MSG_RESULT([$ntp_ok])
2287 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2292 [s Magnavox MX4200 GPS receiver]
2294 [ntp_ok=$enableval],
2296 case "$ac_cv_var_ppsclock" in
2309 AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
2312 AC_MSG_RESULT([$ntp_ok])
2313 case "$ntp_ok$host" in
2314 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
2317 AC_MSG_CHECKING([for NeoClock4X receiver])
2321 [--enable-NEOCLOCK4X],
2322 [+ NeoClock4X DCF77 / TDF receiver]
2324 [ntp_ok=$enableval],
2330 AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
2333 AC_MSG_RESULT([$ntp_ok])
2335 AC_MSG_CHECKING([NMEA GPS receiver])
2340 [+ NMEA GPS receiver]
2342 [ntp_ok=$enableval],
2348 AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
2351 AC_MSG_RESULT([$ntp_ok])
2353 AC_CHECK_FUNCS([strtoll])
2354 AC_MSG_CHECKING([for GPSD JSON receiver])
2359 [+ GPSD JSON receiver]
2361 [ntp_ok=$enableval],
2362 [case "$ac_cv_func_strtoll" in
2363 yes) ntp_ok=$ntp_eac ;;
2370 AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
2373 AC_MSG_RESULT([$ntp_ok])
2375 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2380 [s Motorola VP/UT Oncore GPS receiver]
2382 [ntp_ok=$enableval],
2385 case "$ntp_oncore_ok" in
2391 AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
2394 AC_MSG_RESULT([$ntp_ok])
2396 # Requires modem control
2397 AC_MSG_CHECKING([for Palisade clock])
2401 [--enable-PALISADE],
2404 [ntp_ok=$enableval],
2405 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2410 AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
2413 AC_MSG_RESULT([$ntp_ok])
2415 AC_MSG_CHECKING([Conrad parallel port radio clock])
2420 [+ Conrad parallel port radio clock]
2422 [ntp_ok=$enableval],
2428 AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
2431 AC_MSG_RESULT([$ntp_ok])
2433 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2438 [+ PST/Traconex 1020 WWV/WWVH receiver]
2440 [ntp_ok=$enableval],
2446 AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
2449 AC_MSG_RESULT([$ntp_ok])
2451 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2456 [- RIPENCC specific Trimble driver]
2458 [ntp_ok=$enableval],
2461 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2462 case "$ntp_ripe_ncc_ok" in
2468 AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
2471 AC_MSG_RESULT([$ntp_ok])
2473 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2474 # For *IX, we need sys/ipc.h and sys/shm.h.
2475 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2480 [s SHM clock attached thru shared memory]
2482 [ntp_ok=$enableval],
2484 case "$ntp_eac$ntp_canshm" in
2493 AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
2496 AC_MSG_RESULT([$ntp_ok])
2498 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2502 [--enable-SPECTRACOM],
2503 [+ Spectracom 8170/Netclock/2 WWVB receiver]
2505 [ntp_ok=$enableval],
2511 AC_DEFINE([CLOCK_SPECTRACOM], [1],
2512 [Spectracom 8170/Netclock/2 WWVB receiver])
2515 AC_MSG_RESULT([$ntp_ok])
2517 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2522 [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
2524 [ntp_ok=$enableval],
2526 case "$ac_cv_header_sys_tpro_h" in
2539 AC_DEFINE([CLOCK_TPRO], [1],
2540 [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2543 AC_MSG_RESULT([$ntp_ok])
2544 case "$ntp_ok$ac_cv_header_sys_tpro" in
2545 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2548 # Not on a vax-dec-bsd
2549 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2553 [--enable-TRUETIME],
2554 [s Kinemetrics/TrueTime receivers]
2556 [ntp_ok=$enableval],
2571 AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
2574 AC_MSG_RESULT([$ntp_ok])
2575 case "$ntp_ok$host" in
2576 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
2579 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2584 [- TrueTime 560 IRIG-B decoder]
2586 [ntp_ok=$enableval],
2592 AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
2595 AC_MSG_RESULT([$ntp_ok])
2597 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2602 [+ Ultralink WWVB receiver]
2604 [ntp_ok=$enableval],
2610 AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
2613 AC_MSG_RESULT([$ntp_ok])
2615 AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
2619 [--enable-TSYNCPCI],
2620 [s Spectracom TSYNC timing board]
2622 [ntp_ok=$enableval],
2636 AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
2639 AC_MSG_RESULT([$ntp_ok])
2641 AC_MSG_CHECKING([WWV receiver])
2646 [s WWV Audio receiver]
2648 [ntp_ok=$enableval],
2650 case "$ntp_eac$ntp_canaudio" in
2659 AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
2662 AC_MSG_RESULT([$ntp_ok])
2663 case "$ntp_ok$ntp_canaudio" in
2664 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2667 AC_MSG_CHECKING([for Zyfer receiver])
2672 [+ Zyfer GPStarplus receiver]
2674 [ntp_ok=$enableval],
2680 AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
2683 AC_MSG_RESULT([$ntp_ok])
2685 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2689 [--enable-parse-clocks],
2690 [- include all suitable PARSE clocks:]
2692 [ntp_eapc=$enableval],
2695 yes) ntp_eapc=$ntp_canparse ;;
2698 # Delete the next line one of these days
2702 AC_MSG_RESULT($ntp_eapc)
2704 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2706 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2709 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2717 AC_MSG_CHECKING([Diem Computime Radio Clock])
2721 [--enable-COMPUTIME],
2722 [s Diem Computime Radio Clock]
2724 [ntp_ok=$enableval],
2731 AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
2734 AC_MSG_RESULT([$ntp_ok])
2735 case "$ntp_ok$ntp_canparse" in
2737 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2740 AC_MSG_CHECKING([ELV/DCF7000 clock])
2745 [s ELV/DCF7000 clock]
2747 [ntp_ok=$enableval],
2754 AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
2757 AC_MSG_RESULT([$ntp_ok])
2758 case "$ntp_ok$ntp_canparse" in
2760 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2763 AC_MSG_CHECKING([HOPF 6021 clock])
2767 [--enable-HOPF6021],
2770 [ntp_ok=$enableval],
2777 AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
2780 AC_MSG_RESULT([$ntp_ok])
2781 case "$ntp_ok$ntp_canparse" in
2783 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2786 AC_MSG_CHECKING([Meinberg clocks])
2790 [--enable-MEINBERG],
2793 [ntp_ok=$enableval],
2800 AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
2803 AC_MSG_RESULT([$ntp_ok])
2804 case "$ntp_ok$ntp_canparse" in
2806 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2809 AC_MSG_CHECKING([DCF77 raw time code])
2814 [s DCF77 raw time code]
2816 [ntp_ok=$enableval],
2825 AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
2828 AC_MSG_RESULT([$ntp_ok])
2829 case "$ntp_ok$ntp_canparse" in
2831 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2834 case "$ntp_rawdcf" in
2836 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2837 [ntp_cv_rawdcf_parity],
2845 ntp_cv_rawdcf_parity=$ans
2848 case "$ntp_cv_rawdcf_parity" in
2850 AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
2851 [Should we not IGNPAR (Linux)?]) ;;
2855 AC_MSG_CHECKING([RCC 8000 clock])
2862 [ntp_ok=$enableval],
2869 AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
2872 AC_MSG_RESULT([$ntp_ok])
2873 case "$ntp_ok$ntp_canparse" in
2875 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2878 AC_MSG_CHECKING([Schmid DCF77 clock])
2883 [s Schmid DCF77 clock]
2885 [ntp_ok=$enableval],
2892 AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
2895 AC_MSG_RESULT([$ntp_ok])
2896 case "$ntp_ok$ntp_canparse" in
2898 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2901 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
2905 [--enable-TRIMTAIP],
2906 [s Trimble GPS receiver/TAIP protocol]
2908 [ntp_ok=$enableval],
2915 AC_DEFINE([CLOCK_TRIMTAIP], [1],
2916 [Trimble GPS receiver/TAIP protocol])
2919 AC_MSG_RESULT([$ntp_ok])
2920 case "$ntp_ok$ntp_canparse" in
2922 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2925 AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
2929 [--enable-TRIMTSIP],
2930 [s Trimble GPS receiver/TSIP protocol]
2932 [ntp_ok=$enableval],
2939 AC_DEFINE([CLOCK_TRIMTSIP], [1],
2940 [Trimble GPS receiver/TSIP protocol])
2943 AC_MSG_RESULT([$ntp_ok])
2944 case "$ntp_ok$ntp_canparse" in
2946 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2949 AC_MSG_CHECKING([WHARTON 400A Series clock])
2954 [s WHARTON 400A Series clock]
2956 [ntp_ok=$enableval],
2963 AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
2966 AC_MSG_RESULT([$ntp_ok])
2967 case "$ntp_ok$ntp_canparse" in
2969 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2972 AC_MSG_CHECKING([VARITEXT clock])
2976 [--enable-VARITEXT],
2979 [ntp_ok=$enableval],
2986 AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
2989 AC_MSG_RESULT([$ntp_ok])
2990 case "$ntp_ok$ntp_canparse" in
2992 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2995 AC_MSG_CHECKING(SEL240X clock)
2996 AC_ARG_ENABLE(SEL240X,
2997 AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
2998 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2999 if test "$ntp_ok" = "yes"; then
3002 AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
3004 AC_MSG_RESULT($ntp_ok)
3005 case "$ntp_ok$ntp_canparse" in
3007 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3011 AC_SUBST([LIBPARSE])
3012 AC_SUBST([MAKE_LIBPARSE])
3013 AC_SUBST([MAKE_LIBPARSE_KERNEL])
3014 AC_SUBST([MAKE_CHECK_Y2K])
3016 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3018 case "$ntp_libparse" in
3021 AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
3022 LIBPARSE=../libparse/libparse.a
3023 MAKE_LIBPARSE=libparse.a
3024 # HMS: check_y2k trips the 34 year problem now...
3025 false && MAKE_CHECK_Y2K=check_y2k
3027 AC_MSG_RESULT([$ans])
3033 # if we are using OpenSSL (--with-crypto), by default Autokey is enabled
3034 AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
3039 [+ support NTP Autokey protocol]
3041 [ntp_autokey=$enableval],
3042 [ntp_autokey=$ntp_openssl]
3044 case "$ntp_autokey" in
3048 case "$ntp_openssl" in
3050 AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
3054 AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
3060 AC_MSG_RESULT([$ntp_autokey])
3062 AC_SUBST([MAKE_CHECK_LAYOUT])
3063 AC_MSG_CHECKING([if we want to run check-layout])
3064 case "$cross_compiling$PATH_PERL" in
3066 MAKE_CHECK_LAYOUT=check-layout
3073 AC_MSG_RESULT([$ans])
3077 AC_MSG_CHECKING([if we can make dcf parse utilities])
3079 case "$ntp_parseutil" in
3082 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3089 AC_MSG_RESULT([$ans])
3091 AC_SUBST([MAKE_PARSEKMODULE])
3092 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3094 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3098 case "$ntp_cv_var_kernel_pll" in
3100 AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
3104 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3108 MAKE_PARSEKMODULE=parse
3109 AC_CHECK_HEADERS([strings.h])
3114 AC_MSG_RESULT([$ans])
3116 AC_MSG_CHECKING([if we need basic refclock support])
3117 case "$ntp_refclock" in
3119 AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
3122 AC_MSG_RESULT($ntp_refclock)
3124 dnl Things that can be made in clockstuff
3125 AC_SUBST([PROPDELAY], [propdelay])
3126 AC_SUBST([CHUTEST]) dnl needs work to compile
3128 AC_SUBST([MAKE_ADJTIMED])
3129 AC_MSG_CHECKING([if we want HP-UX adjtimed support])
3139 MAKE_ADJTIMED=adjtimed
3140 AC_DEFINE([NEED_HPUX_ADJTIME], [1],
3141 [Do we need HPUX adjtime() library support?])
3149 AC_MSG_RESULT([$ans])
3151 AC_MSG_CHECKING([if we want QNX adjtime support])
3161 AC_DEFINE([NEED_QNX_ADJTIME], [1],
3162 [Do we need the qnx adjtime call?])
3165 AC_MSG_RESULT([$ans])
3167 AC_MSG_CHECKING([if we can read kmem])
3169 # the default is to enable it if the system has the capability
3171 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3180 *-*-domainos) # Won't be found...
3200 # --enable-kmem / --disable-kmem controls if present
3205 [s read /dev/kmem for tick and/or tickadj]
3210 AC_MSG_RESULT([$ans])
3218 AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
3222 AC_MSG_CHECKING([if adjtime is accurate])
3224 # target-dependent defaults
3233 mips-sgi-irix[[456]]*)
3240 # XXX only verified thru AIX6.
3246 *-*-solaris2.[[01]])
3259 # --enable-accurate-adjtime / --disable-accurate-adjtime
3260 # override the default
3264 [--enable-accurate-adjtime],
3265 [s the adjtime() call is accurate]
3270 AC_MSG_RESULT([$ans])
3274 AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
3275 adjtime_is_accurate=yes
3278 adjtime_is_accurate=no
3283 [the name of 'tick' in the kernel],
3284 [ntp_cv_nlist_tick],
3288 m68*-hp-hpux*) # HP9000/300?
3298 # XXX only verified thru AIX6.
3317 ntp_cv_nlist_tick=$ans
3320 case "$ntp_cv_nlist_tick" in
3322 ;; # HMS: I think we can only get 'no' here...
3324 AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
3325 [What is the name of TICK in the kernel?])
3329 [for the units of 'tick'],
3338 ntp_cv_tick_nano=$ans
3341 case "$ntp_cv_tick_nano" in
3343 AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
3347 [the name of 'tickadj' in the kernel],
3348 [ntp_cv_nlist_tickadj],
3352 m68*-hp-hpux*) # HP9000/300?
3383 ans=no # hrestime_adj
3389 ntp_cv_nlist_tickadj=$ans
3392 case "$ntp_cv_nlist_tickadj" in
3394 ;; # HMS: I think we can only get 'no' here...
3396 AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
3397 [What is the name of TICKADJ in the kernel?])
3401 [for the units of 'tickadj'],
3402 [ntp_cv_tickadj_nano],
3410 ntp_cv_tickadj_nano=$ans
3413 case "$ntp_cv_tickadj_nano" in
3415 AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
3419 [half-heartedly for 'dosynctodr' in the kernel],
3420 [ntp_cv_nlist_dosynctodr],
3460 ntp_cv_nlist_dosynctodr=$ans
3463 case "$ntp_cv_nlist_dosynctodr" in
3467 AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
3468 [What is (probably) the name of DOSYNCTODR in the kernel?])
3473 [half-heartedly for 'noprintf' in the kernel],
3474 [ntp_cv_nlist_noprintf],
3508 ntp_cv_nlist_noprintf=$ans
3511 case "$ntp_cv_nlist_noprintf" in
3515 AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
3516 [What is (probably) the name of NOPRINTF in the kernel?])
3520 dnl The tick/tickadj sections were written by Skippy, who never learned
3521 dnl that it's impolite (horridly gross) to show your guts in public.
3524 dnl 10000 80 Unixware
3525 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3526 dnl 10000 150 sgi IRIX
3527 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3528 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3529 dnl 1000000L/hz 500/HZ other && NOKMEM
3530 dnl txc.tick 1 Linux
3531 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3532 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3533 dnl (RS6000 && !NOKMEM), SINIX MIPS
3535 dnl But we'll only use these "values" if we can't find anything else.
3537 AC_MSG_CHECKING([for a default value for 'tick'])
3539 # target-dependent default for tick
3543 AC_MSG_ERROR([tick needs work for cygwin])
3571 [--enable-tick=VALUE],
3572 [s force a value for 'tick']
3577 AC_MSG_RESULT([$ans])
3581 ;; # HMS: I think we can only get 'no' here...
3583 AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
3584 [Preset a value for 'tick'?])
3587 AC_MSG_CHECKING([for a default value for 'tickadj'])
3589 # target-specific default
3593 case "$adjtime_is_accurate" in
3608 *-*-domainos) # Skippy: won't be found...
3616 case "$adjtime_is_accurate" in
3642 [--enable-tickadj=VALUE],
3643 [s force a value for 'tickadj']
3648 AC_MSG_RESULT([$ans])
3650 default_tickadj=$ans
3652 case "$default_tickadj" in
3654 ;; # HMS: I think we can only get 'no' here...
3656 AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
3657 [Preset a value for 'tickadj'?]) ;;
3660 # Newer versions of ReliantUNIX round adjtime() values down to
3661 # 1/100s (system tick). Sigh ...
3662 # Unfortunately, there is no easy way to know if particular release
3663 # has this "feature" or any obvious way to test for it.
3666 AC_DEFINE([RELIANTUNIX_CLOCK], [1],
3667 [Do we want the ReliantUNIX clock hacks?])
3672 AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
3675 ntp_cv_make_tickadj=yes
3676 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3677 nonono) # Don't read KMEM, no presets. Bogus.
3678 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3679 ntp_cv_make_tickadj=no
3681 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3682 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3683 ntp_cv_make_tickadj=no
3685 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3686 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3687 ntp_cv_make_tickadj=no
3689 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3691 yesnono) # Read KMEM, no presets. Cool.
3693 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3694 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3696 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3698 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3700 *) # Generally bogus.
3701 AC_MSG_ERROR([This shouldn't happen.])
3705 AC_SUBST(MAKE_NTPTIME)
3706 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3708 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
3718 ac_cv_make_ntptime=$ans])
3719 case "$ac_cv_make_ntptime" in
3721 MAKE_NTPTIME=ntptime
3731 AC_SUBST([MAKE_TICKADJ])
3734 # tickadj is pretty useless on newer versions of ReliantUNIX
3736 ntp_cv_make_tickadj=no
3739 ntp_cv_make_tickadj=no
3742 # DLM says tickadj is a no-no starting with solaris2.5
3744 *-*-solaris2.1[[0-9]]*)
3745 ntp_cv_make_tickadj=no
3747 *-*-solaris2.[[0-4]]*) ;;
3748 *) ntp_cv_make_tickadj=no ;;
3752 ntp_cv_make_tickadj=no
3757 # Despite all the above, we always make tickadj. Setting
3758 # ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3759 # report that the configuration variable was cached. It may
3760 # be better to simply remove the hunk above, I did not want
3761 # to remove it if there is hope it will be used again.
3763 AS_UNSET([ntp_cv_make_tickadj])
3766 [if we want and can make the tickadj utility],
3767 [ntp_cv_make_tickadj],
3768 [ntp_cv_make_tickadj=yes]
3770 case "$ntp_cv_make_tickadj" in
3772 MAKE_TICKADJ=tickadj
3786 AC_SUBST([MAKE_TIMETRIM])
3788 [if we want and can make the timetrim utility],
3789 [ntp_cv_make_timetrim],
3793 ntp_cv_make_timetrim=yes
3796 ntp_cv_make_timetrim=yes
3799 ntp_cv_make_timetrim=no
3804 case "$ntp_cv_make_timetrim" in
3806 MAKE_TIMETRIM=timetrim
3815 AC_SUBST([MAKE_LIBNTPSIM])
3816 AC_SUBST([MAKE_NTPDSIM])
3818 AC_MSG_CHECKING([if we want to build the NTPD simulator])
3822 [--enable-simulator],
3823 [- build/install the NTPD simulator?]
3828 AC_MSG_RESULT([$ans])
3831 MAKE_NTPDSIM=ntpdsim
3832 MAKE_LIBNTPSIM=libntpsim.a
3847 LDFLAGS="$LDFLAGS -r"
3855 AC_MSG_CHECKING([if we want to build ntpsnmpd])
3860 [s Build ntpsnmpd MIB agent?]
3864 case "$PATH_NET_SNMP_CONFIG" in
3870 AC_MSG_RESULT([$ans])
3873 case "$PATH_NET_SNMP_CONFIG" in
3875 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
3876 AC_SUBST([SNMP_LIBS])
3877 # HMS: we really want to separate CPPFLAGS and CFLAGS
3878 foo=`$PATH_NET_SNMP_CONFIG --cflags`
3884 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
3886 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
3890 AC_SUBST([SNMP_CPPFLAGS])
3891 AC_SUBST([SNMP_CFLAGS])
3894 save_CPPFLAGS=$CPPFLAGS
3897 CPPFLAGS=$SNMP_CPPFLAGS
3900 [net-snmp/net-snmp-config.h],
3901 [MAKE_NTPSNMPD=ntpsnmpd],
3902 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
3905 # Do this last, as we're messing up LIBS.
3906 # check -lnetsnmp for netsnmp_daemonize
3907 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
3910 [netsnmp_daemonize],
3916 AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
3917 [We need to provide netsnmp_daemonize()])
3921 AS_UNSET([save_CFLAGS])
3922 CPPFLAGS=$save_CPPFLAGS
3923 AS_UNSET([save_CPPFLAGS])
3925 AS_UNSET([save_LIBS])
3928 AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
3933 AC_SUBST([MAKE_NTPSNMPD])
3935 case "$MAKE_NTPSNMPD" in
3944 AC_MSG_CHECKING([if we should always slew the time])
3946 # target-specific defaults
3958 *-*-openvms*) # HMS: won't be found
3965 # --enable-slew-always / --disable-slew-always overrides default
3970 [--enable-slew-always],
3971 [s always slew the time]
3976 AC_MSG_RESULT([$ans])
3980 AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
3983 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 should use the IRIG sawtooth filter])
4171 *-*-solaris2.[[89]])
4174 *-*-solaris2.1[[0-9]]*)
4184 [--enable-irig-sawtooth],
4185 [s if we should enable the IRIG sawtooth filter]
4190 AC_MSG_RESULT([$ans])
4194 AC_DEFINE([IRIG_SUCKS], [1],
4195 [Should we use the IRIG sawtooth filter?])
4198 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4203 [- if we should enable the NIST lockclock scheme]
4209 AC_MSG_RESULT([$ans])
4213 AC_DEFINE([LOCKCLOCK], [1],
4214 [Should we align with the NIST lockclock scheme?]) ;;
4217 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4221 [--enable-ntp-signd],
4222 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4228 AC_MSG_RESULT([$ans])
4235 ntp_signd_path=/var/run/ntp_signd
4238 ntp_signd_path="$ans"
4241 case "$ntp_signd_path" in
4245 AC_DEFINE([HAVE_NTP_SIGND], [1],
4246 [Do we want support for Samba's signing daemon?])
4247 AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
4248 [Path to sign daemon rendezvous socket])
4252 AC_CHECK_HEADERS([libscf.h])
4254 case "$ac_cv_header_libscf_h" in
4264 # Look for a sysctl call to get the list of network interfaces.
4267 [for interface list sysctl],
4268 [ntp_cv_iflist_sysctl],
4271 #include <sys/param.h>
4272 #include <sys/sysctl.h>
4273 #include <sys/socket.h>
4274 #ifndef NET_RT_IFLIST
4278 [ntp_cv_iflist_sysctl=yes],
4279 [ntp_cv_iflist_sysctl=no]
4282 case "$ntp_cv_iflist_sysctl" in
4284 AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
4289 AC_MSG_CHECKING([if we want the saveconfig mechanism])
4293 [--enable-saveconfig],
4294 [+ saveconfig mechanism]
4296 [ntp_ok=$enableval],
4299 ntp_saveconfig_enabled=0
4302 ntp_saveconfig_enabled=1
4303 AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
4306 AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
4307 AC_MSG_RESULT([$ntp_ok])
4309 dnl gtest is needed for our tests subdirs. It would be nice if we could
4310 dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
4311 dnl can't be conditionalized.
4316 AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
4317 [Default location of crypto key info])
4319 AC_CONFIG_FILES([Makefile])
4320 AC_CONFIG_FILES([adjtimed/Makefile])
4321 AC_CONFIG_FILES([clockstuff/Makefile])
4322 AC_CONFIG_FILES([include/Makefile])
4323 AC_CONFIG_FILES([include/isc/Makefile])
4324 AC_CONFIG_FILES([kernel/Makefile])
4325 AC_CONFIG_FILES([kernel/sys/Makefile])
4326 AC_CONFIG_FILES([libntp/Makefile])
4327 AC_CONFIG_FILES([libparse/Makefile])
4328 AC_CONFIG_FILES([ntpd/Makefile])
4329 AC_CONFIG_FILES([ntpd/complete.conf], [sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf])
4330 AC_CONFIG_FILES([ntpdate/Makefile])
4331 AC_CONFIG_FILES([ntpdc/Makefile])
4332 AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
4333 AC_CONFIG_FILES([ntpq/Makefile])
4334 AC_CONFIG_FILES([ntpsnmpd/Makefile])
4335 AC_CONFIG_FILES([parseutil/Makefile])
4336 AC_CONFIG_FILES([scripts/Makefile])
4337 AC_CONFIG_FILES([scripts/build/Makefile])
4338 AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
4339 AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
4340 AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
4341 AC_CONFIG_FILES([scripts/lib/Makefile])
4342 AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
4343 AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
4344 AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
4345 AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
4346 AC_CONFIG_FILES([scripts/ntptrace/Makefile])
4347 AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
4348 AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
4349 AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
4350 AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
4351 AC_CONFIG_FILES([scripts/update-leap/Makefile])
4352 AC_CONFIG_FILES([tests/Makefile])
4353 AC_CONFIG_FILES([tests/libntp/Makefile])
4354 AC_CONFIG_FILES([tests/ntpd/Makefile])
4355 AC_CONFIG_FILES([util/Makefile])
4357 perllibdir="${datadir}/ntp/lib"
4358 AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
4360 calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
4361 AC_SUBST_FILE([calc_tickadj_opts])
4362 ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
4363 AC_SUBST_FILE([ntp_wait_opts])
4364 ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
4365 AC_SUBST_FILE([ntpsweep_opts])
4366 ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
4367 AC_SUBST_FILE([ntptrace_opts])
4368 summary_opts="$srcdir/scripts/summary-opts"
4369 AC_SUBST_FILE([summary_opts])
4370 plot_summary_opts="$srcdir/scripts/plot_summary-opts"
4371 AC_SUBST_FILE([plot_summary_opts])
4373 AC_CONFIG_SUBDIRS([sntp])