1 dnl NTP top-level configure.ac -*- Autoconf -*-
3 m4_include([sntp/m4/version.m4])
8 [http://bugs.ntp.org./],
10 [http://www.ntp.org./]dnl
12 AC_CONFIG_MACRO_DIR([sntp/m4])
13 AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
15 AC_PRESERVE_HELP_ORDER
17 # Bump ntp_configure_cache_version for each change to configure.ac or
18 # .m4 files which invalidates cached values from previous configure
21 # If the change affects cache variables used only by the main NTP
22 # configure.ac, then only its version number should be bumped, while
23 # the subdir configure.ac version numbers should be unchanged. The
24 # same is true for a test/variable that is used only by one subdir
25 # being changed incompatibly; only that subdir's cache version needs
28 # If a change affects variables shared by all NTP configure scripts,
29 # please bump the version numbers of each. If you are not sure, the
30 # safe choice is to bump all on any cache-invalidating change.
32 # In order to avoid the risk of version stamp collision between -stable
33 # and -dev branches, do not simply increment the version, instead use
34 # the date YYYYMMDD optionally with -HHMM if there is more than one
37 ntp_configure_cache_version=20120806
39 # When the cache version of config.cache and configure do not
40 # match, NTP_CACHEVERSION will flush the cache.
42 NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
44 AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
46 dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
49 [AM_SILENT_RULES([yes])]
53 dnl the 'build' machine is where we run configure and compile
54 dnl the 'host' machine is where the resulting stuff runs.
55 AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
56 [canonical system (cpu-vendor-os) of where we should run])
57 AC_CONFIG_HEADERS([config.h])
60 ntp_atom_ok=${ntp_atom_ok=no}
61 ntp_oncore_ok=${ntp_oncore_ok=no}
62 ntp_parse_ok=${ntp_parse_ok=no}
63 ntp_ripe_ncc_ok=${ntp_parse_ok=no}
64 ntp_jupiter_ok=${ntp_jupiter_ok=no}
68 # Do we need CXX for anything besides google test?
74 NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
76 NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
78 dnl AM_PROG_AR req. automake 1.12
84 # So far, the only shared library we might use is libopts.
85 # It's a small library - we might as well use a static version of it.
88 AC_SUBST([LIBTOOL_DEPS])
90 # NTP has (so far) been relying on leading-edge autogen, which
91 # means we need the appropriate corresponding libopts as well.
92 # Therefore, by default:
93 # - use the version of libopts we ship with
95 # - build a static copy (AC_DISABLE_SHARED - done earlier)
96 case "${enable_local_libopts+set}" in
98 *) enable_local_libopts=yes ;;
100 case "${enable_libopts_install+set}" in
102 *) enable_libopts_install=no ;;
105 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
107 NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
111 AC_MSG_CHECKING([for deprecated --with-arlib])
113 AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
114 [ans=$withval], [ans=no])
115 AC_MSG_RESULT([$ans])
119 AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
123 dnl we need to check for cross compile tools for vxWorks here
125 AS_UNSET([ac_cv_prog_AWK])
126 AC_SUBST([AWK]) dnl scripts/ntpver.in
136 AC_PATH_PROG([PATH_PERL], [perl])
137 dnl Saving cached hardcoded paths rather than searching $PATH during a
138 dnl cached configure run is an optimization not worth the the cost of
139 dnl preventing newly-installed tools from being found. Short-circuit
140 dnl the caching after the tests so preset overrides still work.
141 AS_UNSET([ac_cv_path_PATH_PERL])
142 AC_PATH_PROG([PATH_TEST], [test])
143 AS_UNSET([ac_cv_path_PATH_TEST])
144 test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
145 AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
150 [--with-net-snmp-config],
165 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
170 PROG_NET_SNMP_CONFIG=$ans
171 AC_MSG_CHECKING([for net-snmp-config path])
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_RESULT([$PATH_NET_SNMP_CONFIG])
184 case "$PATH_NET_SNMP_CONFIG" in
186 [for net-snmp version],
187 [ntp_cv_net_snmp_version],
188 [ntp_cv_net_snmp_version=`$PATH_NET_SNMP_CONFIG --version`]
195 ac_link="$ac_link $VX_KERNEL"
199 # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
200 AC_SEARCH_LIBS([openlog], [gen syslog])
201 # XXX library list will be in ac_cv_search_openlog
203 # LIBSECCOMP is off by default -- needs testing with all the features
204 # Please send bug reports to loganaden@gmail.com
205 AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
209 [--enable-libseccomp],
210 [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
215 AC_MSG_RESULT([$ntp_ok])
221 [AC_DEFINE([LIBSECCOMP], [1],
222 [Define to any value to include libseccomp sandboxing.])]
228 #include <sys/prctl.h>
229 #include <linux/seccomp.h>
234 ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
246 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
260 , AC_DEFINE([KERN_SECCOMP], 1,
261 [Define to use libseccomp system call filtering.])
269 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
270 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
271 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
272 dnl does Strange Things with extra processes using the Posix-compatibility
273 dnl real-time library, so we don't want to use it.
275 dnl 081118 Harlan got tired of looking for a way to get the sched*()
276 dnl functions to link OK with either cc or gcc.
283 # HMS: Make sure we check for -lrt for clock_* before this...
284 case "$ac_cv_search_clock_gettime" in
285 '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
287 AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
291 AC_CHECK_HEADERS([bstring.h])
295 [DNSServiceRegister],
297 [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
298 [Use Rendezvous/DNS-SD registration])]
301 AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
303 AC_CHECK_HEADERS([memory.h netdb.h poll.h])
304 AC_CHECK_HEADERS([sgtty.h stdatomic.h stdlib.h string.h termio.h])
305 AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
309 AC_CHECK_HEADERS([utmpx.h])
310 case "$ac_cv_header_utmpx_h" in
314 AC_CHECK_HEADERS([utmp.h])
319 AC_CHECK_HEADERS([utmp.h utmpx.h])
324 # On Suns only (so far) getpass() truncates the typed password to 8
325 # characters, but getpassphrase() allows up to 257. Most systems'
326 # getpass() does not truncate, at least not so as to affect ntpq and
327 # ntpdc password prompts.
329 # So check for getpassphrase(), but only on Sun operating systems.
332 *-*-sunos*|*-*-solaris*)
333 AC_CHECK_FUNCS([getpassphrase])
337 AC_CHECK_HEADERS([net/if6.h])
338 AC_CHECK_HEADERS([net/route.h], [], [], [
339 #include <sys/types.h>
340 #include <sys/socket.h>
344 AC_CHECK_HEADERS([netinfo/ni.h])
345 case "$ac_cv_header_netinfo_ni_h" in
347 AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
349 AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
354 AC_CHECK_HEADERS([sys/ioctl.h])
357 AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
358 # HMS: Check sys/proc.h and sys/resource.h after some others
359 AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
360 case "$ac_cv_header_sched_h" in
364 AC_CHECK_HEADERS([sys/sched.h])
367 # HMS: Check sys/shm.h after some others
368 AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
369 # HMS: Checked sys/socket.h earlier
374 AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
377 AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
378 AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
381 AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
384 AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
388 case "$ac_cv_header_stdatomic_h" in
390 AC_CHECK_FUNCS([atomic_thread_fence])
392 [for atomic_thread_fence()],
393 [ntp_cv_func_atomic_thread_fence],
397 #include <stdatomic.h>
400 atomic_thread_fence(memory_order_seq_cst);
403 [ntp_cv_func_atomic_thread_fence=yes],
404 [ntp_cv_func_atomic_thread_fence=no]
415 AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
421 case "$ac_cv_func_ntp_gettime" in
425 AC_CHECK_FUNCS([__ntp_gettime])
426 case "$ac_cv_func___ntp_gettime" in
428 AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
429 AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
433 AC_CHECK_FUNCS([adjtimex])
434 case "$ac_cv_func_adjtimex" in
436 AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
437 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
441 AC_CHECK_FUNCS([__adjtimex])
442 case "$ac_cv_func___adjtimex" in
444 AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
445 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
446 AC_DEFINE([adjtimex], [__adjtimex], [deviant])
447 AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
453 case "$have_adjtimex" in
455 # nlist stuff is only needed for tickadj.
458 AC_SEARCH_LIBS([nlist], [elf ld mld])
459 # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
460 AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
461 # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
462 AC_CHECK_HEADERS([nlist.h sys/var.h])
463 case "$ac_cv_header_nlist_h" in
465 AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
467 [for n_un in struct nlist],
468 [ntp_cv_struct_nlist_n_un],
479 [ntp_cv_struct_nlist_n_un=yes],
480 [ntp_cv_struct_nlist_n_un=no]
483 case "$ntp_cv_struct_nlist_n_un" in
485 AC_DEFINE([NLIST_NAME_UNION], [1],
486 [does struct nlist use a name union?])
489 AC_SUBST([LDADD_NLIST])
492 AS_UNSET([saved_LIBS])
495 AC_CHECK_HEADERS([sys/proc.h], [], [], [
496 #ifdef HAVE_SYS_TYPES_H
497 # include <sys/types.h>
499 #ifdef HAVE_SYS_TIME_H
500 # include <sys/time.h>
504 AC_CHECK_HEADERS([sys/resource.h], [], [], [
505 #ifdef HAVE_SYS_TIME_H
506 # include <sys/time.h>
510 AC_CHECK_HEADERS([sys/shm.h], [], [], [
511 #ifdef HAVE_SYS_TYPES_H
512 # include <sys/types.h>
514 #ifdef HAVE_SYS_IPC_H
515 # include <sys/ipc.h>
519 AC_CHECK_HEADERS([sys/timex.h], [], [], [
520 #ifdef HAVE_SYS_TIME_H
521 # 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])
854 # kvm_open() is only used by tickadj. Also see above.
855 case "$ac_cv_header_kvm_h" in
857 AC_CHECK_FUNCS([kvm_open])
865 *) AC_CHECK_FUNCS([mkstemp])
868 AC_CHECK_FUNCS([mktime])
871 # XXX only verified thru AIX6.
875 # Just a stub in "old" Irix. Sigh.
877 # In the belief that the fix for bug 1223 fixes mlockall() under linux...
879 # # there, but more trouble than it is worth for now (resolver problems)
882 # Apparently there but not working in QNX. Sigh?
887 alpha*-dec-osf4*|alpha*-dec-osf5*)
888 # mlockall is there, as a #define calling memlk via <sys/mman.h>
889 # Not easy to test for - cheat.
890 AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
891 AC_CHECK_FUNCS([mlockall])
893 *) AC_CHECK_FUNCS([mlockall])
896 AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
899 # XXX only verified thru AIX6.
900 # Just a stub in AIX 4. Sigh.
903 # Just stubs in solaris2.5. Sigh.
905 *) AC_CHECK_FUNCS([sched_setscheduler])
908 AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
909 AC_CHECK_FUNCS([strdup strerror setrlimit strchr])
912 # XXX only verified thru AIX6.
925 AC_CHECK_FUNCS([timer_create])
931 # HMS: Only if we are doing the MLOCKALL stuff...
932 AC_MSG_CHECKING([for the default number of 4k stack pages])
936 [--with-stack-limit],
937 [? =50 (200 for openbsd) 4k pages]
954 *) AC_MSG_ERROR(["--with-stack-limit requires an integer argument."])
957 AC_MSG_RESULT([$ans])
958 AC_DEFINE_UNQUOTED([DFLT_RLIMIT_STACK], [$ans],
959 [Default number of 4k pages for RLIMIT_STACK])
961 # HMS: only if we have RLIMIT_MEMLOCK
962 AC_MSG_CHECKING([for the default number of megabytes to MEMLOCK])
977 *) AC_MSG_ERROR(["--with-memlock requires an integer argument."])
980 AC_MSG_RESULT([$ans])
981 AC_DEFINE_UNQUOTED([DFLT_RLIMIT_MEMLOCK], [$ans],
982 [Default number of megabytes for RLIMIT_MEMLOCK])
985 # some OSes prefer _exit() in forked children to exit()
986 AC_CHECK_FUNCS([_exit])
987 ntp_worker_child_exit=exit
988 case "$ac_cv_func__exit::$host_os" in
990 ntp_worker_child_exit=_exit
993 ntp_worker_child_exit=_exit
996 AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
997 [routine worker child proc uses to exit.])
999 AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
1003 # http://bugs.ntp.org/737
1004 case "$ac_cv_func_recvmsg" in
1007 [if we need extra help to define struct iovec],
1008 [ntp_cv_struct_iovec_help],
1011 for ntp_cv_struct_iovec_help in '0' '1'; do
1015 #ifdef HAVE_SYS_TYPES_H
1016 # include <sys/types.h>
1018 #ifdef HAVE_SYS_SOCKET_H
1019 # include <sys/socket.h>
1021 #if $ntp_cv_struct_iovec_help
1022 # include <sys/uio.h>
1034 x = recvmsg(s, &mh, flags);
1038 [compiled=yes ; break 1],
1044 ntp_cv_struct_iovec_help=0
1046 AS_UNSET([compiled])
1049 case "$ntp_cv_struct_iovec_help" in
1051 AC_DEFINE([HAVE_SYS_UIO_H], [1],
1052 [Use sys/uio.h for struct iovec help])
1057 [number of arguments taken by setpgrp()],
1058 [ntp_cv_func_setpgrp_nargs],
1062 #ifdef HAVE_SYS_TYPES_H
1063 # include <sys/types.h>
1065 #ifdef HAVE_UNISTD_H
1066 # include <unistd.h>
1073 [ntp_cv_func_setpgrp_nargs=2],
1074 [ntp_cv_func_setpgrp_nargs=0]
1077 case "$ntp_cv_func_setpgrp_nargs" in
1079 AC_DEFINE([HAVE_SETPGRP_0], [1],
1080 [define if setpgrp takes 0 arguments])
1084 [if we need to declare 'errno'],
1085 [ntp_cv_decl_errno],
1097 [ntp_cv_decl_errno=no],
1098 [ntp_cv_decl_errno=yes]
1101 case "$ntp_cv_decl_errno" in
1103 AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
1106 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1107 dnl MT purposes. This makes the line "extern int h_errno" choke
1108 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1109 dnl without breaking any other platforms.
1112 [if we may declare 'h_errno'],
1113 [ntp_cv_decl_h_errno],
1117 #include <sys/types.h>
1118 #ifdef HAVE_NETINET_IN_H
1119 # include <netinet/in.h>
1121 #ifdef HAVE_ARPA_NAMESER_H
1122 # include <arpa/nameser.h>
1127 #ifdef HAVE_RESOLV_H
1128 # include <resolv.h>
1135 [ntp_cv_decl_h_errno=yes],
1136 [ntp_cv_decl_h_errno=no]
1139 case "$ntp_cv_decl_h_errno" in
1141 AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
1145 [if declaring 'syscall()' is ok],
1146 [ntp_cv_decl_syscall],
1150 #ifdef HAVE_SYS_TYPES_H
1151 # include <sys/types.h>
1153 #ifdef HAVE_UNISTD_H
1154 # include <unistd.h>
1158 extern int syscall (int, ...);
1161 [ntp_cv_decl_syscall=yes],
1162 [ntp_cv_decl_syscall=no]
1165 case "$ntp_cv_decl_syscall" in
1167 AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
1172 AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
1175 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1176 AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
1177 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1178 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1179 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1180 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1181 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1184 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1185 AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
1188 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1191 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1192 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1193 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1194 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1195 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1196 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1197 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1198 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1199 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1200 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1201 AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1202 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1203 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1204 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1205 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1206 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1209 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1210 AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
1213 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1218 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1219 AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
1220 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1221 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1222 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1223 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1224 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1225 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1226 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1227 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1228 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1229 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1230 AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
1231 case "`basename $ac_cv_prog_CC`" in
1233 *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1236 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1237 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1238 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1239 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1240 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1241 AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
1242 AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
1245 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1246 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1247 AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
1248 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1249 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1250 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1251 AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
1252 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1253 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1254 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1255 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1256 AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
1257 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1258 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1264 AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
1265 [Do we need to #define _SVID3 when we #include <termios.h>?])
1271 AC_DEFINE([NEED_RCVBUF_SLOP], [1],
1272 [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
1275 dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
1277 [if we will open the broadcast socket],
1278 [ntp_cv_var_open_bcast_socket],
1285 ntp_cv_var_open_bcast_socket=$ans
1288 case "$ntp_cv_var_open_bcast_socket" in
1290 AC_DEFINE([OPEN_BCAST_SOCKET], [1],
1291 [Should we open the broadcast socket?])
1296 AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
1297 [Do we want the HPUX FindConfig()?])
1300 dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
1302 [if process groups are set with -pid],
1303 [ntp_cv_arg_setpgrp_negpid],
1325 ntp_cv_arg_setpgrp_negpid=$ans
1328 case "$ntp_cv_arg_setpgrp_negpid" in
1330 AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
1331 [Do we set process groups with -pid?])
1335 [if we need a ctty for F_SETOWN],
1336 [ntp_cv_func_ctty_for_f_setown],
1345 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1346 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1347 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1348 # in $host may be followed by "aout", "ecoff", or "elf".
1349 *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
1352 *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
1368 ntp_cv_func_ctty_for_f_setown=$ans
1371 case "$ntp_cv_func_ctty_for_f_setown" in
1373 AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
1377 [if the OS clears cached routes when more specifics become available],
1378 [ntp_cv_os_routeupdates],
1388 ntp_cv_os_routeupdates=$ans
1391 case "$ntp_cv_os_routeupdates" in
1393 AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
1394 [need to recreate sockets on changed routing?])
1398 [if the wildcard socket needs REUSEADDR to bind other addresses],
1399 [ntp_cv_os_wildcardreuse],
1408 ntp_cv_os_wildcardreuse=$ans
1411 case "$ntp_cv_os_wildcardreuse" in
1413 AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
1414 [wildcard socket needs REUSEADDR to bind interface addresses])
1419 AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
1420 [Might nlist() values require an extra level of indirection (AIX)?])
1424 [for a minimum recommended value of tickadj],
1425 [ntp_cv_var_min_rec_tickadj],
1433 ntp_cv_var_min_rec_tickadj=$ans
1436 case "$ntp_cv_var_min_rec_tickadj" in
1440 AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
1441 [Should we recommend a minimum value for tickadj?])
1445 [if the TTY code permits PARENB and IGNPAR],
1446 [ntp_cv_no_parenb_ignpar],
1456 i?86-*-freebsd[[123]].*)
1465 ntp_cv_no_parenb_ignpar=$ans
1468 case "$ntp_cv_no_parenb_ignpar" in
1470 AC_DEFINE([NO_PARENB_IGNPAR], [1],
1471 [Is there a problem using PARENB and IGNPAR?])
1474 AC_MSG_CHECKING([if we're including processing time debugging code])
1478 [--enable-debug-timing],
1479 [- include processing time debugging code (costs performance)]
1481 [ntp_ok=$enableval],
1486 AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
1488 AC_MSG_RESULT([$ntp_ok])
1490 AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
1494 [--enable-dst-minutes],
1495 [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
1500 AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
1501 [The number of minutes in a DST adjustment])
1502 AC_MSG_RESULT([$ans])
1504 AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
1506 [ignore-dns-errors],
1508 [--enable-ignore-dns-errors],
1509 [- retry DNS queries on any error]
1516 AC_DEFINE([IGNORE_DNS_ERRORS], [1],
1517 [Retry queries on _any_ DNS error?])
1519 AC_MSG_RESULT([$ans])
1522 [availability of ntp_{adj,get}time()],
1523 [ntp_cv_var_ntp_syscalls],
1525 ntp_cv_var_ntp_syscalls=no
1526 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1528 ntp_cv_var_ntp_syscalls=libc
1531 ntp_cv_var_ntp_syscalls=inline
1537 #include <sys/syscall.h>
1538 #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
1542 [ntp_cv_var_ntp_syscalls=kernel]
1548 case "$ntp_cv_var_ntp_syscalls" in
1550 AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
1551 [Do we have ntp_{adj,get}time in libc?])
1554 AC_DEFINE([NTP_SYSCALLS_STD], [1],
1555 [Do we have ntp_{adj,get}time in the kernel?])
1560 [if sys/timex.h has STA_FLL],
1561 [ntp_cv_var_sta_fll],
1565 #include <sys/timex.h>
1570 [ntp_cv_var_sta_fll=yes],
1571 [ntp_cv_var_sta_fll=no]
1576 [if we have kernel PLL support],
1577 [ntp_cv_var_kernel_pll],
1578 [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
1579 case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
1581 ntp_cv_var_kernel_pll=no
1583 *) ntp_cv_var_kernel_pll=yes
1588 case "$ntp_cv_var_kernel_pll" in
1590 AC_DEFINE([KERNEL_PLL], [1],
1591 [Does the kernel support precision time discipline?])
1595 [if SIOCGIFCONF returns buffer size in the buffer],
1596 [ntp_cv_size_returned_in_buffer],
1610 ntp_cv_size_returned_in_buffer=$ans
1613 case "$ntp_cv_size_returned_in_buffer" in
1615 AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
1616 [Does SIOCGIFCONF return size in the buffer?])
1619 # Check for ioctls TIOCGPPSEV
1620 AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
1621 case "$ac_cv_header_termios_h" in
1625 #include <termios.h>
1640 AC_DEFINE([HAVE_TIOCGPPSEV], [1],
1641 [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1643 AC_MSG_RESULT([$ntp_ok])
1645 # Check for ioctls TIOCSPPS
1646 AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
1647 case "$ac_cv_header_termios_h" in
1651 #include <termios.h>
1666 AC_DEFINE([HAVE_TIOCSPPS], [1],
1667 [Do we have the TIOCSPPS ioctl (Solaris)?])
1669 AC_MSG_RESULT([$ntp_ok])
1671 # Check for ioctls CIOGETEV
1672 AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
1673 case "$ac_cv_header_sys_ppsclock_h" in
1677 #include <sys/ppsclock.h>
1692 AC_DEFINE([HAVE_CIOGETEV], [1],
1693 [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1695 AC_MSG_RESULT([$ntp_ok])
1697 # ATOM/PPSAPI stuff.
1701 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1703 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
1704 # The PPSAPI needs struct timespec.
1705 # The PPSAPI also needs a timepps header.
1707 case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
1709 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
1710 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
1711 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1721 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1722 AC_CHECK_HEADER([linux/serial.h])
1723 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1725 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
1728 #include <sys/time.h>
1730 #include <sys/ppsclock.h>
1731 #include <linux/serial.h>
1739 #ifndef ASYNC_PPS_CD_POS
1742 #ifndef ASYNC_PPS_CD_NEG
1752 AC_MSG_RESULT([$ntp_ok])
1760 AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
1761 [Do we have the TIO serial stuff?])
1764 # Check for SHMEM_STATUS support
1765 AC_MSG_CHECKING([SHMEM_STATUS support])
1766 case "$ac_cv_header_sys_mman_h" in
1776 AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
1777 [Do we have support for SHMEM_STATUS?])
1779 AC_MSG_RESULT([$ntp_ok])
1783 # HPUX only, and by explicit request
1784 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
1789 [- Datum/Bancomm bc635/VME interface]
1791 [ntp_ok=$enableval],
1797 AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
1800 AC_MSG_RESULT([$ntp_ok])
1801 case "$ntp_ok$host" in
1803 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1806 #HPUX only, and only by explicit request
1807 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
1812 [- TrueTime GPS receiver/VME interface]
1814 [ntp_ok=$enableval],
1820 AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
1823 AC_MSG_RESULT([$ntp_ok])
1824 case "$ntp_ok$host" in
1826 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
1829 AC_MSG_CHECKING([for PCL720 clock support])
1830 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1832 AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
1839 AC_MSG_RESULT([$ans])
1841 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
1845 [--enable-all-clocks],
1846 [+ include all suitable non-PARSE clocks:]
1848 [ntp_eac=$enableval],
1851 AC_MSG_RESULT([$ntp_eac])
1853 # HMS: Should we also require ntp_parse_ok?
1854 AC_MSG_CHECKING([if we have support for PARSE clocks])
1855 case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1862 AC_MSG_RESULT([$ntp_canparse])
1864 AC_MSG_CHECKING([if we have support for audio clocks])
1865 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
1868 AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
1870 *) ntp_canaudio=no ;;
1872 AC_MSG_RESULT([$ntp_canaudio])
1874 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1875 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1881 AC_MSG_RESULT([$ntp_canshm])
1883 # Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
1885 [for termios modem control],
1886 [ntp_cv_modem_control],
1890 #ifdef HAVE_UNISTD_H
1891 # include <unistd.h>
1893 #ifdef HAVE_TERMIOS_H
1894 # include <termios.h>
1896 #ifdef HAVE_SYS_IOCTL_H
1897 # include <sys/ioctl.h>
1901 int dtr = TIOCM_DTR;
1903 ioctl(1, TIOCMBIS, (char *)&dtr);
1906 [ntp_cv_modem_control=yes],
1907 [ntp_cv_modem_control=no]
1910 case "$ntp_eac::$ntp_cv_modem_control" in
1912 ntp_enable_all_modem_control_clocks=yes
1915 ntp_enable_all_modem_control_clocks=no
1919 # Requires modem control
1920 AC_MSG_CHECKING([ACTS modem service])
1925 [s ACTS modem service]
1927 [ntp_ok=$enableval],
1928 [ntp_ok=$ntp_enable_all_modem_control_clocks]
1933 AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
1936 AC_MSG_RESULT([$ntp_ok])
1938 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
1943 [+ Arbiter 1088A/B GPS receiver]
1945 [ntp_ok=$enableval],
1951 AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
1954 AC_MSG_RESULT([$ntp_ok])
1956 AC_MSG_CHECKING([Arcron MSF receiver])
1960 [--enable-ARCRON-MSF],
1961 [+ Arcron MSF receiver]
1963 [ntp_ok=$enableval],
1969 AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
1972 AC_MSG_RESULT([$ntp_ok])
1974 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
1979 [+ Austron 2200A/2201A GPS receiver]
1981 [ntp_ok=$enableval],
1987 AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
1990 AC_MSG_RESULT([$ntp_ok])
1992 AC_MSG_CHECKING([ATOM PPS interface])
1997 [s ATOM PPS interface]
1999 [ntp_ok=$enableval],
2002 case "$ntp_atom_ok" in
2008 AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
2011 AC_MSG_RESULT([$ntp_ok])
2013 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
2017 [--enable-CHRONOLOG],
2018 [+ Chrono-log K-series WWVB receiver]
2020 [ntp_ok=$enableval],
2026 AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
2029 AC_MSG_RESULT([$ntp_ok])
2031 AC_MSG_CHECKING([CHU modem/decoder])
2036 [+ CHU modem/decoder]
2038 [ntp_ok=$enableval],
2044 AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
2047 AC_MSG_RESULT([$ntp_ok])
2048 ntp_refclock_chu=$ntp_ok
2050 AC_MSG_CHECKING([CHU audio/decoder])
2054 [--enable-AUDIO-CHU],
2055 [s CHU audio/decoder]
2057 [ntp_ok=$enableval],
2059 case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
2065 AC_MSG_RESULT([$ntp_ok])
2066 # We used to check for sunos/solaris target...
2067 case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
2068 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
2072 AC_MSG_CHECKING([Datum Programmable Time System])
2077 [s Datum Programmable Time System]
2079 [ntp_ok=$enableval],
2081 case "$ac_cv_header_termios_h" in
2093 AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
2096 AC_MSG_RESULT([$ntp_ok])
2098 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2102 [--enable-DUMBCLOCK],
2103 [+ Dumb generic hh:mm:ss local clock]
2105 [ntp_ok=$enableval],
2111 AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
2114 AC_MSG_RESULT([$ntp_ok])
2116 AC_MSG_CHECKING([Forum Graphic GPS])
2121 [+ Forum Graphic GPS]
2123 [ntp_ok=$enableval],
2129 AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
2132 AC_MSG_RESULT([$ntp_ok])
2134 # Requires modem control
2135 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2140 [s Heath GC-1000 WWV/WWVH receiver]
2142 [ntp_ok=$enableval],
2143 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2148 AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
2151 AC_MSG_RESULT([$ntp_ok])
2153 AC_MSG_CHECKING([for hopf serial clock device])
2157 [--enable-HOPFSERIAL],
2158 [+ hopf serial clock device]
2160 [ntp_ok=$enableval],
2166 AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
2169 AC_MSG_RESULT([$ntp_ok])
2171 AC_MSG_CHECKING([for hopf PCI clock 6039])
2176 [+ hopf 6039 PCI board]
2178 [ntp_ok=$enableval],
2184 AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
2187 AC_MSG_RESULT([$ntp_ok])
2189 AC_MSG_CHECKING([HP 58503A GPS receiver])
2194 [+ HP 58503A GPS receiver]
2196 [ntp_ok=$enableval],
2202 AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
2205 AC_MSG_RESULT([$ntp_ok])
2207 AC_MSG_CHECKING([IRIG audio decoder])
2212 [s IRIG audio decoder]
2214 [ntp_ok=$enableval],
2216 case "$ntp_eac$ntp_canaudio" in
2225 AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
2228 AC_MSG_RESULT([$ntp_ok])
2229 case "$ntp_ok$ntp_canaudio" in
2230 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2233 AC_MSG_CHECKING([for JJY receiver])
2240 [ntp_ok=$enableval],
2246 AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
2249 AC_MSG_RESULT([$ntp_ok])
2251 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2256 [s Rockwell Jupiter GPS receiver]
2258 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2259 case "$ntp_jupiter_ok" in
2265 AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
2268 AC_MSG_RESULT([$ntp_ok])
2270 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2275 [+ Leitch CSD 5300 Master Clock System Driver]
2277 [ntp_ok=$enableval],
2283 AC_DEFINE([CLOCK_LEITCH], [1],
2284 [Leitch CSD 5300 Master Clock System Driver?])
2287 AC_MSG_RESULT([$ntp_ok])
2289 AC_MSG_CHECKING([local clock reference])
2293 [--enable-LOCAL-CLOCK],
2294 [+ local clock reference]
2296 [ntp_ok=$enableval],
2302 AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
2305 AC_MSG_RESULT([$ntp_ok])
2307 dnl Bug 340: longstanding unfixed bugs
2308 dnl AC_MSG_CHECKING([EES M201 MSF receiver])
2309 dnl AC_ARG_ENABLE([MSFEES],
2310 dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
2311 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2312 dnl if test "$ntp_ok" = "yes"; then
2313 dnl ntp_refclock=yes
2314 dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
2316 dnl AC_MSG_RESULT([$ntp_ok])
2319 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2324 [s Magnavox MX4200 GPS receiver]
2326 [ntp_ok=$enableval],
2328 case "$ac_cv_var_ppsclock" in
2341 AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
2344 AC_MSG_RESULT([$ntp_ok])
2345 case "$ntp_ok$host" in
2346 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
2349 AC_MSG_CHECKING([for NeoClock4X receiver])
2353 [--enable-NEOCLOCK4X],
2354 [+ NeoClock4X DCF77 / TDF receiver]
2356 [ntp_ok=$enableval],
2362 AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
2365 AC_MSG_RESULT([$ntp_ok])
2367 AC_MSG_CHECKING([NMEA GPS receiver])
2372 [+ NMEA GPS receiver]
2374 [ntp_ok=$enableval],
2380 AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
2383 AC_MSG_RESULT([$ntp_ok])
2385 AC_CHECK_FUNCS([strtoll])
2386 AC_MSG_CHECKING([for GPSD JSON receiver])
2391 [+ GPSD JSON receiver]
2393 [ntp_ok=$enableval],
2394 [case "$ac_cv_func_strtoll" in
2395 yes) ntp_ok=$ntp_eac ;;
2402 AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
2405 AC_MSG_RESULT([$ntp_ok])
2407 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2412 [s Motorola VP/UT Oncore GPS receiver]
2414 [ntp_ok=$enableval],
2417 case "$ntp_oncore_ok" in
2423 AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
2426 AC_MSG_RESULT([$ntp_ok])
2428 # Requires modem control
2429 AC_MSG_CHECKING([for Palisade clock])
2433 [--enable-PALISADE],
2436 [ntp_ok=$enableval],
2437 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2442 AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
2445 AC_MSG_RESULT([$ntp_ok])
2447 AC_MSG_CHECKING([Conrad parallel port radio clock])
2452 [+ Conrad parallel port radio clock]
2454 [ntp_ok=$enableval],
2460 AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
2463 AC_MSG_RESULT([$ntp_ok])
2465 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2470 [+ PST/Traconex 1020 WWV/WWVH receiver]
2472 [ntp_ok=$enableval],
2478 AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
2481 AC_MSG_RESULT([$ntp_ok])
2483 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2488 [- RIPENCC specific Trimble driver]
2490 [ntp_ok=$enableval],
2493 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2494 case "$ntp_ripe_ncc_ok" in
2500 AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
2503 AC_MSG_RESULT([$ntp_ok])
2505 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2506 # For *IX, we need sys/ipc.h and sys/shm.h.
2507 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2512 [s SHM clock attached thru shared memory]
2514 [ntp_ok=$enableval],
2516 case "$ntp_eac$ntp_canshm" in
2525 AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
2528 AC_MSG_RESULT([$ntp_ok])
2530 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2534 [--enable-SPECTRACOM],
2535 [+ Spectracom 8170/Netclock/2 WWVB receiver]
2537 [ntp_ok=$enableval],
2543 AC_DEFINE([CLOCK_SPECTRACOM], [1],
2544 [Spectracom 8170/Netclock/2 WWVB receiver])
2547 AC_MSG_RESULT([$ntp_ok])
2549 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2554 [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
2556 [ntp_ok=$enableval],
2558 case "$ac_cv_header_sys_tpro_h" in
2571 AC_DEFINE([CLOCK_TPRO], [1],
2572 [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2575 AC_MSG_RESULT([$ntp_ok])
2576 case "$ntp_ok$ac_cv_header_sys_tpro" in
2577 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2580 # Not on a vax-dec-bsd
2581 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2585 [--enable-TRUETIME],
2586 [s Kinemetrics/TrueTime receivers]
2588 [ntp_ok=$enableval],
2603 AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
2606 AC_MSG_RESULT([$ntp_ok])
2607 case "$ntp_ok$host" in
2608 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
2611 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2616 [- TrueTime 560 IRIG-B decoder]
2618 [ntp_ok=$enableval],
2624 AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
2627 AC_MSG_RESULT([$ntp_ok])
2629 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2634 [+ Ultralink WWVB receiver]
2636 [ntp_ok=$enableval],
2642 AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
2645 AC_MSG_RESULT([$ntp_ok])
2647 AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
2651 [--enable-TSYNCPCI],
2652 [s Spectracom TSYNC timing board]
2654 [ntp_ok=$enableval],
2668 AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
2671 AC_MSG_RESULT([$ntp_ok])
2673 AC_MSG_CHECKING([WWV receiver])
2678 [s WWV Audio receiver]
2680 [ntp_ok=$enableval],
2682 case "$ntp_eac$ntp_canaudio" in
2691 AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
2694 AC_MSG_RESULT([$ntp_ok])
2695 case "$ntp_ok$ntp_canaudio" in
2696 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2699 AC_MSG_CHECKING([for Zyfer receiver])
2704 [+ Zyfer GPStarplus receiver]
2706 [ntp_ok=$enableval],
2712 AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
2715 AC_MSG_RESULT([$ntp_ok])
2717 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2721 [--enable-parse-clocks],
2722 [- include all suitable PARSE clocks:]
2724 [ntp_eapc=$enableval],
2727 yes) ntp_eapc=$ntp_canparse ;;
2730 # Delete the next line one of these days
2734 AC_MSG_RESULT($ntp_eapc)
2736 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2738 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2741 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2749 AC_MSG_CHECKING([Diem Computime Radio Clock])
2753 [--enable-COMPUTIME],
2754 [s Diem Computime Radio Clock]
2756 [ntp_ok=$enableval],
2763 AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
2766 AC_MSG_RESULT([$ntp_ok])
2767 case "$ntp_ok$ntp_canparse" in
2769 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2772 AC_MSG_CHECKING([ELV/DCF7000 clock])
2777 [s ELV/DCF7000 clock]
2779 [ntp_ok=$enableval],
2786 AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
2789 AC_MSG_RESULT([$ntp_ok])
2790 case "$ntp_ok$ntp_canparse" in
2792 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2795 AC_MSG_CHECKING([HOPF 6021 clock])
2799 [--enable-HOPF6021],
2802 [ntp_ok=$enableval],
2809 AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
2812 AC_MSG_RESULT([$ntp_ok])
2813 case "$ntp_ok$ntp_canparse" in
2815 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2818 AC_MSG_CHECKING([Meinberg clocks])
2822 [--enable-MEINBERG],
2825 [ntp_ok=$enableval],
2832 AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
2835 AC_MSG_RESULT([$ntp_ok])
2836 case "$ntp_ok$ntp_canparse" in
2838 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2841 AC_MSG_CHECKING([DCF77 raw time code])
2846 [s DCF77 raw time code]
2848 [ntp_ok=$enableval],
2857 AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
2860 AC_MSG_RESULT([$ntp_ok])
2861 case "$ntp_ok$ntp_canparse" in
2863 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2866 case "$ntp_rawdcf" in
2868 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2869 [ntp_cv_rawdcf_parity],
2877 ntp_cv_rawdcf_parity=$ans
2880 case "$ntp_cv_rawdcf_parity" in
2882 AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
2883 [Should we not IGNPAR (Linux)?]) ;;
2887 AC_MSG_CHECKING([RCC 8000 clock])
2894 [ntp_ok=$enableval],
2901 AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
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([Schmid DCF77 clock])
2915 [s Schmid DCF77 clock]
2917 [ntp_ok=$enableval],
2924 AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
2927 AC_MSG_RESULT([$ntp_ok])
2928 case "$ntp_ok$ntp_canparse" in
2930 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2933 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
2937 [--enable-TRIMTAIP],
2938 [s Trimble GPS receiver/TAIP protocol]
2940 [ntp_ok=$enableval],
2947 AC_DEFINE([CLOCK_TRIMTAIP], [1],
2948 [Trimble GPS receiver/TAIP protocol])
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([Trimble GPS receiver/TSIP protocol])
2961 [--enable-TRIMTSIP],
2962 [s Trimble GPS receiver/TSIP protocol]
2964 [ntp_ok=$enableval],
2971 AC_DEFINE([CLOCK_TRIMTSIP], [1],
2972 [Trimble GPS receiver/TSIP protocol])
2975 AC_MSG_RESULT([$ntp_ok])
2976 case "$ntp_ok$ntp_canparse" in
2978 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2981 AC_MSG_CHECKING([WHARTON 400A Series clock])
2986 [s WHARTON 400A Series clock]
2988 [ntp_ok=$enableval],
2995 AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
2998 AC_MSG_RESULT([$ntp_ok])
2999 case "$ntp_ok$ntp_canparse" in
3001 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3004 AC_MSG_CHECKING([VARITEXT clock])
3008 [--enable-VARITEXT],
3011 [ntp_ok=$enableval],
3018 AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
3021 AC_MSG_RESULT([$ntp_ok])
3022 case "$ntp_ok$ntp_canparse" in
3024 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3027 AC_MSG_CHECKING(SEL240X clock)
3028 AC_ARG_ENABLE(SEL240X,
3029 AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
3030 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3031 if test "$ntp_ok" = "yes"; then
3034 AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
3036 AC_MSG_RESULT($ntp_ok)
3037 case "$ntp_ok$ntp_canparse" in
3039 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3043 AC_SUBST([LIBPARSE])
3044 AC_SUBST([MAKE_LIBPARSE])
3045 AC_SUBST([MAKE_LIBPARSE_KERNEL])
3046 AC_SUBST([MAKE_CHECK_Y2K])
3048 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3050 case "$ntp_libparse" in
3053 AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
3054 LIBPARSE=../libparse/libparse.a
3055 MAKE_LIBPARSE=libparse.a
3056 # HMS: check_y2k trips the 34 year problem now...
3057 false && MAKE_CHECK_Y2K=check_y2k
3059 AC_MSG_RESULT([$ans])
3065 # if we are using OpenSSL (--with-crypto), by default Autokey is enabled
3066 AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
3071 [+ support NTP Autokey protocol]
3073 [ntp_autokey=$enableval],
3074 [ntp_autokey=$ntp_openssl]
3076 case "$ntp_autokey" in
3080 case "$ntp_openssl" in
3082 AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
3086 AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
3092 AC_MSG_RESULT([$ntp_autokey])
3094 AC_SUBST([MAKE_CHECK_LAYOUT])
3095 AC_MSG_CHECKING([if we want to run check-layout])
3096 case "$cross_compiling$PATH_PERL" in
3098 MAKE_CHECK_LAYOUT=check-layout
3105 AC_MSG_RESULT([$ans])
3109 AC_MSG_CHECKING([if we can make dcf parse utilities])
3111 case "$ntp_parseutil" in
3114 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3121 AC_MSG_RESULT([$ans])
3123 AC_SUBST([MAKE_PARSEKMODULE])
3124 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3126 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3130 case "$ntp_cv_var_kernel_pll" in
3132 AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
3136 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3140 MAKE_PARSEKMODULE=parse
3141 AC_CHECK_HEADERS([strings.h])
3146 AC_MSG_RESULT([$ans])
3148 AC_MSG_CHECKING([if we need basic refclock support])
3149 case "$ntp_refclock" in
3151 AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
3154 AC_MSG_RESULT($ntp_refclock)
3156 dnl Things that can be made in clockstuff
3157 AC_SUBST([PROPDELAY], [propdelay])
3158 AC_SUBST([CHUTEST]) dnl needs work to compile
3160 AC_SUBST([MAKE_ADJTIMED])
3161 AC_MSG_CHECKING([if we want HP-UX adjtimed support])
3171 MAKE_ADJTIMED=adjtimed
3172 AC_DEFINE([NEED_HPUX_ADJTIME], [1],
3173 [Do we need HPUX adjtime() library support?])
3181 AC_MSG_RESULT([$ans])
3183 AC_MSG_CHECKING([if we want QNX adjtime support])
3193 AC_DEFINE([NEED_QNX_ADJTIME], [1],
3194 [Do we need the qnx adjtime call?])
3197 AC_MSG_RESULT([$ans])
3199 AC_MSG_CHECKING([if we can read kmem])
3201 # the default is to enable it if the system has the capability
3203 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3212 *-*-domainos) # Won't be found...
3232 # --enable-kmem / --disable-kmem controls if present
3237 [s read /dev/kmem for tick and/or tickadj]
3242 AC_MSG_RESULT([$ans])
3250 AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
3254 AC_MSG_CHECKING([if adjtime is accurate])
3256 # target-dependent defaults
3265 mips-sgi-irix[[456]]*)
3272 # XXX only verified thru AIX6.
3278 *-*-solaris2.[[01]])
3291 # --enable-accurate-adjtime / --disable-accurate-adjtime
3292 # override the default
3296 [--enable-accurate-adjtime],
3297 [s the adjtime() call is accurate]
3302 AC_MSG_RESULT([$ans])
3306 AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
3307 adjtime_is_accurate=yes
3310 adjtime_is_accurate=no
3315 [the name of 'tick' in the kernel],
3316 [ntp_cv_nlist_tick],
3320 m68*-hp-hpux*) # HP9000/300?
3330 # XXX only verified thru AIX6.
3349 ntp_cv_nlist_tick=$ans
3352 case "$ntp_cv_nlist_tick" in
3354 ;; # HMS: I think we can only get 'no' here...
3356 AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
3357 [What is the name of TICK in the kernel?])
3361 [for the units of 'tick'],
3370 ntp_cv_tick_nano=$ans
3373 case "$ntp_cv_tick_nano" in
3375 AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
3379 [the name of 'tickadj' in the kernel],
3380 [ntp_cv_nlist_tickadj],
3384 m68*-hp-hpux*) # HP9000/300?
3415 ans=no # hrestime_adj
3421 ntp_cv_nlist_tickadj=$ans
3424 case "$ntp_cv_nlist_tickadj" in
3426 ;; # HMS: I think we can only get 'no' here...
3428 AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
3429 [What is the name of TICKADJ in the kernel?])
3433 [for the units of 'tickadj'],
3434 [ntp_cv_tickadj_nano],
3442 ntp_cv_tickadj_nano=$ans
3445 case "$ntp_cv_tickadj_nano" in
3447 AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
3451 [half-heartedly for 'dosynctodr' in the kernel],
3452 [ntp_cv_nlist_dosynctodr],
3495 ntp_cv_nlist_dosynctodr=$ans
3498 case "$ntp_cv_nlist_dosynctodr" in
3502 AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
3503 [What is (probably) the name of DOSYNCTODR in the kernel?])
3508 [half-heartedly for 'noprintf' in the kernel],
3509 [ntp_cv_nlist_noprintf],
3546 ntp_cv_nlist_noprintf=$ans
3549 case "$ntp_cv_nlist_noprintf" in
3553 AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
3554 [What is (probably) the name of NOPRINTF in the kernel?])
3558 dnl The tick/tickadj sections were written by Skippy, who never learned
3559 dnl that it's impolite (horridly gross) to show your guts in public.
3562 dnl 10000 80 Unixware
3563 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3564 dnl 10000 150 sgi IRIX
3565 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3566 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3567 dnl 1000000L/hz 500/HZ other && NOKMEM
3568 dnl txc.tick 1 Linux
3569 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3570 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3571 dnl (RS6000 && !NOKMEM), SINIX MIPS
3573 dnl But we'll only use these "values" if we can't find anything else.
3575 AC_MSG_CHECKING([for a default value for 'tick'])
3577 # target-dependent default for tick
3581 AC_MSG_ERROR([tick needs work for cygwin])
3609 [--enable-tick=VALUE],
3610 [s force a value for 'tick']
3615 AC_MSG_RESULT([$ans])
3619 ;; # HMS: I think we can only get 'no' here...
3621 AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
3622 [Preset a value for 'tick'?])
3625 AC_MSG_CHECKING([for a default value for 'tickadj'])
3627 # target-specific default
3631 case "$adjtime_is_accurate" in
3646 *-*-domainos) # Skippy: won't be found...
3654 case "$adjtime_is_accurate" in
3680 [--enable-tickadj=VALUE],
3681 [s force a value for 'tickadj']
3686 AC_MSG_RESULT([$ans])
3688 default_tickadj=$ans
3690 case "$default_tickadj" in
3692 ;; # HMS: I think we can only get 'no' here...
3694 AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
3695 [Preset a value for 'tickadj'?]) ;;
3698 # Newer versions of ReliantUNIX round adjtime() values down to
3699 # 1/100s (system tick). Sigh ...
3700 # Unfortunately, there is no easy way to know if particular release
3701 # has this "feature" or any obvious way to test for it.
3704 AC_DEFINE([RELIANTUNIX_CLOCK], [1],
3705 [Do we want the ReliantUNIX clock hacks?])
3710 AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
3713 ntp_cv_make_tickadj=yes
3714 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3715 nonono) # Don't read KMEM, no presets. Bogus.
3716 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3717 ntp_cv_make_tickadj=no
3719 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3720 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3721 ntp_cv_make_tickadj=no
3723 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3724 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3725 ntp_cv_make_tickadj=no
3727 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3729 yesnono) # Read KMEM, no presets. Cool.
3731 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3732 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3734 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3736 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3738 *) # Generally bogus.
3739 AC_MSG_ERROR([This shouldn't happen.])
3743 AC_SUBST(MAKE_NTPTIME)
3744 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3746 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
3756 ac_cv_make_ntptime=$ans])
3757 case "$ac_cv_make_ntptime" in
3759 MAKE_NTPTIME=ntptime
3769 AC_SUBST([MAKE_TICKADJ])
3772 # tickadj is pretty useless on newer versions of ReliantUNIX
3774 ntp_cv_make_tickadj=no
3777 ntp_cv_make_tickadj=no
3780 # DLM says tickadj is a no-no starting with solaris2.5
3782 *-*-solaris2.1[[0-9]]*)
3783 ntp_cv_make_tickadj=no
3785 *-*-solaris2.[[0-4]]*) ;;
3786 *) ntp_cv_make_tickadj=no ;;
3790 ntp_cv_make_tickadj=no
3795 # Despite all the above, we always make tickadj. Setting
3796 # ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3797 # report that the configuration variable was cached. It may
3798 # be better to simply remove the hunk above, I did not want
3799 # to remove it if there is hope it will be used again.
3801 AS_UNSET([ntp_cv_make_tickadj])
3804 [if we want and can make the tickadj utility],
3805 [ntp_cv_make_tickadj],
3806 [ntp_cv_make_tickadj=yes]
3808 case "$ntp_cv_make_tickadj" in
3810 MAKE_TICKADJ=tickadj
3824 AC_SUBST([MAKE_TIMETRIM])
3826 [if we want and can make the timetrim utility],
3827 [ntp_cv_make_timetrim],
3831 ntp_cv_make_timetrim=yes
3834 ntp_cv_make_timetrim=yes
3837 ntp_cv_make_timetrim=no
3842 case "$ntp_cv_make_timetrim" in
3844 MAKE_TIMETRIM=timetrim
3853 AC_SUBST([MAKE_LIBNTPSIM])
3854 AC_SUBST([MAKE_NTPDSIM])
3856 AC_MSG_CHECKING([if we want to build the NTPD simulator])
3860 [--enable-simulator],
3861 [- build/install the NTPD simulator?]
3866 AC_MSG_RESULT([$ans])
3869 MAKE_NTPDSIM=ntpdsim
3870 MAKE_LIBNTPSIM=libntpsim.a
3885 LDFLAGS="$LDFLAGS -r"
3893 AC_MSG_CHECKING([if we want to build ntpsnmpd])
3898 [s Build ntpsnmpd MIB agent?]
3902 case "$PATH_NET_SNMP_CONFIG" in
3908 AC_MSG_RESULT([$ans])
3911 case "$PATH_NET_SNMP_CONFIG" in
3913 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
3914 # Bug 2815. This is a bit of a hack, but it works...
3915 case "$ntp_cv_net_snmp_version" in
3916 5.3*) SNMP_LIBS=`echo $SNMP_LIBS | $SED -e 's/-lnetsnmpagent/-lnetsnmpagent -lnetsnmpmibs/'`
3919 AC_SUBST([SNMP_LIBS])
3920 # HMS: we really want to separate CPPFLAGS and CFLAGS
3921 foo=`$PATH_NET_SNMP_CONFIG --cflags`
3927 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
3929 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
3933 AC_SUBST([SNMP_CPPFLAGS])
3934 AC_SUBST([SNMP_CFLAGS])
3937 save_CPPFLAGS=$CPPFLAGS
3940 CPPFLAGS=$SNMP_CPPFLAGS
3943 [net-snmp/net-snmp-config.h],
3944 [MAKE_NTPSNMPD=ntpsnmpd],
3945 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
3948 # Do this last, as we're messing up LIBS.
3949 # check -lnetsnmp for netsnmp_daemonize
3950 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
3953 [netsnmp_daemonize],
3959 AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
3960 [We need to provide netsnmp_daemonize()])
3964 AS_UNSET([save_CFLAGS])
3965 CPPFLAGS=$save_CPPFLAGS
3966 AS_UNSET([save_CPPFLAGS])
3968 AS_UNSET([save_LIBS])
3971 AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
3976 AC_SUBST([MAKE_NTPSNMPD])
3978 case "$MAKE_NTPSNMPD" in
3987 AC_MSG_CHECKING([if we should always slew the time])
3989 # target-specific defaults
4001 *-*-openvms*) # HMS: won't be found
4008 # --enable-slew-always / --disable-slew-always overrides default
4013 [--enable-slew-always],
4014 [s always slew the time]
4019 AC_MSG_RESULT([$ans])
4023 AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
4026 AC_MSG_CHECKING([if we should step and slew the time])
4041 *-*-solaris2.1[[0-9]]*)
4044 *-*-solaris2.[[012]]*)
4047 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
4057 [--enable-step-slew],
4058 [s step and slew the time]
4063 AC_MSG_RESULT([$ans])
4067 AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
4070 AC_MSG_CHECKING([if ntpdate should step the time])
4083 [--enable-ntpdate-step],
4084 [s if ntpdate should step the time]
4089 AC_MSG_RESULT([$ans])
4093 AC_DEFINE([FORCE_NTPDATE_STEP], [1],
4094 [force ntpdate to step the clock if !defined(STEP_SLEW) ?])
4098 AC_MSG_CHECKING([if we should sync TODR clock every hour])
4104 *-*-openvms*) # HMS: won't be found
4115 [--enable-hourly-todr-sync],
4116 [s if we should sync TODR hourly]
4121 AC_MSG_RESULT([$ans])
4123 case "$ac_cv_var_sync_todr" in
4125 AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
4129 AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4142 # Generic_105181-17 and higher
4163 # Generic_106541-07 and higher
4182 [--enable-kernel-fll-bug],
4183 [s if we should avoid a kernel FLL bug]
4188 AC_MSG_RESULT([$ans])
4192 AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
4196 AC_MSG_CHECKING([if we want new session key behavior])
4200 [--enable-bug1243-fix],
4201 [+ use unmodified autokey session keys]
4206 AC_MSG_RESULT([$ans])
4209 AC_DEFINE([DISABLE_BUG1243_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 dnl gtest is needed for our tests subdirs. It would be nice if we could
4381 dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
4382 dnl can't be conditionalized.
4387 AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
4388 [Default location of crypto key info])
4390 AC_CONFIG_FILES([Makefile])
4391 AC_CONFIG_FILES([adjtimed/Makefile])
4392 AC_CONFIG_FILES([clockstuff/Makefile])
4393 AC_CONFIG_FILES([include/Makefile])
4394 AC_CONFIG_FILES([include/isc/Makefile])
4395 AC_CONFIG_FILES([kernel/Makefile])
4396 AC_CONFIG_FILES([kernel/sys/Makefile])
4397 AC_CONFIG_FILES([libntp/Makefile])
4398 AC_CONFIG_FILES([libparse/Makefile])
4399 AC_CONFIG_FILES([ntpd/Makefile])
4400 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])
4401 AC_CONFIG_FILES([ntpdate/Makefile])
4402 AC_CONFIG_FILES([ntpdc/Makefile])
4403 AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
4404 AC_CONFIG_FILES([ntpq/Makefile])
4405 AC_CONFIG_FILES([ntpsnmpd/Makefile])
4406 AC_CONFIG_FILES([parseutil/Makefile])
4407 AC_CONFIG_FILES([scripts/Makefile])
4408 AC_CONFIG_FILES([scripts/build/Makefile])
4409 AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
4410 AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
4411 AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
4412 AC_CONFIG_FILES([scripts/lib/Makefile])
4413 AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
4414 AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
4415 AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
4416 AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
4417 AC_CONFIG_FILES([scripts/ntptrace/Makefile])
4418 AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
4419 AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
4420 AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
4421 AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
4422 AC_CONFIG_FILES([scripts/update-leap/Makefile])
4423 AC_CONFIG_FILES([scripts/update-leap/update-leap], [chmod +x scripts/update-leap/update-leap])
4424 AC_CONFIG_FILES([tests/Makefile])
4425 AC_CONFIG_FILES([tests/bug-2803/Makefile])
4426 AC_CONFIG_FILES([tests/libntp/Makefile])
4427 AC_CONFIG_FILES([tests/ntpd/Makefile])
4428 AC_CONFIG_FILES([tests/sandbox/Makefile])
4429 AC_CONFIG_FILES([tests/sec-2853/Makefile])
4430 AC_CONFIG_FILES([util/Makefile])
4432 perllibdir="${datadir}/ntp/lib"
4433 AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
4435 calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
4436 AC_SUBST_FILE([calc_tickadj_opts])
4437 ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
4438 AC_SUBST_FILE([ntp_wait_opts])
4439 ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
4440 AC_SUBST_FILE([ntpsweep_opts])
4441 ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
4442 AC_SUBST_FILE([ntptrace_opts])
4443 summary_opts="$srcdir/scripts/summary-opts"
4444 AC_SUBST_FILE([summary_opts])
4445 plot_summary_opts="$srcdir/scripts/plot_summary-opts"
4446 AC_SUBST_FILE([plot_summary_opts])
4448 AC_CONFIG_SUBDIRS([sntp])