2 dnl Process this file with autoconf to produce a configure script.
3 m4_include([version.m4])
5 AC_INIT([ntp], [VERSION_NUMBER])
6 AC_CONFIG_MACRO_DIR([m4])
9 # Increment ntp_configure_cache_version by one for each change to
10 # configure.ac or .m4 files which invalidates cached values from
13 # If the change affects cache variables used only by the main NTP
14 # configure.ac, then only its version number should be bumped, while
15 # the subdir configure.ac version numbers should be unchanged. The
16 # same is true for a test/variable that is used only by one subdir
17 # being changed incompatibly; only that subdir's cache version needs
20 # If a change affects variables shared by all NTP configure scripts,
21 # please bump the version numbers of all three. If you are not sure,
22 # the safe choice is to bump all three on any cache-invalidating change.
24 # In order to avoid the risk of version stamp collision between -stable
25 # and -dev branches, do not simply increment the version, instead use
26 # the date YYYYMMDD optionally with -HHMM if there is more than one
29 ntp_configure_cache_version=20091117
31 # When the cache version of config.cache and configure do not
32 # match, NTP_CACHEVERSION will flush the cache.
34 NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
39 dnl the 'build' machine is where we run configure and compile
40 dnl the 'host' machine is where the resulting stuff runs.
41 AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) of where we should run])
42 AM_CONFIG_HEADER([config.h])
46 ac_cv_var_oncore_ok=no
48 ac_cv_var_ripe_ncc_ok=no
49 ac_cv_var_jupiter_ok=no
51 dnl Grab any initial CFLAGS so we can pick better defaults.
54 dnl check these early to avoid autoconf warnings
58 # So far, the only shared library we might use is libopts.
59 # It's a small library - we might as well use a static version of it.
62 dnl we need to check for cross compile tools for vxWorks here
64 # Ralf Wildenhues: With per-target flags we need CC_C_O
65 # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
70 # AC_PROG_CC_STDC has two functions. It attempts to find a compiler
71 # capable of C99, or failing that, for C89. CC is set afterward with
72 # the selected invocation, such as "gcc --std=gnu99". Also, the
73 # ac_cv_prog_cc_stdc variable is no if the compiler selected for CC
74 # does not accept C89.
78 case "$ac_cv_prog_cc_stdc" in
80 AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile NTP ]
81 [version 4.2.5 and higher.])
84 # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
87 CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
89 *-*-hpux10.*) # at least for hppa2.0-hp-hpux10.20
93 *) CFLAGS="$CFLAGS -Wp,-H18816"
98 CFLAGS="$CFLAGS -DSYS_CYGWIN32"
103 CFLAGS="$CFLAGS -Wc,+abi-socket"
108 CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
109 LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
110 LIBS="$LIBS -lcurses"
113 # see "man standards".
114 # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
115 # -D_XOPEN_SOURCE=600 seems OK for c99
116 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
117 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
126 # NTP has (so far) been relying on leading-edge autogen.
127 # Therefore, by default:
128 # - use the version we ship with
129 # - do not install it
130 # - build a static copy (AC_DISABLE_SHARED - done earlier)
131 case "${enable_local_libopts+set}" in
133 *) enable_local_libopts=yes ;;
135 case "${enable_libopts_install+set}" in
137 *) enable_libopts_install=no ;;
139 LIBOPTS_CHECK(libopts)
144 [if $CC can handle @%:@warning],
148 AC_LANG_PROGRAM([], [#warning foo]),
149 [ac_cv_cpp_warning=yes],
150 [ac_cv_cpp_warning=no],
155 case "$ac_cv_cpp_warning" in
157 AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid @%:@warning on option name collisions?])
162 SAVED_CFLAGS_AC="$CFLAGS"
163 CFLAGS="$CFLAGS -Wstrict-overflow"
165 [if $CC can handle -Wstrict-overflow],
166 ac_cv_gcc_Wstrict_overflow,
169 [AC_LANG_PROGRAM([], [])],
170 [ac_cv_gcc_Wstrict_overflow=yes],
171 [ac_cv_gcc_Wstrict_overflow=no]
175 CFLAGS="$SAVED_CFLAGS_AC"
176 $as_unset SAVED_CFLAGS_AC
178 # $ac_cv_gcc_Wstrict_overflow is tested later to add the
186 SAVED_CFLAGS_AC="$CFLAGS"
187 CFLAGS="$CFLAGS -Winit-self"
189 [if $CC can handle -Winit-self],
190 ac_cv_gcc_Winit_self,
193 [AC_LANG_PROGRAM([], [])],
194 [ac_cv_gcc_Winit_self=yes],
195 [ac_cv_gcc_Winit_self=no]
199 CFLAGS="$SAVED_CFLAGS_AC"
200 $as_unset SAVED_CFLAGS_AC
202 # $ac_cv_gcc_Winit_self is tested later to add the
207 # Expose a cross-compilation indicator to makefiles
208 AM_CONDITIONAL(NTP_CROSSCOMPILE, test $build != $host)
210 AC_MSG_CHECKING([for bin subdirectory])
211 AC_ARG_WITH(binsubdir,
212 AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
213 use_binsubdir="$withval", use_binsubdir="bin")
215 case "$use_binsubdir" in
221 AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
224 AC_MSG_RESULT($use_binsubdir)
225 BINSUBDIR=$use_binsubdir
228 AC_MSG_CHECKING([if we want to use arlib])
230 AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
231 [ans=$withval], [ans=no])
232 AC_MSG_RESULT([$ans])
234 if test -d $srcdir/arlib
239 AC_CONFIG_SUBDIRS(arlib)
246 AC_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
247 [ans=$withval], [ans=x])
256 # HMS: Why isn't this $build?
257 # Well, that depends on if we need this for the build toolchain or
258 # for info in the host executable...
259 # I still have no idea which way this should go, but nobody has complained.
262 case "$need_dash_r" in
269 case "$need_dash_r" in
282 # Quick and dirty sanity check
284 '') AC_MSG_ERROR(Please follow the directions in html/build/hints/vxworks.html!)
287 CFLAGS="$CFLAGS -DSYS_VXWORKS"
293 dnl we need to check for cross compile tools for vxWorks here
301 CFLAGS="$CFLAGS -Wall"
302 # CFLAGS="$CFLAGS -Wcast-align"
303 CFLAGS="$CFLAGS -Wcast-qual"
304 # CFLAGS="$CFLAGS -Wconversion"
305 # CFLAGS="$CFLAGS -Werror"
306 # CFLAGS="$CFLAGS -Wextra"
307 # CFLAGS="$CFLAGS -Wfloat-equal"
308 CFLAGS="$CFLAGS -Wmissing-prototypes"
309 CFLAGS="$CFLAGS -Wpointer-arith"
310 CFLAGS="$CFLAGS -Wshadow"
311 # CFLAGS="$CFLAGS -Wtraditional"
312 # CFLAGS="$CFLAGS -Wwrite-strings"
313 case "$ac_cv_gcc_Winit_self" in
315 CFLAGS="$CFLAGS -Winit-self"
317 case "$ac_cv_gcc_Wstrict_overflow" in
319 CFLAGS="$CFLAGS -Wstrict-overflow"
321 # if building with OpenSSL, -Wno-strict-prototypes is added later
326 CFLAGS="$CFLAGS -posix"
328 dnl This is currently commented out by bor.
329 dnl The new versions of ReliantUNIX round adjtime() interval down
330 dnl to 1/100s (system tick). This makes tickadj actually useless.
331 dnl So, I'd better not use additional flags.
332 dnl I leave it here just in case anybody has better idea
333 dnl mips-sni-sysv4* )
335 dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
337 dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
338 dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
343 ac_busted_vpath_in_make=no
346 *-*-irix6.1*) # 64 bit only
349 *-*-irix6*) # 6.2 (and later?)
350 ac_busted_vpath_in_make=yes
353 ac_busted_vpath_in_make=yes
356 ac_busted_vpath_in_make=yes
360 case "$ac_busted_vpath_in_make$srcdir" in
363 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
365 AC_MSG_ERROR([building outside of the main directory requires GNU make])
375 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
376 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
381 AC_PROG_GCC_TRADITIONAL
384 AC_PATH_PROG(PATH_SH, sh)
385 AC_PATH_PROG(PATH_PERL, perl)
387 AC_ARG_WITH(net-snmp-config,
388 AC_HELP_STRING([--with-net-snmp-config], [+ =net-snmp-config]),
389 [ans=$withval], [ans=yes])
397 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
402 PROG_NET_SNMP_CONFIG=$ans
403 AC_MSG_CHECKING([for net-snmp-config path])
404 case "$PROG_NET_SNMP_CONFIG" in
407 PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
409 *) AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
412 AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
416 ac_link="$ac_link $VX_KERNEL"
424 AC_CHECK_LIB(advapi32, main)
428 AC_CHECK_FUNC([gethostent], ,
429 AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket]))
430 AC_CHECK_FUNC([openlog], ,
431 AC_SEARCH_LIBS([openlog], [gen], ,
432 AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])))
433 AC_SEARCH_LIBS([MD5Init], [md5 md])
434 AC_CHECK_FUNCS(MD5Init)
438 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
439 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
440 dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
441 dnl does Strange Things with extra processes using the Posix-compatibility
442 dnl real-time library, so we don't want to use it.
444 dnl 081118 Harlan got tired of looking for a way to get the sched*()
445 dnl functions to link OK with either cc or gcc.
452 AC_CHECK_LIB(rt, sched_setscheduler, ,
453 AC_CHECK_LIB(posix4, sched_setscheduler))
457 AC_SEARCH_LIBS([setsockopt], [socket xnet])
458 AC_SEARCH_LIBS([res_init], [resolv], , , [-lsocket -lnsl])
459 AC_CHECK_FUNCS(res_init __res_init)
462 AC_CHECK_HEADERS(bstring.h)
463 AC_CHECK_HEADER(dns_sd.h,
464 [AC_CHECK_LIB(dns_sd,
466 [AC_DEFINE(HAVE_DNSREGISTRATION, 1,
467 [Use Rendezvous/DNS-SD registration])])])
468 case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
469 yes) LIBS="-ldns_sd $LIBS" ;;
471 AC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h kvm.h math.h)
473 AC_CHECK_HEADERS(md5.h, [], [],
474 [#if HAVE_SYS_TYPES_H
475 #include <sys/types.h>
478 AC_CHECK_HEADERS(memory.h netdb.h poll.h)
479 AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
480 AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
484 AC_CHECK_HEADERS(utmpx.h)
485 case "$ac_cv_header_utmpx_h" in
487 *) AC_CHECK_HEADERS(utmp.h) ;;
490 *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
494 # On Suns only (so far) getpass() truncates the typed password to 8
495 # characters, but getpassphrase() allows up to 257. Most systems'
496 # getpass() does not truncate, at least not so as to affect ntpq and
497 # ntpdc password prompts.
499 # So check for getpassphrase(), but only on Sun operating systems.
503 *-*-sunos*|*-*-solaris*)
504 AC_CHECK_FUNCS(getpassphrase)
507 AC_CHECK_HEADERS(arpa/nameser.h)
508 AC_CHECK_HEADERS(sys/socket.h)
509 AC_CHECK_HEADERS(net/if.h, [], [],
510 [#if HAVE_SYS_SOCKET_H
511 #include <sys/socket.h>
514 AC_CHECK_HEADERS(net/if6.h)
515 AC_CHECK_HEADERS(net/route.h, [], [], [
516 #include <sys/types.h>
517 #include <sys/socket.h>
520 AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
521 AC_CHECK_HEADERS(netinet/in.h)
522 AC_CHECK_HEADERS(netinet/ip.h, [], [],
523 [#if HAVE_SYS_TYPES_H
524 #include <sys/types.h>
526 #if HAVE_NETINET_IN_H
527 #include <netinet/in.h>
529 #if HAVE_NETINET_IN_SYSTM_H
530 #include <netinet/in_systm.h>
534 # Check for IPTOS_PREC
536 [IPPROTO_IP IP_TOS IPTOS_LOWDELAY],
543 #include <sys/types.h>
545 #if HAVE_NETINET_IP_H
546 #include <netinet/in.h>
547 #include <netinet/ip.h>
549 #if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY)
559 case "$ac_cv_ip_tos" in
561 AC_DEFINE(HAVE_IPTOS_SUPPORT, 1, [Do we have IPTOS support?])
564 AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
565 AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
566 dnl AC_CHECK_HEADERS(sys/chudefs.h)
567 AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
570 *) AC_CHECK_HEADERS(sys/ioctl.h)
573 AC_CHECK_HEADERS(sys/ipc.h)
574 AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
575 # HMS: Check sys/proc.h and sys/resource.h after some others
576 AC_CHECK_HEADERS(sys/ppstime.h)
577 case "$ac_cv_header_sched_h" in
579 *) AC_CHECK_HEADERS(sys/sched.h) ;;
583 AC_CHECK_HEADERS(sys/sio.h)
586 # HMS: Check sys/shm.h after some others
587 AC_CHECK_HEADERS(sys/select.h sys/signal.h sys/sockio.h)
588 # HMS: Checked sys/socket.h earlier
591 *) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
594 AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
595 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
596 AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
599 # include <sys/time.h>
604 #include <sys/timepps.h>
605 #ifdef PPS_API_VERS_1
608 ], [AC_CHECK_HEADERS(sys/timepps.h, [], [],
610 # include <sys/time.h>
617 AC_CHECK_HEADERS(sys/timers.h sys/tpro.h sys/types.h sys/wait.h)
621 AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
624 AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
630 AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
633 case "$ac_cv_func___adjtimex" in
636 AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
637 dnl AC_CHECK_LIB(kvm, main, , , -lelf)
638 AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
639 AC_CHECK_LIB(ld, nlist)
640 AC_CHECK_LIB(mld, nlist)
641 AC_CHECK_HEADER(nlist.h,
642 [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
643 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
644 [AC_TRY_COMPILE([#include <nlist.h>],
645 [struct nlist n; n.n_un.n_name = 0;],
646 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
647 if test $ac_cv_struct_nlist_n_un = yes; then
648 AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
654 dnl AC_CHECK_HEADERS(net/if.h, [], [],
655 dnl [#if HAVE_SYS_TYPES_H
656 dnl # include <sys/types.h>
658 dnl #if HAVE_SYS_SOCKET_H
659 dnl # include <sys/socket.h>
663 AC_CHECK_HEADERS(sys/proc.h, [], [],
664 [#if HAVE_SYS_TYPES_H
665 # include <sys/types.h>
668 # include <sys/time.h>
672 AC_CHECK_HEADERS(sys/resource.h, [], [],
674 # include <sys/time.h>
678 AC_CHECK_HEADERS(sys/shm.h, [], [],
679 [#if HAVE_SYS_TYPES_H
680 # include <sys/types.h>
683 # include <sys/ipc.h>
687 AC_CHECK_HEADERS(sys/timex.h, [], [],
689 # include <sys/time.h>
693 AC_CHECK_HEADERS(resolv.h, [], [],
694 [#if HAVE_SYS_TYPES_H
695 #include <sys/types.h>
697 #if HAVE_NETINET_IN_H
698 #include <netinet/in.h>
700 #if HAVE_ARPA_NAMESER_H
701 #include <arpa/nameser.h>
705 AC_CACHE_CHECK([for basic volatile support], ac_cv_c_volatile,
708 ac_cv_c_volatile=yes,
711 case "$ac_cv_c_volatile" in
714 *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
723 AC_CHECK_TYPE(time_t, long)
724 AC_CHECK_SIZEOF(time_t)
725 AC_CHECK_TYPES(uintptr_t)
727 AH_VERBATIM([TYPEDEF_UINTPTR_T],
728 [/* Provide a typedef for uintptr_t? */
729 #ifndef HAVE_UINTPTR_T
730 typedef unsigned int uintptr_t;
731 #define HAVE_UINTPTR_T 1
736 AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
737 [AC_TRY_COMPILE([#include <sys/types.h>],
738 [u_int8_t len = 42; return 0;],
739 ac_cv_type_u_int8_t=yes,
740 ac_cv_type_u_int8_t=no)
742 if test $ac_cv_type_u_int8_t = yes; then
743 AC_DEFINE(HAVE_TYPE_U_INT8_T, 1, [Does u_int8_t exist?])
746 AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
747 [AC_TRY_COMPILE([#include <sys/types.h>],
748 [u_int64_t len = 42; return 0;],
749 ac_cv_type_u_int64_t=yes,
750 ac_cv_type_u_int64_t=no)
752 if test $ac_cv_type_u_int64_t = yes; then
753 AC_DEFINE(HAVE_TYPE_U_INT64_T, 1, [Does u_int64_t exist?])
756 AC_CACHE_CHECK([for a fallback value for HZ], ac_cv_var_default_hz,
757 [ac_cv_var_default_hz=100
759 alpha*-dec-osf4*|alpha*-dec-osf5*)
760 ac_cv_var_default_hz=1024
763 ac_cv_var_default_hz=256
766 AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
768 AC_CACHE_CHECK([if we need to override the system's value for HZ], ac_cv_var_override_hz,
769 [ac_cv_var_override_hz=no
771 alpha*-dec-osf4*|alpha*-dec-osf5*)
772 ac_cv_var_override_hz=yes
775 ac_cv_var_override_hz=yes
778 ac_cv_var_override_hz=yes
781 ac_cv_var_override_hz=yes
784 case "$ac_cv_var_override_hz" in
786 AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
790 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
791 dnl [AC_TRY_LINK([#include <sys/types.h>
792 dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
793 dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
794 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
795 dnl AC_DEFINE(HAVE_UT_HOST)
798 dnl AC_MSG_CHECKING(if we can get the system boot time)
799 dnl AC_CACHE_VAL(su_cv_have_boot_time,
800 dnl [AC_EGREP_CPP(yes,
801 dnl [#ifdef HAVE_UTMPX_H
802 dnl #include <utmpx.h>
804 dnl #include <utmp.h>
809 dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
810 dnl AC_MSG_RESULT($su_cv_have_boot_time)
812 AC_CACHE_CHECK([for struct rt_msghdr], ac_cv_struct_rt_msghdr,
814 #include <sys/types.h>
815 #include <sys/socket.h>
817 #include <net/route.h>],
818 [struct rt_msghdr p;],
819 ac_cv_struct_rt_msghdr=yes,
820 ac_cv_struct_rt_msghdr=no)
823 AC_CACHE_CHECK([for struct rtattr], ac_cv_struct_rtattr,
825 #include <linux/rtnetlink.h>],
827 ac_cv_struct_rtattr=yes,
828 ac_cv_struct_rtattr=no)
831 if test $ac_cv_struct_rt_msghdr = yes -o $ac_cv_struct_rtattr = yes; then
832 AC_DEFINE(HAS_ROUTING_SOCKET, 1, [Do we have a routing socket (struct rt_msghdr)?])
833 if test $ac_cv_struct_rtattr = yes; then
834 AC_DEFINE(HAVE_RTNETLINK, 1, [Do we have Linux routing socket?])
839 [struct sigaction for sa_sigaction],
840 ac_cv_struct_sigaction_has_sa_sigaction,
843 [#include <signal.h>],
844 [struct sigaction act; act.sa_sigaction = 0;],
845 ac_cv_struct_sigaction_has_sa_sigaction=yes,
846 ac_cv_struct_sigaction_has_sa_sigaction=no
850 if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
851 AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
854 AC_CACHE_CHECK([for struct ppsclockev], ac_cv_struct_ppsclockev,
856 #include <sys/types.h>
857 #ifdef HAVE_SYS_TERMIOS_H
858 # include <sys/termios.h>
860 #ifdef HAVE_SYS_TIME_H
861 # include <sys/time.h>
863 #ifdef HAVE_SYS_PPSCLOCK_H
864 # include <sys/ppsclock.h>
866 extern struct ppsclockev *pce;
867 return pce->serial;],
868 ac_cv_struct_ppsclockev=yes,
869 ac_cv_struct_ppsclockev=no)
871 if test $ac_cv_struct_ppsclockev = yes; then
872 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
876 [for struct sockaddr_storage],
877 ntp_cv_sockaddr_storage,
881 #ifdef HAVE_SYS_TYPES_H
882 # include <sys/types.h>
884 #ifdef HAVE_SYS_SOCKET_H
885 # include <sys/socket.h>
887 #ifdef HAVE_NETINET_IN_H
888 # include <netinet/in.h>
892 struct sockaddr_storage n;
894 [ntp_cv_sockaddr_storage="yes"],
895 [ntp_cv_sockaddr_storage="no"]
899 case "$ntp_cv_sockaddr_storage" in
901 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
905 [for sockaddr_storage.ss_family],
906 ntp_cv_have_ss_family,
910 #ifdef HAVE_SYS_TYPES_H
911 # include <sys/types.h>
913 #ifdef HAVE_SYS_SOCKET_H
914 # include <sys/socket.h>
916 #ifdef HAVE_NETINET_IN_H
917 # include <netinet/in.h>
921 struct sockaddr_storage s;
924 [ntp_cv_have_ss_family="yes"],
925 [ntp_cv_have_ss_family="no"]
930 case "$ntp_cv_have_ss_family" in
933 [for sockaddr_storage.__ss_family],
934 ntp_cv_have___ss_family,
938 #ifdef HAVE_SYS_TYPES_H
939 # include <sys/types.h>
941 #ifdef HAVE_SYS_SOCKET_H
942 # include <sys/socket.h>
944 #ifdef HAVE_NETINET_IN_H
945 # include <netinet/in.h>
949 struct sockaddr_storage s;
952 [ntp_cv_have___ss_family="yes"],
953 [ntp_cv_have___ss_family="no"]
957 case "$ntp_cv_have___ss_family" in
959 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
964 [HAVE___SS_FAMILY_IN_SS_VERBATIM],
966 /* Handle sockaddr_storage.__ss_family */
967 #ifdef HAVE___SS_FAMILY_IN_SS
968 # define ss_family __ss_family
969 #endif /* HAVE___SS_FAMILY_IN_SS */
974 [for sockaddr_storage.ss_len],
979 #ifdef HAVE_SYS_TYPES_H
980 # include <sys/types.h>
982 #ifdef HAVE_SYS_SOCKET_H
983 # include <sys/socket.h>
985 #ifdef HAVE_NETINET_IN_H
986 # include <netinet/in.h>
990 struct sockaddr_storage s;
993 [ntp_cv_have_ss_len="yes"],
994 [ntp_cv_have_ss_len="no"]
999 case "$ntp_cv_have_ss_len" in
1002 [for sockaddr_storage.__ss_len],
1003 ntp_cv_have___ss_len,
1007 #ifdef HAVE_SYS_TYPES_H
1008 # include <sys/types.h>
1010 #ifdef HAVE_SYS_SOCKET_H
1011 # include <sys/socket.h>
1013 #ifdef HAVE_NETINET_IN_H
1014 # include <netinet/in.h>
1018 struct sockaddr_storage s;
1021 [ntp_cv_have___ss_len="yes"],
1022 [ntp_cv_have___ss_len="no"]
1026 case "$ntp_cv_have___ss_len" in
1028 AC_DEFINE(HAVE___SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have __ss_len?])
1033 [HAVE___SS_LEN_IN_SS_VERBATIM],
1035 /* Handle sockaddr_storage.__ss_len */
1036 #ifdef HAVE___SS_LEN_IN_SS
1037 # define ss_len __ss_len
1038 #endif /* HAVE___SS_LEN_IN_SS */
1043 # Look for in_port_t.
1047 isc_cv_have_in_port_t,
1051 #include <sys/types.h>
1052 #include <netinet/in.h>
1055 in_port_t port = 25;
1058 [isc_cv_have_in_port_t=yes],
1059 [isc_cv_have_in_port_t=no]
1063 case "$isc_cv_have_in_port_t" in
1065 AC_DEFINE(ISC_PLATFORM_NEEDPORTT, 1, [Declare in_port_t?])
1068 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
1070 AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
1072 #ifdef HAVE_MACHINE_SOUNDCARD_H
1073 # include <machine/soundcard.h>
1075 #ifdef HAVE_SYS_SOUNDCARD_H
1076 # include <sys/soundcard.h>
1078 extern struct snd_size *ss;
1079 return ss->rec_size;],
1080 ac_cv_struct_snd_size=yes,
1081 ac_cv_struct_snd_size=no)
1083 case "$ac_cv_struct_snd_size" in
1084 yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
1089 AC_CACHE_CHECK([struct clockinfo for hz], ac_cv_struct_clockinfo_has_hz,
1091 #include <sys/time.h>],[
1092 extern struct clockinfo *pc;
1094 ac_cv_struct_clockinfo_has_hz=yes,
1095 ac_cv_struct_clockinfo_has_hz=no)
1097 if test $ac_cv_struct_clockinfo_has_hz = yes; then
1098 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
1101 AC_CACHE_CHECK([struct clockinfo for tickadj], ac_cv_struct_clockinfo_has_tickadj,
1103 #include <sys/time.h>],[
1104 extern struct clockinfo *pc;
1105 return pc->tickadj;],
1106 ac_cv_struct_clockinfo_has_tickadj=yes,
1107 ac_cv_struct_clockinfo_has_tickadj=no)
1109 if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
1110 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
1113 AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
1115 #include <sys/time.h>
1116 /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
1120 #ifdef HAVE_SYS_TIMEPPS_H
1121 # define FRAC 4294967296
1122 # include <sys/timepps.h>
1124 [struct timespec n;],
1125 ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
1126 if test $ac_cv_struct_timespec = yes; then
1127 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
1130 AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
1132 #include <sys/time.h>
1133 #include <sys/timex.h>],
1134 [struct ntptimeval n;],
1135 ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
1136 if test $ac_cv_struct_ntptimeval = yes; then
1137 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
1140 AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
1141 [#ifdef HAVE_SYS_TIME_H
1142 #include <sys/time.h>
1148 #ifdef HAVE_SYS_TIMEX_H
1149 #include <sys/timex.h>
1151 # ifdef HAVE_TIMEX_H
1158 case "$ac_cv_c_inline" in
1162 AC_DEFINE(HAVE_INLINE,1,[inline keyword or macro available])
1163 AC_SUBST(HAVE_INLINE)
1166 AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
1167 AC_CHECK_SIZEOF(signed char)
1168 AC_CHECK_SIZEOF(int)
1169 AC_CHECK_SIZEOF(long)
1171 AC_CHECK_TYPES([s_char])
1172 case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
1174 # We have a typedef for s_char. Might as well believe it...
1177 # We have signed chars, can't say 'signed char', no s_char typedef.
1178 AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
1181 # We have signed chars, can say 'signed char', no s_char typedef.
1182 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
1185 # We have unsigned chars, can't say 'signed char', no s_char typedef.
1186 AC_MSG_ERROR(No way to specify a signed character!)
1189 # We have unsigned chars, can say 'signed char', no s_char typedef.
1190 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
1197 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
1198 # (returning ENOSYS). I didn't check 4.2. If, in the future,
1199 # IBM pulls its thumbs out long enough to implement clock_settime,
1200 # this conditional will need to change. Maybe use AC_TRY_RUN
1201 # instead to try to set the time to itself and check errno.
1204 AC_SEARCH_LIBS([clock_gettime], [rt])
1205 AC_CHECK_FUNCS([clock_gettime clock_settime])
1208 AC_CHECK_FUNCS(daemon)
1209 AC_CHECK_FUNCS(finite, ,
1210 [AC_CHECK_FUNCS(isfinite, ,
1211 [AC_MSG_CHECKING([for isfinite with <math.h>])
1214 AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
1216 AC_DEFINE(HAVE_ISFINITE)],
1219 AC_CHECK_FUNCS(getbootfile getclock getdtablesize)
1221 AC_ARG_ENABLE(getifaddrs,
1222 AC_HELP_STRING([--enable-getifaddrs],
1223 [s Enable the use of getifaddrs() [[yes|no|glibc]].
1224 glibc: Use getifaddrs() in glibc if you know it supports IPv6.]),
1225 want_getifaddrs="$enableval", want_getifaddrs="yes")
1227 case $want_getifaddrs in
1230 # Do we have getifaddrs() ?
1234 # Some recent versions of glibc support getifaddrs() which does not
1235 # provide AF_INET6 addresses while the function provided by the USAGI
1236 # project handles the AF_INET6 case correctly. We need to avoid
1237 # using the former but prefer the latter unless overridden by
1238 # --enable-getifaddrs=glibc.
1239 if test $want_getifaddrs = glibc
1241 AC_CHECK_FUNCS(getifaddrs)
1244 LIBS="-L/usr/local/v6/lib $LIBS"
1245 AC_CHECK_LIB(inet6, getifaddrs,
1246 LIBS="$LIBS -linet6"
1247 AC_DEFINE(HAVE_GETIFADDRS),
1252 AC_CHECK_FUNCS(getifaddrs)
1260 AC_MSG_CHECKING([type of socklen arg for getsockname()])
1261 AC_CACHE_VAL(ac_cv_func_getsockname_arg2,dnl
1262 [AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl
1263 [for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do
1264 for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
1266 [#ifdef HAVE_SYS_TYPES_H
1267 #include <sys/types.h>
1269 #ifdef HAVE_SYS_SOCKET_H
1270 #include <sys/socket.h>
1272 extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl
1273 [ac_not_found=no ; break 2], ac_not_found=yes)
1278 if test "$ac_not_found" = yes; then
1279 ac_cv_func_getsockname_socklen_type='socklen_t'
1281 AC_MSG_RESULT([$ac_cv_func_getsockname_socklen_type])
1282 AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
1283 $ac_cv_func_getsockname_socklen_type,
1284 [What is getsockname()'s socklen type?])
1286 AC_CHECK_FUNCS(getrusage)
1287 AC_CHECK_FUNC(gettimeofday, ,[
1289 *-*-mpeix*) ac_cv_func_gettimeofday=yes
1295 *) AC_CHECK_FUNCS(getuid)
1298 AC_CHECK_FUNCS(hstrerror)
1301 # Check for if_nametoindex() for IPv6 scoped addresses support
1303 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1304 ac_cv_have_if_nametoindex=no)
1305 case $ac_cv_have_if_nametoindex in
1309 AC_CHECK_LIB(ipv6, if_nametoindex,
1310 ac_cv_have_if_nametoindex=yes
1311 LIBS="-lipv6 $LIBS",)
1315 case $ac_cv_have_if_nametoindex in
1317 AC_DEFINE(ISC_PLATFORM_HAVEIFNAMETOINDEX, 1, [ISC: do we have if_nametoindex()?])
1321 AC_SEARCH_LIBS([inet_ntop], [resolv], , , [-lsocket -lnsl])
1322 AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
1323 AC_CHECK_FUNC(inet_pton, [], [AC_DEFINE(ISC_PLATFORM_NEEDPTON, 1, [ISC: provide inet_pton()])])
1324 case "$ac_cv_header_kvm_h" in
1326 AC_CHECK_FUNCS(kvm_open)
1329 AC_CHECK_FUNCS(memcpy memmove memset)
1332 # Just stubs. Idiots.
1334 *) AC_CHECK_FUNCS(mkstemp)
1337 AC_CHECK_FUNCS(mktime)
1340 # Just a stub. Idiots.
1343 # Just a stub in "old" Irix. Idiots.
1346 # there, but more trouble than it is worth for now (resolver problems)
1349 # Apparently there but not working in QNX. Idiots?
1352 # Just a stub. Idiots.
1354 alpha*-dec-osf4*|alpha*-dec-osf5*)
1355 # mlockall is there, as a #define calling memlk via <sys/mman.h>
1356 # Not easy to test for - cheat.
1357 AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
1358 AC_CHECK_FUNCS(mlockall)
1360 *) AC_CHECK_FUNCS(mlockall)
1363 AC_CHECK_FUNCS(nice nlist)
1368 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
1371 AC_CHECK_FUNCS(plock pututline pututxline readlink recvmsg rtprio)
1374 # Just a stub in AIX 4. Idiots.
1377 # Just stubs in solaris2.5. Idiots.
1379 *) AC_CHECK_FUNCS(sched_setscheduler)
1382 AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
1383 AC_CHECK_FUNCS(setrlimit)
1384 AC_CHECK_FUNCS(settimeofday, ,[
1386 *-*-mpeix*) ac_cv_func_settimeofday=yes
1389 AC_CHECK_FUNCS(setvbuf sigaction)
1390 AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
1391 AC_CHECK_FUNCS(snprintf strdup strerror strstr)
1392 AC_CHECK_FUNCS(timegm)
1395 # Just stubs. Idiots.
1398 # Just stubs. Idiots.
1401 # Just stubs. Idiots.
1404 # Just stubs. Idiots.
1406 *) AC_CHECK_FUNCS(timer_create timer_settime)
1413 *) AC_CHECK_FUNCS(umask)
1416 AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
1420 # http://bugs.ntp.org/737
1421 case "$ac_cv_func_recvmsg" in
1423 AC_MSG_CHECKING([if we need extra help to define struct iovec])
1424 AC_CACHE_VAL(ac_cv_struct_iovec_help,dnl
1425 [for ac_cv_struct_iovec_help in '0' '1'; do
1427 [#ifdef HAVE_SYS_TYPES_H
1428 #include <sys/types.h>
1430 #ifdef HAVE_SYS_SOCKET_H
1431 #include <sys/socket.h>
1433 #if $ac_cv_struct_iovec_help
1434 #include <sys/uio.h>
1446 x = recvmsg(s, &mh, flags);
1448 [ac_worked=yes ; break 1], ac_worked=no)
1451 case "$ac_worked$ac_cv_struct_iovec_help" in
1453 AC_DEFINE(HAVE_SYS_UIO_H, 1, [Use sys/uio.h for struct iovec help])
1458 AC_MSG_RESULT([$ans])
1464 AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
1468 AC_CACHE_CHECK([number of arguments to gettimeofday()], ac_cv_func_Xettimeofday_nargs,
1469 [AC_TRY_COMPILE([#include <sys/time.h>],[
1470 gettimeofday((struct timeval*)0,(struct timezone*)0);
1471 settimeofday((struct timeval*)0,(struct timezone*)0);
1473 ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
1475 if test $ac_cv_func_Xettimeofday_nargs = 1; then
1476 AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
1479 AC_CACHE_CHECK([number of arguments taken by setpgrp()], ac_cv_func_setpgrp_nargs,
1481 #ifdef HAVE_SYS_TYPES_H
1482 # include <sys/types.h>
1484 #ifdef HAVE_UNISTD_H
1485 # include <unistd.h>
1488 ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
1490 if test $ac_cv_func_setpgrp_nargs = 0; then
1491 AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
1495 CFLAGS="$CFLAGS -I$srcdir/include"
1497 AC_CACHE_CHECK([argument pointer type of qsort()'s compare function and base],
1498 ac_cv_func_qsort_argtype,
1500 #include "l_stdlib.h"
1503 extern sortfunc (const void *, const void *);
1506 const void *b; { return 0; }
1508 qsort(base, 2, sizeof(char *), sortfunc);
1510 ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
1512 case "$ac_cv_func_qsort_argtype" in
1514 AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
1520 AC_CACHE_CHECK([if we need to declare 'errno'], ac_cv_decl_errno,
1521 [AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
1525 ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
1526 case "$ac_cv_decl_errno" in
1527 yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
1530 dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
1531 dnl the clash. <resolv.h> isn't currently used.
1533 dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1534 dnl MT purposes. This makes the line "extern int h_errno" choke
1535 dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1536 dnl without breaking any other platforms.
1538 AC_CACHE_CHECK([if we may declare 'h_errno'], ac_cv_decl_h_errno,
1539 [AC_TRY_COMPILE([#include <sys/types.h>
1540 #ifdef HAVE_NETINET_IN_H
1541 #include <netinet/in.h>
1543 #ifdef HAVE_ARPA_NAMESER_H
1544 #include <arpa/nameser.h>
1549 #ifdef HAVE_RESOLV_H
1552 [extern int h_errno;],
1553 ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
1554 case "$ac_cv_decl_h_errno" in
1555 yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
1558 dnl See if char *sys_errlist[] is OK.
1559 AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
1560 [AC_TRY_COMPILE([#include <stdio.h>
1564 [extern char *sys_errlist[];
1566 ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
1567 case "$ac_cv_decl_sys_errlist" in
1568 yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
1571 AC_CACHE_CHECK([if declaring 'syscall()' is ok], ac_cv_decl_syscall,
1573 #ifdef HAVE_SYS_TYPES_H
1574 # include <sys/types.h>
1576 #ifdef HAVE_UNISTD_H
1577 # include <unistd.h>
1580 [extern int syscall (int, ...);],
1581 ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
1582 case "$ac_cv_decl_syscall" in
1583 yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
1588 AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style]) # Needed for XLC under AIX 4.3.2
1591 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1592 AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
1593 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1594 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1595 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1596 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1597 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1600 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1601 AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
1604 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1607 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1608 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1609 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1610 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1611 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1612 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1613 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1614 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1615 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1616 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1617 AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1618 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1619 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1620 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1621 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1622 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1625 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1626 AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
1629 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1634 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1635 AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
1636 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1637 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1638 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1639 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1640 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1641 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1642 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1643 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1644 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1645 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1646 AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
1647 case "`basename $ac_cv_prog_CC`" in
1649 *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1652 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1653 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1654 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1655 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1656 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1657 AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
1658 AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
1661 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1662 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1663 AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
1664 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1665 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1666 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1667 AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
1668 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1669 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1670 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1671 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1672 AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
1673 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1674 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1680 AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
1684 AC_CACHE_CHECK([if we need extra room for SO_RCVBUF], ac_cv_var_rcvbuf_slop,
1691 ac_cv_var_rcvbuf_slop=$ans])
1692 case "$ac_cv_var_rcvbuf_slop" in
1693 yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
1696 AC_CACHE_CHECK([if we will open the broadcast socket], ac_cv_var_open_bcast_socket,
1703 ac_cv_var_open_bcast_socket=$ans])
1704 case "$ac_cv_var_open_bcast_socket" in
1705 yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
1708 AC_CACHE_CHECK([if we want the HPUX version of FindConfig()], ac_cv_var_hpux_findconfig,
1715 ac_cv_var_hpux_findconfig=$ans])
1716 case "$ac_cv_var_hpux_findconfig" in
1717 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
1720 AC_CACHE_CHECK([if process groups are set with -pid], ac_cv_arg_setpgrp_negpid,
1741 ac_cv_arg_setpgrp_negpid=$ans])
1742 case "$ac_cv_arg_setpgrp_negpid" in
1743 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
1747 [if we need a ctty for F_SETOWN],
1748 ntp_cv_func_ctty_for_f_setown,
1757 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1758 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1759 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1760 # in $host may be followed by "aout", "ecoff", or "elf".
1761 *-*-netbsd*[a-z]3.[0-8]*|*-*-netbsd*[a-z][0-2].*|*-*-netbsd*[a-z]3.99.[0-7])
1764 *-*-netbsd3.[0-8]*|*-*-netbsd[0-2].*|*-*-netbsd3.99.[0-7])
1779 ntp_cv_func_ctty_for_f_setown=$ans
1782 case "$ntp_cv_func_ctty_for_f_setown" in
1784 AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?])
1787 AC_CACHE_CHECK([if the OS fails to clear cached routes when more specific routes become available], ac_cv_os_routeupdates,
1795 ac_cv_os_routeupdates=$ans]])
1796 case "$ac_cv_os_routeupdates" in
1797 yes) AC_DEFINE(OS_MISSES_SPECIFIC_ROUTE_UPDATES, 1, [need to recreate sockets on changed routing?]) ;;
1800 AC_CACHE_CHECK([if the OS needs the wildcard socket set to REUSEADDR for binding interface addresses], ac_cv_os_wildcardreuse,
1808 ac_cv_os_wildcardreuse=$ans]])
1809 case "$ac_cv_os_wildcardreuse" in
1810 yes) AC_DEFINE(OS_NEEDS_REUSEADDR_FOR_IFADDRBIND, 1, [wildcard socket needs to set REUSEADDR when binding to interface addresses]) ;;
1814 AC_MSG_CHECKING([if we'll use clock_settime or settimeofday or stime])
1815 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1818 ans='clock_settime()'
1821 ntp_warning='But clock_settime() would be better (if we had it)'
1822 ans='settimeofday()'
1825 ntp_warning='Which is the worst of the three'
1830 $host) ntp_warning='Which leaves us with nothing to use!'
1835 AC_MSG_RESULT([$ans])
1836 case "$ntp_warning" in
1838 *) AC_MSG_WARN([*** $ntp_warning ***])
1842 AC_CACHE_CHECK([if we have a losing syscall()], ac_cv_var_syscall_bug,
1850 ac_cv_var_syscall_bug=$ans])
1851 case "$ac_cv_var_syscall_bug" in
1852 yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1855 AC_CACHE_CHECK([for SIGIO], ac_cv_hdr_def_sigio,
1857 [#include <signal.h>
1861 ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1863 dnl Override those system that have a losing SIGIO
1864 AC_CACHE_CHECK([if we want to use signalled IO], ac_cv_var_signalled_io,
1866 case "$ac_cv_hdr_def_sigio" in
1870 alpha*-dec-osf4*|alpha*-dec-osf5*)
1903 ac_cv_var_signalled_io=$ans])
1904 case "$ac_cv_var_signalled_io" in
1905 yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1908 AC_CACHE_CHECK([for SIGPOLL], ac_cv_hdr_def_sigpoll,
1910 [#include <signal.h>
1914 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1916 AC_CACHE_CHECK([for SIGSYS], ac_cv_hdr_def_sigsys,
1918 [#include <signal.h>
1922 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1924 AC_CACHE_CHECK([if we can use SIGPOLL for UDP I/O], ac_cv_var_use_udp_sigpoll,
1926 case "$ac_cv_hdr_def_sigpoll" in
1973 ac_cv_var_use_udp_sigpoll=$ans])
1974 case "$ac_cv_var_use_udp_sigpoll" in
1975 yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1978 AC_CACHE_CHECK([if we can use SIGPOLL for TTY I/O], ac_cv_var_use_tty_sigpoll,
1980 case "$ac_cv_hdr_def_sigpoll" in
2024 ac_cv_var_use_tty_sigpoll=$ans])
2025 case "$ac_cv_var_use_tty_sigpoll" in
2026 yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
2029 case "$ac_cv_header_sys_sio_h" in
2031 AC_CACHE_CHECK([sys/sio.h for TIOCDCDTIMESTAMP], ac_cv_hdr_def_tiocdcdtimestamp,
2033 [#include <sys/sio.h>
2034 #ifdef TIOCDCDTIMESTAMP
2037 ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
2041 case "$ac_cv_hdr_def_tiocdcdtimestamp" in
2043 ac_cv_var_oncore_ok=yes
2047 AC_CACHE_CHECK([if nlist() values might require extra indirection],
2048 ac_cv_var_nlist_extra_indirection,
2055 ac_cv_var_nlist_extra_indirection=$ans])
2056 case "$ac_cv_var_nlist_extra_indirection" in
2057 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
2060 AC_CACHE_CHECK([for a minimum recommended value of tickadj],
2061 ac_cv_var_min_rec_tickadj,
2068 ac_cv_var_min_rec_tickadj=$ans])
2069 case "$ac_cv_var_min_rec_tickadj" in
2071 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
2074 AC_CACHE_CHECK([if the TTY code permits PARENB and IGNPAR],
2075 ac_cv_var_no_parenb_ignpar,
2084 i?86-*-freebsd[[123]].*)
2093 ac_cv_var_no_parenb_ignpar=$ans])
2094 case "$ac_cv_var_no_parenb_ignpar" in
2095 yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
2098 AC_MSG_CHECKING([if we're including ntpd debugging code])
2099 AC_ARG_ENABLE(debugging,
2100 AC_HELP_STRING([--enable-debugging], [+ include ntpd debugging code]),
2101 [ntp_ok=$enableval], [ntp_ok=yes])
2102 if test "$ntp_ok" = "yes"; then
2103 AC_DEFINE(DEBUG, 1, [Enable ntpd debugging code?])
2105 AC_MSG_RESULT($ntp_ok)
2107 AC_MSG_CHECKING([if we including processing time debugging code])
2108 AC_ARG_ENABLE(debug-timing,
2109 AC_HELP_STRING([--enable-debug-timing], [- include processing time debugging code (costs performance)]),
2110 [ntp_ok=$enableval], [ntp_ok=no])
2111 if test "$ntp_ok" = "yes"; then
2112 AC_DEFINE(DEBUG_TIMING, 1, [Enable processing time debugging?])
2114 AC_MSG_RESULT($ntp_ok)
2116 AC_MSG_CHECKING([[for a the number of minutes in a DST adjustment]])
2120 [--enable-dst-minutes],
2121 [n minutes per DST adjustment @<:@60@:>@] dnl @<:@ is [
2126 AC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
2127 AC_MSG_RESULT([$ans])
2129 AC_MSG_CHECKING([[if ntpd will retry permanent DNS failures]])
2131 [ignore-dns-errors],
2133 [--enable-ignore-dns-errors],
2134 [- retry DNS queries on any error]
2141 AC_DEFINE(IGNORE_DNS_ERRORS, 1, [[Retry queries on _any_ DNS error?]])
2143 AC_MSG_RESULT([$ans])
2145 AC_MSG_CHECKING([if ntpd will use the deferred DNS lookup path])
2149 [--enable-force-defer-DNS],
2150 [- force all DNS lookups to take the deferred path]
2157 AC_DEFINE(FORCE_DEFER_DNS, 1, [Force deferred DNS lookups?])
2159 AC_MSG_RESULT([$ans])
2161 AC_CACHE_CHECK([if we have the tty_clk line discipline/streams module],
2163 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
2164 *yes*) ac_cv_var_tty_clk=yes ;;
2165 *) ac_cv_var_tty_clk=no ;;
2167 case "$ac_cv_var_tty_clk" in
2168 yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
2171 AC_CACHE_CHECK([for the ppsclock streams module],
2173 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
2174 case "$ac_cv_var_ppsclock" in
2175 yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
2178 AC_CACHE_CHECK([for kernel multicast support], ac_cv_var_mcast,
2181 i386-sequent-sysv4) ;;
2182 *) AC_EGREP_CPP(yes,
2183 [#include <netinet/in.h>
2184 #ifdef IP_ADD_MEMBERSHIP
2187 ], ac_cv_var_mcast=yes) ;;
2189 case "$ac_cv_var_mcast" in
2191 AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?])
2192 AC_CACHE_CHECK([[arg type needed for IP*_MULTICAST_LOOP for setsockopt()]],
2193 ac_cv_var_typeof_ip_multicast_loop,
2195 *-*-netbsd*|*-*-*linux*)
2196 ac_cv_var_typeof_ip_multicast_loop=u_int
2199 ac_cv_var_typeof_ip_multicast_loop=BOOL
2201 *) ac_cv_var_typeof_ip_multicast_loop=u_char
2204 AC_DEFINE_UNQUOTED(TYPEOF_IP_MULTICAST_LOOP,
2205 $ac_cv_var_typeof_ip_multicast_loop,
2206 [What type to use for setsockopt])
2210 AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
2211 [ac_cv_var_ntp_syscalls=no
2212 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
2214 ac_cv_var_ntp_syscalls=libc
2217 ac_cv_var_ntp_syscalls=inline
2219 *) AC_EGREP_CPP(yes,
2220 [#include <sys/syscall.h>
2221 #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
2224 ], ac_cv_var_ntp_syscalls=kernel)
2227 case "$ac_cv_var_ntp_syscalls" in
2229 AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
2232 AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
2238 AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
2240 [#include <sys/timex.h>
2244 ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
2246 AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
2247 [dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
2248 case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
2250 ac_cv_var_kernel_pll=no
2252 *) ac_cv_var_kernel_pll=yes
2255 case "$ac_cv_var_kernel_pll" in
2257 AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
2261 AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
2274 ac_cv_var_size_returned_in_buffer=$ans])
2275 case "$ac_cv_var_size_returned_in_buffer" in
2276 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
2279 dnl vvvvv-- this is wrong, if you re-enable the switch do not cache the result
2280 dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
2281 dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
2282 dnl [ans=$enableval], [ans=no])
2283 dnl ac_cv_var_gdt_surveying=$ans])
2284 dnl case "$ac_cv_var_gdt_surveying" in
2285 dnl yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
2288 # Check for ioctls TIOCGPPSEV
2289 AC_MSG_CHECKING(ioctl TIOCGPPSEV)
2290 if test "$ac_cv_header_termios_h" = "yes"; then
2292 [#include <termios.h>
2296 ], ntp_ok=yes, ntp_ok=no)
2300 if test "$ntp_ok" = "yes"; then
2301 AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
2302 ac_cv_var_oncore_ok=yes
2304 AC_MSG_RESULT($ntp_ok)
2306 # Check for ioctls TIOCSPPS
2307 AC_MSG_CHECKING(ioctl TIOCSPPS)
2308 if test "$ac_cv_header_termios_h" = "yes"; then
2310 [#include <termios.h>
2314 ], ntp_ok=yes, ntp_ok=no)
2319 if test "$ntp_ok" = "yes"; then
2320 AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
2322 AC_MSG_RESULT($ntp_ok)
2324 # Check for ioctls CIOGETEV
2325 AC_MSG_CHECKING([ioctl CIOGETEV])
2326 if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
2328 [#include <sys/ppsclock.h>
2332 ], ntp_ok=yes, ntp_ok=no)
2336 if test "$ntp_ok" = "yes"; then
2337 ac_cv_var_oncore_ok=yes
2338 AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
2340 AC_MSG_RESULT($ntp_ok)
2343 # ATOM/PPSAPI stuff.
2345 # ATOM used to require struct timespec, but that's been fixed now.
2347 # case "$ac_cv_struct_timespec" in
2349 # ac_cv_var_atom_ok=yes
2352 ac_cv_var_atom_ok=yes
2354 # Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
2356 # The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
2358 # The PPSAPI needs struct timespec.
2360 # The PPSAPI also needs a timepps header.
2362 case "$ac_cv_c_inline$ac_cv_struct_timespec" in
2364 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
2365 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
2366 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
2367 ac_cv_var_jupiter_ok=yes
2368 ac_cv_var_oncore_ok=yes
2369 ac_cv_var_parse_ok=yes
2370 ac_cv_var_ripe_ncc_ok=yes
2376 # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
2377 AC_CHECK_HEADER(linux/serial.h)
2378 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
2379 case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
2382 [#include <sys/time.h>
2385 #include <sys/ppsclock.h>
2386 #include <linux/serial.h>
2390 #ifdef ASYNC_PPS_CD_POS
2391 #ifdef ASYNC_PPS_CD_NEG
2405 if test "$ntp_ok" = "yes"; then
2406 AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
2408 AC_MSG_RESULT($ntp_ok)
2410 # Check for SHMEM_STATUS support
2411 AC_MSG_CHECKING([SHMEM_STATUS support])
2412 case "$ac_cv_header_sys_mman_h" in
2416 if test "$ntp_ok" = "yes"; then
2417 AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
2419 AC_MSG_RESULT($ntp_ok)
2421 dnl dnl These are for OPT_PROGRAMS in authstuff/
2422 dnl AC_SUBST(AUTHCERT)
2423 dnl AC_SUBST(AUTHSPEED)
2424 dnl AC_SUBST(MD5DRIVER)
2425 dnl AC_SUBST(KEYPARITY)
2426 dnl AC_SUBST(MAKEIPFP)
2427 dnl AC_SUBST(MAKEPC1)
2428 dnl AC_SUBST(MAKEPC2)
2429 dnl AC_SUBST(MAKESP)
2430 dnl AC_SUBST(MKRANDKEYS)
2431 dnl AC_SUBST(OMAKEIPFP)
2432 dnl AC_SUBST(UNIXCERT)
2436 # HPUX only, and by explicit request
2437 AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
2438 AC_ARG_ENABLE(BANCOMM,
2439 AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
2440 [ntp_ok=$enableval], [ntp_ok=no])
2441 if test "$ntp_ok" = "yes"; then
2443 AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
2445 AC_MSG_RESULT($ntp_ok)
2446 case "$ntp_ok$host" in
2448 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2451 #HPUX only, and only by explicit request
2452 AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
2453 AC_ARG_ENABLE(GPSVME,
2454 AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
2455 [ntp_ok=$enableval], [ntp_ok=no])
2456 if test "$ntp_ok" = "yes"; then
2458 AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
2460 AC_MSG_RESULT($ntp_ok)
2461 case "$ntp_ok$host" in
2463 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2466 AC_MSG_CHECKING([for PCL720 clock support])
2467 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
2469 AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
2476 AC_MSG_RESULT([$ans])
2478 AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
2479 AC_ARG_ENABLE(all-clocks,
2480 AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
2481 [ntp_eac=$enableval], [ntp_eac=yes])
2482 AC_MSG_RESULT($ntp_eac)
2484 # HMS: Should we also require ac_cv_var_parse_ok?
2485 AC_MSG_CHECKING([if we have support for PARSE clocks])
2486 case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
2493 AC_MSG_RESULT($ntp_canparse)
2495 AC_MSG_CHECKING([if we have support for audio clocks])
2496 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
2499 AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
2501 *) ntp_canaudio=no ;;
2503 AC_MSG_RESULT($ntp_canaudio)
2505 AC_MSG_CHECKING([if we have support for the SHM refclock interface])
2506 case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
2512 AC_MSG_RESULT($ntp_canshm)
2514 # Requires modem control
2515 AC_MSG_CHECKING([ACTS modem service])
2517 AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
2518 [ntp_ok=$enableval],
2520 [#include <termios.h>
2521 #ifdef HAVE_SYS_IOCTL_H
2522 #include <sys/ioctl.h>
2527 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2528 if test "$ntp_ok" = "yes"; then
2530 AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
2532 AC_MSG_RESULT($ntp_ok)
2534 AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
2535 AC_ARG_ENABLE(ARBITER,
2536 AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
2537 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2538 if test "$ntp_ok" = "yes"; then
2540 AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
2542 AC_MSG_RESULT($ntp_ok)
2544 AC_MSG_CHECKING([Arcron MSF receiver])
2545 AC_ARG_ENABLE(ARCRON_MSF,
2546 AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
2547 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2548 if test "$ntp_ok" = "yes"; then
2550 AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
2552 AC_MSG_RESULT($ntp_ok)
2554 AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
2555 AC_ARG_ENABLE(AS2201,
2556 AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
2557 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2558 if test "$ntp_ok" = "yes"; then
2560 AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
2562 AC_MSG_RESULT($ntp_ok)
2564 AC_MSG_CHECKING([ATOM PPS interface])
2566 AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
2567 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2568 case "$ac_cv_var_atom_ok" in
2571 if test "$ntp_ok" = "yes"; then
2573 AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
2575 AC_MSG_RESULT($ntp_ok)
2577 AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
2578 AC_ARG_ENABLE(CHRONOLOG,
2579 AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
2580 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2581 if test "$ntp_ok" = "yes"; then
2583 AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
2585 AC_MSG_RESULT($ntp_ok)
2587 AC_MSG_CHECKING([CHU modem/decoder])
2589 AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
2590 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2591 if test "$ntp_ok" = "yes"; then
2593 AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
2595 AC_MSG_RESULT($ntp_ok)
2596 ac_refclock_chu=$ntp_ok
2598 AC_MSG_CHECKING([CHU audio/decoder])
2599 AC_ARG_ENABLE(AUDIO-CHU,
2600 AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
2601 [ntp_ok=$enableval],
2602 [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
2606 if test "$ntp_ok" = "yes"; then
2607 AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
2609 AC_MSG_RESULT($ntp_ok)
2610 # We used to check for sunos/solaris target...
2611 case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
2612 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***]) ;;
2616 AC_MSG_CHECKING([Datum Programmable Time System])
2617 AC_ARG_ENABLE(DATUM,
2618 AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
2619 [ntp_ok=$enableval],
2620 [case "$ac_cv_header_termios_h" in
2627 if test "$ntp_ok" = "yes"; then
2629 AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
2631 AC_MSG_RESULT($ntp_ok)
2633 AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2634 AC_ARG_ENABLE(DUMBCLOCK,
2635 AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
2636 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2637 if test "$ntp_ok" = "yes"; then
2639 AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
2641 AC_MSG_RESULT($ntp_ok)
2643 AC_MSG_CHECKING([Forum Graphic GPS])
2645 AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
2646 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2647 if test "$ntp_ok" = "yes"; then
2649 AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
2651 AC_MSG_RESULT($ntp_ok)
2653 # Requires modem control
2654 AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2655 AC_ARG_ENABLE(HEATH,
2656 AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
2657 [ntp_ok=$enableval],
2659 [#include <termios.h>
2660 #ifdef HAVE_SYS_IOCTL_H
2661 #include <sys/ioctl.h>
2666 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2667 if test "$ntp_ok" = "yes"; then
2669 AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
2671 AC_MSG_RESULT($ntp_ok)
2673 AC_MSG_CHECKING([for hopf serial clock device])
2674 AC_ARG_ENABLE(HOPFSERIAL,
2675 AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
2676 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2677 if test "$ntp_ok" = "yes"; then
2679 AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
2681 AC_MSG_RESULT($ntp_ok)
2683 AC_MSG_CHECKING([for hopf PCI clock 6039])
2684 AC_ARG_ENABLE(HOPFPCI,
2685 AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
2686 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2687 if test "$ntp_ok" = "yes"; then
2689 AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
2691 AC_MSG_RESULT($ntp_ok)
2693 AC_MSG_CHECKING([HP 58503A GPS receiver])
2694 AC_ARG_ENABLE(HPGPS,
2695 AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
2696 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2697 if test "$ntp_ok" = "yes"; then
2699 AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
2701 AC_MSG_RESULT($ntp_ok)
2703 AC_MSG_CHECKING([IRIG audio decoder])
2705 AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
2706 [ntp_ok=$enableval],
2707 [case "$ntp_eac$ntp_canaudio" in
2711 if test "$ntp_ok" = "yes"; then
2713 AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
2715 AC_MSG_RESULT($ntp_ok)
2716 case "$ntp_ok$ntp_canaudio" in
2717 yesno) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2720 AC_MSG_CHECKING([for JJY receiver])
2722 AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
2723 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2724 if test "$ntp_ok" = "yes"; then
2726 AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
2728 AC_MSG_RESULT($ntp_ok)
2730 AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2731 AC_ARG_ENABLE(JUPITER,
2732 AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
2733 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2734 case "$ac_cv_var_jupiter_ok" in
2737 if test "$ntp_ok" = "yes"; then
2739 AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
2741 AC_MSG_RESULT($ntp_ok)
2743 AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2744 AC_ARG_ENABLE(LEITCH,
2745 AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
2746 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2747 if test "$ntp_ok" = "yes"; then
2749 AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
2751 AC_MSG_RESULT($ntp_ok)
2753 AC_MSG_CHECKING([local clock reference])
2754 AC_ARG_ENABLE(LOCAL-CLOCK,
2755 AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
2756 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2757 if test "$ntp_ok" = "yes"; then
2759 AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
2761 AC_MSG_RESULT($ntp_ok)
2763 dnl Bug 340: longstanding unfixed bugs
2764 dnl AC_MSG_CHECKING(EES M201 MSF receiver)
2765 dnl AC_ARG_ENABLE(MSFEES,
2766 dnl AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
2767 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2768 dnl if test "$ntp_ok" = "yes"; then
2769 dnl ntp_refclock=yes
2770 dnl AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
2772 dnl AC_MSG_RESULT($ntp_ok)
2775 AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2776 AC_ARG_ENABLE(MX4200,
2777 AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
2778 [ntp_ok=$enableval],
2779 [case "$ac_cv_var_ppsclock" in
2780 yes) ntp_ok=$ntp_eac
2785 if test "$ntp_ok" = "yes"; then
2787 AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
2789 AC_MSG_RESULT($ntp_ok)
2790 case "$ntp_ok$host" in
2791 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2794 AC_MSG_CHECKING([for NeoClock4X receiver])
2795 AC_ARG_ENABLE(NEOCLOCK4X,
2796 AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
2797 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2798 if test "$ntp_ok" = "yes"; then
2800 AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
2802 AC_MSG_RESULT($ntp_ok)
2804 AC_MSG_CHECKING([NMEA GPS receiver])
2806 AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
2807 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2808 if test "$ntp_ok" = "yes"; then
2810 AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
2812 AC_MSG_RESULT($ntp_ok)
2814 AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2815 AC_ARG_ENABLE(ONCORE,
2816 AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
2817 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2818 case "$ac_cv_var_oncore_ok" in
2821 if test "$ntp_ok" = "yes"; then
2823 AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
2825 AC_MSG_RESULT($ntp_ok)
2827 AC_MSG_CHECKING([for Palisade clock])
2828 AC_ARG_ENABLE(PALISADE,
2829 AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
2830 [ntp_ok=$enableval],
2831 [case "$ac_cv_header_termios_h" in
2839 if test "$ntp_ok" = "yes"; then
2841 AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
2843 AC_MSG_RESULT($ntp_ok)
2845 AC_MSG_CHECKING([Conrad parallel port radio clock])
2847 AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
2848 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2849 if test "$ntp_ok" = "yes"; then
2851 AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
2853 AC_MSG_RESULT($ntp_ok)
2855 AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2857 AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
2858 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2859 if test "$ntp_ok" = "yes"; then
2861 AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
2863 AC_MSG_RESULT($ntp_ok)
2865 AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2866 AC_ARG_ENABLE(RIPENCC,
2867 AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
2868 [ntp_ok=$enableval], [ntp_ok=no])
2869 # 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2870 case "$ac_cv_var_ripe_ncc_ok" in
2873 if test "$ntp_ok" = "yes"; then
2875 AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
2877 AC_MSG_RESULT($ntp_ok)
2879 # Danny Meyer says SHM compiles (with a few warnings) under Win32.
2880 # For *IX, we need sys/ipc.h and sys/shm.h.
2881 AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2883 AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
2884 [ntp_ok=$enableval],
2885 [case "$ntp_eac$ntp_canshm" in
2889 if test "$ntp_ok" = "yes"; then
2891 AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
2893 AC_MSG_RESULT($ntp_ok)
2895 AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2896 AC_ARG_ENABLE(SPECTRACOM,
2897 AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
2898 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2899 if test "$ntp_ok" = "yes"; then
2901 AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
2903 AC_MSG_RESULT($ntp_ok)
2905 AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2907 AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
2908 [ntp_ok=$enableval],
2909 [case "$ac_cv_header_sys_tpro_h" in
2916 if test "$ntp_ok" = "yes"; then
2918 AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2920 AC_MSG_RESULT($ntp_ok)
2921 case "$ntp_ok$ac_cv_header_sys_tpro" in
2922 yesno) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2925 dnl Bug 342: longstanding unfixed bugs
2926 dnl AC_MSG_CHECKING(TRAK 8810 GPS receiver)
2927 dnl AC_ARG_ENABLE(TRAK,
2928 dnl AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
2929 dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2930 dnl if test "$ntp_ok" = "yes"; then
2931 dnl ntp_refclock=yes
2932 dnl AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
2934 dnl AC_MSG_RESULT($ntp_ok)
2936 # Not on a vax-dec-bsd
2937 AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2938 AC_ARG_ENABLE(TRUETIME,
2939 AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
2940 [ntp_ok=$enableval],
2950 if test "$ntp_ok" = "yes"; then
2952 AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
2954 AC_MSG_RESULT($ntp_ok)
2955 case "$ntp_ok$host" in
2956 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2959 AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2960 AC_ARG_ENABLE(TT560,
2961 AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
2962 [ntp_ok=$enableval], [ntp_ok=no])
2963 if test "$ntp_ok" = "yes"; then
2965 AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
2967 AC_MSG_RESULT($ntp_ok)
2969 AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2970 AC_ARG_ENABLE(ULINK,
2971 AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
2972 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2973 if test "$ntp_ok" = "yes"; then
2975 AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
2977 AC_MSG_RESULT($ntp_ok)
2979 AC_MSG_CHECKING([WWV receiver])
2981 AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2982 [ntp_ok=$enableval],
2983 [case "$ntp_eac$ntp_canaudio" in
2987 if test "$ntp_ok" = "yes"; then
2989 AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2991 AC_MSG_RESULT($ntp_ok)
2992 case "$ntp_ok$ntp_canaudio" in
2993 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2996 AC_MSG_CHECKING([for Zyfer receiver])
2997 AC_ARG_ENABLE(ZYFER,
2998 AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
2999 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
3000 if test "$ntp_ok" = "yes"; then
3002 AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
3004 AC_MSG_RESULT($ntp_ok)
3006 AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
3007 AC_ARG_ENABLE(parse-clocks,
3008 AC_HELP_STRING([--enable-parse-clocks], [- include all suitable PARSE clocks:]),
3009 [ntp_eapc=$enableval],
3011 yes) ntp_eapc=$ntp_canparse ;;
3014 # Delete the next line one of these days
3016 AC_MSG_RESULT($ntp_eapc)
3018 case "$ntp_eac$ntp_eapc$ntp_canparse" in
3020 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
3023 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
3032 AC_MSG_CHECKING([Diem Computime Radio Clock])
3033 AC_ARG_ENABLE(COMPUTIME,
3034 AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
3035 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3036 if test "$ntp_ok" = "yes"; then
3039 AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
3041 AC_MSG_RESULT($ntp_ok)
3042 case "$ntp_ok$ntp_canparse" in
3044 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3048 AC_MSG_CHECKING([ELV/DCF7000 clock])
3049 AC_ARG_ENABLE(DCF7000,
3050 AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
3051 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3052 if test "$ntp_ok" = "yes"; then
3055 AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
3057 AC_MSG_RESULT($ntp_ok)
3058 case "$ntp_ok$ntp_canparse" in
3060 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3064 AC_MSG_CHECKING([HOPF 6021 clock])
3065 AC_ARG_ENABLE(HOPF6021,
3066 AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
3067 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3068 if test "$ntp_ok" = "yes"; then
3071 AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
3073 AC_MSG_RESULT($ntp_ok)
3074 case "$ntp_ok$ntp_canparse" in
3076 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3080 AC_MSG_CHECKING([Meinberg clocks])
3081 AC_ARG_ENABLE(MEINBERG,
3082 AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
3083 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3084 if test "$ntp_ok" = "yes"; then
3087 AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
3089 AC_MSG_RESULT($ntp_ok)
3090 case "$ntp_ok$ntp_canparse" in
3092 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3096 AC_MSG_CHECKING([DCF77 raw time code])
3097 AC_ARG_ENABLE(RAWDCF,
3098 AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
3099 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3100 if test "$ntp_ok" = "yes"; then
3105 AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
3107 AC_MSG_RESULT($ntp_ok)
3108 case "$ntp_ok$ntp_canparse" in
3110 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3114 case "$ntp_rawdcf" in
3116 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
3117 ac_cv_var_rawdcf_parity,
3124 ac_cv_var_rawdcf_parity=$ans])
3125 case "$ac_cv_var_rawdcf_parity" in
3126 yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
3130 *) # HMS: Is this a good idea?
3131 ac_cv_var_rawdcf_parity=no
3135 AC_MSG_CHECKING([RCC 8000 clock])
3136 AC_ARG_ENABLE(RCC8000,
3137 AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
3138 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3139 if test "$ntp_ok" = "yes"; then
3142 AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
3144 AC_MSG_RESULT($ntp_ok)
3145 case "$ntp_ok$ntp_canparse" in
3147 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3151 AC_MSG_CHECKING([Schmid DCF77 clock])
3152 AC_ARG_ENABLE(SCHMID,
3153 AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
3154 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3155 if test "$ntp_ok" = "yes"; then
3158 AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
3160 AC_MSG_RESULT($ntp_ok)
3161 case "$ntp_ok$ntp_canparse" in
3163 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3167 AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
3168 AC_ARG_ENABLE(TRIMTAIP,
3169 AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
3170 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3171 if test "$ntp_ok" = "yes"; then
3174 AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
3176 AC_MSG_RESULT($ntp_ok)
3177 case "$ntp_ok$ntp_canparse" in
3179 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3183 AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
3184 AC_ARG_ENABLE(TRIMTSIP,
3185 AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
3186 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3187 if test "$ntp_ok" = "yes"; then
3190 AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
3192 AC_MSG_RESULT($ntp_ok)
3193 case "$ntp_ok$ntp_canparse" in
3195 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3199 AC_MSG_CHECKING([WHARTON 400A Series clock])
3200 AC_ARG_ENABLE(WHARTON,
3201 AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
3202 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3203 if test "$ntp_ok" = "yes"; then
3206 AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
3208 AC_MSG_RESULT($ntp_ok)
3209 case "$ntp_ok$ntp_canparse" in
3211 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
3215 AC_MSG_CHECKING([VARITEXT clock])
3216 AC_ARG_ENABLE(VARITEXT,
3217 AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
3218 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
3219 if test "$ntp_ok" = "yes"; then
3222 AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
3224 AC_MSG_RESULT($ntp_ok)
3225 case "$ntp_ok$ntp_canparse" in
3227 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
3231 AC_SUBST(MAKE_LIBPARSE)
3232 AC_SUBST(MAKE_LIBPARSE_KERNEL)
3233 AC_SUBST(MAKE_CHECK_Y2K)
3234 AC_MSG_CHECKING([if we need to make and use the parse libraries])
3236 case "$ntp_libparse" in
3239 AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
3240 LIBPARSE=../libparse/libparse.a
3241 MAKE_LIBPARSE=libparse.a
3242 # HMS: check_y2k trips the 34 year problem now...
3243 false && MAKE_CHECK_Y2K=check_y2k
3246 AC_MSG_RESULT([$ans])
3253 # AC_SUBST(LIBRSAREF)
3254 # AC_SUBST(MAKE_LIBRSAREF)
3257 AC_SUBST(OPENSSL_INC)
3258 AC_SUBST(OPENSSL_LIB)
3260 AC_MSG_CHECKING([for openssl library directory])
3261 AC_ARG_WITH(openssl-libdir,
3262 AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
3271 ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib /lib"
3273 *) # Look where they said
3278 *) # Look for libcrypto.a and libssl.a:
3283 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
3286 test -f $i/libcrypto.so -a -f $i/libssl.so && break
3287 test -f $i/libcrypto.a -a -f $i/libssl.a && break
3302 AC_MSG_RESULT([$ans])
3304 AC_MSG_CHECKING([for openssl include directory])
3305 AC_ARG_WITH(openssl-incdir,
3306 AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
3315 ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include"
3317 *) # Look where they said
3322 *) # look for openssl/opensslconf.h:
3325 test -f $i/openssl/opensslconf.h && break
3338 AC_MSG_RESULT([$ans])
3340 AC_MSG_CHECKING([if we will use crypto])
3342 AC_HELP_STRING([--with-crypto], [+ =openssl]),
3343 [ans=$withval], [ans=yes])
3348 if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
3356 AC_MSG_RESULT([$ans])
3358 case "$ntp_openssl" in
3360 # We have OpenSSL inc/lib - use them.
3361 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
3362 LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
3363 case "$need_dash_r" in
3364 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB"
3366 AC_SUBST(LCRYPTO, [-lcrypto])
3367 AC_DEFINE(OPENSSL, , [Use OpenSSL?])
3371 # OpenSSL has a number of callback prototypes inside other function
3372 # prototypes which trigger copious warnings with -Wstrict-prototypes,
3373 # (which is included in -Wall).
3377 # int i2d_RSA_NET(const RSA *a, unsigned char **pp,
3378 # int (*cb)(), int sgckey);
3381 # The OpenSSL headers probably haven't been fixed in this regard
3382 # due to the hoops you have to jump through to stay compatible with
3385 case "$GCC$ntp_openssl" in
3387 CFLAGS="$CFLAGS -Wno-strict-prototypes"
3390 AC_MSG_CHECKING([if we want to compile with ElectricFence])
3391 AC_ARG_WITH(electricfence,
3392 AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
3393 [ans=$withval], [ans=no])
3397 LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
3398 EF_PROGS="eftest tstheap"
3405 AC_MSG_RESULT([$ans])
3407 AC_SUBST(MAKE_CHECK_LAYOUT)
3408 AC_MSG_CHECKING([if we want to run check-layout])
3409 case "$cross_compiling$PATH_PERL" in
3411 MAKE_CHECK_LAYOUT=check-layout
3418 AC_MSG_RESULT([$ans])
3423 AC_MSG_CHECKING([if we can make dcf parse utilities])
3425 if test "$ntp_parseutil" = "yes"; then
3427 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3434 AC_MSG_RESULT([$ans])
3436 AC_SUBST(MAKE_PARSEKMODULE)
3437 AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3439 case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3443 case "$ac_cv_var_kernel_pll" in
3445 AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
3449 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3453 MAKE_PARSEKMODULE=parse
3454 AC_CHECK_HEADERS([strings.h])
3459 AC_MSG_RESULT([$ans])
3461 AC_MSG_CHECKING([if we need basic refclock support])
3462 if test "$ntp_refclock" = "yes"; then
3463 AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
3465 AC_MSG_RESULT($ntp_refclock)
3467 dnl Things that can be made in clockstuff/
3468 AC_SUBST(PROPDELAY) dnl Set to "propdelay"
3469 AC_SUBST(CHUTEST) dnl Set to "chutest"
3470 AC_SUBST(CLKTEST) dnl Set to "clktest"
3472 AC_SUBST(MAKE_ADJTIMED)
3473 AC_MSG_CHECKING(if we want HP-UX adjtimed support)
3481 if test "$ans" = "yes"; then
3482 MAKE_ADJTIMED=adjtimed
3483 AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
3485 AC_MSG_RESULT([$ans])
3487 AC_MSG_CHECKING([if we want QNX adjtime support])
3495 if test "$ans" = "yes"; then
3496 AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
3498 AC_MSG_RESULT([$ans])
3500 AC_MSG_CHECKING([if we can read kmem])
3502 # the default is to enable it if the system has the capability
3504 case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3512 *-*-domainos) # Won't be found...
3532 # --enable-kmem / --disable-kmem controls if present
3537 [s read /dev/kmem for tick and/or tickadj]
3542 AC_MSG_RESULT([$ans])
3550 AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?])
3554 AC_MSG_CHECKING([if adjtime is accurate])
3556 # target-dependent defaults
3565 mips-sgi-irix[[456]]*)
3577 *-*-solaris2.[[01]])
3589 # --enable-accurate-adjtime / --disable-accurate-adjtime
3590 # override the default
3591 AC_ARG_ENABLE([accurate-adjtime],
3593 [--enable-accurate-adjtime],
3594 [s the adjtime() call is accurate]
3599 AC_MSG_RESULT([$ans])
3603 AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?])
3604 adjtime_is_accurate=yes
3607 adjtime_is_accurate=no
3610 AC_CACHE_CHECK([the name of 'tick' in the kernel],
3611 ac_cv_var_nlist_tick,
3614 m68*-hp-hpux*) # HP9000/300?
3642 ac_cv_var_nlist_tick=$ans])
3643 case "$ac_cv_var_nlist_tick" in
3644 ''|no) ;; # HMS: I think we can only get 'no' here...
3645 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
3648 AC_CACHE_CHECK([for the units of 'tick'],
3649 ac_cv_var_tick_nano,
3656 ac_cv_var_tick_nano=$ans])
3657 case "$ac_cv_var_tick_nano" in
3659 AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
3663 AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
3664 ac_cv_var_nlist_tickadj,
3667 m68*-hp-hpux*) # HP9000/300?
3698 ans=no # hrestime_adj
3704 ac_cv_var_nlist_tickadj=$ans])
3705 case "$ac_cv_var_nlist_tickadj" in
3706 ''|no) ;; # HMS: I think we can only get 'no' here...
3707 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
3710 AC_CACHE_CHECK([for the units of 'tickadj'],
3711 ac_cv_var_tickadj_nano,
3718 ac_cv_var_tickadj_nano=$ans])
3719 case "$ac_cv_var_tickadj_nano" in
3721 AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
3725 AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
3726 ac_cv_var_nlist_dosynctodr,
3765 ac_cv_var_nlist_dosynctodr=$ans])
3766 case "$ac_cv_var_nlist_dosynctodr" in
3768 *) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
3772 AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
3773 ac_cv_var_nlist_noprintf,
3806 ac_cv_var_nlist_noprintf=$ans])
3807 case "$ac_cv_var_nlist_noprintf" in
3809 *) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
3813 dnl The tick/tickadj sections were written by Skippy, who never learned
3814 dnl that it's impolite (horridly gross) to show your guts in public.
3817 dnl 10000 80 Unixware
3818 dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3819 dnl 10000 150 sgi IRIX
3820 dnl 1000000L/hz 1000 RS6000 && NOKMEM
3821 dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3822 dnl 1000000L/hz 500/HZ other && NOKMEM
3823 dnl txc.tick 1 Linux
3824 dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3825 dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3826 dnl (RS6000 && !NOKMEM), SINIX MIPS
3828 dnl But we'll only use these "values" if we can't find anything else.
3830 AC_MSG_CHECKING([for a default value for 'tick'])
3832 # target-dependent default for tick
3836 AC_MSG_ERROR([tick needs work for cygwin])
3864 [--enable-tick=VALUE],
3865 [s force a value for 'tick']
3870 AC_MSG_RESULT([$ans])
3873 ''|no) ;; # HMS: I think we can only get 'no' here...
3874 *) AC_DEFINE_UNQUOTED(PRESET_TICK, [$ans], [Preset a value for 'tick'?]) ;;
3878 AC_MSG_CHECKING([for a default value for 'tickadj'])
3880 # target-specific default
3886 case "$adjtime_is_accurate" in
3903 *-*-domainos) # Skippy: won't be found...
3910 case "$adjtime_is_accurate" in
3934 [--enable-tickadj=VALUE],
3935 [s force a value for 'tickadj']
3940 AC_MSG_RESULT([$ans])
3942 default_tickadj=$ans
3944 case "$default_tickadj" in
3945 ''|no) ;; # HMS: I think we can only get 'no' here...
3946 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $default_tickadj, [Preset a value for 'tickadj'?]) ;;
3949 # Newer versions of ReliantUNIX round adjtime() values down to
3950 # 1/100s (system tick). Sigh ...
3951 # Unfortunately, there is no easy way to know if particular release
3952 # has this "feature" or any obvious way to test for it.
3954 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
3958 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
3961 ac_cv_make_tickadj=yes
3962 case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3963 nonono) # Don't read KMEM, no presets. Bogus.
3964 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3965 ac_cv_make_tickadj=no
3967 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3968 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3969 ac_cv_make_tickadj=no
3971 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3972 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3973 ac_cv_make_tickadj=no
3975 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3977 yesnono) # Read KMEM, no presets. Cool.
3979 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3980 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3982 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3984 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3986 *) # Generally bogus.
3987 AC_MSG_ERROR([This shouldn't happen.])
3991 AC_SUBST(MAKE_NTPTIME)
3992 AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3994 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
4004 ac_cv_make_ntptime=$ans])
4005 case "$ac_cv_make_ntptime" in
4007 MAKE_NTPTIME=ntptime
4011 AC_SUBST(MAKE_TICKADJ)
4014 # tickadj is pretty useless on newer versions of ReliantUNIX
4016 ac_cv_make_tickadj=no
4019 ac_cv_make_tickadj=no
4022 # DLM says tickadj is a no-no starting with solaris2.5
4024 *-*-solaris2.1[[0-9]]*)
4025 ac_cv_make_tickadj=no
4027 *-*-solaris2.[[0-4]]*) ;;
4028 *) ac_cv_make_tickadj=no ;;
4032 ac_cv_make_tickadj=no
4037 # Despite all the above, we always make tickadj. Setting
4038 # ac_cv_make_tickadj before AC_CACHE_CHECK will cause a false
4039 # report that the configuration variable was cached. It may
4040 # be better to simply remove the hunk above, I did not want
4041 # to remove it if there is hope it will be used again.
4043 $as_unset ac_cv_make_tickadj
4045 AC_CACHE_CHECK([if we want and can make the tickadj utility], ac_cv_make_tickadj,
4046 ac_cv_make_tickadj=yes)
4047 case "$ac_cv_make_tickadj" in
4049 MAKE_TICKADJ=tickadj
4053 AC_SUBST(MAKE_TIMETRIM)
4054 AC_CACHE_CHECK([if we want and can make the timetrim utility], ac_cv_make_timetrim,
4057 ac_cv_make_timetrim=yes
4060 ac_cv_make_timetrim=yes
4063 ac_cv_make_timetrim=no
4066 case "$ac_cv_make_timetrim" in
4068 MAKE_TIMETRIM=timetrim
4072 AC_SUBST(MAKE_LIBNTPSIM)
4073 AC_SUBST(MAKE_NTPDSIM)
4075 AC_MSG_CHECKING([if we want to build the NTPD simulator])
4080 [--enable-simulator],
4081 [- build/install the NTPD simulator?]
4087 AC_MSG_RESULT([$ans])
4091 MAKE_NTPDSIM=ntpdsim
4092 MAKE_LIBNTPSIM=libntpsim.a
4101 LDFLAGS="$LDFLAGS -r"
4108 AC_MSG_CHECKING([if we want to build ntpsnmpd])
4109 AC_ARG_WITH(ntpsnmpd,
4110 AC_HELP_STRING([--with-ntpsnmpd], [s Build ntpsnmpd MIB agent?]),
4112 [case "$PATH_NET_SNMP_CONFIG" in
4120 case "$PATH_NET_SNMP_CONFIG" in
4122 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
4124 # HMS: we really want to separate CPPFLAGS and CFLAGS
4125 foo=`$PATH_NET_SNMP_CONFIG --cflags`
4131 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
4133 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
4137 AC_SUBST(SNMP_CPPFLAGS)
4138 AC_SUBST(SNMP_CFLAGS)
4141 save_CPPFLAGS=$CPPFLAGS
4144 CPPFLAGS=$SNMP_CPPFLAGS
4146 AC_CHECK_HEADER([net-snmp/net-snmp-config.h], [MAKE_NTPSNMPD=ntpsnmpd],
4147 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])])
4149 # Do this last, as we're messing up LIBS.
4151 # check -lnetsnmp for netsnmp_daemonize
4152 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
4153 AC_CHECK_LIB([netsnmp], [netsnmp_daemonize], [],
4154 [AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
4155 [We need to provide netsnmp_daemonize()])])
4158 CPPFLAGS=$save_CPPFLAGS
4162 *) AC_MSG_WARN([Cannot build ntpsnmpd as desired - net-snmp-config cannot be found])
4167 AC_SUBST(MAKE_NTPSNMPD)
4170 AC_MSG_CHECKING([if we should always slew the time])
4172 # target-specific defaults
4184 *-*-openvms*) # HMS: won't be found
4191 # --enable-slew-always / --disable-slew-always overrides default
4196 [--enable-slew-always],
4197 [s always slew the time]
4202 AC_MSG_RESULT([$ans])
4205 yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
4208 AC_MSG_CHECKING([if we should step and slew the time])
4220 *-*-solaris2.1[[0-9]]*)
4223 *-*-solaris2.[[012]]*)
4226 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
4237 [--enable-step-slew],
4238 [s step and slew the time]
4243 AC_MSG_RESULT([$ans])
4246 yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
4249 AC_MSG_CHECKING([if ntpdate should step the time])
4261 [--enable-ntpdate-step],
4262 [s if ntpdate should step the time]
4267 AC_MSG_RESULT([$ans])
4270 yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
4274 AC_MSG_CHECKING([if we should sync TODR clock every hour])
4280 *-*-openvms*) # HMS: won't be found
4290 [--enable-hourly-todr-sync],
4291 [s if we should sync TODR hourly]
4296 AC_MSG_RESULT([$ans])
4298 case "$ac_cv_var_sync_todr" in
4299 yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
4303 AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4316 # Generic_105181-17 and higher
4336 # Generic_106541-07 and higher
4353 [--enable-kernel-fll-bug],
4354 [s if we should avoid a kernel FLL bug]
4359 AC_MSG_RESULT([$ans])
4362 yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
4366 AC_MSG_CHECKING([if we want new session key behavior])
4371 [--enable-bug1243-fix],
4372 [+ use unmodified autokey session keys]
4378 AC_MSG_RESULT([$ans])
4382 AC_DEFINE([DISABLE_BUG1243_FIX], 1, [use old autokey session key behavior?])
4386 AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
4389 *-*-solaris2.[[89]])
4392 *-*-solaris2.1[[0-9]]*)
4401 [--enable-irig-sawtooth],
4402 [s if we should enable the IRIG sawtooth filter]
4407 AC_MSG_RESULT([$ans])
4410 yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
4414 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4420 [- if we should enable the NIST lockclock scheme]
4426 AC_MSG_RESULT([$ans])
4429 yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
4433 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4438 [--enable-ntp-signd],
4439 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4445 AC_MSG_RESULT([$ans])
4452 ntp_signd_path=/var/run/ntp_signd
4455 ntp_signd_path="$ans"
4458 case "$ntp_signd_path" in
4462 AC_DEFINE(HAVE_NTP_SIGND, ,[Do we want support for Samba's signing daemon?])
4463 AC_DEFINE_UNQUOTED(NTP_SIGND_PATH, "$ntp_signd_path", [Path to sign daemon rendezvous socket])
4467 AC_CHECK_HEADERS(sys/clockctl.h)
4480 [--enable-clockctl],
4481 [s Use /dev/clockctl for non-root clock control]
4483 [ntp_use_dev_clockctl=$enableval],
4484 [ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h]
4487 AC_MSG_CHECKING([[if we should use /dev/clockctl]])
4488 AC_MSG_RESULT([$ntp_use_dev_clockctl])
4491 AC_CHECK_HEADERS([sys/capability.h])
4492 AC_CHECK_HEADERS([sys/prctl.h])
4494 AC_MSG_CHECKING([[if we have linux capabilities (libcap)]])
4496 case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
4498 ntp_have_linuxcaps=yes
4501 ntp_have_linuxcaps=no
4507 [--enable-linuxcaps],
4508 [+ Use Linux capabilities for non-root clock control]
4510 [ntp_have_linuxcaps=$enableval]
4513 AC_MSG_RESULT([$ntp_have_linuxcaps])
4515 case "$ntp_have_linuxcaps" in
4517 AC_DEFINE(HAVE_LINUX_CAPABILITIES, ,[Do we have Linux capabilities?])
4521 case "$ntp_use_dev_clockctl$ntp_have_linuxcaps" in
4523 AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
4527 AC_CHECK_HEADERS([libscf.h])
4529 case "$ac_cv_header_libscf_h" in
4531 AC_SUBST(LSCF, [-lscf])
4536 AC_DEFINE(HAVE_SOLARIS_PRIVS, ,[Are Solaris privileges available?])
4545 [struct sockaddr for sa_len],
4546 isc_cv_platform_havesalen,
4550 #include <sys/types.h>
4551 #include <sys/socket.h>
4554 extern struct sockaddr *ps;
4557 [isc_cv_platform_havesalen=yes],
4558 [isc_cv_platform_havesalen=no]
4562 if test $isc_cv_platform_havesalen = yes; then
4563 AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[struct sockaddr has sa_len?])
4566 AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [s use IPv6?]))
4568 case "$enable_ipv6" in
4571 powerpc-ibm-aix4*) ;;
4573 AC_DEFINE(WANT_IPV6, ,[configure --enable-ipv6])
4583 [for IPv6 structures],
4584 ac_cv_isc_found_ipv6,
4590 #include <sys/types.h>
4591 #include <sys/socket.h>
4592 #include <netinet/in.h>
4595 struct sockaddr_in6 sin6;
4599 [ac_cv_isc_found_ipv6=yes],
4600 [ac_cv_isc_found_ipv6=no]
4606 # See whether IPv6 support is provided via a Kame add-on.
4607 # This is done before other IPv6 linking tests so LIBS is properly set.
4609 AC_MSG_CHECKING([for Kame IPv6 support])
4611 [AC_HELP_STRING([--with-kame], [- =/usr/local/v6])],
4612 use_kame="$withval", use_kame="no")
4619 kame_path=/usr/local/v6
4622 kame_path="$use_kame"
4631 if test -f $kame_path/lib/libinet6.a; then
4632 AC_MSG_RESULT($kame_path/lib/libinet6.a)
4633 LIBS="-L$kame_path/lib -linet6 $LIBS"
4635 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
4637 Please choose the proper path with the following command:
4639 configure --with-kame=PATH
4646 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
4647 # Including it on Kame-using platforms is very bad, though, because
4648 # Kame uses #error against direct inclusion. So include it on only
4649 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
4650 # This is done before the in6_pktinfo check because that's what
4651 # netinet6/in6.h is needed for.
4655 AC_DEFINE(ISC_PLATFORM_NEEDNETINET6IN6H, 1, [Do we need netinet6/in6.h?])
4656 isc_netinet6in6_hack="#include <netinet6/in6.h>"
4659 isc_netinet6in6_hack=""
4663 # This is similar to the netinet6/in6.h issue.
4666 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
4667 AC_DEFINE(ISC_PLATFORM_FIXIN6ISADDR, 1,[Do we need to fix in6isaddr?])
4668 isc_netinetin6_hack="#include <netinet/in6.h>"
4671 isc_netinetin6_hack=""
4675 case "$ac_cv_isc_found_ipv6" in
4677 AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[have IPv6?])
4681 ac_cv_have_in6_pktinfo,
4687 #include <sys/types.h>
4688 #include <sys/socket.h>
4689 #include <netinet/in.h>
4690 $isc_netinetin6_hack
4691 $isc_netinet6in6_hack
4694 struct in6_pktinfo xyzzy;
4698 [ac_cv_have_in6_pktinfo=yes],
4699 [ac_cv_have_in6_pktinfo=no]
4704 case "$ac_cv_have_in6_pktinfo" in
4706 AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, , [have struct in6_pktinfo?])
4710 # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
4712 [for sockaddr_in6.sin6_scope_id],
4713 ac_cv_have_sin6_scope_id,
4719 #include <sys/types.h>
4720 #include <sys/socket.h>
4721 #include <netinet/in.h>
4722 $isc_netinetin6_hack
4723 $isc_netinet6in6_hack
4726 struct sockaddr_in6 xyzzy;
4727 xyzzy.sin6_scope_id = 0;
4731 [ac_cv_have_sin6_scope_id=yes],
4732 [ac_cv_have_sin6_scope_id=no]
4737 case "$ac_cv_have_sin6_scope_id" in
4739 AC_DEFINE(ISC_PLATFORM_HAVESCOPEID, , [have sin6_scope_id?])
4744 # We need this check run even without ac_cv_isc_found_ipv6=yes
4748 isc_cv_have_in6addr_any,
4754 #include <sys/types.h>
4755 #include <sys/socket.h>
4756 #include <netinet/in.h>
4757 $isc_netinetin6_hack
4758 $isc_netinet6in6_hack
4761 struct in6_addr in6;
4766 [isc_cv_have_in6addr_any=yes],
4767 [isc_cv_have_in6addr_any=no]
4772 case "$isc_cv_have_in6addr_any" in
4774 AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, , [missing in6addr_any?])
4779 [for struct if_laddrconf],
4780 ac_cv_isc_struct_if_laddrconf,
4786 #include <sys/types.h>
4787 #include <net/if6.h>
4790 struct if_laddrconf a;
4794 [ac_cv_isc_struct_if_laddrconf=yes],
4795 [ac_cv_isc_struct_if_laddrconf=no]
4800 case "$ac_cv_isc_struct_if_laddrconf" in
4802 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, , [have struct if_laddrconf?])
4806 [for struct if_laddrreq],
4807 ac_cv_isc_struct_if_laddrreq,
4813 #include <sys/types.h>
4814 #include <net/if6.h>
4817 struct if_laddrreq a;
4821 [ac_cv_isc_struct_if_laddrreq=yes],
4822 [ac_cv_isc_struct_if_laddrreq=no]
4827 case "$ac_cv_isc_struct_if_laddrreq" in
4829 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, , [have struct if_laddrreq?])
4833 # Look for a sysctl call to get the list of network interfaces.
4836 [for interface list sysctl],
4837 ac_cv_iflist_sysctl,
4841 #include <sys/param.h>
4842 #include <sys/sysctl.h>
4843 #include <sys/socket.h>
4844 #ifdef NET_RT_IFLIST
4848 [ac_cv_iflist_sysctl=yes],
4849 [ac_cv_iflist_sysctl=no]
4853 case "$ac_cv_iflist_sysctl" in
4855 AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[have iflist_sysctl?])
4860 AC_MSG_CHECKING([if we want the saveconfig mechanism])
4861 AC_ARG_ENABLE(saveconfig,
4862 AC_HELP_STRING([--enable-saveconfig], [+ saveconfig mechanism]),
4863 [ntp_ok=$enableval], [ntp_ok=yes])
4864 ntp_saveconfig_enabled=0
4865 if test "$ntp_ok" = "yes"; then
4866 ntp_saveconfig_enabled=1
4867 AC_DEFINE(SAVECONFIG, 1, [saveconfig mechanism])
4869 AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
4870 AC_MSG_RESULT($ntp_ok)
4874 AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
4876 AC_CONFIG_FILES(Makefile)
4877 AC_CONFIG_FILES(ElectricFence/Makefile)
4878 AC_CONFIG_FILES(adjtimed/Makefile)
4879 AC_CONFIG_FILES(clockstuff/Makefile)
4880 AC_CONFIG_FILES(include/Makefile)
4881 AC_CONFIG_FILES(include/isc/Makefile)
4882 AC_CONFIG_FILES(kernel/Makefile)
4883 AC_CONFIG_FILES(kernel/sys/Makefile)
4884 AC_CONFIG_FILES(libntp/Makefile)
4885 AC_CONFIG_FILES(libparse/Makefile)
4886 AC_CONFIG_FILES(ntpd/Makefile)
4887 AC_CONFIG_FILES(ntpdate/Makefile)
4888 AC_CONFIG_FILES(ntpdc/Makefile)
4889 AC_CONFIG_FILES(ntpdc/nl.pl, [chmod +x ntpdc/nl.pl])
4890 AC_CONFIG_FILES(ntpq/Makefile)
4891 AC_CONFIG_FILES(ntpsnmpd/Makefile)
4892 AC_CONFIG_FILES(parseutil/Makefile)
4893 AC_CONFIG_FILES(scripts/Makefile)
4894 AC_CONFIG_FILES(scripts/calc_tickadj, [chmod +x scripts/calc_tickadj])
4895 AC_CONFIG_FILES(scripts/checktime, [chmod +x scripts/checktime])
4896 AC_CONFIG_FILES(scripts/freq_adj, [chmod +x scripts/freq_adj])
4897 AC_CONFIG_FILES(scripts/html2man, [chmod +x scripts/html2man])
4898 AC_CONFIG_FILES(scripts/mkver, [chmod +x scripts/mkver])
4899 AC_CONFIG_FILES(scripts/ntp-wait, [chmod +x scripts/ntp-wait])
4900 AC_CONFIG_FILES(scripts/ntpsweep, [chmod +x scripts/ntpsweep])
4901 AC_CONFIG_FILES(scripts/ntptrace, [chmod +x scripts/ntptrace])
4902 AC_CONFIG_FILES(scripts/ntpver, [chmod +x scripts/ntpver])
4903 AC_CONFIG_FILES(scripts/plot_summary, [chmod +x scripts/plot_summary])
4904 AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary])
4905 AC_CONFIG_FILES(util/Makefile)
4907 AC_CONFIG_SUBDIRS(sntp)