configure.ac revision 181834
1181834Srobertodnl -*-fundamental-*-
2181834Srobertodnl Process this file with autoconf to produce a configure script.
3181834Srobertom4_include([version.m4])
4181834SrobertoAC_INIT(ntp, VERSION_NUMBER)
5181834SrobertoAM_INIT_AUTOMAKE
6181834SrobertoAC_CANONICAL_HOST
7181834Srobertodnl the 'build' machine is where we run configure and compile
8181834Srobertodnl the 'host' machine is where the resulting stuff runs.
9181834SrobertoAC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) of where we should run])
10181834SrobertoAM_CONFIG_HEADER(config.h)
11181834Srobertodnl AC_ARG_PROGRAM
12181834SrobertoAC_PREREQ(2.53)
13181834Sroberto
14181834Srobertoac_cv_var_atom_ok=no
15181834Srobertoac_cv_var_oncore_ok=no
16181834Srobertoac_cv_var_parse_ok=no
17181834Srobertoac_cv_var_ripe_ncc_ok=no
18181834Srobertoac_cv_var_jupiter_ok=no
19181834Sroberto
20181834Srobertodnl Grab any initial CFLAGS so we can pick better defaults.
21181834SrobertoiCFLAGS="$CFLAGS"
22181834Sroberto
23181834Srobertodnl check these early to avoid autoconf warnings
24181834SrobertoAC_AIX
25181834SrobertoAC_MINIX
26181834Sroberto
27181834Srobertodnl  we need to check for cross compile tools for vxWorks here
28181834SrobertoAC_PROG_CC
29181834Sroberto# Ralf Wildenhues: With per-target flags we need CC_C_O
30181834SrobertoAC_PROG_CC_C_O
31181834SrobertoAC_PROG_CC_STDC
32181834SrobertoAC_PROG_CPP
33181834Sroberto
34181834Sroberto# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
35181834Srobertocase "$host" in
36181834Sroberto *-*-amigaos)
37181834Sroberto    CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
38181834Sroberto    ;;
39181834Sroberto *-*-hpux10.*)	# at least for hppa2.0-hp-hpux10.20
40181834Sroberto    case "$GCC" in
41181834Sroberto     yes)
42181834Sroberto	;;
43181834Sroberto     *) CFLAGS="$CFLAGS -Wp,-H18816"
44181834Sroberto	;;
45181834Sroberto    esac
46181834Sroberto    ;;
47181834Sroberto *-pc-cygwin*)
48181834Sroberto    CFLAGS="$CFLAGS -DSYS_CYGWIN32"
49181834Sroberto    ;;
50181834Sroberto i386-sequent-sysv4)
51181834Sroberto    case "$CC" in
52181834Sroberto     cc)
53181834Sroberto	CFLAGS="$CFLAGS -Wc,+abi-socket"
54181834Sroberto	;;
55181834Sroberto    esac
56181834Sroberto    ;;
57181834Sroberto *-*-mpeix*)
58181834Sroberto    CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
59181834Sroberto    LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
60181834Sroberto    LIBS="$LIBS -lcurses"
61181834Sroberto    ;;
62181834Sroberto *-*-solaris*)
63181834Sroberto    # see "man standards".
64181834Sroberto    # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
65181834Sroberto    # -D_XOPEN_SOURCE=600 seems OK for c99
66181834Sroberto    #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
67181834Sroberto    CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
68181834Sroberto    libxnet=-lxnet
69181834Sroberto    ;;
70181834Srobertoesac
71181834Sroberto
72181834SrobertoAMU_OS_CFLAGS
73181834Sroberto
74181834Sroberto# NTP has (so far) been relying on leading-edge autogen.
75181834Sroberto# Therefore, by default:
76181834Sroberto# - use the version we ship with
77181834Sroberto# - do not install it
78181834Sroberto# - build a static copy (AC_DISABLE_SHARED - done earlier)
79181834Srobertocase "${enable_local_libopts+set}" in
80181834Sroberto set) ;;
81181834Sroberto *) enable_local_libopts=yes ;;
82181834Srobertoesac
83181834Srobertocase "${enable_libopts_install+set}" in
84181834Sroberto set) ;;
85181834Sroberto *) enable_libopts_install=no ;;
86181834Srobertoesac
87181834SrobertoLIBOPTS_CHECK(libopts)
88181834Sroberto
89181834SrobertoAC_MSG_CHECKING([[if $CC can handle #warning]])
90181834SrobertoAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#warning foo]])],[ac_cv_cpp_warning=yes],[ac_cv_cpp_warning=no])
91181834SrobertoAC_MSG_RESULT([$ac_cv_cpp_warning])
92181834Sroberto
93181834Srobertocase "$ac_cv_cpp_warning" in
94181834Sroberto no)
95181834Sroberto    AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid #warning on option name collisions?])
96181834Sroberto    AC_MSG_RESULT([[Enabling NO_OPTION_NAME_WARNINGS as #warning does not work]])
97181834Sroberto    ;;
98181834Srobertoesac
99181834Sroberto
100181834SrobertoAC_MSG_CHECKING(for bin subdirectory)
101181834SrobertoAC_ARG_WITH(binsubdir,
102181834Sroberto	AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
103181834Sroberto	use_binsubdir="$withval", use_binsubdir="bin")
104181834Sroberto
105181834Srobertocase "$use_binsubdir" in
106181834Sroberto bin)
107181834Sroberto    ;;
108181834Sroberto sbin)
109181834Sroberto    ;;
110181834Sroberto *)
111181834Sroberto    AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
112181834Sroberto    ;;
113181834Srobertoesac
114181834SrobertoAC_MSG_RESULT($use_binsubdir)
115181834SrobertoBINSUBDIR=$use_binsubdir
116181834SrobertoAC_SUBST(BINSUBDIR)
117181834Sroberto
118181834SrobertoAC_MSG_CHECKING(if we want to use arlib)
119181834SrobertoAC_ARG_WITH(arlib,
120181834Sroberto	AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
121181834Sroberto	[ans=$withval], [ans=no])
122181834SrobertoAC_MSG_RESULT($ans)
123181834Sroberto
124181834Srobertoif test -d $srcdir/arlib
125181834Srobertothen
126181834Sroberto    case "$ans" in
127181834Sroberto     yes)
128181834Sroberto	ARLIB_DIR=arlib
129181834Sroberto	AC_CONFIG_SUBDIRS(arlib)
130181834Sroberto	;;
131181834Sroberto    esac
132181834Srobertofi
133181834SrobertoAC_SUBST(ARLIB_DIR)
134181834Sroberto
135181834SrobertoAC_ARG_WITH(rpath,
136181834Sroberto	AC_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
137181834Sroberto[ans=$withval], [ans=x])
138181834Srobertocase "$ans" in
139181834Sroberto no)
140181834Sroberto    need_dash_r=
141181834Sroberto    ;;
142181834Sroberto yes)
143181834Sroberto    need_dash_r=1
144181834Sroberto    ;;
145181834Srobertoesac
146181834Sroberto# HMS: Why isn't this $build?
147181834Sroberto# Well, that depends on if we need this for the build toolchain or
148181834Sroberto# for info in the host executable...
149181834Sroberto# I still have no idea which way this should go, but nobody has complained.
150181834Srobertocase "$host" in
151181834Sroberto *-*-netbsd*)
152181834Sroberto    case "$need_dash_r" in
153181834Sroberto     no) ;;
154181834Sroberto     *)  need_dash_r=1
155181834Sroberto	 ;;
156181834Sroberto    esac
157181834Sroberto    ;;
158181834Sroberto *-*-solaris*)
159181834Sroberto    case "$need_dash_r" in
160181834Sroberto     no) ;;
161181834Sroberto     *)  need_dash_r=1
162181834Sroberto	 ;;
163181834Sroberto    esac
164181834Sroberto    ;;
165181834Srobertoesac
166181834Sroberto
167181834SrobertoAC_CACHE_CHECK(if we should use /dev/clockctl, ac_clockctl,
168181834Sroberto[AC_ARG_ENABLE(clockctl,
169181834Sroberto   AC_HELP_STRING([--enable-clockctl], [s Use /dev/clockctl for non-root clock control]),
170181834Sroberto    [ans=$enableval],
171181834Sroberto    [case "$host" in
172181834Sroberto      *-*-netbsd*)
173181834Sroberto	 ans=yes
174181834Sroberto	 ;;
175181834Sroberto      *) ans=no
176181834Sroberto	 ;;
177181834Sroberto     esac
178181834Sroberto     ])
179181834Srobertoac_clockctl=$ans])
180181834Sroberto# End of AC_CACHE_CHECK for clockctl
181181834SrobertoAC_CHECK_HEADERS(sys/clockctl.h)
182181834Srobertocase "$ac_clockctl$ac_cv_header_sys_clockctl_h" in
183181834Sroberto yesyes)
184181834Sroberto    AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
185181834Sroberto    ;;
186181834Srobertoesac
187181834Sroberto
188181834SrobertoAC_CACHE_CHECK(if we have linux capabilities (libcap), ac_linuxcaps,
189181834Sroberto[AC_ARG_ENABLE(linuxcaps,
190181834Sroberto   AC_HELP_STRING([--enable-linuxcaps], [s Use Linux capabilities for non-root clock control]),
191181834Sroberto    [ans=$enableval],
192181834Sroberto    [ans=no])
193181834Srobertoac_linuxcaps=$ans])
194181834Sroberto# End of AC_CACHE_CHECK for linuxcaps
195181834SrobertoAC_CHECK_HEADERS(sys/capability.h)
196181834SrobertoAC_CHECK_HEADERS(sys/prctl.h)
197181834Srobertocase "$ac_linuxcaps$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
198181834Sroberto yesyesyes)
199181834Sroberto    AC_DEFINE(HAVE_LINUX_CAPABILITIES, ,[Do we have Linux capabilities?])
200181834Sroberto    AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
201181834Sroberto    LIBS="$LIBS -lcap"
202181834Sroberto    ;;
203181834Srobertoesac
204181834Sroberto
205181834Srobertocase "$build" in
206181834Sroberto $host)
207181834Sroberto    ;;
208181834Sroberto *) case "$host" in
209181834Sroberto     *-*-vxworks*)
210181834Sroberto	# Quick and dirty sanity check
211181834Sroberto	case "$VX_KERNEL" in
212181834Sroberto	 '') AC_MSG_ERROR(Please follow the directions in html/build/hints/vxworks.html!)
213181834Sroberto	    ;;
214181834Sroberto	esac
215181834Sroberto        CFLAGS="$CFLAGS -DSYS_VXWORKS"
216181834Sroberto        ;;
217181834Sroberto    esac
218181834Sroberto    ;;
219181834Srobertoesac
220181834Sroberto
221181834Srobertodnl  we need to check for cross compile tools for vxWorks here
222181834SrobertoAC_PROG_AWK
223181834SrobertoAC_PROG_MAKE_SET
224181834Sroberto
225181834Srobertorm -f conftest*
226181834Sroberto
227181834Srobertocase "$GCC" in
228181834Sroberto yes)
229181834Sroberto    CFLAGS="$CFLAGS -Wall"
230181834Sroberto    # CFLAGS="$CFLAGS -Wcast-align"
231181834Sroberto    CFLAGS="$CFLAGS -Wcast-qual"
232181834Sroberto    # CFLAGS="$CFLAGS -Wconversion"
233181834Sroberto    # CFLAGS="$CFLAGS -Werror"
234181834Sroberto    # CFLAGS="$CFLAGS -Wextra"
235181834Sroberto    # CFLAGS="$CFLAGS -Wfloat-equal"
236181834Sroberto    CFLAGS="$CFLAGS -Wmissing-prototypes"
237181834Sroberto    CFLAGS="$CFLAGS -Wpointer-arith"
238181834Sroberto    CFLAGS="$CFLAGS -Wshadow"
239181834Sroberto    CFLAGS="$CFLAGS -Wstrict-prototypes"
240181834Sroberto    # CFLAGS="$CFLAGS -Wtraditional"
241181834Sroberto    # CFLAGS="$CFLAGS -Wwrite-strings"
242181834Sroberto
243181834Sroberto    ;;
244181834Srobertoesac
245181834Sroberto
246181834Srobertocase "$host" in
247181834Sroberto *-next-nextstep3)
248181834Sroberto    CFLAGS="$CFLAGS -posix"
249181834Sroberto    ;;
250181834Srobertodnl This is currently commented out by bor. 
251181834Srobertodnl The new versions of ReliantUNIX round adjtime() interval down
252181834Srobertodnl to 1/100s (system tick). This makes tickadj actually useless.
253181834Srobertodnl So, I'd better not use additional flags.
254181834Srobertodnl I leave it here just in case anybody has better idea
255181834Srobertodnl  mips-sni-sysv4* )
256181834Srobertodnl     #
257181834Srobertodnl     # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
258181834Srobertodnl     #
259181834Srobertodnl     if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
260181834Srobertodnl       CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
261181834Srobertodnl     fi
262181834Srobertodnl     ;;
263181834Srobertoesac
264181834Sroberto
265181834Srobertoac_busted_vpath_in_make=no
266181834Sroberto
267181834Srobertocase "$build" in
268181834Sroberto *-*-irix6.1*)	# 64 bit only
269181834Sroberto    # busted vpath?
270181834Sroberto    ;;
271181834Sroberto *-*-irix6*)	# 6.2 (and later?)
272181834Sroberto    ac_busted_vpath_in_make=yes
273181834Sroberto    ;;
274181834Sroberto *-*-solaris2.5.1)
275181834Sroberto    ac_busted_vpath_in_make=yes
276181834Sroberto    ;;
277181834Sroberto *-*-unicosmp*)
278181834Sroberto    ac_busted_vpath_in_make=yes
279181834Sroberto    ;;
280181834Srobertoesac
281181834Sroberto
282181834Srobertocase "$ac_busted_vpath_in_make$srcdir" in
283181834Sroberto no*) ;;
284181834Sroberto yes.) ;;
285181834Sroberto *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
286181834Sroberto     '')
287181834Sroberto	AC_MSG_ERROR(building outside of the main directory requires GNU make)
288181834Sroberto	;;
289181834Sroberto     *) ;;
290181834Sroberto    esac
291181834Sroberto    ;;
292181834Srobertoesac
293181834Sroberto
294181834SrobertoAC_SUBST(CFLAGS)dnl
295181834SrobertoAC_SUBST(LDFLAGS)dnl
296181834Sroberto
297181834Sroberto# HMS: From bunnylou/cowbird
298181834Srobertocase "$host" in
299181834Sroberto alpha-dec-osf4.0)
300181834Sroberto    AC_DISABLE_SHARED
301181834Sroberto    ;;
302181834Sroberto *) # So far, the only shared library we might use is libopts.
303181834Sroberto    # It's a small library - we might as well use a static version of it.
304181834Sroberto    AC_DISABLE_SHARED
305181834Sroberto    ;;
306181834Srobertoesac
307181834Sroberto
308181834SrobertoAC_PROG_LIBTOOL
309181834SrobertoAC_PROG_LN_S
310181834SrobertoAC_PROG_GCC_TRADITIONAL
311181834SrobertoAC_C_VOLATILE
312181834SrobertoAC_ISC_POSIX
313181834SrobertoAC_PATH_PROG(PATH_SH, sh)
314181834SrobertoAC_PATH_PROG(PATH_PERL, perl)
315181834Sroberto
316181834Srobertohs_ULONG_CONST
317181834Sroberto
318181834Srobertocase "$host" in
319181834Sroberto *-*-vxworks*)
320181834Sroberto    ac_link="$ac_link $VX_KERNEL"
321181834Sroberto    ;;
322181834Srobertoesac
323181834Sroberto
324181834SrobertoAC_PROG_INSTALL
325181834Sroberto
326181834Srobertocase "$host" in
327181834Sroberto *-pc-cygwin*)
328181834Sroberto    AC_CHECK_LIB(advapi32, main)
329181834Sroberto    ;;
330181834Srobertoesac
331181834Sroberto
332181834SrobertoAC_CHECK_FUNC(gethostent, ,
333181834Sroberto  AC_CHECK_LIB(nsl, gethostent, , , $libxnet -lsocket))
334181834SrobertoAC_CHECK_FUNC(openlog, , 
335181834Sroberto  AC_CHECK_LIB(gen, openlog, , 
336181834Sroberto  AC_CHECK_LIB(syslog, openlog, , , $libxnet -lsocket)))
337181834SrobertoAC_CHECK_LIB(md5, MD5Init, , 
338181834Sroberto  AC_CHECK_LIB(md, MD5Init))
339181834SrobertoAC_CHECK_FUNCS(MD5Init)
340181834Srobertodnl HMS: What a hack...
341181834SrobertoAC_CHECK_HEADERS(readline/history.h readline/readline.h)
342181834Srobertocase "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
343181834Sroberto *no*) ;;
344181834Sroberto *) save_LIBS=$LIBS
345181834Sroberto    LIBS=
346181834Sroberto    # Ralf Wildenhues: either unset ... or cache READLINE_LIBS
347181834Sroberto    unset ac_cv_lib_readline_readline
348181834Sroberto    AC_CHECK_LIB(readline, readline, ,
349181834Sroberto     AC_MSG_NOTICE([Trying again with -lcurses])
350181834Sroberto     unset ac_cv_lib_readline_readline
351181834Sroberto     AC_CHECK_LIB(readline, readline,
352181834Sroberto      LIBS="-lreadline -lcurses $LIBS"
353181834Sroberto      AC_DEFINE(HAVE_LIBREADLINE)
354181834Sroberto      AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
355181834Sroberto      AC_CHECK_LIB(edit, readline,
356181834Sroberto       LIBS="-ledit -lcurses"
357181834Sroberto       AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
358181834Sroberto       AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
359181834Sroberto       , , -lcurses)
360181834Sroberto      , -lcurses))
361181834Sroberto    READLINE_LIBS=$LIBS
362181834Sroberto    AC_SUBST(READLINE_LIBS)
363181834Sroberto    LIBS=$save_LIBS
364181834Sroberto    ;;
365181834Srobertoesac
366181834Sroberto
367181834Srobertodnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
368181834Srobertodnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
369181834Srobertodnl so only use one of them.  Linux (glibc-2.1.2 and -2.2.2, at least)
370181834Srobertodnl does Strange Things with extra processes using the Posix-compatibility
371181834Srobertodnl real-time library, so we don't want to use it.
372181834Sroberto
373181834Srobertocase "$host" in
374181834Sroberto *-*-linux*) ;;
375181834Sroberto *)
376181834Sroberto    AC_CHECK_LIB(rt, sched_setscheduler, ,
377181834Sroberto	AC_CHECK_LIB(posix4, sched_setscheduler))
378181834Sroberto    ;;
379181834Srobertoesac
380181834Sroberto
381181834SrobertoAC_CHECK_FUNC(setsockopt, ,
382181834Sroberto	[AC_CHECK_LIB(socket, setsockopt)
383181834Sroberto	 AC_CHECK_LIB(xnet, setsockopt)])
384181834Sroberto
385181834SrobertoAC_HEADER_STDC
386181834SrobertoAC_CHECK_HEADERS(bstring.h)
387181834SrobertoAC_CHECK_HEADER(dns_sd.h,
388181834Sroberto	[AC_CHECK_LIB(dns_sd,
389181834Sroberto			DNSServiceRegister,
390181834Sroberto			[AC_DEFINE(HAVE_DNSREGISTRATION, 1,
391181834Sroberto				[Use Rendezvous/DNS-SD registration])])])
392181834Srobertocase "$ac_cv_lib_dns_sd_DNSServiceRegister" in
393181834Sroberto yes) LIBS="-ldns_sd $LIBS" ;;
394181834Srobertoesac
395181834SrobertoAC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h math.h)
396181834Sroberto
397181834Sroberto# HMS: Lame, but fast.
398181834Srobertoif test -f /etc/redhat-release
399181834Srobertothen
400181834Sroberto    :
401181834Srobertoelse
402181834Sroberto    AC_CHECK_HEADERS(md5.h, [], [],
403181834Sroberto[#if HAVE_SYS_TYPES_H
404181834Sroberto#include <sys/types.h>
405181834Sroberto#endif
406181834Sroberto])
407181834Srobertofi
408181834SrobertoAC_CHECK_HEADERS(memory.h netdb.h poll.h)
409181834SrobertoAC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
410181834SrobertoAC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
411181834Srobertocase "$host" in
412181834Sroberto *-*-aix*)
413181834Sroberto    AC_CHECK_HEADERS(utmpx.h)
414181834Sroberto    case "$ac_cv_header_utmpx_h" in
415181834Sroberto     yes) ;;
416181834Sroberto     *) AC_CHECK_HEADERS(utmp.h) ;;
417181834Sroberto    esac
418181834Sroberto    ;;
419181834Sroberto *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
420181834Srobertoesac
421181834SrobertoAC_CHECK_HEADERS(arpa/nameser.h)
422181834SrobertoAC_CHECK_HEADERS(sys/socket.h)
423181834SrobertoAC_CHECK_HEADERS(net/if.h, [], [],
424181834Sroberto[#if HAVE_SYS_SOCKET_H
425181834Sroberto#include <sys/socket.h>
426181834Sroberto#endif
427181834Sroberto])
428181834SrobertoAC_CHECK_HEADERS(net/if6.h)
429181834SrobertoAC_CHECK_HEADERS(net/route.h, [], [], [
430181834Sroberto#include <sys/types.h>
431181834Sroberto#include <sys/socket.h>
432181834Sroberto#include <net/if.h>
433181834Sroberto])
434181834SrobertoAC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
435181834SrobertoAC_CHECK_HEADERS(netinet/in.h)
436181834SrobertoAC_CHECK_HEADERS(netinet/ip.h, [], [],
437181834Sroberto[#if HAVE_SYS_TYPES_H
438181834Sroberto#include <sys/types.h>
439181834Sroberto#endif
440181834Sroberto#if HAVE_NETINET_IN_H
441181834Sroberto#include <netinet/in.h>
442181834Sroberto#endif
443181834Sroberto#if HAVE_NETINET_IN_SYSTM_H
444181834Sroberto#include <netinet/in_systm.h>
445181834Sroberto#endif
446181834Sroberto])
447181834SrobertoAC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
448181834SrobertoAC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
449181834Srobertodnl AC_CHECK_HEADERS(sys/chudefs.h)
450181834SrobertoAC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
451181834Srobertocase "$host" in
452181834Sroberto *-*-sunos4*) ;;
453181834Sroberto *) AC_CHECK_HEADERS(sys/ioctl.h)
454181834Sroberto    ;;
455181834Srobertoesac
456181834SrobertoAC_CHECK_HEADERS(sys/ipc.h)
457181834SrobertoAC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
458181834Sroberto# HMS: Check sys/proc.h and sys/resource.h after some others
459181834SrobertoAC_CHECK_HEADERS(sys/ppstime.h)
460181834Srobertocase "$ac_cv_header_sched_h" in
461181834Sroberto yes) ;;
462181834Sroberto *) AC_CHECK_HEADERS(sys/sched.h) ;;
463181834Srobertoesac
464181834Srobertocase "$host" in
465181834Sroberto *-*-sco*)
466181834Sroberto    AC_CHECK_HEADERS(sys/sio.h)
467181834Sroberto    ;;
468181834Srobertoesac
469181834Sroberto# HMS: Check sys/shm.h after some others
470181834SrobertoAC_CHECK_HEADERS(sys/select.h sys/signal.h sys/sockio.h)
471181834Sroberto# HMS: Checked sys/socket.h earlier
472181834Srobertocase "$host" in
473181834Sroberto *-*-netbsd*) ;;
474181834Sroberto *) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
475181834Sroberto    ;;
476181834Srobertoesac
477181834SrobertoAC_CHECK_HEADERS(sys/stat.h sys/stream.h)
478181834SrobertoAC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
479181834SrobertoAC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
480181834SrobertoAC_EGREP_CPP(yes,
481181834Sroberto[#if HAVE_SYS_TIME_H
482181834Sroberto# include <sys/time.h>
483181834Sroberto#endif
484181834Sroberto#if HAVE_ERRNO_H
485181834Sroberto# include <errno.h>
486181834Sroberto#endif
487181834Sroberto#include <sys/timepps.h>
488181834Sroberto#ifdef PPS_API_VERS_1
489181834Srobertoyes
490181834Sroberto#endif
491181834Sroberto], [AC_CHECK_HEADERS(sys/timepps.h, [], [],
492181834Sroberto[#if HAVE_SYS_TIME_H
493181834Sroberto# include <sys/time.h>
494181834Sroberto#endif
495181834Sroberto#if HAVE_ERRNO_H
496181834Sroberto# include <errno.h>
497181834Sroberto#endif
498181834Sroberto])
499181834Sroberto])
500181834SrobertoAC_CHECK_HEADERS(sys/timers.h sys/tpro.h sys/types.h sys/wait.h)
501181834SrobertoAC_HEADER_TIME
502181834Srobertocase "$host" in
503181834Sroberto*-convex-*)
504181834Sroberto  AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
505181834Sroberto  ;;
506181834Sroberto*-*-bsdi*)
507181834Sroberto  AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
508181834Sroberto  ;;
509181834Srobertoesac
510181834Sroberto
511181834Srobertocase "$host" in
512181834Sroberto *-*-linux*)
513181834Sroberto    AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
514181834Sroberto    ;;
515181834Srobertoesac
516181834Srobertocase "$ac_cv_func___adjtimex" in
517181834Sroberto yes) ;;
518181834Sroberto *)
519181834Sroberto    AC_CHECK_LIB(elf, nlist)	dnl Only needed for tickadj...
520181834Sroberto    dnl AC_CHECK_LIB(kvm, main, , , -lelf)
521181834Sroberto    AC_CHECK_LIB(kvm, main)		dnl We already know about -lelf here...
522181834Sroberto    AC_CHECK_LIB(ld, nlist)
523181834Sroberto    AC_CHECK_LIB(mld, nlist)
524181834Sroberto    AC_CHECK_HEADER(nlist.h,
525181834Sroberto    [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
526181834Sroberto     AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
527181834Sroberto      [AC_TRY_COMPILE([#include <nlist.h>],
528181834Sroberto       [struct nlist n; n.n_un.n_name = 0;],
529181834Sroberto       ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
530181834Sroberto     if test $ac_cv_struct_nlist_n_un = yes; then
531181834Sroberto       AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
532181834Sroberto     fi
533181834Sroberto    ])dnl
534181834Sroberto    ;;
535181834Srobertoesac
536181834Sroberto
537181834Srobertodnl AC_CHECK_HEADERS(net/if.h, [], [],
538181834Srobertodnl [#if HAVE_SYS_TYPES_H
539181834Srobertodnl # include <sys/types.h>
540181834Srobertodnl #endif
541181834Srobertodnl #if HAVE_SYS_SOCKET_H
542181834Srobertodnl # include <sys/socket.h>
543181834Srobertodnl #endif
544181834Srobertodnl ])
545181834Sroberto
546181834SrobertoAC_CHECK_HEADERS(sys/proc.h, [], [],
547181834Sroberto[#if HAVE_SYS_TYPES_H
548181834Sroberto# include <sys/types.h>
549181834Sroberto#endif
550181834Sroberto#if HAVE_SYS_TIME_H
551181834Sroberto# include <sys/time.h>
552181834Sroberto#endif
553181834Sroberto])
554181834Sroberto
555181834SrobertoAC_CHECK_HEADERS(sys/resource.h, [], [],
556181834Sroberto[#if HAVE_SYS_TIME_H
557181834Sroberto# include <sys/time.h>
558181834Sroberto#endif
559181834Sroberto])
560181834Sroberto
561181834SrobertoAC_CHECK_HEADERS(sys/shm.h, [], [],
562181834Sroberto[#if HAVE_SYS_TYPES_H
563181834Sroberto# include <sys/types.h>
564181834Sroberto#endif
565181834Sroberto#if HAVE_SYS_IPC_H
566181834Sroberto# include <sys/ipc.h>
567181834Sroberto#endif
568181834Sroberto])
569181834Sroberto
570181834SrobertoAC_CHECK_HEADERS(sys/timex.h, [], [],
571181834Sroberto[#if HAVE_SYS_TIME_H
572181834Sroberto# include <sys/time.h>
573181834Sroberto#endif
574181834Sroberto])
575181834Sroberto
576181834SrobertoAC_CHECK_HEADERS(resolv.h, [], [],
577181834Sroberto[#if HAVE_SYS_TYPES_H
578181834Sroberto#include <sys/types.h>
579181834Sroberto#endif
580181834Sroberto#if HAVE_NETINET_IN_H
581181834Sroberto#include <netinet/in.h>
582181834Sroberto#endif
583181834Sroberto#if HAVE_ARPA_NAMESER_H
584181834Sroberto#include <arpa/nameser.h>
585181834Sroberto#endif
586181834Sroberto])
587181834Sroberto
588181834SrobertoAC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
589181834Sroberto[AC_TRY_COMPILE([],[
590181834Srobertovolatile int x;],
591181834Sroberto	ac_cv_c_volatile=yes,
592181834Sroberto	ac_cv_c_volatile=no)
593181834Sroberto])
594181834Srobertocase "$ac_cv_c_volatile" in
595181834Sroberto yes)
596181834Sroberto    ;;
597181834Sroberto *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
598181834Sroberto    ;;
599181834Srobertoesac
600181834Sroberto
601181834Sroberto# AM_C_PROTOTYPES gives us ansi2knr
602181834Srobertocase "$build" in
603181834Sroberto *-*-solaris2*)
604181834Sroberto    # Assume that solaris2 is Ansi C...
605181834Sroberto    ;;
606181834Sroberto *)
607181834Sroberto    AM_C_PROTOTYPES
608181834Sroberto    ;;
609181834Srobertoesac
610181834SrobertoAC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
611181834Sroberto[AC_TRY_COMPILE([
612181834Srobertoextern int foo (short);
613181834Srobertoint foo(short i) { return i; }],[
614181834Srobertoint i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
615181834Sroberto])
616181834Srobertoif test "$ac_cv_have_prototypes" = yes; then
617181834Sroberto  AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
618181834Srobertofi
619181834Sroberto
620181834SrobertoAC_C_CONST
621181834SrobertoAC_C_BIGENDIAN
622181834SrobertoAC_TYPE_SIGNAL
623181834SrobertoAC_TYPE_OFF_T
624181834SrobertoAC_TYPE_SIZE_T
625181834SrobertoAC_CHECK_TYPE(time_t, long)
626181834SrobertoAC_CHECK_SIZEOF(time_t)
627181834SrobertoAC_CHECK_TYPES(uintptr_t)
628181834Sroberto 
629181834SrobertoAH_VERBATIM([TYPEDEF_UINTPTR_T],
630181834Sroberto[/* Provide a typedef for uintptr_t? */
631181834Sroberto#ifndef HAVE_UINTPTR_T
632181834Srobertotypedef unsigned int	uintptr_t;
633181834Sroberto#define HAVE_UINTPTR_T	1
634181834Sroberto#endif])
635181834Sroberto
636181834SrobertoAC_STRUCT_TM
637181834Sroberto
638181834SrobertoAC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
639181834Sroberto[AC_TRY_COMPILE([#include <sys/types.h>],
640181834Sroberto	[u_int8_t len = 42; return 0;],
641181834Sroberto	ac_cv_type_u_int8_t=yes,
642181834Sroberto	ac_cv_type_u_int8_t=no)
643181834Sroberto])
644181834Srobertoif test $ac_cv_type_u_int8_t = yes; then
645181834Sroberto	AC_DEFINE(HAVE_TYPE_U_INT8_T, 1, [Does u_int8_t exist?])
646181834Srobertofi
647181834Sroberto
648181834SrobertoAC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
649181834Sroberto[AC_TRY_COMPILE([#include <sys/types.h>],
650181834Sroberto	[u_int64_t len = 42; return 0;],
651181834Sroberto	ac_cv_type_u_int64_t=yes,
652181834Sroberto	ac_cv_type_u_int64_t=no)
653181834Sroberto])
654181834Srobertoif test $ac_cv_type_u_int64_t = yes; then
655181834Sroberto	AC_DEFINE(HAVE_TYPE_U_INT64_T, 1, [Does u_int64_t exist?])
656181834Srobertofi
657181834Sroberto
658181834Sroberto#
659181834Sroberto# Look for in_port_t.
660181834Sroberto#
661181834SrobertoAC_MSG_CHECKING(for in_port_t)
662181834SrobertoAC_TRY_COMPILE([
663181834Sroberto#include <sys/types.h>
664181834Sroberto#include <netinet/in.h>],
665181834Sroberto[in_port_t port = 25; return (0);],
666181834Sroberto	[AC_MSG_RESULT(yes)
667181834Sroberto	],
668181834Sroberto        [AC_MSG_RESULT(no)
669181834Sroberto	AC_DEFINE(ISC_PLATFORM_NEEDPORTT, 1, [Do we need our own in_port_t?])
670181834Sroberto	])
671181834Sroberto
672181834SrobertoAC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
673181834Sroberto[ac_cv_var_default_hz=100
674181834Srobertocase "$host" in
675181834Sroberto alpha*-dec-osf4*|alpha*-dec-osf5*)
676181834Sroberto    ac_cv_var_default_hz=1024
677181834Sroberto    ;;
678181834Sroberto mips-dec-ultrix4*)
679181834Sroberto    ac_cv_var_default_hz=256
680181834Sroberto    ;;
681181834Srobertoesac])
682181834SrobertoAC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
683181834Sroberto
684181834SrobertoAC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
685181834Sroberto[ac_cv_var_override_hz=no
686181834Srobertocase "$host" in
687181834Sroberto alpha*-dec-osf4*|alpha*-dec-osf5*)
688181834Sroberto    ac_cv_var_override_hz=yes
689181834Sroberto    ;;
690181834Sroberto mips-dec-ultrix4*)
691181834Sroberto    ac_cv_var_override_hz=yes
692181834Sroberto    ;;
693181834Sroberto *-*-freebsd*)
694181834Sroberto    ac_cv_var_override_hz=yes
695181834Sroberto    ;;
696181834Sroberto *-*-sunos4*)
697181834Sroberto    ac_cv_var_override_hz=yes
698181834Sroberto    ;;
699181834Srobertoesac])
700181834Srobertocase "$ac_cv_var_override_hz" in
701181834Sroberto yes)
702181834Sroberto    AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
703181834Sroberto    ;;
704181834Srobertoesac
705181834Sroberto
706181834Srobertodnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
707181834Srobertodnl [AC_TRY_LINK([#include <sys/types.h>
708181834Srobertodnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
709181834Srobertodnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
710181834Srobertodnl if test $su_cv_func_ut_host_in_utmp = yes; then
711181834Srobertodnl   AC_DEFINE(HAVE_UT_HOST)
712181834Srobertodnl fi
713181834Sroberto
714181834Srobertodnl AC_MSG_CHECKING(if we can get the system boot time)
715181834Srobertodnl AC_CACHE_VAL(su_cv_have_boot_time,
716181834Srobertodnl [AC_EGREP_CPP(yes,
717181834Srobertodnl [#ifdef HAVE_UTMPX_H
718181834Srobertodnl #include <utmpx.h>
719181834Srobertodnl #else
720181834Srobertodnl #include <utmp.h>
721181834Srobertodnl #endif
722181834Srobertodnl #ifdef BOOT_TIME
723181834Srobertodnl yes
724181834Srobertodnl #endif
725181834Srobertodnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
726181834Srobertodnl AC_MSG_RESULT($su_cv_have_boot_time)
727181834Sroberto
728181834SrobertoAC_CACHE_CHECK(for struct rt_msghdr, ac_cv_struct_rt_msghdr,
729181834Sroberto[AC_TRY_COMPILE([
730181834Sroberto#include <sys/types.h>
731181834Sroberto#include <sys/socket.h>
732181834Sroberto#include <net/if.h>
733181834Sroberto#include <net/route.h>],
734181834Sroberto[struct rt_msghdr p;],
735181834Sroberto	ac_cv_struct_rt_msghdr=yes,
736181834Sroberto	ac_cv_struct_rt_msghdr=no)
737181834Sroberto])
738181834Srobertoif test $ac_cv_struct_rt_msghdr = yes; then
739181834Sroberto    AC_DEFINE(HAS_ROUTING_SOCKET, 1, [Do we have a routing socket (struct rt_msghdr)?])
740181834Srobertofi
741181834Sroberto
742181834SrobertoAC_CACHE_CHECK(
743181834Sroberto  struct sigaction for sa_sigaction,
744181834Sroberto  ac_cv_struct_sigaction_has_sa_sigaction,
745181834Sroberto  [
746181834Sroberto    AC_TRY_COMPILE(
747181834Sroberto      [#include <signal.h>],
748181834Sroberto      [struct sigaction act; act.sa_sigaction = 0;],
749181834Sroberto      ac_cv_struct_sigaction_has_sa_sigaction=yes,
750181834Sroberto      ac_cv_struct_sigaction_has_sa_sigaction=no
751181834Sroberto    )
752181834Sroberto  ]
753181834Sroberto)
754181834Srobertoif test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
755181834Sroberto  AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
756181834Srobertofi
757181834Sroberto
758181834SrobertoAC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
759181834Sroberto[AC_TRY_COMPILE([
760181834Sroberto#include <sys/types.h>
761181834Sroberto#ifdef HAVE_SYS_TERMIOS_H
762181834Sroberto# include <sys/termios.h>
763181834Sroberto#endif
764181834Sroberto#ifdef HAVE_SYS_TIME_H
765181834Sroberto# include <sys/time.h>
766181834Sroberto#endif
767181834Sroberto#ifdef HAVE_SYS_PPSCLOCK_H
768181834Sroberto# include <sys/ppsclock.h>
769181834Sroberto#endif],[
770181834Srobertoextern struct ppsclockev *pce;
771181834Srobertoreturn pce->serial;],
772181834Sroberto	ac_cv_struct_ppsclockev=yes,
773181834Sroberto	ac_cv_struct_ppsclockev=no)
774181834Sroberto])
775181834Srobertoif test $ac_cv_struct_ppsclockev = yes; then
776181834Sroberto    AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
777181834Srobertofi
778181834Sroberto
779181834SrobertoAC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
780181834Sroberto[AC_TRY_COMPILE([
781181834Sroberto#include <sys/types.h>
782181834Sroberto#include <sys/socket.h>],[
783181834Srobertoextern struct sockaddr *ps;
784181834Srobertoreturn ps->sa_len;],
785181834Sroberto	ac_cv_struct_sockaddr_has_sa_len=yes,
786181834Sroberto	ac_cv_struct_sockaddr_has_sa_len=no)
787181834Sroberto])
788181834Srobertoif test $ac_cv_struct_sockaddr_has_sa_len = yes; then
789181834Sroberto    AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
790181834Srobertofi
791181834Sroberto
792181834SrobertoAC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage,
793181834Sroberto[AC_TRY_COMPILE([
794181834Sroberto#include <sys/types.h>
795181834Sroberto#include <sys/socket.h>
796181834Sroberto#include <netinet/in.h>
797181834Sroberto],[
798181834Srobertostruct sockaddr_storage n;],
799181834Sroberto	ac_cv_struct_sockaddr_storage=yes,
800181834Sroberto	ac_cv_struct_sockaddr_storage=no)
801181834Sroberto])
802181834Srobertoif test $ac_cv_struct_sockaddr_storage = yes; then
803181834Sroberto    AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
804181834Srobertofi
805181834Sroberto
806181834SrobertoAC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
807181834Sroberto		ac_cv_have_ss_family_in_struct_ss, [
808181834Sroberto	AC_TRY_COMPILE(
809181834Sroberto		[
810181834Sroberto#include <sys/types.h>
811181834Sroberto#include <sys/socket.h>
812181834Sroberto		],
813181834Sroberto		[ struct sockaddr_storage s; s.ss_family = 1; ],
814181834Sroberto		[ ac_cv_have_ss_family_in_struct_ss="yes" ],
815181834Sroberto		[ ac_cv_have_ss_family_in_struct_ss="no" ],
816181834Sroberto	)
817181834Sroberto])
818181834Srobertoif test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
819181834Sroberto	AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
820181834Srobertoelse
821181834Sroberto    # Hack around a problem...
822181834Sroberto    # HMS: This is $host because we need the -D if we are building *for* it.
823181834Sroberto    # HMS: 061029: Now that we separate the ss_* checks this is causing
824181834Sroberto    # a problem - disable it until we get to the bottom of it.
825181834Sroberto    case "$host" in
826181834Sroberto     XXX*-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
827181834Sroberto	;;
828181834Sroberto    esac
829181834Srobertofi
830181834Sroberto
831181834SrobertoAC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
832181834Sroberto		ac_cv_have___ss_family_in_struct_ss, [
833181834Sroberto	AC_TRY_COMPILE(
834181834Sroberto		[
835181834Sroberto#include <sys/types.h>
836181834Sroberto#include <sys/socket.h>
837181834Sroberto		],
838181834Sroberto		[ struct sockaddr_storage s; s.__ss_family = 1; ],
839181834Sroberto		[ ac_cv_have___ss_family_in_struct_ss="yes" ],
840181834Sroberto		[ ac_cv_have___ss_family_in_struct_ss="no" ]
841181834Sroberto	)
842181834Sroberto])
843181834Srobertoif test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
844181834Sroberto	AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
845181834Srobertofi
846181834Sroberto
847181834SrobertoAH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
848181834Sroberto[/* Handle ss_family */
849181834Sroberto#if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
850181834Sroberto# define ss_family __ss_family
851181834Sroberto#endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
852181834Sroberto
853181834SrobertoAC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
854181834Sroberto		ac_cv_have_ss_len_in_struct_ss, [
855181834Sroberto	AC_TRY_COMPILE(
856181834Sroberto		[
857181834Sroberto#include <sys/types.h>
858181834Sroberto#include <sys/socket.h>
859181834Sroberto		],
860181834Sroberto		[ struct sockaddr_storage s; s.ss_len = 1; ],
861181834Sroberto		[ ac_cv_have_ss_len_in_struct_ss="yes" ],
862181834Sroberto		[ ac_cv_have_ss_len_in_struct_ss="no" ],
863181834Sroberto	)
864181834Sroberto])
865181834Srobertoif test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
866181834Sroberto	AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len?])
867181834Srobertofi
868181834Sroberto
869181834SrobertoAC_CACHE_CHECK([for __ss_len field in struct sockaddr_storage],
870181834Sroberto		ac_cv_have___ss_len_in_struct_ss, [
871181834Sroberto	AC_TRY_COMPILE(
872181834Sroberto		[
873181834Sroberto#include <sys/types.h>
874181834Sroberto#include <sys/socket.h>
875181834Sroberto		],
876181834Sroberto		[ struct sockaddr_storage s; s.__ss_len = 1; ],
877181834Sroberto		[ ac_cv_have___ss_len_in_struct_ss="yes" ],
878181834Sroberto		[ ac_cv_have___ss_len_in_struct_ss="no" ]
879181834Sroberto	)
880181834Sroberto])
881181834Srobertoif test "x$ac_cv_have___ss_len_in_struct_ss" = "xyes" ; then
882181834Sroberto	AC_DEFINE(HAVE___SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have __ss_len?])
883181834Srobertofi
884181834Sroberto
885181834SrobertoAH_VERBATIM([X_HAVE_SS_LEN_IN_SS],
886181834Sroberto[/* Handle ss_len */
887181834Sroberto#if !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE___SS_LEN_IN_SS)
888181834Sroberto# define ss_len __ss_len
889181834Sroberto#endif /* !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE_SA_LEN_IN_SS) */])
890181834Sroberto
891181834Srobertocase "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
892181834Sroberto  *yes*)
893181834Sroberto    AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
894181834Sroberto[AC_TRY_COMPILE([
895181834Sroberto#ifdef HAVE_MACHINE_SOUNDCARD_H
896181834Sroberto# include <machine/soundcard.h>
897181834Sroberto#endif
898181834Sroberto#ifdef HAVE_SYS_SOUNDCARD_H
899181834Sroberto# include <sys/soundcard.h>
900181834Sroberto#endif],[
901181834Srobertoextern struct snd_size *ss;
902181834Srobertoreturn ss->rec_size;],
903181834Sroberto    ac_cv_struct_snd_size=yes,
904181834Sroberto    ac_cv_struct_snd_size=no)
905181834Sroberto])
906181834Sroberto    case "$ac_cv_struct_snd_size" in
907181834Sroberto     yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
908181834Sroberto    esac
909181834Sroberto    ;;
910181834Srobertoesac
911181834Sroberto
912181834SrobertoAC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
913181834Sroberto[AC_TRY_COMPILE([
914181834Sroberto#include <sys/time.h>],[
915181834Srobertoextern struct clockinfo *pc;
916181834Srobertoreturn pc->hz;],
917181834Sroberto	ac_cv_struct_clockinfo_has_hz=yes,
918181834Sroberto	ac_cv_struct_clockinfo_has_hz=no)
919181834Sroberto])
920181834Srobertoif test $ac_cv_struct_clockinfo_has_hz = yes; then
921181834Sroberto    AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
922181834Srobertofi
923181834Sroberto
924181834SrobertoAC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
925181834Sroberto[AC_TRY_COMPILE([
926181834Sroberto#include <sys/time.h>],[
927181834Srobertoextern struct clockinfo *pc;
928181834Srobertoreturn pc->tickadj;],
929181834Sroberto	ac_cv_struct_clockinfo_has_tickadj=yes,
930181834Sroberto	ac_cv_struct_clockinfo_has_tickadj=no)
931181834Sroberto])
932181834Srobertoif test $ac_cv_struct_clockinfo_has_tickadj = yes; then
933181834Sroberto    AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
934181834Srobertofi
935181834Sroberto
936181834SrobertoAC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
937181834Sroberto[AC_TRY_COMPILE([
938181834Sroberto#include <sys/time.h>
939181834Sroberto/* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
940181834Sroberto#ifdef HAVE_ERRNO_H
941181834Sroberto# include <errno.h>
942181834Sroberto#endif
943181834Sroberto#ifdef HAVE_SYS_TIMEPPS_H
944181834Sroberto# define FRAC 4294967296
945181834Sroberto# include <sys/timepps.h>
946181834Sroberto#endif],
947181834Sroberto[struct timespec n;],
948181834Srobertoac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
949181834Srobertoif test $ac_cv_struct_timespec = yes; then
950181834Sroberto  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
951181834Srobertofi
952181834Sroberto
953181834SrobertoAC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
954181834Sroberto[AC_TRY_COMPILE([
955181834Sroberto#include <sys/time.h>
956181834Sroberto#include <sys/timex.h>],
957181834Sroberto[struct ntptimeval n;],
958181834Srobertoac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
959181834Srobertoif test $ac_cv_struct_ntptimeval = yes; then
960181834Sroberto  AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
961181834Srobertofi
962181834Sroberto
963181834SrobertoAC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
964181834Sroberto[#ifdef HAVE_SYS_TIME_H
965181834Sroberto#include <sys/time.h>
966181834Sroberto#else
967181834Sroberto# ifdef HAVE_TIME_H
968181834Sroberto# include <time.h>
969181834Sroberto# endif
970181834Sroberto#endif
971181834Sroberto#ifdef HAVE_SYS_TIMEX_H
972181834Sroberto#include <sys/timex.h>
973181834Sroberto#else
974181834Sroberto# ifdef HAVE_TIMEX_H
975181834Sroberto# include <timex.h>
976181834Sroberto# endif
977181834Sroberto#endif])
978181834Sroberto
979181834SrobertoAC_C_INLINE
980181834SrobertoAC_C_CHAR_UNSIGNED		dnl CROSS_COMPILE?
981181834SrobertoAC_CHECK_SIZEOF(signed char)
982181834SrobertoAC_CHECK_SIZEOF(int)
983181834SrobertoAC_CHECK_SIZEOF(long)
984181834Sroberto
985181834SrobertoAC_CHECK_TYPES([s_char])
986181834Srobertocase "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
987181834Sroberto *yes)
988181834Sroberto    # We have a typedef for s_char.  Might as well believe it...
989181834Sroberto    ;;
990181834Sroberto no0no)
991181834Sroberto    # We have signed chars, can't say 'signed char', no s_char typedef.
992181834Sroberto    AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
993181834Sroberto    ;;
994181834Sroberto no1no)
995181834Sroberto    # We have signed chars, can say 'signed char', no s_char typedef.
996181834Sroberto    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
997181834Sroberto    ;;
998181834Sroberto yes0no)
999181834Sroberto    # We have unsigned chars, can't say 'signed char', no s_char typedef.
1000181834Sroberto    AC_MSG_ERROR(No way to specify a signed character!)
1001181834Sroberto    ;;
1002181834Sroberto yes1no)
1003181834Sroberto    # We have unsigned chars, can say 'signed char', no s_char typedef.
1004181834Sroberto    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
1005181834Sroberto    ;;
1006181834Srobertoesac
1007181834SrobertoAC_TYPE_UID_T
1008181834Sroberto
1009181834Srobertocase "$host" in
1010181834Sroberto *-*-aix[[45]]*)
1011181834Sroberto	# (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
1012181834Sroberto	# (returning ENOSYS).  I didn't check 4.2.  If, in the future,
1013181834Sroberto	# IBM pulls its thumbs out long enough to implement clock_settime,
1014181834Sroberto	# this conditional will need to change.  Maybe use AC_TRY_RUN
1015181834Sroberto	# instead to try to set the time to itself and check errno.
1016181834Sroberto    ;;
1017181834Sroberto *) AC_CHECK_FUNCS(clock_gettime clock_settime)
1018181834Sroberto    ;;
1019181834Srobertoesac
1020181834SrobertoAC_CHECK_FUNCS(daemon)
1021181834SrobertoAC_CHECK_FUNCS(finite, ,
1022181834Sroberto  [AC_CHECK_FUNCS(isfinite, ,
1023181834Sroberto    [AC_MSG_CHECKING(for isfinite with <math.h>)
1024181834Sroberto    _libs=$LIBS
1025181834Sroberto    LIBS="$LIBS -lm"
1026181834Sroberto    AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
1027181834Sroberto      [AC_MSG_RESULT(yes)
1028181834Sroberto      AC_DEFINE(HAVE_ISFINITE)],
1029181834Sroberto      AC_MSG_RESULT(no))
1030181834Sroberto    LIBS=$_libs])])
1031181834SrobertoAC_CHECK_FUNCS(getbootfile getclock getdtablesize)
1032181834Sroberto
1033181834SrobertoAC_ARG_ENABLE(getifaddrs,
1034181834Sroberto    AC_HELP_STRING([--enable-getifaddrs],
1035181834Sroberto	[s Enable the use of getifaddrs() [[yes|no|glibc]].
1036181834Srobertoglibc: Use getifaddrs() in glibc if you know it supports IPv6.]),
1037181834Sroberto    want_getifaddrs="$enableval",  want_getifaddrs="yes")
1038181834Sroberto
1039181834Srobertocase $want_getifaddrs in
1040181834Srobertoyes|glibc)
1041181834Sroberto#
1042181834Sroberto# Do we have getifaddrs() ?
1043181834Sroberto#
1044181834Srobertocase $host in
1045181834Sroberto*-linux*)
1046181834Sroberto	# Some recent versions of glibc support getifaddrs() which does not
1047181834Sroberto	# provide AF_INET6 addresses while the function provided by the USAGI
1048181834Sroberto	# project handles the AF_INET6 case correctly.  We need to avoid
1049181834Sroberto	# using the former but prefer the latter unless overridden by
1050181834Sroberto	# --enable-getifaddrs=glibc.
1051181834Sroberto	if test $want_getifaddrs = glibc
1052181834Sroberto	then
1053181834Sroberto		AC_CHECK_FUNCS(getifaddrs)
1054181834Sroberto	else
1055181834Sroberto		save_LIBS="$LIBS"
1056181834Sroberto		LIBS="-L/usr/local/v6/lib $LIBS"
1057181834Sroberto		AC_CHECK_LIB(inet6, getifaddrs,
1058181834Sroberto			LIBS="$LIBS -linet6"
1059181834Sroberto			AC_DEFINE(HAVE_GETIFADDRS),
1060181834Sroberto			LIBS=${save_LIBS})
1061181834Sroberto	fi
1062181834Sroberto	;;
1063181834Sroberto*)
1064181834Sroberto	AC_CHECK_FUNCS(getifaddrs)
1065181834Sroberto	;;
1066181834Srobertoesac
1067181834Sroberto;;
1068181834Srobertono)
1069181834Sroberto;;
1070181834Srobertoesac
1071181834Sroberto
1072181834SrobertoAC_MSG_CHECKING([type of socklen arg for getsockname()])
1073181834SrobertoAC_CACHE_VAL(ac_cv_func_getsockname_arg2,dnl
1074181834Sroberto[AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl
1075181834Sroberto [for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do
1076181834Sroberto  for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
1077181834Sroberto   AC_TRY_COMPILE(dnl
1078181834Sroberto[#ifdef HAVE_SYS_TYPES_H
1079181834Sroberto#include <sys/types.h>
1080181834Sroberto#endif
1081181834Sroberto#ifdef HAVE_SYS_SOCKET_H
1082181834Sroberto#include <sys/socket.h>
1083181834Sroberto#endif
1084181834Srobertoextern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl
1085181834Sroberto    [ac_not_found=no ; break 2], ac_not_found=yes)
1086181834Sroberto   done
1087181834Sroberto  done
1088181834Sroberto ])dnl AC_CACHE_VAL
1089181834Sroberto])dnl AC_CACHE_VAL
1090181834Srobertoif test "$ac_not_found" = yes; then
1091181834Sroberto ac_cv_func_getsockname_socklen_type='socklen_t'
1092181834Srobertofi
1093181834SrobertoAC_MSG_RESULT([$ac_cv_func_getsockname_socklen_type])
1094181834SrobertoAC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
1095181834Sroberto		   $ac_cv_func_getsockname_socklen_type,
1096181834Sroberto		   [What is getsockname()'s socklen type?])
1097181834Sroberto
1098181834SrobertoAC_CHECK_FUNCS(getrusage)
1099181834SrobertoAC_CHECK_FUNC(gettimeofday, ,[
1100181834Srobertocase "$host" in
1101181834Sroberto  *-*-mpeix*) ac_cv_func_gettimeofday=yes
1102181834Sroberto    ;;
1103181834Srobertoesac])
1104181834Srobertocase "$host" in
1105181834Sroberto *-pc-cygwin*)
1106181834Sroberto    ;;
1107181834Sroberto *) AC_CHECK_FUNCS(getuid)
1108181834Sroberto    ;;
1109181834Srobertoesac
1110181834SrobertoAC_CHECK_FUNCS(hstrerror)
1111181834Sroberto
1112181834Sroberto#
1113181834Sroberto# Check for if_nametoindex() for IPv6 scoped addresses support
1114181834Sroberto#
1115181834SrobertoAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1116181834Sroberto		ac_cv_have_if_nametoindex=no)
1117181834Srobertocase $ac_cv_have_if_nametoindex in
1118181834Sroberto no)
1119181834Sroberto	case "$host" in
1120181834Sroberto  	*-hp-hpux*)
1121181834Sroberto  		AC_CHECK_LIB(ipv6, if_nametoindex,
1122181834Sroberto				ac_cv_have_if_nametoindex=yes
1123181834Sroberto				LIBS="-lipv6 $LIBS",)
1124181834Sroberto  	;;
1125181834Sroberto	esac
1126181834Srobertoesac
1127181834Srobertocase $ac_cv_have_if_nametoindex in
1128181834Sroberto yes)
1129181834Sroberto	AC_DEFINE(ISC_PLATFORM_HAVEIFNAMETOINDEX, 1, [ISC: do we have if_nametoindex()?])
1130181834Sroberto	;;
1131181834Srobertoesac
1132181834Sroberto
1133181834SrobertoAC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
1134181834SrobertoAC_CHECK_FUNC(inet_pton, [], [AC_DEFINE(ISC_PLATFORM_NEEDPTON, 1, [ISC: provide inet_pton()])])
1135181834SrobertoAC_CHECK_FUNC(inet_aton, [], [AC_DEFINE(ISC_PLATFORM_NEEDATON, 1, [ISC: provide inet_aton()])])
1136181834SrobertoAC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
1137181834Srobertocase "$host" in
1138181834Sroberto *-*-sco3.2v5.0.*)
1139181834Sroberto    # Just stubs.  Idiots.
1140181834Sroberto    ;;
1141181834Sroberto *) AC_CHECK_FUNCS(mkstemp)
1142181834Sroberto    ;;
1143181834Srobertoesac
1144181834SrobertoAC_CHECK_FUNCS(mktime)
1145181834Srobertocase "$host" in
1146181834Sroberto *-*-aix[[45]]*)
1147181834Sroberto    # Just a stub.  Idiots.
1148181834Sroberto    ;;
1149181834Sroberto *-*-irix[[45]]*)
1150181834Sroberto    # Just a stub in "old" Irix.  Idiots.
1151181834Sroberto    ;;
1152181834Sroberto *-*-linux*)
1153181834Sroberto    # there, but more trouble than it is worth for now (resolver problems)
1154181834Sroberto    ;;
1155181834Sroberto *-*-qnx*)
1156181834Sroberto    # Apparently there but not working in QNX.  Idiots?
1157181834Sroberto    ;;
1158181834Sroberto *-*-sco3.2v5.0.*)
1159181834Sroberto    # Just a stub.  Idiots.
1160181834Sroberto    ;;
1161181834Sroberto alpha*-dec-osf4*|alpha*-dec-osf5*)
1162181834Sroberto    # mlockall is there, as a #define calling memlk via <sys/mman.h>
1163181834Sroberto    # Not easy to test for - cheat.
1164181834Sroberto    AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
1165181834Sroberto    AC_CHECK_FUNCS(mlockall)
1166181834Sroberto    ;;
1167181834Sroberto *) AC_CHECK_FUNCS(mlockall)
1168181834Sroberto    ;;
1169181834Srobertoesac
1170181834SrobertoAC_CHECK_FUNCS(nice nlist)
1171181834Srobertocase "$host" in
1172181834Sroberto *-*-solaris2.6)
1173181834Sroberto    # Broken...
1174181834Sroberto    ;;
1175181834Sroberto *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
1176181834Sroberto    ;;
1177181834Srobertoesac
1178181834SrobertoAC_CHECK_FUNCS(plock pututline pututxline readlink recvmsg rtprio)
1179181834Srobertocase "$host" in
1180181834Sroberto *-*-aix[[45]]*)
1181181834Sroberto    # Just a stub in AIX 4.  Idiots.
1182181834Sroberto    ;;
1183181834Sroberto *-*-solaris2.5*)
1184181834Sroberto    # Just stubs in solaris2.5.  Idiots.
1185181834Sroberto    ;;
1186181834Sroberto *) AC_CHECK_FUNCS(sched_setscheduler)
1187181834Sroberto    ;;
1188181834Srobertoesac
1189181834SrobertoAC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
1190181834SrobertoAC_CHECK_FUNCS(setrlimit)
1191181834SrobertoAC_CHECK_FUNCS(settimeofday, ,[
1192181834Srobertocase "$host" in
1193181834Sroberto  *-*-mpeix*) ac_cv_func_settimeofday=yes
1194181834Sroberto    ;;
1195181834Srobertoesac])
1196181834SrobertoAC_CHECK_FUNCS(setvbuf sigaction)
1197181834SrobertoAC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
1198181834SrobertoAC_CHECK_FUNCS(snprintf strdup strerror strstr)
1199181834SrobertoAC_CHECK_FUNCS(timegm)
1200181834Srobertocase "$host" in
1201181834Sroberto *-*-aix[[45]]*)
1202181834Sroberto    # Just stubs.  Idiots.
1203181834Sroberto    ;;
1204181834Sroberto *-*-netbsd1*)
1205181834Sroberto    # Just stubs.  Idiots.
1206181834Sroberto    ;;
1207181834Sroberto *-*-netbsdelf1*)
1208181834Sroberto    # Just stubs.  Idiots.
1209181834Sroberto    ;;
1210181834Sroberto *-*-openbsd*)
1211181834Sroberto    # Just stubs.  Idiots.
1212181834Sroberto    ;;
1213181834Sroberto *) AC_CHECK_FUNCS(timer_create timer_settime)
1214181834Sroberto    ;;
1215181834Srobertoesac
1216181834Srobertocase "$host" in
1217181834Sroberto *-pc-cygwin*)
1218181834Sroberto    # I have no idea...
1219181834Sroberto    ;;
1220181834Sroberto *) AC_CHECK_FUNCS(umask)
1221181834Sroberto    ;;
1222181834Srobertoesac
1223181834SrobertoAC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
1224181834Sroberto
1225181834Sroberto###
1226181834Sroberto
1227181834Sroberto# http://bugs.ntp.isc.org/737
1228181834Srobertocase "$ac_cv_func_recvmsg" in
1229181834Sroberto yes)
1230181834Sroberto AC_MSG_CHECKING([if we need extra help to define struct iovec])
1231181834Sroberto AC_CACHE_VAL(ac_cv_struct_iovec_help,dnl
1232181834Sroberto [for ac_cv_struct_iovec_help in '0' '1'; do
1233181834Sroberto   AC_TRY_COMPILE(dnl
1234181834Sroberto[#ifdef HAVE_SYS_TYPES_H
1235181834Sroberto#include <sys/types.h>
1236181834Sroberto#endif
1237181834Sroberto#ifdef HAVE_SYS_SOCKET_H
1238181834Sroberto#include <sys/socket.h>
1239181834Sroberto#endif
1240181834Sroberto#if $ac_cv_struct_iovec_help
1241181834Sroberto#include <sys/uio.h>
1242181834Sroberto#endif
1243181834Sroberto
1244181834Srobertovoid foo();
1245181834Srobertovoid foo() {
1246181834Sroberto	ssize_t x;
1247181834Sroberto	int s = 0;
1248181834Sroberto	struct iovec iov;
1249181834Sroberto	struct msghdr mh;
1250181834Sroberto	int flags = 0;
1251181834Sroberto
1252181834Sroberto	mh.msg_iov = &iov;
1253181834Sroberto	x = recvmsg(s, &mh, flags);
1254181834Sroberto}],,dnl
1255181834Sroberto  [ac_worked=yes ; break 1], ac_worked=no)
1256181834Sroberto  done
1257181834Sroberto])dnl AC_CACHE_VAL
1258181834Sroberto    case "$ac_worked$ac_cv_struct_iovec_help" in
1259181834Sroberto     yes1)
1260181834Sroberto	AC_DEFINE(HAVE_SYS_UIO_H, 1, [Use sys/uio.h for struct iovec help])
1261181834Sroberto	ans=yes
1262181834Sroberto	;;
1263181834Sroberto     *) ans=no
1264181834Sroberto    esac
1265181834Sroberto    AC_MSG_RESULT([$ans])
1266181834Sroberto    ;;
1267181834Srobertoesac
1268181834Sroberto
1269181834Srobertocase "$host" in
1270181834Sroberto *-*-sunos4*)
1271181834Sroberto    AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
1272181834Sroberto    ;;
1273181834Srobertoesac
1274181834Sroberto
1275181834SrobertoAC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
1276181834Sroberto[AC_TRY_COMPILE([#include <sys/time.h>],[
1277181834Srobertogettimeofday((struct timeval*)0,(struct timezone*)0);
1278181834Srobertosettimeofday((struct timeval*)0,(struct timezone*)0);
1279181834Sroberto],
1280181834Sroberto	ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
1281181834Sroberto])
1282181834Srobertoif test $ac_cv_func_Xettimeofday_nargs = 1; then
1283181834Sroberto	AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
1284181834Srobertofi
1285181834Sroberto
1286181834SrobertoAC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
1287181834Sroberto[AC_TRY_COMPILE([
1288181834Sroberto#ifdef HAVE_SYS_TYPES_H
1289181834Sroberto# include <sys/types.h>
1290181834Sroberto#endif
1291181834Sroberto#ifdef HAVE_UNISTD_H
1292181834Sroberto# include <unistd.h>
1293181834Sroberto#endif
1294181834Sroberto],[setpgrp(0,0);],
1295181834Sroberto        ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
1296181834Sroberto])
1297181834Srobertoif test $ac_cv_func_setpgrp_nargs = 0; then
1298181834Sroberto        AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
1299181834Srobertofi
1300181834Sroberto
1301181834Srobertosave_CFLAGS=$CFLAGS
1302181834SrobertoCFLAGS="$CFLAGS -I$srcdir/include"
1303181834Sroberto
1304181834SrobertoAC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
1305181834Srobertoac_cv_func_qsort_argtype,
1306181834Sroberto[AC_TRY_COMPILE([
1307181834Sroberto#include "l_stdlib.h"
1308181834Sroberto
1309181834Sroberto#ifdef HAVE_PROTOTYPES
1310181834Sroberto#define P(x) x
1311181834Sroberto#else
1312181834Sroberto#define P(x) ()
1313181834Sroberto#endif
1314181834Sroberto
1315181834Srobertoextern void *base;
1316181834Srobertoextern sortfunc P((const void *, const void *));
1317181834Srobertoint sortfunc(a, b)
1318181834Sroberto  const void *a;
1319181834Sroberto  const void *b; { return 0; }
1320181834Sroberto],[
1321181834Srobertoqsort(base, 2, sizeof(char *), sortfunc);
1322181834Sroberto],
1323181834Sroberto	ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
1324181834Sroberto])
1325181834Srobertocase "$ac_cv_func_qsort_argtype" in
1326181834Sroberto void)
1327181834Sroberto    AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
1328181834Sroberto    ;;
1329181834Srobertoesac
1330181834Sroberto
1331181834SrobertoCFLAGS=$save_CFLAGS
1332181834Sroberto
1333181834SrobertoAC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
1334181834Sroberto[AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
1335181834Sroberto#include <errno.h>
1336181834Sroberto#endif],
1337181834Sroberto  [errno = 0;],
1338181834Sroberto  ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
1339181834Srobertocase "$ac_cv_decl_errno" in
1340181834Sroberto yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
1341181834Srobertoesac
1342181834Sroberto
1343181834Srobertodnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
1344181834Srobertodnl the clash.  <resolv.h> isn't currently used.
1345181834Srobertodnl
1346181834Srobertodnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1347181834Srobertodnl MT purposes.  This makes the line "extern int h_errno" choke
1348181834Srobertodnl the compiler.  Hopefully adding !defined(h_errno) fixes this
1349181834Srobertodnl without breaking any other platforms.
1350181834Srobertodnl
1351181834SrobertoAC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
1352181834Sroberto[AC_TRY_COMPILE([#include <sys/types.h>
1353181834Sroberto#ifdef HAVE_NETINET_IN_H
1354181834Sroberto#include <netinet/in.h>
1355181834Sroberto#endif
1356181834Sroberto#ifdef HAVE_ARPA_NAMESER_H
1357181834Sroberto#include <arpa/nameser.h>
1358181834Sroberto#endif
1359181834Sroberto#ifdef HAVE_NETDB_H
1360181834Sroberto#include <netdb.h>
1361181834Sroberto#endif
1362181834Sroberto#ifdef HAVE_RESOLV_H
1363181834Sroberto#include <resolv.h>
1364181834Sroberto#endif],
1365181834Sroberto  [extern int h_errno;],
1366181834Sroberto  ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
1367181834Srobertocase "$ac_cv_decl_h_errno" in
1368181834Sroberto yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
1369181834Srobertoesac
1370181834Sroberto
1371181834Srobertodnl See if char *sys_errlist[] is OK.
1372181834SrobertoAC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
1373181834Sroberto[AC_TRY_COMPILE([#include <stdio.h>
1374181834Sroberto#ifdef HAVE_ERRNO_H
1375181834Sroberto#include <errno.h>
1376181834Sroberto#endif],
1377181834Sroberto  [extern char *sys_errlist[];
1378181834Sroberto],
1379181834Sroberto  ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
1380181834Srobertocase "$ac_cv_decl_sys_errlist" in
1381181834Sroberto yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
1382181834Srobertoesac
1383181834Sroberto
1384181834SrobertoAC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
1385181834Sroberto[AC_TRY_COMPILE([
1386181834Sroberto#ifdef HAVE_SYS_TYPES_H
1387181834Sroberto# include <sys/types.h>
1388181834Sroberto#endif
1389181834Sroberto#ifdef HAVE_UNISTD_H
1390181834Sroberto# include <unistd.h>
1391181834Sroberto#endif
1392181834Sroberto#ifdef HAVE_PROTOTYPES
1393181834Sroberto#define P(x) x
1394181834Sroberto#else
1395181834Sroberto#define P(x) ()
1396181834Sroberto#endif
1397181834Sroberto],
1398181834Sroberto  [extern int syscall P((int, ...));],
1399181834Sroberto  ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
1400181834Srobertocase "$ac_cv_decl_syscall" in
1401181834Sroberto yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
1402181834Srobertoesac
1403181834Sroberto
1404181834Srobertocase "$host" in
1405181834Sroberto *-*-aix4.3.*)
1406181834Sroberto    AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style])		# Needed for XLC under AIX 4.3.2
1407181834Sroberto    ;;
1408181834Sroberto *-*-mpeix*)
1409181834Sroberto    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1410181834Sroberto    AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
1411181834Sroberto    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1412181834Sroberto    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1413181834Sroberto    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1414181834Sroberto    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1415181834Sroberto    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1416181834Sroberto    ;;
1417181834Sroberto *-*-osf[[45]]*)
1418181834Sroberto    AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1419181834Sroberto    AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
1420181834Sroberto    ;;
1421181834Sroberto *-*-qnx*)
1422181834Sroberto    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1423181834Sroberto    ;;
1424181834Sroberto *-*-riscos4*)
1425181834Sroberto    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1426181834Sroberto    AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1427181834Sroberto    AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1428181834Sroberto    AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1429181834Sroberto    AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1430181834Sroberto    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1431181834Sroberto    AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1432181834Sroberto    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1433181834Sroberto    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1434181834Sroberto    AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1435181834Sroberto    AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1436181834Sroberto    AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1437181834Sroberto    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1438181834Sroberto    AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1439181834Sroberto    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1440181834Sroberto    AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1441181834Sroberto    ;;
1442181834Sroberto *-*-solaris2*)
1443181834Sroberto    AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1444181834Sroberto    AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
1445181834Sroberto    case "$host" in
1446181834Sroberto     *-*-solaris2.4)
1447181834Sroberto        AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1448181834Sroberto	;;
1449181834Sroberto    esac
1450181834Sroberto    ;;
1451181834Sroberto *-*-sunos4*)
1452181834Sroberto    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1453181834Sroberto    AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
1454181834Sroberto    AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1455181834Sroberto    AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1456181834Sroberto    AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1457181834Sroberto    AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1458181834Sroberto    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1459181834Sroberto    AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1460181834Sroberto    AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1461181834Sroberto    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1462181834Sroberto    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1463181834Sroberto    AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1464181834Sroberto    AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
1465181834Sroberto    case "`basename $ac_cv_prog_CC`" in
1466181834Sroberto     acc*) ;;
1467181834Sroberto     *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1468181834Sroberto	;;
1469181834Sroberto    esac
1470181834Sroberto    AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1471181834Sroberto    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1472181834Sroberto    AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1473181834Sroberto    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1474181834Sroberto    AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1475181834Sroberto    AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
1476181834Sroberto    AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
1477181834Sroberto    ;;
1478181834Sroberto *-*-ultrix4*)
1479181834Sroberto    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1480181834Sroberto    AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1481181834Sroberto    AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
1482181834Sroberto    AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1483181834Sroberto    AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1484181834Sroberto    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1485181834Sroberto    AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
1486181834Sroberto    AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1487181834Sroberto    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1488181834Sroberto    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1489181834Sroberto    AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1490181834Sroberto    AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
1491181834Sroberto    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1492181834Sroberto    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1493181834Sroberto    ;;
1494181834Srobertoesac
1495181834Sroberto
1496181834Srobertocase "$host" in
1497181834Sroberto *-*-sco3.2*)
1498181834Sroberto    AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
1499181834Sroberto    ;;
1500181834Srobertoesac
1501181834Sroberto
1502181834SrobertoAC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
1503181834Sroberto[ans=no
1504181834Srobertocase "$host" in
1505181834Sroberto *-*-hpux[[567]]*)
1506181834Sroberto    ans=yes
1507181834Sroberto    ;;
1508181834Srobertoesac
1509181834Srobertoac_cv_var_rcvbuf_slop=$ans])
1510181834Srobertocase "$ac_cv_var_rcvbuf_slop" in
1511181834Sroberto yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
1512181834Srobertoesac
1513181834Sroberto
1514181834SrobertoAC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
1515181834Sroberto[ans=yes
1516181834Srobertocase "$host" in
1517181834Sroberto *-*-domainos)
1518181834Sroberto    ans=no
1519181834Sroberto    ;;
1520181834Srobertoesac
1521181834Srobertoac_cv_var_open_bcast_socket=$ans])
1522181834Srobertocase "$ac_cv_var_open_bcast_socket" in
1523181834Sroberto yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
1524181834Srobertoesac
1525181834Sroberto
1526181834SrobertoAC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
1527181834Sroberto[ans=no
1528181834Srobertocase "$host" in
1529181834Sroberto *-*-hpux*)
1530181834Sroberto    ans=yes
1531181834Sroberto    ;;
1532181834Srobertoesac
1533181834Srobertoac_cv_var_hpux_findconfig=$ans])
1534181834Srobertocase "$ac_cv_var_hpux_findconfig" in
1535181834Sroberto yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
1536181834Srobertoesac
1537181834Sroberto
1538181834SrobertoAC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
1539181834Sroberto[case "$host" in
1540181834Sroberto *-*-hpux[[567]]*)
1541181834Sroberto    ans=no
1542181834Sroberto    ;;
1543181834Sroberto *-*-hpux*)
1544181834Sroberto    ans=yes
1545181834Sroberto    ;;
1546181834Sroberto *-*-linux*)
1547181834Sroberto    ans=yes
1548181834Sroberto    ;;
1549181834Sroberto *-*-sunos3*)
1550181834Sroberto    ans=yes
1551181834Sroberto    ;;
1552181834Sroberto *-*-ultrix2*)
1553181834Sroberto    ans=yes
1554181834Sroberto    ;;
1555181834Sroberto *)
1556181834Sroberto    ans=no
1557181834Sroberto    ;;
1558181834Srobertoesac
1559181834Srobertoac_cv_arg_setpgrp_negpid=$ans])
1560181834Srobertocase "$ac_cv_arg_setpgrp_negpid" in
1561181834Sroberto yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
1562181834Srobertoesac
1563181834Sroberto
1564181834SrobertoAC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
1565181834Sroberto[[case "$host" in
1566181834Sroberto *-*-bsdi[23]*)
1567181834Sroberto    ans=yes
1568181834Sroberto    ;;
1569181834Sroberto *-*-freebsd*)
1570181834Sroberto    ans=yes
1571181834Sroberto    ;;
1572181834Sroberto *-*-netbsd*3.[0-8]*|*-*-netbsd*[0-2].*|*-*-netbsd*3.99.[0-7])
1573181834Sroberto    ans=yes
1574181834Sroberto    ;;
1575181834Sroberto *-*-openbsd*)
1576181834Sroberto    ans=yes
1577181834Sroberto    ;;
1578181834Sroberto *-*-osf*)
1579181834Sroberto    ans=yes
1580181834Sroberto    ;;
1581181834Sroberto *) ans=no
1582181834Sroberto    ;;
1583181834Srobertoesac
1584181834Srobertoac_cv_func_ctty_for_f_setown=$ans]])
1585181834Srobertocase "$ac_cv_func_ctty_for_f_setown" in
1586181834Sroberto yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
1587181834Srobertoesac
1588181834Sroberto
1589181834SrobertoAC_CACHE_CHECK(if the OS misses to clear cached routes when more specific routes become available, ac_cv_os_routeupdates,
1590181834Sroberto[[case "$host" in
1591181834Sroberto *-*-netbsd*)
1592181834Sroberto    ans=yes
1593181834Sroberto    ;;
1594181834Sroberto *) ans=no
1595181834Sroberto    ;;
1596181834Srobertoesac
1597181834Srobertoac_cv_os_routeupdates=$ans]])
1598181834Srobertocase "$ac_cv_os_routeupdates" in
1599181834Sroberto yes) AC_DEFINE(OS_MISSES_SPECIFIC_ROUTE_UPDATES, 1, [need to recreate sockets on changed routing?]) ;;
1600181834Srobertoesac
1601181834Sroberto
1602181834SrobertoAC_CACHE_CHECK(if the OS needs the wildcard socket set to REUSEADDR for binding interface addresses, ac_cv_os_wildcardreuse,
1603181834Sroberto[[case "$host" in
1604181834Sroberto *-*-linux*)
1605181834Sroberto    ans=yes
1606181834Sroberto    ;;
1607181834Sroberto *) ans=no
1608181834Sroberto    ;;
1609181834Srobertoesac
1610181834Srobertoac_cv_os_wildcardreuse=$ans]])
1611181834Srobertocase "$ac_cv_os_wildcardreuse" in
1612181834Sroberto yes) AC_DEFINE(OS_NEEDS_REUSEADDR_FOR_IFADDRBIND, 1, [wildcard socket needs to set REUSEADDR when binding to interface addresses]) ;;
1613181834Srobertoesac
1614181834Sroberto
1615181834Srobertontp_warning='GRONK'
1616181834SrobertoAC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
1617181834Srobertocase "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1618181834Sroberto yes*)
1619181834Sroberto    ntp_warning=''
1620181834Sroberto    ans='clock_settime()'
1621181834Sroberto    ;;
1622181834Sroberto noyes*)
1623181834Sroberto    ntp_warning='But clock_settime() would be better (if we had it)'
1624181834Sroberto    ans='settimeofday()'
1625181834Sroberto    ;;
1626181834Sroberto nonoyes)
1627181834Sroberto    ntp_warning='Which is the worst of the three'
1628181834Sroberto    ans='stime()'
1629181834Sroberto    ;;
1630181834Sroberto *) 
1631181834Sroberto    case "$build" in
1632181834Sroberto     $host) ntp_warning='Which leaves us with nothing to use!'
1633181834Sroberto    ans=none
1634181834Sroberto    ;;
1635181834Srobertoesac
1636181834Srobertoesac
1637181834SrobertoAC_MSG_RESULT($ans)
1638181834Srobertocase "$ntp_warning" in
1639181834Sroberto '') ;;
1640181834Sroberto *) AC_MSG_WARN(*** $ntp_warning ***)
1641181834Sroberto    ;;
1642181834Srobertoesac
1643181834Sroberto
1644181834SrobertoAC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1645181834Sroberto[case "$host" in
1646181834Sroberto *-*-solaris2.4*)
1647181834Sroberto    ans=yes
1648181834Sroberto    ;;
1649181834Sroberto *) ans=no
1650181834Sroberto    ;;
1651181834Srobertoesac
1652181834Srobertoac_cv_var_syscall_bug=$ans])
1653181834Srobertocase "$ac_cv_var_syscall_bug" in
1654181834Sroberto yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1655181834Srobertoesac
1656181834Sroberto
1657181834SrobertoAC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1658181834Sroberto AC_EGREP_CPP(yes,
1659181834Sroberto  [#include <signal.h>
1660181834Sroberto#ifdef SIGIO
1661181834Sroberto   yes
1662181834Sroberto#endif
1663181834Sroberto  ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1664181834Sroberto
1665181834Srobertodnl Override those system that have a losing SIGIO
1666181834SrobertoAC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1667181834Sroberto[ans=no
1668181834Srobertocase "$ac_cv_hdr_def_sigio" in
1669181834Sroberto yes)
1670181834Sroberto    ans=yes
1671181834Sroberto    case "$host" in
1672181834Sroberto     alpha*-dec-osf4*|alpha*-dec-osf5*)
1673181834Sroberto        ans=no
1674181834Sroberto        ;;
1675181834Sroberto     *-convex-*)
1676181834Sroberto        ans=no
1677181834Sroberto        ;;
1678181834Sroberto     *-dec-*)
1679181834Sroberto        ans=no
1680181834Sroberto        ;;
1681181834Sroberto     *-pc-cygwin*)
1682181834Sroberto	ans=no
1683181834Sroberto	;;
1684181834Sroberto     *-sni-sysv*)
1685181834Sroberto        ans=no
1686181834Sroberto        ;;
1687181834Sroberto     *-univel-sysv*)
1688181834Sroberto        ans=no
1689181834Sroberto	;;
1690181834Sroberto     *-*-irix6*)
1691181834Sroberto	ans=no
1692181834Sroberto	;;
1693181834Sroberto     *-*-freebsd*)
1694181834Sroberto	ans=no
1695181834Sroberto	;;
1696181834Sroberto     *-*-linux*)
1697181834Sroberto	ans=no
1698181834Sroberto	;;
1699181834Sroberto     *-*-unicosmp*)
1700181834Sroberto	ans=no
1701181834Sroberto	;;
1702181834Sroberto    esac
1703181834Sroberto    ;;
1704181834Srobertoesac
1705181834Srobertoac_cv_var_signalled_io=$ans])
1706181834Srobertocase "$ac_cv_var_signalled_io" in
1707181834Sroberto yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1708181834Srobertoesac
1709181834Sroberto
1710181834SrobertoAC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1711181834Sroberto AC_EGREP_CPP(yes,
1712181834Sroberto [#include <signal.h>
1713181834Sroberto#ifdef SIGPOLL
1714181834Sroberto  yes
1715181834Sroberto#endif
1716181834Sroberto ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1717181834Sroberto
1718181834SrobertoAC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1719181834Sroberto AC_EGREP_CPP(yes,
1720181834Sroberto [#include <signal.h>
1721181834Sroberto#ifdef SIGSYS
1722181834Sroberto  yes
1723181834Sroberto#endif
1724181834Sroberto ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1725181834Sroberto
1726181834SrobertoAC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1727181834Sroberto[ans=no
1728181834Srobertocase "$ac_cv_hdr_def_sigpoll" in
1729181834Sroberto yes)
1730181834Sroberto    case "$host" in
1731181834Sroberto     mips-sgi-irix*)
1732181834Sroberto	ans=no
1733181834Sroberto	;;
1734181834Sroberto     vax-dec-bsd)
1735181834Sroberto        ans=no
1736181834Sroberto        ;;
1737181834Sroberto     *-pc-cygwin*)
1738181834Sroberto	ans=no
1739181834Sroberto	;;
1740181834Sroberto     *-sni-sysv*)
1741181834Sroberto        ans=no
1742181834Sroberto        ;;
1743181834Sroberto     *-*-aix[[45]]*)
1744181834Sroberto        ans=no
1745181834Sroberto        ;;
1746181834Sroberto     *-*-hpux*)
1747181834Sroberto        ans=no
1748181834Sroberto        ;;
1749181834Sroberto     *-*-linux*)
1750181834Sroberto	ans=no
1751181834Sroberto	;;
1752181834Sroberto     *-*-osf*)
1753181834Sroberto        ans=no
1754181834Sroberto        ;;
1755181834Sroberto     *-*-qnx*)
1756181834Sroberto        ans=no
1757181834Sroberto        ;;
1758181834Sroberto     *-*-sunos*)
1759181834Sroberto	ans=no
1760181834Sroberto	;;
1761181834Sroberto     *-*-ultrix*)
1762181834Sroberto        ans=no
1763181834Sroberto        ;;
1764181834Sroberto     *-*-unicosmp*)
1765181834Sroberto        ans=no
1766181834Sroberto        ;;
1767181834Sroberto     *) ans=yes
1768181834Sroberto        ;;
1769181834Sroberto    esac
1770181834Sroberto    ;;
1771181834Srobertoesac
1772181834Srobertoac_cv_var_use_udp_sigpoll=$ans])
1773181834Srobertocase "$ac_cv_var_use_udp_sigpoll" in
1774181834Sroberto yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1775181834Srobertoesac
1776181834Sroberto
1777181834SrobertoAC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1778181834Sroberto[ans=no
1779181834Srobertocase "$ac_cv_hdr_def_sigpoll" in
1780181834Sroberto yes)
1781181834Sroberto    case "$host" in
1782181834Sroberto     mips-sgi-irix*)
1783181834Sroberto        ans=no
1784181834Sroberto        ;;
1785181834Sroberto     vax-dec-bsd)
1786181834Sroberto        ans=no
1787181834Sroberto        ;;
1788181834Sroberto     *-pc-cygwin*)
1789181834Sroberto	ans=no
1790181834Sroberto	;;
1791181834Sroberto     *-sni-sysv*)
1792181834Sroberto        ans=no
1793181834Sroberto        ;;
1794181834Sroberto     *-*-aix[[45]]*)
1795181834Sroberto	ans=no
1796181834Sroberto	;;
1797181834Sroberto     *-*-hpux*)
1798181834Sroberto        ans=no
1799181834Sroberto        ;;
1800181834Sroberto     *-*-linux*)
1801181834Sroberto	ans=no
1802181834Sroberto	;;
1803181834Sroberto     *-*-osf*)
1804181834Sroberto        ans=no
1805181834Sroberto        ;;
1806181834Sroberto     *-*-sunos*)
1807181834Sroberto	ans=no
1808181834Sroberto	;;
1809181834Sroberto     *-*-ultrix*)
1810181834Sroberto        ans=no
1811181834Sroberto        ;;
1812181834Sroberto     *-*-qnx*)
1813181834Sroberto        ans=no
1814181834Sroberto        ;;
1815181834Sroberto     *-*-unicosmp*)
1816181834Sroberto        ans=no
1817181834Sroberto        ;;
1818181834Sroberto     *) ans=yes
1819181834Sroberto        ;;
1820181834Sroberto    esac
1821181834Sroberto    ;;
1822181834Srobertoesac
1823181834Srobertoac_cv_var_use_tty_sigpoll=$ans])
1824181834Srobertocase "$ac_cv_var_use_tty_sigpoll" in
1825181834Sroberto yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
1826181834Srobertoesac
1827181834Sroberto
1828181834Srobertocase "$ac_cv_header_sys_sio_h" in
1829181834Sroberto yes)
1830181834Sroberto    AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1831181834Sroberto     AC_EGREP_CPP(yes,
1832181834Sroberto[#include <sys/sio.h>
1833181834Sroberto#ifdef TIOCDCDTIMESTAMP
1834181834Sroberto  yes
1835181834Sroberto#endif
1836181834Sroberto     ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1837181834Sroberto    ;;
1838181834Srobertoesac
1839181834Sroberto
1840181834Srobertocase "$ac_cv_hdr_def_tiocdcdtimestamp" in
1841181834Sroberto yes)
1842181834Sroberto    ac_cv_var_oncore_ok=yes
1843181834Sroberto    ;;
1844181834Srobertoesac
1845181834Sroberto
1846181834SrobertoAC_CACHE_CHECK(if nlist() values might require extra indirection,
1847181834Srobertoac_cv_var_nlist_extra_indirection,
1848181834Sroberto[ans=no
1849181834Srobertocase "$host" in
1850181834Sroberto *-*-aix*)
1851181834Sroberto    ans=yes
1852181834Sroberto    ;;
1853181834Srobertoesac
1854181834Srobertoac_cv_var_nlist_extra_indirection=$ans])
1855181834Srobertocase "$ac_cv_var_nlist_extra_indirection" in
1856181834Sroberto yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
1857181834Srobertoesac
1858181834Sroberto
1859181834SrobertoAC_CACHE_CHECK(for a minimum recommended value of tickadj,
1860181834Srobertoac_cv_var_min_rec_tickadj,
1861181834Sroberto[ans=no
1862181834Srobertocase "$host" in
1863181834Sroberto *-*-aix*)
1864181834Sroberto    ans=40
1865181834Sroberto    ;;
1866181834Srobertoesac
1867181834Srobertoac_cv_var_min_rec_tickadj=$ans])
1868181834Srobertocase "$ac_cv_var_min_rec_tickadj" in
1869181834Sroberto ''|no) ;;
1870181834Sroberto *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
1871181834Srobertoesac
1872181834Sroberto
1873181834SrobertoAC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1874181834Srobertoac_cv_var_no_parenb_ignpar,
1875181834Sroberto[ans=no
1876181834Srobertocase "$host" in
1877181834Sroberto i?86-*-linux*)
1878181834Sroberto    ans=yes
1879181834Sroberto    ;;
1880181834Sroberto mips-sgi-irix*)
1881181834Sroberto    ans=yes
1882181834Sroberto    ;;
1883181834Sroberto i?86-*-freebsd[[123]].*)
1884181834Sroberto    ;;
1885181834Sroberto i?86-*-freebsd*)
1886181834Sroberto    ans=yes
1887181834Sroberto    ;;
1888181834Sroberto *-*-unicosmp*)
1889181834Sroberto    ans=yes
1890181834Sroberto    ;;
1891181834Srobertoesac
1892181834Srobertoac_cv_var_no_parenb_ignpar=$ans])
1893181834Srobertocase "$ac_cv_var_no_parenb_ignpar" in
1894181834Sroberto yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
1895181834Srobertoesac
1896181834Sroberto
1897181834SrobertoAC_MSG_CHECKING(if we're including debugging code)
1898181834SrobertoAC_ARG_ENABLE(debugging,
1899181834Sroberto   AC_HELP_STRING([--enable-debugging], [+ include debugging code]),
1900181834Sroberto    [ntp_ok=$enableval], [ntp_ok=yes])
1901181834Srobertoif test "$ntp_ok" = "yes"; then
1902181834Sroberto    AC_DEFINE(DEBUG, 1, [Enable debugging?])
1903181834Srobertofi
1904181834SrobertoAC_MSG_RESULT($ntp_ok)
1905181834Sroberto
1906181834SrobertoAC_MSG_CHECKING(if we including processing time debugging code)
1907181834SrobertoAC_ARG_ENABLE(debug-timing,
1908181834Sroberto   AC_HELP_STRING([--enable-debug-timing], [- include processing time debugging code (costs performance)]),
1909181834Sroberto    [ntp_ok=$enableval], [ntp_ok=no])
1910181834Srobertoif test "$ntp_ok" = "yes"; then
1911181834Sroberto    AC_DEFINE(DEBUG_TIMING, 1, [Enable processing time debugging?])
1912181834Srobertofi
1913181834SrobertoAC_MSG_RESULT($ntp_ok)
1914181834Sroberto
1915181834SrobertoAC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1916181834SrobertoAC_ARG_ENABLE(dst_minutes,
1917181834Sroberto   AC_HELP_STRING([--enable-dst-minutes=60], [+ minutes per DST adjustment]),
1918181834Sroberto    [ans=$enableval], [ans=60])
1919181834SrobertoAC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
1920181834SrobertoAC_MSG_RESULT($ans)
1921181834Sroberto
1922181834SrobertoAC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1923181834Sroberto ac_cv_var_tty_clk,
1924181834Sroberto [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1925181834Sroberto  *yes*) ac_cv_var_tty_clk=yes ;;
1926181834Sroberto esac])
1927181834Srobertocase "$ac_cv_var_tty_clk" in
1928181834Sroberto yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
1929181834Srobertoesac
1930181834Sroberto
1931181834SrobertoAC_CACHE_CHECK(for the ppsclock streams module,
1932181834Sroberto ac_cv_var_ppsclock,
1933181834Sroberto ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1934181834Srobertocase "$ac_cv_var_ppsclock" in
1935181834Sroberto yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
1936181834Srobertoesac
1937181834Sroberto
1938181834SrobertoAC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1939181834Sroberto  [ac_cv_var_mcast=no
1940181834Sroberto  case "$host" in
1941181834Sroberto   i386-sequent-sysv4) ;;
1942181834Sroberto   *) AC_EGREP_CPP(yes,
1943181834Sroberto  [#include <netinet/in.h>
1944181834Sroberto#ifdef IP_ADD_MEMBERSHIP
1945181834Sroberto   yes
1946181834Sroberto#endif
1947181834Sroberto  ], ac_cv_var_mcast=yes) ;;
1948181834Sroberto  esac])
1949181834Srobertocase "$ac_cv_var_mcast" in
1950181834Sroberto yes)
1951181834Sroberto    AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?])
1952181834Sroberto    AC_CACHE_CHECK([[arg type needed for IP*_MULTICAST_LOOP for setsockopt()]],
1953181834Sroberto	ac_cv_var_typeof_ip_multicast_loop,
1954181834Sroberto	[case "$host" in
1955181834Sroberto	 *-*-netbsd*|*-*-linux*)
1956181834Sroberto	    ac_cv_var_typeof_ip_multicast_loop=u_int
1957181834Sroberto	    ;;
1958181834Sroberto	 *-*-winnt*)
1959181834Sroberto	    ac_cv_var_typeof_ip_multicast_loop=BOOL
1960181834Sroberto	    ;;
1961181834Sroberto	 *) ac_cv_var_typeof_ip_multicast_loop=u_char
1962181834Sroberto	    ;;
1963181834Sroberto	esac])
1964181834Sroberto    AC_DEFINE_UNQUOTED(TYPEOF_IP_MULTICAST_LOOP,
1965181834Sroberto		   $ac_cv_var_typeof_ip_multicast_loop,
1966181834Sroberto		   [What type to use for setsockopt])
1967181834Sroberto    ;;
1968181834Srobertoesac
1969181834Sroberto
1970181834SrobertoAC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1971181834Sroberto [ac_cv_var_ntp_syscalls=no
1972181834Sroberto case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1973181834Sroberto  yesyes*)
1974181834Sroberto    ac_cv_var_ntp_syscalls=libc
1975181834Sroberto    ;;
1976181834Sroberto  *yes)
1977181834Sroberto    ac_cv_var_ntp_syscalls=inline
1978181834Sroberto    ;;
1979181834Sroberto  *) AC_EGREP_CPP(yes,
1980181834Sroberto         [#include <sys/syscall.h>
1981181834Sroberto#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1982181834Sroberto           yes
1983181834Sroberto#endif
1984181834Sroberto          ], ac_cv_var_ntp_syscalls=kernel)
1985181834Sroberto    ;;
1986181834Sroberto esac])
1987181834Srobertocase "$ac_cv_var_ntp_syscalls" in
1988181834Sroberto libc)
1989181834Sroberto    AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
1990181834Sroberto    ;;
1991181834Sroberto kernel)
1992181834Sroberto    AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
1993181834Sroberto    ;;
1994181834Sroberto *)
1995181834Sroberto    ;;
1996181834Srobertoesac
1997181834Sroberto
1998181834SrobertoAC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1999181834Sroberto[AC_EGREP_CPP(yes,
2000181834Sroberto    [#include <sys/timex.h>
2001181834Sroberto#ifdef STA_FLL
2002181834Sroberto    yes
2003181834Sroberto#endif
2004181834Sroberto    ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
2005181834Sroberto
2006181834SrobertoAC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
2007181834Sroberto[dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
2008181834Srobertocase "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
2009181834Sroberto *no*)
2010181834Sroberto    ac_cv_var_kernel_pll=no
2011181834Sroberto    ;;
2012181834Sroberto *) ac_cv_var_kernel_pll=yes
2013181834Sroberto    ;;
2014181834Srobertoesac])
2015181834Srobertocase "$ac_cv_var_kernel_pll" in
2016181834Sroberto yes)
2017181834Sroberto    AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
2018181834Sroberto    ;;
2019181834Srobertoesac
2020181834Sroberto
2021181834SrobertoAC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
2022181834Sroberto  [ans=no
2023181834Sroberto  case "$host" in
2024181834Sroberto   *-fujitsu-uxp*)
2025181834Sroberto      ans=yes
2026181834Sroberto      ;;
2027181834Sroberto   *-ncr-sysv4*)
2028181834Sroberto      ans=yes
2029181834Sroberto      ;;
2030181834Sroberto   *-univel-sysv*)
2031181834Sroberto      ans=yes
2032181834Sroberto      ;;
2033181834Sroberto  esac
2034181834Sroberto  ac_cv_var_size_returned_in_buffer=$ans])
2035181834Srobertocase "$ac_cv_var_size_returned_in_buffer" in
2036181834Sroberto yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
2037181834Srobertoesac
2038181834Sroberto
2039181834Srobertodnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
2040181834Srobertodnl [AC_ARG_ENABLE(gdt-surveying,	[  --enable-gdt-surveying   - include GDT survey code],
2041181834Srobertodnl     [ans=$enableval], [ans=no])
2042181834Srobertodnl ac_cv_var_gdt_surveying=$ans])
2043181834Srobertodnl case "$ac_cv_var_gdt_surveying" in
2044181834Srobertodnl  yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
2045181834Srobertodnl esac
2046181834Sroberto
2047181834Sroberto# Check for ioctls TIOCGPPSEV
2048181834SrobertoAC_MSG_CHECKING(ioctl TIOCGPPSEV)
2049181834Srobertoif test "$ac_cv_header_termios_h" = "yes"; then
2050181834Sroberto    AC_EGREP_CPP(yes,
2051181834Sroberto    [#include <termios.h>
2052181834Sroberto#ifdef TIOCGPPSEV
2053181834Sroberto         yes
2054181834Sroberto#endif
2055181834Sroberto	 ], ntp_ok=yes, ntp_ok=no)
2056181834Srobertoelse
2057181834Srobertontp_ok=no
2058181834Srobertofi
2059181834Srobertoif test "$ntp_ok" = "yes"; then
2060181834Sroberto    AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
2061181834Sroberto    ac_cv_var_oncore_ok=yes
2062181834Srobertofi
2063181834SrobertoAC_MSG_RESULT($ntp_ok)
2064181834Sroberto
2065181834Sroberto# Check for ioctls TIOCSPPS
2066181834SrobertoAC_MSG_CHECKING(ioctl TIOCSPPS)
2067181834Srobertoif test "$ac_cv_header_termios_h" = "yes"; then
2068181834Sroberto    AC_EGREP_CPP(yes,
2069181834Sroberto    [#include <termios.h>
2070181834Sroberto#ifdef TIOCSPPS
2071181834Sroberto         yes
2072181834Sroberto#endif
2073181834Sroberto	 ], ntp_ok=yes, ntp_ok=no)
2074181834Srobertoelse
2075181834Sroberto    ntp_ok=no
2076181834Srobertofi
2077181834Sroberto
2078181834Srobertoif test "$ntp_ok" = "yes"; then
2079181834Sroberto    AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
2080181834Srobertofi
2081181834SrobertoAC_MSG_RESULT($ntp_ok)
2082181834Sroberto
2083181834Sroberto# Check for ioctls CIOGETEV
2084181834SrobertoAC_MSG_CHECKING(ioctl CIOGETEV)
2085181834Srobertoif test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
2086181834Sroberto    AC_EGREP_CPP(yes,
2087181834Sroberto    [#include <sys/ppsclock.h>
2088181834Sroberto#ifdef CIOGETEV
2089181834Sroberto         yes
2090181834Sroberto#endif
2091181834Sroberto	 ], ntp_ok=yes, ntp_ok=no)
2092181834Srobertoelse
2093181834Srobertontp_ok=no
2094181834Srobertofi
2095181834Srobertoif test "$ntp_ok" = "yes"; then
2096181834Sroberto    ac_cv_var_oncore_ok=yes
2097181834Sroberto    AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
2098181834Srobertofi
2099181834SrobertoAC_MSG_RESULT($ntp_ok)
2100181834Sroberto
2101181834Sroberto
2102181834Sroberto# ATOM/PPSAPI stuff.
2103181834Sroberto
2104181834Sroberto# ATOM used to require struct timespec, but that's been fixed now.
2105181834Sroberto
2106181834Sroberto# case "$ac_cv_struct_timespec" in
2107181834Sroberto#  'yes')
2108181834Sroberto#     ac_cv_var_atom_ok=yes
2109181834Sroberto#     ;;
2110181834Sroberto# esac
2111181834Srobertoac_cv_var_atom_ok=yes
2112181834Sroberto
2113181834Sroberto# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
2114181834Sroberto
2115181834Sroberto# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
2116181834Sroberto
2117181834Sroberto# The PPSAPI needs struct timespec.
2118181834Sroberto
2119181834Sroberto# The PPSAPI also needs a timepps header.
2120181834Sroberto
2121181834Srobertocase "$ac_cv_c_inline$ac_cv_struct_timespec" in
2122181834Sroberto inlineyes)
2123181834Sroberto    case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
2124181834Sroberto     *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
2125181834Sroberto	AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
2126181834Sroberto	ac_cv_var_jupiter_ok=yes
2127181834Sroberto	ac_cv_var_oncore_ok=yes
2128181834Sroberto	ac_cv_var_parse_ok=yes
2129181834Sroberto	ac_cv_var_ripe_ncc_ok=yes
2130181834Sroberto	;;
2131181834Sroberto    esac
2132181834Sroberto    ;;
2133181834Srobertoesac
2134181834Sroberto
2135181834Sroberto# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
2136181834SrobertoAC_CHECK_HEADER(linux/serial.h)
2137181834SrobertoAC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
2138181834Srobertocase "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
2139181834Sroberto  yesyes)
2140181834Sroberto    AC_EGREP_CPP(yes,
2141181834Sroberto    [#include <sys/time.h>
2142181834Srobertotypedef int u_int;
2143181834Sroberto
2144181834Sroberto#include <sys/ppsclock.h>
2145181834Sroberto#include <linux/serial.h>
2146181834Sroberto
2147181834Sroberto#ifdef TIOCGSERIAL
2148181834Sroberto#ifdef TIOCSSERIAL
2149181834Sroberto#ifdef ASYNC_PPS_CD_POS
2150181834Sroberto#ifdef ASYNC_PPS_CD_NEG
2151181834Sroberto#ifdef CIOGETEV
2152181834Sroberto         yes
2153181834Sroberto#endif
2154181834Sroberto#endif
2155181834Sroberto#endif
2156181834Sroberto#endif
2157181834Sroberto#endif
2158181834Sroberto	 ], ntp_ok=yes)
2159181834Sroberto	;;
2160181834Sroberto  *)
2161181834Sroberto	ntp_ok=no
2162181834Sroberto	;;
2163181834Srobertoesac
2164181834Srobertoif test "$ntp_ok" = "yes"; then
2165181834Sroberto    AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
2166181834Srobertofi
2167181834SrobertoAC_MSG_RESULT($ntp_ok)
2168181834Sroberto
2169181834Sroberto# Check for SHMEM_STATUS support
2170181834SrobertoAC_MSG_CHECKING(SHMEM_STATUS support)
2171181834Srobertocase "$ac_cv_header_sys_mman_h" in
2172181834Sroberto yes) ntp_ok=yes ;;
2173181834Sroberto *)   ntp_ok=no  ;;
2174181834Srobertoesac
2175181834Srobertoif test "$ntp_ok" = "yes"; then
2176181834Sroberto    AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
2177181834Srobertofi
2178181834SrobertoAC_MSG_RESULT($ntp_ok)
2179181834Sroberto
2180181834Srobertodnl dnl These are for OPT_PROGRAMS in authstuff/
2181181834Srobertodnl AC_SUBST(AUTHCERT)
2182181834Srobertodnl AC_SUBST(AUTHSPEED)
2183181834Srobertodnl AC_SUBST(MD5DRIVER)
2184181834Srobertodnl AC_SUBST(KEYPARITY)
2185181834Srobertodnl AC_SUBST(MAKEIPFP)
2186181834Srobertodnl AC_SUBST(MAKEPC1)
2187181834Srobertodnl AC_SUBST(MAKEPC2)
2188181834Srobertodnl AC_SUBST(MAKESP)
2189181834Srobertodnl AC_SUBST(MKRANDKEYS)
2190181834Srobertodnl AC_SUBST(OMAKEIPFP)
2191181834Srobertodnl AC_SUBST(UNIXCERT)
2192181834Sroberto
2193181834Srobertontp_refclock=no
2194181834Sroberto
2195181834Sroberto# HPUX only, and by explicit request
2196181834SrobertoAC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
2197181834SrobertoAC_ARG_ENABLE(BANCOMM,
2198181834Sroberto    AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
2199181834Sroberto    [ntp_ok=$enableval], [ntp_ok=no])
2200181834Srobertoif test "$ntp_ok" = "yes"; then
2201181834Sroberto    ntp_refclock=yes
2202181834Sroberto    AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
2203181834Srobertofi
2204181834SrobertoAC_MSG_RESULT($ntp_ok)
2205181834Srobertocase "$ntp_ok$host" in
2206181834Sroberto yes*-*-hpux*) ;;
2207181834Sroberto yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2208181834Srobertoesac
2209181834Sroberto
2210181834Sroberto#HPUX only, and only by explicit request
2211181834SrobertoAC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
2212181834SrobertoAC_ARG_ENABLE(GPSVME,
2213181834Sroberto    AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
2214181834Sroberto    [ntp_ok=$enableval], [ntp_ok=no])
2215181834Srobertoif test "$ntp_ok" = "yes"; then
2216181834Sroberto    ntp_refclock=yes
2217181834Sroberto    AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
2218181834Srobertofi
2219181834SrobertoAC_MSG_RESULT($ntp_ok)
2220181834Srobertocase "$ntp_ok$host" in
2221181834Sroberto yes*-*-hpux*) ;;
2222181834Sroberto yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2223181834Srobertoesac
2224181834Sroberto
2225181834SrobertoAC_MSG_CHECKING(for PCL720 clock support)
2226181834Srobertocase "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
2227181834Sroberto yesyesyes)
2228181834Sroberto    AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
2229181834Sroberto    ans=yes
2230181834Sroberto    ;;
2231181834Sroberto *)
2232181834Sroberto    ans=no
2233181834Sroberto    ;;
2234181834Srobertoesac
2235181834SrobertoAC_MSG_RESULT($ans)
2236181834Sroberto
2237181834SrobertoAC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
2238181834SrobertoAC_ARG_ENABLE(all-clocks,
2239181834Sroberto    AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
2240181834Sroberto    [ntp_eac=$enableval], [ntp_eac=yes])
2241181834SrobertoAC_MSG_RESULT($ntp_eac)
2242181834Sroberto
2243181834Sroberto# HMS: Should we also require ac_cv_var_parse_ok?
2244181834SrobertoAC_MSG_CHECKING(if we have support for PARSE clocks)
2245181834Srobertocase "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
2246181834Sroberto yes*yes*)
2247181834Sroberto    ntp_canparse=yes
2248181834Sroberto    ;;
2249181834Sroberto *) ntp_canparse=no
2250181834Sroberto    ;;
2251181834Srobertoesac
2252181834SrobertoAC_MSG_RESULT($ntp_canparse)
2253181834Sroberto
2254181834SrobertoAC_MSG_CHECKING([if we have support for audio clocks])
2255181834Srobertocase "$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
2256181834Sroberto *yes*)
2257181834Sroberto    ntp_canaudio=yes
2258181834Sroberto    AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
2259181834Sroberto    ;;
2260181834Sroberto *) ntp_canaudio=no ;;
2261181834Srobertoesac
2262181834SrobertoAC_MSG_RESULT($ntp_canaudio)
2263181834Sroberto
2264181834SrobertoAC_MSG_CHECKING([if we have support for the SHM refclock interface])
2265181834Srobertocase "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
2266181834Sroberto yesyes)
2267181834Sroberto    ntp_canshm=yes
2268181834Sroberto    ;;
2269181834Sroberto *) ntp_canshm=no ;;
2270181834Srobertoesac
2271181834SrobertoAC_MSG_RESULT($ntp_canshm)
2272181834Sroberto
2273181834Sroberto# Requires modem control
2274181834SrobertoAC_MSG_CHECKING(ACTS modem service)
2275181834SrobertoAC_ARG_ENABLE(ACTS,
2276181834Sroberto    AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
2277181834Sroberto    [ntp_ok=$enableval],
2278181834Sroberto    [AC_EGREP_CPP(yes,
2279181834Sroberto        [#include <termios.h>
2280181834Sroberto#ifdef HAVE_SYS_IOCTL_H
2281181834Sroberto#include <sys/ioctl.h>
2282181834Sroberto#endif
2283181834Sroberto#ifdef TIOCMBIS
2284181834Sroberto         yes
2285181834Sroberto#endif
2286181834Sroberto         ], ntp_ok=$ntp_eac, ntp_ok=no)])
2287181834Srobertoif test "$ntp_ok" = "yes"; then
2288181834Sroberto    ntp_refclock=yes
2289181834Sroberto    AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
2290181834Srobertofi
2291181834SrobertoAC_MSG_RESULT($ntp_ok)
2292181834Sroberto
2293181834SrobertoAC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
2294181834SrobertoAC_ARG_ENABLE(ARBITER,
2295181834Sroberto    AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
2296181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2297181834Srobertoif test "$ntp_ok" = "yes"; then
2298181834Sroberto    ntp_refclock=yes
2299181834Sroberto    AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
2300181834Srobertofi
2301181834SrobertoAC_MSG_RESULT($ntp_ok)
2302181834Sroberto
2303181834SrobertoAC_MSG_CHECKING(Arcron MSF receiver)
2304181834SrobertoAC_ARG_ENABLE(ARCRON_MSF,
2305181834Sroberto    AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
2306181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2307181834Srobertoif test "$ntp_ok" = "yes"; then
2308181834Sroberto    ntp_refclock=yes
2309181834Sroberto    AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
2310181834Srobertofi
2311181834SrobertoAC_MSG_RESULT($ntp_ok)
2312181834Sroberto
2313181834SrobertoAC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
2314181834SrobertoAC_ARG_ENABLE(AS2201,
2315181834Sroberto    AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
2316181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2317181834Srobertoif test "$ntp_ok" = "yes"; then
2318181834Sroberto    ntp_refclock=yes
2319181834Sroberto    AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
2320181834Srobertofi
2321181834SrobertoAC_MSG_RESULT($ntp_ok)
2322181834Sroberto
2323181834SrobertoAC_MSG_CHECKING(ATOM PPS interface)
2324181834SrobertoAC_ARG_ENABLE(ATOM,	
2325181834Sroberto    AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
2326181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2327181834Srobertocase "$ac_cv_var_atom_ok" in
2328181834Sroberto no) ntp_ok=no ;;
2329181834Srobertoesac
2330181834Srobertoif test "$ntp_ok" = "yes"; then
2331181834Sroberto    ntp_refclock=yes
2332181834Sroberto    AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
2333181834Srobertofi
2334181834SrobertoAC_MSG_RESULT($ntp_ok)
2335181834Sroberto
2336181834SrobertoAC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
2337181834SrobertoAC_ARG_ENABLE(CHRONOLOG,
2338181834Sroberto    AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
2339181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2340181834Srobertoif test "$ntp_ok" = "yes"; then
2341181834Sroberto    ntp_refclock=yes
2342181834Sroberto    AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
2343181834Srobertofi
2344181834SrobertoAC_MSG_RESULT($ntp_ok)
2345181834Sroberto
2346181834SrobertoAC_MSG_CHECKING(CHU modem/decoder)
2347181834SrobertoAC_ARG_ENABLE(CHU,
2348181834Sroberto    AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
2349181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2350181834Srobertoif test "$ntp_ok" = "yes"; then
2351181834Sroberto    ntp_refclock=yes
2352181834Sroberto    AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
2353181834Srobertofi
2354181834SrobertoAC_MSG_RESULT($ntp_ok)
2355181834Srobertoac_refclock_chu=$ntp_ok
2356181834Sroberto
2357181834SrobertoAC_MSG_CHECKING(CHU audio/decoder)
2358181834SrobertoAC_ARG_ENABLE(AUDIO-CHU,
2359181834Sroberto    AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
2360181834Sroberto    [ntp_ok=$enableval],
2361181834Sroberto    [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
2362181834Sroberto *no*)	ntp_ok=no  ;;
2363181834Sroberto *)	ntp_ok=yes ;;
2364181834Srobertoesac])
2365181834Srobertoif test "$ntp_ok" = "yes"; then
2366181834Sroberto    AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
2367181834Srobertofi
2368181834SrobertoAC_MSG_RESULT($ntp_ok)
2369181834Sroberto# We used to check for sunos/solaris target...
2370181834Srobertocase "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
2371181834Sroberto yes*no*) AC_MSG_WARN(*** But the expected answer is...no ***) ;;
2372181834Srobertoesac
2373181834Sroberto
2374181834Sroberto# Not under HP-UX
2375181834SrobertoAC_MSG_CHECKING(Datum Programmable Time System)
2376181834SrobertoAC_ARG_ENABLE(DATUM,
2377181834Sroberto    AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
2378181834Sroberto    [ntp_ok=$enableval],
2379181834Sroberto    [case "$ac_cv_header_termios_h" in
2380181834Sroberto    yes)
2381181834Sroberto        ntp_ok=$ntp_eac
2382181834Sroberto        ;;
2383181834Sroberto    *) ntp_ok=no
2384181834Sroberto        ;;
2385181834Sroberto    esac])
2386181834Srobertoif test "$ntp_ok" = "yes"; then
2387181834Sroberto    ntp_refclock=yes
2388181834Sroberto    AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
2389181834Srobertofi
2390181834SrobertoAC_MSG_RESULT($ntp_ok)
2391181834Sroberto
2392181834SrobertoAC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
2393181834SrobertoAC_ARG_ENABLE(DUMBCLOCK,
2394181834Sroberto    AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
2395181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2396181834Srobertoif test "$ntp_ok" = "yes"; then
2397181834Sroberto    ntp_refclock=yes
2398181834Sroberto    AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
2399181834Srobertofi
2400181834SrobertoAC_MSG_RESULT($ntp_ok)
2401181834Sroberto
2402181834SrobertoAC_MSG_CHECKING(Forum Graphic GPS)
2403181834SrobertoAC_ARG_ENABLE(FG,
2404181834Sroberto    AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
2405181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2406181834Srobertoif test "$ntp_ok" = "yes"; then
2407181834Sroberto    ntp_refclock=yes
2408181834Sroberto    AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
2409181834Srobertofi
2410181834SrobertoAC_MSG_RESULT($ntp_ok)
2411181834Sroberto
2412181834Sroberto# Requires modem control
2413181834SrobertoAC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
2414181834SrobertoAC_ARG_ENABLE(HEATH,
2415181834Sroberto    AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
2416181834Sroberto    [ntp_ok=$enableval],
2417181834Sroberto    [AC_EGREP_CPP(yes,
2418181834Sroberto        [#include <termios.h>
2419181834Sroberto#ifdef HAVE_SYS_IOCTL_H
2420181834Sroberto#include <sys/ioctl.h>
2421181834Sroberto#endif
2422181834Sroberto#ifdef TIOCMBIS
2423181834Sroberto         yes
2424181834Sroberto#endif
2425181834Sroberto         ], ntp_ok=$ntp_eac, ntp_ok=no)])
2426181834Srobertoif test "$ntp_ok" = "yes"; then
2427181834Sroberto    ntp_refclock=yes
2428181834Sroberto    AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
2429181834Srobertofi
2430181834SrobertoAC_MSG_RESULT($ntp_ok)
2431181834Sroberto
2432181834SrobertoAC_MSG_CHECKING(for hopf serial clock device)
2433181834SrobertoAC_ARG_ENABLE(HOPFSERIAL,
2434181834Sroberto    AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
2435181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2436181834Srobertoif test "$ntp_ok" = "yes"; then
2437181834Sroberto    ntp_refclock=yes
2438181834Sroberto    AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
2439181834Srobertofi
2440181834SrobertoAC_MSG_RESULT($ntp_ok)
2441181834Sroberto
2442181834SrobertoAC_MSG_CHECKING(for hopf PCI clock 6039)
2443181834SrobertoAC_ARG_ENABLE(HOPFPCI,
2444181834Sroberto    AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
2445181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2446181834Srobertoif test "$ntp_ok" = "yes"; then
2447181834Sroberto    ntp_refclock=yes
2448181834Sroberto    AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
2449181834Srobertofi
2450181834SrobertoAC_MSG_RESULT($ntp_ok)
2451181834Sroberto
2452181834SrobertoAC_MSG_CHECKING(HP 58503A GPS receiver)
2453181834SrobertoAC_ARG_ENABLE(HPGPS,
2454181834Sroberto    AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
2455181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2456181834Srobertoif test "$ntp_ok" = "yes"; then
2457181834Sroberto    ntp_refclock=yes
2458181834Sroberto    AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
2459181834Srobertofi
2460181834SrobertoAC_MSG_RESULT($ntp_ok)
2461181834Sroberto
2462181834SrobertoAC_MSG_CHECKING(IRIG audio decoder)
2463181834SrobertoAC_ARG_ENABLE(IRIG,
2464181834Sroberto    AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
2465181834Sroberto    [ntp_ok=$enableval],
2466181834Sroberto    [case "$ntp_eac$ntp_canaudio" in
2467181834Sroberto     *no*)	ntp_ok=no  ;;
2468181834Sroberto     *)		ntp_ok=yes ;;
2469181834Sroberto    esac])
2470181834Srobertoif test "$ntp_ok" = "yes"; then
2471181834Sroberto    ntp_refclock=yes
2472181834Sroberto    AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
2473181834Srobertofi
2474181834SrobertoAC_MSG_RESULT($ntp_ok)
2475181834Srobertocase "$ntp_ok$ntp_canaudio" in
2476181834Sroberto yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2477181834Srobertoesac
2478181834Sroberto
2479181834SrobertoAC_MSG_CHECKING(for JJY receiver)
2480181834SrobertoAC_ARG_ENABLE(JJY,
2481181834Sroberto    AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
2482181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2483181834Srobertoif test "$ntp_ok" = "yes"; then
2484181834Sroberto    ntp_refclock=yes
2485181834Sroberto    AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
2486181834Srobertofi
2487181834SrobertoAC_MSG_RESULT($ntp_ok)
2488181834Sroberto
2489181834SrobertoAC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
2490181834SrobertoAC_ARG_ENABLE(JUPITER,
2491181834Sroberto    AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
2492181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2493181834Srobertocase "$ac_cv_var_jupiter_ok" in
2494181834Sroberto no) ntp_ok=no ;;
2495181834Srobertoesac
2496181834Srobertoif test "$ntp_ok" = "yes"; then
2497181834Sroberto    ntp_refclock=yes
2498181834Sroberto    AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
2499181834Srobertofi
2500181834SrobertoAC_MSG_RESULT($ntp_ok)
2501181834Sroberto
2502181834SrobertoAC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
2503181834SrobertoAC_ARG_ENABLE(LEITCH,
2504181834Sroberto    AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
2505181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2506181834Srobertoif test "$ntp_ok" = "yes"; then
2507181834Sroberto    ntp_refclock=yes
2508181834Sroberto    AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
2509181834Srobertofi
2510181834SrobertoAC_MSG_RESULT($ntp_ok)
2511181834Sroberto
2512181834SrobertoAC_MSG_CHECKING(local clock reference)
2513181834SrobertoAC_ARG_ENABLE(LOCAL-CLOCK,
2514181834Sroberto    AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
2515181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2516181834Srobertoif test "$ntp_ok" = "yes"; then
2517181834Sroberto    ntp_refclock=yes
2518181834Sroberto    AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
2519181834Srobertofi
2520181834SrobertoAC_MSG_RESULT($ntp_ok)
2521181834Sroberto
2522181834Srobertodnl Bug 340: longstanding unfixed bugs
2523181834Srobertodnl AC_MSG_CHECKING(EES M201 MSF receiver)
2524181834Srobertodnl AC_ARG_ENABLE(MSFEES,
2525181834Srobertodnl     AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
2526181834Srobertodnl     [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2527181834Srobertodnl if test "$ntp_ok" = "yes"; then
2528181834Srobertodnl     ntp_refclock=yes
2529181834Srobertodnl     AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
2530181834Srobertodnl fi
2531181834Srobertodnl AC_MSG_RESULT($ntp_ok)
2532181834Sroberto
2533181834Sroberto# Not Ultrix
2534181834SrobertoAC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
2535181834SrobertoAC_ARG_ENABLE(MX4200,
2536181834Sroberto    AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
2537181834Sroberto    [ntp_ok=$enableval],
2538181834Sroberto    [case "$ac_cv_var_ppsclock" in
2539181834Sroberto     yes) ntp_ok=$ntp_eac
2540181834Sroberto        ;;
2541181834Sroberto     *) ntp_ok=no
2542181834Sroberto        ;;
2543181834Sroberto    esac])
2544181834Srobertoif test "$ntp_ok" = "yes"; then
2545181834Sroberto    ntp_refclock=yes
2546181834Sroberto    AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
2547181834Srobertofi
2548181834SrobertoAC_MSG_RESULT($ntp_ok)
2549181834Srobertocase "$ntp_ok$host" in
2550181834Sroberto yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2551181834Srobertoesac
2552181834Sroberto
2553181834SrobertoAC_MSG_CHECKING(for NeoClock4X receiver)
2554181834SrobertoAC_ARG_ENABLE(NEOCLOCK4X,
2555181834Sroberto    AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
2556181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2557181834Srobertoif test "$ntp_ok" = "yes"; then
2558181834Sroberto    ntp_refclock=yes
2559181834Sroberto    AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
2560181834Srobertofi
2561181834SrobertoAC_MSG_RESULT($ntp_ok)
2562181834Sroberto
2563181834SrobertoAC_MSG_CHECKING(NMEA GPS receiver)
2564181834SrobertoAC_ARG_ENABLE(NMEA,
2565181834Sroberto    AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
2566181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2567181834Srobertoif test "$ntp_ok" = "yes"; then
2568181834Sroberto    ntp_refclock=yes
2569181834Sroberto    AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
2570181834Srobertofi
2571181834SrobertoAC_MSG_RESULT($ntp_ok)
2572181834Sroberto
2573181834SrobertoAC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
2574181834SrobertoAC_ARG_ENABLE(ONCORE,
2575181834Sroberto    AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
2576181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2577181834Srobertocase "$ac_cv_var_oncore_ok" in
2578181834Sroberto no) ntp_ok=no ;;
2579181834Srobertoesac
2580181834Srobertoif test "$ntp_ok" = "yes"; then
2581181834Sroberto    ntp_refclock=yes
2582181834Sroberto    AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
2583181834Srobertofi
2584181834SrobertoAC_MSG_RESULT($ntp_ok)
2585181834Sroberto
2586181834SrobertoAC_MSG_CHECKING(for Palisade clock)
2587181834SrobertoAC_ARG_ENABLE(PALISADE,
2588181834Sroberto    AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
2589181834Sroberto    [ntp_ok=$enableval],
2590181834Sroberto    [case "$ac_cv_header_termios_h" in
2591181834Sroberto    yes)
2592181834Sroberto        ntp_ok=$ntp_eac
2593181834Sroberto        ;;
2594181834Sroberto    *) ntp_ok=no
2595181834Sroberto        ;;
2596181834Sroberto    esac])
2597181834Sroberto
2598181834Srobertoif test "$ntp_ok" = "yes"; then
2599181834Sroberto    ntp_refclock=yes
2600181834Sroberto    AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
2601181834Srobertofi
2602181834SrobertoAC_MSG_RESULT($ntp_ok)
2603181834Sroberto
2604181834SrobertoAC_MSG_CHECKING(Conrad parallel port radio clock)
2605181834SrobertoAC_ARG_ENABLE(PCF,
2606181834Sroberto    AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
2607181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2608181834Srobertoif test "$ntp_ok" = "yes"; then
2609181834Sroberto    ntp_refclock=yes
2610181834Sroberto    AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
2611181834Srobertofi
2612181834SrobertoAC_MSG_RESULT($ntp_ok)
2613181834Sroberto
2614181834SrobertoAC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
2615181834SrobertoAC_ARG_ENABLE(PST,
2616181834Sroberto    AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
2617181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2618181834Srobertoif test "$ntp_ok" = "yes"; then
2619181834Sroberto    ntp_refclock=yes
2620181834Sroberto    AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
2621181834Srobertofi
2622181834SrobertoAC_MSG_RESULT($ntp_ok)
2623181834Sroberto
2624181834SrobertoAC_MSG_CHECKING(RIPENCC specific Trimble driver)
2625181834SrobertoAC_ARG_ENABLE(RIPENCC,
2626181834Sroberto    AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
2627181834Sroberto    [ntp_ok=$enableval], [ntp_ok=no])
2628181834Sroberto# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2629181834Srobertocase "$ac_cv_var_ripe_ncc_ok" in
2630181834Sroberto no) ntp_ok=no ;;
2631181834Srobertoesac
2632181834Srobertoif test "$ntp_ok" = "yes"; then
2633181834Sroberto    ntp_refclock=yes
2634181834Sroberto    AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
2635181834Srobertofi
2636181834SrobertoAC_MSG_RESULT($ntp_ok)
2637181834Sroberto
2638181834Sroberto# Danny Meyer says SHM compiles (with a few warnings) under Win32.
2639181834Sroberto# For *IX, we need sys/ipc.h and sys/shm.h.
2640181834SrobertoAC_MSG_CHECKING(for SHM clock attached thru shared memory)
2641181834SrobertoAC_ARG_ENABLE(SHM,
2642181834Sroberto    AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
2643181834Sroberto    [ntp_ok=$enableval],
2644181834Sroberto    [case "$ntp_eac$ntp_canshm" in
2645181834Sroberto *no*)	ntp_ok=no  ;;
2646181834Sroberto *)	ntp_ok=yes ;;
2647181834Srobertoesac])
2648181834Srobertoif test "$ntp_ok" = "yes"; then
2649181834Sroberto    ntp_refclock=yes
2650181834Sroberto    AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
2651181834Srobertofi
2652181834SrobertoAC_MSG_RESULT($ntp_ok)
2653181834Sroberto
2654181834SrobertoAC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
2655181834SrobertoAC_ARG_ENABLE(SPECTRACOM,
2656181834Sroberto    AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
2657181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2658181834Srobertoif test "$ntp_ok" = "yes"; then
2659181834Sroberto    ntp_refclock=yes
2660181834Sroberto    AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
2661181834Srobertofi
2662181834SrobertoAC_MSG_RESULT($ntp_ok)
2663181834Sroberto
2664181834SrobertoAC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
2665181834SrobertoAC_ARG_ENABLE(TPRO,
2666181834Sroberto    AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
2667181834Sroberto    [ntp_ok=$enableval],
2668181834Sroberto    [case "$ac_cv_header_sys_tpro_h" in
2669181834Sroberto     yes)
2670181834Sroberto	ntp_ok=$ntp_eac
2671181834Sroberto	;;
2672181834Sroberto     *)	ntp_ok=no
2673181834Sroberto	;;
2674181834Sroberto    esac])
2675181834Srobertoif test "$ntp_ok" = "yes"; then
2676181834Sroberto    ntp_refclock=yes
2677181834Sroberto    AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2678181834Srobertofi
2679181834SrobertoAC_MSG_RESULT($ntp_ok)
2680181834Srobertocase "$ntp_ok$ac_cv_header_sys_tpro" in
2681181834Sroberto yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2682181834Srobertoesac
2683181834Sroberto
2684181834Srobertodnl Bug 342: longstanding unfixed bugs
2685181834Srobertodnl AC_MSG_CHECKING(TRAK 8810 GPS receiver)
2686181834Srobertodnl AC_ARG_ENABLE(TRAK,
2687181834Srobertodnl     AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
2688181834Srobertodnl     [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2689181834Srobertodnl if test "$ntp_ok" = "yes"; then
2690181834Srobertodnl     ntp_refclock=yes
2691181834Srobertodnl     AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
2692181834Srobertodnl fi
2693181834Srobertodnl AC_MSG_RESULT($ntp_ok)
2694181834Sroberto
2695181834Sroberto# Not on a vax-dec-bsd
2696181834SrobertoAC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
2697181834SrobertoAC_ARG_ENABLE(TRUETIME,
2698181834Sroberto    AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
2699181834Sroberto    [ntp_ok=$enableval],
2700181834Sroberto    [case "$host" in
2701181834Sroberto     vax-dec-bsd)
2702181834Sroberto	ntp_ok=no
2703181834Sroberto	;;
2704181834Sroberto     *)
2705181834Sroberto	ntp_ok=$ntp_eac
2706181834Sroberto	;;
2707181834Sroberto    esac])
2708181834Srobertoif test "$ntp_ok" = "yes"; then
2709181834Sroberto    ntp_refclock=yes
2710181834Sroberto    AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
2711181834Srobertofi
2712181834SrobertoAC_MSG_RESULT($ntp_ok)
2713181834Srobertocase "$ntp_ok$host" in
2714181834Sroberto yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2715181834Srobertoesac
2716181834Sroberto
2717181834SrobertoAC_MSG_CHECKING(TrueTime 560 IRIG-B decoder)
2718181834SrobertoAC_ARG_ENABLE(TT560,
2719181834Sroberto    AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
2720181834Sroberto    [ntp_ok=$enableval], [ntp_ok=no])
2721181834Srobertoif test "$ntp_ok" = "yes"; then
2722181834Sroberto    ntp_refclock=yes
2723181834Sroberto    AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
2724181834Srobertofi
2725181834SrobertoAC_MSG_RESULT($ntp_ok)
2726181834Sroberto
2727181834SrobertoAC_MSG_CHECKING(Ultralink M320 WWVB receiver)
2728181834SrobertoAC_ARG_ENABLE(ULINK,
2729181834Sroberto    AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
2730181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2731181834Srobertoif test "$ntp_ok" = "yes"; then
2732181834Sroberto    ntp_refclock=yes
2733181834Sroberto    AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
2734181834Srobertofi
2735181834SrobertoAC_MSG_RESULT($ntp_ok)
2736181834Sroberto
2737181834SrobertoAC_MSG_CHECKING(WWV receiver)
2738181834SrobertoAC_ARG_ENABLE(WWV,
2739181834Sroberto    AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2740181834Sroberto    [ntp_ok=$enableval],
2741181834Sroberto    [case "$ntp_eac$ntp_canaudio" in
2742181834Sroberto     *no*)	ntp_ok=no  ;;
2743181834Sroberto     *)		ntp_ok=yes ;;
2744181834Sroberto    esac])
2745181834Srobertoif test "$ntp_ok" = "yes"; then
2746181834Sroberto    ntp_refclock=yes
2747181834Sroberto    AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2748181834Srobertofi
2749181834SrobertoAC_MSG_RESULT($ntp_ok)
2750181834Srobertocase "$ntp_ok$ntp_canaudio" in
2751181834Sroberto yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2752181834Srobertoesac
2753181834Sroberto
2754181834SrobertoAC_MSG_CHECKING(for Zyfer receiver)
2755181834SrobertoAC_ARG_ENABLE(ZYFER,
2756181834Sroberto    AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
2757181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2758181834Srobertoif test "$ntp_ok" = "yes"; then
2759181834Sroberto    ntp_refclock=yes
2760181834Sroberto    AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
2761181834Srobertofi
2762181834SrobertoAC_MSG_RESULT($ntp_ok)
2763181834Sroberto
2764181834SrobertoAC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
2765181834SrobertoAC_ARG_ENABLE(parse-clocks,
2766181834Sroberto   AC_HELP_STRING([--enable-parse-clocks], [- include all suitable PARSE clocks:]),
2767181834Sroberto    [ntp_eapc=$enableval],
2768181834Sroberto    [case "$ntp_eac" in
2769181834Sroberto     yes) ntp_eapc=$ntp_canparse ;;
2770181834Sroberto     *) ntp_eapc=no ;;
2771181834Sroberto    esac
2772181834Sroberto    # Delete the next line one of these days
2773181834Sroberto    ntp_eapc=no])
2774181834SrobertoAC_MSG_RESULT($ntp_eapc)
2775181834Sroberto
2776181834Srobertocase "$ntp_eac$ntp_eapc$ntp_canparse" in
2777181834Sroberto noyes*)
2778181834Sroberto    AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
2779181834Sroberto    ;;
2780181834Sroberto yesyesno)
2781181834Sroberto    AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
2782181834Sroberto    ;;
2783181834Sroberto *) ;;
2784181834Srobertoesac
2785181834Sroberto
2786181834Srobertontp_libparse=no
2787181834Srobertontp_parseutil=no
2788181834Srobertontp_rawdcf=no
2789181834Sroberto
2790181834SrobertoAC_MSG_CHECKING(Diem Computime Radio Clock)
2791181834SrobertoAC_ARG_ENABLE(COMPUTIME,
2792181834Sroberto    AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
2793181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2794181834Srobertoif test "$ntp_ok" = "yes"; then
2795181834Sroberto    ntp_libparse=yes
2796181834Sroberto    ntp_refclock=yes
2797181834Sroberto    AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
2798181834Srobertofi
2799181834SrobertoAC_MSG_RESULT($ntp_ok)
2800181834Srobertocase "$ntp_ok$ntp_canparse" in
2801181834Sroberto yesno)
2802181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2803181834Sroberto    ;;
2804181834Srobertoesac
2805181834Sroberto
2806181834SrobertoAC_MSG_CHECKING(ELV/DCF7000 clock)
2807181834SrobertoAC_ARG_ENABLE(DCF7000,
2808181834Sroberto    AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
2809181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2810181834Srobertoif test "$ntp_ok" = "yes"; then
2811181834Sroberto    ntp_libparse=yes
2812181834Sroberto    ntp_refclock=yes
2813181834Sroberto    AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
2814181834Srobertofi
2815181834SrobertoAC_MSG_RESULT($ntp_ok)
2816181834Srobertocase "$ntp_ok$ntp_canparse" in
2817181834Sroberto yesno)
2818181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2819181834Sroberto    ;;
2820181834Srobertoesac
2821181834Sroberto
2822181834SrobertoAC_MSG_CHECKING(HOPF 6021 clock)
2823181834SrobertoAC_ARG_ENABLE(HOPF6021,
2824181834Sroberto    AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
2825181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2826181834Srobertoif test "$ntp_ok" = "yes"; then
2827181834Sroberto    ntp_libparse=yes
2828181834Sroberto    ntp_refclock=yes
2829181834Sroberto    AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
2830181834Srobertofi
2831181834SrobertoAC_MSG_RESULT($ntp_ok)
2832181834Srobertocase "$ntp_ok$ntp_canparse" in
2833181834Sroberto yesno)
2834181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2835181834Sroberto    ;;
2836181834Srobertoesac
2837181834Sroberto
2838181834SrobertoAC_MSG_CHECKING(Meinberg clocks)
2839181834SrobertoAC_ARG_ENABLE(MEINBERG,
2840181834Sroberto    AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
2841181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2842181834Srobertoif test "$ntp_ok" = "yes"; then
2843181834Sroberto    ntp_libparse=yes
2844181834Sroberto    ntp_refclock=yes
2845181834Sroberto    AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
2846181834Srobertofi
2847181834SrobertoAC_MSG_RESULT($ntp_ok)
2848181834Srobertocase "$ntp_ok$ntp_canparse" in
2849181834Sroberto yesno)
2850181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2851181834Sroberto    ;;
2852181834Srobertoesac
2853181834Sroberto
2854181834SrobertoAC_MSG_CHECKING(DCF77 raw time code)
2855181834SrobertoAC_ARG_ENABLE(RAWDCF,
2856181834Sroberto    AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
2857181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2858181834Srobertoif test "$ntp_ok" = "yes"; then
2859181834Sroberto    ntp_libparse=yes
2860181834Sroberto    ntp_parseutil=yes
2861181834Sroberto    ntp_refclock=yes
2862181834Sroberto    ntp_rawdcf=yes
2863181834Sroberto    AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
2864181834Srobertofi
2865181834SrobertoAC_MSG_RESULT($ntp_ok)
2866181834Srobertocase "$ntp_ok$ntp_canparse" in
2867181834Sroberto yesno)
2868181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2869181834Sroberto    ;;
2870181834Srobertoesac
2871181834Sroberto
2872181834Srobertocase "$ntp_rawdcf" in
2873181834Sroberto yes)
2874181834Sroberto    AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2875181834Sroberto    ac_cv_var_rawdcf_parity,
2876181834Sroberto    [ans=no
2877181834Sroberto    case "$host" in
2878181834Sroberto     *-*-linux*)
2879181834Sroberto        ans=yes
2880181834Sroberto        ;;
2881181834Sroberto    esac
2882181834Sroberto    ac_cv_var_rawdcf_parity=$ans])
2883181834Sroberto    case "$ac_cv_var_rawdcf_parity" in
2884181834Sroberto     yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
2885181834Sroberto    esac
2886181834Sroberto    ;;
2887181834Sroberto
2888181834Sroberto *) # HMS: Is this a good idea?
2889181834Sroberto    ac_cv_var_rawdcf_parity=no
2890181834Sroberto    ;;
2891181834Srobertoesac
2892181834Sroberto
2893181834SrobertoAC_MSG_CHECKING(RCC 8000 clock)
2894181834SrobertoAC_ARG_ENABLE(RCC8000,
2895181834Sroberto    AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
2896181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2897181834Srobertoif test "$ntp_ok" = "yes"; then
2898181834Sroberto    ntp_libparse=yes
2899181834Sroberto    ntp_refclock=yes
2900181834Sroberto    AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
2901181834Srobertofi
2902181834SrobertoAC_MSG_RESULT($ntp_ok)
2903181834Srobertocase "$ntp_ok$ntp_canparse" in
2904181834Sroberto yesno)
2905181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2906181834Sroberto    ;;
2907181834Srobertoesac
2908181834Sroberto
2909181834SrobertoAC_MSG_CHECKING(Schmid DCF77 clock)
2910181834SrobertoAC_ARG_ENABLE(SCHMID,
2911181834Sroberto    AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
2912181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2913181834Srobertoif test "$ntp_ok" = "yes"; then
2914181834Sroberto    ntp_libparse=yes
2915181834Sroberto    ntp_refclock=yes
2916181834Sroberto    AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
2917181834Srobertofi
2918181834SrobertoAC_MSG_RESULT($ntp_ok)
2919181834Srobertocase "$ntp_ok$ntp_canparse" in
2920181834Sroberto yesno)
2921181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2922181834Sroberto    ;;
2923181834Srobertoesac
2924181834Sroberto
2925181834SrobertoAC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2926181834SrobertoAC_ARG_ENABLE(TRIMTAIP,
2927181834Sroberto    AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
2928181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2929181834Srobertoif test "$ntp_ok" = "yes"; then
2930181834Sroberto    ntp_libparse=yes
2931181834Sroberto    ntp_refclock=yes
2932181834Sroberto    AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
2933181834Srobertofi
2934181834SrobertoAC_MSG_RESULT($ntp_ok)
2935181834Srobertocase "$ntp_ok$ntp_canparse" in
2936181834Sroberto yesno)
2937181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2938181834Sroberto    ;;
2939181834Srobertoesac
2940181834Sroberto
2941181834SrobertoAC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2942181834SrobertoAC_ARG_ENABLE(TRIMTSIP,
2943181834Sroberto    AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
2944181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2945181834Srobertoif test "$ntp_ok" = "yes"; then
2946181834Sroberto    ntp_libparse=yes
2947181834Sroberto    ntp_refclock=yes
2948181834Sroberto    AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
2949181834Srobertofi
2950181834SrobertoAC_MSG_RESULT($ntp_ok)
2951181834Srobertocase "$ntp_ok$ntp_canparse" in
2952181834Sroberto yesno)
2953181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2954181834Sroberto    ;;
2955181834Srobertoesac
2956181834Sroberto
2957181834SrobertoAC_MSG_CHECKING(WHARTON 400A Series clock)
2958181834SrobertoAC_ARG_ENABLE(WHARTON,
2959181834Sroberto    AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
2960181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2961181834Srobertoif test "$ntp_ok" = "yes"; then
2962181834Sroberto    ntp_libparse=yes
2963181834Sroberto    ntp_refclock=yes
2964181834Sroberto    AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
2965181834Srobertofi
2966181834SrobertoAC_MSG_RESULT($ntp_ok)
2967181834Srobertocase "$ntp_ok$ntp_canparse" in
2968181834Sroberto yesno)
2969181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2970181834Sroberto    ;;
2971181834Srobertoesac
2972181834Sroberto
2973181834SrobertoAC_MSG_CHECKING(VARITEXT clock)
2974181834SrobertoAC_ARG_ENABLE(VARITEXT,
2975181834Sroberto    AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
2976181834Sroberto    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2977181834Srobertoif test "$ntp_ok" = "yes"; then
2978181834Sroberto    ntp_libparse=yes
2979181834Sroberto    ntp_refclock=yes
2980181834Sroberto    AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
2981181834Srobertofi
2982181834SrobertoAC_MSG_RESULT($ntp_ok)
2983181834Srobertocase "$ntp_ok$ntp_canparse" in
2984181834Sroberto yesno)
2985181834Sroberto    AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2986181834Sroberto    ;;
2987181834Srobertoesac
2988181834SrobertoAC_SUBST(LIBPARSE)
2989181834SrobertoAC_SUBST(MAKE_LIBPARSE)
2990181834SrobertoAC_SUBST(MAKE_LIBPARSE_KERNEL)
2991181834SrobertoAC_SUBST(MAKE_CHECK_Y2K)
2992181834SrobertoAC_MSG_CHECKING(if we need to make and use the parse libraries)
2993181834Srobertoans=no
2994181834Srobertocase "$ntp_libparse" in
2995181834Sroberto yes)
2996181834Sroberto    ans=yes
2997181834Sroberto    AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
2998181834Sroberto    LIBPARSE=../libparse/libparse.a
2999181834Sroberto    MAKE_LIBPARSE=libparse.a
3000181834Sroberto    # HMS: check_y2k trips the 34 year problem now...
3001181834Sroberto    false && MAKE_CHECK_Y2K=check_y2k
3002181834Sroberto    AC_DEFINE(PPS_SAMPLE, 1, [PPS auxiliary interface for ATOM?])
3003181834Sroberto    AC_DEFINE(CLOCK_ATOM)
3004181834Sroberto    ;;
3005181834Srobertoesac
3006181834SrobertoAC_MSG_RESULT($ans)
3007181834Sroberto
3008181834Sroberto# AC_SUBST(RSAOBJS)
3009181834Sroberto# AC_SUBST(RSASRCS)
3010181834Sroberto# AC_SUBST(RSADIR)
3011181834Sroberto# AC_SUBST(RSAREF)
3012181834Sroberto# AC_SUBST(LIBRSAREF)
3013181834Sroberto# AC_SUBST(MAKE_LIBRSAREF)
3014181834Sroberto
3015181834SrobertoAC_SUBST(OPENSSL)
3016181834SrobertoAC_SUBST(OPENSSL_INC)
3017181834SrobertoAC_SUBST(OPENSSL_LIB)
3018181834Sroberto
3019181834SrobertoAC_MSG_CHECKING(for openssl library directory)
3020181834SrobertoAC_ARG_WITH(openssl-libdir,
3021181834Sroberto	AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
3022181834Sroberto[ans=$withval],
3023181834Sroberto[case "$build" in
3024181834Sroberto $host) ans=yes ;;
3025181834Sroberto *)     ans=no ;;
3026181834Srobertoesac])
3027181834Srobertocase "$ans" in
3028181834Sroberto no) ;;
3029181834Sroberto yes) # Look in:
3030181834Sroberto    ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib"
3031181834Sroberto    ;;
3032181834Sroberto *) # Look where they said
3033181834Sroberto    ;;
3034181834Srobertoesac
3035181834Srobertocase "$ans" in
3036181834Sroberto no) ;;
3037181834Sroberto *) # Look for libcrypto.a and libssl.a:
3038181834Sroberto    for i in $ans no
3039181834Sroberto    do
3040181834Sroberto	case "$host" in
3041181834Sroberto	 *-*-darwin*)
3042181834Sroberto	    test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
3043181834Sroberto	    ;;
3044181834Sroberto	 *)
3045181834Sroberto	    test -f $i/libcrypto.so -a -f $i/libssl.so && break
3046181834Sroberto	    test -f $i/libcrypto.a -a -f $i/libssl.a && break
3047181834Sroberto	    ;;
3048181834Sroberto	esac
3049181834Sroberto    done
3050181834Sroberto    case "$i" in
3051181834Sroberto     no)
3052181834Sroberto	ans=no
3053181834Sroberto	OPENSSL_LIB=
3054181834Sroberto	;;
3055181834Sroberto     *) ans=$i
3056181834Sroberto	OPENSSL_LIB=$ans
3057181834Sroberto	;;
3058181834Sroberto    esac
3059181834Sroberto    ;;
3060181834Srobertoesac
3061181834SrobertoAC_MSG_RESULT($ans)
3062181834Sroberto
3063181834SrobertoAC_MSG_CHECKING(for openssl include directory)
3064181834SrobertoAC_ARG_WITH(openssl-incdir,
3065181834Sroberto	AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
3066181834Sroberto[ans=$withval],
3067181834Sroberto[case "$build" in
3068181834Sroberto $host) ans=yes ;;
3069181834Sroberto *)     ans=no ;;
3070181834Srobertoesac])
3071181834Srobertocase "$ans" in
3072181834Sroberto no) ;;
3073181834Sroberto yes) # look in:
3074181834Sroberto    ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include"
3075181834Sroberto    ;;
3076181834Sroberto *) # Look where they said
3077181834Sroberto    ;;
3078181834Srobertoesac
3079181834Srobertocase "$ans" in
3080181834Sroberto no) ;;
3081181834Sroberto *) # look for openssl/opensslconf.h:
3082181834Sroberto    for i in $ans no
3083181834Sroberto    do
3084181834Sroberto	test -f $i/openssl/opensslconf.h && break
3085181834Sroberto    done
3086181834Sroberto    case "$i" in
3087181834Sroberto     no)
3088181834Sroberto	ans=no
3089181834Sroberto	OPENSSL_INC=
3090181834Sroberto	;;
3091181834Sroberto     *) ans=$i
3092181834Sroberto	OPENSSL_INC=$ans
3093181834Sroberto	;;
3094181834Sroberto    esac
3095181834Sroberto    ;;
3096181834Srobertoesac
3097181834SrobertoAC_MSG_RESULT($ans)
3098181834Sroberto
3099181834SrobertoAC_ARG_WITH(crypto,
3100181834Sroberto	AC_HELP_STRING([--with-crypto], [+ =openssl]),
3101181834Sroberto[ans=$withval], [ans=yes])
3102181834Srobertocase "$ans" in
3103181834Sroberto no) ;;
3104181834Sroberto yes|openssl)
3105181834Sroberto    if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
3106181834Sroberto    then
3107181834Sroberto	ans=no
3108181834Sroberto    else
3109181834Sroberto	# We have OpenSSL inc/lib - use them.
3110181834Sroberto	ans=openssl
3111181834Sroberto	CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
3112181834Sroberto	LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
3113181834Sroberto	case "$need_dash_r" in
3114181834Sroberto	 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB"
3115181834Sroberto	    ;;
3116181834Sroberto	esac
3117181834Sroberto	AC_SUBST(LCRYPTO, [-lcrypto])
3118181834Sroberto	AC_DEFINE(OPENSSL, , [Use OpenSSL?])
3119181834Sroberto	AC_CHECK_FUNCS(EVP_md2 EVP_mdc2)
3120181834Sroberto    fi
3121181834Sroberto    ;;
3122181834Srobertoesac
3123181834SrobertoAC_MSG_CHECKING(for the level of crypto support)
3124181834SrobertoAC_MSG_RESULT($ans)
3125181834Sroberto
3126181834SrobertoAC_MSG_CHECKING(if we want to compile with ElectricFence)
3127181834SrobertoAC_ARG_WITH(electricfence,
3128181834Sroberto	AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
3129181834Sroberto[ans=$withval], [ans=no])
3130181834Srobertocase "$ans" in
3131181834Sroberto no) ;;
3132181834Sroberto *)
3133181834Sroberto    LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
3134181834Sroberto    EF_PROGS="eftest tstheap"
3135181834Sroberto    AC_SUBST(EF_PROGS)
3136181834Sroberto    EF_LIBS=libefence.a
3137181834Sroberto    AC_SUBST(EF_LIBS)
3138181834Sroberto    ans=yes
3139181834Sroberto    ;;
3140181834Srobertoesac
3141181834SrobertoAC_MSG_RESULT($ans)
3142181834Sroberto
3143181834SrobertoAC_SUBST(MAKE_CHECK_LAYOUT)
3144181834SrobertoAC_MSG_CHECKING(if we want to run check-layout)
3145181834Srobertocase "$cross_compiling$PATH_PERL" in
3146181834Sroberto no/*)
3147181834Sroberto    MAKE_CHECK_LAYOUT=check-layout
3148181834Sroberto    ans=yes
3149181834Sroberto    ;;
3150181834Sroberto *)
3151181834Sroberto    ans=no
3152181834Sroberto    ;;
3153181834Srobertoesac
3154181834SrobertoAC_MSG_RESULT($ans)
3155181834Sroberto
3156181834SrobertoAC_SUBST(TESTDCF)
3157181834SrobertoAC_SUBST(DCFD)
3158181834Sroberto
3159181834SrobertoAC_MSG_CHECKING(if we can make dcf parse utilities)
3160181834Srobertoans=no
3161181834Srobertoif test "$ntp_parseutil" = "yes"; then
3162181834Sroberto    case "$host" in
3163181834Sroberto     *-*-sunos4*|*-*-solaris2*|*-*-linux*|*-*-netbsd*)
3164181834Sroberto	ans="dcfd testdcf"
3165181834Sroberto	DCFD=dcfd
3166181834Sroberto        TESTDCF=testdcf
3167181834Sroberto	;;
3168181834Sroberto    esac
3169181834Srobertofi
3170181834SrobertoAC_MSG_RESULT($ans)
3171181834Sroberto
3172181834SrobertoAC_SUBST(MAKE_PARSEKMODULE)
3173181834SrobertoAC_MSG_CHECKING(if we can build kernel streams modules for parse)
3174181834Srobertoans=no
3175181834Srobertocase "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3176181834Sroberto yesyes)
3177181834Sroberto    case "$host" in
3178181834Sroberto     sparc-*-sunos4*)
3179181834Sroberto        case "$ac_cv_var_kernel_pll" in
3180181834Sroberto	yes)
3181181834Sroberto	    AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
3182181834Sroberto	    ;;
3183181834Sroberto	esac
3184181834Sroberto	ans=parsestreams
3185181834Sroberto	MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3186181834Sroberto	;;
3187181834Sroberto     sparc-*-solaris2*)
3188181834Sroberto	ans=parsesolaris
3189181834Sroberto	MAKE_PARSEKMODULE=parse
3190181834Sroberto	;;
3191181834Sroberto    esac
3192181834Sroberto    ;;
3193181834Srobertoesac
3194181834SrobertoAC_MSG_RESULT($ans)
3195181834Sroberto
3196181834SrobertoAC_MSG_CHECKING(if we need basic refclock support)
3197181834Srobertoif test "$ntp_refclock" = "yes"; then
3198181834Sroberto    AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
3199181834Srobertofi
3200181834SrobertoAC_MSG_RESULT($ntp_refclock)
3201181834Sroberto
3202181834Srobertodnl Things that can be made in clockstuff/
3203181834SrobertoAC_SUBST(PROPDELAY)	dnl Set to "propdelay"
3204181834SrobertoAC_SUBST(CHUTEST)	dnl Set to "chutest"
3205181834SrobertoAC_SUBST(CLKTEST)	dnl Set to "clktest"
3206181834Sroberto
3207181834SrobertoAC_SUBST(MAKE_ADJTIMED)
3208181834SrobertoAC_MSG_CHECKING(if we want HP-UX adjtimed support)
3209181834Srobertocase "$host" in
3210181834Sroberto *-*-hpux[[56789]]*)
3211181834Sroberto    ans=yes
3212181834Sroberto    ;;
3213181834Sroberto *) ans=no
3214181834Sroberto    ;;
3215181834Srobertoesac
3216181834Srobertoif test "$ans" = "yes"; then
3217181834Sroberto    MAKE_ADJTIMED=adjtimed
3218181834Sroberto    AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
3219181834Srobertofi
3220181834SrobertoAC_MSG_RESULT($ans)
3221181834Sroberto
3222181834SrobertoAC_MSG_CHECKING(if we want QNX adjtime support)
3223181834Srobertocase "$host" in
3224181834Sroberto *-*-qnx*)
3225181834Sroberto    ans=yes
3226181834Sroberto    ;;
3227181834Sroberto *) ans=no
3228181834Sroberto    ;;
3229181834Srobertoesac
3230181834Srobertoif test "$ans" = "yes"; then
3231181834Sroberto    AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
3232181834Srobertofi
3233181834SrobertoAC_MSG_RESULT($ans)
3234181834Sroberto
3235181834SrobertoAC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
3236181834Sroberto[AC_ARG_ENABLE(kmem,
3237181834Sroberto   AC_HELP_STRING([--enable-kmem], [s read /dev/kmem for tick and/or tickadj]),
3238181834Sroberto    [ans=$enableval],
3239181834Sroberto    [case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3240181834Sroberto     *yes*)
3241181834Sroberto	ans=yes
3242181834Sroberto	;;
3243181834Sroberto     *) ans=no
3244181834Sroberto	;;
3245181834Sroberto    esac
3246181834Sroberto    case "$host" in
3247181834Sroberto     *-*-aix*)
3248181834Sroberto	#ans=no
3249181834Sroberto	;;
3250181834Sroberto     *-*-domainos)	# Won't be found...
3251181834Sroberto	ans=no
3252181834Sroberto	;;
3253181834Sroberto     *-*-hpux*)
3254181834Sroberto	#ans=no
3255181834Sroberto	;;
3256181834Sroberto     *-*-irix[[456]]*)
3257181834Sroberto	ans=no
3258181834Sroberto	;;
3259181834Sroberto     *-*-linux*)
3260181834Sroberto	ans=no
3261181834Sroberto	;;
3262181834Sroberto     *-*-winnt3.5)
3263181834Sroberto	ans=no
3264181834Sroberto	;;
3265181834Sroberto     *-*-unicosmp*)
3266181834Sroberto	ans=no
3267181834Sroberto	;;
3268181834Sroberto    esac
3269181834Sroberto    ])
3270181834Srobertoac_cv_var_can_kmem=$ans])
3271181834Sroberto
3272181834Srobertocase "$ac_cv_var_can_kmem" in
3273181834Sroberto *yes*) ;;
3274181834Sroberto *) AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?]) ;;
3275181834Srobertoesac
3276181834Sroberto
3277181834SrobertoAC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
3278181834Sroberto[AC_ARG_ENABLE(accurate-adjtime,
3279181834Sroberto   AC_HELP_STRING([--enable-accurate-adjtime], [s the adjtime() call is accurate]),
3280181834Sroberto    [ans=$enableval],
3281181834Sroberto    [case "$host" in
3282181834Sroberto      i386-sequent-ptx*)
3283181834Sroberto	 ans=no
3284181834Sroberto	 ;;
3285181834Sroberto      i386-unknown-osf1*)
3286181834Sroberto	 ans=yes
3287181834Sroberto	 ;;
3288181834Sroberto      mips-sgi-irix[[456]]*)
3289181834Sroberto	 ans=yes
3290181834Sroberto	 ;;
3291181834Sroberto      *-fujitsu-uxp*)
3292181834Sroberto	 ans=yes
3293181834Sroberto	 ;;
3294181834Sroberto      *-ibm-aix[[45]]*)
3295181834Sroberto	 ans=yes
3296181834Sroberto	 ;;
3297181834Sroberto      *-*-linux*)
3298181834Sroberto	 ans=yes
3299181834Sroberto	 ;;
3300181834Sroberto      *-*-solaris2.[[01]])
3301181834Sroberto	 ans=no
3302181834Sroberto	 ;;
3303181834Sroberto      *-*-solaris2*)
3304181834Sroberto         ans=yes
3305181834Sroberto         ;;
3306181834Sroberto      *-*-unicosmp*)
3307181834Sroberto         ans=yes
3308181834Sroberto         ;;
3309181834Sroberto      *) ans=no
3310181834Sroberto	 ;;
3311181834Sroberto     esac
3312181834Sroberto     ])
3313181834Srobertoac_cv_var_adjtime_is_accurate=$ans])
3314181834Srobertocase "$ac_cv_var_adjtime_is_accurate" in
3315181834Sroberto yes) AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?]) ;;
3316181834Srobertoesac
3317181834Sroberto
3318181834SrobertoAC_CACHE_CHECK([the name of 'tick' in the kernel],
3319181834Srobertoac_cv_var_nlist_tick,
3320181834Sroberto[ans=_tick
3321181834Srobertocase "$host" in
3322181834Sroberto m68*-hp-hpux*) # HP9000/300?
3323181834Sroberto    ans=_old_tick
3324181834Sroberto    ;;
3325181834Sroberto *-apple-aux[[23]]*)
3326181834Sroberto    ans=tick
3327181834Sroberto    ;;
3328181834Sroberto *-hp-hpux*)
3329181834Sroberto    ans=old_tick
3330181834Sroberto    ;;
3331181834Sroberto *-ibm-aix[[345]]*)
3332181834Sroberto    ans=no
3333181834Sroberto    ;;
3334181834Sroberto *-*-mpeix*)
3335181834Sroberto    ans=no
3336181834Sroberto    ;;
3337181834Sroberto *-*-ptx*)
3338181834Sroberto    ans=tick
3339181834Sroberto    ;;
3340181834Sroberto *-*-sco3.2v[[45]]*)
3341181834Sroberto    ans=no
3342181834Sroberto    ;;
3343181834Sroberto *-*-solaris2*)
3344181834Sroberto    ans=nsec_per_tick
3345181834Sroberto    ;;
3346181834Sroberto *-*-sysv4*)
3347181834Sroberto    ans=tick
3348181834Sroberto    ;;
3349181834Srobertoesac
3350181834Srobertoac_cv_var_nlist_tick=$ans])
3351181834Srobertocase "$ac_cv_var_nlist_tick" in
3352181834Sroberto ''|no) ;;	# HMS: I think we can only get 'no' here...
3353181834Sroberto *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
3354181834Srobertoesac
3355181834Sroberto#
3356181834SrobertoAC_CACHE_CHECK([for the units of 'tick'],
3357181834Srobertoac_cv_var_tick_nano,
3358181834Sroberto[ans=usec
3359181834Srobertocase "$host" in
3360181834Sroberto *-*-solaris2*)
3361181834Sroberto    ans=nsec
3362181834Sroberto    ;;
3363181834Srobertoesac
3364181834Srobertoac_cv_var_tick_nano=$ans])
3365181834Srobertocase "$ac_cv_var_tick_nano" in
3366181834Sroberto nsec)
3367181834Sroberto    AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
3368181834Sroberto    ;;
3369181834Srobertoesac
3370181834Sroberto#
3371181834SrobertoAC_CACHE_CHECK([the name of 'tickadj' in the kernel],
3372181834Srobertoac_cv_var_nlist_tickadj,
3373181834Sroberto[ans=_tickadj
3374181834Srobertocase "$host" in
3375181834Sroberto m68*-hp-hpux*) # HP9000/300?
3376181834Sroberto    ans=_tickadj
3377181834Sroberto    ;;
3378181834Sroberto *-apple-aux[[23]]*)
3379181834Sroberto    ans=tickadj
3380181834Sroberto    ;;
3381181834Sroberto *-hp-hpux10*)
3382181834Sroberto    ans=no
3383181834Sroberto    ;;
3384181834Sroberto *-hp-hpux9*)
3385181834Sroberto    ans=no
3386181834Sroberto    ;;
3387181834Sroberto *-hp-hpux*)
3388181834Sroberto    ans=tickadj
3389181834Sroberto    ;;
3390181834Sroberto *-*-aix*)
3391181834Sroberto    ans=tickadj
3392181834Sroberto    ;;
3393181834Sroberto *-*-mpeix*)
3394181834Sroberto    ans=no
3395181834Sroberto    ;;
3396181834Sroberto *-*-ptx*)
3397181834Sroberto    ans=tickadj
3398181834Sroberto    ;;
3399181834Sroberto *-*-sco3.2v4*)
3400181834Sroberto    ans=no
3401181834Sroberto    ;;
3402181834Sroberto *-*-sco3.2v5.0*)
3403181834Sroberto    ans=clock_drift
3404181834Sroberto    ;;
3405181834Sroberto *-*-solaris2*)
3406181834Sroberto    ans=no	# hrestime_adj
3407181834Sroberto    ;;
3408181834Sroberto *-*-sysv4*)
3409181834Sroberto    ans=tickadj
3410181834Sroberto    ;;
3411181834Srobertoesac
3412181834Srobertoac_cv_var_nlist_tickadj=$ans])
3413181834Srobertocase "$ac_cv_var_nlist_tickadj" in
3414181834Sroberto ''|no) ;;	# HMS: I think we can only get 'no' here...
3415181834Sroberto *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
3416181834Srobertoesac
3417181834Sroberto#
3418181834SrobertoAC_CACHE_CHECK([for the units of 'tickadj'],
3419181834Srobertoac_cv_var_tickadj_nano,
3420181834Sroberto[ans=usec
3421181834Srobertocase "$host" in
3422181834Sroberto *-*-solaris2*)
3423181834Sroberto    ans=nsec
3424181834Sroberto    ;;
3425181834Srobertoesac
3426181834Srobertoac_cv_var_tickadj_nano=$ans])
3427181834Srobertocase "$ac_cv_var_tickadj_nano" in
3428181834Sroberto nsec)
3429181834Sroberto    AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
3430181834Sroberto    ;;
3431181834Srobertoesac
3432181834Sroberto#
3433181834SrobertoAC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
3434181834Srobertoac_cv_var_nlist_dosynctodr,
3435181834Sroberto[case "$host" in
3436181834Sroberto *-apple-aux[[23]]*)
3437181834Sroberto    ans=no
3438181834Sroberto    ;;
3439181834Sroberto *-sni-sysv*)
3440181834Sroberto    ans=dosynctodr
3441181834Sroberto    ;;
3442181834Sroberto *-*-aix*)
3443181834Sroberto    ans=dosynctodr
3444181834Sroberto    ;;
3445181834Sroberto *-*-hpux*)
3446181834Sroberto    ans=no
3447181834Sroberto    ;;
3448181834Sroberto *-*-mpeix*)
3449181834Sroberto    ans=no
3450181834Sroberto    ;;
3451181834Sroberto *-*-nextstep*)
3452181834Sroberto    ans=_dosynctodr
3453181834Sroberto    ;;
3454181834Sroberto *-*-ptx*)
3455181834Sroberto    ans=doresettodr
3456181834Sroberto    ;;
3457181834Sroberto *-*-sco3.2v4*)
3458181834Sroberto    ans=no
3459181834Sroberto    ;;
3460181834Sroberto *-*-sco3.2v5*)
3461181834Sroberto    ans=track_rtc
3462181834Sroberto    ;;
3463181834Sroberto *-*-solaris2*)
3464181834Sroberto    ans=dosynctodr
3465181834Sroberto    ;;
3466181834Sroberto *-*-sysv4*)
3467181834Sroberto    ans=doresettodr
3468181834Sroberto    ;;
3469181834Sroberto *)
3470181834Sroberto    ans=_dosynctodr
3471181834Sroberto    ;;
3472181834Srobertoesac
3473181834Srobertoac_cv_var_nlist_dosynctodr=$ans])
3474181834Srobertocase "$ac_cv_var_nlist_dosynctodr" in
3475181834Sroberto no) ;;
3476181834Sroberto *)  AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
3477181834Sroberto     ;;
3478181834Srobertoesac
3479181834Sroberto#
3480181834SrobertoAC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
3481181834Srobertoac_cv_var_nlist_noprintf,
3482181834Sroberto[case "$host" in
3483181834Sroberto *-apple-aux[[23]]*)
3484181834Sroberto    ans=no
3485181834Sroberto    ;;
3486181834Sroberto *-sni-sysv*)
3487181834Sroberto    ans=noprintf
3488181834Sroberto    ;;
3489181834Sroberto *-*-aix*)
3490181834Sroberto    ans=noprintf
3491181834Sroberto    ;;
3492181834Sroberto *-*-hpux*)
3493181834Sroberto    ans=no
3494181834Sroberto    ;;
3495181834Sroberto *-*-mpeix*)
3496181834Sroberto    ans=no
3497181834Sroberto    ;;
3498181834Sroberto *-*-ptx*)
3499181834Sroberto    ans=noprintf
3500181834Sroberto    ;;
3501181834Sroberto *-*-nextstep*)
3502181834Sroberto    ans=_noprintf
3503181834Sroberto    ;;
3504181834Sroberto *-*-solaris2*)
3505181834Sroberto    ans=noprintf
3506181834Sroberto    ;;
3507181834Sroberto *-*-sysv4*)
3508181834Sroberto    ans=noprintf
3509181834Sroberto    ;;
3510181834Sroberto *)
3511181834Sroberto    ans=_noprintf
3512181834Sroberto    ;;
3513181834Srobertoesac
3514181834Srobertoac_cv_var_nlist_noprintf=$ans])
3515181834Srobertocase "$ac_cv_var_nlist_noprintf" in
3516181834Sroberto no) ;;
3517181834Sroberto *)  AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
3518181834Sroberto     ;;
3519181834Srobertoesac
3520181834Sroberto
3521181834Srobertodnl The tick/tickadj sections were written by Skippy, who never learned
3522181834Srobertodnl that it's impolite (horridly gross) to show your guts in public.
3523181834Sroberto
3524181834Srobertodnl	tick		tickadj	
3525181834Srobertodnl	10000		80	    Unixware
3526181834Srobertodnl	1000000L/hz	tick/16     (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3527181834Srobertodnl	10000		150	    sgi IRIX
3528181834Srobertodnl	1000000L/hz	1000	    RS6000 && NOKMEM
3529181834Srobertodnl	1000000L/hz	668	    DOMAINOS && NOKMEM
3530181834Srobertodnl	1000000L/hz	500/HZ	    other && NOKMEM
3531181834Srobertodnl	txc.tick	1	    Linux
3532181834Srobertodnl	(every / 10)	50	    WinNT - tickadj is roughly 500/hz
3533181834Srobertodnl	1000000L/hz	(nlist)     (Solaris && !ADJTIME_IS_ACCURATE),
3534181834Srobertodnl				    (RS6000 && !NOKMEM), SINIX MIPS
3535181834Sroberto
3536181834Srobertodnl But we'll only use these "values" if we can't find anything else.
3537181834Sroberto
3538181834SrobertoAC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
3539181834Sroberto[AC_ARG_ENABLE(tick,
3540181834Sroberto  AC_HELP_STRING([--enable-tick=VALUE], [s force a value for 'tick']),
3541181834Sroberto    [ans=$enableval],
3542181834Sroberto    [ans=no
3543181834Sroberto     case "$host" in
3544181834Sroberto      XXX-*-pc-cygwin*)
3545181834Sroberto	 ;;
3546181834Sroberto      *-univel-sysv*)
3547181834Sroberto	 ans=10000
3548181834Sroberto	 ;;
3549181834Sroberto      *-*-irix*)
3550181834Sroberto	 ans=10000
3551181834Sroberto	 ;;
3552181834Sroberto      *-*-linux*)
3553181834Sroberto	 ans=txc.tick
3554181834Sroberto	 ;;
3555181834Sroberto      *-*-mpeix*)
3556181834Sroberto	 ans=no
3557181834Sroberto	 ;;
3558181834Sroberto      *-*-winnt3.5)
3559181834Sroberto	 ans='(every / 10)'
3560181834Sroberto	 ;;
3561181834Sroberto      *-*-unicosmp*)
3562181834Sroberto	 ans=10000
3563181834Sroberto	 ;;
3564181834Sroberto      *)
3565181834Sroberto	 ans='1000000L/hz'
3566181834Sroberto	 ;;
3567181834Sroberto     esac])
3568181834Srobertoac_cv_var_tick=$ans])
3569181834Srobertocase "$ac_cv_var_tick" in
3570181834Sroberto ''|no) ;;	# HMS: I think we can only get 'no' here...
3571181834Sroberto *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick, [Preset a value for 'tick'?]) ;;
3572181834Srobertoesac
3573181834Sroberto
3574181834SrobertoAC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
3575181834Sroberto[AC_ARG_ENABLE(tickadj,
3576181834Sroberto  AC_HELP_STRING([--enable-tickadj=VALUE], [s force a value for 'tickadj']),
3577181834Sroberto  [ans=$enableval],
3578181834Sroberto  [ans='500/hz'
3579181834Sroberto  case "$host" in
3580181834Sroberto   *-fujitsu-uxp*)
3581181834Sroberto      case "$ac_cv_var_adjtime_is_accurate" in
3582181834Sroberto       yes) ans='tick/16' ;;
3583181834Sroberto      esac
3584181834Sroberto      ;;
3585181834Sroberto   XXX-*-pc-cygwin*)
3586181834Sroberto      ans=no
3587181834Sroberto      ;;
3588181834Sroberto   *-univel-sysv*)
3589181834Sroberto      ans=80
3590181834Sroberto      ;;
3591181834Sroberto   *-*-aix*)
3592181834Sroberto      case "$ac_cv_var_can_kmem" in
3593181834Sroberto       no) ans=1000 ;;
3594181834Sroberto      esac
3595181834Sroberto      ;;
3596181834Sroberto   *-*-domainos)	# Skippy: won't be found...
3597181834Sroberto      case "$ac_cv_var_can_kmem" in
3598181834Sroberto       no) ans=668 ;;
3599181834Sroberto      esac
3600181834Sroberto      ;;
3601181834Sroberto   *-*-hpux*)
3602181834Sroberto      case "$ac_cv_var_adjtime_is_accurate" in
3603181834Sroberto       yes) ans='tick/16' ;;
3604181834Sroberto      esac
3605181834Sroberto      ;;
3606181834Sroberto   *-*-irix*)
3607181834Sroberto      ans=150
3608181834Sroberto      ;;
3609181834Sroberto   *-*-mpeix*)
3610181834Sroberto      ans=no
3611181834Sroberto      ;;
3612181834Sroberto   *-*-sco3.2v5.0*)
3613181834Sroberto      ans=10000L/hz
3614181834Sroberto      ;;
3615181834Sroberto   *-*-solaris2*)
3616181834Sroberto      case "$ac_cv_var_adjtime_is_accurate" in
3617181834Sroberto       yes)
3618181834Sroberto          #ans='tick/16'
3619181834Sroberto	  ;;
3620181834Sroberto      esac
3621181834Sroberto      ;;
3622181834Sroberto   *-*-winnt3.5)
3623181834Sroberto      ans=50
3624181834Sroberto      ;;
3625181834Sroberto   *-*-unicosmp*)
3626181834Sroberto      ans=150
3627181834Sroberto      ;;
3628181834Sroberto  esac])
3629181834Srobertoac_cv_var_tickadj=$ans])
3630181834Srobertocase "$ac_cv_var_tickadj" in
3631181834Sroberto ''|no) ;;	# HMS: I think we can only get 'no' here...
3632181834Sroberto *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj, [Preset a value for 'tickadj'?]) ;;
3633181834Srobertoesac
3634181834Sroberto
3635181834Sroberto# Newer versions of ReliantUNIX round adjtime() values down to
3636181834Sroberto# 1/100s (system tick). Sigh ...
3637181834Sroberto# Unfortunately, there is no easy way to know if particular release
3638181834Sroberto# has this "feature" or any obvious way to test for it.
3639181834Srobertocase "$host" in
3640181834Sroberto mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
3641181834Srobertoesac
3642181834Sroberto
3643181834Srobertocase "$host" in
3644181834Sroberto *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
3645181834Srobertoesac
3646181834Sroberto
3647181834Srobertoac_cv_make_tickadj=yes
3648181834Srobertocase "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
3649181834Sroberto nonono)	# Don't read KMEM, no presets.  Bogus.
3650181834Sroberto    AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ.  No tickadj.)
3651181834Sroberto    ac_cv_make_tickadj=no
3652181834Sroberto    ;;
3653181834Sroberto nono*)		# Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
3654181834Sroberto    AC_MSG_WARN(Can't read kmem but no PRESET_TICK.  No tickadj.)
3655181834Sroberto    ac_cv_make_tickadj=no
3656181834Sroberto    ;;
3657181834Sroberto no*no)		# Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Bogus.
3658181834Sroberto    AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ.  No tickadj.)
3659181834Sroberto    ac_cv_make_tickadj=no
3660181834Sroberto    ;;
3661181834Sroberto no*)		# Don't read KMEM, PRESET_TICK and PRESET_TICKADJ.  Cool.
3662181834Sroberto    ;;
3663181834Sroberto yesnono)	# Read KMEM, no presets.  Cool.
3664181834Sroberto    ;;
3665181834Sroberto yesno*)	# Read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
3666181834Sroberto    AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK.  Please report this.)
3667181834Sroberto    ;;
3668181834Sroberto yes*no)	# Read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Cool.
3669181834Sroberto    ;;
3670181834Sroberto yes*)		# READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3671181834Sroberto    ;;
3672181834Sroberto *)		# Generally bogus.
3673181834Sroberto    AC_MSG_ERROR(This shouldn't happen.)
3674181834Sroberto    ;;
3675181834Srobertoesac
3676181834Sroberto
3677181834SrobertoAC_SUBST(MAKE_NTPTIME)
3678181834SrobertoAC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
3679181834Sroberto[case "$host" in
3680181834Sroberto *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
3681181834Sroberto     yesyes)
3682181834Sroberto	ans=yes
3683181834Sroberto	;;
3684181834Sroberto     *)
3685181834Sroberto	ans=no
3686181834Sroberto	;;
3687181834Sroberto    esac
3688181834Sroberto    ;;
3689181834Srobertoesac
3690181834Srobertoac_cv_make_ntptime=$ans])
3691181834Srobertocase "$ac_cv_make_ntptime" in
3692181834Sroberto yes)
3693181834Sroberto    MAKE_NTPTIME=ntptime
3694181834Sroberto    ;;
3695181834Srobertoesac
3696181834Sroberto
3697181834SrobertoAC_SUBST(MAKE_TICKADJ)
3698181834Srobertocase "$host" in
3699181834Sroberto mips-sni-sysv4*)
3700181834Sroberto    # tickadj is pretty useless on newer versions of ReliantUNIX
3701181834Sroberto    # Do not bother
3702181834Sroberto    ac_cv_make_tickadj=no
3703181834Sroberto    ;;
3704181834Sroberto *-*-irix*)
3705181834Sroberto    ac_cv_make_tickadj=no
3706181834Sroberto    ;;
3707181834Sroberto *-*-solaris2*)
3708181834Sroberto    # DLM says tickadj is a no-no starting with solaris2.5
3709181834Sroberto    case "$host" in
3710181834Sroberto     *-*-solaris2.1[[0-9]]*)
3711181834Sroberto	ac_cv_make_tickadj=no
3712181834Sroberto	;;
3713181834Sroberto     *-*-solaris2.[[0-4]]*) ;;
3714181834Sroberto     *) ac_cv_make_tickadj=no ;;
3715181834Sroberto    esac
3716181834Sroberto    ;;
3717181834Sroberto *-*-unicosmp*)
3718181834Sroberto    ac_cv_make_tickadj=no
3719181834Sroberto    ;;
3720181834Srobertoesac
3721181834SrobertoAC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
3722181834Srobertoac_cv_make_tickadj=yes)
3723181834Srobertocase "$ac_cv_make_tickadj" in
3724181834Sroberto yes)
3725181834Sroberto    MAKE_TICKADJ=tickadj
3726181834Sroberto    ;;
3727181834Srobertoesac
3728181834Sroberto
3729181834SrobertoAC_SUBST(MAKE_TIMETRIM)
3730181834SrobertoAC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
3731181834Sroberto[case "$host" in
3732181834Sroberto *-*-irix*)
3733181834Sroberto    ac_cv_make_timetrim=yes
3734181834Sroberto    ;;
3735181834Sroberto *-*-unicosmp*)
3736181834Sroberto    ac_cv_make_timetrim=yes
3737181834Sroberto    ;;
3738181834Sroberto *)
3739181834Sroberto    ac_cv_make_timetrim=no
3740181834Sroberto    ;;
3741181834Srobertoesac])
3742181834Srobertocase "$ac_cv_make_timetrim" in
3743181834Sroberto yes)
3744181834Sroberto    MAKE_TIMETRIM=timetrim
3745181834Sroberto    ;;
3746181834Srobertoesac
3747181834Sroberto
3748181834SrobertoAC_SUBST(MAKE_LIBNTPSIM)
3749181834SrobertoAC_SUBST(MAKE_NTPDSIM)
3750181834SrobertoAC_CACHE_CHECK([if we want to build the NTPD simulator], ac_cv_var_ntpd_sim,
3751181834Sroberto[AC_ARG_ENABLE(simulator,
3752181834Sroberto    AC_HELP_STRING([--enable-simulator], [- build/install the NTPD simulator?]),
3753181834Sroberto    [ans=$enableval], [ans=no])
3754181834Srobertoac_cv_var_ntpd_sim=$ans])
3755181834Srobertocase "$ac_cv_var_ntpd_sim" in
3756181834Sroberto yes)
3757181834Sroberto    MAKE_NTPDSIM=ntpdsim
3758181834Sroberto    MAKE_LIBNTPSIM=libntpsim.a
3759181834Sroberto    ;;
3760181834Srobertoesac
3761181834Sroberto
3762181834Srobertocase "$build" in
3763181834Sroberto $host)
3764181834Sroberto    ;;
3765181834Sroberto *) case "$host" in
3766181834Sroberto     *-*-vxworks*)
3767181834Sroberto        LDFLAGS="$LDFLAGS -r"
3768181834Sroberto        ;;
3769181834Sroberto    esac
3770181834Sroberto    ;;
3771181834Srobertoesac
3772181834Sroberto
3773181834SrobertoAC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3774181834Sroberto[AC_ARG_ENABLE(slew-always,
3775181834Sroberto   AC_HELP_STRING([--enable-slew-always], [s always slew the time]),
3776181834Sroberto    [ans=$enableval],
3777181834Sroberto    [case "$host" in
3778181834Sroberto      *-apple-aux[[23]]*)
3779181834Sroberto	 ans=yes
3780181834Sroberto	 ;;
3781181834Sroberto      *-*-bsdi[[012]]*)
3782181834Sroberto	 ans=no
3783181834Sroberto	 ;;
3784181834Sroberto      *-*-bsdi*)
3785181834Sroberto	 ans=yes
3786181834Sroberto	 ;;
3787181834Sroberto      *-*-openvms*)	# HMS: won't be found
3788181834Sroberto	 ans=yes
3789181834Sroberto	 ;;
3790181834Sroberto      *) ans=no
3791181834Sroberto	 ;;
3792181834Sroberto     esac
3793181834Sroberto     ])
3794181834Srobertoac_cv_var_slew_always=$ans])
3795181834Srobertocase "$ac_cv_var_slew_always" in
3796181834Sroberto yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
3797181834Srobertoesac
3798181834Sroberto
3799181834SrobertoAC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3800181834Sroberto[AC_ARG_ENABLE(step-slew,
3801181834Sroberto   AC_HELP_STRING([--enable-step-slew], [s step and slew the time]),
3802181834Sroberto    [ans=$enableval],
3803181834Sroberto    [case "$host" in
3804181834Sroberto      *-sni-sysv*)
3805181834Sroberto	 ans=yes
3806181834Sroberto	 ;;
3807181834Sroberto      *-univel-sysv*)
3808181834Sroberto	 ans=no
3809181834Sroberto	 ;;
3810181834Sroberto      *-*-ptx*)
3811181834Sroberto	 ans=yes
3812181834Sroberto	 ;;
3813181834Sroberto      *-*-solaris2.1[[0-9]]*)
3814181834Sroberto	 ans=no
3815181834Sroberto	 ;;
3816181834Sroberto      *-*-solaris2.[[012]]*)
3817181834Sroberto	 ans=yes
3818181834Sroberto	 ;;
3819181834Sroberto      *-*-sysv4*)	# HMS: Does this catch Fujitsu UXP?
3820181834Sroberto	 ans=yes
3821181834Sroberto	 ;;
3822181834Sroberto      *) ans=no
3823181834Sroberto	 ;;
3824181834Sroberto     esac
3825181834Sroberto     ])
3826181834Srobertoac_cv_var_step_slew=$ans])
3827181834Srobertocase "$ac_cv_var_step_slew" in
3828181834Sroberto yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
3829181834Srobertoesac
3830181834Sroberto
3831181834SrobertoAC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3832181834Sroberto[AC_ARG_ENABLE(ntpdate-step,
3833181834Sroberto   AC_HELP_STRING([--enable-ntpdate-step], [s if ntpdate should step the time]),
3834181834Sroberto    [ans=$enableval],
3835181834Sroberto    [case "$host" in
3836181834Sroberto      *-apple-aux[[23]]*)
3837181834Sroberto	 ans=yes
3838181834Sroberto	 ;;
3839181834Sroberto      *) ans=no
3840181834Sroberto	 ;;
3841181834Sroberto     esac
3842181834Sroberto     ])
3843181834Srobertoac_cv_var_ntpdate_step=$ans])
3844181834Srobertocase "$ac_cv_var_ntpdate_step" in
3845181834Sroberto yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
3846181834Srobertoesac
3847181834Sroberto
3848181834SrobertoAC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3849181834Sroberto[AC_ARG_ENABLE(hourly-todr-sync,
3850181834Sroberto   AC_HELP_STRING([--enable-hourly-todr-sync],
3851181834Sroberto		  [s if we should sync TODR hourly]),
3852181834Sroberto    [ans=$enableval],
3853181834Sroberto    [case "$host" in
3854181834Sroberto      *-*-nextstep*)
3855181834Sroberto	 ans=yes
3856181834Sroberto	 ;;
3857181834Sroberto      *-*-openvms*)	# HMS: won't be found
3858181834Sroberto	 ans=yes
3859181834Sroberto	 ;;
3860181834Sroberto      *) ans=no
3861181834Sroberto	 ;;
3862181834Sroberto     esac])
3863181834Srobertoac_cv_var_sync_todr=$ans])
3864181834Srobertocase "$ac_cv_var_sync_todr" in
3865181834Sroberto yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
3866181834Srobertoesac
3867181834Sroberto
3868181834SrobertoAC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3869181834Sroberto[AC_ARG_ENABLE(kernel-fll-bug,
3870181834Sroberto   AC_HELP_STRING([--enable-kernel-fll-bug],
3871181834Sroberto		  [s if we should avoid a kernel FLL bug]),
3872181834Sroberto    [ans=$enableval],
3873181834Sroberto    [case "$host" in
3874181834Sroberto     *-*-solaris2.6)
3875181834Sroberto	 unamev=`uname -v`
3876181834Sroberto	 case "$unamev" in
3877181834Sroberto	  Generic_105181-*)
3878181834Sroberto	     old_IFS="$IFS"
3879181834Sroberto	     IFS="-"
3880181834Sroberto	     set $unamev
3881181834Sroberto	     IFS="$old_IFS"
3882181834Sroberto	     if test "$2" -ge 17
3883181834Sroberto	     then
3884181834Sroberto	        # Generic_105181-17 and higher
3885181834Sroberto	        ans=no
3886181834Sroberto	     else
3887181834Sroberto	        ans=yes
3888181834Sroberto	     fi
3889181834Sroberto	     ;;
3890181834Sroberto	  *) ans=yes
3891181834Sroberto	     ;;
3892181834Sroberto	 esac
3893181834Sroberto	 ;;
3894181834Sroberto     *-*-solaris2.7)
3895181834Sroberto	 unamev=`uname -v`
3896181834Sroberto	 case "$unamev" in
3897181834Sroberto	  Generic_106541-*)
3898181834Sroberto	     old_IFS="$IFS"
3899181834Sroberto	     IFS="-"
3900181834Sroberto	     set $unamev
3901181834Sroberto	     IFS="$old_IFS"
3902181834Sroberto	     if test "$2" -ge 07
3903181834Sroberto	     then
3904181834Sroberto	        # Generic_106541-07 and higher
3905181834Sroberto	        ans=no
3906181834Sroberto	     else
3907181834Sroberto	        ans=yes
3908181834Sroberto	     fi
3909181834Sroberto	     ;;
3910181834Sroberto	  *) ans=yes
3911181834Sroberto	     ;;
3912181834Sroberto	 esac
3913181834Sroberto	 ;;
3914181834Sroberto     *) ans=no
3915181834Sroberto	 ;;
3916181834Sroberto    esac
3917181834Sroberto    ])
3918181834Srobertoac_cv_var_kernel_fll_bug=$ans])
3919181834Srobertocase "$ac_cv_var_kernel_fll_bug" in
3920181834Sroberto yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
3921181834Srobertoesac
3922181834Sroberto
3923181834SrobertoAC_CACHE_CHECK(if we should use the IRIG sawtooth filter, ac_cv_var_irig_sucks,
3924181834Sroberto[AC_ARG_ENABLE(irig-sawtooth, 
3925181834Sroberto	AC_HELP_STRING([--enable-irig-sawtooth],
3926181834Sroberto		       [s if we should enable the IRIG sawtooth filter]),
3927181834Sroberto    [ans=$enableval],
3928181834Sroberto    [case "$host" in
3929181834Sroberto     *-*-solaris2.[[89]])
3930181834Sroberto	ans=yes
3931181834Sroberto	;;
3932181834Sroberto     *-*-solaris2.1[[0-9]]*)
3933181834Sroberto	ans=yes
3934181834Sroberto	;;
3935181834Sroberto     *) ans=no
3936181834Sroberto	;;
3937181834Sroberto    esac
3938181834Sroberto    ])
3939181834Srobertoac_cv_var_irig_sucks=$ans])
3940181834Srobertocase "$ac_cv_var_irig_sucks" in
3941181834Sroberto yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
3942181834Srobertoesac
3943181834Sroberto
3944181834SrobertoAC_CACHE_CHECK(if we should enable NIST lockclock scheme, ac_cv_var_nist_lockclock,
3945181834Sroberto[AC_ARG_ENABLE(nist, 
3946181834Sroberto	AC_HELP_STRING([--enable-nist],
3947181834Sroberto		       [- if we should enable the NIST lockclock scheme]),
3948181834Sroberto    [ans=$enableval],[ans=no])
3949181834Srobertoac_cv_var_nist_lockclock=$ans])
3950181834Srobertocase "$ac_cv_var_nist_lockclock" in
3951181834Sroberto yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
3952181834Srobertoesac
3953181834Sroberto
3954181834Sroberto#
3955181834Sroberto# ISC stuff
3956181834Sroberto#
3957181834Sroberto
3958181834Srobertoif test $ac_cv_struct_sockaddr_has_sa_len = yes; then
3959181834Sroberto    AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[ISC: struct sockaddr as sa_len?])
3960181834Srobertofi
3961181834Sroberto
3962181834SrobertoAC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [s use IPv6?]))
3963181834Sroberto
3964181834Srobertocase "$enable_ipv6" in
3965181834Sroberto yes|''|autodetect)
3966181834Sroberto    case "$host" in
3967181834Sroberto     powerpc-ibm-aix4*) ;;
3968181834Sroberto     *)
3969181834Sroberto	AC_DEFINE(WANT_IPV6, ,[ISC: Want IPv6?])
3970181834Sroberto	;;
3971181834Sroberto    esac
3972181834Sroberto    ;;
3973181834Sroberto no)
3974181834Sroberto    ;;
3975181834Srobertoesac
3976181834Sroberto
3977181834SrobertoAC_MSG_CHECKING(for IPv6 structures)
3978181834SrobertoAC_TRY_COMPILE([
3979181834Sroberto#include <sys/types.h>
3980181834Sroberto#include <sys/socket.h>
3981181834Sroberto#include <netinet/in.h>],
3982181834Sroberto[struct sockaddr_in6 sin6; return (0);],
3983181834Sroberto	[AC_MSG_RESULT(yes)
3984181834Sroberto	 found_ipv6=yes],
3985181834Sroberto	[AC_MSG_RESULT(no)
3986181834Sroberto	 found_ipv6=no])
3987181834Sroberto
3988181834Sroberto#
3989181834Sroberto# See whether IPv6 support is provided via a Kame add-on.
3990181834Sroberto# This is done before other IPv6 linking tests so LIBS is properly set.
3991181834Sroberto#
3992181834SrobertoAC_MSG_CHECKING(for Kame IPv6 support)
3993181834SrobertoAC_ARG_WITH(kame,
3994181834Sroberto	AC_HELP_STRING([--with-kame], [- =/usr/local/v6]),
3995181834Sroberto	use_kame="$withval", use_kame="no")
3996181834Sroberto
3997181834Srobertocase "$use_kame" in
3998181834Sroberto	no)
3999181834Sroberto		;;
4000181834Sroberto	yes)
4001181834Sroberto		kame_path=/usr/local/v6
4002181834Sroberto		;;
4003181834Sroberto	*)
4004181834Sroberto		kame_path="$use_kame"
4005181834Sroberto		;;
4006181834Srobertoesac
4007181834Sroberto
4008181834Srobertocase "$use_kame" in
4009181834Sroberto	no)
4010181834Sroberto		AC_MSG_RESULT(no)
4011181834Sroberto		;;
4012181834Sroberto	*)
4013181834Sroberto		if test -f $kame_path/lib/libinet6.a; then
4014181834Sroberto			AC_MSG_RESULT($kame_path/lib/libinet6.a)
4015181834Sroberto			LIBS="-L$kame_path/lib -linet6 $LIBS"
4016181834Sroberto		else
4017181834Sroberto			AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
4018181834Sroberto
4019181834SrobertoPlease choose the proper path with the following command:
4020181834Sroberto
4021181834Sroberto    configure --with-kame=PATH
4022181834Sroberto])
4023181834Sroberto		fi
4024181834Sroberto		;;
4025181834Srobertoesac
4026181834Sroberto
4027181834Sroberto#
4028181834Sroberto# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
4029181834Sroberto# Including it on Kame-using platforms is very bad, though, because
4030181834Sroberto# Kame uses #error against direct inclusion.   So include it on only
4031181834Sroberto# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
4032181834Sroberto# This is done before the in6_pktinfo check because that's what
4033181834Sroberto# netinet6/in6.h is needed for.
4034181834Sroberto#
4035181834Srobertocase "$host" in
4036181834Sroberto*-bsdi4.[[01]]*)
4037181834Sroberto	ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
4038181834Sroberto	LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
4039181834Sroberto	isc_netinet6in6_hack="#include <netinet6/in6.h>"
4040181834Sroberto	;;
4041181834Sroberto*)
4042181834Sroberto	ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
4043181834Sroberto	LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
4044181834Sroberto	isc_netinet6in6_hack=""
4045181834Sroberto	;;
4046181834Srobertoesac
4047181834Sroberto
4048181834Sroberto#
4049181834Sroberto# This is similar to the netinet6/in6.h issue.
4050181834Sroberto#
4051181834Srobertocase "$host" in
4052181834Sroberto*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
4053181834Sroberto        # UnixWare
4054181834Sroberto	# ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
4055181834Sroberto	# LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
4056181834Sroberto	AC_DEFINE(ISC_PLATFORM_FIXIN6ISADDR, 1,[Do we need to fix in6isaddr?])
4057181834Sroberto	isc_netinetin6_hack="#include <netinet/in6.h>"
4058181834Sroberto	;;
4059181834Sroberto*)
4060181834Sroberto	# ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
4061181834Sroberto	# LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
4062181834Sroberto        # ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
4063181834Sroberto	isc_netinetin6_hack=""
4064181834Sroberto	;;
4065181834Srobertoesac
4066181834Sroberto
4067181834Sroberto
4068181834SrobertoAC_MSG_CHECKING([for struct if_laddrconf])
4069181834SrobertoAC_TRY_LINK([
4070181834Sroberto#include <sys/types.h>
4071181834Sroberto#include <net/if6.h>
4072181834Sroberto],[ struct if_laddrconf a; ],
4073181834Sroberto	[AC_MSG_RESULT(yes)
4074181834Sroberto	 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, ,
4075181834Sroberto		[ISC: have struct if_laddrconf?])],
4076181834Sroberto	[AC_MSG_RESULT(no)])
4077181834Sroberto
4078181834SrobertoAC_MSG_CHECKING([for struct if_laddrreq])
4079181834SrobertoAC_TRY_LINK([
4080181834Sroberto#include <sys/types.h>
4081181834Sroberto#include <net/if6.h>
4082181834Sroberto],[ struct if_laddrreq a; ],
4083181834Sroberto	[AC_MSG_RESULT(yes)
4084181834Sroberto	 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, ,
4085181834Sroberto		[ISC: have struct if_laddrreq?])],
4086181834Sroberto	[AC_MSG_RESULT(no)])
4087181834Sroberto
4088181834Srobertocase "$found_ipv6" in
4089181834Sroberto yes)
4090181834Sroberto    AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[ISC: Have IPv6?])
4091181834Sroberto
4092181834Sroberto    AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , ,
4093181834Sroberto[
4094181834Sroberto#include <sys/types.h>
4095181834Sroberto#include <sys/socket.h>
4096181834Sroberto#include <netinet/in.h>
4097181834Sroberto$isc_netinetin6_hack
4098181834Sroberto$isc_netinet6in6_hack
4099181834Sroberto])
4100181834Sroberto
4101181834Sroberto    AC_MSG_CHECKING(for in6_pktinfo)
4102181834Sroberto    AC_TRY_COMPILE([
4103181834Sroberto#include <sys/types.h>
4104181834Sroberto#include <sys/socket.h>
4105181834Sroberto#include <netinet/in.h>
4106181834Sroberto$isc_netinetin6_hack
4107181834Sroberto$isc_netinet6in6_hack
4108181834Sroberto],
4109181834Sroberto	[struct in6_pktinfo xyzzy; return (0);],
4110181834Sroberto	[AC_MSG_RESULT(yes)
4111181834Sroberto	 AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, ,
4112181834Sroberto		[ISC: Have struct in6_pktinfo?])],
4113181834Sroberto	[AC_MSG_RESULT(no -- disabling runtime ipv6 support)])
4114181834Sroberto
4115181834Sroberto    # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
4116181834Sroberto    AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
4117181834Sroberto    AC_TRY_COMPILE([
4118181834Sroberto#include <sys/types.h>
4119181834Sroberto#include <sys/socket.h>
4120181834Sroberto#include <netinet/in.h>
4121181834Sroberto$isc_netinetin6_hack
4122181834Sroberto$isc_netinet6in6_hack
4123181834Sroberto],
4124181834Sroberto	[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
4125181834Sroberto	[AC_MSG_RESULT(yes)
4126181834Sroberto	 AC_DEFINE(ISC_PLATFORM_HAVESCOPEID, ,
4127181834Sroberto		[ISC: Have sin6_scope_id?])],
4128181834Sroberto	 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
4129181834Sroberto	[AC_MSG_RESULT(no)
4130181834Sroberto	 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
4131181834Sroberto	 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
4132181834Sroberto    LWRES_HAVE_SIN6_SCOPE_ID="$result"
4133181834Sroberto
4134181834Sroberto    ;;
4135181834Srobertoesac
4136181834Sroberto
4137181834Sroberto# We need this check run all the time...
4138181834SrobertoAC_MSG_CHECKING(for in6addr_any)
4139181834SrobertoAC_TRY_LINK([
4140181834Sroberto#include <sys/types.h>
4141181834Sroberto#include <sys/socket.h>
4142181834Sroberto#include <netinet/in.h>
4143181834Sroberto$isc_netinetin6_hack
4144181834Sroberto$isc_netinet6in6_hack
4145181834Sroberto$isc_in_addr6_hack
4146181834Sroberto],
4147181834Sroberto	[[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);]],
4148181834Sroberto	[AC_MSG_RESULT(yes)],
4149181834Sroberto	[AC_MSG_RESULT(no)
4150181834Sroberto	 AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, ,
4151181834Sroberto		[ISC: Need in6addr_any?])]
4152181834Sroberto)
4153181834Sroberto
4154181834Sroberto#
4155181834Sroberto# Look for a sysctl call to get the list of network interfaces.
4156181834Sroberto#
4157181834SrobertoAC_MSG_CHECKING(for interface list sysctl)
4158181834SrobertoAC_EGREP_CPP(found_rt_iflist, [
4159181834Sroberto#include <sys/param.h>
4160181834Sroberto#include <sys/sysctl.h>
4161181834Sroberto#include <sys/socket.h>
4162181834Sroberto#ifdef NET_RT_IFLIST  
4163181834Srobertofound_rt_iflist
4164181834Sroberto#endif
4165181834Sroberto],
4166181834Sroberto        [AC_MSG_RESULT(yes)
4167181834Sroberto         AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[ISC: Use iflist_sysctl?])],
4168181834Sroberto        [AC_MSG_RESULT(no)])
4169181834Sroberto
4170181834Sroberto###
4171181834Sroberto
4172181834SrobertoAC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
4173181834Sroberto
4174181834SrobertoAC_CONFIG_FILES(Makefile)
4175181834SrobertoAC_CONFIG_FILES(ElectricFence/Makefile)
4176181834SrobertoAC_CONFIG_FILES(adjtimed/Makefile)
4177181834SrobertoAC_CONFIG_FILES(clockstuff/Makefile)
4178181834SrobertoAC_CONFIG_FILES(include/Makefile)
4179181834SrobertoAC_CONFIG_FILES(include/isc/Makefile)
4180181834SrobertoAC_CONFIG_FILES(kernel/Makefile)
4181181834SrobertoAC_CONFIG_FILES(kernel/sys/Makefile)
4182181834SrobertoAC_CONFIG_FILES(libntp/Makefile)
4183181834SrobertoAC_CONFIG_FILES(libparse/Makefile)
4184181834SrobertoAC_CONFIG_FILES(ntpd/Makefile)
4185181834SrobertoAC_CONFIG_FILES(ntpdate/Makefile)
4186181834SrobertoAC_CONFIG_FILES(ntpdc/Makefile)
4187181834SrobertoAC_CONFIG_FILES(ntpdc/nl.pl,		[chmod +x ntpdc/nl.pl])
4188181834SrobertoAC_CONFIG_FILES(ntpq/Makefile)
4189181834SrobertoAC_CONFIG_FILES(parseutil/Makefile)
4190181834SrobertoAC_CONFIG_FILES(scripts/Makefile)
4191181834SrobertoAC_CONFIG_FILES(scripts/calc_tickadj,	[chmod +x scripts/calc_tickadj])
4192181834SrobertoAC_CONFIG_FILES(scripts/checktime,	[chmod +x scripts/checktime])
4193181834SrobertoAC_CONFIG_FILES(scripts/freq_adj,	[chmod +x scripts/freq_adj])
4194181834SrobertoAC_CONFIG_FILES(scripts/html2man,	[chmod +x scripts/html2man])
4195181834SrobertoAC_CONFIG_FILES(scripts/mkver,		[chmod +x scripts/mkver])
4196181834SrobertoAC_CONFIG_FILES(scripts/ntp-wait,	[chmod +x scripts/ntp-wait])
4197181834SrobertoAC_CONFIG_FILES(scripts/ntpsweep,	[chmod +x scripts/ntpsweep])
4198181834SrobertoAC_CONFIG_FILES(scripts/ntptrace,	[chmod +x scripts/ntptrace])
4199181834SrobertoAC_CONFIG_FILES(scripts/ntpver,		[chmod +x scripts/ntpver])
4200181834SrobertoAC_CONFIG_FILES(scripts/plot_summary,	[chmod +x scripts/plot_summary])
4201181834SrobertoAC_CONFIG_FILES(scripts/summary,	[chmod +x scripts/summary])
4202181834SrobertoAC_CONFIG_FILES(util/Makefile)
4203181834Sroberto
4204181834SrobertoAC_CONFIG_SUBDIRS(sntp)
4205181834Sroberto
4206181834SrobertoAC_OUTPUT
4207