1 dnl NTP top-level configure.ac -*- Autoconf -*-
3 m4_include([sntp/m4/version.m4])
8 [https://bugs.ntp.org/],
10 [https://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=20230326
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 subdir-objects -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}
68 dnl AC_PROG_CC_C_O # called by NTP_COMPILER
73 NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
75 NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
79 # So far, the only shared library we might use is libopts.
80 # It's a small library - we might as well use a static version of it.
83 AC_SUBST([LIBTOOL_DEPS])
85 # NTP has (so far) been relying on leading-edge autogen, which
86 # means we need the appropriate corresponding libopts as well.
87 # Therefore, by default:
88 # - use the version of libopts we ship with
90 # - build a static copy (AC_DISABLE_SHARED - done earlier)
91 case "${enable_local_libopts+set}" in
93 *) enable_local_libopts=yes ;;
95 case "${enable_libopts_install+set}" in
97 *) enable_libopts_install=no ;;
100 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
102 NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
106 AC_MSG_CHECKING([for deprecated --with-arlib])
108 AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
109 [ans=$withval], [ans=no])
110 AC_MSG_RESULT([$ans])
114 AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
118 dnl we need to check for cross compile tools for vxWorks here
120 AS_UNSET([ac_cv_prog_AWK])
121 AC_SUBST([AWK]) dnl scripts/ntpver.in
131 AC_PATH_PROG([PATH_PERL], [perl])
132 dnl Saving cached hardcoded paths rather than searching $PATH during a
133 dnl cached configure run is an optimization not worth the the cost of
134 dnl preventing newly-installed tools from being found. Short-circuit
135 dnl the caching after the tests so preset overrides still work.
136 AS_UNSET([ac_cv_path_PATH_PERL])
137 AC_PATH_PROG([PATH_TEST], [test])
138 AS_UNSET([ac_cv_path_PATH_TEST])
139 test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
140 AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
145 [--with-net-snmp-config],
160 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
165 PROG_NET_SNMP_CONFIG=$ans
166 case "$PROG_NET_SNMP_CONFIG" in
169 PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
172 AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
173 AS_UNSET([ac_cv_path_PATH_NET_SNMP_CONFIG])
176 AC_MSG_CHECKING([for net-snmp-config path])
177 AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
179 case "$PATH_NET_SNMP_CONFIG" in
181 [for net-snmp version],
182 [ntp_cv_net_snmp_version],
183 [ntp_cv_net_snmp_version=`$PATH_NET_SNMP_CONFIG --version`]
190 ac_link="$ac_link $VX_KERNEL"
194 # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
195 AC_SEARCH_LIBS([openlog], [gen syslog])
196 # XXX library list will be in ac_cv_search_openlog
198 # LIBSECCOMP is off by default -- needs testing with all the features
199 # Please send bug reports to loganaden@gmail.com
200 AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
204 [--enable-libseccomp],
205 [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
210 AC_MSG_RESULT([$ntp_ok])
216 [AC_DEFINE([LIBSECCOMP], [1],
217 [Define to any value to include libseccomp sandboxing.])]
223 #include <sys/prctl.h>
224 #include <linux/seccomp.h>
229 ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
241 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
255 , AC_DEFINE([KERN_SECCOMP], 1,
256 [Define to use libseccomp system call filtering.])
264 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
265 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
266 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
267 dnl does Strange Things with extra processes using the Posix-compatibility
268 dnl real-time library, so we don't want to use it.
270 dnl 081118 Harlan got tired of looking for a way to get the sched*()
271 dnl functions to link OK with either cc or gcc.
278 # HMS: Make sure we check for -lrt for clock_* before this...
279 case "$ac_cv_search_clock_gettime" in
280 '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
282 AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
286 AC_CHECK_HEADERS([bstring.h])
290 [DNSServiceRegister],
292 [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
293 [Use Rendezvous/DNS-SD registration])]
296 AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
298 AC_CHECK_HEADERS([memory.h netdb.h poll.h])
299 AC_CHECK_HEADERS([sgtty.h stdatomic.h])
301 AC_CHECK_HEADERS([stdlib.h string.h termio.h])
302 AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
306 AC_CHECK_HEADERS([utmpx.h])
307 case "$ac_cv_header_utmpx_h" in
311 AC_CHECK_HEADERS([utmp.h])
316 AC_CHECK_HEADERS([utmp.h utmpx.h])
321 # On Suns only (so far) getpass() truncates the typed password to 8
322 # characters, but getpassphrase() allows up to 257. Most systems'
323 # getpass() does not truncate, at least not so as to affect ntpq and
324 # ntpdc password prompts.
326 # So check for getpassphrase(), but only on Sun operating systems.
329 *-*-sunos*|*-*-solaris*)
330 AC_CHECK_FUNCS([getpassphrase])
334 AC_CHECK_HEADERS([net/if6.h])
335 AC_CHECK_HEADERS([net/route.h], [], [], [
336 #include <sys/types.h>
337 #include <sys/socket.h>
341 AC_CHECK_HEADERS([netinfo/ni.h])
342 case "$ac_cv_header_netinfo_ni_h" in
344 AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
346 AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
351 AC_CHECK_HEADERS([sys/ioctl.h])
354 AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
355 # HMS: Check sys/proc.h and sys/resource.h after some others
356 AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
357 case "$ac_cv_header_sched_h" in
361 AC_CHECK_HEADERS([sys/sched.h])
364 # HMS: Check sys/shm.h after some others
365 AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
366 # HMS: Checked sys/socket.h earlier
371 AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
374 AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
375 AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
376 AC_CHECK_FUNCS([waitpid])
379 AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
382 AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
386 case "$ac_cv_header_stdatomic_h" in
388 AC_CHECK_FUNCS([atomic_thread_fence])
390 [for atomic_thread_fence()],
391 [ntp_cv_func_atomic_thread_fence],
395 #include <stdatomic.h>
398 atomic_thread_fence(memory_order_seq_cst);
401 [ntp_cv_func_atomic_thread_fence=yes],
402 [ntp_cv_func_atomic_thread_fence=no]
413 AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
419 case "$ac_cv_func_ntp_gettime" in
423 AC_CHECK_FUNCS([__ntp_gettime])
424 case "$ac_cv_func___ntp_gettime" in
426 AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
427 AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
431 AC_CHECK_FUNCS([adjtimex])
432 case "$ac_cv_func_adjtimex" in
434 AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
435 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
439 AC_CHECK_FUNCS([__adjtimex])
440 case "$ac_cv_func___adjtimex" in
442 AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
443 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
444 AC_DEFINE([adjtimex], [__adjtimex], [deviant])
445 AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
451 case "$have_adjtimex" in
453 # nlist stuff is only needed for tickadj.
456 AC_SEARCH_LIBS([nlist], [elf ld mld])
457 # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
458 AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
459 # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
460 AC_CHECK_HEADERS([nlist.h sys/var.h])
461 case "$ac_cv_header_nlist_h" in
463 AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
465 [for n_un in struct nlist],
466 [ntp_cv_struct_nlist_n_un],
477 [ntp_cv_struct_nlist_n_un=yes],
478 [ntp_cv_struct_nlist_n_un=no]
481 case "$ntp_cv_struct_nlist_n_un" in
483 AC_DEFINE([NLIST_NAME_UNION], [1],
484 [does struct nlist use a name union?])
487 AC_SUBST([LDADD_NLIST])
490 AS_UNSET([saved_LIBS])
493 AC_CHECK_HEADERS([sys/proc.h], [], [], [
494 #ifdef HAVE_SYS_TYPES_H
495 # include <sys/types.h>
497 #ifdef HAVE_SYS_TIME_H
498 # include <sys/time.h>
502 AC_CHECK_HEADERS([sys/resource.h], [], [], [
503 #ifdef HAVE_SYS_TIME_H
504 # include <sys/time.h>
508 AC_CHECK_HEADERS([sys/shm.h], [], [], [
509 #ifdef HAVE_SYS_TYPES_H
510 # include <sys/types.h>
512 #ifdef HAVE_SYS_IPC_H
513 # include <sys/ipc.h>
517 AC_CHECK_HEADERS([sys/timex.h], [], [], [
518 #ifdef HAVE_SYS_TIME_H
519 # include <sys/time.h>
527 AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c
530 [for a fallback value for HZ],
533 ntp_cv_default_hz=100
535 alpha*-dec-osf4*|alpha*-dec-osf5*)
536 ntp_cv_default_hz=1024
539 ntp_cv_default_hz=256
544 AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
545 [What is the fallback value for HZ?])
548 [if we need to override the system's value for HZ],
549 [ntp_cv_override_hz],
551 ntp_cv_override_hz=no
553 alpha*-dec-osf4*|alpha*-dec-osf5*)
554 ntp_cv_override_hz=yes
557 ntp_cv_override_hz=yes
560 ntp_cv_override_hz=yes
563 ntp_cv_override_hz=yes
566 ntp_cv_override_hz=yes
571 case "$ntp_cv_override_hz" in
573 AC_DEFINE([OVERRIDE_HZ], [1],
574 [Do we need to override the system's idea of HZ?])
577 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
578 dnl [AC_TRY_LINK([#include <sys/types.h>
579 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
580 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
581 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
582 dnl AC_DEFINE(HAVE_UT_HOST)
585 dnl AC_MSG_CHECKING(if we can get the system boot time)
586 dnl AC_CACHE_VAL(su_cv_have_boot_time,
587 dnl [AC_EGREP_CPP(yes,
588 dnl [#ifdef HAVE_UTMPX_H
589 dnl #include <utmpx.h>
591 dnl #include <utmp.h>
596 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
597 dnl AC_MSG_RESULT($su_cv_have_boot_time)
600 [for struct rt_msghdr],
601 [ntp_cv_struct_rt_msghdr],
605 #include <sys/types.h>
606 #include <sys/socket.h>
608 #include <net/route.h>
614 [ntp_cv_struct_rt_msghdr=yes],
615 [ntp_cv_struct_rt_msghdr=no]
626 #include <sys/socket.h>
627 #include <linux/rtnetlink.h>
638 case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
640 AC_DEFINE([HAS_ROUTING_SOCKET], [1],
641 [Do we have a routing socket (rt_msghdr or rtattr)?])
642 case "$ntp_cv_rtattr" in
644 AC_DEFINE([HAVE_RTNETLINK], [1],
645 [Do we have Linux routing socket?])
650 [struct sigaction for sa_sigaction],
651 [ntp_cv_struct_sigaction_has_sa_sigaction],
658 struct sigaction act;
659 act.sa_sigaction = 0;
662 [ntp_cv_struct_sigaction_has_sa_sigaction=yes],
663 [ntp_cv_struct_sigaction_has_sa_sigaction=no]
666 case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
668 AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
672 [for struct ppsclockev],
673 [ntp_cv_struct_ppsclockev],
677 #ifdef HAVE_SYS_TYPES_H
678 # include <sys/types.h>
680 #ifdef HAVE_SYS_TERMIOS_H
681 # include <sys/termios.h>
683 #ifdef HAVE_SYS_TIME_H
684 # include <sys/time.h>
686 #ifdef HAVE_SYS_PPSCLOCK_H
687 # include <sys/ppsclock.h>
691 extern struct ppsclockev *pce;
695 [ntp_cv_struct_ppsclockev=yes],
696 [ntp_cv_struct_ppsclockev=no]
699 case "$ntp_cv_struct_ppsclockev" in
701 AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
702 [Does a system header define struct ppsclockev?])
705 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
708 [for struct snd_size],
709 [ntp_cv_struct_snd_size],
713 #ifdef HAVE_MACHINE_SOUNDCARD_H
714 # include <machine/soundcard.h>
716 #ifdef HAVE_SYS_SOUNDCARD_H
717 # include <sys/soundcard.h>
721 extern struct snd_size *ss;
725 [ntp_cv_struct_snd_size=yes],
726 [ntp_cv_struct_snd_size=no]
729 case "$ntp_cv_struct_snd_size" in
731 AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
732 [Do we have struct snd_size?])
737 [struct clockinfo for hz],
738 [ntp_cv_struct_clockinfo_has_hz],
742 #include <sys/time.h>
745 extern struct clockinfo *pc;
749 [ntp_cv_struct_clockinfo_has_hz=yes],
750 [ntp_cv_struct_clockinfo_has_hz=no]
753 case "$ntp_cv_struct_clockinfo_has_hz" in
755 AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
759 [struct clockinfo for tickadj],
760 [ntp_cv_struct_clockinfo_has_hz],
764 #include <sys/time.h>
767 extern struct clockinfo *pc;
771 [ntp_cv_struct_clockinfo_has_hz=yes],
772 [ntp_cv_struct_clockinfo_has_hz=no]
775 case "$ntp_cv_struct_clockinfo_has_hz" in
777 AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
780 case "$ntp_cv_struct_ntptimeval" in
783 [struct ntptimeval.time.tv_nsec],
787 #ifdef HAVE_SYS_TIME_H
788 # include <sys/time.h>
794 #ifdef HAVE_SYS_TIMEX_H
795 # include <sys/timex.h>
807 AC_CHECK_FUNCS([arc4random_buf])
812 LIBS="$LIBS $LDADD_LIBNTP"
813 AC_CHECK_FUNCS([daemon])
814 # XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
816 AS_UNSET([saved_LIBS])
825 AC_MSG_CHECKING([for isfinite with <math.h>])
843 AC_MSG_RESULT([$ans])
846 AC_DEFINE([HAVE_ISFINITE], [1])
852 AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal ]dnl
853 [strsignal closefrom getdtablesize])
856 # kvm_open() is only used by tickadj. Also see above.
857 case "$ac_cv_header_kvm_h" in
859 AC_CHECK_FUNCS([kvm_open])
867 *) AC_CHECK_FUNCS([mkstemp])
870 AC_CHECK_FUNCS([mktime])
873 # XXX only verified thru AIX6.
877 # Just a stub in "old" Irix. Sigh.
879 # In the belief that the fix for bug 1223 fixes mlockall() under linux...
881 # # there, but more trouble than it is worth for now (resolver problems)
884 # Apparently there but not working in QNX. Sigh?
889 alpha*-dec-osf4*|alpha*-dec-osf5*)
890 # mlockall is there, as a #define calling memlk via <sys/mman.h>
891 # Not easy to test for - cheat.
892 AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
893 AC_CHECK_FUNCS([mlockall])
895 *) AC_CHECK_FUNCS([mlockall])
898 AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
902 # XXX only verified thru AIX6.
903 # Just a stub in AIX 4. Sigh.
906 # Just stubs in solaris2.5. Sigh.
908 *) AC_CHECK_FUNCS([sched_setscheduler])
911 AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
912 AC_CHECK_FUNCS([strdup strnlen memchr strerror setrlimit strchr])
915 # XXX only verified thru AIX6.
928 AC_CHECK_FUNCS([timer_create])
934 # some OSes prefer _exit() in forked children to exit()
935 AC_CHECK_FUNCS([_exit])
936 ntp_worker_child_exit=exit
937 case "$ac_cv_func__exit::$host_os" in
939 ntp_worker_child_exit=_exit
942 ntp_worker_child_exit=_exit
945 AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
946 [routine worker child proc uses to exit.])
948 AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
952 # http://bugs.ntp.org/737
953 case "$ac_cv_func_recvmsg" in
956 [if we need extra help to define struct iovec],
957 [ntp_cv_struct_iovec_help],
960 for ntp_cv_struct_iovec_help in '0' '1'; do
964 #ifdef HAVE_SYS_TYPES_H
965 # include <sys/types.h>
967 #ifdef HAVE_SYS_SOCKET_H
968 # include <sys/socket.h>
970 #if $ntp_cv_struct_iovec_help
971 # include <sys/uio.h>
983 x = recvmsg(s, &mh, flags);
987 [compiled=yes ; break 1],
993 ntp_cv_struct_iovec_help=0
998 case "$ntp_cv_struct_iovec_help" in
1000 AC_DEFINE([HAVE_SYS_UIO_H], [1],
1001 [Use sys/uio.h for struct iovec help])
1006 [number of arguments taken by setpgrp()],
1007 [ntp_cv_func_setpgrp_nargs],
1011 #ifdef HAVE_SYS_TYPES_H
1012 # include <sys/types.h>
1014 #ifdef HAVE_UNISTD_H
1015 # include <unistd.h>
1022 [ntp_cv_func_setpgrp_nargs=2],
1023 [ntp_cv_func_setpgrp_nargs=0]
1026 case "$ntp_cv_func_setpgrp_nargs" in
1028 AC_DEFINE([HAVE_SETPGRP_0], [1],
1029 [define if setpgrp takes 0 arguments])
1033 [if we need to declare 'errno'],
1034 [ntp_cv_decl_errno],
1046 [ntp_cv_decl_errno=no],
1047 [ntp_cv_decl_errno=yes]
1050 case "$ntp_cv_decl_errno" in
1052 AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
1055 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1056 dnl MT purposes. This makes the line "extern int h_errno" choke
1057 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1058 dnl without breaking any other platforms.
1061 [if we may declare 'h_errno'],
1062 [ntp_cv_decl_h_errno],
1066 #include <sys/types.h>
1067 #ifdef HAVE_NETINET_IN_H
1068 # include <netinet/in.h>
1070 #ifdef HAVE_ARPA_NAMESER_H
1071 # include <arpa/nameser.h>
1076 #ifdef HAVE_RESOLV_H
1077 # include <resolv.h>
1084 [ntp_cv_decl_h_errno=yes],
1085 [ntp_cv_decl_h_errno=no]
1088 case "$ntp_cv_decl_h_errno" in
1090 AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
1094 [if declaring 'syscall()' is ok],
1095 [ntp_cv_decl_syscall],
1099 #ifdef HAVE_SYS_TYPES_H
1100 # include <sys/types.h>
1102 #ifdef HAVE_UNISTD_H
1103 # include <unistd.h>
1107 extern int syscall (int, ...);
1110 [ntp_cv_decl_syscall=yes],
1111 [ntp_cv_decl_syscall=no]
1114 case "$ntp_cv_decl_syscall" in
1116 AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
1121 AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
1124 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1125 AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
1126 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1127 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1128 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1129 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1130 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1133 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1134 AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
1137 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1140 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1141 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1142 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1143 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1144 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1145 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1146 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1147 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1148 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1149 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1150 AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1151 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1152 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1153 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1154 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1155 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1158 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1159 AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
1162 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1167 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1168 AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
1169 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1170 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1171 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1172 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1173 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1174 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1175 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1176 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1177 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1178 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1179 AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
1180 case "`basename $ac_cv_prog_CC`" in
1182 *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1185 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1186 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1187 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1188 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1189 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1190 AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
1191 AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
1194 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1195 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1196 AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
1197 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1198 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1199 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1200 AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
1201 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1202 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1203 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1204 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1205 AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
1206 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1207 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1213 AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
1214 [Do we need to #define _SVID3 when we #include <termios.h>?])
1220 AC_DEFINE([NEED_RCVBUF_SLOP], [1],
1221 [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
1224 dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
1226 [if we will open the broadcast socket],
1227 [ntp_cv_var_open_bcast_socket],
1234 ntp_cv_var_open_bcast_socket=$ans
1237 case "$ntp_cv_var_open_bcast_socket" in
1239 AC_DEFINE([OPEN_BCAST_SOCKET], [1],
1240 [Should we open the broadcast socket?])
1245 AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
1246 [Do we want the HPUX FindConfig()?])
1249 dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
1251 [if process groups are set with -pid],
1252 [ntp_cv_arg_setpgrp_negpid],
1274 ntp_cv_arg_setpgrp_negpid=$ans
1277 case "$ntp_cv_arg_setpgrp_negpid" in
1279 AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
1280 [Do we set process groups with -pid?])
1284 [if we need a ctty for F_SETOWN],
1285 [ntp_cv_func_ctty_for_f_setown],
1294 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1295 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1296 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1297 # in $host may be followed by "aout", "ecoff", or "elf".
1298 *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
1301 *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
1317 ntp_cv_func_ctty_for_f_setown=$ans
1320 case "$ntp_cv_func_ctty_for_f_setown" in
1322 AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
1326 [if the OS clears cached routes when more specifics become available],
1327 [ntp_cv_os_routeupdates],
1337 ntp_cv_os_routeupdates=$ans
1340 case "$ntp_cv_os_routeupdates" in
1342 AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
1343 [need to recreate sockets on changed routing?])
1347 [if the wildcard socket needs REUSEADDR to bind other addresses],
1348 [ntp_cv_os_wildcardreuse],
1357 ntp_cv_os_wildcardreuse=$ans
1360 case "$ntp_cv_os_wildcardreuse" in
1362 AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
1363 [wildcard socket needs REUSEADDR to bind interface addresses])
1368 AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
1369 [Might nlist() values require an extra level of indirection (AIX)?])
1373 [for a minimum recommended value of tickadj],
1374 [ntp_cv_var_min_rec_tickadj],
1382 ntp_cv_var_min_rec_tickadj=$ans
1385 case "$ntp_cv_var_min_rec_tickadj" in
1389 AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
1390 [Should we recommend a minimum value for tickadj?])
1394 [if the TTY code permits PARENB and IGNPAR],
1395 [ntp_cv_no_parenb_ignpar],
1405 i?86-*-freebsd[[123]].*)
1414 ntp_cv_no_parenb_ignpar=$ans
1417 case "$ntp_cv_no_parenb_ignpar" in
1419 AC_DEFINE([NO_PARENB_IGNPAR], [1],
1420 [Is there a problem using PARENB and IGNPAR?])
1423 AC_MSG_CHECKING([if we're including processing time debugging code])
1427 [--enable-debug-timing],
1428 [- include processing time debugging code (costs performance)]
1430 [ntp_ok=$enableval],
1435 AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
1437 AC_MSG_RESULT([$ntp_ok])
1439 AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
1443 [--enable-dst-minutes],
1444 [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
1449 AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
1450 [The number of minutes in a DST adjustment])
1451 AC_MSG_RESULT([$ans])
1453 AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
1455 [ignore-dns-errors],
1457 [--enable-ignore-dns-errors],
1458 [- retry DNS queries on any error]
1465 AC_DEFINE([IGNORE_DNS_ERRORS], [1],
1466 [Retry queries on _any_ DNS error?])
1468 AC_MSG_RESULT([$ans])
1471 [availability of ntp_{adj,get}time()],
1472 [ntp_cv_var_ntp_syscalls],
1474 ntp_cv_var_ntp_syscalls=no
1475 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1477 ntp_cv_var_ntp_syscalls=libc
1480 ntp_cv_var_ntp_syscalls=inline
1486 #include <sys/syscall.h>
1487 #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
1491 [ntp_cv_var_ntp_syscalls=kernel]
1497 case "$ntp_cv_var_ntp_syscalls" in
1499 AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
1500 [Do we have ntp_{adj,get}time in libc?])
1503 AC_DEFINE([NTP_SYSCALLS_STD], [1],
1504 [Do we have ntp_{adj,get}time in the kernel?])
1509 [if sys/timex.h has STA_FLL],
1510 [ntp_cv_var_sta_fll],
1514 #include <sys/timex.h>
1519 [ntp_cv_var_sta_fll=yes],
1520 [ntp_cv_var_sta_fll=no]
1525 [if we have kernel PLL support],
1526 [ntp_cv_var_kernel_pll],
1527 [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
1528 case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
1530 ntp_cv_var_kernel_pll=no
1532 *) ntp_cv_var_kernel_pll=yes
1537 case "$ntp_cv_var_kernel_pll" in
1539 AC_DEFINE([KERNEL_PLL], [1],
1540 [Does the kernel support precision time discipline?])
1544 [if SIOCGIFCONF returns buffer size in the buffer],
1545 [ntp_cv_size_returned_in_buffer],
1559 ntp_cv_size_returned_in_buffer=$ans
1562 case "$ntp_cv_size_returned_in_buffer" in
1564 AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
1565 [Does SIOCGIFCONF return size in the buffer?])
1568 # Check for ioctls TIOCGPPSEV
1569 AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
1570 case "$ac_cv_header_termios_h" in
1574 #include <termios.h>
1589 AC_DEFINE([HAVE_TIOCGPPSEV], [1],
1590 [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1592 AC_MSG_RESULT([$ntp_ok])
1594 # Check for ioctls TIOCSPPS
1595 AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
1596 case "$ac_cv_header_termios_h" in
1600 #include <termios.h>
1615 AC_DEFINE([HAVE_TIOCSPPS], [1],
1616 [Do we have the TIOCSPPS ioctl (Solaris)?])
1618 AC_MSG_RESULT([$ntp_ok])
1620 # Check for ioctls CIOGETEV
1621 AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
1622 case "$ac_cv_header_sys_ppsclock_h" in
1626 #include <sys/ppsclock.h>
1641 AC_DEFINE([HAVE_CIOGETEV], [1],
1642 [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1644 AC_MSG_RESULT([$ntp_ok])
1646 # ATOM/PPSAPI stuff.
1650 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1652 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1653 # The PPSAPI needs struct timespec.
1654 # The PPSAPI also needs a timepps header.
1656 case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
1658 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
1659 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
1660 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1670 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1671 AC_CHECK_HEADER([linux/serial.h])
1672 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1674 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
1677 #include <sys/time.h>
1679 #include <sys/ppsclock.h>
1680 #include <linux/serial.h>
1688 #ifndef ASYNC_PPS_CD_POS
1691 #ifndef ASYNC_PPS_CD_NEG
1701 AC_MSG_RESULT([$ntp_ok])
1709 AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
1710 [Do we have the TIO serial stuff?])
1713 # Check for SHMEM_STATUS support
1714 AC_MSG_CHECKING([SHMEM_STATUS support])
1715 case "$ac_cv_header_sys_mman_h" in
1725 AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
1726 [Do we have support for SHMEM_STATUS?])
1728 AC_MSG_RESULT([$ntp_ok])
1732 # HPUX only, and by explicit request
1733 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
1738 [- Datum/Bancomm bc635/VME interface]
1740 [ntp_ok=$enableval],
1746 AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
1747 AC_SEARCH_LIBS([bcStartPci], [bcsdk], , , [])
1750 AC_MSG_RESULT([$ntp_ok])
1751 case "$ntp_ok$host" in
1753 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1756 #HPUX only, and only by explicit request
1757 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
1762 [- TrueTime GPS receiver/VME interface]
1764 [ntp_ok=$enableval],
1770 AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
1773 AC_MSG_RESULT([$ntp_ok])
1774 case "$ntp_ok$host" in
1776 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1779 AC_MSG_CHECKING([for PCL720 clock support])
1780 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1782 AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
1789 AC_MSG_RESULT([$ans])
1791 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
1795 [--enable-all-clocks],
1796 [+ include all suitable non-PARSE clocks:]
1798 [ntp_eac=$enableval],
1801 AC_MSG_RESULT([$ntp_eac])
1803 # HMS: Should we also require ntp_parse_ok?
1804 AC_MSG_CHECKING([if we have support for PARSE clocks])
1805 case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1812 AC_MSG_RESULT([$ntp_canparse])
1814 AC_MSG_CHECKING([if we have support for audio clocks])
1815 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
1818 AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
1820 *) ntp_canaudio=no ;;
1822 AC_MSG_RESULT([$ntp_canaudio])
1824 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1825 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1831 AC_MSG_RESULT([$ntp_canshm])
1833 # Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
1835 [for termios modem control],
1836 [ntp_cv_modem_control],
1840 #ifdef HAVE_UNISTD_H
1841 # include <unistd.h>
1843 #ifdef HAVE_TERMIOS_H
1844 # include <termios.h>
1846 #ifdef HAVE_SYS_IOCTL_H
1847 # include <sys/ioctl.h>
1851 int dtr = TIOCM_DTR;
1853 ioctl(1, TIOCMBIS, (char *)&dtr);
1856 [ntp_cv_modem_control=yes],
1857 [ntp_cv_modem_control=no]
1860 case "$ntp_eac::$ntp_cv_modem_control" in
1862 ntp_enable_all_modem_control_clocks=yes
1865 ntp_enable_all_modem_control_clocks=no
1869 # Requires modem control
1870 AC_MSG_CHECKING([ACTS modem service])
1875 [s ACTS modem service]
1877 [ntp_ok=$enableval],
1878 [ntp_ok=$ntp_enable_all_modem_control_clocks]
1883 AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
1886 AC_MSG_RESULT([$ntp_ok])
1888 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
1893 [+ Arbiter 1088A/B GPS receiver]
1895 [ntp_ok=$enableval],
1901 AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
1904 AC_MSG_RESULT([$ntp_ok])
1906 AC_MSG_CHECKING([Arcron MSF receiver])
1910 [--enable-ARCRON-MSF],
1911 [+ Arcron MSF receiver]
1913 [ntp_ok=$enableval],
1919 AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
1922 AC_MSG_RESULT([$ntp_ok])
1924 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
1929 [+ Austron 2200A/2201A GPS receiver]
1931 [ntp_ok=$enableval],
1937 AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
1940 AC_MSG_RESULT([$ntp_ok])
1942 AC_MSG_CHECKING([ATOM PPS interface])
1947 [s ATOM PPS interface]
1949 [ntp_ok=$enableval],
1952 case "$ntp_atom_ok" in
1958 AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
1961 AC_MSG_RESULT([$ntp_ok])
1963 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
1967 [--enable-CHRONOLOG],
1968 [+ Chrono-log K-series WWVB receiver]
1970 [ntp_ok=$enableval],
1976 AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
1979 AC_MSG_RESULT([$ntp_ok])
1981 AC_MSG_CHECKING([CHU modem/decoder])
1986 [+ CHU modem/decoder]
1988 [ntp_ok=$enableval],
1994 AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
1997 AC_MSG_RESULT([$ntp_ok])
1998 ntp_refclock_chu=$ntp_ok
2000 AC_MSG_CHECKING([CHU audio/decoder])
2004 [--enable-AUDIO-CHU],
2005 [s CHU audio/decoder]
2007 [ntp_ok=$enableval],
2009 case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
2015 AC_MSG_RESULT([$ntp_ok])
2016 # We used to check for sunos/solaris target...
2017 case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
2018 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
2022 AC_MSG_CHECKING([Datum Programmable Time System])
2027 [s Datum Programmable Time System]
2029 [ntp_ok=$enableval],
2031 case "$ac_cv_header_termios_h" in
2043 AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
2046 AC_MSG_RESULT([$ntp_ok])
2048 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2052 [--enable-DUMBCLOCK],
2053 [+ Dumb generic hh:mm:ss local clock]
2055 [ntp_ok=$enableval],
2061 AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
2064 AC_MSG_RESULT([$ntp_ok])
2066 AC_MSG_CHECKING([Forum Graphic GPS])
2071 [+ Forum Graphic GPS]
2073 [ntp_ok=$enableval],
2079 AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
2082 AC_MSG_RESULT([$ntp_ok])
2084 # Requires modem control
2085 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2090 [s Heath GC-1000 WWV/WWVH receiver]
2092 [ntp_ok=$enableval],
2093 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2098 AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
2101 AC_MSG_RESULT([$ntp_ok])
2103 AC_MSG_CHECKING([for hopf serial clock device])
2107 [--enable-HOPFSERIAL],
2108 [+ hopf serial clock device]
2110 [ntp_ok=$enableval],
2116 AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
2119 AC_MSG_RESULT([$ntp_ok])
2121 AC_MSG_CHECKING([for hopf PCI clock 6039])
2126 [+ hopf 6039 PCI board]
2128 [ntp_ok=$enableval],
2134 AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
2137 AC_MSG_RESULT([$ntp_ok])
2139 AC_MSG_CHECKING([HP 58503A GPS receiver])
2144 [+ HP 58503A GPS receiver]
2146 [ntp_ok=$enableval],
2152 AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
2155 AC_MSG_RESULT([$ntp_ok])
2157 AC_MSG_CHECKING([IRIG audio decoder])
2162 [s IRIG audio decoder]
2164 [ntp_ok=$enableval],
2166 case "$ntp_eac$ntp_canaudio" in
2175 AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
2178 AC_MSG_RESULT([$ntp_ok])
2179 case "$ntp_ok$ntp_canaudio" in
2180 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2183 AC_MSG_CHECKING([for JJY receiver])
2190 [ntp_ok=$enableval],
2196 AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
2199 AC_MSG_RESULT([$ntp_ok])
2201 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2206 [s Rockwell Jupiter GPS receiver]
2208 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2209 case "$ntp_jupiter_ok" in
2215 AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
2218 AC_MSG_RESULT([$ntp_ok])
2220 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2225 [+ Leitch CSD 5300 Master Clock System Driver]
2227 [ntp_ok=$enableval],
2233 AC_DEFINE([CLOCK_LEITCH], [1],
2234 [Leitch CSD 5300 Master Clock System Driver?])
2237 AC_MSG_RESULT([$ntp_ok])
2239 AC_MSG_CHECKING([local clock reference])
2243 [--enable-LOCAL-CLOCK],
2244 [+ local clock reference]
2246 [ntp_ok=$enableval],
2252 AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
2255 AC_MSG_RESULT([$ntp_ok])
2257 dnl Bug 340: longstanding unfixed bugs
2258 dnl AC_MSG_CHECKING([EES M201 MSF receiver])
2259 dnl AC_ARG_ENABLE([MSFEES],
2260 dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
2261 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2262 dnl if test "$ntp_ok" = "yes"; then
2263 dnl ntp_refclock=yes
2264 dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
2266 dnl AC_MSG_RESULT([$ntp_ok])
2269 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2274 [s Magnavox MX4200 GPS receiver]
2276 [ntp_ok=$enableval],
2278 case "$ac_cv_var_ppsclock" in
2291 AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
2294 AC_MSG_RESULT([$ntp_ok])
2295 case "$ntp_ok$host" in
2296 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
2299 AC_MSG_CHECKING([for NeoClock4X receiver])
2303 [--enable-NEOCLOCK4X],
2304 [+ NeoClock4X DCF77 / TDF receiver]
2306 [ntp_ok=$enableval],
2312 AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
2315 AC_MSG_RESULT([$ntp_ok])
2317 AC_MSG_CHECKING([NMEA GPS receiver])
2322 [+ NMEA GPS receiver]
2324 [ntp_ok=$enableval],
2330 AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
2333 AC_MSG_RESULT([$ntp_ok])
2335 AC_CHECK_FUNCS([strtoll])
2336 AC_MSG_CHECKING([for GPSD JSON receiver])
2341 [+ GPSD JSON receiver]
2343 [ntp_ok=$enableval],
2344 [case "$ac_cv_func_strtoll" in
2345 yes) ntp_ok=$ntp_eac ;;
2352 AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
2355 AC_MSG_RESULT([$ntp_ok])
2357 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2362 [s Motorola VP/UT Oncore GPS receiver]
2364 [ntp_ok=$enableval],
2367 case "$ntp_oncore_ok" in
2373 AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
2376 AC_MSG_RESULT([$ntp_ok])
2378 # Requires modem control
2379 AC_MSG_CHECKING([for Palisade clock])
2383 [--enable-PALISADE],
2386 [ntp_ok=$enableval],
2387 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2392 AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
2395 AC_MSG_RESULT([$ntp_ok])
2397 AC_MSG_CHECKING([Conrad parallel port radio clock])
2402 [+ Conrad parallel port radio clock]
2404 [ntp_ok=$enableval],
2410 AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
2413 AC_MSG_RESULT([$ntp_ok])
2415 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2420 [+ PST/Traconex 1020 WWV/WWVH receiver]
2422 [ntp_ok=$enableval],
2428 AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
2431 AC_MSG_RESULT([$ntp_ok])
2433 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2438 [- RIPENCC specific Trimble driver]
2440 [ntp_ok=$enableval],
2443 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2444 case "$ntp_ripe_ncc_ok" in
2450 AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
2453 AC_MSG_RESULT([$ntp_ok])
2455 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2456 # For *IX, we need sys/ipc.h and sys/shm.h.
2457 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2462 [s SHM clock attached thru shared memory]
2464 [ntp_ok=$enableval],
2466 case "$ntp_eac$ntp_canshm" in
2475 AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
2478 AC_MSG_RESULT([$ntp_ok])
2480 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2484 [--enable-SPECTRACOM],
2485 [+ Spectracom 8170/Netclock/2 WWVB receiver]
2487 [ntp_ok=$enableval],
2493 AC_DEFINE([CLOCK_SPECTRACOM], [1],
2494 [Spectracom 8170/Netclock/2 WWVB receiver])
2497 AC_MSG_RESULT([$ntp_ok])
2499 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2504 [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
2506 [ntp_ok=$enableval],
2508 case "$ac_cv_header_sys_tpro_h" in
2521 AC_DEFINE([CLOCK_TPRO], [1],
2522 [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2525 AC_MSG_RESULT([$ntp_ok])
2526 case "$ntp_ok$ac_cv_header_sys_tpro" in
2527 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2530 # Not on a vax-dec-bsd
2531 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2535 [--enable-TRUETIME],
2536 [s Kinemetrics/TrueTime receivers]
2538 [ntp_ok=$enableval],
2553 AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
2556 AC_MSG_RESULT([$ntp_ok])
2557 case "$ntp_ok$host" in
2558 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
2561 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2566 [- TrueTime 560 IRIG-B decoder]
2568 [ntp_ok=$enableval],
2574 AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
2577 AC_MSG_RESULT([$ntp_ok])
2579 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2584 [+ Ultralink WWVB receiver]
2586 [ntp_ok=$enableval],
2592 AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
2595 AC_MSG_RESULT([$ntp_ok])
2597 AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
2601 [--enable-TSYNCPCI],
2602 [s Spectracom TSYNC timing board]
2604 [ntp_ok=$enableval],
2618 AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
2621 AC_MSG_RESULT([$ntp_ok])
2623 AC_MSG_CHECKING([WWV receiver])
2628 [s WWV Audio receiver]
2630 [ntp_ok=$enableval],
2632 case "$ntp_eac$ntp_canaudio" in
2641 AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
2644 AC_MSG_RESULT([$ntp_ok])
2645 case "$ntp_ok$ntp_canaudio" in
2646 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2649 AC_MSG_CHECKING([for Zyfer receiver])
2654 [+ Zyfer GPStarplus receiver]
2656 [ntp_ok=$enableval],
2662 AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
2665 AC_MSG_RESULT([$ntp_ok])
2667 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2671 [--enable-parse-clocks],
2672 [- include all suitable PARSE clocks:]
2674 [ntp_eapc=$enableval],
2677 yes) ntp_eapc=$ntp_canparse ;;
2680 # Delete the next line one of these days
2684 AC_MSG_RESULT($ntp_eapc)
2686 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2688 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2691 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2699 AC_MSG_CHECKING([Diem Computime Radio Clock])
2703 [--enable-COMPUTIME],
2704 [s Diem Computime Radio Clock]
2706 [ntp_ok=$enableval],
2713 AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
2716 AC_MSG_RESULT([$ntp_ok])
2717 case "$ntp_ok$ntp_canparse" in
2719 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2722 AC_MSG_CHECKING([ELV/DCF7000 clock])
2727 [s ELV/DCF7000 clock]
2729 [ntp_ok=$enableval],
2736 AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
2739 AC_MSG_RESULT([$ntp_ok])
2740 case "$ntp_ok$ntp_canparse" in
2742 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2745 AC_MSG_CHECKING([HOPF 6021 clock])
2749 [--enable-HOPF6021],
2752 [ntp_ok=$enableval],
2759 AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
2762 AC_MSG_RESULT([$ntp_ok])
2763 case "$ntp_ok$ntp_canparse" in
2765 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2768 AC_MSG_CHECKING([Meinberg clocks])
2772 [--enable-MEINBERG],
2775 [ntp_ok=$enableval],
2782 AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
2785 AC_MSG_RESULT([$ntp_ok])
2786 case "$ntp_ok$ntp_canparse" in
2788 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2791 AC_MSG_CHECKING([DCF77 raw time code])
2796 [s DCF77 raw time code]
2798 [ntp_ok=$enableval],
2807 AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
2810 AC_MSG_RESULT([$ntp_ok])
2811 case "$ntp_ok$ntp_canparse" in
2813 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2816 case "$ntp_rawdcf" in
2818 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2819 [ntp_cv_rawdcf_parity],
2827 ntp_cv_rawdcf_parity=$ans
2830 case "$ntp_cv_rawdcf_parity" in
2832 AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
2833 [Should we not IGNPAR (Linux)?]) ;;
2837 AC_MSG_CHECKING([RCC 8000 clock])
2844 [ntp_ok=$enableval],
2851 AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
2854 AC_MSG_RESULT([$ntp_ok])
2855 case "$ntp_ok$ntp_canparse" in
2857 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2860 AC_MSG_CHECKING([Schmid DCF77 clock])
2865 [s Schmid DCF77 clock]
2867 [ntp_ok=$enableval],
2874 AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
2877 AC_MSG_RESULT([$ntp_ok])
2878 case "$ntp_ok$ntp_canparse" in
2880 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2883 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
2887 [--enable-TRIMTAIP],
2888 [s Trimble GPS receiver/TAIP protocol]
2890 [ntp_ok=$enableval],
2897 AC_DEFINE([CLOCK_TRIMTAIP], [1],
2898 [Trimble GPS receiver/TAIP protocol])
2901 AC_MSG_RESULT([$ntp_ok])
2902 case "$ntp_ok$ntp_canparse" in
2904 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2907 AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
2911 [--enable-TRIMTSIP],
2912 [s Trimble GPS receiver/TSIP protocol]
2914 [ntp_ok=$enableval],
2921 AC_DEFINE([CLOCK_TRIMTSIP], [1],
2922 [Trimble GPS receiver/TSIP protocol])
2925 AC_MSG_RESULT([$ntp_ok])
2926 case "$ntp_ok$ntp_canparse" in
2928 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2931 AC_MSG_CHECKING([WHARTON 400A Series clock])
2936 [s WHARTON 400A Series clock]
2938 [ntp_ok=$enableval],
2945 AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
2948 AC_MSG_RESULT([$ntp_ok])
2949 case "$ntp_ok$ntp_canparse" in
2951 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2954 AC_MSG_CHECKING([VARITEXT clock])
2958 [--enable-VARITEXT],
2961 [ntp_ok=$enableval],
2968 AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
2971 AC_MSG_RESULT([$ntp_ok])
2972 case "$ntp_ok$ntp_canparse" in
2974 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2977 AC_MSG_CHECKING(SEL240X clock)
2978 AC_ARG_ENABLE(SEL240X,
2979 AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
2980 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2981 if test "$ntp_ok" = "yes"; then
2984 AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
2986 AC_MSG_RESULT($ntp_ok)
2987 case "$ntp_ok$ntp_canparse" in
2989 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2993 AC_SUBST([LIBPARSE])
2994 AC_SUBST([MAKE_LIBPARSE])
2995 AC_SUBST([MAKE_LIBPARSE_KERNEL])
2996 AC_SUBST([MAKE_CHECK_Y2K])
2998 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3000 case "$ntp_libparse" in
3003 AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
3004 LIBPARSE=../libparse/libparse.a
3005 MAKE_LIBPARSE=libparse.a
3006 # HMS: check_y2k trips the 34 year problem now...
3007 false && MAKE_CHECK_Y2K=check_y2k
3009 AC_MSG_RESULT([$ans])
3013 AC_MSG_CHECKING([if we want to enable CMAC support])
3014 case "$ac_cv_header_openssl_cmac_h" in
3016 AC_DEFINE([ENABLE_CMAC], [1], [Enable CMAC support?])
3022 AC_MSG_RESULT([$ans])
3026 # if we are using OpenSSL (--with-crypto), by default Autokey is enabled
3027 AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
3032 [+ support NTP Autokey protocol]
3034 [ntp_autokey=$enableval],
3035 [ntp_autokey=$ntp_openssl]
3037 case "$ntp_autokey" in
3041 case "$ntp_openssl" in
3043 AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
3047 AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
3053 AC_MSG_RESULT([$ntp_autokey])
3055 AC_SUBST([MAKE_CHECK_LAYOUT])
3056 AC_MSG_CHECKING([if we want to run check-layout])
3057 case "$cross_compiling$PATH_PERL" in
3059 MAKE_CHECK_LAYOUT=check-layout
3066 AC_MSG_RESULT([$ans])
3070 AC_MSG_CHECKING([if we can make dcf parse utilities])
3072 case "$ntp_parseutil" in
3075 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3082 AC_MSG_RESULT([$ans])
3084 AC_SUBST([MAKE_PARSEKMODULE])
3085 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3087 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3091 case "$ntp_cv_var_kernel_pll" in
3093 AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
3097 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3101 MAKE_PARSEKMODULE=parse
3102 AC_CHECK_HEADERS([strings.h])
3107 AC_MSG_RESULT([$ans])
3109 AC_MSG_CHECKING([if we need basic refclock support])
3110 case "$ntp_refclock" in
3112 AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
3115 AC_MSG_RESULT($ntp_refclock)
3117 dnl Things that can be made in clockstuff
3118 AC_SUBST([PROPDELAY], [propdelay])
3119 AC_SUBST([CHUTEST]) dnl needs work to compile
3121 AC_SUBST([MAKE_ADJTIMED])
3122 AC_MSG_CHECKING([if we want HP-UX adjtimed support])
3132 MAKE_ADJTIMED=adjtimed
3133 AC_DEFINE([NEED_HPUX_ADJTIME], [1],
3134 [Do we need HPUX adjtime() library support?])
3142 AC_MSG_RESULT([$ans])
3144 AC_MSG_CHECKING([if we want QNX adjtime support])
3154 AC_DEFINE([NEED_QNX_ADJTIME], [1],
3155 [Do we need the qnx adjtime call?])
3158 AC_MSG_RESULT([$ans])
3160 AC_MSG_CHECKING([if we can read kmem])
3162 # the default is to enable it if the system has the capability
3164 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3173 *-*-domainos) # Won't be found...
3193 # --enable-kmem / --disable-kmem controls if present
3198 [s read /dev/kmem for tick and/or tickadj]
3203 AC_MSG_RESULT([$ans])
3211 AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
3215 AC_MSG_CHECKING([if adjtime is accurate])
3217 # target-dependent defaults
3226 mips-sgi-irix[[456]]*)
3233 # XXX only verified thru AIX6.
3239 *-*-solaris2.[[01]])
3252 # --enable-accurate-adjtime / --disable-accurate-adjtime
3253 # override the default
3257 [--enable-accurate-adjtime],
3258 [s the adjtime() call is accurate]
3263 AC_MSG_RESULT([$ans])
3267 AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
3268 adjtime_is_accurate=yes
3271 adjtime_is_accurate=no
3276 [the name of 'tick' in the kernel],
3277 [ntp_cv_nlist_tick],
3281 m68*-hp-hpux*) # HP9000/300?
3291 # XXX only verified thru AIX6.
3310 ntp_cv_nlist_tick=$ans
3313 case "$ntp_cv_nlist_tick" in
3315 ;; # HMS: I think we can only get 'no' here...
3317 AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
3318 [What is the name of TICK in the kernel?])
3322 [for the units of 'tick'],
3331 ntp_cv_tick_nano=$ans
3334 case "$ntp_cv_tick_nano" in
3336 AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
3340 [the name of 'tickadj' in the kernel],
3341 [ntp_cv_nlist_tickadj],
3345 m68*-hp-hpux*) # HP9000/300?
3376 ans=no # hrestime_adj
3382 ntp_cv_nlist_tickadj=$ans
3385 case "$ntp_cv_nlist_tickadj" in
3387 ;; # HMS: I think we can only get 'no' here...
3389 AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
3390 [What is the name of TICKADJ in the kernel?])
3394 [for the units of 'tickadj'],
3395 [ntp_cv_tickadj_nano],
3403 ntp_cv_tickadj_nano=$ans
3406 case "$ntp_cv_tickadj_nano" in
3408 AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
3412 [half-heartedly for 'dosynctodr' in the kernel],
3413 [ntp_cv_nlist_dosynctodr],
3456 ntp_cv_nlist_dosynctodr=$ans
3459 case "$ntp_cv_nlist_dosynctodr" in
3463 AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
3464 [What is (probably) the name of DOSYNCTODR in the kernel?])
3469 [half-heartedly for 'noprintf' in the kernel],
3470 [ntp_cv_nlist_noprintf],
3507 ntp_cv_nlist_noprintf=$ans
3510 case "$ntp_cv_nlist_noprintf" in
3514 AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
3515 [What is (probably) the name of NOPRINTF in the kernel?])
3519 dnl The tick/tickadj sections were written by Skippy, who never learned
3520 dnl that it's impolite (horridly gross) to show your guts in public.
3523 dnl 10000 80 Unixware
3524 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3525 dnl 10000 150 sgi IRIX
3526 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3527 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3528 dnl 1000000L/hz 500/HZ other && NOKMEM
3529 dnl txc.tick 1 Linux
3530 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3531 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3532 dnl (RS6000 && !NOKMEM), SINIX MIPS
3534 dnl But we'll only use these "values" if we can't find anything else.
3536 AC_MSG_CHECKING([for a default value for 'tick'])
3538 # target-dependent default for tick
3542 AC_MSG_ERROR([tick needs work for cygwin])
3570 [--enable-tick=VALUE],
3571 [s force a value for 'tick']
3576 AC_MSG_RESULT([$ans])
3580 ;; # HMS: I think we can only get 'no' here...
3582 AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
3583 [Preset a value for 'tick'?])
3586 AC_MSG_CHECKING([for a default value for 'tickadj'])
3588 # target-specific default
3592 case "$adjtime_is_accurate" in
3607 *-*-domainos) # Skippy: won't be found...
3615 case "$adjtime_is_accurate" in
3641 [--enable-tickadj=VALUE],
3642 [s force a value for 'tickadj']
3647 AC_MSG_RESULT([$ans])
3649 default_tickadj=$ans
3651 case "$default_tickadj" in
3653 ;; # HMS: I think we can only get 'no' here...
3655 AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
3656 [Preset a value for 'tickadj'?]) ;;
3659 # Newer versions of ReliantUNIX round adjtime() values down to
3660 # 1/100s (system tick). Sigh ...
3661 # Unfortunately, there is no easy way to know if particular release
3662 # has this "feature" or any obvious way to test for it.
3665 AC_DEFINE([RELIANTUNIX_CLOCK], [1],
3666 [Do we want the ReliantUNIX clock hacks?])
3671 AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
3674 ntp_cv_make_tickadj=yes
3675 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3676 nonono) # Don't read KMEM, no presets. Bogus.
3677 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3678 ntp_cv_make_tickadj=no
3680 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3681 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3682 ntp_cv_make_tickadj=no
3684 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3685 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3686 ntp_cv_make_tickadj=no
3688 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3690 yesnono) # Read KMEM, no presets. Cool.
3692 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3693 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3695 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3697 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3699 *) # Generally bogus.
3700 AC_MSG_ERROR([This shouldn't happen.])
3704 AC_SUBST(MAKE_NTPTIME)
3705 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3707 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
3717 ac_cv_make_ntptime=$ans])
3718 case "$ac_cv_make_ntptime" in
3720 MAKE_NTPTIME=ntptime
3730 AC_SUBST([MAKE_TICKADJ])
3733 # tickadj is pretty useless on newer versions of ReliantUNIX
3735 ntp_cv_make_tickadj=no
3738 ntp_cv_make_tickadj=no
3741 # DLM says tickadj is a no-no starting with solaris2.5
3743 *-*-solaris2.1[[0-9]]*)
3744 ntp_cv_make_tickadj=no
3746 *-*-solaris2.[[0-4]]*) ;;
3747 *) ntp_cv_make_tickadj=no ;;
3751 ntp_cv_make_tickadj=no
3756 # Despite all the above, we always make tickadj. Setting
3757 # ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3758 # report that the configuration variable was cached. It may
3759 # be better to simply remove the hunk above, I did not want
3760 # to remove it if there is hope it will be used again.
3762 AS_UNSET([ntp_cv_make_tickadj])
3765 [if we want and can make the tickadj utility],
3766 [ntp_cv_make_tickadj],
3767 [ntp_cv_make_tickadj=yes]
3769 case "$ntp_cv_make_tickadj" in
3771 MAKE_TICKADJ=tickadj
3785 AC_SUBST([MAKE_TIMETRIM])
3787 [if we want and can make the timetrim utility],
3788 [ntp_cv_make_timetrim],
3792 ntp_cv_make_timetrim=yes
3795 ntp_cv_make_timetrim=yes
3798 ntp_cv_make_timetrim=no
3803 case "$ntp_cv_make_timetrim" in
3805 MAKE_TIMETRIM=timetrim
3814 AC_SUBST([MAKE_LIBNTPSIM])
3815 AC_SUBST([MAKE_NTPDSIM])
3817 AC_MSG_CHECKING([if we want to build the NTPD simulator])
3821 [--enable-simulator],
3822 [- build/install the NTPD simulator?]
3827 AC_MSG_RESULT([$ans])
3830 MAKE_NTPDSIM=ntpdsim
3831 MAKE_LIBNTPSIM=libntpsim.a
3846 LDFLAGS="$LDFLAGS -r"
3854 AC_MSG_CHECKING([if we want to build ntpsnmpd])
3859 [s Build ntpsnmpd MIB agent?]
3863 case "$PATH_NET_SNMP_CONFIG" in
3869 AC_MSG_RESULT([$ans])
3872 case "$PATH_NET_SNMP_CONFIG" in
3874 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
3875 # Bug 2815. This is a bit of a hack, but it works...
3876 case "$ntp_cv_net_snmp_version" in
3877 5.3*) SNMP_LIBS=`echo $SNMP_LIBS | $SED -e 's/-lnetsnmpagent/-lnetsnmpagent -lnetsnmpmibs/'`
3880 AC_SUBST([SNMP_LIBS])
3881 # HMS: we really want to separate CPPFLAGS and CFLAGS
3882 foo=`$PATH_NET_SNMP_CONFIG --cflags`
3888 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
3890 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
3894 AC_SUBST([SNMP_CPPFLAGS])
3895 AC_SUBST([SNMP_CFLAGS])
3898 save_CPPFLAGS=$CPPFLAGS
3901 CPPFLAGS=$SNMP_CPPFLAGS
3904 [net-snmp/net-snmp-config.h],
3905 [MAKE_NTPSNMPD=ntpsnmpd],
3906 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
3909 # Do this last, as we're messing up LIBS.
3910 # check -lnetsnmp for netsnmp_daemonize
3911 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
3914 [netsnmp_daemonize],
3920 AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
3921 [We need to provide netsnmp_daemonize()])
3925 AS_UNSET([save_CFLAGS])
3926 CPPFLAGS=$save_CPPFLAGS
3927 AS_UNSET([save_CPPFLAGS])
3929 AS_UNSET([save_LIBS])
3932 AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
3937 AC_SUBST([MAKE_NTPSNMPD])
3939 case "$MAKE_NTPSNMPD" in
3948 AC_MSG_CHECKING([if we should always slew the time])
3950 # target-specific defaults
3962 *-*-openvms*) # HMS: won't be found
3969 # --enable-slew-always / --disable-slew-always overrides default
3974 [--enable-slew-always],
3975 [s always slew the time]
3980 AC_MSG_RESULT([$ans])
3984 AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
3987 AC_MSG_CHECKING([if we should step and slew the time])
4002 *-*-solaris2.1[[0-9]]*)
4005 *-*-solaris2.[[012]]*)
4008 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
4018 [--enable-step-slew],
4019 [s step and slew the time]
4024 AC_MSG_RESULT([$ans])
4028 AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
4031 AC_MSG_CHECKING([if ntpdate should step the time])
4044 [--enable-ntpdate-step],
4045 [s if ntpdate should step the time]
4050 AC_MSG_RESULT([$ans])
4054 AC_DEFINE([FORCE_NTPDATE_STEP], [1],
4055 [force ntpdate to step the clock if !defined(STEP_SLEW) ?])
4059 AC_MSG_CHECKING([if we should sync TODR clock every hour])
4065 *-*-openvms*) # HMS: won't be found
4076 [--enable-hourly-todr-sync],
4077 [s if we should sync TODR hourly]
4082 AC_MSG_RESULT([$ans])
4084 case "$ac_cv_var_sync_todr" in
4086 AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
4090 AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4103 # Generic_105181-17 and higher
4124 # Generic_106541-07 and higher
4143 [--enable-kernel-fll-bug],
4144 [s if we should avoid a kernel FLL bug]
4149 AC_MSG_RESULT([$ans])
4153 AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
4157 AC_MSG_CHECKING([if we want new session key behavior])
4161 [--enable-bug1243-fix],
4162 [+ use unmodified autokey session keys]
4167 AC_MSG_RESULT([$ans])
4170 AC_DEFINE([DISABLE_BUG1243_FIX], [1],
4171 [use old autokey session key behavior?])
4175 AC_MSG_CHECKING([if we want the explicit 127.0.0.0/8 martian filter])
4179 [--enable-bug3020-fix],
4180 [+ Provide the explicit 127.0.0.0/8 martian filter]
4185 AC_MSG_RESULT([$ans])
4188 AC_DEFINE([ENABLE_BUG3020_FIX], [1],
4189 [Provide the explicit 127.0.0.0/8 martian filter?])
4193 AC_MSG_CHECKING([if we want correct mode7 fudgetime2 behavior])
4197 [--enable-bug3527-fix],
4198 [+ provide correct mode7 fudgetime2 behavior]
4203 AC_MSG_RESULT([$ans])
4206 AC_DEFINE([DISABLE_BUG3527_FIX], [1],
4207 [use old autokey session key behavior?])
4211 AC_MSG_CHECKING([if we want a debug assert on an OOB KoD RATE value])
4215 [--enable-bug3767-fix],
4216 [+ Disable debug assertion on OOB KoD RATE value]
4221 AC_MSG_RESULT([$ans])
4224 AC_DEFINE([DISABLE_BUG3767_FIX], [1],
4225 [Disable debug assertion on OOB KoD RATE value?])
4229 AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
4232 *-*-solaris2.[[89]])
4235 *-*-solaris2.1[[0-9]]*)
4245 [--enable-irig-sawtooth],
4246 [s if we should enable the IRIG sawtooth filter]
4251 AC_MSG_RESULT([$ans])
4255 AC_DEFINE([IRIG_SUCKS], [1],
4256 [Should we use the IRIG sawtooth filter?])
4259 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4264 [- if we should enable the NIST lockclock scheme]
4270 AC_MSG_RESULT([$ans])
4274 AC_DEFINE([LOCKCLOCK], [1],
4275 [Should we align with the NIST lockclock scheme?]) ;;
4278 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4282 [--enable-ntp-signd],
4283 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4289 AC_MSG_RESULT([$ans])
4296 ntp_signd_path=/var/run/ntp_signd
4299 ntp_signd_path="$ans"
4302 case "$ntp_signd_path" in
4306 AC_DEFINE([HAVE_NTP_SIGND], [1],
4307 [Do we want support for Samba's signing daemon?])
4308 AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
4309 [Path to sign daemon rendezvous socket])
4313 dnl check for 'magic pps' for Linux
4314 AC_MSG_CHECKING([if we want 'magic' PPS support])
4318 [--enable-magicpps],
4319 [+ try to auto-instantiate PPS devices on Linux]
4324 AC_MSG_RESULT([$ans])
4327 AC_DEFINE([ENABLE_MAGICPPS], [1],
4328 [auto-instantiate missing PPS devices on Linux])
4329 AC_CHECK_FUNCS([openat fdopendir fstatat])
4333 AC_CHECK_HEADERS([libscf.h])
4335 case "$ac_cv_header_libscf_h" in
4345 # Look for a sysctl call to get the list of network interfaces.
4348 [for interface list sysctl],
4349 [ntp_cv_iflist_sysctl],
4352 #include <sys/param.h>
4353 #include <sys/sysctl.h>
4354 #include <sys/socket.h>
4355 #ifndef NET_RT_IFLIST
4359 [ntp_cv_iflist_sysctl=yes],
4360 [ntp_cv_iflist_sysctl=no]
4363 case "$ntp_cv_iflist_sysctl" in
4365 AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
4370 AC_MSG_CHECKING([if we want the saveconfig mechanism])
4374 [--enable-saveconfig],
4375 [+ saveconfig mechanism]
4377 [ntp_ok=$enableval],
4380 ntp_saveconfig_enabled=0
4383 ntp_saveconfig_enabled=1
4384 AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
4387 AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
4388 AC_MSG_RESULT([$ntp_ok])
4392 AC_MSG_CHECKING([if we want the experimental leap smear code])
4396 [--enable-leap-smear],
4397 [- experimental leap smear code]
4399 [ntp_ok=$enableval],
4402 ntp_leap_smear_enabled=0
4405 ntp_leap_smear_enabled=1
4406 AC_DEFINE([LEAP_SMEAR], [1], [leap smear mechanism])
4407 AC_SUBST([HAVE_LEAPSMEARINTERVAL])
4408 HAVE_LEAPSMEARINTERVAL="leapsmearinterval 0"
4411 AC_MSG_RESULT([$ntp_ok])
4415 AC_MSG_CHECKING([if we want dynamic interleave support])
4417 [dynamic-interleave],
4419 [--enable-dynamic-interleave],
4420 [- dynamic interleave support]
4422 [ntp_ok=$enableval],
4425 ntp_dynamic_interleave=0
4428 ntp_dynamic_interleave=1
4431 AC_DEFINE_UNQUOTED([DYNAMIC_INTERLEAVE], [$ntp_dynamic_interleave],
4432 [support dynamic interleave?])
4433 AC_MSG_RESULT([$ntp_ok])
4441 AC_CHECK_DECLS([sigsetjmp,siglongjmp], [], [], [[#include <setjmp.h>]])
4445 AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
4446 [Default location of crypto key info])
4448 AC_CONFIG_FILES([Makefile])
4449 AC_CONFIG_FILES([adjtimed/Makefile])
4450 AC_CONFIG_FILES([clockstuff/Makefile])
4451 AC_CONFIG_FILES([include/Makefile])
4452 AC_CONFIG_FILES([include/isc/Makefile])
4453 AC_CONFIG_FILES([kernel/Makefile])
4454 AC_CONFIG_FILES([kernel/sys/Makefile])
4455 AC_CONFIG_FILES([libntp/Makefile])
4456 AC_CONFIG_FILES([libparse/Makefile])
4457 AC_CONFIG_FILES([ntpd/Makefile])
4458 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])
4459 AC_CONFIG_FILES([ntpdate/Makefile])
4460 AC_CONFIG_FILES([ntpdc/Makefile])
4461 AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
4462 AC_CONFIG_FILES([ntpq/Makefile])
4463 AC_CONFIG_FILES([ntpsnmpd/Makefile])
4464 AC_CONFIG_FILES([parseutil/Makefile])
4465 AC_CONFIG_FILES([scripts/Makefile])
4466 AC_CONFIG_FILES([scripts/build/Makefile])
4467 AC_CONFIG_FILES([scripts/build/genAuthors], [chmod +x scripts/build/genAuthors])
4468 AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
4469 AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
4470 AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
4471 AC_CONFIG_FILES([scripts/lib/Makefile])
4472 AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
4473 AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
4474 AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
4475 AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
4476 AC_CONFIG_FILES([scripts/ntptrace/Makefile])
4477 AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
4478 AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
4479 AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
4480 AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
4481 AC_CONFIG_FILES([scripts/update-leap/Makefile])
4482 AC_CONFIG_FILES([scripts/update-leap/update-leap], [chmod +x scripts/update-leap/update-leap])
4483 AC_CONFIG_FILES([tests/Makefile])
4484 AC_CONFIG_FILES([tests/bug-2803/Makefile])
4485 AC_CONFIG_FILES([tests/libntp/Makefile])
4486 AC_CONFIG_FILES([tests/ntpd/Makefile])
4487 AC_CONFIG_FILES([tests/ntpq/Makefile])
4488 AC_CONFIG_FILES([tests/sandbox/Makefile])
4489 AC_CONFIG_FILES([tests/sec-2853/Makefile])
4490 AC_CONFIG_FILES([util/Makefile])
4492 perllibdir="${datadir}/ntp/lib"
4493 AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
4495 calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
4496 AC_SUBST_FILE([calc_tickadj_opts])
4497 ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
4498 AC_SUBST_FILE([ntp_wait_opts])
4499 ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
4500 AC_SUBST_FILE([ntpsweep_opts])
4501 ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
4502 AC_SUBST_FILE([ntptrace_opts])
4503 summary_opts="$srcdir/scripts/summary-opts"
4504 AC_SUBST_FILE([summary_opts])
4505 plot_summary_opts="$srcdir/scripts/plot_summary-opts"
4506 AC_SUBST_FILE([plot_summary_opts])
4508 AC_CONFIG_SUBDIRS([sntp])