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.15 foreign -Wall -Wno-gnu])
47 AM_SILENT_RULES([yes])
51 dnl the 'build' machine is where we run configure and compile
52 dnl the 'host' machine is where the resulting stuff runs.
53 AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
54 [canonical system (cpu-vendor-os) of where we should run])
55 AC_CONFIG_HEADERS([config.h])
58 ntp_atom_ok=${ntp_atom_ok=no}
59 ntp_oncore_ok=${ntp_oncore_ok=no}
60 ntp_parse_ok=${ntp_parse_ok=no}
61 ntp_ripe_ncc_ok=${ntp_parse_ok=no}
62 ntp_jupiter_ok=${ntp_jupiter_ok=no}
67 dnl # Do we need CXX for anything besides google test?
70 dnl AC_PROG_CC_C_O # called by NTP_COMPILER
75 NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
77 NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
79 dnl AM_PROG_AR req. automake 1.12
85 # So far, the only shared library we might use is libopts.
86 # It's a small library - we might as well use a static version of it.
89 AC_SUBST([LIBTOOL_DEPS])
91 # NTP has (so far) been relying on leading-edge autogen, which
92 # means we need the appropriate corresponding libopts as well.
93 # Therefore, by default:
94 # - use the version of libopts we ship with
96 # - build a static copy (AC_DISABLE_SHARED - done earlier)
97 case "${enable_local_libopts+set}" in
99 *) enable_local_libopts=yes ;;
101 case "${enable_libopts_install+set}" in
103 *) enable_libopts_install=no ;;
106 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
108 NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
112 AC_MSG_CHECKING([for deprecated --with-arlib])
114 AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
115 [ans=$withval], [ans=no])
116 AC_MSG_RESULT([$ans])
120 AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
124 dnl we need to check for cross compile tools for vxWorks here
126 AS_UNSET([ac_cv_prog_AWK])
127 AC_SUBST([AWK]) dnl scripts/ntpver.in
137 AC_PATH_PROG([PATH_PERL], [perl])
138 dnl Saving cached hardcoded paths rather than searching $PATH during a
139 dnl cached configure run is an optimization not worth the the cost of
140 dnl preventing newly-installed tools from being found. Short-circuit
141 dnl the caching after the tests so preset overrides still work.
142 AS_UNSET([ac_cv_path_PATH_PERL])
143 AC_PATH_PROG([PATH_TEST], [test])
144 AS_UNSET([ac_cv_path_PATH_TEST])
145 test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
146 AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
151 [--with-net-snmp-config],
166 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
171 PROG_NET_SNMP_CONFIG=$ans
172 case "$PROG_NET_SNMP_CONFIG" in
175 PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
178 AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
179 AS_UNSET([ac_cv_path_PATH_NET_SNMP_CONFIG])
182 AC_MSG_CHECKING([for net-snmp-config path])
183 AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
185 case "$PATH_NET_SNMP_CONFIG" in
187 [for net-snmp version],
188 [ntp_cv_net_snmp_version],
189 [ntp_cv_net_snmp_version=`$PATH_NET_SNMP_CONFIG --version`]
196 ac_link="$ac_link $VX_KERNEL"
200 # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
201 AC_SEARCH_LIBS([openlog], [gen syslog])
202 # XXX library list will be in ac_cv_search_openlog
204 # LIBSECCOMP is off by default -- needs testing with all the features
205 # Please send bug reports to loganaden@gmail.com
206 AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
210 [--enable-libseccomp],
211 [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
216 AC_MSG_RESULT([$ntp_ok])
222 [AC_DEFINE([LIBSECCOMP], [1],
223 [Define to any value to include libseccomp sandboxing.])]
229 #include <sys/prctl.h>
230 #include <linux/seccomp.h>
235 ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
247 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
261 , AC_DEFINE([KERN_SECCOMP], 1,
262 [Define to use libseccomp system call filtering.])
270 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
271 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
272 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
273 dnl does Strange Things with extra processes using the Posix-compatibility
274 dnl real-time library, so we don't want to use it.
276 dnl 081118 Harlan got tired of looking for a way to get the sched*()
277 dnl functions to link OK with either cc or gcc.
284 # HMS: Make sure we check for -lrt for clock_* before this...
285 case "$ac_cv_search_clock_gettime" in
286 '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
288 AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
292 AC_CHECK_HEADERS([bstring.h])
296 [DNSServiceRegister],
298 [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
299 [Use Rendezvous/DNS-SD registration])]
302 AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
304 AC_CHECK_HEADERS([memory.h netdb.h poll.h])
305 AC_CHECK_HEADERS([sgtty.h stdatomic.h])
307 AC_CHECK_HEADERS([stdlib.h string.h termio.h])
308 AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
312 AC_CHECK_HEADERS([utmpx.h])
313 case "$ac_cv_header_utmpx_h" in
317 AC_CHECK_HEADERS([utmp.h])
322 AC_CHECK_HEADERS([utmp.h utmpx.h])
327 # On Suns only (so far) getpass() truncates the typed password to 8
328 # characters, but getpassphrase() allows up to 257. Most systems'
329 # getpass() does not truncate, at least not so as to affect ntpq and
330 # ntpdc password prompts.
332 # So check for getpassphrase(), but only on Sun operating systems.
335 *-*-sunos*|*-*-solaris*)
336 AC_CHECK_FUNCS([getpassphrase])
340 AC_CHECK_HEADERS([net/if6.h])
341 AC_CHECK_HEADERS([net/route.h], [], [], [
342 #include <sys/types.h>
343 #include <sys/socket.h>
347 AC_CHECK_HEADERS([netinfo/ni.h])
348 case "$ac_cv_header_netinfo_ni_h" in
350 AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
352 AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
357 AC_CHECK_HEADERS([sys/ioctl.h])
360 AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
361 # HMS: Check sys/proc.h and sys/resource.h after some others
362 AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
363 case "$ac_cv_header_sched_h" in
367 AC_CHECK_HEADERS([sys/sched.h])
370 # HMS: Check sys/shm.h after some others
371 AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
372 # HMS: Checked sys/socket.h earlier
377 AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
380 AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
381 AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
382 AC_CHECK_FUNCS([waitpid])
385 AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
388 AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
392 case "$ac_cv_header_stdatomic_h" in
394 AC_CHECK_FUNCS([atomic_thread_fence])
396 [for atomic_thread_fence()],
397 [ntp_cv_func_atomic_thread_fence],
401 #include <stdatomic.h>
404 atomic_thread_fence(memory_order_seq_cst);
407 [ntp_cv_func_atomic_thread_fence=yes],
408 [ntp_cv_func_atomic_thread_fence=no]
419 AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
425 case "$ac_cv_func_ntp_gettime" in
429 AC_CHECK_FUNCS([__ntp_gettime])
430 case "$ac_cv_func___ntp_gettime" in
432 AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
433 AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
437 AC_CHECK_FUNCS([adjtimex])
438 case "$ac_cv_func_adjtimex" in
440 AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
441 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
445 AC_CHECK_FUNCS([__adjtimex])
446 case "$ac_cv_func___adjtimex" in
448 AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
449 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
450 AC_DEFINE([adjtimex], [__adjtimex], [deviant])
451 AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
457 case "$have_adjtimex" in
459 # nlist stuff is only needed for tickadj.
462 AC_SEARCH_LIBS([nlist], [elf ld mld])
463 # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
464 AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
465 # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
466 AC_CHECK_HEADERS([nlist.h sys/var.h])
467 case "$ac_cv_header_nlist_h" in
469 AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
471 [for n_un in struct nlist],
472 [ntp_cv_struct_nlist_n_un],
483 [ntp_cv_struct_nlist_n_un=yes],
484 [ntp_cv_struct_nlist_n_un=no]
487 case "$ntp_cv_struct_nlist_n_un" in
489 AC_DEFINE([NLIST_NAME_UNION], [1],
490 [does struct nlist use a name union?])
493 AC_SUBST([LDADD_NLIST])
496 AS_UNSET([saved_LIBS])
499 AC_CHECK_HEADERS([sys/proc.h], [], [], [
500 #ifdef HAVE_SYS_TYPES_H
501 # include <sys/types.h>
503 #ifdef HAVE_SYS_TIME_H
504 # include <sys/time.h>
508 AC_CHECK_HEADERS([sys/resource.h], [], [], [
509 #ifdef HAVE_SYS_TIME_H
510 # include <sys/time.h>
514 AC_CHECK_HEADERS([sys/shm.h], [], [], [
515 #ifdef HAVE_SYS_TYPES_H
516 # include <sys/types.h>
518 #ifdef HAVE_SYS_IPC_H
519 # include <sys/ipc.h>
523 AC_CHECK_HEADERS([sys/timex.h], [], [], [
524 #ifdef HAVE_SYS_TIME_H
525 # include <sys/time.h>
533 AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c
536 [for a fallback value for HZ],
539 ntp_cv_default_hz=100
541 alpha*-dec-osf4*|alpha*-dec-osf5*)
542 ntp_cv_default_hz=1024
545 ntp_cv_default_hz=256
550 AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
551 [What is the fallback value for HZ?])
554 [if we need to override the system's value for HZ],
555 [ntp_cv_override_hz],
557 ntp_cv_override_hz=no
559 alpha*-dec-osf4*|alpha*-dec-osf5*)
560 ntp_cv_override_hz=yes
563 ntp_cv_override_hz=yes
566 ntp_cv_override_hz=yes
569 ntp_cv_override_hz=yes
572 ntp_cv_override_hz=yes
577 case "$ntp_cv_override_hz" in
579 AC_DEFINE([OVERRIDE_HZ], [1],
580 [Do we need to override the system's idea of HZ?])
583 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
584 dnl [AC_TRY_LINK([#include <sys/types.h>
585 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
586 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
587 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
588 dnl AC_DEFINE(HAVE_UT_HOST)
591 dnl AC_MSG_CHECKING(if we can get the system boot time)
592 dnl AC_CACHE_VAL(su_cv_have_boot_time,
593 dnl [AC_EGREP_CPP(yes,
594 dnl [#ifdef HAVE_UTMPX_H
595 dnl #include <utmpx.h>
597 dnl #include <utmp.h>
602 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
603 dnl AC_MSG_RESULT($su_cv_have_boot_time)
606 [for struct rt_msghdr],
607 [ntp_cv_struct_rt_msghdr],
611 #include <sys/types.h>
612 #include <sys/socket.h>
614 #include <net/route.h>
620 [ntp_cv_struct_rt_msghdr=yes],
621 [ntp_cv_struct_rt_msghdr=no]
632 #include <sys/socket.h>
633 #include <linux/rtnetlink.h>
644 case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
646 AC_DEFINE([HAS_ROUTING_SOCKET], [1],
647 [Do we have a routing socket (rt_msghdr or rtattr)?])
648 case "$ntp_cv_rtattr" in
650 AC_DEFINE([HAVE_RTNETLINK], [1],
651 [Do we have Linux routing socket?])
656 [struct sigaction for sa_sigaction],
657 [ntp_cv_struct_sigaction_has_sa_sigaction],
664 struct sigaction act;
665 act.sa_sigaction = 0;
668 [ntp_cv_struct_sigaction_has_sa_sigaction=yes],
669 [ntp_cv_struct_sigaction_has_sa_sigaction=no]
672 case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
674 AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
678 [for struct ppsclockev],
679 [ntp_cv_struct_ppsclockev],
683 #ifdef HAVE_SYS_TYPES_H
684 # include <sys/types.h>
686 #ifdef HAVE_SYS_TERMIOS_H
687 # include <sys/termios.h>
689 #ifdef HAVE_SYS_TIME_H
690 # include <sys/time.h>
692 #ifdef HAVE_SYS_PPSCLOCK_H
693 # include <sys/ppsclock.h>
697 extern struct ppsclockev *pce;
701 [ntp_cv_struct_ppsclockev=yes],
702 [ntp_cv_struct_ppsclockev=no]
705 case "$ntp_cv_struct_ppsclockev" in
707 AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
708 [Does a system header define struct ppsclockev?])
711 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
714 [for struct snd_size],
715 [ntp_cv_struct_snd_size],
719 #ifdef HAVE_MACHINE_SOUNDCARD_H
720 # include <machine/soundcard.h>
722 #ifdef HAVE_SYS_SOUNDCARD_H
723 # include <sys/soundcard.h>
727 extern struct snd_size *ss;
731 [ntp_cv_struct_snd_size=yes],
732 [ntp_cv_struct_snd_size=no]
735 case "$ntp_cv_struct_snd_size" in
737 AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
738 [Do we have struct snd_size?])
743 [struct clockinfo for hz],
744 [ntp_cv_struct_clockinfo_has_hz],
748 #include <sys/time.h>
751 extern struct clockinfo *pc;
755 [ntp_cv_struct_clockinfo_has_hz=yes],
756 [ntp_cv_struct_clockinfo_has_hz=no]
759 case "$ntp_cv_struct_clockinfo_has_hz" in
761 AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
765 [struct clockinfo for tickadj],
766 [ntp_cv_struct_clockinfo_has_hz],
770 #include <sys/time.h>
773 extern struct clockinfo *pc;
777 [ntp_cv_struct_clockinfo_has_hz=yes],
778 [ntp_cv_struct_clockinfo_has_hz=no]
781 case "$ntp_cv_struct_clockinfo_has_hz" in
783 AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
786 case "$ntp_cv_struct_ntptimeval" in
789 [struct ntptimeval.time.tv_nsec],
793 #ifdef HAVE_SYS_TIME_H
794 # include <sys/time.h>
800 #ifdef HAVE_SYS_TIMEX_H
801 # include <sys/timex.h>
813 AC_CHECK_FUNCS([arc4random_buf])
818 LIBS="$LIBS $LDADD_LIBNTP"
819 AC_CHECK_FUNCS([daemon])
820 # XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
822 AS_UNSET([saved_LIBS])
831 AC_MSG_CHECKING([for isfinite with <math.h>])
849 AC_MSG_RESULT([$ans])
852 AC_DEFINE([HAVE_ISFINITE], [1])
858 AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
860 # kvm_open() is only used by tickadj. Also see above.
861 case "$ac_cv_header_kvm_h" in
863 AC_CHECK_FUNCS([kvm_open])
871 *) AC_CHECK_FUNCS([mkstemp])
874 AC_CHECK_FUNCS([mktime])
877 # XXX only verified thru AIX6.
881 # Just a stub in "old" Irix. Sigh.
883 # In the belief that the fix for bug 1223 fixes mlockall() under linux...
885 # # there, but more trouble than it is worth for now (resolver problems)
888 # Apparently there but not working in QNX. Sigh?
893 alpha*-dec-osf4*|alpha*-dec-osf5*)
894 # mlockall is there, as a #define calling memlk via <sys/mman.h>
895 # Not easy to test for - cheat.
896 AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
897 AC_CHECK_FUNCS([mlockall])
899 *) AC_CHECK_FUNCS([mlockall])
902 AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
905 # XXX only verified thru AIX6.
906 # Just a stub in AIX 4. Sigh.
909 # Just stubs in solaris2.5. Sigh.
911 *) AC_CHECK_FUNCS([sched_setscheduler])
914 AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
915 AC_CHECK_FUNCS([strdup strnlen memchr strerror setrlimit strchr])
918 # XXX only verified thru AIX6.
931 AC_CHECK_FUNCS([timer_create])
937 # some OSes prefer _exit() in forked children to exit()
938 AC_CHECK_FUNCS([_exit])
939 ntp_worker_child_exit=exit
940 case "$ac_cv_func__exit::$host_os" in
942 ntp_worker_child_exit=_exit
945 ntp_worker_child_exit=_exit
948 AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
949 [routine worker child proc uses to exit.])
951 AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
955 # http://bugs.ntp.org/737
956 case "$ac_cv_func_recvmsg" in
959 [if we need extra help to define struct iovec],
960 [ntp_cv_struct_iovec_help],
963 for ntp_cv_struct_iovec_help in '0' '1'; do
967 #ifdef HAVE_SYS_TYPES_H
968 # include <sys/types.h>
970 #ifdef HAVE_SYS_SOCKET_H
971 # include <sys/socket.h>
973 #if $ntp_cv_struct_iovec_help
974 # include <sys/uio.h>
986 x = recvmsg(s, &mh, flags);
990 [compiled=yes ; break 1],
996 ntp_cv_struct_iovec_help=0
1001 case "$ntp_cv_struct_iovec_help" in
1003 AC_DEFINE([HAVE_SYS_UIO_H], [1],
1004 [Use sys/uio.h for struct iovec help])
1009 [number of arguments taken by setpgrp()],
1010 [ntp_cv_func_setpgrp_nargs],
1014 #ifdef HAVE_SYS_TYPES_H
1015 # include <sys/types.h>
1017 #ifdef HAVE_UNISTD_H
1018 # include <unistd.h>
1025 [ntp_cv_func_setpgrp_nargs=2],
1026 [ntp_cv_func_setpgrp_nargs=0]
1029 case "$ntp_cv_func_setpgrp_nargs" in
1031 AC_DEFINE([HAVE_SETPGRP_0], [1],
1032 [define if setpgrp takes 0 arguments])
1036 [if we need to declare 'errno'],
1037 [ntp_cv_decl_errno],
1049 [ntp_cv_decl_errno=no],
1050 [ntp_cv_decl_errno=yes]
1053 case "$ntp_cv_decl_errno" in
1055 AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
1058 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1059 dnl MT purposes. This makes the line "extern int h_errno" choke
1060 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1061 dnl without breaking any other platforms.
1064 [if we may declare 'h_errno'],
1065 [ntp_cv_decl_h_errno],
1069 #include <sys/types.h>
1070 #ifdef HAVE_NETINET_IN_H
1071 # include <netinet/in.h>
1073 #ifdef HAVE_ARPA_NAMESER_H
1074 # include <arpa/nameser.h>
1079 #ifdef HAVE_RESOLV_H
1080 # include <resolv.h>
1087 [ntp_cv_decl_h_errno=yes],
1088 [ntp_cv_decl_h_errno=no]
1091 case "$ntp_cv_decl_h_errno" in
1093 AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
1097 [if declaring 'syscall()' is ok],
1098 [ntp_cv_decl_syscall],
1102 #ifdef HAVE_SYS_TYPES_H
1103 # include <sys/types.h>
1105 #ifdef HAVE_UNISTD_H
1106 # include <unistd.h>
1110 extern int syscall (int, ...);
1113 [ntp_cv_decl_syscall=yes],
1114 [ntp_cv_decl_syscall=no]
1117 case "$ntp_cv_decl_syscall" in
1119 AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
1124 AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
1127 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1128 AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
1129 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1130 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1131 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1132 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1133 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1136 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1137 AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
1140 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1143 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1144 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1145 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1146 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1147 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1148 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1149 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1150 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1151 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1152 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1153 AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1154 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1155 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1156 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1157 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1158 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1161 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1162 AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
1165 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1170 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1171 AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
1172 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1173 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1174 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1175 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1176 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1177 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1178 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1179 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1180 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1181 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1182 AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
1183 case "`basename $ac_cv_prog_CC`" in
1185 *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1188 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1189 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1190 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1191 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1192 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1193 AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
1194 AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
1197 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1198 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1199 AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
1200 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1201 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1202 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1203 AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
1204 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1205 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1206 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1207 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1208 AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
1209 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1210 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1216 AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
1217 [Do we need to #define _SVID3 when we #include <termios.h>?])
1223 AC_DEFINE([NEED_RCVBUF_SLOP], [1],
1224 [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
1227 dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
1229 [if we will open the broadcast socket],
1230 [ntp_cv_var_open_bcast_socket],
1237 ntp_cv_var_open_bcast_socket=$ans
1240 case "$ntp_cv_var_open_bcast_socket" in
1242 AC_DEFINE([OPEN_BCAST_SOCKET], [1],
1243 [Should we open the broadcast socket?])
1248 AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
1249 [Do we want the HPUX FindConfig()?])
1252 dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
1254 [if process groups are set with -pid],
1255 [ntp_cv_arg_setpgrp_negpid],
1277 ntp_cv_arg_setpgrp_negpid=$ans
1280 case "$ntp_cv_arg_setpgrp_negpid" in
1282 AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
1283 [Do we set process groups with -pid?])
1287 [if we need a ctty for F_SETOWN],
1288 [ntp_cv_func_ctty_for_f_setown],
1297 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1298 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1299 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1300 # in $host may be followed by "aout", "ecoff", or "elf".
1301 *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
1304 *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
1320 ntp_cv_func_ctty_for_f_setown=$ans
1323 case "$ntp_cv_func_ctty_for_f_setown" in
1325 AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
1329 [if the OS clears cached routes when more specifics become available],
1330 [ntp_cv_os_routeupdates],
1340 ntp_cv_os_routeupdates=$ans
1343 case "$ntp_cv_os_routeupdates" in
1345 AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
1346 [need to recreate sockets on changed routing?])
1350 [if the wildcard socket needs REUSEADDR to bind other addresses],
1351 [ntp_cv_os_wildcardreuse],
1360 ntp_cv_os_wildcardreuse=$ans
1363 case "$ntp_cv_os_wildcardreuse" in
1365 AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
1366 [wildcard socket needs REUSEADDR to bind interface addresses])
1371 AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
1372 [Might nlist() values require an extra level of indirection (AIX)?])
1376 [for a minimum recommended value of tickadj],
1377 [ntp_cv_var_min_rec_tickadj],
1385 ntp_cv_var_min_rec_tickadj=$ans
1388 case "$ntp_cv_var_min_rec_tickadj" in
1392 AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
1393 [Should we recommend a minimum value for tickadj?])
1397 [if the TTY code permits PARENB and IGNPAR],
1398 [ntp_cv_no_parenb_ignpar],
1408 i?86-*-freebsd[[123]].*)
1417 ntp_cv_no_parenb_ignpar=$ans
1420 case "$ntp_cv_no_parenb_ignpar" in
1422 AC_DEFINE([NO_PARENB_IGNPAR], [1],
1423 [Is there a problem using PARENB and IGNPAR?])
1426 AC_MSG_CHECKING([if we're including processing time debugging code])
1430 [--enable-debug-timing],
1431 [- include processing time debugging code (costs performance)]
1433 [ntp_ok=$enableval],
1438 AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
1440 AC_MSG_RESULT([$ntp_ok])
1442 AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
1446 [--enable-dst-minutes],
1447 [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
1452 AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
1453 [The number of minutes in a DST adjustment])
1454 AC_MSG_RESULT([$ans])
1456 AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
1458 [ignore-dns-errors],
1460 [--enable-ignore-dns-errors],
1461 [- retry DNS queries on any error]
1468 AC_DEFINE([IGNORE_DNS_ERRORS], [1],
1469 [Retry queries on _any_ DNS error?])
1471 AC_MSG_RESULT([$ans])
1474 [availability of ntp_{adj,get}time()],
1475 [ntp_cv_var_ntp_syscalls],
1477 ntp_cv_var_ntp_syscalls=no
1478 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1480 ntp_cv_var_ntp_syscalls=libc
1483 ntp_cv_var_ntp_syscalls=inline
1489 #include <sys/syscall.h>
1490 #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
1494 [ntp_cv_var_ntp_syscalls=kernel]
1500 case "$ntp_cv_var_ntp_syscalls" in
1502 AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
1503 [Do we have ntp_{adj,get}time in libc?])
1506 AC_DEFINE([NTP_SYSCALLS_STD], [1],
1507 [Do we have ntp_{adj,get}time in the kernel?])
1512 [if sys/timex.h has STA_FLL],
1513 [ntp_cv_var_sta_fll],
1517 #include <sys/timex.h>
1522 [ntp_cv_var_sta_fll=yes],
1523 [ntp_cv_var_sta_fll=no]
1528 [if we have kernel PLL support],
1529 [ntp_cv_var_kernel_pll],
1530 [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
1531 case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
1533 ntp_cv_var_kernel_pll=no
1535 *) ntp_cv_var_kernel_pll=yes
1540 case "$ntp_cv_var_kernel_pll" in
1542 AC_DEFINE([KERNEL_PLL], [1],
1543 [Does the kernel support precision time discipline?])
1547 [if SIOCGIFCONF returns buffer size in the buffer],
1548 [ntp_cv_size_returned_in_buffer],
1562 ntp_cv_size_returned_in_buffer=$ans
1565 case "$ntp_cv_size_returned_in_buffer" in
1567 AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
1568 [Does SIOCGIFCONF return size in the buffer?])
1571 # Check for ioctls TIOCGPPSEV
1572 AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
1573 case "$ac_cv_header_termios_h" in
1577 #include <termios.h>
1592 AC_DEFINE([HAVE_TIOCGPPSEV], [1],
1593 [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1595 AC_MSG_RESULT([$ntp_ok])
1597 # Check for ioctls TIOCSPPS
1598 AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
1599 case "$ac_cv_header_termios_h" in
1603 #include <termios.h>
1618 AC_DEFINE([HAVE_TIOCSPPS], [1],
1619 [Do we have the TIOCSPPS ioctl (Solaris)?])
1621 AC_MSG_RESULT([$ntp_ok])
1623 # Check for ioctls CIOGETEV
1624 AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
1625 case "$ac_cv_header_sys_ppsclock_h" in
1629 #include <sys/ppsclock.h>
1644 AC_DEFINE([HAVE_CIOGETEV], [1],
1645 [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1647 AC_MSG_RESULT([$ntp_ok])
1649 # ATOM/PPSAPI stuff.
1653 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1655 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1656 # The PPSAPI needs struct timespec.
1657 # The PPSAPI also needs a timepps header.
1659 case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
1661 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
1662 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
1663 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1673 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1674 AC_CHECK_HEADER([linux/serial.h])
1675 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1677 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
1680 #include <sys/time.h>
1682 #include <sys/ppsclock.h>
1683 #include <linux/serial.h>
1691 #ifndef ASYNC_PPS_CD_POS
1694 #ifndef ASYNC_PPS_CD_NEG
1704 AC_MSG_RESULT([$ntp_ok])
1712 AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
1713 [Do we have the TIO serial stuff?])
1716 # Check for SHMEM_STATUS support
1717 AC_MSG_CHECKING([SHMEM_STATUS support])
1718 case "$ac_cv_header_sys_mman_h" in
1728 AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
1729 [Do we have support for SHMEM_STATUS?])
1731 AC_MSG_RESULT([$ntp_ok])
1735 # HPUX only, and by explicit request
1736 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
1741 [- Datum/Bancomm bc635/VME interface]
1743 [ntp_ok=$enableval],
1749 AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
1750 AC_SEARCH_LIBS([bcStartPci], [bcsdk], , , [])
1753 AC_MSG_RESULT([$ntp_ok])
1754 case "$ntp_ok$host" in
1756 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1759 #HPUX only, and only by explicit request
1760 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
1765 [- TrueTime GPS receiver/VME interface]
1767 [ntp_ok=$enableval],
1773 AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
1776 AC_MSG_RESULT([$ntp_ok])
1777 case "$ntp_ok$host" in
1779 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1782 AC_MSG_CHECKING([for PCL720 clock support])
1783 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1785 AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
1792 AC_MSG_RESULT([$ans])
1794 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
1798 [--enable-all-clocks],
1799 [+ include all suitable non-PARSE clocks:]
1801 [ntp_eac=$enableval],
1804 AC_MSG_RESULT([$ntp_eac])
1806 # HMS: Should we also require ntp_parse_ok?
1807 AC_MSG_CHECKING([if we have support for PARSE clocks])
1808 case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1815 AC_MSG_RESULT([$ntp_canparse])
1817 AC_MSG_CHECKING([if we have support for audio clocks])
1818 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
1821 AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
1823 *) ntp_canaudio=no ;;
1825 AC_MSG_RESULT([$ntp_canaudio])
1827 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1828 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1834 AC_MSG_RESULT([$ntp_canshm])
1836 # Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
1838 [for termios modem control],
1839 [ntp_cv_modem_control],
1843 #ifdef HAVE_UNISTD_H
1844 # include <unistd.h>
1846 #ifdef HAVE_TERMIOS_H
1847 # include <termios.h>
1849 #ifdef HAVE_SYS_IOCTL_H
1850 # include <sys/ioctl.h>
1854 int dtr = TIOCM_DTR;
1856 ioctl(1, TIOCMBIS, (char *)&dtr);
1859 [ntp_cv_modem_control=yes],
1860 [ntp_cv_modem_control=no]
1863 case "$ntp_eac::$ntp_cv_modem_control" in
1865 ntp_enable_all_modem_control_clocks=yes
1868 ntp_enable_all_modem_control_clocks=no
1872 # Requires modem control
1873 AC_MSG_CHECKING([ACTS modem service])
1878 [s ACTS modem service]
1880 [ntp_ok=$enableval],
1881 [ntp_ok=$ntp_enable_all_modem_control_clocks]
1886 AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
1889 AC_MSG_RESULT([$ntp_ok])
1891 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
1896 [+ Arbiter 1088A/B GPS receiver]
1898 [ntp_ok=$enableval],
1904 AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
1907 AC_MSG_RESULT([$ntp_ok])
1909 AC_MSG_CHECKING([Arcron MSF receiver])
1913 [--enable-ARCRON-MSF],
1914 [+ Arcron MSF receiver]
1916 [ntp_ok=$enableval],
1922 AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
1925 AC_MSG_RESULT([$ntp_ok])
1927 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
1932 [+ Austron 2200A/2201A GPS receiver]
1934 [ntp_ok=$enableval],
1940 AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
1943 AC_MSG_RESULT([$ntp_ok])
1945 AC_MSG_CHECKING([ATOM PPS interface])
1950 [s ATOM PPS interface]
1952 [ntp_ok=$enableval],
1955 case "$ntp_atom_ok" in
1961 AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
1964 AC_MSG_RESULT([$ntp_ok])
1966 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
1970 [--enable-CHRONOLOG],
1971 [+ Chrono-log K-series WWVB receiver]
1973 [ntp_ok=$enableval],
1979 AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
1982 AC_MSG_RESULT([$ntp_ok])
1984 AC_MSG_CHECKING([CHU modem/decoder])
1989 [+ CHU modem/decoder]
1991 [ntp_ok=$enableval],
1997 AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
2000 AC_MSG_RESULT([$ntp_ok])
2001 ntp_refclock_chu=$ntp_ok
2003 AC_MSG_CHECKING([CHU audio/decoder])
2007 [--enable-AUDIO-CHU],
2008 [s CHU audio/decoder]
2010 [ntp_ok=$enableval],
2012 case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
2018 AC_MSG_RESULT([$ntp_ok])
2019 # We used to check for sunos/solaris target...
2020 case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
2021 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
2025 AC_MSG_CHECKING([Datum Programmable Time System])
2030 [s Datum Programmable Time System]
2032 [ntp_ok=$enableval],
2034 case "$ac_cv_header_termios_h" in
2046 AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
2049 AC_MSG_RESULT([$ntp_ok])
2051 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2055 [--enable-DUMBCLOCK],
2056 [+ Dumb generic hh:mm:ss local clock]
2058 [ntp_ok=$enableval],
2064 AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
2067 AC_MSG_RESULT([$ntp_ok])
2069 AC_MSG_CHECKING([Forum Graphic GPS])
2074 [+ Forum Graphic GPS]
2076 [ntp_ok=$enableval],
2082 AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
2085 AC_MSG_RESULT([$ntp_ok])
2087 # Requires modem control
2088 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2093 [s Heath GC-1000 WWV/WWVH receiver]
2095 [ntp_ok=$enableval],
2096 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2101 AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
2104 AC_MSG_RESULT([$ntp_ok])
2106 AC_MSG_CHECKING([for hopf serial clock device])
2110 [--enable-HOPFSERIAL],
2111 [+ hopf serial clock device]
2113 [ntp_ok=$enableval],
2119 AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
2122 AC_MSG_RESULT([$ntp_ok])
2124 AC_MSG_CHECKING([for hopf PCI clock 6039])
2129 [+ hopf 6039 PCI board]
2131 [ntp_ok=$enableval],
2137 AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
2140 AC_MSG_RESULT([$ntp_ok])
2142 AC_MSG_CHECKING([HP 58503A GPS receiver])
2147 [+ HP 58503A GPS receiver]
2149 [ntp_ok=$enableval],
2155 AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
2158 AC_MSG_RESULT([$ntp_ok])
2160 AC_MSG_CHECKING([IRIG audio decoder])
2165 [s IRIG audio decoder]
2167 [ntp_ok=$enableval],
2169 case "$ntp_eac$ntp_canaudio" in
2178 AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
2181 AC_MSG_RESULT([$ntp_ok])
2182 case "$ntp_ok$ntp_canaudio" in
2183 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2186 AC_MSG_CHECKING([for JJY receiver])
2193 [ntp_ok=$enableval],
2199 AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
2202 AC_MSG_RESULT([$ntp_ok])
2204 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2209 [s Rockwell Jupiter GPS receiver]
2211 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2212 case "$ntp_jupiter_ok" in
2218 AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
2221 AC_MSG_RESULT([$ntp_ok])
2223 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2228 [+ Leitch CSD 5300 Master Clock System Driver]
2230 [ntp_ok=$enableval],
2236 AC_DEFINE([CLOCK_LEITCH], [1],
2237 [Leitch CSD 5300 Master Clock System Driver?])
2240 AC_MSG_RESULT([$ntp_ok])
2242 AC_MSG_CHECKING([local clock reference])
2246 [--enable-LOCAL-CLOCK],
2247 [+ local clock reference]
2249 [ntp_ok=$enableval],
2255 AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
2258 AC_MSG_RESULT([$ntp_ok])
2260 dnl Bug 340: longstanding unfixed bugs
2261 dnl AC_MSG_CHECKING([EES M201 MSF receiver])
2262 dnl AC_ARG_ENABLE([MSFEES],
2263 dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
2264 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2265 dnl if test "$ntp_ok" = "yes"; then
2266 dnl ntp_refclock=yes
2267 dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
2269 dnl AC_MSG_RESULT([$ntp_ok])
2272 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2277 [s Magnavox MX4200 GPS receiver]
2279 [ntp_ok=$enableval],
2281 case "$ac_cv_var_ppsclock" in
2294 AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
2297 AC_MSG_RESULT([$ntp_ok])
2298 case "$ntp_ok$host" in
2299 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
2302 AC_MSG_CHECKING([for NeoClock4X receiver])
2306 [--enable-NEOCLOCK4X],
2307 [+ NeoClock4X DCF77 / TDF receiver]
2309 [ntp_ok=$enableval],
2315 AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
2318 AC_MSG_RESULT([$ntp_ok])
2320 AC_MSG_CHECKING([NMEA GPS receiver])
2325 [+ NMEA GPS receiver]
2327 [ntp_ok=$enableval],
2333 AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
2336 AC_MSG_RESULT([$ntp_ok])
2338 AC_CHECK_FUNCS([strtoll])
2339 AC_MSG_CHECKING([for GPSD JSON receiver])
2344 [+ GPSD JSON receiver]
2346 [ntp_ok=$enableval],
2347 [case "$ac_cv_func_strtoll" in
2348 yes) ntp_ok=$ntp_eac ;;
2355 AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
2358 AC_MSG_RESULT([$ntp_ok])
2360 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2365 [s Motorola VP/UT Oncore GPS receiver]
2367 [ntp_ok=$enableval],
2370 case "$ntp_oncore_ok" in
2376 AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
2379 AC_MSG_RESULT([$ntp_ok])
2381 # Requires modem control
2382 AC_MSG_CHECKING([for Palisade clock])
2386 [--enable-PALISADE],
2389 [ntp_ok=$enableval],
2390 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2395 AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
2398 AC_MSG_RESULT([$ntp_ok])
2400 AC_MSG_CHECKING([Conrad parallel port radio clock])
2405 [+ Conrad parallel port radio clock]
2407 [ntp_ok=$enableval],
2413 AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
2416 AC_MSG_RESULT([$ntp_ok])
2418 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2423 [+ PST/Traconex 1020 WWV/WWVH receiver]
2425 [ntp_ok=$enableval],
2431 AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
2434 AC_MSG_RESULT([$ntp_ok])
2436 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2441 [- RIPENCC specific Trimble driver]
2443 [ntp_ok=$enableval],
2446 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2447 case "$ntp_ripe_ncc_ok" in
2453 AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
2456 AC_MSG_RESULT([$ntp_ok])
2458 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2459 # For *IX, we need sys/ipc.h and sys/shm.h.
2460 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2465 [s SHM clock attached thru shared memory]
2467 [ntp_ok=$enableval],
2469 case "$ntp_eac$ntp_canshm" in
2478 AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
2481 AC_MSG_RESULT([$ntp_ok])
2483 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2487 [--enable-SPECTRACOM],
2488 [+ Spectracom 8170/Netclock/2 WWVB receiver]
2490 [ntp_ok=$enableval],
2496 AC_DEFINE([CLOCK_SPECTRACOM], [1],
2497 [Spectracom 8170/Netclock/2 WWVB receiver])
2500 AC_MSG_RESULT([$ntp_ok])
2502 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2507 [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
2509 [ntp_ok=$enableval],
2511 case "$ac_cv_header_sys_tpro_h" in
2524 AC_DEFINE([CLOCK_TPRO], [1],
2525 [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2528 AC_MSG_RESULT([$ntp_ok])
2529 case "$ntp_ok$ac_cv_header_sys_tpro" in
2530 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2533 # Not on a vax-dec-bsd
2534 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2538 [--enable-TRUETIME],
2539 [s Kinemetrics/TrueTime receivers]
2541 [ntp_ok=$enableval],
2556 AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
2559 AC_MSG_RESULT([$ntp_ok])
2560 case "$ntp_ok$host" in
2561 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
2564 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2569 [- TrueTime 560 IRIG-B decoder]
2571 [ntp_ok=$enableval],
2577 AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
2580 AC_MSG_RESULT([$ntp_ok])
2582 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2587 [+ Ultralink WWVB receiver]
2589 [ntp_ok=$enableval],
2595 AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
2598 AC_MSG_RESULT([$ntp_ok])
2600 AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
2604 [--enable-TSYNCPCI],
2605 [s Spectracom TSYNC timing board]
2607 [ntp_ok=$enableval],
2621 AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
2624 AC_MSG_RESULT([$ntp_ok])
2626 AC_MSG_CHECKING([WWV receiver])
2631 [s WWV Audio receiver]
2633 [ntp_ok=$enableval],
2635 case "$ntp_eac$ntp_canaudio" in
2644 AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
2647 AC_MSG_RESULT([$ntp_ok])
2648 case "$ntp_ok$ntp_canaudio" in
2649 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2652 AC_MSG_CHECKING([for Zyfer receiver])
2657 [+ Zyfer GPStarplus receiver]
2659 [ntp_ok=$enableval],
2665 AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
2668 AC_MSG_RESULT([$ntp_ok])
2670 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2674 [--enable-parse-clocks],
2675 [- include all suitable PARSE clocks:]
2677 [ntp_eapc=$enableval],
2680 yes) ntp_eapc=$ntp_canparse ;;
2683 # Delete the next line one of these days
2687 AC_MSG_RESULT($ntp_eapc)
2689 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2691 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2694 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2702 AC_MSG_CHECKING([Diem Computime Radio Clock])
2706 [--enable-COMPUTIME],
2707 [s Diem Computime Radio Clock]
2709 [ntp_ok=$enableval],
2716 AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
2719 AC_MSG_RESULT([$ntp_ok])
2720 case "$ntp_ok$ntp_canparse" in
2722 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2725 AC_MSG_CHECKING([ELV/DCF7000 clock])
2730 [s ELV/DCF7000 clock]
2732 [ntp_ok=$enableval],
2739 AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
2742 AC_MSG_RESULT([$ntp_ok])
2743 case "$ntp_ok$ntp_canparse" in
2745 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2748 AC_MSG_CHECKING([HOPF 6021 clock])
2752 [--enable-HOPF6021],
2755 [ntp_ok=$enableval],
2762 AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
2765 AC_MSG_RESULT([$ntp_ok])
2766 case "$ntp_ok$ntp_canparse" in
2768 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2771 AC_MSG_CHECKING([Meinberg clocks])
2775 [--enable-MEINBERG],
2778 [ntp_ok=$enableval],
2785 AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
2788 AC_MSG_RESULT([$ntp_ok])
2789 case "$ntp_ok$ntp_canparse" in
2791 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2794 AC_MSG_CHECKING([DCF77 raw time code])
2799 [s DCF77 raw time code]
2801 [ntp_ok=$enableval],
2810 AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
2813 AC_MSG_RESULT([$ntp_ok])
2814 case "$ntp_ok$ntp_canparse" in
2816 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2819 case "$ntp_rawdcf" in
2821 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2822 [ntp_cv_rawdcf_parity],
2830 ntp_cv_rawdcf_parity=$ans
2833 case "$ntp_cv_rawdcf_parity" in
2835 AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
2836 [Should we not IGNPAR (Linux)?]) ;;
2840 AC_MSG_CHECKING([RCC 8000 clock])
2847 [ntp_ok=$enableval],
2854 AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
2857 AC_MSG_RESULT([$ntp_ok])
2858 case "$ntp_ok$ntp_canparse" in
2860 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2863 AC_MSG_CHECKING([Schmid DCF77 clock])
2868 [s Schmid DCF77 clock]
2870 [ntp_ok=$enableval],
2877 AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
2880 AC_MSG_RESULT([$ntp_ok])
2881 case "$ntp_ok$ntp_canparse" in
2883 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2886 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
2890 [--enable-TRIMTAIP],
2891 [s Trimble GPS receiver/TAIP protocol]
2893 [ntp_ok=$enableval],
2900 AC_DEFINE([CLOCK_TRIMTAIP], [1],
2901 [Trimble GPS receiver/TAIP protocol])
2904 AC_MSG_RESULT([$ntp_ok])
2905 case "$ntp_ok$ntp_canparse" in
2907 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2910 AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
2914 [--enable-TRIMTSIP],
2915 [s Trimble GPS receiver/TSIP protocol]
2917 [ntp_ok=$enableval],
2924 AC_DEFINE([CLOCK_TRIMTSIP], [1],
2925 [Trimble GPS receiver/TSIP protocol])
2928 AC_MSG_RESULT([$ntp_ok])
2929 case "$ntp_ok$ntp_canparse" in
2931 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2934 AC_MSG_CHECKING([WHARTON 400A Series clock])
2939 [s WHARTON 400A Series clock]
2941 [ntp_ok=$enableval],
2948 AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
2951 AC_MSG_RESULT([$ntp_ok])
2952 case "$ntp_ok$ntp_canparse" in
2954 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2957 AC_MSG_CHECKING([VARITEXT clock])
2961 [--enable-VARITEXT],
2964 [ntp_ok=$enableval],
2971 AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
2974 AC_MSG_RESULT([$ntp_ok])
2975 case "$ntp_ok$ntp_canparse" in
2977 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2980 AC_MSG_CHECKING(SEL240X clock)
2981 AC_ARG_ENABLE(SEL240X,
2982 AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
2983 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2984 if test "$ntp_ok" = "yes"; then
2987 AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
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!)
2996 AC_SUBST([LIBPARSE])
2997 AC_SUBST([MAKE_LIBPARSE])
2998 AC_SUBST([MAKE_LIBPARSE_KERNEL])
2999 AC_SUBST([MAKE_CHECK_Y2K])
3001 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3003 case "$ntp_libparse" in
3006 AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
3007 LIBPARSE=../libparse/libparse.a
3008 MAKE_LIBPARSE=libparse.a
3009 # HMS: check_y2k trips the 34 year problem now...
3010 false && MAKE_CHECK_Y2K=check_y2k
3012 AC_MSG_RESULT([$ans])
3016 AC_MSG_CHECKING([if we want to enable CMAC support])
3017 case "$ac_cv_header_openssl_cmac_h" in
3019 AC_DEFINE([ENABLE_CMAC], [1], [Enable CMAC support?])
3025 AC_MSG_RESULT([$ans])
3029 # if we are using OpenSSL (--with-crypto), by default Autokey is enabled
3030 AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
3035 [+ support NTP Autokey protocol]
3037 [ntp_autokey=$enableval],
3038 [ntp_autokey=$ntp_openssl]
3040 case "$ntp_autokey" in
3044 case "$ntp_openssl" in
3046 AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
3050 AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
3056 AC_MSG_RESULT([$ntp_autokey])
3058 AC_SUBST([MAKE_CHECK_LAYOUT])
3059 AC_MSG_CHECKING([if we want to run check-layout])
3060 case "$cross_compiling$PATH_PERL" in
3062 MAKE_CHECK_LAYOUT=check-layout
3069 AC_MSG_RESULT([$ans])
3073 AC_MSG_CHECKING([if we can make dcf parse utilities])
3075 case "$ntp_parseutil" in
3078 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3085 AC_MSG_RESULT([$ans])
3087 AC_SUBST([MAKE_PARSEKMODULE])
3088 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3090 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3094 case "$ntp_cv_var_kernel_pll" in
3096 AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
3100 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3104 MAKE_PARSEKMODULE=parse
3105 AC_CHECK_HEADERS([strings.h])
3110 AC_MSG_RESULT([$ans])
3112 AC_MSG_CHECKING([if we need basic refclock support])
3113 case "$ntp_refclock" in
3115 AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
3118 AC_MSG_RESULT($ntp_refclock)
3120 dnl Things that can be made in clockstuff
3121 AC_SUBST([PROPDELAY], [propdelay])
3122 AC_SUBST([CHUTEST]) dnl needs work to compile
3124 AC_SUBST([MAKE_ADJTIMED])
3125 AC_MSG_CHECKING([if we want HP-UX adjtimed support])
3135 MAKE_ADJTIMED=adjtimed
3136 AC_DEFINE([NEED_HPUX_ADJTIME], [1],
3137 [Do we need HPUX adjtime() library support?])
3145 AC_MSG_RESULT([$ans])
3147 AC_MSG_CHECKING([if we want QNX adjtime support])
3157 AC_DEFINE([NEED_QNX_ADJTIME], [1],
3158 [Do we need the qnx adjtime call?])
3161 AC_MSG_RESULT([$ans])
3163 AC_MSG_CHECKING([if we can read kmem])
3165 # the default is to enable it if the system has the capability
3167 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3176 *-*-domainos) # Won't be found...
3196 # --enable-kmem / --disable-kmem controls if present
3201 [s read /dev/kmem for tick and/or tickadj]
3206 AC_MSG_RESULT([$ans])
3214 AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
3218 AC_MSG_CHECKING([if adjtime is accurate])
3220 # target-dependent defaults
3229 mips-sgi-irix[[456]]*)
3236 # XXX only verified thru AIX6.
3242 *-*-solaris2.[[01]])
3255 # --enable-accurate-adjtime / --disable-accurate-adjtime
3256 # override the default
3260 [--enable-accurate-adjtime],
3261 [s the adjtime() call is accurate]
3266 AC_MSG_RESULT([$ans])
3270 AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
3271 adjtime_is_accurate=yes
3274 adjtime_is_accurate=no
3279 [the name of 'tick' in the kernel],
3280 [ntp_cv_nlist_tick],
3284 m68*-hp-hpux*) # HP9000/300?
3294 # XXX only verified thru AIX6.
3313 ntp_cv_nlist_tick=$ans
3316 case "$ntp_cv_nlist_tick" in
3318 ;; # HMS: I think we can only get 'no' here...
3320 AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
3321 [What is the name of TICK in the kernel?])
3325 [for the units of 'tick'],
3334 ntp_cv_tick_nano=$ans
3337 case "$ntp_cv_tick_nano" in
3339 AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
3343 [the name of 'tickadj' in the kernel],
3344 [ntp_cv_nlist_tickadj],
3348 m68*-hp-hpux*) # HP9000/300?
3379 ans=no # hrestime_adj
3385 ntp_cv_nlist_tickadj=$ans
3388 case "$ntp_cv_nlist_tickadj" in
3390 ;; # HMS: I think we can only get 'no' here...
3392 AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
3393 [What is the name of TICKADJ in the kernel?])
3397 [for the units of 'tickadj'],
3398 [ntp_cv_tickadj_nano],
3406 ntp_cv_tickadj_nano=$ans
3409 case "$ntp_cv_tickadj_nano" in
3411 AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
3415 [half-heartedly for 'dosynctodr' in the kernel],
3416 [ntp_cv_nlist_dosynctodr],
3459 ntp_cv_nlist_dosynctodr=$ans
3462 case "$ntp_cv_nlist_dosynctodr" in
3466 AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
3467 [What is (probably) the name of DOSYNCTODR in the kernel?])
3472 [half-heartedly for 'noprintf' in the kernel],
3473 [ntp_cv_nlist_noprintf],
3510 ntp_cv_nlist_noprintf=$ans
3513 case "$ntp_cv_nlist_noprintf" in
3517 AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
3518 [What is (probably) the name of NOPRINTF in the kernel?])
3522 dnl The tick/tickadj sections were written by Skippy, who never learned
3523 dnl that it's impolite (horridly gross) to show your guts in public.
3526 dnl 10000 80 Unixware
3527 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3528 dnl 10000 150 sgi IRIX
3529 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3530 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3531 dnl 1000000L/hz 500/HZ other && NOKMEM
3532 dnl txc.tick 1 Linux
3533 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3534 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3535 dnl (RS6000 && !NOKMEM), SINIX MIPS
3537 dnl But we'll only use these "values" if we can't find anything else.
3539 AC_MSG_CHECKING([for a default value for 'tick'])
3541 # target-dependent default for tick
3545 AC_MSG_ERROR([tick needs work for cygwin])
3573 [--enable-tick=VALUE],
3574 [s force a value for 'tick']
3579 AC_MSG_RESULT([$ans])
3583 ;; # HMS: I think we can only get 'no' here...
3585 AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
3586 [Preset a value for 'tick'?])
3589 AC_MSG_CHECKING([for a default value for 'tickadj'])
3591 # target-specific default
3595 case "$adjtime_is_accurate" in
3610 *-*-domainos) # Skippy: won't be found...
3618 case "$adjtime_is_accurate" in
3644 [--enable-tickadj=VALUE],
3645 [s force a value for 'tickadj']
3650 AC_MSG_RESULT([$ans])
3652 default_tickadj=$ans
3654 case "$default_tickadj" in
3656 ;; # HMS: I think we can only get 'no' here...
3658 AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
3659 [Preset a value for 'tickadj'?]) ;;
3662 # Newer versions of ReliantUNIX round adjtime() values down to
3663 # 1/100s (system tick). Sigh ...
3664 # Unfortunately, there is no easy way to know if particular release
3665 # has this "feature" or any obvious way to test for it.
3668 AC_DEFINE([RELIANTUNIX_CLOCK], [1],
3669 [Do we want the ReliantUNIX clock hacks?])
3674 AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
3677 ntp_cv_make_tickadj=yes
3678 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3679 nonono) # Don't read KMEM, no presets. Bogus.
3680 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3681 ntp_cv_make_tickadj=no
3683 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3684 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3685 ntp_cv_make_tickadj=no
3687 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3688 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3689 ntp_cv_make_tickadj=no
3691 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3693 yesnono) # Read KMEM, no presets. Cool.
3695 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3696 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3698 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3700 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3702 *) # Generally bogus.
3703 AC_MSG_ERROR([This shouldn't happen.])
3707 AC_SUBST(MAKE_NTPTIME)
3708 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3710 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
3720 ac_cv_make_ntptime=$ans])
3721 case "$ac_cv_make_ntptime" in
3723 MAKE_NTPTIME=ntptime
3733 AC_SUBST([MAKE_TICKADJ])
3736 # tickadj is pretty useless on newer versions of ReliantUNIX
3738 ntp_cv_make_tickadj=no
3741 ntp_cv_make_tickadj=no
3744 # DLM says tickadj is a no-no starting with solaris2.5
3746 *-*-solaris2.1[[0-9]]*)
3747 ntp_cv_make_tickadj=no
3749 *-*-solaris2.[[0-4]]*) ;;
3750 *) ntp_cv_make_tickadj=no ;;
3754 ntp_cv_make_tickadj=no
3759 # Despite all the above, we always make tickadj. Setting
3760 # ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3761 # report that the configuration variable was cached. It may
3762 # be better to simply remove the hunk above, I did not want
3763 # to remove it if there is hope it will be used again.
3765 AS_UNSET([ntp_cv_make_tickadj])
3768 [if we want and can make the tickadj utility],
3769 [ntp_cv_make_tickadj],
3770 [ntp_cv_make_tickadj=yes]
3772 case "$ntp_cv_make_tickadj" in
3774 MAKE_TICKADJ=tickadj
3788 AC_SUBST([MAKE_TIMETRIM])
3790 [if we want and can make the timetrim utility],
3791 [ntp_cv_make_timetrim],
3795 ntp_cv_make_timetrim=yes
3798 ntp_cv_make_timetrim=yes
3801 ntp_cv_make_timetrim=no
3806 case "$ntp_cv_make_timetrim" in
3808 MAKE_TIMETRIM=timetrim
3817 AC_SUBST([MAKE_LIBNTPSIM])
3818 AC_SUBST([MAKE_NTPDSIM])
3820 AC_MSG_CHECKING([if we want to build the NTPD simulator])
3824 [--enable-simulator],
3825 [- build/install the NTPD simulator?]
3830 AC_MSG_RESULT([$ans])
3833 MAKE_NTPDSIM=ntpdsim
3834 MAKE_LIBNTPSIM=libntpsim.a
3849 LDFLAGS="$LDFLAGS -r"
3857 AC_MSG_CHECKING([if we want to build ntpsnmpd])
3862 [s Build ntpsnmpd MIB agent?]
3866 case "$PATH_NET_SNMP_CONFIG" in
3872 AC_MSG_RESULT([$ans])
3875 case "$PATH_NET_SNMP_CONFIG" in
3877 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
3878 # Bug 2815. This is a bit of a hack, but it works...
3879 case "$ntp_cv_net_snmp_version" in
3880 5.3*) SNMP_LIBS=`echo $SNMP_LIBS | $SED -e 's/-lnetsnmpagent/-lnetsnmpagent -lnetsnmpmibs/'`
3883 AC_SUBST([SNMP_LIBS])
3884 # HMS: we really want to separate CPPFLAGS and CFLAGS
3885 foo=`$PATH_NET_SNMP_CONFIG --cflags`
3891 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
3893 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
3897 AC_SUBST([SNMP_CPPFLAGS])
3898 AC_SUBST([SNMP_CFLAGS])
3901 save_CPPFLAGS=$CPPFLAGS
3904 CPPFLAGS=$SNMP_CPPFLAGS
3907 [net-snmp/net-snmp-config.h],
3908 [MAKE_NTPSNMPD=ntpsnmpd],
3909 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
3912 # Do this last, as we're messing up LIBS.
3913 # check -lnetsnmp for netsnmp_daemonize
3914 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
3917 [netsnmp_daemonize],
3923 AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
3924 [We need to provide netsnmp_daemonize()])
3928 AS_UNSET([save_CFLAGS])
3929 CPPFLAGS=$save_CPPFLAGS
3930 AS_UNSET([save_CPPFLAGS])
3932 AS_UNSET([save_LIBS])
3935 AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
3940 AC_SUBST([MAKE_NTPSNMPD])
3942 case "$MAKE_NTPSNMPD" in
3951 AC_MSG_CHECKING([if we should always slew the time])
3953 # target-specific defaults
3965 *-*-openvms*) # HMS: won't be found
3972 # --enable-slew-always / --disable-slew-always overrides default
3977 [--enable-slew-always],
3978 [s always slew the time]
3983 AC_MSG_RESULT([$ans])
3987 AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
3990 AC_MSG_CHECKING([if we should step and slew the time])
4005 *-*-solaris2.1[[0-9]]*)
4008 *-*-solaris2.[[012]]*)
4011 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
4021 [--enable-step-slew],
4022 [s step and slew the time]
4027 AC_MSG_RESULT([$ans])
4031 AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
4034 AC_MSG_CHECKING([if ntpdate should step the time])
4047 [--enable-ntpdate-step],
4048 [s if ntpdate should step the time]
4053 AC_MSG_RESULT([$ans])
4057 AC_DEFINE([FORCE_NTPDATE_STEP], [1],
4058 [force ntpdate to step the clock if !defined(STEP_SLEW) ?])
4062 AC_MSG_CHECKING([if we should sync TODR clock every hour])
4068 *-*-openvms*) # HMS: won't be found
4079 [--enable-hourly-todr-sync],
4080 [s if we should sync TODR hourly]
4085 AC_MSG_RESULT([$ans])
4087 case "$ac_cv_var_sync_todr" in
4089 AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
4093 AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4106 # Generic_105181-17 and higher
4127 # Generic_106541-07 and higher
4146 [--enable-kernel-fll-bug],
4147 [s if we should avoid a kernel FLL bug]
4152 AC_MSG_RESULT([$ans])
4156 AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
4160 AC_MSG_CHECKING([if we want new session key behavior])
4164 [--enable-bug1243-fix],
4165 [+ use unmodified autokey session keys]
4170 AC_MSG_RESULT([$ans])
4173 AC_DEFINE([DISABLE_BUG1243_FIX], [1],
4174 [use old autokey session key behavior?])
4178 AC_MSG_CHECKING([if we want the explicit 127.0.0.0/8 martian filter])
4182 [--enable-bug3020-fix],
4183 [+ Provide the explicit 127.0.0.0/8 martian filter]
4188 AC_MSG_RESULT([$ans])
4191 AC_DEFINE([ENABLE_BUG3020_FIX], [1],
4192 [Provide the explicit 127.0.0.0/8 martian filter?])
4196 AC_MSG_CHECKING([if we want correct mode7 fudgetime2 behavior])
4200 [--enable-bug3527-fix],
4201 [+ provide correct mode7 fudgetime2 behavior]
4206 AC_MSG_RESULT([$ans])
4209 AC_DEFINE([DISABLE_BUG3527_FIX], [1],
4210 [use old autokey session key behavior?])
4214 AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
4217 *-*-solaris2.[[89]])
4220 *-*-solaris2.1[[0-9]]*)
4230 [--enable-irig-sawtooth],
4231 [s if we should enable the IRIG sawtooth filter]
4236 AC_MSG_RESULT([$ans])
4240 AC_DEFINE([IRIG_SUCKS], [1],
4241 [Should we use the IRIG sawtooth filter?])
4244 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4249 [- if we should enable the NIST lockclock scheme]
4255 AC_MSG_RESULT([$ans])
4259 AC_DEFINE([LOCKCLOCK], [1],
4260 [Should we align with the NIST lockclock scheme?]) ;;
4263 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4267 [--enable-ntp-signd],
4268 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4274 AC_MSG_RESULT([$ans])
4281 ntp_signd_path=/var/run/ntp_signd
4284 ntp_signd_path="$ans"
4287 case "$ntp_signd_path" in
4291 AC_DEFINE([HAVE_NTP_SIGND], [1],
4292 [Do we want support for Samba's signing daemon?])
4293 AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
4294 [Path to sign daemon rendezvous socket])
4298 AC_CHECK_HEADERS([libscf.h])
4300 case "$ac_cv_header_libscf_h" in
4310 # Look for a sysctl call to get the list of network interfaces.
4313 [for interface list sysctl],
4314 [ntp_cv_iflist_sysctl],
4317 #include <sys/param.h>
4318 #include <sys/sysctl.h>
4319 #include <sys/socket.h>
4320 #ifndef NET_RT_IFLIST
4324 [ntp_cv_iflist_sysctl=yes],
4325 [ntp_cv_iflist_sysctl=no]
4328 case "$ntp_cv_iflist_sysctl" in
4330 AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
4335 AC_MSG_CHECKING([if we want the saveconfig mechanism])
4339 [--enable-saveconfig],
4340 [+ saveconfig mechanism]
4342 [ntp_ok=$enableval],
4345 ntp_saveconfig_enabled=0
4348 ntp_saveconfig_enabled=1
4349 AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
4352 AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
4353 AC_MSG_RESULT([$ntp_ok])
4357 AC_MSG_CHECKING([if we want the experimental leap smear code])
4361 [--enable-leap-smear],
4362 [- experimental leap smear code]
4364 [ntp_ok=$enableval],
4367 ntp_leap_smear_enabled=0
4370 ntp_leap_smear_enabled=1
4371 AC_DEFINE([LEAP_SMEAR], [1], [leap smear mechanism])
4372 AC_SUBST([HAVE_LEAPSMEARINTERVAL])
4373 HAVE_LEAPSMEARINTERVAL="leapsmearinterval 0"
4376 AC_MSG_RESULT([$ntp_ok])
4380 AC_MSG_CHECKING([if we want dynamic interleave support])
4382 [dynamic-interleave],
4384 [--enable-dynamic-interleave],
4385 [- dynamic interleave support]
4387 [ntp_ok=$enableval],
4390 ntp_dynamic_interleave=0
4393 ntp_dynamic_interleave=1
4396 AC_DEFINE_UNQUOTED([DYNAMIC_INTERLEAVE], [$ntp_dynamic_interleave],
4397 [support dynamic interleave?])
4398 AC_MSG_RESULT([$ntp_ok])
4402 dnl gtest is needed for our tests subdirs. It would be nice if we could
4403 dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
4404 dnl can't be conditionalized.
4411 AC_CHECK_DECLS([sigsetjmp,siglongjmp], [], [], [[#include <setjmp.h>]])
4415 AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
4416 [Default location of crypto key info])
4418 AC_CONFIG_FILES([Makefile])
4419 AC_CONFIG_FILES([adjtimed/Makefile])
4420 AC_CONFIG_FILES([clockstuff/Makefile])
4421 AC_CONFIG_FILES([include/Makefile])
4422 AC_CONFIG_FILES([include/isc/Makefile])
4423 AC_CONFIG_FILES([kernel/Makefile])
4424 AC_CONFIG_FILES([kernel/sys/Makefile])
4425 AC_CONFIG_FILES([libntp/Makefile])
4426 AC_CONFIG_FILES([libparse/Makefile])
4427 AC_CONFIG_FILES([ntpd/Makefile])
4428 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])
4429 AC_CONFIG_FILES([ntpdate/Makefile])
4430 AC_CONFIG_FILES([ntpdc/Makefile])
4431 AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
4432 AC_CONFIG_FILES([ntpq/Makefile])
4433 AC_CONFIG_FILES([ntpsnmpd/Makefile])
4434 AC_CONFIG_FILES([parseutil/Makefile])
4435 AC_CONFIG_FILES([scripts/Makefile])
4436 AC_CONFIG_FILES([scripts/build/Makefile])
4437 AC_CONFIG_FILES([scripts/build/genAuthors], [chmod +x scripts/build/genAuthors])
4438 AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
4439 AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
4440 AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
4441 AC_CONFIG_FILES([scripts/lib/Makefile])
4442 AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
4443 AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
4444 AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
4445 AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
4446 AC_CONFIG_FILES([scripts/ntptrace/Makefile])
4447 AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
4448 AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
4449 AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
4450 AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
4451 AC_CONFIG_FILES([scripts/update-leap/Makefile])
4452 AC_CONFIG_FILES([scripts/update-leap/update-leap], [chmod +x scripts/update-leap/update-leap])
4453 AC_CONFIG_FILES([tests/Makefile])
4454 AC_CONFIG_FILES([tests/bug-2803/Makefile])
4455 AC_CONFIG_FILES([tests/libntp/Makefile])
4456 AC_CONFIG_FILES([tests/ntpd/Makefile])
4457 AC_CONFIG_FILES([tests/ntpq/Makefile])
4458 AC_CONFIG_FILES([tests/sandbox/Makefile])
4459 AC_CONFIG_FILES([tests/sec-2853/Makefile])
4460 AC_CONFIG_FILES([util/Makefile])
4462 perllibdir="${datadir}/ntp/lib"
4463 AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
4465 calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
4466 AC_SUBST_FILE([calc_tickadj_opts])
4467 ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
4468 AC_SUBST_FILE([ntp_wait_opts])
4469 ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
4470 AC_SUBST_FILE([ntpsweep_opts])
4471 ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
4472 AC_SUBST_FILE([ntptrace_opts])
4473 summary_opts="$srcdir/scripts/summary-opts"
4474 AC_SUBST_FILE([summary_opts])
4475 plot_summary_opts="$srcdir/scripts/plot_summary-opts"
4476 AC_SUBST_FILE([plot_summary_opts])
4478 AC_CONFIG_SUBDIRS([sntp])