2 dnl Process this file with autoconf to produce a configure script.
3 m4_include([version.m4])
4 AC_INIT(ntp, VERSION_NUMBER)
7 dnl the 'build' machine is where we run configure and compile
8 dnl the 'host' machine is where the resulting stuff runs.
9 AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) of where we should run])
10 AM_CONFIG_HEADER([config.h])
15 ac_cv_var_oncore_ok=no
17 ac_cv_var_ripe_ncc_ok=no
18 ac_cv_var_jupiter_ok=no
20 dnl Grab any initial CFLAGS so we can pick better defaults.
23 dnl check these early to avoid autoconf warnings
27 # So far, the only shared library we might use is libopts.
28 # It's a small library - we might as well use a static version of it.
31 dnl we need to check for cross compile tools for vxWorks here
33 # Ralf Wildenhues: With per-target flags we need CC_C_O
34 # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
39 # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
42 CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
44 *-*-hpux10.*) # at least for hppa2.0-hp-hpux10.20
48 *) CFLAGS="$CFLAGS -Wp,-H18816"
53 CFLAGS="$CFLAGS -DSYS_CYGWIN32"
58 CFLAGS="$CFLAGS -Wc,+abi-socket"
63 CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
64 LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
68 # see "man standards".
69 # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
70 # -D_XOPEN_SOURCE=600 seems OK for c99
71 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
72 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
79 # NTP has (so far) been relying on leading-edge autogen.
80 # Therefore, by default:
81 # - use the version we ship with
83 # - build a static copy (AC_DISABLE_SHARED - done earlier)
84 case "${enable_local_libopts+set}" in
86 *) enable_local_libopts=yes ;;
88 case "${enable_libopts_install+set}" in
90 *) enable_libopts_install=no ;;
92 LIBOPTS_CHECK(libopts)
95 [if $CC can handle @%:@warning],
99 AC_LANG_PROGRAM([], [#warning foo]),
100 [ac_cv_cpp_warning=yes],
101 [ac_cv_cpp_warning=no],
106 case "$ac_cv_cpp_warning" in
108 AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid @%:@warning on option name collisions?])
113 SAVED_CFLAGS_AC="$CFLAGS"
114 CFLAGS="$CFLAGS -Wstrict-overflow"
116 [if $CC can handle -Wstrict-overflow],
117 ac_cv_gcc_Wstrict_overflow,
120 [AC_LANG_PROGRAM([], [])],
121 [ac_cv_gcc_Wstrict_overflow=yes],
122 [ac_cv_gcc_Wstrict_overflow=no]
126 CFLAGS="$SAVED_CFLAGS_AC"
127 unset SAVED_CFLAGS_AC
129 # $ac_cv_gcc_Wstrict_overflow is tested later to add the
137 SAVED_CFLAGS_AC="$CFLAGS"
138 CFLAGS="$CFLAGS -Winit-self"
140 [if $CC can handle -Winit-self],
141 ac_cv_gcc_Winit_self,
144 [AC_LANG_PROGRAM([], [])],
145 [ac_cv_gcc_Winit_self=yes],
146 [ac_cv_gcc_Winit_self=no]
150 CFLAGS="$SAVED_CFLAGS_AC"
151 unset SAVED_CFLAGS_AC
153 # $ac_cv_gcc_Winit_self is tested later to add the
160 AC_MSG_CHECKING([for bin subdirectory])
161 AC_ARG_WITH(binsubdir,
162 AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
163 use_binsubdir="$withval", use_binsubdir="bin")
165 case "$use_binsubdir" in
171 AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
174 AC_MSG_RESULT($use_binsubdir)
175 BINSUBDIR=$use_binsubdir
178 AC_MSG_CHECKING([if we want to use arlib])
180 AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
181 [ans=$withval], [ans=no])
182 AC_MSG_RESULT([$ans])
184 if test -d $srcdir/arlib
189 AC_CONFIG_SUBDIRS(arlib)
196 AC_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
197 [ans=$withval], [ans=x])
206 # HMS: Why isn't this $build?
207 # Well, that depends on if we need this for the build toolchain or
208 # for info in the host executable...
209 # I still have no idea which way this should go, but nobody has complained.
212 case "$need_dash_r" in
219 case "$need_dash_r" in
233 # Quick and dirty sanity check
235 '') AC_MSG_ERROR(Please follow the directions in html/build/hints/vxworks.html!)
238 CFLAGS="$CFLAGS -DSYS_VXWORKS"
244 dnl we need to check for cross compile tools for vxWorks here
252 CFLAGS="$CFLAGS -Wall"
253 # CFLAGS="$CFLAGS -Wcast-align"
254 CFLAGS="$CFLAGS -Wcast-qual"
255 # CFLAGS="$CFLAGS -Wconversion"
256 # CFLAGS="$CFLAGS -Werror"
257 # CFLAGS="$CFLAGS -Wextra"
258 # CFLAGS="$CFLAGS -Wfloat-equal"
259 CFLAGS="$CFLAGS -Wmissing-prototypes"
260 CFLAGS="$CFLAGS -Wpointer-arith"
261 CFLAGS="$CFLAGS -Wshadow"
263 # OpenSSL has a number of callback prototypes
264 # inside other function prototypes which trigger
265 # warnings with -Wstrict-prototypes, such as:
267 # int i2d_RSA_NET(const RSA *a, unsigned char **pp,
268 # int (*cb)(), int sgckey);
271 CFLAGS="$CFLAGS -Wno-strict-prototypes"
272 # CFLAGS="$CFLAGS -Wtraditional"
273 # CFLAGS="$CFLAGS -Wwrite-strings"
274 case "$ac_cv_gcc_Winit_self" in
276 CFLAGS="$CFLAGS -Winit-self"
278 case "$ac_cv_gcc_Wstrict_overflow" in
280 #not yet: CFLAGS="$CFLAGS -Wstrict-overflow"
287 CFLAGS="$CFLAGS -posix"
289 dnl This is currently commented out by bor.
290 dnl The new versions of ReliantUNIX round adjtime() interval down
291 dnl to 1/100s (system tick). This makes tickadj actually useless.
292 dnl So, I'd better not use additional flags.
293 dnl I leave it here just in case anybody has better idea
294 dnl mips-sni-sysv4* )
296 dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
298 dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
299 dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
304 ac_busted_vpath_in_make=no
307 *-*-irix6.1*) # 64 bit only
310 *-*-irix6*) # 6.2 (and later?)
311 ac_busted_vpath_in_make=yes
314 ac_busted_vpath_in_make=yes
317 ac_busted_vpath_in_make=yes
321 case "$ac_busted_vpath_in_make$srcdir" in
324 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
326 AC_MSG_ERROR([building outside of the main directory requires GNU make])
336 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
337 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
342 AC_PROG_GCC_TRADITIONAL
345 AC_PATH_PROG(PATH_SH, sh)
346 AC_PATH_PROG(PATH_PERL, perl)
348 hs_ULONG_CONST # remove for 4.2.5
352 ac_link="$ac_link $VX_KERNEL"
360 AC_CHECK_LIB(advapi32, main)
364 AC_CHECK_FUNC([gethostent], ,
365 AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket]))
366 AC_CHECK_FUNC([openlog], ,
367 AC_SEARCH_LIBS([openlog], [gen], ,
368 AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])))
369 AC_SEARCH_LIBS([MD5Init], [md5 md])
370 AC_CHECK_FUNCS(MD5Init)
372 # following block becomes on 4.2.5: NTP_LINEEDITLIBS
373 dnl HMS: What a hack...
374 AC_CHECK_HEADERS(readline/history.h readline/readline.h)
375 case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
379 # Ralf Wildenhues: either unset ... or cache READLINE_LIBS
380 unset ac_cv_lib_readline_readline
381 AC_CHECK_LIB(readline, readline, ,
382 AC_MSG_NOTICE([Trying again with -lcurses])
383 unset ac_cv_lib_readline_readline
384 AC_CHECK_LIB(readline, readline,
385 LIBS="-lreadline -lcurses $LIBS"
386 AC_DEFINE(HAVE_LIBREADLINE)
387 AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
388 AC_CHECK_LIB(edit, readline,
389 LIBS="-ledit -lcurses"
390 AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
391 AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
395 AC_SUBST(READLINE_LIBS)
400 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
401 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
402 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
403 dnl does Strange Things with extra processes using the Posix-compatibility
404 dnl real-time library, so we don't want to use it.
409 AC_CHECK_LIB(rt, sched_setscheduler, ,
410 AC_CHECK_LIB(posix4, sched_setscheduler))
414 AC_CHECK_FUNC(setsockopt, ,
415 [AC_SEARCH_LIBS([setsockopt], [socket xnet])])
418 AC_CHECK_HEADERS(bstring.h)
419 AC_CHECK_HEADER(dns_sd.h,
420 [AC_CHECK_LIB(dns_sd,
422 [AC_DEFINE(HAVE_DNSREGISTRATION, 1,
423 [Use Rendezvous/DNS-SD registration])])])
424 case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
425 yes) LIBS="-ldns_sd $LIBS" ;;
427 AC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h math.h)
429 # HMS: Lame, but fast.
430 if test -f /etc/redhat-release
434 AC_CHECK_HEADERS(md5.h, [], [],
435 [#if HAVE_SYS_TYPES_H
436 #include <sys/types.h>
440 AC_CHECK_HEADERS(memory.h netdb.h poll.h)
441 AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
442 AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
445 AC_CHECK_HEADERS(utmpx.h)
446 case "$ac_cv_header_utmpx_h" in
448 *) AC_CHECK_HEADERS(utmp.h) ;;
451 *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
453 AC_CHECK_HEADERS(arpa/nameser.h)
454 AC_CHECK_HEADERS(sys/socket.h)
455 AC_CHECK_HEADERS(net/if.h, [], [],
456 [#if HAVE_SYS_SOCKET_H
457 #include <sys/socket.h>
460 AC_CHECK_HEADERS(net/if6.h)
461 AC_CHECK_HEADERS(net/route.h, [], [], [
462 #include <sys/types.h>
463 #include <sys/socket.h>
466 AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
467 AC_CHECK_HEADERS(netinet/in.h)
468 AC_CHECK_HEADERS(netinet/ip.h, [], [],
469 [#if HAVE_SYS_TYPES_H
470 #include <sys/types.h>
472 #if HAVE_NETINET_IN_H
473 #include <netinet/in.h>
475 #if HAVE_NETINET_IN_SYSTM_H
476 #include <netinet/in_systm.h>
480 # Check for IPTOS_PREC
482 [IPPROTO_IP IP_TOS IPTOS_LOWDELAY],
489 #include <sys/types.h>
491 #if HAVE_NETINET_IP_H
492 #include <netinet/in.h>
493 #include <netinet/ip.h>
495 #if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY)
505 case "$ac_cv_ip_tos" in
507 AC_DEFINE(HAVE_IPTOS_SUPPORT, 1, [Do we have IPTOS support?])
510 AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
511 AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
512 dnl AC_CHECK_HEADERS(sys/chudefs.h)
513 AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
516 *) AC_CHECK_HEADERS(sys/ioctl.h)
519 AC_CHECK_HEADERS(sys/ipc.h)
520 AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
521 # HMS: Check sys/proc.h and sys/resource.h after some others
522 AC_CHECK_HEADERS(sys/ppstime.h)
523 case "$ac_cv_header_sched_h" in
525 *) AC_CHECK_HEADERS(sys/sched.h) ;;
529 AC_CHECK_HEADERS(sys/sio.h)
532 # HMS: Check sys/shm.h after some others
533 AC_CHECK_HEADERS(sys/select.h sys/signal.h sys/sockio.h)
534 # HMS: Checked sys/socket.h earlier
537 *) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
540 AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
541 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
542 AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
545 # include <sys/time.h>
550 #include <sys/timepps.h>
551 #ifdef PPS_API_VERS_1
554 ], [AC_CHECK_HEADERS(sys/timepps.h, [], [],
556 # include <sys/time.h>
563 AC_CHECK_HEADERS(sys/timers.h sys/tpro.h sys/types.h sys/wait.h)
567 AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
570 AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
576 AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
579 case "$ac_cv_func___adjtimex" in
582 AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
583 dnl AC_CHECK_LIB(kvm, main, , , -lelf)
584 AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
585 AC_CHECK_LIB(ld, nlist)
586 AC_CHECK_LIB(mld, nlist)
587 AC_CHECK_HEADER(nlist.h,
588 [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
589 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
590 [AC_TRY_COMPILE([#include <nlist.h>],
591 [struct nlist n; n.n_un.n_name = 0;],
592 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
593 if test $ac_cv_struct_nlist_n_un = yes; then
594 AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
600 dnl AC_CHECK_HEADERS(net/if.h, [], [],
601 dnl [#if HAVE_SYS_TYPES_H
602 dnl # include <sys/types.h>
604 dnl #if HAVE_SYS_SOCKET_H
605 dnl # include <sys/socket.h>
609 AC_CHECK_HEADERS(sys/proc.h, [], [],
610 [#if HAVE_SYS_TYPES_H
611 # include <sys/types.h>
614 # include <sys/time.h>
618 AC_CHECK_HEADERS(sys/resource.h, [], [],
620 # include <sys/time.h>
624 AC_CHECK_HEADERS(sys/shm.h, [], [],
625 [#if HAVE_SYS_TYPES_H
626 # include <sys/types.h>
629 # include <sys/ipc.h>
633 AC_CHECK_HEADERS(sys/timex.h, [], [],
635 # include <sys/time.h>
639 AC_CHECK_HEADERS(resolv.h, [], [],
640 [#if HAVE_SYS_TYPES_H
641 #include <sys/types.h>
643 #if HAVE_NETINET_IN_H
644 #include <netinet/in.h>
646 #if HAVE_ARPA_NAMESER_H
647 #include <arpa/nameser.h>
651 AC_CACHE_CHECK([for basic volatile support], ac_cv_c_volatile,
654 ac_cv_c_volatile=yes,
657 case "$ac_cv_c_volatile" in
660 *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
665 # following block goes away in 4.2.5
667 # AM_C_PROTOTYPES gives us ansi2knr
670 # Assume that solaris2 is Ansi C...
676 AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
678 extern int foo (short);
679 int foo(short i) { return i; }],[
680 int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
682 if test "$ac_cv_have_prototypes" = yes; then
683 AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
694 AC_CHECK_TYPE(time_t, long)
695 AC_CHECK_SIZEOF(time_t)
696 AC_CHECK_TYPES(uintptr_t)
698 AH_VERBATIM([TYPEDEF_UINTPTR_T],
699 [/* Provide a typedef for uintptr_t? */
700 #ifndef HAVE_UINTPTR_T
701 typedef unsigned int uintptr_t;
702 #define HAVE_UINTPTR_T 1
707 AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
708 [AC_TRY_COMPILE([#include <sys/types.h>],
709 [u_int8_t len = 42; return 0;],
710 ac_cv_type_u_int8_t=yes,
711 ac_cv_type_u_int8_t=no)
713 if test $ac_cv_type_u_int8_t = yes; then
714 AC_DEFINE(HAVE_TYPE_U_INT8_T, 1, [Does u_int8_t exist?])
717 AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
718 [AC_TRY_COMPILE([#include <sys/types.h>],
719 [u_int64_t len = 42; return 0;],
720 ac_cv_type_u_int64_t=yes,
721 ac_cv_type_u_int64_t=no)
723 if test $ac_cv_type_u_int64_t = yes; then
724 AC_DEFINE(HAVE_TYPE_U_INT64_T, 1, [Does u_int64_t exist?])
728 # Look for in_port_t.
730 AC_MSG_CHECKING([for in_port_t])
732 #include <sys/types.h>
733 #include <netinet/in.h>],
734 [in_port_t port = 25; return (0);],
738 AC_DEFINE(ISC_PLATFORM_NEEDPORTT, 1, [Do we need our own in_port_t?])
741 AC_CACHE_CHECK([for a fallback value for HZ], ac_cv_var_default_hz,
742 [ac_cv_var_default_hz=100
744 alpha*-dec-osf4*|alpha*-dec-osf5*)
745 ac_cv_var_default_hz=1024
748 ac_cv_var_default_hz=256
751 AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
753 AC_CACHE_CHECK([if we need to override the system's value for HZ], ac_cv_var_override_hz,
754 [ac_cv_var_override_hz=no
756 alpha*-dec-osf4*|alpha*-dec-osf5*)
757 ac_cv_var_override_hz=yes
760 ac_cv_var_override_hz=yes
763 ac_cv_var_override_hz=yes
766 ac_cv_var_override_hz=yes
769 case "$ac_cv_var_override_hz" in
771 AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
775 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
776 dnl [AC_TRY_LINK([#include <sys/types.h>
777 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
778 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
779 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
780 dnl AC_DEFINE(HAVE_UT_HOST)
783 dnl AC_MSG_CHECKING(if we can get the system boot time)
784 dnl AC_CACHE_VAL(su_cv_have_boot_time,
785 dnl [AC_EGREP_CPP(yes,
786 dnl [#ifdef HAVE_UTMPX_H
787 dnl #include <utmpx.h>
789 dnl #include <utmp.h>
794 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
795 dnl AC_MSG_RESULT($su_cv_have_boot_time)
797 AC_CACHE_CHECK([for struct rt_msghdr], ac_cv_struct_rt_msghdr,
799 #include <sys/types.h>
800 #include <sys/socket.h>
802 #include <net/route.h>],
803 [struct rt_msghdr p;],
804 ac_cv_struct_rt_msghdr=yes,
805 ac_cv_struct_rt_msghdr=no)
808 if test $ac_cv_struct_rt_msghdr = yes; then
809 AC_DEFINE(HAS_ROUTING_SOCKET, 1, [Do we have a routing socket (struct rt_msghdr)?])
813 [struct sigaction for sa_sigaction],
814 ac_cv_struct_sigaction_has_sa_sigaction,
817 [#include <signal.h>],
818 [struct sigaction act; act.sa_sigaction = 0;],
819 ac_cv_struct_sigaction_has_sa_sigaction=yes,
820 ac_cv_struct_sigaction_has_sa_sigaction=no
824 if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
825 AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
828 AC_CACHE_CHECK([for struct ppsclockev], ac_cv_struct_ppsclockev,
830 #include <sys/types.h>
831 #ifdef HAVE_SYS_TERMIOS_H
832 # include <sys/termios.h>
834 #ifdef HAVE_SYS_TIME_H
835 # include <sys/time.h>
837 #ifdef HAVE_SYS_PPSCLOCK_H
838 # include <sys/ppsclock.h>
840 extern struct ppsclockev *pce;
841 return pce->serial;],
842 ac_cv_struct_ppsclockev=yes,
843 ac_cv_struct_ppsclockev=no)
845 if test $ac_cv_struct_ppsclockev = yes; then
846 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
849 AC_CACHE_CHECK([struct sockaddr for sa_len], ac_cv_struct_sockaddr_has_sa_len,
851 #include <sys/types.h>
852 #include <sys/socket.h>],[
853 extern struct sockaddr *ps;
855 ac_cv_struct_sockaddr_has_sa_len=yes,
856 ac_cv_struct_sockaddr_has_sa_len=no)
858 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
859 AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
862 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
864 #include <sys/types.h>
865 #include <sys/socket.h>
866 #include <netinet/in.h>
868 struct sockaddr_storage n;],
869 ac_cv_struct_sockaddr_storage=yes,
870 ac_cv_struct_sockaddr_storage=no)
872 if test $ac_cv_struct_sockaddr_storage = yes; then
873 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
876 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
877 ac_cv_have_ss_family_in_struct_ss, [
880 #include <sys/types.h>
881 #include <sys/socket.h>
883 [ struct sockaddr_storage s; s.ss_family = 1; ],
884 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
885 [ ac_cv_have_ss_family_in_struct_ss="no" ],
888 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
889 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
891 # Hack around a problem...
892 # HMS: This is $host because we need the -D if we are building *for* it.
893 # HMS: 061029: Now that we separate the ss_* checks this is causing
894 # a problem - disable it until we get to the bottom of it.
896 XXX*-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
901 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
902 ac_cv_have___ss_family_in_struct_ss, [
905 #include <sys/types.h>
906 #include <sys/socket.h>
908 [ struct sockaddr_storage s; s.__ss_family = 1; ],
909 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
910 [ ac_cv_have___ss_family_in_struct_ss="no" ]
913 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
914 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
917 AH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
918 [/* Handle ss_family */
919 #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
920 # define ss_family __ss_family
921 #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
923 AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
924 ac_cv_have_ss_len_in_struct_ss, [
927 #include <sys/types.h>
928 #include <sys/socket.h>
930 [ struct sockaddr_storage s; s.ss_len = 1; ],
931 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
932 [ ac_cv_have_ss_len_in_struct_ss="no" ],
935 if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
936 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len?])
939 AC_CACHE_CHECK([for __ss_len field in struct sockaddr_storage],
940 ac_cv_have___ss_len_in_struct_ss, [
943 #include <sys/types.h>
944 #include <sys/socket.h>
946 [ struct sockaddr_storage s; s.__ss_len = 1; ],
947 [ ac_cv_have___ss_len_in_struct_ss="yes" ],
948 [ ac_cv_have___ss_len_in_struct_ss="no" ]
951 if test "x$ac_cv_have___ss_len_in_struct_ss" = "xyes" ; then
952 AC_DEFINE(HAVE___SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have __ss_len?])
955 AH_VERBATIM([X_HAVE_SS_LEN_IN_SS],
957 #if !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE___SS_LEN_IN_SS)
958 # define ss_len __ss_len
959 #endif /* !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE_SA_LEN_IN_SS) */])
961 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
963 AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
965 #ifdef HAVE_MACHINE_SOUNDCARD_H
966 # include <machine/soundcard.h>
968 #ifdef HAVE_SYS_SOUNDCARD_H
969 # include <sys/soundcard.h>
971 extern struct snd_size *ss;
972 return ss->rec_size;],
973 ac_cv_struct_snd_size=yes,
974 ac_cv_struct_snd_size=no)
976 case "$ac_cv_struct_snd_size" in
977 yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
982 AC_CACHE_CHECK([struct clockinfo for hz], ac_cv_struct_clockinfo_has_hz,
984 #include <sys/time.h>],[
985 extern struct clockinfo *pc;
987 ac_cv_struct_clockinfo_has_hz=yes,
988 ac_cv_struct_clockinfo_has_hz=no)
990 if test $ac_cv_struct_clockinfo_has_hz = yes; then
991 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
994 AC_CACHE_CHECK([struct clockinfo for tickadj], ac_cv_struct_clockinfo_has_tickadj,
996 #include <sys/time.h>],[
997 extern struct clockinfo *pc;
998 return pc->tickadj;],
999 ac_cv_struct_clockinfo_has_tickadj=yes,
1000 ac_cv_struct_clockinfo_has_tickadj=no)
1002 if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
1003 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
1006 AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
1008 #include <sys/time.h>
1009 /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
1013 #ifdef HAVE_SYS_TIMEPPS_H
1014 # define FRAC 4294967296
1015 # include <sys/timepps.h>
1017 [struct timespec n;],
1018 ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
1019 if test $ac_cv_struct_timespec = yes; then
1020 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
1023 AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
1025 #include <sys/time.h>
1026 #include <sys/timex.h>],
1027 [struct ntptimeval n;],
1028 ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
1029 if test $ac_cv_struct_ntptimeval = yes; then
1030 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
1033 AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
1034 [#ifdef HAVE_SYS_TIME_H
1035 #include <sys/time.h>
1041 #ifdef HAVE_SYS_TIMEX_H
1042 #include <sys/timex.h>
1044 # ifdef HAVE_TIMEX_H
1051 case "$ac_cv_c_inline" in
1055 AC_DEFINE(HAVE_INLINE,1,[inline keyword or macro available])
1056 AC_SUBST(HAVE_INLINE)
1059 AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
1060 AC_CHECK_SIZEOF(signed char)
1061 AC_CHECK_SIZEOF(int)
1062 AC_CHECK_SIZEOF(long)
1064 AC_CHECK_TYPES([s_char])
1065 case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
1067 # We have a typedef for s_char. Might as well believe it...
1070 # We have signed chars, can't say 'signed char', no s_char typedef.
1071 AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
1074 # We have signed chars, can say 'signed char', no s_char typedef.
1075 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
1078 # We have unsigned chars, can't say 'signed char', no s_char typedef.
1079 AC_MSG_ERROR(No way to specify a signed character!)
1082 # We have unsigned chars, can say 'signed char', no s_char typedef.
1083 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
1090 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
1091 # (returning ENOSYS). I didn't check 4.2. If, in the future,
1092 # IBM pulls its thumbs out long enough to implement clock_settime,
1093 # this conditional will need to change. Maybe use AC_TRY_RUN
1094 # instead to try to set the time to itself and check errno.
1096 *) AC_CHECK_FUNCS(clock_gettime clock_settime)
1099 AC_CHECK_FUNCS(daemon)
1100 AC_CHECK_FUNCS(finite, ,
1101 [AC_CHECK_FUNCS(isfinite, ,
1102 [AC_MSG_CHECKING([for isfinite with <math.h>])
1105 AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
1107 AC_DEFINE(HAVE_ISFINITE)],
1110 AC_CHECK_FUNCS(getbootfile getclock getdtablesize)
1112 AC_ARG_ENABLE(getifaddrs,
1113 AC_HELP_STRING([--enable-getifaddrs],
1114 [s Enable the use of getifaddrs() [[yes|no|glibc]].
1115 glibc: Use getifaddrs() in glibc if you know it supports IPv6.]),
1116 want_getifaddrs="$enableval", want_getifaddrs="yes")
1118 case $want_getifaddrs in
1121 # Do we have getifaddrs() ?
1125 # Some recent versions of glibc support getifaddrs() which does not
1126 # provide AF_INET6 addresses while the function provided by the USAGI
1127 # project handles the AF_INET6 case correctly. We need to avoid
1128 # using the former but prefer the latter unless overridden by
1129 # --enable-getifaddrs=glibc.
1130 if test $want_getifaddrs = glibc
1132 AC_CHECK_FUNCS(getifaddrs)
1135 LIBS="-L/usr/local/v6/lib $LIBS"
1136 AC_CHECK_LIB(inet6, getifaddrs,
1137 LIBS="$LIBS -linet6"
1138 AC_DEFINE(HAVE_GETIFADDRS),
1143 AC_CHECK_FUNCS(getifaddrs)
1151 AC_MSG_CHECKING([type of socklen arg for getsockname()])
1152 AC_CACHE_VAL(ac_cv_func_getsockname_arg2,dnl
1153 [AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl
1154 [for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do
1155 for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
1157 [#ifdef HAVE_SYS_TYPES_H
1158 #include <sys/types.h>
1160 #ifdef HAVE_SYS_SOCKET_H
1161 #include <sys/socket.h>
1163 extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl
1164 [ac_not_found=no ; break 2], ac_not_found=yes)
1169 if test "$ac_not_found" = yes; then
1170 ac_cv_func_getsockname_socklen_type='socklen_t'
1172 AC_MSG_RESULT([$ac_cv_func_getsockname_socklen_type])
1173 AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
1174 $ac_cv_func_getsockname_socklen_type,
1175 [What is getsockname()'s socklen type?])
1177 AC_CHECK_FUNCS(getrusage)
1178 AC_CHECK_FUNC(gettimeofday, ,[
1180 *-*-mpeix*) ac_cv_func_gettimeofday=yes
1186 *) AC_CHECK_FUNCS(getuid)
1189 AC_CHECK_FUNCS(hstrerror)
1192 # Check for if_nametoindex() for IPv6 scoped addresses support
1194 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1195 ac_cv_have_if_nametoindex=no)
1196 case $ac_cv_have_if_nametoindex in
1200 AC_CHECK_LIB(ipv6, if_nametoindex,
1201 ac_cv_have_if_nametoindex=yes
1202 LIBS="-lipv6 $LIBS",)
1206 case $ac_cv_have_if_nametoindex in
1208 AC_DEFINE(ISC_PLATFORM_HAVEIFNAMETOINDEX, 1, [ISC: do we have if_nametoindex()?])
1212 AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
1213 AC_CHECK_FUNC(inet_pton, [], [AC_DEFINE(ISC_PLATFORM_NEEDPTON, 1, [ISC: provide inet_pton()])])
1214 AC_CHECK_FUNC(inet_aton, [], [AC_DEFINE(ISC_PLATFORM_NEEDATON, 1, [ISC: provide inet_aton()])])
1215 AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
1218 # Just stubs. Idiots.
1220 *) AC_CHECK_FUNCS(mkstemp)
1223 AC_CHECK_FUNCS(mktime)
1226 # Just a stub. Idiots.
1229 # Just a stub in "old" Irix. Idiots.
1232 # there, but more trouble than it is worth for now (resolver problems)
1235 # Apparently there but not working in QNX. Idiots?
1238 # Just a stub. Idiots.
1240 alpha*-dec-osf4*|alpha*-dec-osf5*)
1241 # mlockall is there, as a #define calling memlk via <sys/mman.h>
1242 # Not easy to test for - cheat.
1243 AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
1244 AC_CHECK_FUNCS(mlockall)
1246 *) AC_CHECK_FUNCS(mlockall)
1249 AC_CHECK_FUNCS(nice nlist)
1254 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
1257 AC_CHECK_FUNCS(plock pututline pututxline readlink recvmsg rtprio)
1260 # Just a stub in AIX 4. Idiots.
1263 # Just stubs in solaris2.5. Idiots.
1265 *) AC_CHECK_FUNCS(sched_setscheduler)
1268 AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
1269 AC_CHECK_FUNCS(setrlimit)
1270 AC_CHECK_FUNCS(settimeofday, ,[
1272 *-*-mpeix*) ac_cv_func_settimeofday=yes
1275 AC_CHECK_FUNCS(setvbuf sigaction)
1276 AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
1277 AC_CHECK_FUNCS(snprintf strdup strerror strstr)
1278 AC_CHECK_FUNCS(timegm)
1281 # Just stubs. Idiots.
1284 # Just stubs. Idiots.
1287 # Just stubs. Idiots.
1290 # Just stubs. Idiots.
1292 *) AC_CHECK_FUNCS(timer_create timer_settime)
1299 *) AC_CHECK_FUNCS(umask)
1302 AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
1306 # http://bugs.ntp.org/737
1307 case "$ac_cv_func_recvmsg" in
1309 AC_MSG_CHECKING([if we need extra help to define struct iovec])
1310 AC_CACHE_VAL(ac_cv_struct_iovec_help,dnl
1311 [for ac_cv_struct_iovec_help in '0' '1'; do
1313 [#ifdef HAVE_SYS_TYPES_H
1314 #include <sys/types.h>
1316 #ifdef HAVE_SYS_SOCKET_H
1317 #include <sys/socket.h>
1319 #if $ac_cv_struct_iovec_help
1320 #include <sys/uio.h>
1332 x = recvmsg(s, &mh, flags);
1334 [ac_worked=yes ; break 1], ac_worked=no)
1337 case "$ac_worked$ac_cv_struct_iovec_help" in
1339 AC_DEFINE(HAVE_SYS_UIO_H, 1, [Use sys/uio.h for struct iovec help])
1344 AC_MSG_RESULT([$ans])
1350 AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
1354 AC_CACHE_CHECK([number of arguments to gettimeofday()], ac_cv_func_Xettimeofday_nargs,
1355 [AC_TRY_COMPILE([#include <sys/time.h>],[
1356 gettimeofday((struct timeval*)0,(struct timezone*)0);
1357 settimeofday((struct timeval*)0,(struct timezone*)0);
1359 ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
1361 if test $ac_cv_func_Xettimeofday_nargs = 1; then
1362 AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
1365 AC_CACHE_CHECK([number of arguments taken by setpgrp()], ac_cv_func_setpgrp_nargs,
1367 #ifdef HAVE_SYS_TYPES_H
1368 # include <sys/types.h>
1370 #ifdef HAVE_UNISTD_H
1371 # include <unistd.h>
1374 ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
1376 if test $ac_cv_func_setpgrp_nargs = 0; then
1377 AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
1381 CFLAGS="$CFLAGS -I$srcdir/include"
1383 AC_CACHE_CHECK([argument pointer type of qsort()'s compare function and base],
1384 ac_cv_func_qsort_argtype,
1386 #include "l_stdlib.h"
1388 #ifdef HAVE_PROTOTYPES
1395 extern sortfunc P((const void *, const void *));
1398 const void *b; { return 0; }
1400 qsort(base, 2, sizeof(char *), sortfunc);
1402 ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
1404 case "$ac_cv_func_qsort_argtype" in
1406 AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
1412 AC_CACHE_CHECK([if we need to declare 'errno'], ac_cv_decl_errno,
1413 [AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
1417 ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
1418 case "$ac_cv_decl_errno" in
1419 yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
1422 dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
1423 dnl the clash. <resolv.h> isn't currently used.
1425 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1426 dnl MT purposes. This makes the line "extern int h_errno" choke
1427 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1428 dnl without breaking any other platforms.
1430 AC_CACHE_CHECK([if we may declare 'h_errno'], ac_cv_decl_h_errno,
1431 [AC_TRY_COMPILE([#include <sys/types.h>
1432 #ifdef HAVE_NETINET_IN_H
1433 #include <netinet/in.h>
1435 #ifdef HAVE_ARPA_NAMESER_H
1436 #include <arpa/nameser.h>
1441 #ifdef HAVE_RESOLV_H
1444 [extern int h_errno;],
1445 ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
1446 case "$ac_cv_decl_h_errno" in
1447 yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
1450 dnl See if char *sys_errlist[] is OK.
1451 AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
1452 [AC_TRY_COMPILE([#include <stdio.h>
1456 [extern char *sys_errlist[];
1458 ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
1459 case "$ac_cv_decl_sys_errlist" in
1460 yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
1463 AC_CACHE_CHECK([if declaring 'syscall()' is ok], ac_cv_decl_syscall,
1465 #ifdef HAVE_SYS_TYPES_H
1466 # include <sys/types.h>
1468 #ifdef HAVE_UNISTD_H
1469 # include <unistd.h>
1471 #ifdef HAVE_PROTOTYPES
1477 [extern int syscall P((int, ...));],
1478 ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
1479 case "$ac_cv_decl_syscall" in
1480 yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
1485 AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style]) # Needed for XLC under AIX 4.3.2
1488 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1489 AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
1490 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1491 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1492 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1493 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1494 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1497 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1498 AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
1501 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1504 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1505 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1506 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1507 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1508 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1509 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1510 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1511 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1512 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1513 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1514 AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1515 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1516 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1517 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1518 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1519 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1522 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1523 AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
1526 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1531 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1532 AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
1533 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1534 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1535 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1536 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1537 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1538 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1539 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1540 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1541 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1542 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1543 AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
1544 case "`basename $ac_cv_prog_CC`" in
1546 *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1549 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1550 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1551 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1552 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1553 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1554 AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
1555 AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
1558 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1559 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1560 AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
1561 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1562 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1563 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1564 AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
1565 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1566 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1567 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1568 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1569 AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
1570 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1571 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1577 AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
1581 AC_CACHE_CHECK([if we need extra room for SO_RCVBUF], ac_cv_var_rcvbuf_slop,
1588 ac_cv_var_rcvbuf_slop=$ans])
1589 case "$ac_cv_var_rcvbuf_slop" in
1590 yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
1593 AC_CACHE_CHECK([if we will open the broadcast socket], ac_cv_var_open_bcast_socket,
1600 ac_cv_var_open_bcast_socket=$ans])
1601 case "$ac_cv_var_open_bcast_socket" in
1602 yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
1605 AC_CACHE_CHECK([if we want the HPUX version of FindConfig()], ac_cv_var_hpux_findconfig,
1612 ac_cv_var_hpux_findconfig=$ans])
1613 case "$ac_cv_var_hpux_findconfig" in
1614 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
1617 AC_CACHE_CHECK([if process groups are set with -pid], ac_cv_arg_setpgrp_negpid,
1638 ac_cv_arg_setpgrp_negpid=$ans])
1639 case "$ac_cv_arg_setpgrp_negpid" in
1640 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
1643 AC_CACHE_CHECK([if we need a ctty for F_SETOWN], ac_cv_func_ctty_for_f_setown,
1651 *-*-netbsd*3.[0-8]*|*-*-netbsd*[0-2].*|*-*-netbsd*3.99.[0-7])
1666 ac_cv_func_ctty_for_f_setown=$ans]])
1667 case "$ac_cv_func_ctty_for_f_setown" in
1668 yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
1671 AC_CACHE_CHECK([if the OS fails to clear cached routes when more specific routes become available], ac_cv_os_routeupdates,
1679 ac_cv_os_routeupdates=$ans]])
1680 case "$ac_cv_os_routeupdates" in
1681 yes) AC_DEFINE(OS_MISSES_SPECIFIC_ROUTE_UPDATES, 1, [need to recreate sockets on changed routing?]) ;;
1684 AC_CACHE_CHECK([if the OS needs the wildcard socket set to REUSEADDR for binding interface addresses], ac_cv_os_wildcardreuse,
1692 ac_cv_os_wildcardreuse=$ans]])
1693 case "$ac_cv_os_wildcardreuse" in
1694 yes) AC_DEFINE(OS_NEEDS_REUSEADDR_FOR_IFADDRBIND, 1, [wildcard socket needs to set REUSEADDR when binding to interface addresses]) ;;
1698 AC_MSG_CHECKING([if we'll use clock_settime or settimeofday or stime])
1699 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1702 ans='clock_settime()'
1705 ntp_warning='But clock_settime() would be better (if we had it)'
1706 ans='settimeofday()'
1709 ntp_warning='Which is the worst of the three'
1714 $host) ntp_warning='Which leaves us with nothing to use!'
1719 AC_MSG_RESULT([$ans])
1720 case "$ntp_warning" in
1722 *) AC_MSG_WARN([*** $ntp_warning ***])
1726 AC_CACHE_CHECK([if we have a losing syscall()], ac_cv_var_syscall_bug,
1734 ac_cv_var_syscall_bug=$ans])
1735 case "$ac_cv_var_syscall_bug" in
1736 yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1739 AC_CACHE_CHECK([for SIGIO], ac_cv_hdr_def_sigio,
1741 [#include <signal.h>
1745 ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1747 dnl Override those system that have a losing SIGIO
1748 AC_CACHE_CHECK([if we want to use signalled IO], ac_cv_var_signalled_io,
1750 case "$ac_cv_hdr_def_sigio" in
1754 alpha*-dec-osf4*|alpha*-dec-osf5*)
1787 ac_cv_var_signalled_io=$ans])
1788 case "$ac_cv_var_signalled_io" in
1789 yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1792 AC_CACHE_CHECK([for SIGPOLL], ac_cv_hdr_def_sigpoll,
1794 [#include <signal.h>
1798 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1800 AC_CACHE_CHECK([for SIGSYS], ac_cv_hdr_def_sigsys,
1802 [#include <signal.h>
1806 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1808 AC_CACHE_CHECK([if we can use SIGPOLL for UDP I/O], ac_cv_var_use_udp_sigpoll,
1810 case "$ac_cv_hdr_def_sigpoll" in
1857 ac_cv_var_use_udp_sigpoll=$ans])
1858 case "$ac_cv_var_use_udp_sigpoll" in
1859 yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1862 AC_CACHE_CHECK([if we can use SIGPOLL for TTY I/O], ac_cv_var_use_tty_sigpoll,
1864 case "$ac_cv_hdr_def_sigpoll" in
1908 ac_cv_var_use_tty_sigpoll=$ans])
1909 case "$ac_cv_var_use_tty_sigpoll" in
1910 yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
1913 case "$ac_cv_header_sys_sio_h" in
1915 AC_CACHE_CHECK([sys/sio.h for TIOCDCDTIMESTAMP], ac_cv_hdr_def_tiocdcdtimestamp,
1917 [#include <sys/sio.h>
1918 #ifdef TIOCDCDTIMESTAMP
1921 ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1925 case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1927 ac_cv_var_oncore_ok=yes
1931 AC_CACHE_CHECK([if nlist() values might require extra indirection],
1932 ac_cv_var_nlist_extra_indirection,
1939 ac_cv_var_nlist_extra_indirection=$ans])
1940 case "$ac_cv_var_nlist_extra_indirection" in
1941 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
1944 AC_CACHE_CHECK([for a minimum recommended value of tickadj],
1945 ac_cv_var_min_rec_tickadj,
1952 ac_cv_var_min_rec_tickadj=$ans])
1953 case "$ac_cv_var_min_rec_tickadj" in
1955 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
1958 AC_CACHE_CHECK([if the TTY code permits PARENB and IGNPAR],
1959 ac_cv_var_no_parenb_ignpar,
1968 i?86-*-freebsd[[123]].*)
1977 ac_cv_var_no_parenb_ignpar=$ans])
1978 case "$ac_cv_var_no_parenb_ignpar" in
1979 yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
1982 AC_MSG_CHECKING([if we're including debugging code])
1983 AC_ARG_ENABLE(debugging,
1984 AC_HELP_STRING([--enable-debugging], [+ include debugging code]),
1985 [ntp_ok=$enableval], [ntp_ok=yes])
1986 if test "$ntp_ok" = "yes"; then
1987 AC_DEFINE(DEBUG, 1, [Enable debugging?])
1989 AC_MSG_RESULT($ntp_ok)
1991 AC_MSG_CHECKING([if we including processing time debugging code])
1992 AC_ARG_ENABLE(debug-timing,
1993 AC_HELP_STRING([--enable-debug-timing], [- include processing time debugging code (costs performance)]),
1994 [ntp_ok=$enableval], [ntp_ok=no])
1995 if test "$ntp_ok" = "yes"; then
1996 AC_DEFINE(DEBUG_TIMING, 1, [Enable processing time debugging?])
1998 AC_MSG_RESULT($ntp_ok)
2000 AC_MSG_CHECKING([[for a the number of minutes in a DST adjustment]])
2004 [--enable-dst-minutes],
2005 [n minutes per DST adjustment @<:@60@:>@] dnl @<:@ is [
2010 AC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
2011 AC_MSG_RESULT([$ans])
2013 AC_MSG_CHECKING([[if ntpd will retry on permanent DNS errors]])
2015 [ignore-dns-errors],
2017 [--enable-ignore-dns-errors],
2018 [- retry DNS queries on any error]
2025 AC_DEFINE(IGNORE_DNS_ERRORS, 1, [[Retry queries on _any_ DNS error?]])
2027 AC_MSG_RESULT([$ans])
2029 AC_CACHE_CHECK([if we have the tty_clk line discipline/streams module],
2031 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
2032 *yes*) ac_cv_var_tty_clk=yes ;;
2033 *) ac_cv_var_tty_clk=no ;;
2035 case "$ac_cv_var_tty_clk" in
2036 yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
2039 AC_CACHE_CHECK([for the ppsclock streams module],
2041 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
2042 case "$ac_cv_var_ppsclock" in
2043 yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
2046 AC_CACHE_CHECK([for kernel multicast support], ac_cv_var_mcast,
2049 i386-sequent-sysv4) ;;
2050 *) AC_EGREP_CPP(yes,
2051 [#include <netinet/in.h>
2052 #ifdef IP_ADD_MEMBERSHIP
2055 ], ac_cv_var_mcast=yes) ;;
2057 case "$ac_cv_var_mcast" in
2059 AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?])
2060 AC_CACHE_CHECK([[arg type needed for IP*_MULTICAST_LOOP for setsockopt()]],
2061 ac_cv_var_typeof_ip_multicast_loop,
2063 *-*-netbsd*|*-*-*linux*)
2064 ac_cv_var_typeof_ip_multicast_loop=u_int
2067 ac_cv_var_typeof_ip_multicast_loop=BOOL
2069 *) ac_cv_var_typeof_ip_multicast_loop=u_char
2072 AC_DEFINE_UNQUOTED(TYPEOF_IP_MULTICAST_LOOP,
2073 $ac_cv_var_typeof_ip_multicast_loop,
2074 [What type to use for setsockopt])
2078 AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
2079 [ac_cv_var_ntp_syscalls=no
2080 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
2082 ac_cv_var_ntp_syscalls=libc
2085 ac_cv_var_ntp_syscalls=inline
2087 *) AC_EGREP_CPP(yes,
2088 [#include <sys/syscall.h>
2089 #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
2092 ], ac_cv_var_ntp_syscalls=kernel)
2095 case "$ac_cv_var_ntp_syscalls" in
2097 AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
2100 AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
2106 AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
2108 [#include <sys/timex.h>
2112 ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
2114 AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
2115 [dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
2116 case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
2118 ac_cv_var_kernel_pll=no
2120 *) ac_cv_var_kernel_pll=yes
2123 case "$ac_cv_var_kernel_pll" in
2125 AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
2129 AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
2142 ac_cv_var_size_returned_in_buffer=$ans])
2143 case "$ac_cv_var_size_returned_in_buffer" in
2144 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
2147 dnl vvvvv-- this is wrong, if you re-enable the switch do not cache the result
2148 dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
2149 dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
2150 dnl [ans=$enableval], [ans=no])
2151 dnl ac_cv_var_gdt_surveying=$ans])
2152 dnl case "$ac_cv_var_gdt_surveying" in
2153 dnl yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
2156 # Check for ioctls TIOCGPPSEV
2157 AC_MSG_CHECKING(ioctl TIOCGPPSEV)
2158 if test "$ac_cv_header_termios_h" = "yes"; then
2160 [#include <termios.h>
2164 ], ntp_ok=yes, ntp_ok=no)
2168 if test "$ntp_ok" = "yes"; then
2169 AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
2170 ac_cv_var_oncore_ok=yes
2172 AC_MSG_RESULT($ntp_ok)
2174 # Check for ioctls TIOCSPPS
2175 AC_MSG_CHECKING(ioctl TIOCSPPS)
2176 if test "$ac_cv_header_termios_h" = "yes"; then
2178 [#include <termios.h>
2182 ], ntp_ok=yes, ntp_ok=no)
2187 if test "$ntp_ok" = "yes"; then
2188 AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
2190 AC_MSG_RESULT($ntp_ok)
2192 # Check for ioctls CIOGETEV
2193 AC_MSG_CHECKING([ioctl CIOGETEV])
2194 if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
2196 [#include <sys/ppsclock.h>
2200 ], ntp_ok=yes, ntp_ok=no)
2204 if test "$ntp_ok" = "yes"; then
2205 ac_cv_var_oncore_ok=yes
2206 AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
2208 AC_MSG_RESULT($ntp_ok)
2211 # ATOM/PPSAPI stuff.
2213 # ATOM used to require struct timespec, but that's been fixed now.
2215 # case "$ac_cv_struct_timespec" in
2217 # ac_cv_var_atom_ok=yes
2220 ac_cv_var_atom_ok=yes
2222 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
2224 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
2226 # The PPSAPI needs struct timespec.
2228 # The PPSAPI also needs a timepps header.
2230 case "$ac_cv_c_inline$ac_cv_struct_timespec" in
2232 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
2233 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
2234 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
2235 ac_cv_var_jupiter_ok=yes
2236 ac_cv_var_oncore_ok=yes
2237 ac_cv_var_parse_ok=yes
2238 ac_cv_var_ripe_ncc_ok=yes
2244 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
2245 AC_CHECK_HEADER(linux/serial.h)
2246 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
2247 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
2250 [#include <sys/time.h>
2253 #include <sys/ppsclock.h>
2254 #include <linux/serial.h>
2258 #ifdef ASYNC_PPS_CD_POS
2259 #ifdef ASYNC_PPS_CD_NEG
2273 if test "$ntp_ok" = "yes"; then
2274 AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
2276 AC_MSG_RESULT($ntp_ok)
2278 # Check for SHMEM_STATUS support
2279 AC_MSG_CHECKING([SHMEM_STATUS support])
2280 case "$ac_cv_header_sys_mman_h" in
2284 if test "$ntp_ok" = "yes"; then
2285 AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
2287 AC_MSG_RESULT($ntp_ok)
2289 dnl dnl These are for OPT_PROGRAMS in authstuff/
2290 dnl AC_SUBST(AUTHCERT)
2291 dnl AC_SUBST(AUTHSPEED)
2292 dnl AC_SUBST(MD5DRIVER)
2293 dnl AC_SUBST(KEYPARITY)
2294 dnl AC_SUBST(MAKEIPFP)
2295 dnl AC_SUBST(MAKEPC1)
2296 dnl AC_SUBST(MAKEPC2)
2297 dnl AC_SUBST(MAKESP)
2298 dnl AC_SUBST(MKRANDKEYS)
2299 dnl AC_SUBST(OMAKEIPFP)
2300 dnl AC_SUBST(UNIXCERT)
2304 # HPUX only, and by explicit request
2305 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
2306 AC_ARG_ENABLE(BANCOMM,
2307 AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
2308 [ntp_ok=$enableval], [ntp_ok=no])
2309 if test "$ntp_ok" = "yes"; then
2311 AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
2313 AC_MSG_RESULT($ntp_ok)
2314 case "$ntp_ok$host" in
2316 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2319 #HPUX only, and only by explicit request
2320 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
2321 AC_ARG_ENABLE(GPSVME,
2322 AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
2323 [ntp_ok=$enableval], [ntp_ok=no])
2324 if test "$ntp_ok" = "yes"; then
2326 AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
2328 AC_MSG_RESULT($ntp_ok)
2329 case "$ntp_ok$host" in
2331 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2334 AC_MSG_CHECKING([for PCL720 clock support])
2335 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
2337 AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
2344 AC_MSG_RESULT([$ans])
2346 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
2347 AC_ARG_ENABLE(all-clocks,
2348 AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
2349 [ntp_eac=$enableval], [ntp_eac=yes])
2350 AC_MSG_RESULT($ntp_eac)
2352 # HMS: Should we also require ac_cv_var_parse_ok?
2353 AC_MSG_CHECKING([if we have support for PARSE clocks])
2354 case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
2361 AC_MSG_RESULT($ntp_canparse)
2363 AC_MSG_CHECKING([if we have support for audio clocks])
2364 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
2367 AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
2369 *) ntp_canaudio=no ;;
2371 AC_MSG_RESULT($ntp_canaudio)
2373 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
2374 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
2380 AC_MSG_RESULT($ntp_canshm)
2382 # Requires modem control
2383 AC_MSG_CHECKING([ACTS modem service])
2385 AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
2386 [ntp_ok=$enableval],
2388 [#include <termios.h>
2389 #ifdef HAVE_SYS_IOCTL_H
2390 #include <sys/ioctl.h>
2395 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2396 if test "$ntp_ok" = "yes"; then
2398 AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
2400 AC_MSG_RESULT($ntp_ok)
2402 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
2403 AC_ARG_ENABLE(ARBITER,
2404 AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
2405 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2406 if test "$ntp_ok" = "yes"; then
2408 AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
2410 AC_MSG_RESULT($ntp_ok)
2412 AC_MSG_CHECKING([Arcron MSF receiver])
2413 AC_ARG_ENABLE(ARCRON_MSF,
2414 AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
2415 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2416 if test "$ntp_ok" = "yes"; then
2418 AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
2420 AC_MSG_RESULT($ntp_ok)
2422 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
2423 AC_ARG_ENABLE(AS2201,
2424 AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
2425 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2426 if test "$ntp_ok" = "yes"; then
2428 AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
2430 AC_MSG_RESULT($ntp_ok)
2432 AC_MSG_CHECKING([ATOM PPS interface])
2434 AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
2435 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2436 case "$ac_cv_var_atom_ok" in
2439 if test "$ntp_ok" = "yes"; then
2441 AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
2443 AC_MSG_RESULT($ntp_ok)
2445 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
2446 AC_ARG_ENABLE(CHRONOLOG,
2447 AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
2448 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2449 if test "$ntp_ok" = "yes"; then
2451 AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
2453 AC_MSG_RESULT($ntp_ok)
2455 AC_MSG_CHECKING([CHU modem/decoder])
2457 AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
2458 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2459 if test "$ntp_ok" = "yes"; then
2461 AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
2463 AC_MSG_RESULT($ntp_ok)
2464 ac_refclock_chu=$ntp_ok
2466 AC_MSG_CHECKING([CHU audio/decoder])
2467 AC_ARG_ENABLE(AUDIO-CHU,
2468 AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
2469 [ntp_ok=$enableval],
2470 [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
2474 if test "$ntp_ok" = "yes"; then
2475 AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
2477 AC_MSG_RESULT($ntp_ok)
2478 # We used to check for sunos/solaris target...
2479 case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
2480 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***]) ;;
2484 AC_MSG_CHECKING([Datum Programmable Time System])
2485 AC_ARG_ENABLE(DATUM,
2486 AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
2487 [ntp_ok=$enableval],
2488 [case "$ac_cv_header_termios_h" in
2495 if test "$ntp_ok" = "yes"; then
2497 AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
2499 AC_MSG_RESULT($ntp_ok)
2501 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2502 AC_ARG_ENABLE(DUMBCLOCK,
2503 AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
2504 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2505 if test "$ntp_ok" = "yes"; then
2507 AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
2509 AC_MSG_RESULT($ntp_ok)
2511 AC_MSG_CHECKING([Forum Graphic GPS])
2513 AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
2514 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2515 if test "$ntp_ok" = "yes"; then
2517 AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
2519 AC_MSG_RESULT($ntp_ok)
2521 # Requires modem control
2522 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2523 AC_ARG_ENABLE(HEATH,
2524 AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
2525 [ntp_ok=$enableval],
2527 [#include <termios.h>
2528 #ifdef HAVE_SYS_IOCTL_H
2529 #include <sys/ioctl.h>
2534 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2535 if test "$ntp_ok" = "yes"; then
2537 AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
2539 AC_MSG_RESULT($ntp_ok)
2541 AC_MSG_CHECKING([for hopf serial clock device])
2542 AC_ARG_ENABLE(HOPFSERIAL,
2543 AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
2544 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2545 if test "$ntp_ok" = "yes"; then
2547 AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
2549 AC_MSG_RESULT($ntp_ok)
2551 AC_MSG_CHECKING([for hopf PCI clock 6039])
2552 AC_ARG_ENABLE(HOPFPCI,
2553 AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
2554 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2555 if test "$ntp_ok" = "yes"; then
2557 AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
2559 AC_MSG_RESULT($ntp_ok)
2561 AC_MSG_CHECKING([HP 58503A GPS receiver])
2562 AC_ARG_ENABLE(HPGPS,
2563 AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
2564 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2565 if test "$ntp_ok" = "yes"; then
2567 AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
2569 AC_MSG_RESULT($ntp_ok)
2571 AC_MSG_CHECKING([IRIG audio decoder])
2573 AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
2574 [ntp_ok=$enableval],
2575 [case "$ntp_eac$ntp_canaudio" in
2579 if test "$ntp_ok" = "yes"; then
2581 AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
2583 AC_MSG_RESULT($ntp_ok)
2584 case "$ntp_ok$ntp_canaudio" in
2585 yesno) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2588 AC_MSG_CHECKING([for JJY receiver])
2590 AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
2591 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2592 if test "$ntp_ok" = "yes"; then
2594 AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
2596 AC_MSG_RESULT($ntp_ok)
2598 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2599 AC_ARG_ENABLE(JUPITER,
2600 AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
2601 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2602 case "$ac_cv_var_jupiter_ok" in
2605 if test "$ntp_ok" = "yes"; then
2607 AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
2609 AC_MSG_RESULT($ntp_ok)
2611 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2612 AC_ARG_ENABLE(LEITCH,
2613 AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
2614 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2615 if test "$ntp_ok" = "yes"; then
2617 AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
2619 AC_MSG_RESULT($ntp_ok)
2621 AC_MSG_CHECKING([local clock reference])
2622 AC_ARG_ENABLE(LOCAL-CLOCK,
2623 AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
2624 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2625 if test "$ntp_ok" = "yes"; then
2627 AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
2629 AC_MSG_RESULT($ntp_ok)
2631 dnl Bug 340: longstanding unfixed bugs
2632 dnl AC_MSG_CHECKING(EES M201 MSF receiver)
2633 dnl AC_ARG_ENABLE(MSFEES,
2634 dnl AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
2635 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2636 dnl if test "$ntp_ok" = "yes"; then
2637 dnl ntp_refclock=yes
2638 dnl AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
2640 dnl AC_MSG_RESULT($ntp_ok)
2643 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2644 AC_ARG_ENABLE(MX4200,
2645 AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
2646 [ntp_ok=$enableval],
2647 [case "$ac_cv_var_ppsclock" in
2648 yes) ntp_ok=$ntp_eac
2653 if test "$ntp_ok" = "yes"; then
2655 AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
2657 AC_MSG_RESULT($ntp_ok)
2658 case "$ntp_ok$host" in
2659 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2662 AC_MSG_CHECKING([for NeoClock4X receiver])
2663 AC_ARG_ENABLE(NEOCLOCK4X,
2664 AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
2665 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2666 if test "$ntp_ok" = "yes"; then
2668 AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
2670 AC_MSG_RESULT($ntp_ok)
2672 AC_MSG_CHECKING([NMEA GPS receiver])
2674 AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
2675 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2676 if test "$ntp_ok" = "yes"; then
2678 AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
2680 AC_MSG_RESULT($ntp_ok)
2682 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2683 AC_ARG_ENABLE(ONCORE,
2684 AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
2685 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2686 case "$ac_cv_var_oncore_ok" in
2689 if test "$ntp_ok" = "yes"; then
2691 AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
2693 AC_MSG_RESULT($ntp_ok)
2695 AC_MSG_CHECKING([for Palisade clock])
2696 AC_ARG_ENABLE(PALISADE,
2697 AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
2698 [ntp_ok=$enableval],
2699 [case "$ac_cv_header_termios_h" in
2707 if test "$ntp_ok" = "yes"; then
2709 AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
2711 AC_MSG_RESULT($ntp_ok)
2713 AC_MSG_CHECKING([Conrad parallel port radio clock])
2715 AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
2716 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2717 if test "$ntp_ok" = "yes"; then
2719 AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
2721 AC_MSG_RESULT($ntp_ok)
2723 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2725 AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
2726 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2727 if test "$ntp_ok" = "yes"; then
2729 AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
2731 AC_MSG_RESULT($ntp_ok)
2733 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2734 AC_ARG_ENABLE(RIPENCC,
2735 AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
2736 [ntp_ok=$enableval], [ntp_ok=no])
2737 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2738 case "$ac_cv_var_ripe_ncc_ok" in
2741 if test "$ntp_ok" = "yes"; then
2743 AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
2745 AC_MSG_RESULT($ntp_ok)
2747 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2748 # For *IX, we need sys/ipc.h and sys/shm.h.
2749 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2751 AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
2752 [ntp_ok=$enableval],
2753 [case "$ntp_eac$ntp_canshm" in
2757 if test "$ntp_ok" = "yes"; then
2759 AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
2761 AC_MSG_RESULT($ntp_ok)
2763 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2764 AC_ARG_ENABLE(SPECTRACOM,
2765 AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
2766 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2767 if test "$ntp_ok" = "yes"; then
2769 AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
2771 AC_MSG_RESULT($ntp_ok)
2773 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2775 AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
2776 [ntp_ok=$enableval],
2777 [case "$ac_cv_header_sys_tpro_h" in
2784 if test "$ntp_ok" = "yes"; then
2786 AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2788 AC_MSG_RESULT($ntp_ok)
2789 case "$ntp_ok$ac_cv_header_sys_tpro" in
2790 yesno) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2793 dnl Bug 342: longstanding unfixed bugs
2794 dnl AC_MSG_CHECKING(TRAK 8810 GPS receiver)
2795 dnl AC_ARG_ENABLE(TRAK,
2796 dnl AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
2797 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2798 dnl if test "$ntp_ok" = "yes"; then
2799 dnl ntp_refclock=yes
2800 dnl AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
2802 dnl AC_MSG_RESULT($ntp_ok)
2804 # Not on a vax-dec-bsd
2805 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2806 AC_ARG_ENABLE(TRUETIME,
2807 AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
2808 [ntp_ok=$enableval],
2818 if test "$ntp_ok" = "yes"; then
2820 AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
2822 AC_MSG_RESULT($ntp_ok)
2823 case "$ntp_ok$host" in
2824 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2827 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2828 AC_ARG_ENABLE(TT560,
2829 AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
2830 [ntp_ok=$enableval], [ntp_ok=no])
2831 if test "$ntp_ok" = "yes"; then
2833 AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
2835 AC_MSG_RESULT($ntp_ok)
2837 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2838 AC_ARG_ENABLE(ULINK,
2839 AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
2840 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2841 if test "$ntp_ok" = "yes"; then
2843 AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
2845 AC_MSG_RESULT($ntp_ok)
2847 AC_MSG_CHECKING([WWV receiver])
2849 AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2850 [ntp_ok=$enableval],
2851 [case "$ntp_eac$ntp_canaudio" in
2855 if test "$ntp_ok" = "yes"; then
2857 AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2859 AC_MSG_RESULT($ntp_ok)
2860 case "$ntp_ok$ntp_canaudio" in
2861 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2864 AC_MSG_CHECKING([for Zyfer receiver])
2865 AC_ARG_ENABLE(ZYFER,
2866 AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
2867 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2868 if test "$ntp_ok" = "yes"; then
2870 AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
2872 AC_MSG_RESULT($ntp_ok)
2874 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2875 AC_ARG_ENABLE(parse-clocks,
2876 AC_HELP_STRING([--enable-parse-clocks], [- include all suitable PARSE clocks:]),
2877 [ntp_eapc=$enableval],
2879 yes) ntp_eapc=$ntp_canparse ;;
2882 # Delete the next line one of these days
2884 AC_MSG_RESULT($ntp_eapc)
2886 case "$ntp_eac$ntp_eapc$ntp_canparse" in
2888 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2891 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2900 AC_MSG_CHECKING([Diem Computime Radio Clock])
2901 AC_ARG_ENABLE(COMPUTIME,
2902 AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
2903 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2904 if test "$ntp_ok" = "yes"; then
2907 AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
2909 AC_MSG_RESULT($ntp_ok)
2910 case "$ntp_ok$ntp_canparse" in
2912 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2916 AC_MSG_CHECKING([ELV/DCF7000 clock])
2917 AC_ARG_ENABLE(DCF7000,
2918 AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
2919 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2920 if test "$ntp_ok" = "yes"; then
2923 AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
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!])
2932 AC_MSG_CHECKING([HOPF 6021 clock])
2933 AC_ARG_ENABLE(HOPF6021,
2934 AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
2935 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2936 if test "$ntp_ok" = "yes"; then
2939 AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
2941 AC_MSG_RESULT($ntp_ok)
2942 case "$ntp_ok$ntp_canparse" in
2944 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2948 AC_MSG_CHECKING([Meinberg clocks])
2949 AC_ARG_ENABLE(MEINBERG,
2950 AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
2951 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2952 if test "$ntp_ok" = "yes"; then
2955 AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
2957 AC_MSG_RESULT($ntp_ok)
2958 case "$ntp_ok$ntp_canparse" in
2960 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2964 AC_MSG_CHECKING([DCF77 raw time code])
2965 AC_ARG_ENABLE(RAWDCF,
2966 AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
2967 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2968 if test "$ntp_ok" = "yes"; then
2973 AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
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!)
2982 case "$ntp_rawdcf" in
2984 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2985 ac_cv_var_rawdcf_parity,
2992 ac_cv_var_rawdcf_parity=$ans])
2993 case "$ac_cv_var_rawdcf_parity" in
2994 yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
2998 *) # HMS: Is this a good idea?
2999 ac_cv_var_rawdcf_parity=no
3003 AC_MSG_CHECKING([RCC 8000 clock])
3004 AC_ARG_ENABLE(RCC8000,
3005 AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
3006 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3007 if test "$ntp_ok" = "yes"; then
3010 AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
3012 AC_MSG_RESULT($ntp_ok)
3013 case "$ntp_ok$ntp_canparse" in
3015 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3019 AC_MSG_CHECKING([Schmid DCF77 clock])
3020 AC_ARG_ENABLE(SCHMID,
3021 AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
3022 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3023 if test "$ntp_ok" = "yes"; then
3026 AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
3028 AC_MSG_RESULT($ntp_ok)
3029 case "$ntp_ok$ntp_canparse" in
3031 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3035 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
3036 AC_ARG_ENABLE(TRIMTAIP,
3037 AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
3038 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3039 if test "$ntp_ok" = "yes"; then
3042 AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
3044 AC_MSG_RESULT($ntp_ok)
3045 case "$ntp_ok$ntp_canparse" in
3047 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3051 AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
3052 AC_ARG_ENABLE(TRIMTSIP,
3053 AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
3054 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3055 if test "$ntp_ok" = "yes"; then
3058 AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
3060 AC_MSG_RESULT($ntp_ok)
3061 case "$ntp_ok$ntp_canparse" in
3063 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3067 AC_MSG_CHECKING([WHARTON 400A Series clock])
3068 AC_ARG_ENABLE(WHARTON,
3069 AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
3070 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3071 if test "$ntp_ok" = "yes"; then
3074 AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
3076 AC_MSG_RESULT($ntp_ok)
3077 case "$ntp_ok$ntp_canparse" in
3079 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3083 AC_MSG_CHECKING([VARITEXT clock])
3084 AC_ARG_ENABLE(VARITEXT,
3085 AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
3086 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3087 if test "$ntp_ok" = "yes"; then
3090 AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
3092 AC_MSG_RESULT($ntp_ok)
3093 case "$ntp_ok$ntp_canparse" in
3095 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3099 AC_SUBST(MAKE_LIBPARSE)
3100 AC_SUBST(MAKE_LIBPARSE_KERNEL)
3101 AC_SUBST(MAKE_CHECK_Y2K)
3102 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3104 case "$ntp_libparse" in
3107 AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
3108 LIBPARSE=../libparse/libparse.a
3109 MAKE_LIBPARSE=libparse.a
3110 # HMS: check_y2k trips the 34 year problem now...
3111 false && MAKE_CHECK_Y2K=check_y2k
3112 AC_DEFINE(PPS_SAMPLE, 1, [PPS auxiliary interface for ATOM?])
3113 AC_DEFINE(CLOCK_ATOM)
3116 AC_MSG_RESULT([$ans])
3122 # AC_SUBST(LIBRSAREF)
3123 # AC_SUBST(MAKE_LIBRSAREF)
3126 AC_SUBST(OPENSSL_INC)
3127 AC_SUBST(OPENSSL_LIB)
3129 AC_MSG_CHECKING([for openssl library directory])
3130 AC_ARG_WITH(openssl-libdir,
3131 AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
3140 ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib"
3142 *) # Look where they said
3147 *) # Look for libcrypto.a and libssl.a:
3152 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
3155 test -f $i/libcrypto.so -a -f $i/libssl.so && break
3156 test -f $i/libcrypto.a -a -f $i/libssl.a && break
3171 AC_MSG_RESULT([$ans])
3173 AC_MSG_CHECKING([for openssl include directory])
3174 AC_ARG_WITH(openssl-incdir,
3175 AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
3184 ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include"
3186 *) # Look where they said
3191 *) # look for openssl/opensslconf.h:
3194 test -f $i/openssl/opensslconf.h && break
3207 AC_MSG_RESULT([$ans])
3210 AC_HELP_STRING([--with-crypto], [+ =openssl]),
3211 [ans=$withval], [ans=yes])
3215 if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
3219 # We have OpenSSL inc/lib - use them.
3221 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
3222 LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
3223 case "$need_dash_r" in
3224 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB"
3227 AC_SUBST(LCRYPTO, [-lcrypto])
3228 AC_DEFINE(OPENSSL, , [Use OpenSSL?])
3229 AC_CHECK_FUNCS(EVP_md2 EVP_mdc2)
3233 AC_MSG_CHECKING(for the level of crypto support)
3234 AC_MSG_RESULT([$ans])
3236 AC_MSG_CHECKING([if we want to compile with ElectricFence])
3237 AC_ARG_WITH(electricfence,
3238 AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
3239 [ans=$withval], [ans=no])
3243 LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
3244 EF_PROGS="eftest tstheap"
3251 AC_MSG_RESULT([$ans])
3253 AC_SUBST(MAKE_CHECK_LAYOUT)
3254 AC_MSG_CHECKING([if we want to run check-layout])
3255 case "$cross_compiling$PATH_PERL" in
3257 MAKE_CHECK_LAYOUT=check-layout
3264 AC_MSG_RESULT([$ans])
3269 AC_MSG_CHECKING([if we can make dcf parse utilities])
3271 if test "$ntp_parseutil" = "yes"; then
3273 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3280 AC_MSG_RESULT([$ans])
3282 AC_SUBST(MAKE_PARSEKMODULE)
3283 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3285 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3289 case "$ac_cv_var_kernel_pll" in
3291 AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
3295 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3299 MAKE_PARSEKMODULE=parse
3304 AC_MSG_RESULT([$ans])
3306 AC_MSG_CHECKING([if we need basic refclock support])
3307 if test "$ntp_refclock" = "yes"; then
3308 AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
3310 AC_MSG_RESULT($ntp_refclock)
3312 dnl Things that can be made in clockstuff/
3313 AC_SUBST(PROPDELAY) dnl Set to "propdelay"
3314 AC_SUBST(CHUTEST) dnl Set to "chutest"
3315 AC_SUBST(CLKTEST) dnl Set to "clktest"
3317 AC_SUBST(MAKE_ADJTIMED)
3318 AC_MSG_CHECKING(if we want HP-UX adjtimed support)
3326 if test "$ans" = "yes"; then
3327 MAKE_ADJTIMED=adjtimed
3328 AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
3330 AC_MSG_RESULT([$ans])
3332 AC_MSG_CHECKING([if we want QNX adjtime support])
3340 if test "$ans" = "yes"; then
3341 AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
3343 AC_MSG_RESULT([$ans])
3345 AC_MSG_CHECKING([if we can read kmem])
3347 # the default is to enable it if the system has the capability
3349 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3357 *-*-domainos) # Won't be found...
3377 # --enable-kmem / --disable-kmem controls if present
3382 [s read /dev/kmem for tick and/or tickadj]
3387 AC_MSG_RESULT([$ans])
3395 AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?])
3399 AC_MSG_CHECKING([if adjtime is accurate])
3401 # target-dependent defaults
3410 mips-sgi-irix[[456]]*)
3422 *-*-solaris2.[[01]])
3434 # --enable-accurate-adjtime / --disable-accurate-adjtime
3435 # override the default
3436 AC_ARG_ENABLE([accurate-adjtime],
3438 [--enable-accurate-adjtime],
3439 [s the adjtime() call is accurate]
3444 AC_MSG_RESULT([$ans])
3448 AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?])
3449 adjtime_is_accurate=yes
3452 adjtime_is_accurate=no
3455 AC_CACHE_CHECK([the name of 'tick' in the kernel],
3456 ac_cv_var_nlist_tick,
3459 m68*-hp-hpux*) # HP9000/300?
3487 ac_cv_var_nlist_tick=$ans])
3488 case "$ac_cv_var_nlist_tick" in
3489 ''|no) ;; # HMS: I think we can only get 'no' here...
3490 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
3493 AC_CACHE_CHECK([for the units of 'tick'],
3494 ac_cv_var_tick_nano,
3501 ac_cv_var_tick_nano=$ans])
3502 case "$ac_cv_var_tick_nano" in
3504 AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
3508 AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
3509 ac_cv_var_nlist_tickadj,
3512 m68*-hp-hpux*) # HP9000/300?
3543 ans=no # hrestime_adj
3549 ac_cv_var_nlist_tickadj=$ans])
3550 case "$ac_cv_var_nlist_tickadj" in
3551 ''|no) ;; # HMS: I think we can only get 'no' here...
3552 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
3555 AC_CACHE_CHECK([for the units of 'tickadj'],
3556 ac_cv_var_tickadj_nano,
3563 ac_cv_var_tickadj_nano=$ans])
3564 case "$ac_cv_var_tickadj_nano" in
3566 AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
3570 AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
3571 ac_cv_var_nlist_dosynctodr,
3610 ac_cv_var_nlist_dosynctodr=$ans])
3611 case "$ac_cv_var_nlist_dosynctodr" in
3613 *) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
3617 AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
3618 ac_cv_var_nlist_noprintf,
3651 ac_cv_var_nlist_noprintf=$ans])
3652 case "$ac_cv_var_nlist_noprintf" in
3654 *) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
3658 dnl The tick/tickadj sections were written by Skippy, who never learned
3659 dnl that it's impolite (horridly gross) to show your guts in public.
3662 dnl 10000 80 Unixware
3663 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3664 dnl 10000 150 sgi IRIX
3665 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3666 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3667 dnl 1000000L/hz 500/HZ other && NOKMEM
3668 dnl txc.tick 1 Linux
3669 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3670 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3671 dnl (RS6000 && !NOKMEM), SINIX MIPS
3673 dnl But we'll only use these "values" if we can't find anything else.
3675 AC_MSG_CHECKING([for a default value for 'tick'])
3677 # target-dependent default for tick
3681 AC_MSG_ERROR([tick needs work for cygwin])
3709 [--enable-tick=VALUE],
3710 [s force a value for 'tick']
3715 AC_MSG_RESULT([$ans])
3718 ''|no) ;; # HMS: I think we can only get 'no' here...
3719 *) AC_DEFINE_UNQUOTED(PRESET_TICK, [$ans], [Preset a value for 'tick'?]) ;;
3723 AC_MSG_CHECKING([for a default value for 'tickadj'])
3725 # target-specific default
3731 case "$adjtime_is_accurate" in
3748 *-*-domainos) # Skippy: won't be found...
3755 case "$adjtime_is_accurate" in
3779 [--enable-tickadj=VALUE],
3780 [s force a value for 'tickadj']
3785 AC_MSG_RESULT([$ans])
3787 default_tickadj=$ans
3789 case "$default_tickadj" in
3790 ''|no) ;; # HMS: I think we can only get 'no' here...
3791 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $default_tickadj, [Preset a value for 'tickadj'?]) ;;
3794 # Newer versions of ReliantUNIX round adjtime() values down to
3795 # 1/100s (system tick). Sigh ...
3796 # Unfortunately, there is no easy way to know if particular release
3797 # has this "feature" or any obvious way to test for it.
3799 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
3803 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
3806 ac_cv_make_tickadj=yes
3807 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3808 nonono) # Don't read KMEM, no presets. Bogus.
3809 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3810 ac_cv_make_tickadj=no
3812 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3813 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3814 ac_cv_make_tickadj=no
3816 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3817 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3818 ac_cv_make_tickadj=no
3820 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3822 yesnono) # Read KMEM, no presets. Cool.
3824 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3825 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3827 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3829 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3831 *) # Generally bogus.
3832 AC_MSG_ERROR([This shouldn't happen.])
3836 AC_SUBST(MAKE_NTPTIME)
3837 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3839 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
3849 ac_cv_make_ntptime=$ans])
3850 case "$ac_cv_make_ntptime" in
3852 MAKE_NTPTIME=ntptime
3856 AC_SUBST(MAKE_TICKADJ)
3859 # tickadj is pretty useless on newer versions of ReliantUNIX
3861 ac_cv_make_tickadj=no
3864 ac_cv_make_tickadj=no
3867 # DLM says tickadj is a no-no starting with solaris2.5
3869 *-*-solaris2.1[[0-9]]*)
3870 ac_cv_make_tickadj=no
3872 *-*-solaris2.[[0-4]]*) ;;
3873 *) ac_cv_make_tickadj=no ;;
3877 ac_cv_make_tickadj=no
3882 # Despite all the above, we always make tickadj. Setting
3883 # ac_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3884 # report that the configuration variable was cached. It may
3885 # be better to simply remove the hunk above, I did not want
3886 # to remove it if there is hope it will be used again.
3888 unset ac_cv_make_tickadj
3890 AC_CACHE_CHECK([if we want and can make the tickadj utility], ac_cv_make_tickadj,
3891 ac_cv_make_tickadj=yes)
3892 case "$ac_cv_make_tickadj" in
3894 MAKE_TICKADJ=tickadj
3898 AC_SUBST(MAKE_TIMETRIM)
3899 AC_CACHE_CHECK([if we want and can make the timetrim utility], ac_cv_make_timetrim,
3902 ac_cv_make_timetrim=yes
3905 ac_cv_make_timetrim=yes
3908 ac_cv_make_timetrim=no
3911 case "$ac_cv_make_timetrim" in
3913 MAKE_TIMETRIM=timetrim
3917 AC_SUBST(MAKE_LIBNTPSIM)
3918 AC_SUBST(MAKE_NTPDSIM)
3920 AC_MSG_CHECKING([if we want to build the NTPD simulator])
3925 [--enable-simulator],
3926 [- build/install the NTPD simulator?]
3932 AC_MSG_RESULT([$ans])
3936 MAKE_NTPDSIM=ntpdsim
3937 MAKE_LIBNTPSIM=libntpsim.a
3946 LDFLAGS="$LDFLAGS -r"
3953 AC_MSG_CHECKING([if we should always slew the time])
3955 # target-specific defaults
3967 *-*-openvms*) # HMS: won't be found
3974 # --enable-slew-always / --disable-slew-always overrides default
3979 [--enable-slew-always],
3980 [s always slew the time]
3985 AC_MSG_RESULT([$ans])
3988 yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
3991 AC_MSG_CHECKING([if we should step and slew the time])
4003 *-*-solaris2.1[[0-9]]*)
4006 *-*-solaris2.[[012]]*)
4009 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
4020 [--enable-step-slew],
4021 [s step and slew the time]
4026 AC_MSG_RESULT([$ans])
4029 yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
4032 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])
4053 yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
4057 AC_MSG_CHECKING([if we should sync TODR clock every hour])
4063 *-*-openvms*) # HMS: won't be found
4073 [--enable-hourly-todr-sync],
4074 [s if we should sync TODR hourly]
4079 AC_MSG_RESULT([$ans])
4081 case "$ac_cv_var_sync_todr" in
4082 yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
4086 AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4099 # Generic_105181-17 and higher
4119 # Generic_106541-07 and higher
4136 [--enable-kernel-fll-bug],
4137 [s if we should avoid a kernel FLL bug]
4142 AC_MSG_RESULT([$ans])
4145 yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
4149 AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
4152 *-*-solaris2.[[89]])
4155 *-*-solaris2.1[[0-9]]*)
4164 [--enable-irig-sawtooth],
4165 [s if we should enable the IRIG sawtooth filter]
4170 AC_MSG_RESULT([$ans])
4173 yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
4177 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4183 [- if we should enable the NIST lockclock scheme]
4189 AC_MSG_RESULT([$ans])
4192 yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
4196 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4201 [--enable-ntp-signd],
4202 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4208 AC_MSG_RESULT([$ans])
4215 ntp_signd_path=/var/run/ntp_signd
4218 ntp_signd_path="$ans"
4221 case "$ntp_signd_path" in
4227 AC_DEFINE(HAVE_NTP_SIGND, ,[Do we want support for Samba's signing daemon?])
4228 AC_DEFINE_UNQUOTED(NTP_SIGND_PATH, "$ntp_signd_path", [Path to sign daemon rendezvous socket])
4232 AC_MSG_CHECKING([if we want the windows symmetric client hack])
4234 # default is no, unless --enable-ntp-signd was given
4235 ans=$wintime_default
4236 unset wintime_default
4242 [- Provide the windows symmetric client hack]
4247 AC_MSG_RESULT([$ans])
4251 AC_DEFINE(WINTIME, ,[Do we want the windows symmetric client hack?])
4255 AC_CHECK_HEADERS(sys/clockctl.h)
4268 [--enable-clockctl],
4269 [s Use /dev/clockctl for non-root clock control]
4271 [ntp_use_dev_clockctl=$enableval],
4272 [ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h]
4275 AC_MSG_CHECKING([[if we should use /dev/clockctl]])
4276 AC_MSG_RESULT([$ntp_use_dev_clockctl])
4279 AC_CHECK_HEADERS([sys/capability.h])
4280 AC_CHECK_HEADERS([sys/prctl.h])
4282 AC_MSG_CHECKING([[if we have linux capabilities (libcap)]])
4284 case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
4286 ntp_have_linuxcaps=yes
4289 ntp_have_linuxcaps=no
4292 AC_MSG_RESULT([$ntp_have_linuxcaps])
4298 [--enable-linuxcaps],
4299 [+ Use Linux capabilities for non-root clock control]
4301 [ntp_have_linuxcaps=$enableval]
4305 case "$ntp_have_linuxcaps" in
4307 AC_DEFINE(HAVE_LINUX_CAPABILITIES, ,[[Do we have Linux capabilities?]])
4312 case "$ntp_use_dev_clockctl$ntp_have_linuxcaps" in
4314 AC_DEFINE(HAVE_DROPROOT, ,[[Can we drop root privileges?]])
4318 AC_CHECK_HEADERS([libscf.h])
4320 case "$ac_cv_header_libscf_h" in
4322 AC_SUBST(LSCF, [-lscf])
4327 AC_DEFINE(HAVE_SOLARIS_PRIVS, ,[[Are Solaris privileges available?]])
4335 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
4336 AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[ISC: struct sockaddr as sa_len?])
4339 AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [s use IPv6?]))
4341 case "$enable_ipv6" in
4344 powerpc-ibm-aix4*) ;;
4346 AC_DEFINE(WANT_IPV6, ,[configure --enable-ipv6])
4356 [for IPv6 structures],
4357 ac_cv_isc_found_ipv6,
4363 #include <sys/types.h>
4364 #include <sys/socket.h>
4365 #include <netinet/in.h>
4368 struct sockaddr_in6 sin6;
4372 [ac_cv_isc_found_ipv6=yes],
4373 [ac_cv_isc_found_ipv6=no]
4379 # See whether IPv6 support is provided via a Kame add-on.
4380 # This is done before other IPv6 linking tests so LIBS is properly set.
4382 AC_MSG_CHECKING([for Kame IPv6 support])
4384 [AC_HELP_STRING([--with-kame], [- =/usr/local/v6])],
4385 use_kame="$withval", use_kame="no")
4391 kame_path=/usr/local/v6
4394 kame_path="$use_kame"
4403 if test -f $kame_path/lib/libinet6.a; then
4404 AC_MSG_RESULT($kame_path/lib/libinet6.a)
4405 LIBS="-L$kame_path/lib -linet6 $LIBS"
4407 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
4409 Please choose the proper path with the following command:
4411 configure --with-kame=PATH
4418 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
4419 # Including it on Kame-using platforms is very bad, though, because
4420 # Kame uses #error against direct inclusion. So include it on only
4421 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
4422 # This is done before the in6_pktinfo check because that's what
4423 # netinet6/in6.h is needed for.
4427 AC_DEFINE(ISC_PLATFORM_NEEDNETINET6IN6H, 1, [Do we need netinet6/in6.h?])
4428 isc_netinet6in6_hack="#include <netinet6/in6.h>"
4431 isc_netinet6in6_hack=""
4435 # This is similar to the netinet6/in6.h issue.
4438 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
4439 AC_DEFINE(ISC_PLATFORM_FIXIN6ISADDR, 1,[Do we need to fix in6isaddr?])
4440 isc_netinetin6_hack="#include <netinet/in6.h>"
4443 isc_netinetin6_hack=""
4447 case "$ac_cv_isc_found_ipv6" in
4449 AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[have IPv6?])
4453 ac_cv_have_in6_pktinfo,
4459 #include <sys/types.h>
4460 #include <sys/socket.h>
4461 #include <netinet/in.h>
4462 $isc_netinetin6_hack
4463 $isc_netinet6in6_hack
4466 struct in6_pktinfo xyzzy;
4470 [ac_cv_have_in6_pktinfo=yes],
4471 [ac_cv_have_in6_pktinfo=no]
4476 case "$ac_cv_have_in6_pktinfo" in
4478 AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, , [have struct in6_pktinfo?])
4482 # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
4484 [for sockaddr_in6.sin6_scope_id],
4485 ac_cv_have_sin6_scope_id,
4491 #include <sys/types.h>
4492 #include <sys/socket.h>
4493 #include <netinet/in.h>
4494 $isc_netinetin6_hack
4495 $isc_netinet6in6_hack
4498 struct sockaddr_in6 xyzzy;
4499 xyzzy.sin6_scope_id = 0;
4503 [ac_cv_have_sin6_scope_id=yes],
4504 [ac_cv_have_sin6_scope_id=no]
4509 case "$ac_cv_have_sin6_scope_id" in
4511 AC_DEFINE(ISC_PLATFORM_HAVESCOPEID, , [have sin6_scope_id?])
4516 # We need this check run even without ac_cv_isc_found_ipv6=yes
4520 ac_cv_have_in6addr_any,
4526 #include <sys/types.h>
4527 #include <sys/socket.h>
4528 #include <netinet/in.h>
4529 $isc_netinetin6_hack
4530 $isc_netinet6in6_hack
4533 struct in6_addr in6;
4538 [ac_cv_have_in6addr_any=yes],
4539 [ac_cv_have_in6addr_any=no]
4544 case "$ac_cv_have_in6addr_any" in
4546 AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, , [missing in6addr_any?])
4551 [for struct if_laddrconf],
4552 ac_cv_isc_struct_if_laddrconf,
4558 #include <sys/types.h>
4559 #include <net/if6.h>
4562 struct if_laddrconf a;
4566 [ac_cv_isc_struct_if_laddrconf=yes],
4567 [ac_cv_isc_struct_if_laddrconf=no]
4572 case "$ac_cv_isc_struct_if_laddrconf" in
4574 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, , [have struct if_laddrconf?])
4578 [for struct if_laddrreq],
4579 ac_cv_isc_struct_if_laddrreq,
4585 #include <sys/types.h>
4586 #include <net/if6.h>
4589 struct if_laddrreq a;
4593 [ac_cv_isc_struct_if_laddrreq=yes],
4594 [ac_cv_isc_struct_if_laddrreq=no]
4599 case "$ac_cv_isc_struct_if_laddrreq" in
4601 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, , [have struct if_laddrreq?])
4605 # Look for a sysctl call to get the list of network interfaces.
4608 [for interface list sysctl],
4609 ac_cv_iflist_sysctl,
4613 #include <sys/param.h>
4614 #include <sys/sysctl.h>
4615 #include <sys/socket.h>
4616 #ifdef NET_RT_IFLIST
4620 [ac_cv_iflist_sysctl=yes],
4621 [ac_cv_iflist_sysctl=no]
4625 case "$ac_cv_iflist_sysctl" in
4627 AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[have iflist_sysctl?])
4633 AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
4635 AC_CONFIG_FILES(Makefile)
4636 AC_CONFIG_FILES(ElectricFence/Makefile)
4637 AC_CONFIG_FILES(adjtimed/Makefile)
4638 AC_CONFIG_FILES(clockstuff/Makefile)
4639 AC_CONFIG_FILES(include/Makefile)
4640 AC_CONFIG_FILES(include/isc/Makefile)
4641 AC_CONFIG_FILES(kernel/Makefile)
4642 AC_CONFIG_FILES(kernel/sys/Makefile)
4643 AC_CONFIG_FILES(libntp/Makefile)
4644 AC_CONFIG_FILES(libparse/Makefile)
4645 AC_CONFIG_FILES(ntpd/Makefile)
4646 AC_CONFIG_FILES(ntpdate/Makefile)
4647 AC_CONFIG_FILES(ntpdc/Makefile)
4648 AC_CONFIG_FILES(ntpdc/nl.pl, [chmod +x ntpdc/nl.pl])
4649 AC_CONFIG_FILES(ntpq/Makefile)
4650 AC_CONFIG_FILES(parseutil/Makefile)
4651 AC_CONFIG_FILES(scripts/Makefile)
4652 AC_CONFIG_FILES(scripts/calc_tickadj, [chmod +x scripts/calc_tickadj])
4653 AC_CONFIG_FILES(scripts/checktime, [chmod +x scripts/checktime])
4654 AC_CONFIG_FILES(scripts/freq_adj, [chmod +x scripts/freq_adj])
4655 AC_CONFIG_FILES(scripts/html2man, [chmod +x scripts/html2man])
4656 AC_CONFIG_FILES(scripts/mkver, [chmod +x scripts/mkver])
4657 AC_CONFIG_FILES(scripts/ntp-wait, [chmod +x scripts/ntp-wait])
4658 AC_CONFIG_FILES(scripts/ntpsweep, [chmod +x scripts/ntpsweep])
4659 AC_CONFIG_FILES(scripts/ntptrace, [chmod +x scripts/ntptrace])
4660 AC_CONFIG_FILES(scripts/ntpver, [chmod +x scripts/ntpver])
4661 AC_CONFIG_FILES(scripts/plot_summary, [chmod +x scripts/plot_summary])
4662 AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary])
4663 AC_CONFIG_FILES(util/Makefile)
4665 AC_CONFIG_SUBDIRS(sntp)