Deleted Added
full compact
configure.ac (302408) configure.ac (181834)
1dnl NTP top-level configure.ac -*- Autoconf -*-
2dnl
3m4_include([sntp/m4/version.m4])
4AC_PREREQ([2.61])
5AC_INIT(
6 [ntp],
7 [VERSION_NUMBER],
8 [http://bugs.ntp.org./],
9 [],
10 [http://www.ntp.org./]dnl
11)
12AC_CONFIG_MACRO_DIR([sntp/m4])
13AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
14AC_LANG([C])
15
16AC_PRESERVE_HELP_ORDER
17
18# Bump ntp_configure_cache_version for each change to configure.ac or
19# .m4 files which invalidates cached values from previous configure
20# runs.
21#
22# If the change affects cache variables used only by the main NTP
23# configure.ac, then only its version number should be bumped, while
24# the subdir configure.ac version numbers should be unchanged. The
25# same is true for a test/variable that is used only by one subdir
26# being changed incompatibly; only that subdir's cache version needs
27# bumping.
28#
29# If a change affects variables shared by all NTP configure scripts,
30# please bump the version numbers of each. If you are not sure, the
31# safe choice is to bump all on any cache-invalidating change.
32#
33# In order to avoid the risk of version stamp collision between -stable
34# and -dev branches, do not simply increment the version, instead use
35# the date YYYYMMDD optionally with -HHMM if there is more than one
36# bump in a day.
37
38ntp_configure_cache_version=20120806
39
40# When the cache version of config.cache and configure do not
41# match, NTP_CACHEVERSION will flush the cache.
42
43NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
44
45AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
46
47dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
48m4_ifdef(
49 [AM_SILENT_RULES],
50 [AM_SILENT_RULES([yes])]
51)
52AC_CANONICAL_BUILD
1dnl -*-fundamental-*-
2dnl Process this file with autoconf to produce a configure script.
3m4_include([version.m4])
4AC_INIT(ntp, VERSION_NUMBER)
5AM_INIT_AUTOMAKE
53AC_CANONICAL_HOST
54dnl the 'build' machine is where we run configure and compile
55dnl the 'host' machine is where the resulting stuff runs.
6AC_CANONICAL_HOST
7dnl the 'build' machine is where we run configure and compile
8dnl the 'host' machine is where the resulting stuff runs.
56AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
57 [canonical system (cpu-vendor-os) of where we should run])
58AC_CONFIG_HEADERS([config.h])
9AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) of where we should run])
10AM_CONFIG_HEADER(config.h)
59dnl AC_ARG_PROGRAM
11dnl AC_ARG_PROGRAM
12AC_PREREQ(2.53)
60
13
61ntp_atom_ok=${ntp_atom_ok=no}
62ntp_oncore_ok=${ntp_oncore_ok=no}
63ntp_parse_ok=${ntp_parse_ok=no}
64ntp_ripe_ncc_ok=${ntp_parse_ok=no}
65ntp_jupiter_ok=${ntp_jupiter_ok=no}
14ac_cv_var_atom_ok=no
15ac_cv_var_oncore_ok=no
16ac_cv_var_parse_ok=no
17ac_cv_var_ripe_ncc_ok=no
18ac_cv_var_jupiter_ok=no
66
19
67NTP_PROG_CC
68AC_PROG_CPP
69# Do we need CXX for anything besides google test?
70AC_PROG_CXX
71AC_PROG_YACC
72AC_PROG_CC_C_O
73AX_C99_STRUCT_INIT
20dnl Grab any initial CFLAGS so we can pick better defaults.
21iCFLAGS="$CFLAGS"
74
22
75NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
23dnl check these early to avoid autoconf warnings
24AC_AIX
25AC_MINIX
76
26
77NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
27dnl we need to check for cross compile tools for vxWorks here
28AC_PROG_CC
29# Ralf Wildenhues: With per-target flags we need CC_C_O
30AC_PROG_CC_C_O
31AC_PROG_CC_STDC
32AC_PROG_CPP
78
33
79dnl AM_PROG_AR req. automake 1.12
80m4_ifdef(
81 [AM_PROG_AR],
82 [AM_PROG_AR]
83)
34# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
35case "$host" in
36 *-*-amigaos)
37 CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
38 ;;
39 *-*-hpux10.*) # at least for hppa2.0-hp-hpux10.20
40 case "$GCC" in
41 yes)
42 ;;
43 *) CFLAGS="$CFLAGS -Wp,-H18816"
44 ;;
45 esac
46 ;;
47 *-pc-cygwin*)
48 CFLAGS="$CFLAGS -DSYS_CYGWIN32"
49 ;;
50 i386-sequent-sysv4)
51 case "$CC" in
52 cc)
53 CFLAGS="$CFLAGS -Wc,+abi-socket"
54 ;;
55 esac
56 ;;
57 *-*-mpeix*)
58 CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
59 LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
60 LIBS="$LIBS -lcurses"
61 ;;
62 *-*-solaris*)
63 # see "man standards".
64 # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
65 # -D_XOPEN_SOURCE=600 seems OK for c99
66 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
67 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
68 libxnet=-lxnet
69 ;;
70esac
84
71
85# So far, the only shared library we might use is libopts.
86# It's a small library - we might as well use a static version of it.
87AC_DISABLE_SHARED
88AC_PROG_LIBTOOL
89AC_SUBST([LIBTOOL_DEPS])
72AMU_OS_CFLAGS
90
73
91# NTP has (so far) been relying on leading-edge autogen, which
92# means we need the appropriate corresponding libopts as well.
74# NTP has (so far) been relying on leading-edge autogen.
93# Therefore, by default:
75# Therefore, by default:
94# - use the version of libopts we ship with
76# - use the version we ship with
95# - do not install it
96# - build a static copy (AC_DISABLE_SHARED - done earlier)
97case "${enable_local_libopts+set}" in
98 set) ;;
99 *) enable_local_libopts=yes ;;
100esac
101case "${enable_libopts_install+set}" in
102 set) ;;
103 *) enable_libopts_install=no ;;
104esac
77# - do not install it
78# - build a static copy (AC_DISABLE_SHARED - done earlier)
79case "${enable_local_libopts+set}" in
80 set) ;;
81 *) enable_local_libopts=yes ;;
82esac
83case "${enable_libopts_install+set}" in
84 set) ;;
85 *) enable_libopts_install=no ;;
86esac
105enable_nls=no
106LIBOPTS_CHECK_NOBUILD([sntp/libopts])
87LIBOPTS_CHECK(libopts)
107
88
108NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
89AC_MSG_CHECKING([[if $CC can handle #warning]])
90AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#warning foo]])],[ac_cv_cpp_warning=yes],[ac_cv_cpp_warning=no])
91AC_MSG_RESULT([$ac_cv_cpp_warning])
109
92
110NTP_LIBNTP
93case "$ac_cv_cpp_warning" in
94 no)
95 AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid #warning on option name collisions?])
96 AC_MSG_RESULT([[Enabling NO_OPTION_NAME_WARNINGS as #warning does not work]])
97 ;;
98esac
111
99
112AC_MSG_CHECKING([for deprecated --with-arlib])
113AC_ARG_WITH([arlib],
114 AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
100AC_MSG_CHECKING(for bin subdirectory)
101AC_ARG_WITH(binsubdir,
102 AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
103 use_binsubdir="$withval", use_binsubdir="bin")
104
105case "$use_binsubdir" in
106 bin)
107 ;;
108 sbin)
109 ;;
110 *)
111 AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
112 ;;
113esac
114AC_MSG_RESULT($use_binsubdir)
115BINSUBDIR=$use_binsubdir
116AC_SUBST(BINSUBDIR)
117
118AC_MSG_CHECKING(if we want to use arlib)
119AC_ARG_WITH(arlib,
120 AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
115 [ans=$withval], [ans=no])
121 [ans=$withval], [ans=no])
116AC_MSG_RESULT([$ans])
122AC_MSG_RESULT($ans)
117
123
124if test -d $srcdir/arlib
125then
126 case "$ans" in
127 yes)
128 ARLIB_DIR=arlib
129 AC_CONFIG_SUBDIRS(arlib)
130 ;;
131 esac
132fi
133AC_SUBST(ARLIB_DIR)
134
135AC_ARG_WITH(rpath,
136 AC_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
137[ans=$withval], [ans=x])
118case "$ans" in
138case "$ans" in
139 no)
140 need_dash_r=
141 ;;
119 yes)
142 yes)
120 AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
143 need_dash_r=1
121 ;;
122esac
144 ;;
145esac
146# HMS: Why isn't this $build?
147# Well, that depends on if we need this for the build toolchain or
148# for info in the host executable...
149# I still have no idea which way this should go, but nobody has complained.
150case "$host" in
151 *-*-netbsd*)
152 case "$need_dash_r" in
153 no) ;;
154 *) need_dash_r=1
155 ;;
156 esac
157 ;;
158 *-*-solaris*)
159 case "$need_dash_r" in
160 no) ;;
161 *) need_dash_r=1
162 ;;
163 esac
164 ;;
165esac
123
166
167AC_CACHE_CHECK(if we should use /dev/clockctl, ac_clockctl,
168[AC_ARG_ENABLE(clockctl,
169 AC_HELP_STRING([--enable-clockctl], [s Use /dev/clockctl for non-root clock control]),
170 [ans=$enableval],
171 [case "$host" in
172 *-*-netbsd*)
173 ans=yes
174 ;;
175 *) ans=no
176 ;;
177 esac
178 ])
179ac_clockctl=$ans])
180# End of AC_CACHE_CHECK for clockctl
181AC_CHECK_HEADERS(sys/clockctl.h)
182case "$ac_clockctl$ac_cv_header_sys_clockctl_h" in
183 yesyes)
184 AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
185 ;;
186esac
187
188AC_CACHE_CHECK(if we have linux capabilities (libcap), ac_linuxcaps,
189[AC_ARG_ENABLE(linuxcaps,
190 AC_HELP_STRING([--enable-linuxcaps], [s Use Linux capabilities for non-root clock control]),
191 [ans=$enableval],
192 [ans=no])
193ac_linuxcaps=$ans])
194# End of AC_CACHE_CHECK for linuxcaps
195AC_CHECK_HEADERS(sys/capability.h)
196AC_CHECK_HEADERS(sys/prctl.h)
197case "$ac_linuxcaps$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
198 yesyesyes)
199 AC_DEFINE(HAVE_LINUX_CAPABILITIES, ,[Do we have Linux capabilities?])
200 AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
201 LIBS="$LIBS -lcap"
202 ;;
203esac
204
205case "$build" in
206 $host)
207 ;;
208 *) case "$host" in
209 *-*-vxworks*)
210 # Quick and dirty sanity check
211 case "$VX_KERNEL" in
212 '') AC_MSG_ERROR(Please follow the directions in html/build/hints/vxworks.html!)
213 ;;
214 esac
215 CFLAGS="$CFLAGS -DSYS_VXWORKS"
216 ;;
217 esac
218 ;;
219esac
220
124dnl we need to check for cross compile tools for vxWorks here
125AC_PROG_AWK
221dnl we need to check for cross compile tools for vxWorks here
222AC_PROG_AWK
126AS_UNSET([ac_cv_prog_AWK])
127AC_SUBST([AWK]) dnl scripts/ntpver.in
128AC_PROG_MAKE_SET
129
223AC_PROG_MAKE_SET
224
130AC_SUBST([CFLAGS])
131AC_SUBST([LDFLAGS])
225rm -f conftest*
132
226
133AC_PROG_LN_S
134AC_ISC_POSIX
227case "$GCC" in
228 yes)
229 CFLAGS="$CFLAGS -Wall"
230 # CFLAGS="$CFLAGS -Wcast-align"
231 CFLAGS="$CFLAGS -Wcast-qual"
232 # CFLAGS="$CFLAGS -Wconversion"
233 # CFLAGS="$CFLAGS -Werror"
234 # CFLAGS="$CFLAGS -Wextra"
235 # CFLAGS="$CFLAGS -Wfloat-equal"
236 CFLAGS="$CFLAGS -Wmissing-prototypes"
237 CFLAGS="$CFLAGS -Wpointer-arith"
238 CFLAGS="$CFLAGS -Wshadow"
239 CFLAGS="$CFLAGS -Wstrict-prototypes"
240 # CFLAGS="$CFLAGS -Wtraditional"
241 # CFLAGS="$CFLAGS -Wwrite-strings"
135
242
243 ;;
244esac
136
245
137AC_PATH_PROG([PATH_PERL], [perl])
138dnl Saving cached hardcoded paths rather than searching $PATH during a
139dnl cached configure run is an optimization not worth the the cost of
140dnl preventing newly-installed tools from being found. Short-circuit
141dnl the caching after the tests so preset overrides still work.
142AS_UNSET([ac_cv_path_PATH_PERL])
143AC_PATH_PROG([PATH_TEST], [test])
144AS_UNSET([ac_cv_path_PATH_TEST])
145test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
146AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
246case "$host" in
247 *-next-nextstep3)
248 CFLAGS="$CFLAGS -posix"
249 ;;
250dnl This is currently commented out by bor.
251dnl The new versions of ReliantUNIX round adjtime() interval down
252dnl to 1/100s (system tick). This makes tickadj actually useless.
253dnl So, I'd better not use additional flags.
254dnl I leave it here just in case anybody has better idea
255dnl mips-sni-sysv4* )
256dnl #
257dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
258dnl #
259dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
260dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
261dnl fi
262dnl ;;
263esac
147
264
148AC_ARG_WITH(
149 [net-snmp-config],
150 [AS_HELP_STRING(
151 [--with-net-snmp-config],
152 [+ =net-snmp-config]
153 )],
154 [ans=$withval],
155 [ans=yes]
156)
157case "$ans" in
158 no)
265ac_busted_vpath_in_make=no
266
267case "$build" in
268 *-*-irix6.1*) # 64 bit only
269 # busted vpath?
159 ;;
270 ;;
160 yes)
161 ans=net-snmp-config
271 *-*-irix6*) # 6.2 (and later?)
272 ac_busted_vpath_in_make=yes
162 ;;
273 ;;
163 /*)
274 *-*-solaris2.5.1)
275 ac_busted_vpath_in_make=yes
164 ;;
276 ;;
165 */*)
166 AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
277 *-*-unicosmp*)
278 ac_busted_vpath_in_make=yes
167 ;;
279 ;;
168 *)
169 ;;
170esac
280esac
171PROG_NET_SNMP_CONFIG=$ans
172AC_MSG_CHECKING([for net-snmp-config path])
173case "$PROG_NET_SNMP_CONFIG" in
174 no) ;;
175 /*)
176 PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
281
282case "$ac_busted_vpath_in_make$srcdir" in
283 no*) ;;
284 yes.) ;;
285 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
286 '')
287 AC_MSG_ERROR(building outside of the main directory requires GNU make)
288 ;;
289 *) ;;
290 esac
177 ;;
291 ;;
178 *)
179 AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
180 AS_UNSET([ac_cv_path_PATH_NET_SNMP_CONFIG])
181;;
182esac
292esac
183AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
184
293
185case "$PATH_NET_SNMP_CONFIG" in
186 /*) AC_CACHE_CHECK(
187 [for net-snmp version],
188 [ntp_cv_net_snmp_version],
189 [ntp_cv_net_snmp_version=`$PATH_NET_SNMP_CONFIG --version`]
190 )
191 ;;
294AC_SUBST(CFLAGS)dnl
295AC_SUBST(LDFLAGS)dnl
296
297# HMS: From bunnylou/cowbird
298case "$host" in
299 alpha-dec-osf4.0)
300 AC_DISABLE_SHARED
301 ;;
302 *) # So far, the only shared library we might use is libopts.
303 # It's a small library - we might as well use a static version of it.
304 AC_DISABLE_SHARED
305 ;;
192esac
193
306esac
307
308AC_PROG_LIBTOOL
309AC_PROG_LN_S
310AC_PROG_GCC_TRADITIONAL
311AC_C_VOLATILE
312AC_ISC_POSIX
313AC_PATH_PROG(PATH_SH, sh)
314AC_PATH_PROG(PATH_PERL, perl)
315
316hs_ULONG_CONST
317
194case "$host" in
195 *-*-vxworks*)
196 ac_link="$ac_link $VX_KERNEL"
197 ;;
198esac
199
318case "$host" in
319 *-*-vxworks*)
320 ac_link="$ac_link $VX_KERNEL"
321 ;;
322esac
323
200# HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
201AC_SEARCH_LIBS([openlog], [gen syslog])
202# XXX library list will be in ac_cv_search_openlog
324AC_PROG_INSTALL
203
325
204# LIBSECCOMP is off by default -- needs testing with all the features
205# Please send bug reports to loganaden@gmail.com
206AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
207AC_ARG_ENABLE(
208 [libseccomp],
209 [AS_HELP_STRING(
210 [--enable-libseccomp],
211 [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
212 )],
213 [ntp_ok=$enableval],
214 [ntp_ok=no]
215)
216AC_MSG_RESULT([$ntp_ok])
217case "$ntp_ok" in
218 yes)
219 AC_SEARCH_LIBS(
220 [seccomp_init],
221 [seccomp],
222 [AC_DEFINE([LIBSECCOMP], [1],
223 [Define to any value to include libseccomp sandboxing.])]
224 )
225 AC_TRY_RUN([
226 #include <stdio.h>
227 #include <stdlib.h>
228 #include <errno.h>
229 #include <sys/prctl.h>
230 #include <linux/seccomp.h>
326case "$host" in
327 *-pc-cygwin*)
328 AC_CHECK_LIB(advapi32, main)
329 ;;
330esac
231
331
232 int main(void)
233 {
234 int ret;
235 ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
236 if (ret < 0) {
237 switch (errno) {
238 case ENOSYS:
239 return 1;
240 case EINVAL:
241 return 1;
242 default:
243 return 1;
244 }
245 }
246 ret =
247 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
248 if (ret < 0) {
249 switch (errno) {
250 case EINVAL:
251 return 1;
252 case EFAULT:
253 return 0;
254 default:
255 return 1;
256 }
257 }
258return 1;
259}
260]
261, AC_DEFINE([KERN_SECCOMP], 1,
262[Define to use libseccomp system call filtering.])
263, []
264)
332AC_CHECK_FUNC(gethostent, ,
333 AC_CHECK_LIB(nsl, gethostent, , , $libxnet -lsocket))
334AC_CHECK_FUNC(openlog, ,
335 AC_CHECK_LIB(gen, openlog, ,
336 AC_CHECK_LIB(syslog, openlog, , , $libxnet -lsocket)))
337AC_CHECK_LIB(md5, MD5Init, ,
338 AC_CHECK_LIB(md, MD5Init))
339AC_CHECK_FUNCS(MD5Init)
340dnl HMS: What a hack...
341AC_CHECK_HEADERS(readline/history.h readline/readline.h)
342case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
343 *no*) ;;
344 *) save_LIBS=$LIBS
345 LIBS=
346 # Ralf Wildenhues: either unset ... or cache READLINE_LIBS
347 unset ac_cv_lib_readline_readline
348 AC_CHECK_LIB(readline, readline, ,
349 AC_MSG_NOTICE([Trying again with -lcurses])
350 unset ac_cv_lib_readline_readline
351 AC_CHECK_LIB(readline, readline,
352 LIBS="-lreadline -lcurses $LIBS"
353 AC_DEFINE(HAVE_LIBREADLINE)
354 AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
355 AC_CHECK_LIB(edit, readline,
356 LIBS="-ledit -lcurses"
357 AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
358 AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
359 , , -lcurses)
360 , -lcurses))
361 READLINE_LIBS=$LIBS
362 AC_SUBST(READLINE_LIBS)
363 LIBS=$save_LIBS
265 ;;
266esac
267
364 ;;
365esac
366
268NTP_FACILITYNAMES
269
270dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
271dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
272dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
273dnl does Strange Things with extra processes using the Posix-compatibility
274dnl real-time library, so we don't want to use it.
367dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
368dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
369dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
370dnl does Strange Things with extra processes using the Posix-compatibility
371dnl real-time library, so we don't want to use it.
275dnl
276dnl 081118 Harlan got tired of looking for a way to get the sched*()
277dnl functions to link OK with either cc or gcc.
278
279case "$host" in
372
373case "$host" in
280 *-*-*linux*) ;;
281 *-*-osf4*) ;;
282 *-*-osf5*) ;;
374 *-*-linux*) ;;
283 *)
375 *)
284 # HMS: Make sure we check for -lrt for clock_* before this...
285 case "$ac_cv_search_clock_gettime" in
286 '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
287 esac
288 AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
376 AC_CHECK_LIB(rt, sched_setscheduler, ,
377 AC_CHECK_LIB(posix4, sched_setscheduler))
289 ;;
290esac
291
378 ;;
379esac
380
292AC_CHECK_HEADERS([bstring.h])
293AC_CHECK_HEADER(
294 [dns_sd.h],
295 [AC_SEARCH_LIBS(
296 [DNSServiceRegister],
297 [dns_sd],
298 [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
299 [Use Rendezvous/DNS-SD registration])]
300 )]
301)
302AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
381AC_CHECK_FUNC(setsockopt, ,
382 [AC_CHECK_LIB(socket, setsockopt)
383 AC_CHECK_LIB(xnet, setsockopt)])
303
384
304AC_CHECK_HEADERS([memory.h netdb.h poll.h])
305AC_CHECK_HEADERS([sgtty.h stdatomic.h])
306AC_HEADER_STDBOOL
307AC_CHECK_HEADERS([stdlib.h string.h termio.h])
308AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
385AC_HEADER_STDC
386AC_CHECK_HEADERS(bstring.h)
387AC_CHECK_HEADER(dns_sd.h,
388 [AC_CHECK_LIB(dns_sd,
389 DNSServiceRegister,
390 [AC_DEFINE(HAVE_DNSREGISTRATION, 1,
391 [Use Rendezvous/DNS-SD registration])])])
392case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
393 yes) LIBS="-ldns_sd $LIBS" ;;
394esac
395AC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h math.h)
309
396
397# HMS: Lame, but fast.
398if test -f /etc/redhat-release
399then
400 :
401else
402 AC_CHECK_HEADERS(md5.h, [], [],
403[#if HAVE_SYS_TYPES_H
404#include <sys/types.h>
405#endif
406])
407fi
408AC_CHECK_HEADERS(memory.h netdb.h poll.h)
409AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
410AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
310case "$host" in
311 *-*-aix*)
411case "$host" in
412 *-*-aix*)
312 AC_CHECK_HEADERS([utmpx.h])
413 AC_CHECK_HEADERS(utmpx.h)
313 case "$ac_cv_header_utmpx_h" in
414 case "$ac_cv_header_utmpx_h" in
314 yes)
315 ;;
316 *)
317 AC_CHECK_HEADERS([utmp.h])
318 ;;
415 yes) ;;
416 *) AC_CHECK_HEADERS(utmp.h) ;;
319 esac
320 ;;
417 esac
418 ;;
321 *)
322 AC_CHECK_HEADERS([utmp.h utmpx.h])
323 ;;
419 *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
324esac
420esac
325
326#
327# On Suns only (so far) getpass() truncates the typed password to 8
328# characters, but getpassphrase() allows up to 257. Most systems'
329# getpass() does not truncate, at least not so as to affect ntpq and
330# ntpdc password prompts.
331#
332# So check for getpassphrase(), but only on Sun operating systems.
333#
334case "$host" in
335 *-*-sunos*|*-*-solaris*)
336 AC_CHECK_FUNCS([getpassphrase])
337esac
338
339
340AC_CHECK_HEADERS([net/if6.h])
341AC_CHECK_HEADERS([net/route.h], [], [], [
342 #include <sys/types.h>
343 #include <sys/socket.h>
344 #include <net/if.h>
421AC_CHECK_HEADERS(arpa/nameser.h)
422AC_CHECK_HEADERS(sys/socket.h)
423AC_CHECK_HEADERS(net/if.h, [], [],
424[#if HAVE_SYS_SOCKET_H
425#include <sys/socket.h>
426#endif
345])
427])
346
347AC_CHECK_HEADERS([netinfo/ni.h])
348case "$ac_cv_header_netinfo_ni_h" in
349 yes)
350 AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
351esac
352AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
428AC_CHECK_HEADERS(net/if6.h)
429AC_CHECK_HEADERS(net/route.h, [], [], [
430#include <sys/types.h>
431#include <sys/socket.h>
432#include <net/if.h>
433])
434AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
435AC_CHECK_HEADERS(netinet/in.h)
436AC_CHECK_HEADERS(netinet/ip.h, [], [],
437[#if HAVE_SYS_TYPES_H
438#include <sys/types.h>
439#endif
440#if HAVE_NETINET_IN_H
441#include <netinet/in.h>
442#endif
443#if HAVE_NETINET_IN_SYSTM_H
444#include <netinet/in_systm.h>
445#endif
446])
447AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
448AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
449dnl AC_CHECK_HEADERS(sys/chudefs.h)
450AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
353case "$host" in
451case "$host" in
354 *-*-sunos4*)
452 *-*-sunos4*) ;;
453 *) AC_CHECK_HEADERS(sys/ioctl.h)
355 ;;
454 ;;
356 *)
357 AC_CHECK_HEADERS([sys/ioctl.h])
358 ;;
359esac
455esac
360AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
456AC_CHECK_HEADERS(sys/ipc.h)
457AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
361# HMS: Check sys/proc.h and sys/resource.h after some others
458# HMS: Check sys/proc.h and sys/resource.h after some others
362AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
459AC_CHECK_HEADERS(sys/ppstime.h)
363case "$ac_cv_header_sched_h" in
460case "$ac_cv_header_sched_h" in
364 yes)
461 yes) ;;
462 *) AC_CHECK_HEADERS(sys/sched.h) ;;
463esac
464case "$host" in
465 *-*-sco*)
466 AC_CHECK_HEADERS(sys/sio.h)
365 ;;
467 ;;
366 *)
367 AC_CHECK_HEADERS([sys/sched.h])
368 ;;
369esac
370# HMS: Check sys/shm.h after some others
468esac
469# HMS: Check sys/shm.h after some others
371AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
470AC_CHECK_HEADERS(sys/select.h sys/signal.h sys/sockio.h)
372# HMS: Checked sys/socket.h earlier
373case "$host" in
471# HMS: Checked sys/socket.h earlier
472case "$host" in
374 *-*-netbsd*)
473 *-*-netbsd*) ;;
474 *) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
375 ;;
475 ;;
376 *)
377 AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
378 ;;
379esac
476esac
380AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
381AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
477AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
478AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
479AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
480AC_EGREP_CPP(yes,
481[#if HAVE_SYS_TIME_H
482# include <sys/time.h>
483#endif
484#if HAVE_ERRNO_H
485# include <errno.h>
486#endif
487#include <sys/timepps.h>
488#ifdef PPS_API_VERS_1
489yes
490#endif
491], [AC_CHECK_HEADERS(sys/timepps.h, [], [],
492[#if HAVE_SYS_TIME_H
493# include <sys/time.h>
494#endif
495#if HAVE_ERRNO_H
496# include <errno.h>
497#endif
498])
499])
500AC_CHECK_HEADERS(sys/timers.h sys/tpro.h sys/types.h sys/wait.h)
501AC_HEADER_TIME
382case "$host" in
383*-convex-*)
502case "$host" in
503*-convex-*)
384 AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
385 ;;
504 AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
505 ;;
386*-*-bsdi*)
506*-*-bsdi*)
387 AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
388 ;;
507 AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
508 ;;
389esac
390
509esac
510
391case "$ac_cv_header_stdatomic_h" in
392 yes)
393 AC_CHECK_FUNCS([atomic_thread_fence])
394 AC_CACHE_CHECK(
395 [for atomic_thread_fence()],
396 [ntp_cv_func_atomic_thread_fence],
397 [AC_COMPILE_IFELSE(
398 [AC_LANG_PROGRAM(
399 [[
400 #include <stdatomic.h>
401 ]],
402 [[
403 atomic_thread_fence(memory_order_seq_cst);
404 ]]
405 )]
406 [ntp_cv_func_atomic_thread_fence=yes],
407 [ntp_cv_func_atomic_thread_fence=no]
408 )]
409 )
410 ;;
411esac
412
413case "$host" in
511case "$host" in
414 *-*-solaris2.6)
415 # Broken...
512 *-*-linux*)
513 AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
416 ;;
514 ;;
515esac
516case "$ac_cv_func___adjtimex" in
517 yes) ;;
417 *)
518 *)
418 AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
519 AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
520 dnl AC_CHECK_LIB(kvm, main, , , -lelf)
521 AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
522 AC_CHECK_LIB(ld, nlist)
523 AC_CHECK_LIB(mld, nlist)
524 AC_CHECK_HEADER(nlist.h,
525 [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
526 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
527 [AC_TRY_COMPILE([#include <nlist.h>],
528 [struct nlist n; n.n_un.n_name = 0;],
529 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
530 if test $ac_cv_struct_nlist_n_un = yes; then
531 AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
532 fi
533 ])dnl
419 ;;
420esac
421
534 ;;
535esac
536
422case "$host" in
423 *-*-*linux*)
424 case "$ac_cv_func_ntp_gettime" in
425 yes)
426 ;;
427 *)
428 AC_CHECK_FUNCS([__ntp_gettime])
429 case "$ac_cv_func___ntp_gettime" in
430 yes)
431 AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
432 AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
433 esac
434 ;;
435 esac
436 AC_CHECK_FUNCS([adjtimex])
437 case "$ac_cv_func_adjtimex" in
438 yes)
439 AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
440 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
441 have_adjtimex=1
442 ;;
443 *)
444 AC_CHECK_FUNCS([__adjtimex])
445 case "$ac_cv_func___adjtimex" in
446 yes)
447 AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
448 AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
449 AC_DEFINE([adjtimex], [__adjtimex], [deviant])
450 AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
451 have_adjtimex=1
452 esac
453 ;;
454 esac
455esac
456case "$have_adjtimex" in
457 '')
458 # nlist stuff is only needed for tickadj.
459 saved_LIBS="$LIBS"
460 LIBS=
461 AC_SEARCH_LIBS([nlist], [elf ld mld])
462 # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
463 AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
464 # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
465 AC_CHECK_HEADERS([nlist.h sys/var.h])
466 case "$ac_cv_header_nlist_h" in
467 yes)
468 AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
469 AC_CACHE_CHECK(
470 [for n_un in struct nlist],
471 [ntp_cv_struct_nlist_n_un],
472 [AC_COMPILE_IFELSE(
473 [AC_LANG_PROGRAM(
474 [[
475 #include <nlist.h>
476 ]],
477 [[
478 struct nlist n;
479 n.n_un.n_name = 0;
480 ]]
481 )]
482 [ntp_cv_struct_nlist_n_un=yes],
483 [ntp_cv_struct_nlist_n_un=no]
484 )]
485 )
486 case "$ntp_cv_struct_nlist_n_un" in
487 yes)
488 AC_DEFINE([NLIST_NAME_UNION], [1],
489 [does struct nlist use a name union?])
490 esac
491 esac
492 AC_SUBST([LDADD_NLIST])
493 LDADD_NLIST="$LIBS"
494 LIBS="$saved_LIBS"
495 AS_UNSET([saved_LIBS])
496esac
537dnl AC_CHECK_HEADERS(net/if.h, [], [],
538dnl [#if HAVE_SYS_TYPES_H
539dnl # include <sys/types.h>
540dnl #endif
541dnl #if HAVE_SYS_SOCKET_H
542dnl # include <sys/socket.h>
543dnl #endif
544dnl ])
497
545
498AC_CHECK_HEADERS([sys/proc.h], [], [], [
499 #ifdef HAVE_SYS_TYPES_H
500 # include <sys/types.h>
501 #endif
502 #ifdef HAVE_SYS_TIME_H
503 # include <sys/time.h>
504 #endif
546AC_CHECK_HEADERS(sys/proc.h, [], [],
547[#if HAVE_SYS_TYPES_H
548# include
549#endif
550#if HAVE_SYS_TIME_H
551# include
552#endif
505])
506
553])
554
507AC_CHECK_HEADERS([sys/resource.h], [], [], [
508 #ifdef HAVE_SYS_TIME_H
509 # include <sys/time.h>
510 #endif
555AC_CHECK_HEADERS(sys/resource.h, [], [],
556[#if HAVE_SYS_TIME_H
557# include
558#endif
511])
512
559])
560
513AC_CHECK_HEADERS([sys/shm.h], [], [], [
514 #ifdef HAVE_SYS_TYPES_H
515 # include <sys/types.h>
516 #endif
517 #ifdef HAVE_SYS_IPC_H
518 # include <sys/ipc.h>
519 #endif
561AC_CHECK_HEADERS(sys/shm.h, [], [],
562[#if HAVE_SYS_TYPES_H
563# include
564#endif
565#if HAVE_SYS_IPC_H
566# include
567#endif
520])
521
568])
569
522AC_CHECK_HEADERS([sys/timex.h], [], [], [
523 #ifdef HAVE_SYS_TIME_H
524 # include <sys/time.h>
525 #endif
570AC_CHECK_HEADERS(sys/timex.h, [], [],
571[#if HAVE_SYS_TIME_H
572# include
573#endif
526])
527
574])
575
576AC_CHECK_HEADERS(resolv.h, [], [],
577[#if HAVE_SYS_TYPES_H
578#include <sys/types.h>
579#endif
580#if HAVE_NETINET_IN_H
581#include <netinet/in.h>
582#endif
583#if HAVE_ARPA_NAMESER_H
584#include <arpa/nameser.h>
585#endif
586])
587
588AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
589[AC_TRY_COMPILE([],[
590volatile int x;],
591 ac_cv_c_volatile=yes,
592 ac_cv_c_volatile=no)
593])
594case "$ac_cv_c_volatile" in
595 yes)
596 ;;
597 *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
598 ;;
599esac
600
601# AM_C_PROTOTYPES gives us ansi2knr
602case "$build" in
603 *-*-solaris2*)
604 # Assume that solaris2 is Ansi C...
605 ;;
606 *)
607 AM_C_PROTOTYPES
608 ;;
609esac
610AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
611[AC_TRY_COMPILE([
612extern int foo (short);
613int foo(short i) { return i; }],[
614int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
615])
616if test "$ac_cv_have_prototypes" = yes; then
617 AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
618fi
619
620AC_C_CONST
621AC_C_BIGENDIAN
528AC_TYPE_SIGNAL
529AC_TYPE_OFF_T
622AC_TYPE_SIGNAL
623AC_TYPE_OFF_T
530AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c
624AC_TYPE_SIZE_T
625AC_CHECK_TYPE(time_t, long)
626AC_CHECK_SIZEOF(time_t)
627AC_CHECK_TYPES(uintptr_t)
628
629AH_VERBATIM([TYPEDEF_UINTPTR_T],
630[/* Provide a typedef for uintptr_t? */
631#ifndef HAVE_UINTPTR_T
632typedef unsigned int uintptr_t;
633#define HAVE_UINTPTR_T 1
634#endif])
531
635
532AC_CACHE_CHECK(
533 [for a fallback value for HZ],
534 [ntp_cv_default_hz],
535 [
536 ntp_cv_default_hz=100
537 case "$host" in
538 alpha*-dec-osf4*|alpha*-dec-osf5*)
539 ntp_cv_default_hz=1024
540 ;;
541 mips-dec-ultrix4*)
542 ntp_cv_default_hz=256
543 ;;
544 esac
545 ]
546)
547AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
548 [What is the fallback value for HZ?])
636AC_STRUCT_TM
549
637
550AC_CACHE_CHECK(
551 [if we need to override the system's value for HZ],
552 [ntp_cv_override_hz],
553 [
554 ntp_cv_override_hz=no
555 case "$host" in
556 alpha*-dec-osf4*|alpha*-dec-osf5*)
557 ntp_cv_override_hz=yes
558 ;;
559 mips-dec-ultrix4*)
560 ntp_cv_override_hz=yes
561 ;;
562 *-*-freebsd*)
563 ntp_cv_override_hz=yes
564 ;;
565 *-*-sunos4*)
566 ntp_cv_override_hz=yes
567 ;;
568 *-*-kfreebsd*)
569 ntp_cv_override_hz=yes
570 ;;
571 esac
572 ]
573)
574case "$ntp_cv_override_hz" in
638AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
639[AC_TRY_COMPILE([#include <sys/types.h>],
640 [u_int8_t len = 42; return 0;],
641 ac_cv_type_u_int8_t=yes,
642 ac_cv_type_u_int8_t=no)
643])
644if test $ac_cv_type_u_int8_t = yes; then
645 AC_DEFINE(HAVE_TYPE_U_INT8_T, 1, [Does u_int8_t exist?])
646fi
647
648AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
649[AC_TRY_COMPILE([#include <sys/types.h>],
650 [u_int64_t len = 42; return 0;],
651 ac_cv_type_u_int64_t=yes,
652 ac_cv_type_u_int64_t=no)
653])
654if test $ac_cv_type_u_int64_t = yes; then
655 AC_DEFINE(HAVE_TYPE_U_INT64_T, 1, [Does u_int64_t exist?])
656fi
657
658#
659# Look for in_port_t.
660#
661AC_MSG_CHECKING(for in_port_t)
662AC_TRY_COMPILE([
663#include <sys/types.h>
664#include <netinet/in.h>],
665[in_port_t port = 25; return (0);],
666 [AC_MSG_RESULT(yes)
667 ],
668 [AC_MSG_RESULT(no)
669 AC_DEFINE(ISC_PLATFORM_NEEDPORTT, 1, [Do we need our own in_port_t?])
670 ])
671
672AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
673[ac_cv_var_default_hz=100
674case "$host" in
675 alpha*-dec-osf4*|alpha*-dec-osf5*)
676 ac_cv_var_default_hz=1024
677 ;;
678 mips-dec-ultrix4*)
679 ac_cv_var_default_hz=256
680 ;;
681esac])
682AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
683
684AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
685[ac_cv_var_override_hz=no
686case "$host" in
687 alpha*-dec-osf4*|alpha*-dec-osf5*)
688 ac_cv_var_override_hz=yes
689 ;;
690 mips-dec-ultrix4*)
691 ac_cv_var_override_hz=yes
692 ;;
693 *-*-freebsd*)
694 ac_cv_var_override_hz=yes
695 ;;
696 *-*-sunos4*)
697 ac_cv_var_override_hz=yes
698 ;;
699esac])
700case "$ac_cv_var_override_hz" in
575 yes)
701 yes)
576 AC_DEFINE([OVERRIDE_HZ], [1],
577 [Do we need to override the system's idea of HZ?])
702 AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
703 ;;
578esac
579
580dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
581dnl [AC_TRY_LINK([#include <sys/types.h>
582dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
583dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
584dnl if test $su_cv_func_ut_host_in_utmp = yes; then
585dnl AC_DEFINE(HAVE_UT_HOST)

--- 8 unchanged lines hidden (view full) ---

594dnl #include <utmp.h>
595dnl #endif
596dnl #ifdef BOOT_TIME
597dnl yes
598dnl #endif
599dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
600dnl AC_MSG_RESULT($su_cv_have_boot_time)
601
704esac
705
706dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
707dnl [AC_TRY_LINK([#include <sys/types.h>
708dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
709dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
710dnl if test $su_cv_func_ut_host_in_utmp = yes; then
711dnl AC_DEFINE(HAVE_UT_HOST)

--- 8 unchanged lines hidden (view full) ---

720dnl #include <utmp.h>
721dnl #endif
722dnl #ifdef BOOT_TIME
723dnl yes
724dnl #endif
725dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
726dnl AC_MSG_RESULT($su_cv_have_boot_time)
727
602AC_CACHE_CHECK(
603 [for struct rt_msghdr],
604 [ntp_cv_struct_rt_msghdr],
605 [AC_COMPILE_IFELSE(
606 [AC_LANG_PROGRAM(
607 [[
608 #include <sys/types.h>
609 #include <sys/socket.h>
610 #include <net/if.h>
611 #include <net/route.h>
612 ]],
613 [[
614 struct rt_msghdr p;
615 ]]
616 )],
617 [ntp_cv_struct_rt_msghdr=yes],
618 [ntp_cv_struct_rt_msghdr=no]
619 )]
620)
728AC_CACHE_CHECK(for struct rt_msghdr, ac_cv_struct_rt_msghdr,
729[AC_TRY_COMPILE([
730#include <sys/types.h>
731#include <sys/socket.h>
732#include <net/if.h>
733#include <net/route.h>],
734[struct rt_msghdr p;],
735 ac_cv_struct_rt_msghdr=yes,
736 ac_cv_struct_rt_msghdr=no)
737])
738if test $ac_cv_struct_rt_msghdr = yes; then
739 AC_DEFINE(HAS_ROUTING_SOCKET, 1, [Do we have a routing socket (struct rt_msghdr)?])
740fi
621
622AC_CACHE_CHECK(
741
742AC_CACHE_CHECK(
623 [for struct rtattr],
624 [ntp_cv_rtattr],
625 [AC_COMPILE_IFELSE(
626 [AC_LANG_PROGRAM(
627 [[
628 #include <stddef.h>
629 #include <sys/socket.h>
630 #include <linux/rtnetlink.h>
631 ]],
632 [[
633 struct rtattr p;
634 ]]
635 )],
636 [ntp_cv_rtattr=yes],
637 [ntp_cv_rtattr=no]
638 )]
743 struct sigaction for sa_sigaction,
744 ac_cv_struct_sigaction_has_sa_sigaction,
745 [
746 AC_TRY_COMPILE(
747 [#include <signal.h>],
748 [struct sigaction act; act.sa_sigaction = 0;],
749 ac_cv_struct_sigaction_has_sa_sigaction=yes,
750 ac_cv_struct_sigaction_has_sa_sigaction=no
751 )
752 ]
639)
753)
754if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
755 AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
756fi
640
757
641case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
642 *yes*)
643 AC_DEFINE([HAS_ROUTING_SOCKET], [1],
644 [Do we have a routing socket (rt_msghdr or rtattr)?])
645 case "$ntp_cv_rtattr" in
646 yes)
647 AC_DEFINE([HAVE_RTNETLINK], [1],
648 [Do we have Linux routing socket?])
758AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
759[AC_TRY_COMPILE([
760#include <sys/types.h>
761#ifdef HAVE_SYS_TERMIOS_H
762# include <sys/termios.h>
763#endif
764#ifdef HAVE_SYS_TIME_H
765# include <sys/time.h>
766#endif
767#ifdef HAVE_SYS_PPSCLOCK_H
768# include <sys/ppsclock.h>
769#endif],[
770extern struct ppsclockev *pce;
771return pce->serial;],
772 ac_cv_struct_ppsclockev=yes,
773 ac_cv_struct_ppsclockev=no)
774])
775if test $ac_cv_struct_ppsclockev = yes; then
776 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
777fi
778
779AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
780[AC_TRY_COMPILE([
781#include <sys/types.h>
782#include <sys/socket.h>],[
783extern struct sockaddr *ps;
784return ps->sa_len;],
785 ac_cv_struct_sockaddr_has_sa_len=yes,
786 ac_cv_struct_sockaddr_has_sa_len=no)
787])
788if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
789 AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
790fi
791
792AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage,
793[AC_TRY_COMPILE([
794#include <sys/types.h>
795#include <sys/socket.h>
796#include <netinet/in.h>
797],[
798struct sockaddr_storage n;],
799 ac_cv_struct_sockaddr_storage=yes,
800 ac_cv_struct_sockaddr_storage=no)
801])
802if test $ac_cv_struct_sockaddr_storage = yes; then
803 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
804fi
805
806AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
807 ac_cv_have_ss_family_in_struct_ss, [
808 AC_TRY_COMPILE(
809 [
810#include <sys/types.h>
811#include <sys/socket.h>
812 ],
813 [ struct sockaddr_storage s; s.ss_family = 1; ],
814 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
815 [ ac_cv_have_ss_family_in_struct_ss="no" ],
816 )
817])
818if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
819 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
820else
821 # Hack around a problem...
822 # HMS: This is $host because we need the -D if we are building *for* it.
823 # HMS: 061029: Now that we separate the ss_* checks this is causing
824 # a problem - disable it until we get to the bottom of it.
825 case "$host" in
826 XXX*-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
827 ;;
649 esac
828 esac
650esac
829fi
651
830
652AC_CACHE_CHECK(
653 [struct sigaction for sa_sigaction],
654 [ntp_cv_struct_sigaction_has_sa_sigaction],
655 [AC_COMPILE_IFELSE(
656 [AC_LANG_PROGRAM(
657 [[
658 #include <signal.h>
659 ]],
660 [[
661 struct sigaction act;
662 act.sa_sigaction = 0;
663 ]]
664 )],
665 [ntp_cv_struct_sigaction_has_sa_sigaction=yes],
666 [ntp_cv_struct_sigaction_has_sa_sigaction=no]
667 )]
668)
669case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
670 yes)
671 AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
672esac
831AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
832 ac_cv_have___ss_family_in_struct_ss, [
833 AC_TRY_COMPILE(
834 [
835#include <sys/types.h>
836#include <sys/socket.h>
837 ],
838 [ struct sockaddr_storage s; s.__ss_family = 1; ],
839 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
840 [ ac_cv_have___ss_family_in_struct_ss="no" ]
841 )
842])
843if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
844 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
845fi
673
846
674AC_CACHE_CHECK(
675 [for struct ppsclockev],
676 [ntp_cv_struct_ppsclockev],
677 [AC_COMPILE_IFELSE(
678 [AC_LANG_PROGRAM(
679 [[
680 #ifdef HAVE_SYS_TYPES_H
681 # include <sys/types.h>
682 #endif
683 #ifdef HAVE_SYS_TERMIOS_H
684 # include <sys/termios.h>
685 #endif
686 #ifdef HAVE_SYS_TIME_H
687 # include <sys/time.h>
688 #endif
689 #ifdef HAVE_SYS_PPSCLOCK_H
690 # include <sys/ppsclock.h>
691 #endif
692 ]],
693 [[
694 extern struct ppsclockev *pce;
695 return pce->serial;
696 ]]
697 )],
698 [ntp_cv_struct_ppsclockev=yes],
699 [ntp_cv_struct_ppsclockev=no]
700 )]
701)
702case "$ntp_cv_struct_ppsclockev" in
703 yes)
704 AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
705 [Does a system header define struct ppsclockev?])
706esac
847AH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
848[/* Handle ss_family */
849#if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
850# define ss_family __ss_family
851#endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
707
852
853AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
854 ac_cv_have_ss_len_in_struct_ss, [
855 AC_TRY_COMPILE(
856 [
857#include <sys/types.h>
858#include <sys/socket.h>
859 ],
860 [ struct sockaddr_storage s; s.ss_len = 1; ],
861 [ ac_cv_have_ss_len_in_struct_ss="yes" ],
862 [ ac_cv_have_ss_len_in_struct_ss="no" ],
863 )
864])
865if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
866 AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len?])
867fi
868
869AC_CACHE_CHECK([for __ss_len field in struct sockaddr_storage],
870 ac_cv_have___ss_len_in_struct_ss, [
871 AC_TRY_COMPILE(
872 [
873#include <sys/types.h>
874#include <sys/socket.h>
875 ],
876 [ struct sockaddr_storage s; s.__ss_len = 1; ],
877 [ ac_cv_have___ss_len_in_struct_ss="yes" ],
878 [ ac_cv_have___ss_len_in_struct_ss="no" ]
879 )
880])
881if test "x$ac_cv_have___ss_len_in_struct_ss" = "xyes" ; then
882 AC_DEFINE(HAVE___SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have __ss_len?])
883fi
884
885AH_VERBATIM([X_HAVE_SS_LEN_IN_SS],
886[/* Handle ss_len */
887#if !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE___SS_LEN_IN_SS)
888# define ss_len __ss_len
889#endif /* !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE_SA_LEN_IN_SS) */])
890
708case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
709 *yes*)
891case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
892 *yes*)
710 AC_CACHE_CHECK(
711 [for struct snd_size],
712 [ntp_cv_struct_snd_size],
713 [AC_COMPILE_IFELSE(
714 [AC_LANG_PROGRAM(
715 [[
716 #ifdef HAVE_MACHINE_SOUNDCARD_H
717 # include <machine/soundcard.h>
718 #endif
719 #ifdef HAVE_SYS_SOUNDCARD_H
720 # include <sys/soundcard.h>
721 #endif
722 ]],
723 [[
724 extern struct snd_size *ss;
725 return ss->rec_size;
726 ]]
727 )],
728 [ntp_cv_struct_snd_size=yes],
729 [ntp_cv_struct_snd_size=no]
730 )]
731 )
732 case "$ntp_cv_struct_snd_size" in
733 yes)
734 AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
735 [Do we have struct snd_size?])
893 AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
894[AC_TRY_COMPILE([
895#ifdef HAVE_MACHINE_SOUNDCARD_H
896# include <machine/soundcard.h>
897#endif
898#ifdef HAVE_SYS_SOUNDCARD_H
899# include <sys/soundcard.h>
900#endif],[
901extern struct snd_size *ss;
902return ss->rec_size;],
903 ac_cv_struct_snd_size=yes,
904 ac_cv_struct_snd_size=no)
905])
906 case "$ac_cv_struct_snd_size" in
907 yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
736 esac
908 esac
909 ;;
737esac
738
910esac
911
739AC_CACHE_CHECK(
740 [struct clockinfo for hz],
741 [ntp_cv_struct_clockinfo_has_hz],
742 [AC_COMPILE_IFELSE(
743 [AC_LANG_PROGRAM(
744 [[
745 #include <sys/time.h>
746 ]],
747 [[
748 extern struct clockinfo *pc;
749 return pc->hz;
750 ]]
751 )],
752 [ntp_cv_struct_clockinfo_has_hz=yes],
753 [ntp_cv_struct_clockinfo_has_hz=no]
754 )]
755)
756case "$ntp_cv_struct_clockinfo_has_hz" in
757 yes)
758 AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
759esac
912AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
913[AC_TRY_COMPILE([
914#include <sys/time.h>],[
915extern struct clockinfo *pc;
916return pc->hz;],
917 ac_cv_struct_clockinfo_has_hz=yes,
918 ac_cv_struct_clockinfo_has_hz=no)
919])
920if test $ac_cv_struct_clockinfo_has_hz = yes; then
921 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
922fi
760
923
761AC_CACHE_CHECK(
762 [struct clockinfo for tickadj],
763 [ntp_cv_struct_clockinfo_has_hz],
764 [AC_COMPILE_IFELSE(
765 [AC_LANG_PROGRAM(
766 [[
767 #include <sys/time.h>
768 ]],
769 [[
770 extern struct clockinfo *pc;
771 return pc->tickadj;
772 ]]
773 )],
774 [ntp_cv_struct_clockinfo_has_hz=yes],
775 [ntp_cv_struct_clockinfo_has_hz=no]
776 )]
777)
778case "$ntp_cv_struct_clockinfo_has_hz" in
779 yes)
780 AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
781esac
924AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
925[AC_TRY_COMPILE([
926#include <sys/time.h>],[
927extern struct clockinfo *pc;
928return pc->tickadj;],
929 ac_cv_struct_clockinfo_has_tickadj=yes,
930 ac_cv_struct_clockinfo_has_tickadj=no)
931])
932if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
933 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
934fi
782
935
783case "$ntp_cv_struct_ntptimeval" in
784 yes)
785 AC_CHECK_MEMBERS(
786 [struct ntptimeval.time.tv_nsec],
787 [],
788 [],
789 [
790 #ifdef HAVE_SYS_TIME_H
791 # include <sys/time.h>
792 #else
793 # ifdef HAVE_TIME_H
794 # include <time.h>
795 # endif
796 #endif
797 #ifdef HAVE_SYS_TIMEX_H
798 # include <sys/timex.h>
799 #else
800 # ifdef HAVE_TIMEX_H
801 # include <timex.h>
802 # endif
803 #endif
804 ]
805 )
806esac
936AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
937[AC_TRY_COMPILE([
938#include <sys/time.h>
939/* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
940#ifdef HAVE_ERRNO_H
941# include <errno.h>
942#endif
943#ifdef HAVE_SYS_TIMEPPS_H
944# define FRAC 4294967296
945# include <sys/timepps.h>
946#endif],
947[struct timespec n;],
948ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
949if test $ac_cv_struct_timespec = yes; then
950 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
951fi
807
952
808####
953AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
954[AC_TRY_COMPILE([
955#include <sys/time.h>
956#include <sys/timex.h>],
957[struct ntptimeval n;],
958ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
959if test $ac_cv_struct_ntptimeval = yes; then
960 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
961fi
809
962
810AC_CHECK_FUNCS([arc4random_buf])
963AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
964[#ifdef HAVE_SYS_TIME_H
965#include <sys/time.h>
966#else
967# ifdef HAVE_TIME_H
968# include <time.h>
969# endif
970#endif
971#ifdef HAVE_SYS_TIMEX_H
972#include <sys/timex.h>
973#else
974# ifdef HAVE_TIMEX_H
975# include <timex.h>
976# endif
977#endif])
811
978
812####
979AC_C_INLINE
980AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
981AC_CHECK_SIZEOF(signed char)
982AC_CHECK_SIZEOF(int)
983AC_CHECK_SIZEOF(long)
813
984
814saved_LIBS="$LIBS"
815LIBS="$LIBS $LDADD_LIBNTP"
816AC_CHECK_FUNCS([daemon])
817# XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
818LIBS="$saved_LIBS"
819AS_UNSET([saved_LIBS])
985AC_CHECK_TYPES([s_char])
986case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
987 *yes)
988 # We have a typedef for s_char. Might as well believe it...
989 ;;
990 no0no)
991 # We have signed chars, can't say 'signed char', no s_char typedef.
992 AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
993 ;;
994 no1no)
995 # We have signed chars, can say 'signed char', no s_char typedef.
996 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
997 ;;
998 yes0no)
999 # We have unsigned chars, can't say 'signed char', no s_char typedef.
1000 AC_MSG_ERROR(No way to specify a signed character!)
1001 ;;
1002 yes1no)
1003 # We have unsigned chars, can say 'signed char', no s_char typedef.
1004 AC_DEFINE(NEED_S_CHAR_TYPEDEF)
1005 ;;
1006esac
1007AC_TYPE_UID_T
820
1008
821AC_CHECK_FUNCS(
822 [finite],
823 [],
824 [AC_CHECK_FUNCS(
825 [isfinite],
826 [],
827 [
828 AC_MSG_CHECKING([for isfinite with <math.h>])
829 _libs=$LIBS
830 # XXX
831 LIBS="$LIBS -lm"
832 AC_LINK_IFELSE(
833 [AC_LANG_PROGRAM(
834 [[
835 #include <math.h>
836 ]],
837 [[
838 float f = 0.0;
839 isfinite(f);
840 ]]
841 )],
842 [ans=yes],
843 [ans=no]
844 )
845 LIBS=$_libs
846 AC_MSG_RESULT([$ans])
847 case "$ans" in
848 yes)
849 AC_DEFINE([HAVE_ISFINITE], [1])
850 esac
851 ]
852 )]
853)
1009case "$host" in
1010 *-*-aix[[45]]*)
1011 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
1012 # (returning ENOSYS). I didn't check 4.2. If, in the future,
1013 # IBM pulls its thumbs out long enough to implement clock_settime,
1014 # this conditional will need to change. Maybe use AC_TRY_RUN
1015 # instead to try to set the time to itself and check errno.
1016 ;;
1017 *) AC_CHECK_FUNCS(clock_gettime clock_settime)
1018 ;;
1019esac
1020AC_CHECK_FUNCS(daemon)
1021AC_CHECK_FUNCS(finite, ,
1022 [AC_CHECK_FUNCS(isfinite, ,
1023 [AC_MSG_CHECKING(for isfinite with <math.h>)
1024 _libs=$LIBS
1025 LIBS="$LIBS -lm"
1026 AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
1027 [AC_MSG_RESULT(yes)
1028 AC_DEFINE(HAVE_ISFINITE)],
1029 AC_MSG_RESULT(no))
1030 LIBS=$_libs])])
1031AC_CHECK_FUNCS(getbootfile getclock getdtablesize)
854
1032
855AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
1033AC_ARG_ENABLE(getifaddrs,
1034 AC_HELP_STRING([--enable-getifaddrs],
1035 [s Enable the use of getifaddrs() [[yes|no|glibc]].
1036glibc: Use getifaddrs() in glibc if you know it supports IPv6.]),
1037 want_getifaddrs="$enableval", want_getifaddrs="yes")
856
1038
857# kvm_open() is only used by tickadj. Also see above.
858case "$ac_cv_header_kvm_h" in
859 yes)
860 AC_CHECK_FUNCS([kvm_open])
1039case $want_getifaddrs in
1040yes|glibc)
1041#
1042# Do we have getifaddrs() ?
1043#
1044case $host in
1045*-linux*)
1046 # Some recent versions of glibc support getifaddrs() which does not
1047 # provide AF_INET6 addresses while the function provided by the USAGI
1048 # project handles the AF_INET6 case correctly. We need to avoid
1049 # using the former but prefer the latter unless overridden by
1050 # --enable-getifaddrs=glibc.
1051 if test $want_getifaddrs = glibc
1052 then
1053 AC_CHECK_FUNCS(getifaddrs)
1054 else
1055 save_LIBS="$LIBS"
1056 LIBS="-L/usr/local/v6/lib $LIBS"
1057 AC_CHECK_LIB(inet6, getifaddrs,
1058 LIBS="$LIBS -linet6"
1059 AC_DEFINE(HAVE_GETIFADDRS),
1060 LIBS=${save_LIBS})
1061 fi
1062 ;;
1063*)
1064 AC_CHECK_FUNCS(getifaddrs)
1065 ;;
1066esac
1067;;
1068no)
1069;;
1070esac
1071
1072AC_MSG_CHECKING([type of socklen arg for getsockname()])
1073AC_CACHE_VAL(ac_cv_func_getsockname_arg2,dnl
1074[AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl
1075 [for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do
1076 for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
1077 AC_TRY_COMPILE(dnl
1078[#ifdef HAVE_SYS_TYPES_H
1079#include <sys/types.h>
1080#endif
1081#ifdef HAVE_SYS_SOCKET_H
1082#include <sys/socket.h>
1083#endif
1084extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl
1085 [ac_not_found=no ; break 2], ac_not_found=yes)
1086 done
1087 done
1088 ])dnl AC_CACHE_VAL
1089])dnl AC_CACHE_VAL
1090if test "$ac_not_found" = yes; then
1091 ac_cv_func_getsockname_socklen_type='socklen_t'
1092fi
1093AC_MSG_RESULT([$ac_cv_func_getsockname_socklen_type])
1094AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
1095 $ac_cv_func_getsockname_socklen_type,
1096 [What is getsockname()'s socklen type?])
1097
1098AC_CHECK_FUNCS(getrusage)
1099AC_CHECK_FUNC(gettimeofday, ,[
1100case "$host" in
1101 *-*-mpeix*) ac_cv_func_gettimeofday=yes
861 ;;
1102 ;;
1103esac])
1104case "$host" in
1105 *-pc-cygwin*)
1106 ;;
1107 *) AC_CHECK_FUNCS(getuid)
1108 ;;
862esac
1109esac
1110AC_CHECK_FUNCS(hstrerror)
863
1111
1112#
1113# Check for if_nametoindex() for IPv6 scoped addresses support
1114#
1115AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
1116 ac_cv_have_if_nametoindex=no)
1117case $ac_cv_have_if_nametoindex in
1118 no)
1119 case "$host" in
1120 *-hp-hpux*)
1121 AC_CHECK_LIB(ipv6, if_nametoindex,
1122 ac_cv_have_if_nametoindex=yes
1123 LIBS="-lipv6 $LIBS",)
1124 ;;
1125 esac
1126esac
1127case $ac_cv_have_if_nametoindex in
1128 yes)
1129 AC_DEFINE(ISC_PLATFORM_HAVEIFNAMETOINDEX, 1, [ISC: do we have if_nametoindex()?])
1130 ;;
1131esac
1132
1133AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
1134AC_CHECK_FUNC(inet_pton, [], [AC_DEFINE(ISC_PLATFORM_NEEDPTON, 1, [ISC: provide inet_pton()])])
1135AC_CHECK_FUNC(inet_aton, [], [AC_DEFINE(ISC_PLATFORM_NEEDATON, 1, [ISC: provide inet_aton()])])
1136AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
864case "$host" in
865 *-*-sco3.2v5.0.*)
1137case "$host" in
1138 *-*-sco3.2v5.0.*)
866 # Just stubs. Sigh.
1139 # Just stubs. Idiots.
867 ;;
1140 ;;
868 *) AC_CHECK_FUNCS([mkstemp])
1141 *) AC_CHECK_FUNCS(mkstemp)
869 ;;
870esac
1142 ;;
1143esac
871AC_CHECK_FUNCS([mktime])
1144AC_CHECK_FUNCS(mktime)
872case "$host" in
1145case "$host" in
873 *-*-aix[[4-9]]*)
874 # XXX only verified thru AIX6.
875 # Just a stub. Sigh.
1146 *-*-aix[[45]]*)
1147 # Just a stub. Idiots.
876 ;;
877 *-*-irix[[45]]*)
1148 ;;
1149 *-*-irix[[45]]*)
878 # Just a stub in "old" Irix. Sigh.
1150 # Just a stub in "old" Irix. Idiots.
879 ;;
1151 ;;
880# In the belief that the fix for bug 1223 fixes mlockall() under linux...
881# *-*-*linux*)
882# # there, but more trouble than it is worth for now (resolver problems)
883# ;;
1152 *-*-linux*)
1153 # there, but more trouble than it is worth for now (resolver problems)
1154 ;;
884 *-*-qnx*)
1155 *-*-qnx*)
885 # Apparently there but not working in QNX. Sigh?
1156 # Apparently there but not working in QNX. Idiots?
886 ;;
887 *-*-sco3.2v5.0.*)
1157 ;;
1158 *-*-sco3.2v5.0.*)
888 # Just a stub. Sigh.
1159 # Just a stub. Idiots.
889 ;;
890 alpha*-dec-osf4*|alpha*-dec-osf5*)
891 # mlockall is there, as a #define calling memlk via <sys/mman.h>
892 # Not easy to test for - cheat.
1160 ;;
1161 alpha*-dec-osf4*|alpha*-dec-osf5*)
1162 # mlockall is there, as a #define calling memlk via <sys/mman.h>
1163 # Not easy to test for - cheat.
893 AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
894 AC_CHECK_FUNCS([mlockall])
1164 AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
1165 AC_CHECK_FUNCS(mlockall)
895 ;;
1166 ;;
896 *) AC_CHECK_FUNCS([mlockall])
1167 *) AC_CHECK_FUNCS(mlockall)
897 ;;
898esac
1168 ;;
1169esac
899AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
1170AC_CHECK_FUNCS(nice nlist)
900case "$host" in
1171case "$host" in
901 *-*-aix[[4-9]]*)
902 # XXX only verified thru AIX6.
903 # Just a stub in AIX 4. Sigh.
1172 *-*-solaris2.6)
1173 # Broken...
904 ;;
1174 ;;
1175 *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
1176 ;;
1177esac
1178AC_CHECK_FUNCS(plock pututline pututxline readlink recvmsg rtprio)
1179case "$host" in
1180 *-*-aix[[45]]*)
1181 # Just a stub in AIX 4. Idiots.
1182 ;;
905 *-*-solaris2.5*)
1183 *-*-solaris2.5*)
906 # Just stubs in solaris2.5. Sigh.
1184 # Just stubs in solaris2.5. Idiots.
907 ;;
1185 ;;
908 *) AC_CHECK_FUNCS([sched_setscheduler])
1186 *) AC_CHECK_FUNCS(sched_setscheduler)
909 ;;
910esac
1187 ;;
1188esac
911AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
912AC_CHECK_FUNCS([strdup strerror setrlimit strchr])
1189AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
1190AC_CHECK_FUNCS(setrlimit)
1191AC_CHECK_FUNCS(settimeofday, ,[
913case "$host" in
1192case "$host" in
914 *-*-aix[[4-9]]*)
915 # XXX only verified thru AIX6.
916 # Just stubs. Sigh.
1193 *-*-mpeix*) ac_cv_func_settimeofday=yes
917 ;;
1194 ;;
1195esac])
1196AC_CHECK_FUNCS(setvbuf sigaction)
1197AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
1198AC_CHECK_FUNCS(snprintf strdup strerror strstr)
1199AC_CHECK_FUNCS(timegm)
1200case "$host" in
1201 *-*-aix[[45]]*)
1202 # Just stubs. Idiots.
1203 ;;
918 *-*-netbsd1*)
1204 *-*-netbsd1*)
919 # Just stubs. Sigh.
1205 # Just stubs. Idiots.
920 ;;
921 *-*-netbsdelf1*)
1206 ;;
1207 *-*-netbsdelf1*)
922 # Just stubs. Sigh.
1208 # Just stubs. Idiots.
923 ;;
924 *-*-openbsd*)
1209 ;;
1210 *-*-openbsd*)
925 # Just stubs. Sigh.
1211 # Just stubs. Idiots.
926 ;;
1212 ;;
927 *)
928 AC_CHECK_FUNCS([timer_create])
1213 *) AC_CHECK_FUNCS(timer_create timer_settime)
929 ;;
930esac
1214 ;;
1215esac
931
932NTP_RLIMIT_ITEMS
933
934# some OSes prefer _exit() in forked children to exit()
935AC_CHECK_FUNCS([_exit])
936ntp_worker_child_exit=exit
937case "$ac_cv_func__exit::$host_os" in
938 yes::netbsd*)
939 ntp_worker_child_exit=_exit
1216case "$host" in
1217 *-pc-cygwin*)
1218 # I have no idea...
940 ;;
1219 ;;
941 yes::openbsd*)
942 ntp_worker_child_exit=_exit
1220 *) AC_CHECK_FUNCS(umask)
943 ;;
944esac
1221 ;;
1222esac
945AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
946 [routine worker child proc uses to exit.])
1223AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
947
1224
948AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
949
950###
951
1225###
1226
952# http://bugs.ntp.org/737
1227# http://bugs.ntp.isc.org/737
953case "$ac_cv_func_recvmsg" in
954 yes)
1228case "$ac_cv_func_recvmsg" in
1229 yes)
955 AC_CACHE_CHECK(
956 [if we need extra help to define struct iovec],
957 [ntp_cv_struct_iovec_help],
958 [
959 compiled=no
960 for ntp_cv_struct_iovec_help in '0' '1'; do
961 AC_COMPILE_IFELSE(
962 [AC_LANG_PROGRAM(
963 [[
964 #ifdef HAVE_SYS_TYPES_H
965 # include <sys/types.h>
966 #endif
967 #ifdef HAVE_SYS_SOCKET_H
968 # include <sys/socket.h>
969 #endif
970 #if $ntp_cv_struct_iovec_help
971 # include <sys/uio.h>
972 #endif
973 ]],
974 [[
975 void foo(void) {
976 ssize_t x;
977 int s = 0;
978 struct iovec iov;
979 struct msghdr mh;
980 int flags = 0;
1230 AC_MSG_CHECKING([if we need extra help to define struct iovec])
1231 AC_CACHE_VAL(ac_cv_struct_iovec_help,dnl
1232 [for ac_cv_struct_iovec_help in '0' '1'; do
1233 AC_TRY_COMPILE(dnl
1234[#ifdef HAVE_SYS_TYPES_H
1235#include <sys/types.h>
1236#endif
1237#ifdef HAVE_SYS_SOCKET_H
1238#include <sys/socket.h>
1239#endif
1240#if $ac_cv_struct_iovec_help
1241#include <sys/uio.h>
1242#endif
981
1243
982 mh.msg_iov = &iov;
983 x = recvmsg(s, &mh, flags);
984 }
985 ]]
986 )],
987 [compiled=yes ; break 1],
988 []
989 )
990 done
991 case "$compiled" in
992 no)
993 ntp_cv_struct_iovec_help=0
994 esac
995 AS_UNSET([compiled])
996 ]
997 )
998 case "$ntp_cv_struct_iovec_help" in
999 1)
1000 AC_DEFINE([HAVE_SYS_UIO_H], [1],
1001 [Use sys/uio.h for struct iovec help])
1244void foo();
1245void foo() {
1246 ssize_t x;
1247 int s = 0;
1248 struct iovec iov;
1249 struct msghdr mh;
1250 int flags = 0;
1251
1252 mh.msg_iov = &iov;
1253 x = recvmsg(s, &mh, flags);
1254}],,dnl
1255 [ac_worked=yes ; break 1], ac_worked=no)
1256 done
1257])dnl AC_CACHE_VAL
1258 case "$ac_worked$ac_cv_struct_iovec_help" in
1259 yes1)
1260 AC_DEFINE(HAVE_SYS_UIO_H, 1, [Use sys/uio.h for struct iovec help])
1261 ans=yes
1262 ;;
1263 *) ans=no
1002 esac
1264 esac
1265 AC_MSG_RESULT([$ans])
1266 ;;
1003esac
1004
1267esac
1268
1005AC_CACHE_CHECK(
1006 [number of arguments taken by setpgrp()],
1007 [ntp_cv_func_setpgrp_nargs],
1008 [AC_COMPILE_IFELSE(
1009 [AC_LANG_PROGRAM(
1010 [[
1011 #ifdef HAVE_SYS_TYPES_H
1012 # include <sys/types.h>
1013 #endif
1014 #ifdef HAVE_UNISTD_H
1015 # include <unistd.h>
1016 #endif
1017 ]],
1018 [[
1019 setpgrp(0, 0);
1020 ]]
1021 )],
1022 [ntp_cv_func_setpgrp_nargs=2],
1023 [ntp_cv_func_setpgrp_nargs=0]
1024 )]
1025)
1026case "$ntp_cv_func_setpgrp_nargs" in
1027 0)
1028 AC_DEFINE([HAVE_SETPGRP_0], [1],
1029 [define if setpgrp takes 0 arguments])
1269case "$host" in
1270 *-*-sunos4*)
1271 AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
1272 ;;
1030esac
1031
1273esac
1274
1032AC_CACHE_CHECK(
1033 [if we need to declare 'errno'],
1034 [ntp_cv_decl_errno],
1035 [AC_COMPILE_IFELSE(
1036 [AC_LANG_PROGRAM(
1037 [[
1038 #ifdef HAVE_ERRNO_H
1039 # include <errno.h>
1040 #endif
1041 ]],
1042 [[
1043 errno = 0;
1044 ]]
1045 )],
1046 [ntp_cv_decl_errno=no],
1047 [ntp_cv_decl_errno=yes]
1048 )]
1049)
1050case "$ntp_cv_decl_errno" in
1051 yes)
1052 AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
1275AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
1276[AC_TRY_COMPILE([#include <sys/time.h>],[
1277gettimeofday((struct timeval*)0,(struct timezone*)0);
1278settimeofday((struct timeval*)0,(struct timezone*)0);
1279],
1280 ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
1281])
1282if test $ac_cv_func_Xettimeofday_nargs = 1; then
1283 AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
1284fi
1285
1286AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
1287[AC_TRY_COMPILE([
1288#ifdef HAVE_SYS_TYPES_H
1289# include <sys/types.h>
1290#endif
1291#ifdef HAVE_UNISTD_H
1292# include <unistd.h>
1293#endif
1294],[setpgrp(0,0);],
1295 ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
1296])
1297if test $ac_cv_func_setpgrp_nargs = 0; then
1298 AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
1299fi
1300
1301save_CFLAGS=$CFLAGS
1302CFLAGS="$CFLAGS -I$srcdir/include"
1303
1304AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
1305ac_cv_func_qsort_argtype,
1306[AC_TRY_COMPILE([
1307#include "l_stdlib.h"
1308
1309#ifdef HAVE_PROTOTYPES
1310#define P(x) x
1311#else
1312#define P(x) ()
1313#endif
1314
1315extern void *base;
1316extern sortfunc P((const void *, const void *));
1317int sortfunc(a, b)
1318 const void *a;
1319 const void *b; { return 0; }
1320],[
1321qsort(base, 2, sizeof(char *), sortfunc);
1322],
1323 ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
1324])
1325case "$ac_cv_func_qsort_argtype" in
1326 void)
1327 AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
1328 ;;
1053esac
1054
1329esac
1330
1331CFLAGS=$save_CFLAGS
1332
1333AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
1334[AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
1335#include <errno.h>
1336#endif],
1337 [errno = 0;],
1338 ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
1339case "$ac_cv_decl_errno" in
1340 yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
1341esac
1342
1343dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
1344dnl the clash. <resolv.h> isn't currently used.
1345dnl
1055dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1056dnl MT purposes. This makes the line "extern int h_errno" choke
1057dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1058dnl without breaking any other platforms.
1059dnl
1346dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
1347dnl MT purposes. This makes the line "extern int h_errno" choke
1348dnl the compiler. Hopefully adding !defined(h_errno) fixes this
1349dnl without breaking any other platforms.
1350dnl
1060AC_CACHE_CHECK(
1061 [if we may declare 'h_errno'],
1062 [ntp_cv_decl_h_errno],
1063 [AC_COMPILE_IFELSE(
1064 [AC_LANG_PROGRAM(
1065 [[
1066 #include <sys/types.h>
1067 #ifdef HAVE_NETINET_IN_H
1068 # include <netinet/in.h>
1069 #endif
1070 #ifdef HAVE_ARPA_NAMESER_H
1071 # include <arpa/nameser.h>
1072 #endif
1073 #ifdef HAVE_NETDB_H
1074 # include <netdb.h>
1075 #endif
1076 #ifdef HAVE_RESOLV_H
1077 # include <resolv.h>
1078 #endif
1079 ]],
1080 [[
1081 extern int h_errno;
1082 ]]
1083 )],
1084 [ntp_cv_decl_h_errno=yes],
1085 [ntp_cv_decl_h_errno=no]
1086 )]
1087)
1088case "$ntp_cv_decl_h_errno" in
1089 yes)
1090 AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
1351AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
1352[AC_TRY_COMPILE([#include <sys/types.h>
1353#ifdef HAVE_NETINET_IN_H
1354#include <netinet/in.h>
1355#endif
1356#ifdef HAVE_ARPA_NAMESER_H
1357#include <arpa/nameser.h>
1358#endif
1359#ifdef HAVE_NETDB_H
1360#include <netdb.h>
1361#endif
1362#ifdef HAVE_RESOLV_H
1363#include <resolv.h>
1364#endif],
1365 [extern int h_errno;],
1366 ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
1367case "$ac_cv_decl_h_errno" in
1368 yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
1091esac
1092
1369esac
1370
1093AC_CACHE_CHECK(
1094 [if declaring 'syscall()' is ok],
1095 [ntp_cv_decl_syscall],
1096 [AC_COMPILE_IFELSE(
1097 [AC_LANG_PROGRAM(
1098 [[
1099 #ifdef HAVE_SYS_TYPES_H
1100 # include <sys/types.h>
1101 #endif
1102 #ifdef HAVE_UNISTD_H
1103 # include <unistd.h>
1104 #endif
1105 ]],
1106 [[
1107 extern int syscall (int, ...);
1108 ]]
1109 )]
1110 [ntp_cv_decl_syscall=yes],
1111 [ntp_cv_decl_syscall=no]
1112 )]
1113)
1114case "$ntp_cv_decl_syscall" in
1115 yes)
1116 AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
1371dnl See if char *sys_errlist[] is OK.
1372AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
1373[AC_TRY_COMPILE([#include <stdio.h>
1374#ifdef HAVE_ERRNO_H
1375#include <errno.h>
1376#endif],
1377 [extern char *sys_errlist[];
1378],
1379 ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
1380case "$ac_cv_decl_sys_errlist" in
1381 yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
1117esac
1118
1382esac
1383
1384AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
1385[AC_TRY_COMPILE([
1386#ifdef HAVE_SYS_TYPES_H
1387# include <sys/types.h>
1388#endif
1389#ifdef HAVE_UNISTD_H
1390# include <unistd.h>
1391#endif
1392#ifdef HAVE_PROTOTYPES
1393#define P(x) x
1394#else
1395#define P(x) ()
1396#endif
1397],
1398 [extern int syscall P((int, ...));],
1399 ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
1400case "$ac_cv_decl_syscall" in
1401 yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
1402esac
1403
1119case "$host" in
1120 *-*-aix4.3.*)
1404case "$host" in
1405 *-*-aix4.3.*)
1121 AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
1406 AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style]) # Needed for XLC under AIX 4.3.2
1122 ;;
1123 *-*-mpeix*)
1407 ;;
1408 *-*-mpeix*)
1124 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1125 AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
1126 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1127 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1128 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1129 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1130 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1409 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1410 AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
1411 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1412 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1413 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1414 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1415 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1131 ;;
1132 *-*-osf[[45]]*)
1416 ;;
1417 *-*-osf[[45]]*)
1133 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1134 AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
1418 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1419 AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
1135 ;;
1136 *-*-qnx*)
1420 ;;
1421 *-*-qnx*)
1137 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1422 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1138 ;;
1139 *-*-riscos4*)
1423 ;;
1424 *-*-riscos4*)
1140 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1141 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1142 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1143 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1144 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1145 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1146 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1147 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1148 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1149 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1150 AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1151 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1152 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1153 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1154 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1155 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1425 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1426 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1427 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1428 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1429 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1430 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1431 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1432 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1433 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1434 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1435 AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1436 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1437 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1438 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1439 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1440 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1156 ;;
1157 *-*-solaris2*)
1441 ;;
1442 *-*-solaris2*)
1158 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1159 AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
1443 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1444 AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
1160 case "$host" in
1161 *-*-solaris2.4)
1445 case "$host" in
1446 *-*-solaris2.4)
1162 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1447 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1163 ;;
1164 esac
1165 ;;
1166 *-*-sunos4*)
1448 ;;
1449 esac
1450 ;;
1451 *-*-sunos4*)
1167 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1168 AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
1169 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1170 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1171 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1172 AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
1173 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1174 AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
1175 AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
1176 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1177 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1178 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1179 AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
1452 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1453 AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
1454 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1455 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1456 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1457 AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
1458 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1459 AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
1460 AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
1461 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1462 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1463 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1464 AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
1180 case "`basename $ac_cv_prog_CC`" in
1181 acc*) ;;
1465 case "`basename $ac_cv_prog_CC`" in
1466 acc*) ;;
1182 *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
1467 *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
1183 ;;
1184 esac
1468 ;;
1469 esac
1185 AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
1186 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1187 AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
1188 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1189 AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
1190 AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
1191 AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
1470 AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
1471 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1472 AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
1473 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1474 AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
1475 AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
1476 AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
1192 ;;
1193 *-*-ultrix4*)
1477 ;;
1478 *-*-ultrix4*)
1194 AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
1195 AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
1196 AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
1197 AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
1198 AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
1199 AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
1200 AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
1201 AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
1202 AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
1203 AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
1204 AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
1205 AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
1206 AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
1207 AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
1479 AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
1480 AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
1481 AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
1482 AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
1483 AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
1484 AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
1485 AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
1486 AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
1487 AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
1488 AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
1489 AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
1490 AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
1491 AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
1492 AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
1208 ;;
1209esac
1210
1211case "$host" in
1212 *-*-sco3.2*)
1493 ;;
1494esac
1495
1496case "$host" in
1497 *-*-sco3.2*)
1213 AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
1214 [Do we need to #define _SVID3 when we #include <termios.h>?])
1498 AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
1215 ;;
1216esac
1217
1499 ;;
1500esac
1501
1502AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
1503[ans=no
1218case "$host" in
1219 *-*-hpux[[567]]*)
1504case "$host" in
1505 *-*-hpux[[567]]*)
1220 AC_DEFINE([NEED_RCVBUF_SLOP], [1],
1221 [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
1506 ans=yes
1507 ;;
1222esac
1508esac
1509ac_cv_var_rcvbuf_slop=$ans])
1510case "$ac_cv_var_rcvbuf_slop" in
1511 yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
1512esac
1223
1513
1224dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
1225AC_CACHE_CHECK(
1226 [if we will open the broadcast socket],
1227 [ntp_cv_var_open_bcast_socket],
1228 [
1229 ans=yes
1230 case "$host" in
1231 *-*-domainos)
1232 ans=no
1233 esac
1234 ntp_cv_var_open_bcast_socket=$ans
1235 ]
1236)
1237case "$ntp_cv_var_open_bcast_socket" in
1238 yes)
1239 AC_DEFINE([OPEN_BCAST_SOCKET], [1],
1240 [Should we open the broadcast socket?])
1514AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
1515[ans=yes
1516case "$host" in
1517 *-*-domainos)
1518 ans=no
1519 ;;
1241esac
1520esac
1521ac_cv_var_open_bcast_socket=$ans])
1522case "$ac_cv_var_open_bcast_socket" in
1523 yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
1524esac
1242
1525
1526AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
1527[ans=no
1243case "$host" in
1244 *-*-hpux*)
1528case "$host" in
1529 *-*-hpux*)
1245 AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
1246 [Do we want the HPUX FindConfig()?])
1530 ans=yes
1531 ;;
1247esac
1532esac
1248
1249dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
1250AC_CACHE_CHECK(
1251 [if process groups are set with -pid],
1252 [ntp_cv_arg_setpgrp_negpid],
1253 [
1254 case "$host" in
1255 *-*-hpux[[567]]*)
1256 ans=no
1257 ;;
1258 *-*-hpux*)
1259 ans=yes
1260 ;;
1261 *-*-*linux*)
1262 ans=yes
1263 ;;
1264 *-*-sunos3*)
1265 ans=yes
1266 ;;
1267 *-*-ultrix2*)
1268 ans=yes
1269 ;;
1270 *)
1271 ans=no
1272 ;;
1273 esac
1274 ntp_cv_arg_setpgrp_negpid=$ans
1275 ]
1276)
1277case "$ntp_cv_arg_setpgrp_negpid" in
1278 yes)
1279 AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
1280 [Do we set process groups with -pid?])
1533ac_cv_var_hpux_findconfig=$ans])
1534case "$ac_cv_var_hpux_findconfig" in
1535 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
1281esac
1282
1536esac
1537
1283AC_CACHE_CHECK(
1284 [if we need a ctty for F_SETOWN],
1285 [ntp_cv_func_ctty_for_f_setown],
1286 [
1287 case "$host" in
1288 *-*-bsdi[[23]]*)
1289 ans=yes
1290 ;;
1291 *-*-freebsd*)
1292 ans=yes
1293 ;;
1294 # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
1295 # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
1296 # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
1297 # in $host may be followed by "aout", "ecoff", or "elf".
1298 *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
1299 ans=yes
1300 ;;
1301 *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
1302 ans=yes
1303 ;;
1304 *-*-openbsd*)
1305 ans=yes
1306 ;;
1307 *-*-osf*)
1308 ans=yes
1309 ;;
1310 *-*-darwin*)
1311 ans=yes
1312 ;;
1313 *)
1314 ans=no
1315 ;;
1316 esac
1317 ntp_cv_func_ctty_for_f_setown=$ans
1318 ]
1319)
1320case "$ntp_cv_func_ctty_for_f_setown" in
1321 yes)
1322 AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
1538AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
1539[case "$host" in
1540 *-*-hpux[[567]]*)
1541 ans=no
1542 ;;
1543 *-*-hpux*)
1544 ans=yes
1545 ;;
1546 *-*-linux*)
1547 ans=yes
1548 ;;
1549 *-*-sunos3*)
1550 ans=yes
1551 ;;
1552 *-*-ultrix2*)
1553 ans=yes
1554 ;;
1555 *)
1556 ans=no
1557 ;;
1323esac
1558esac
1559ac_cv_arg_setpgrp_negpid=$ans])
1560case "$ac_cv_arg_setpgrp_negpid" in
1561 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
1562esac
1324
1563
1325AC_CACHE_CHECK(
1326 [if the OS clears cached routes when more specifics become available],
1327 [ntp_cv_os_routeupdates],
1328 [
1329 case "$host" in
1330 *-*-netbsd*)
1331 ans=yes
1332 ;;
1333 *)
1334 ans=no
1335 ;;
1336 esac
1337 ntp_cv_os_routeupdates=$ans
1338 ]
1339)
1340case "$ntp_cv_os_routeupdates" in
1341 yes)
1342 AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
1343 [need to recreate sockets on changed routing?])
1564AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
1565[[case "$host" in
1566 *-*-bsdi[23]*)
1567 ans=yes
1568 ;;
1569 *-*-freebsd*)
1570 ans=yes
1571 ;;
1572 *-*-netbsd*3.[0-8]*|*-*-netbsd*[0-2].*|*-*-netbsd*3.99.[0-7])
1573 ans=yes
1574 ;;
1575 *-*-openbsd*)
1576 ans=yes
1577 ;;
1578 *-*-osf*)
1579 ans=yes
1580 ;;
1581 *) ans=no
1582 ;;
1344esac
1583esac
1584ac_cv_func_ctty_for_f_setown=$ans]])
1585case "$ac_cv_func_ctty_for_f_setown" in
1586 yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
1587esac
1345
1588
1346AC_CACHE_CHECK(
1347 [if the wildcard socket needs REUSEADDR to bind other addresses],
1348 [ntp_cv_os_wildcardreuse],
1349 [
1350 case "$host" in
1351 *-*-*linux*)
1352 ans=yes
1353 ;;
1354 *) ans=no
1355 ;;
1356 esac
1357 ntp_cv_os_wildcardreuse=$ans
1358 ]
1359)
1360case "$ntp_cv_os_wildcardreuse" in
1361 yes)
1362 AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
1363 [wildcard socket needs REUSEADDR to bind interface addresses])
1589AC_CACHE_CHECK(if the OS misses to clear cached routes when more specific routes become available, ac_cv_os_routeupdates,
1590[[case "$host" in
1591 *-*-netbsd*)
1592 ans=yes
1593 ;;
1594 *) ans=no
1595 ;;
1364esac
1596esac
1597ac_cv_os_routeupdates=$ans]])
1598case "$ac_cv_os_routeupdates" in
1599 yes) AC_DEFINE(OS_MISSES_SPECIFIC_ROUTE_UPDATES, 1, [need to recreate sockets on changed routing?]) ;;
1600esac
1365
1601
1366case "$host" in
1367 *-*-aix*)
1368 AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
1369 [Might nlist() values require an extra level of indirection (AIX)?])
1602AC_CACHE_CHECK(if the OS needs the wildcard socket set to REUSEADDR for binding interface addresses, ac_cv_os_wildcardreuse,
1603[[case "$host" in
1604 *-*-linux*)
1605 ans=yes
1606 ;;
1607 *) ans=no
1608 ;;
1370esac
1609esac
1610ac_cv_os_wildcardreuse=$ans]])
1611case "$ac_cv_os_wildcardreuse" in
1612 yes) AC_DEFINE(OS_NEEDS_REUSEADDR_FOR_IFADDRBIND, 1, [wildcard socket needs to set REUSEADDR when binding to interface addresses]) ;;
1613esac
1371
1614
1372AC_CACHE_CHECK(
1373 [for a minimum recommended value of tickadj],
1374 [ntp_cv_var_min_rec_tickadj],
1375 [
1376 ans=no
1377 case "$host" in
1378 *-*-aix*)
1379 ans=40
1380 ;;
1381 esac
1382 ntp_cv_var_min_rec_tickadj=$ans
1383 ]
1384)
1385case "$ntp_cv_var_min_rec_tickadj" in
1386 ''|no)
1615ntp_warning='GRONK'
1616AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
1617case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
1618 yes*)
1619 ntp_warning=''
1620 ans='clock_settime()'
1387 ;;
1621 ;;
1388 *)
1389 AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
1390 [Should we recommend a minimum value for tickadj?])
1622 noyes*)
1623 ntp_warning='But clock_settime() would be better (if we had it)'
1624 ans='settimeofday()'
1625 ;;
1626 nonoyes)
1627 ntp_warning='Which is the worst of the three'
1628 ans='stime()'
1629 ;;
1630 *)
1631 case "$build" in
1632 $host) ntp_warning='Which leaves us with nothing to use!'
1633 ans=none
1634 ;;
1391esac
1635esac
1636esac
1637AC_MSG_RESULT($ans)
1638case "$ntp_warning" in
1639 '') ;;
1640 *) AC_MSG_WARN(*** $ntp_warning ***)
1641 ;;
1642esac
1392
1643
1393AC_CACHE_CHECK(
1394 [if the TTY code permits PARENB and IGNPAR],
1395 [ntp_cv_no_parenb_ignpar],
1396 [
1397 ans=no
1398 case "$host" in
1399 i?86-*-*linux*)
1400 ans=yes
1401 ;;
1402 mips-sgi-irix*)
1403 ans=yes
1404 ;;
1405 i?86-*-freebsd[[123]].*)
1406 ;;
1407 i?86-*-freebsd*)
1408 ans=yes
1409 ;;
1410 *-*-unicosmp*)
1411 ans=yes
1412 ;;
1413 esac
1414 ntp_cv_no_parenb_ignpar=$ans
1415 ]
1416)
1417case "$ntp_cv_no_parenb_ignpar" in
1418 yes)
1419 AC_DEFINE([NO_PARENB_IGNPAR], [1],
1420 [Is there a problem using PARENB and IGNPAR?])
1644AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1645[case "$host" in
1646 *-*-solaris2.4*)
1647 ans=yes
1648 ;;
1649 *) ans=no
1650 ;;
1421esac
1651esac
1652ac_cv_var_syscall_bug=$ans])
1653case "$ac_cv_var_syscall_bug" in
1654 yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1655esac
1422
1656
1423AC_MSG_CHECKING([if we're including processing time debugging code])
1424AC_ARG_ENABLE(
1425 [debug-timing],
1426 [AS_HELP_STRING(
1427 [--enable-debug-timing],
1428 [- include processing time debugging code (costs performance)]
1429 )],
1430 [ntp_ok=$enableval],
1431 [ntp_ok=no]
1432)
1433case "$ntp_ok" in
1657AC_CACHE_CHECK(for SIGIO, ac_cv_hdr_def_sigio,
1658 AC_EGREP_CPP(yes,
1659 [#include <signal.h>
1660#ifdef SIGIO
1661 yes
1662#endif
1663 ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
1664
1665dnl Override those system that have a losing SIGIO
1666AC_CACHE_CHECK(if we want to use signalled IO, ac_cv_var_signalled_io,
1667[ans=no
1668case "$ac_cv_hdr_def_sigio" in
1434 yes)
1669 yes)
1435 AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
1670 ans=yes
1671 case "$host" in
1672 alpha*-dec-osf4*|alpha*-dec-osf5*)
1673 ans=no
1674 ;;
1675 *-convex-*)
1676 ans=no
1677 ;;
1678 *-dec-*)
1679 ans=no
1680 ;;
1681 *-pc-cygwin*)
1682 ans=no
1683 ;;
1684 *-sni-sysv*)
1685 ans=no
1686 ;;
1687 *-univel-sysv*)
1688 ans=no
1689 ;;
1690 *-*-irix6*)
1691 ans=no
1692 ;;
1693 *-*-freebsd*)
1694 ans=no
1695 ;;
1696 *-*-linux*)
1697 ans=no
1698 ;;
1699 *-*-unicosmp*)
1700 ans=no
1701 ;;
1702 esac
1703 ;;
1436esac
1704esac
1437AC_MSG_RESULT([$ntp_ok])
1705ac_cv_var_signalled_io=$ans])
1706case "$ac_cv_var_signalled_io" in
1707 yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1708esac
1438
1709
1439AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
1440AC_ARG_ENABLE(
1441 [dst-minutes],
1442 [AS_HELP_STRING(
1443 [--enable-dst-minutes],
1444 [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
1445 ],
1446 [ans=$enableval],
1447 [ans=60]
1448)
1449AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
1450 [The number of minutes in a DST adjustment])
1451AC_MSG_RESULT([$ans])
1710AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1711 AC_EGREP_CPP(yes,
1712 [#include <signal.h>
1713#ifdef SIGPOLL
1714 yes
1715#endif
1716 ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
1452
1717
1453AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
1454AC_ARG_ENABLE(
1455 [ignore-dns-errors],
1456 [AS_HELP_STRING(
1457 [--enable-ignore-dns-errors],
1458 [- retry DNS queries on any error]
1459 )],
1460 [ans=$enableval],
1461 [ans=no]
1462)
1463case "$ans" in
1718AC_CACHE_CHECK(for SIGSYS, ac_cv_hdr_def_sigsys,
1719 AC_EGREP_CPP(yes,
1720 [#include <signal.h>
1721#ifdef SIGSYS
1722 yes
1723#endif
1724 ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
1725
1726AC_CACHE_CHECK(if we can use SIGPOLL for UDP I/O, ac_cv_var_use_udp_sigpoll,
1727[ans=no
1728case "$ac_cv_hdr_def_sigpoll" in
1464 yes)
1729 yes)
1465 AC_DEFINE([IGNORE_DNS_ERRORS], [1],
1466 [Retry queries on _any_ DNS error?])
1730 case "$host" in
1731 mips-sgi-irix*)
1732 ans=no
1733 ;;
1734 vax-dec-bsd)
1735 ans=no
1736 ;;
1737 *-pc-cygwin*)
1738 ans=no
1739 ;;
1740 *-sni-sysv*)
1741 ans=no
1742 ;;
1743 *-*-aix[[45]]*)
1744 ans=no
1745 ;;
1746 *-*-hpux*)
1747 ans=no
1748 ;;
1749 *-*-linux*)
1750 ans=no
1751 ;;
1752 *-*-osf*)
1753 ans=no
1754 ;;
1755 *-*-qnx*)
1756 ans=no
1757 ;;
1758 *-*-sunos*)
1759 ans=no
1760 ;;
1761 *-*-ultrix*)
1762 ans=no
1763 ;;
1764 *-*-unicosmp*)
1765 ans=no
1766 ;;
1767 *) ans=yes
1768 ;;
1769 esac
1770 ;;
1467esac
1771esac
1468AC_MSG_RESULT([$ans])
1772ac_cv_var_use_udp_sigpoll=$ans])
1773case "$ac_cv_var_use_udp_sigpoll" in
1774 yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1775esac
1469
1776
1470AC_CACHE_CHECK(
1471 [availability of ntp_{adj,get}time()],
1472 [ntp_cv_var_ntp_syscalls],
1473 [
1474 ntp_cv_var_ntp_syscalls=no
1475 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1476 yesyes*)
1477 ntp_cv_var_ntp_syscalls=libc
1478 ;;
1479 *yes)
1480 ntp_cv_var_ntp_syscalls=inline
1481 ;;
1482 *)
1483 AC_PREPROC_IFELSE(
1484 [AC_LANG_SOURCE(
1485 [
1486 #include <sys/syscall.h>
1487 #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
1488 # error
1489 #endif
1490 ])],
1491 [ntp_cv_var_ntp_syscalls=kernel]
1492 )
1493 ;;
1494 esac
1495 ]
1496)
1497case "$ntp_cv_var_ntp_syscalls" in
1498 libc)
1499 AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
1500 [Do we have ntp_{adj,get}time in libc?])
1777AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1778[ans=no
1779case "$ac_cv_hdr_def_sigpoll" in
1780 yes)
1781 case "$host" in
1782 mips-sgi-irix*)
1783 ans=no
1784 ;;
1785 vax-dec-bsd)
1786 ans=no
1787 ;;
1788 *-pc-cygwin*)
1789 ans=no
1790 ;;
1791 *-sni-sysv*)
1792 ans=no
1793 ;;
1794 *-*-aix[[45]]*)
1795 ans=no
1796 ;;
1797 *-*-hpux*)
1798 ans=no
1799 ;;
1800 *-*-linux*)
1801 ans=no
1802 ;;
1803 *-*-osf*)
1804 ans=no
1805 ;;
1806 *-*-sunos*)
1807 ans=no
1808 ;;
1809 *-*-ultrix*)
1810 ans=no
1811 ;;
1812 *-*-qnx*)
1813 ans=no
1814 ;;
1815 *-*-unicosmp*)
1816 ans=no
1817 ;;
1818 *) ans=yes
1819 ;;
1820 esac
1501 ;;
1821 ;;
1502 kernel)
1503 AC_DEFINE([NTP_SYSCALLS_STD], [1],
1504 [Do we have ntp_{adj,get}time in the kernel?])
1505 ;;
1506esac
1822esac
1823ac_cv_var_use_tty_sigpoll=$ans])
1824case "$ac_cv_var_use_tty_sigpoll" in
1825 yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
1826esac
1507
1827
1508AC_CACHE_CHECK(
1509 [if sys/timex.h has STA_FLL],
1510 [ntp_cv_var_sta_fll],
1511 [AC_PREPROC_IFELSE(
1512 [AC_LANG_SOURCE(
1513 [
1514 #include <sys/timex.h>
1515 #ifndef STA_FLL
1516 # error
1517 #endif
1518 ])],
1519 [ntp_cv_var_sta_fll=yes],
1520 [ntp_cv_var_sta_fll=no]
1521 )]
1522)
1523
1524AC_CACHE_CHECK(
1525 [if we have kernel PLL support],
1526 [ntp_cv_var_kernel_pll],
1527 [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
1528 case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
1529 *no*)
1530 ntp_cv_var_kernel_pll=no
1531 ;;
1532 *) ntp_cv_var_kernel_pll=yes
1533 ;;
1534 esac
1535 ]
1536)
1537case "$ntp_cv_var_kernel_pll" in
1828case "$ac_cv_header_sys_sio_h" in
1538 yes)
1829 yes)
1539 AC_DEFINE([KERNEL_PLL], [1],
1540 [Does the kernel support precision time discipline?])
1830 AC_CACHE_CHECK(sys/sio.h for TIOCDCDTIMESTAMP, ac_cv_hdr_def_tiocdcdtimestamp,
1831 AC_EGREP_CPP(yes,
1832[#include <sys/sio.h>
1833#ifdef TIOCDCDTIMESTAMP
1834 yes
1835#endif
1836 ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
1837 ;;
1541esac
1542
1838esac
1839
1543AC_CACHE_CHECK(
1544 [if SIOCGIFCONF returns buffer size in the buffer],
1545 [ntp_cv_size_returned_in_buffer],
1546 [
1547 ans=no
1548 case "$host" in
1549 *-fujitsu-uxp*)
1550 ans=yes
1551 ;;
1552 *-ncr-sysv4*)
1553 ans=yes
1554 ;;
1555 *-univel-sysv*)
1556 ans=yes
1557 ;;
1558 esac
1559 ntp_cv_size_returned_in_buffer=$ans
1560 ]
1561)
1562case "$ntp_cv_size_returned_in_buffer" in
1840case "$ac_cv_hdr_def_tiocdcdtimestamp" in
1563 yes)
1841 yes)
1564 AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
1565 [Does SIOCGIFCONF return size in the buffer?])
1842 ac_cv_var_oncore_ok=yes
1843 ;;
1566esac
1567
1844esac
1845
1568# Check for ioctls TIOCGPPSEV
1569AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
1570case "$ac_cv_header_termios_h" in
1571 yes)
1572 AC_PREPROC_IFELSE(
1573 [AC_LANG_SOURCE([
1574 #include <termios.h>
1575 #ifndef TIOCGPPSEV
1576 # error
1577 #endif
1578 ])],
1579 [ntp_ok=yes],
1580 [ntp_ok=no]
1581 )
1846AC_CACHE_CHECK(if nlist() values might require extra indirection,
1847ac_cv_var_nlist_extra_indirection,
1848[ans=no
1849case "$host" in
1850 *-*-aix*)
1851 ans=yes
1582 ;;
1852 ;;
1583 *)
1584 ntp_ok=no
1853esac
1854ac_cv_var_nlist_extra_indirection=$ans])
1855case "$ac_cv_var_nlist_extra_indirection" in
1856 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
1857esac
1858
1859AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1860ac_cv_var_min_rec_tickadj,
1861[ans=no
1862case "$host" in
1863 *-*-aix*)
1864 ans=40
1585 ;;
1586esac
1865 ;;
1866esac
1587case "$ntp_ok" in
1588 yes)
1589 AC_DEFINE([HAVE_TIOCGPPSEV], [1],
1590 [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1867ac_cv_var_min_rec_tickadj=$ans])
1868case "$ac_cv_var_min_rec_tickadj" in
1869 ''|no) ;;
1870 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
1591esac
1871esac
1592AC_MSG_RESULT([$ntp_ok])
1593
1872
1594# Check for ioctls TIOCSPPS
1595AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
1596case "$ac_cv_header_termios_h" in
1597 yes)
1598 AC_PREPROC_IFELSE(
1599 [AC_LANG_SOURCE([
1600 #include <termios.h>
1601 #ifndef TIOCSPPS
1602 # error
1603 #endif
1604 ])],
1605 [ntp_ok=yes],
1606 [ntp_ok=no]
1607 )
1873AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1874ac_cv_var_no_parenb_ignpar,
1875[ans=no
1876case "$host" in
1877 i?86-*-linux*)
1878 ans=yes
1608 ;;
1879 ;;
1609 *)
1610 ntp_ok=no
1880 mips-sgi-irix*)
1881 ans=yes
1611 ;;
1882 ;;
1883 i?86-*-freebsd[[123]].*)
1884 ;;
1885 i?86-*-freebsd*)
1886 ans=yes
1887 ;;
1888 *-*-unicosmp*)
1889 ans=yes
1890 ;;
1612esac
1891esac
1613case "$ntp_ok" in
1614 yes)
1615 AC_DEFINE([HAVE_TIOCSPPS], [1],
1616 [Do we have the TIOCSPPS ioctl (Solaris)?])
1892ac_cv_var_no_parenb_ignpar=$ans])
1893case "$ac_cv_var_no_parenb_ignpar" in
1894 yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
1617esac
1895esac
1618AC_MSG_RESULT([$ntp_ok])
1619
1896
1620# Check for ioctls CIOGETEV
1621AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
1622case "$ac_cv_header_sys_ppsclock_h" in
1897AC_MSG_CHECKING(if we're including debugging code)
1898AC_ARG_ENABLE(debugging,
1899 AC_HELP_STRING([--enable-debugging], [+ include debugging code]),
1900 [ntp_ok=$enableval], [ntp_ok=yes])
1901if test "$ntp_ok" = "yes"; then
1902 AC_DEFINE(DEBUG, 1, [Enable debugging?])
1903fi
1904AC_MSG_RESULT($ntp_ok)
1905
1906AC_MSG_CHECKING(if we including processing time debugging code)
1907AC_ARG_ENABLE(debug-timing,
1908 AC_HELP_STRING([--enable-debug-timing], [- include processing time debugging code (costs performance)]),
1909 [ntp_ok=$enableval], [ntp_ok=no])
1910if test "$ntp_ok" = "yes"; then
1911 AC_DEFINE(DEBUG_TIMING, 1, [Enable processing time debugging?])
1912fi
1913AC_MSG_RESULT($ntp_ok)
1914
1915AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1916AC_ARG_ENABLE(dst_minutes,
1917 AC_HELP_STRING([--enable-dst-minutes=60], [+ minutes per DST adjustment]),
1918 [ans=$enableval], [ans=60])
1919AC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
1920AC_MSG_RESULT($ans)
1921
1922AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1923 ac_cv_var_tty_clk,
1924 [case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
1925 *yes*) ac_cv_var_tty_clk=yes ;;
1926 esac])
1927case "$ac_cv_var_tty_clk" in
1928 yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
1929esac
1930
1931AC_CACHE_CHECK(for the ppsclock streams module,
1932 ac_cv_var_ppsclock,
1933 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1934case "$ac_cv_var_ppsclock" in
1935 yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
1936esac
1937
1938AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1939 [ac_cv_var_mcast=no
1940 case "$host" in
1941 i386-sequent-sysv4) ;;
1942 *) AC_EGREP_CPP(yes,
1943 [#include <netinet/in.h>
1944#ifdef IP_ADD_MEMBERSHIP
1945 yes
1946#endif
1947 ], ac_cv_var_mcast=yes) ;;
1948 esac])
1949case "$ac_cv_var_mcast" in
1623 yes)
1950 yes)
1624 AC_PREPROC_IFELSE(
1625 [AC_LANG_SOURCE([
1626 #include <sys/ppsclock.h>
1627 #ifndef CIOGETEV
1628 # error
1629 #endif
1630 ])],
1631 [ntp_ok=yes],
1632 [ntp_ok=no]
1633 )
1951 AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?])
1952 AC_CACHE_CHECK([[arg type needed for IP*_MULTICAST_LOOP for setsockopt()]],
1953 ac_cv_var_typeof_ip_multicast_loop,
1954 [case "$host" in
1955 *-*-netbsd*|*-*-linux*)
1956 ac_cv_var_typeof_ip_multicast_loop=u_int
1957 ;;
1958 *-*-winnt*)
1959 ac_cv_var_typeof_ip_multicast_loop=BOOL
1960 ;;
1961 *) ac_cv_var_typeof_ip_multicast_loop=u_char
1962 ;;
1963 esac])
1964 AC_DEFINE_UNQUOTED(TYPEOF_IP_MULTICAST_LOOP,
1965 $ac_cv_var_typeof_ip_multicast_loop,
1966 [What type to use for setsockopt])
1634 ;;
1967 ;;
1968esac
1969
1970AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1971 [ac_cv_var_ntp_syscalls=no
1972 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
1973 yesyes*)
1974 ac_cv_var_ntp_syscalls=libc
1975 ;;
1976 *yes)
1977 ac_cv_var_ntp_syscalls=inline
1978 ;;
1979 *) AC_EGREP_CPP(yes,
1980 [#include <sys/syscall.h>
1981#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1982 yes
1983#endif
1984 ], ac_cv_var_ntp_syscalls=kernel)
1985 ;;
1986 esac])
1987case "$ac_cv_var_ntp_syscalls" in
1988 libc)
1989 AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
1990 ;;
1991 kernel)
1992 AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
1993 ;;
1635 *)
1994 *)
1636 ntp_ok=no
1637 ;;
1638esac
1995 ;;
1996esac
1639case "$ntp_ok" in
1997
1998AC_CACHE_CHECK(if sys/timex.h has STA_FLL, ac_cv_var_sta_fll,
1999[AC_EGREP_CPP(yes,
2000 [#include <sys/timex.h>
2001#ifdef STA_FLL
2002 yes
2003#endif
2004 ], ac_cv_var_sta_fll=yes, ac_cv_var_sta_fll=no)])
2005
2006AC_CACHE_CHECK(if we have kernel PLL support, ac_cv_var_kernel_pll,
2007[dnl ac_cv_var_ntp_syscalls is {no,libc,kernel}
2008case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
2009 *no*)
2010 ac_cv_var_kernel_pll=no
2011 ;;
2012 *) ac_cv_var_kernel_pll=yes
2013 ;;
2014esac])
2015case "$ac_cv_var_kernel_pll" in
1640 yes)
2016 yes)
1641 AC_DEFINE([HAVE_CIOGETEV], [1],
1642 [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
2017 AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
2018 ;;
1643esac
2019esac
1644AC_MSG_RESULT([$ntp_ok])
1645
2020
2021AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
2022 [ans=no
2023 case "$host" in
2024 *-fujitsu-uxp*)
2025 ans=yes
2026 ;;
2027 *-ncr-sysv4*)
2028 ans=yes
2029 ;;
2030 *-univel-sysv*)
2031 ans=yes
2032 ;;
2033 esac
2034 ac_cv_var_size_returned_in_buffer=$ans])
2035case "$ac_cv_var_size_returned_in_buffer" in
2036 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
2037esac
2038
2039dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
2040dnl [AC_ARG_ENABLE(gdt-surveying, [ --enable-gdt-surveying - include GDT survey code],
2041dnl [ans=$enableval], [ans=no])
2042dnl ac_cv_var_gdt_surveying=$ans])
2043dnl case "$ac_cv_var_gdt_surveying" in
2044dnl yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
2045dnl esac
2046
2047# Check for ioctls TIOCGPPSEV
2048AC_MSG_CHECKING(ioctl TIOCGPPSEV)
2049if test "$ac_cv_header_termios_h" = "yes"; then
2050 AC_EGREP_CPP(yes,
2051 [#include <termios.h>
2052#ifdef TIOCGPPSEV
2053 yes
2054#endif
2055 ], ntp_ok=yes, ntp_ok=no)
2056else
2057ntp_ok=no
2058fi
2059if test "$ntp_ok" = "yes"; then
2060 AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
2061 ac_cv_var_oncore_ok=yes
2062fi
2063AC_MSG_RESULT($ntp_ok)
2064
2065# Check for ioctls TIOCSPPS
2066AC_MSG_CHECKING(ioctl TIOCSPPS)
2067if test "$ac_cv_header_termios_h" = "yes"; then
2068 AC_EGREP_CPP(yes,
2069 [#include <termios.h>
2070#ifdef TIOCSPPS
2071 yes
2072#endif
2073 ], ntp_ok=yes, ntp_ok=no)
2074else
2075 ntp_ok=no
2076fi
2077
2078if test "$ntp_ok" = "yes"; then
2079 AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
2080fi
2081AC_MSG_RESULT($ntp_ok)
2082
2083# Check for ioctls CIOGETEV
2084AC_MSG_CHECKING(ioctl CIOGETEV)
2085if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
2086 AC_EGREP_CPP(yes,
2087 [#include <sys/ppsclock.h>
2088#ifdef CIOGETEV
2089 yes
2090#endif
2091 ], ntp_ok=yes, ntp_ok=no)
2092else
2093ntp_ok=no
2094fi
2095if test "$ntp_ok" = "yes"; then
2096 ac_cv_var_oncore_ok=yes
2097 AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
2098fi
2099AC_MSG_RESULT($ntp_ok)
2100
2101
1646# ATOM/PPSAPI stuff.
1647
2102# ATOM/PPSAPI stuff.
2103
1648ntp_atom_ok=yes
2104# ATOM used to require struct timespec, but that's been fixed now.
1649
2105
2106# case "$ac_cv_struct_timespec" in
2107# 'yes')
2108# ac_cv_var_atom_ok=yes
2109# ;;
2110# esac
2111ac_cv_var_atom_ok=yes
2112
1650# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
1651
1652# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
2113# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
2114
2115# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
2116
1653# The PPSAPI needs struct timespec.
2117# The PPSAPI needs struct timespec.
2118
1654# The PPSAPI also needs a timepps header.
1655
2119# The PPSAPI also needs a timepps header.
2120
1656case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
2121case "$ac_cv_c_inline$ac_cv_struct_timespec" in
1657 inlineyes)
1658 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
1659 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
1660 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
2122 inlineyes)
2123 case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
2124 *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
2125 AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1661 ntp_jupiter_ok=yes
1662 ntp_oncore_ok=yes
1663 ntp_parse_ok=yes
1664 ntp_ripe_ncc_ok=yes
2126 ac_cv_var_jupiter_ok=yes
2127 ac_cv_var_oncore_ok=yes
2128 ac_cv_var_parse_ok=yes
2129 ac_cv_var_ripe_ncc_ok=yes
1665 ;;
1666 esac
1667 ;;
1668esac
1669
1670# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
2130 ;;
2131 esac
2132 ;;
2133esac
2134
2135# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
1671AC_CHECK_HEADER([linux/serial.h])
2136AC_CHECK_HEADER(linux/serial.h)
2137AC_MSG_CHECKING(ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG)
1672case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
1673 yesyes)
2138case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
2139 yesyes)
1674 AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
1675 AC_PREPROC_IFELSE(
1676 [AC_LANG_SOURCE([
1677 #include <sys/time.h>
1678 typedef int u_int;
1679 #include <sys/ppsclock.h>
1680 #include <linux/serial.h>
2140 AC_EGREP_CPP(yes,
2141 [#include <sys/time.h>
2142typedef int u_int;
1681
2143
1682 #ifndef TIOCGSERIAL
1683 # error
1684 #endif
1685 #ifndef TIOCSSERIAL
1686 # error
1687 #endif
1688 #ifndef ASYNC_PPS_CD_POS
1689 # error
1690 #endif
1691 #ifndef ASYNC_PPS_CD_NEG
1692 # error
1693 #endif
1694 #ifndef CIOGETEV
1695 # error
1696 #endif
1697 ])],
1698 [ntp_ok=yes],
1699 [ntp_ok=no]
1700 )
1701 AC_MSG_RESULT([$ntp_ok])
1702 ;;
2144#include <sys/ppsclock.h>
2145#include <linux/serial.h>
2146
2147#ifdef TIOCGSERIAL
2148#ifdef TIOCSSERIAL
2149#ifdef ASYNC_PPS_CD_POS
2150#ifdef ASYNC_PPS_CD_NEG
2151#ifdef CIOGETEV
2152 yes
2153#endif
2154#endif
2155#endif
2156#endif
2157#endif
2158 ], ntp_ok=yes)
2159 ;;
1703 *)
2160 *)
1704 ntp_ok=no
1705 ;;
2161 ntp_ok=no
2162 ;;
1706esac
2163esac
1707case "$ntp_ok" in
1708 yes)
1709 AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
1710 [Do we have the TIO serial stuff?])
1711esac
2164if test "$ntp_ok" = "yes"; then
2165 AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
2166fi
2167AC_MSG_RESULT($ntp_ok)
1712
1713# Check for SHMEM_STATUS support
2168
2169# Check for SHMEM_STATUS support
1714AC_MSG_CHECKING([SHMEM_STATUS support])
2170AC_MSG_CHECKING(SHMEM_STATUS support)
1715case "$ac_cv_header_sys_mman_h" in
2171case "$ac_cv_header_sys_mman_h" in
1716 yes)
1717 ntp_ok=yes
1718 ;;
1719 *)
1720 ntp_ok=no
1721 ;;
2172 yes) ntp_ok=yes ;;
2173 *) ntp_ok=no ;;
1722esac
2174esac
1723case "$ntp_ok" in
1724 yes)
1725 AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
1726 [Do we have support for SHMEM_STATUS?])
1727esac
1728AC_MSG_RESULT([$ntp_ok])
2175if test "$ntp_ok" = "yes"; then
2176 AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
2177fi
2178AC_MSG_RESULT($ntp_ok)
1729
2179
2180dnl dnl These are for OPT_PROGRAMS in authstuff/
2181dnl AC_SUBST(AUTHCERT)
2182dnl AC_SUBST(AUTHSPEED)
2183dnl AC_SUBST(MD5DRIVER)
2184dnl AC_SUBST(KEYPARITY)
2185dnl AC_SUBST(MAKEIPFP)
2186dnl AC_SUBST(MAKEPC1)
2187dnl AC_SUBST(MAKEPC2)
2188dnl AC_SUBST(MAKESP)
2189dnl AC_SUBST(MKRANDKEYS)
2190dnl AC_SUBST(OMAKEIPFP)
2191dnl AC_SUBST(UNIXCERT)
2192
1730ntp_refclock=no
1731
1732# HPUX only, and by explicit request
2193ntp_refclock=no
2194
2195# HPUX only, and by explicit request
1733AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
1734AC_ARG_ENABLE(
1735 [BANCOMM],
1736 [AS_HELP_STRING(
1737 [--enable-BANCOMM],
1738 [- Datum/Bancomm bc635/VME interface]
1739 )],
1740 [ntp_ok=$enableval],
1741 [ntp_ok=no]
1742)
1743case "$ntp_ok" in
1744 yes)
2196AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
2197AC_ARG_ENABLE(BANCOMM,
2198 AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
2199 [ntp_ok=$enableval], [ntp_ok=no])
2200if test "$ntp_ok" = "yes"; then
1745 ntp_refclock=yes
2201 ntp_refclock=yes
1746 AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
1747 ;;
1748esac
1749AC_MSG_RESULT([$ntp_ok])
2202 AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
2203fi
2204AC_MSG_RESULT($ntp_ok)
1750case "$ntp_ok$host" in
1751 yes*-*-hpux*) ;;
2205case "$ntp_ok$host" in
2206 yes*-*-hpux*) ;;
1752 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2207 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1753esac
1754
1755#HPUX only, and only by explicit request
2208esac
2209
2210#HPUX only, and only by explicit request
1756AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
1757AC_ARG_ENABLE(
1758 [GPSVME],
1759 [AS_HELP_STRING(
1760 [--enable-GPSVME],
1761 [- TrueTime GPS receiver/VME interface]
1762 )],
1763 [ntp_ok=$enableval],
1764 [ntp_ok=no]
1765)
1766case "$ntp_ok" in
1767 yes)
2211AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
2212AC_ARG_ENABLE(GPSVME,
2213 AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
2214 [ntp_ok=$enableval], [ntp_ok=no])
2215if test "$ntp_ok" = "yes"; then
1768 ntp_refclock=yes
2216 ntp_refclock=yes
1769 AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
1770 ;;
1771esac
1772AC_MSG_RESULT([$ntp_ok])
2217 AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
2218fi
2219AC_MSG_RESULT($ntp_ok)
1773case "$ntp_ok$host" in
1774 yes*-*-hpux*) ;;
2220case "$ntp_ok$host" in
2221 yes*-*-hpux*) ;;
1775 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
2222 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1776esac
1777
2223esac
2224
1778AC_MSG_CHECKING([for PCL720 clock support])
2225AC_MSG_CHECKING(for PCL720 clock support)
1779case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1780 yesyesyes)
2226case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
2227 yesyesyes)
1781 AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
2228 AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
1782 ans=yes
1783 ;;
1784 *)
1785 ans=no
1786 ;;
1787esac
2229 ans=yes
2230 ;;
2231 *)
2232 ans=no
2233 ;;
2234esac
1788AC_MSG_RESULT([$ans])
2235AC_MSG_RESULT($ans)
1789
2236
1790AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
1791AC_ARG_ENABLE(
1792 [all-clocks],
1793 [AS_HELP_STRING(
1794 [--enable-all-clocks],
1795 [+ include all suitable non-PARSE clocks:]
1796 )],
1797 [ntp_eac=$enableval],
1798 [ntp_eac=yes]
1799)
1800AC_MSG_RESULT([$ntp_eac])
2237AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
2238AC_ARG_ENABLE(all-clocks,
2239 AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
2240 [ntp_eac=$enableval], [ntp_eac=yes])
2241AC_MSG_RESULT($ntp_eac)
1801
2242
1802# HMS: Should we also require ntp_parse_ok?
1803AC_MSG_CHECKING([if we have support for PARSE clocks])
1804case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
2243# HMS: Should we also require ac_cv_var_parse_ok?
2244AC_MSG_CHECKING(if we have support for PARSE clocks)
2245case "$ac_cv_var_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
1805 yes*yes*)
1806 ntp_canparse=yes
1807 ;;
1808 *) ntp_canparse=no
1809 ;;
1810esac
2246 yes*yes*)
2247 ntp_canparse=yes
2248 ;;
2249 *) ntp_canparse=no
2250 ;;
2251esac
1811AC_MSG_RESULT([$ntp_canparse])
2252AC_MSG_RESULT($ntp_canparse)
1812
1813AC_MSG_CHECKING([if we have support for audio clocks])
1814case "$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
1815 *yes*)
1816 ntp_canaudio=yes
2253
2254AC_MSG_CHECKING([if we have support for audio clocks])
2255case "$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
2256 *yes*)
2257 ntp_canaudio=yes
1817 AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
2258 AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
1818 ;;
1819 *) ntp_canaudio=no ;;
1820esac
2259 ;;
2260 *) ntp_canaudio=no ;;
2261esac
1821AC_MSG_RESULT([$ntp_canaudio])
2262AC_MSG_RESULT($ntp_canaudio)
1822
1823AC_MSG_CHECKING([if we have support for the SHM refclock interface])
1824case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
1825 yesyes)
1826 ntp_canshm=yes
1827 ;;
1828 *) ntp_canshm=no ;;
1829esac
2263
2264AC_MSG_CHECKING([if we have support for the SHM refclock interface])
2265case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
2266 yesyes)
2267 ntp_canshm=yes
2268 ;;
2269 *) ntp_canshm=no ;;
2270esac
1830AC_MSG_RESULT([$ntp_canshm])
2271AC_MSG_RESULT($ntp_canshm)
1831
2272
1832# Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
1833AC_CACHE_CHECK(
1834 [for termios modem control],
1835 [ntp_cv_modem_control],
1836 [AC_COMPILE_IFELSE(
1837 [AC_LANG_PROGRAM(
1838 [[
1839 #ifdef HAVE_UNISTD_H
1840 # include <unistd.h>
1841 #endif
1842 #ifdef HAVE_TERMIOS_H
1843 # include <termios.h>
1844 #endif
1845 #ifdef HAVE_SYS_IOCTL_H
1846 # include <sys/ioctl.h>
1847 #endif
1848 ]],
1849 [[
1850 int dtr = TIOCM_DTR;
1851
1852 ioctl(1, TIOCMBIS, (char *)&dtr);
1853 ]]
1854 )],
1855 [ntp_cv_modem_control=yes],
1856 [ntp_cv_modem_control=no]
1857 )]
1858)
1859case "$ntp_eac::$ntp_cv_modem_control" in
1860 yes::yes)
1861 ntp_enable_all_modem_control_clocks=yes
1862 ;;
1863 *)
1864 ntp_enable_all_modem_control_clocks=no
1865 ;;
1866esac
1867
1868# Requires modem control
2273# Requires modem control
1869AC_MSG_CHECKING([ACTS modem service])
1870AC_ARG_ENABLE(
1871 [ACTS],
1872 [AS_HELP_STRING(
1873 [--enable-ACTS],
1874 [s ACTS modem service]
1875 )],
2274AC_MSG_CHECKING(ACTS modem service)
2275AC_ARG_ENABLE(ACTS,
2276 AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
1876 [ntp_ok=$enableval],
2277 [ntp_ok=$enableval],
1877 [ntp_ok=$ntp_enable_all_modem_control_clocks]
1878)
1879case "$ntp_ok" in
1880 yes)
2278 [AC_EGREP_CPP(yes,
2279 [#include <termios.h>
2280#ifdef HAVE_SYS_IOCTL_H
2281#include <sys/ioctl.h>
2282#endif
2283#ifdef TIOCMBIS
2284 yes
2285#endif
2286 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2287if test "$ntp_ok" = "yes"; then
1881 ntp_refclock=yes
2288 ntp_refclock=yes
1882 AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
1883 ;;
1884esac
1885AC_MSG_RESULT([$ntp_ok])
2289 AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
2290fi
2291AC_MSG_RESULT($ntp_ok)
1886
2292
1887AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
1888AC_ARG_ENABLE(
1889 [ARBITER],
1890 [AS_HELP_STRING(
1891 [--enable-ARBITER],
1892 [+ Arbiter 1088A/B GPS receiver]
1893 )],
1894 [ntp_ok=$enableval],
1895 [ntp_ok=$ntp_eac]
1896)
1897case "$ntp_ok" in
1898 yes)
2293AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
2294AC_ARG_ENABLE(ARBITER,
2295 AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
2296 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2297if test "$ntp_ok" = "yes"; then
1899 ntp_refclock=yes
2298 ntp_refclock=yes
1900 AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
1901 ;;
1902esac
1903AC_MSG_RESULT([$ntp_ok])
2299 AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
2300fi
2301AC_MSG_RESULT($ntp_ok)
1904
2302
1905AC_MSG_CHECKING([Arcron MSF receiver])
1906AC_ARG_ENABLE(
1907 [ARCRON_MSF],
1908 [AS_HELP_STRING(
1909 [--enable-ARCRON-MSF],
1910 [+ Arcron MSF receiver]
1911 )],
1912 [ntp_ok=$enableval],
1913 [ntp_ok=$ntp_eac]
1914)
1915case "$ntp_ok" in
1916 yes)
2303AC_MSG_CHECKING(Arcron MSF receiver)
2304AC_ARG_ENABLE(ARCRON_MSF,
2305 AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
2306 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2307if test "$ntp_ok" = "yes"; then
1917 ntp_refclock=yes
2308 ntp_refclock=yes
1918 AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
1919 ;;
1920esac
1921AC_MSG_RESULT([$ntp_ok])
2309 AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
2310fi
2311AC_MSG_RESULT($ntp_ok)
1922
2312
1923AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
1924AC_ARG_ENABLE(
1925 [AS2201],
1926 [AS_HELP_STRING(
1927 [--enable-AS2201],
1928 [+ Austron 2200A/2201A GPS receiver]
1929 )],
1930 [ntp_ok=$enableval],
1931 [ntp_ok=$ntp_eac]
1932)
1933case "$ntp_ok" in
1934 yes)
2313AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
2314AC_ARG_ENABLE(AS2201,
2315 AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
2316 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2317if test "$ntp_ok" = "yes"; then
1935 ntp_refclock=yes
2318 ntp_refclock=yes
1936 AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
1937 ;;
1938esac
1939AC_MSG_RESULT([$ntp_ok])
2319 AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
2320fi
2321AC_MSG_RESULT($ntp_ok)
1940
2322
1941AC_MSG_CHECKING([ATOM PPS interface])
1942AC_ARG_ENABLE(
1943 [ATOM],
1944 [AS_HELP_STRING(
1945 [--enable-ATOM],
1946 [s ATOM PPS interface]
1947 )],
1948 [ntp_ok=$enableval],
1949 [ntp_ok=$ntp_eac]
1950)
1951case "$ntp_atom_ok" in
2323AC_MSG_CHECKING(ATOM PPS interface)
2324AC_ARG_ENABLE(ATOM,
2325 AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
2326 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2327case "$ac_cv_var_atom_ok" in
1952 no) ntp_ok=no ;;
1953esac
2328 no) ntp_ok=no ;;
2329esac
1954case "$ntp_ok" in
1955 yes)
2330if test "$ntp_ok" = "yes"; then
1956 ntp_refclock=yes
2331 ntp_refclock=yes
1957 AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
1958 ;;
1959esac
1960AC_MSG_RESULT([$ntp_ok])
2332 AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
2333fi
2334AC_MSG_RESULT($ntp_ok)
1961
2335
1962AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
1963AC_ARG_ENABLE(
1964 [CHRONOLOG],
1965 [AS_HELP_STRING(
1966 [--enable-CHRONOLOG],
1967 [+ Chrono-log K-series WWVB receiver]
1968 )],
1969 [ntp_ok=$enableval],
1970 [ntp_ok=$ntp_eac]
1971)
1972case "$ntp_ok" in
1973 yes)
2336AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
2337AC_ARG_ENABLE(CHRONOLOG,
2338 AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
2339 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2340if test "$ntp_ok" = "yes"; then
1974 ntp_refclock=yes
2341 ntp_refclock=yes
1975 AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
1976 ;;
1977esac
1978AC_MSG_RESULT([$ntp_ok])
2342 AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
2343fi
2344AC_MSG_RESULT($ntp_ok)
1979
2345
1980AC_MSG_CHECKING([CHU modem/decoder])
1981AC_ARG_ENABLE(
1982 [CHU],
1983 [AS_HELP_STRING(
1984 [--enable-CHU],
1985 [+ CHU modem/decoder]
1986 )],
1987 [ntp_ok=$enableval],
1988 [ntp_ok=$ntp_eac]
1989)
1990case "$ntp_ok" in
1991 yes)
2346AC_MSG_CHECKING(CHU modem/decoder)
2347AC_ARG_ENABLE(CHU,
2348 AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
2349 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2350if test "$ntp_ok" = "yes"; then
1992 ntp_refclock=yes
2351 ntp_refclock=yes
1993 AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
1994 ;;
1995esac
1996AC_MSG_RESULT([$ntp_ok])
1997ntp_refclock_chu=$ntp_ok
2352 AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
2353fi
2354AC_MSG_RESULT($ntp_ok)
2355ac_refclock_chu=$ntp_ok
1998
2356
1999AC_MSG_CHECKING([CHU audio/decoder])
2000AC_ARG_ENABLE(
2001 [AUDIO-CHU],
2002 [AS_HELP_STRING(
2003 [--enable-AUDIO-CHU],
2004 [s CHU audio/decoder]
2005 )],
2357AC_MSG_CHECKING(CHU audio/decoder)
2358AC_ARG_ENABLE(AUDIO-CHU,
2359 AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
2006 [ntp_ok=$enableval],
2360 [ntp_ok=$enableval],
2007 [
2008 case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
2009 *no*) ntp_ok=no ;;
2010 *) ntp_ok=yes ;;
2011 esac
2012 ]
2013)
2014AC_MSG_RESULT([$ntp_ok])
2361 [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
2362 *no*) ntp_ok=no ;;
2363 *) ntp_ok=yes ;;
2364esac])
2365if test "$ntp_ok" = "yes"; then
2366 AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
2367fi
2368AC_MSG_RESULT($ntp_ok)
2015# We used to check for sunos/solaris target...
2369# We used to check for sunos/solaris target...
2016case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
2017 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
2370case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
2371 yes*no*) AC_MSG_WARN(*** But the expected answer is...no ***) ;;
2018esac
2019
2020# Not under HP-UX
2372esac
2373
2374# Not under HP-UX
2021AC_MSG_CHECKING([Datum Programmable Time System])
2022AC_ARG_ENABLE(
2023 [DATUM],
2024 [AS_HELP_STRING(
2025 [--enable-DATUM],
2026 [s Datum Programmable Time System]
2027 )],
2375AC_MSG_CHECKING(Datum Programmable Time System)
2376AC_ARG_ENABLE(DATUM,
2377 AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
2028 [ntp_ok=$enableval],
2378 [ntp_ok=$enableval],
2029 [
2030 case "$ac_cv_header_termios_h" in
2031 yes)
2032 ntp_ok=$ntp_eac
2033 ;;
2034 *) ntp_ok=no
2035 ;;
2036 esac
2037 ]
2038)
2039case "$ntp_ok" in
2040 yes)
2379 [case "$ac_cv_header_termios_h" in
2380 yes)
2381 ntp_ok=$ntp_eac
2382 ;;
2383 *) ntp_ok=no
2384 ;;
2385 esac])
2386if test "$ntp_ok" = "yes"; then
2041 ntp_refclock=yes
2387 ntp_refclock=yes
2042 AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
2043 ;;
2044esac
2045AC_MSG_RESULT([$ntp_ok])
2388 AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
2389fi
2390AC_MSG_RESULT($ntp_ok)
2046
2391
2047AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
2048AC_ARG_ENABLE(
2049 [DUMBCLOCK],
2050 [AS_HELP_STRING(
2051 [--enable-DUMBCLOCK],
2052 [+ Dumb generic hh:mm:ss local clock]
2053 )],
2054 [ntp_ok=$enableval],
2055 [ntp_ok=$ntp_eac]
2056)
2057case "$ntp_ok" in
2058 yes)
2392AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
2393AC_ARG_ENABLE(DUMBCLOCK,
2394 AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
2395 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2396if test "$ntp_ok" = "yes"; then
2059 ntp_refclock=yes
2397 ntp_refclock=yes
2060 AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
2061 ;;
2062esac
2063AC_MSG_RESULT([$ntp_ok])
2398 AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
2399fi
2400AC_MSG_RESULT($ntp_ok)
2064
2401
2065AC_MSG_CHECKING([Forum Graphic GPS])
2066AC_ARG_ENABLE(
2067 [FG],
2068 [AS_HELP_STRING(
2069 [--enable-FG],
2070 [+ Forum Graphic GPS]
2071 )],
2072 [ntp_ok=$enableval],
2073 [ntp_ok=$ntp_eac]
2074)
2075case "$ntp_ok" in
2076 yes)
2402AC_MSG_CHECKING(Forum Graphic GPS)
2403AC_ARG_ENABLE(FG,
2404 AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
2405 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2406if test "$ntp_ok" = "yes"; then
2077 ntp_refclock=yes
2407 ntp_refclock=yes
2078 AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
2079 ;;
2080esac
2081AC_MSG_RESULT([$ntp_ok])
2408 AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
2409fi
2410AC_MSG_RESULT($ntp_ok)
2082
2083# Requires modem control
2411
2412# Requires modem control
2084AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
2085AC_ARG_ENABLE(
2086 [HEATH],
2087 [AS_HELP_STRING(
2088 [--enable-HEATH],
2089 [s Heath GC-1000 WWV/WWVH receiver]
2090 )],
2413AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
2414AC_ARG_ENABLE(HEATH,
2415 AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
2091 [ntp_ok=$enableval],
2416 [ntp_ok=$enableval],
2092 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2093)
2094case "$ntp_ok" in
2095 yes)
2417 [AC_EGREP_CPP(yes,
2418 [#include <termios.h>
2419#ifdef HAVE_SYS_IOCTL_H
2420#include <sys/ioctl.h>
2421#endif
2422#ifdef TIOCMBIS
2423 yes
2424#endif
2425 ], ntp_ok=$ntp_eac, ntp_ok=no)])
2426if test "$ntp_ok" = "yes"; then
2096 ntp_refclock=yes
2427 ntp_refclock=yes
2097 AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
2098 ;;
2099esac
2100AC_MSG_RESULT([$ntp_ok])
2428 AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
2429fi
2430AC_MSG_RESULT($ntp_ok)
2101
2431
2102AC_MSG_CHECKING([for hopf serial clock device])
2103AC_ARG_ENABLE(
2104 [HOPFSERIAL],
2105 [AS_HELP_STRING(
2106 [--enable-HOPFSERIAL],
2107 [+ hopf serial clock device]
2108 )],
2109 [ntp_ok=$enableval],
2110 [ntp_ok=$ntp_eac]
2111)
2112case "$ntp_ok" in
2113 yes)
2432AC_MSG_CHECKING(for hopf serial clock device)
2433AC_ARG_ENABLE(HOPFSERIAL,
2434 AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
2435 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2436if test "$ntp_ok" = "yes"; then
2114 ntp_refclock=yes
2437 ntp_refclock=yes
2115 AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
2116 ;;
2117esac
2118AC_MSG_RESULT([$ntp_ok])
2438 AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
2439fi
2440AC_MSG_RESULT($ntp_ok)
2119
2441
2120AC_MSG_CHECKING([for hopf PCI clock 6039])
2121AC_ARG_ENABLE(
2122 [HOPFPCI],
2123 [AS_HELP_STRING(
2124 [--enable-HOPFPCI],
2125 [+ hopf 6039 PCI board]
2126 )],
2127 [ntp_ok=$enableval],
2128 [ntp_ok=$ntp_eac]
2129)
2130case "$ntp_ok" in
2131 yes)
2442AC_MSG_CHECKING(for hopf PCI clock 6039)
2443AC_ARG_ENABLE(HOPFPCI,
2444 AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
2445 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2446if test "$ntp_ok" = "yes"; then
2132 ntp_refclock=yes
2447 ntp_refclock=yes
2133 AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
2134 ;;
2135esac
2136AC_MSG_RESULT([$ntp_ok])
2448 AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
2449fi
2450AC_MSG_RESULT($ntp_ok)
2137
2451
2138AC_MSG_CHECKING([HP 58503A GPS receiver])
2139AC_ARG_ENABLE(
2140 [HPGPS],
2141 [AS_HELP_STRING(
2142 [--enable-HPGPS],
2143 [+ HP 58503A GPS receiver]
2144 )],
2145 [ntp_ok=$enableval],
2146 [ntp_ok=$ntp_eac]
2147)
2148case "$ntp_ok" in
2149 yes)
2452AC_MSG_CHECKING(HP 58503A GPS receiver)
2453AC_ARG_ENABLE(HPGPS,
2454 AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
2455 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2456if test "$ntp_ok" = "yes"; then
2150 ntp_refclock=yes
2457 ntp_refclock=yes
2151 AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
2152 ;;
2153esac
2154AC_MSG_RESULT([$ntp_ok])
2458 AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
2459fi
2460AC_MSG_RESULT($ntp_ok)
2155
2461
2156AC_MSG_CHECKING([IRIG audio decoder])
2157AC_ARG_ENABLE(
2158 [IRIG],
2159 [AS_HELP_STRING(
2160 [--enable-IRIG],
2161 [s IRIG audio decoder]
2162 )],
2462AC_MSG_CHECKING(IRIG audio decoder)
2463AC_ARG_ENABLE(IRIG,
2464 AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
2163 [ntp_ok=$enableval],
2465 [ntp_ok=$enableval],
2164 [
2165 case "$ntp_eac$ntp_canaudio" in
2166 *no*) ntp_ok=no ;;
2167 *) ntp_ok=yes ;;
2168 esac
2169 ]
2170)
2171case "$ntp_ok" in
2172 yes)
2466 [case "$ntp_eac$ntp_canaudio" in
2467 *no*) ntp_ok=no ;;
2468 *) ntp_ok=yes ;;
2469 esac])
2470if test "$ntp_ok" = "yes"; then
2173 ntp_refclock=yes
2471 ntp_refclock=yes
2174 AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
2175 ;;
2176esac
2177AC_MSG_RESULT([$ntp_ok])
2472 AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
2473fi
2474AC_MSG_RESULT($ntp_ok)
2178case "$ntp_ok$ntp_canaudio" in
2475case "$ntp_ok$ntp_canaudio" in
2179 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2476 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2180esac
2181
2477esac
2478
2182AC_MSG_CHECKING([for JJY receiver])
2183AC_ARG_ENABLE(
2184 [JJY],
2185 [AS_HELP_STRING(
2186 [--enable-JJY],
2187 [+ JJY receiver]
2188 )],
2189 [ntp_ok=$enableval],
2190 [ntp_ok=$ntp_eac]
2191)
2192case "$ntp_ok" in
2193 yes)
2479AC_MSG_CHECKING(for JJY receiver)
2480AC_ARG_ENABLE(JJY,
2481 AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
2482 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2483if test "$ntp_ok" = "yes"; then
2194 ntp_refclock=yes
2484 ntp_refclock=yes
2195 AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
2196 ;;
2197esac
2198AC_MSG_RESULT([$ntp_ok])
2485 AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
2486fi
2487AC_MSG_RESULT($ntp_ok)
2199
2488
2200AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
2201AC_ARG_ENABLE(
2202 [JUPITER],
2203 [AS_HELP_STRING(
2204 [--enable-JUPITER],
2205 [s Rockwell Jupiter GPS receiver]
2206 )],
2489AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
2490AC_ARG_ENABLE(JUPITER,
2491 AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
2207 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2492 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2208case "$ntp_jupiter_ok" in
2493case "$ac_cv_var_jupiter_ok" in
2209 no) ntp_ok=no ;;
2210esac
2494 no) ntp_ok=no ;;
2495esac
2211case "$ntp_ok" in
2212 yes)
2496if test "$ntp_ok" = "yes"; then
2213 ntp_refclock=yes
2497 ntp_refclock=yes
2214 AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
2215 ;;
2216esac
2217AC_MSG_RESULT([$ntp_ok])
2498 AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
2499fi
2500AC_MSG_RESULT($ntp_ok)
2218
2501
2219AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
2220AC_ARG_ENABLE(
2221 [LEITCH],
2222 [AS_HELP_STRING(
2223 [--enable-LEITCH],
2224 [+ Leitch CSD 5300 Master Clock System Driver]
2225 )],
2226 [ntp_ok=$enableval],
2227 [ntp_ok=$ntp_eac]
2228)
2229case "$ntp_ok" in
2230 yes)
2502AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
2503AC_ARG_ENABLE(LEITCH,
2504 AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
2505 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2506if test "$ntp_ok" = "yes"; then
2231 ntp_refclock=yes
2507 ntp_refclock=yes
2232 AC_DEFINE([CLOCK_LEITCH], [1],
2233 [Leitch CSD 5300 Master Clock System Driver?])
2234 ;;
2235esac
2236AC_MSG_RESULT([$ntp_ok])
2508 AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
2509fi
2510AC_MSG_RESULT($ntp_ok)
2237
2511
2238AC_MSG_CHECKING([local clock reference])
2239AC_ARG_ENABLE(
2240 [LOCAL-CLOCK],
2241 [AS_HELP_STRING(
2242 [--enable-LOCAL-CLOCK],
2243 [+ local clock reference]
2244 )],
2245 [ntp_ok=$enableval],
2246 [ntp_ok=$ntp_eac]
2247)
2248case "$ntp_ok" in
2249 yes)
2512AC_MSG_CHECKING(local clock reference)
2513AC_ARG_ENABLE(LOCAL-CLOCK,
2514 AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
2515 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2516if test "$ntp_ok" = "yes"; then
2250 ntp_refclock=yes
2517 ntp_refclock=yes
2251 AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
2252 ;;
2253esac
2254AC_MSG_RESULT([$ntp_ok])
2518 AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
2519fi
2520AC_MSG_RESULT($ntp_ok)
2255
2256dnl Bug 340: longstanding unfixed bugs
2521
2522dnl Bug 340: longstanding unfixed bugs
2257dnl AC_MSG_CHECKING([EES M201 MSF receiver])
2258dnl AC_ARG_ENABLE([MSFEES],
2259dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
2523dnl AC_MSG_CHECKING(EES M201 MSF receiver)
2524dnl AC_ARG_ENABLE(MSFEES,
2525dnl AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
2260dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2261dnl if test "$ntp_ok" = "yes"; then
2262dnl ntp_refclock=yes
2526dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2527dnl if test "$ntp_ok" = "yes"; then
2528dnl ntp_refclock=yes
2263dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
2529dnl AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
2264dnl fi
2530dnl fi
2265dnl AC_MSG_RESULT([$ntp_ok])
2531dnl AC_MSG_RESULT($ntp_ok)
2266
2267# Not Ultrix
2532
2533# Not Ultrix
2268AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
2269AC_ARG_ENABLE(
2270 [MX4200],
2271 [AS_HELP_STRING(
2272 [--enable-MX4200 ],
2273 [s Magnavox MX4200 GPS receiver]
2274 )],
2534AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
2535AC_ARG_ENABLE(MX4200,
2536 AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
2275 [ntp_ok=$enableval],
2537 [ntp_ok=$enableval],
2276 [
2277 case "$ac_cv_var_ppsclock" in
2278 yes)
2279 ntp_ok=$ntp_eac
2280 ;;
2281 *)
2282 ntp_ok=no
2283 ;;
2284 esac
2285 ]
2286)
2287case "$ntp_ok" in
2288 yes)
2538 [case "$ac_cv_var_ppsclock" in
2539 yes) ntp_ok=$ntp_eac
2540 ;;
2541 *) ntp_ok=no
2542 ;;
2543 esac])
2544if test "$ntp_ok" = "yes"; then
2289 ntp_refclock=yes
2545 ntp_refclock=yes
2290 AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
2291 ;;
2292esac
2293AC_MSG_RESULT([$ntp_ok])
2546 AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
2547fi
2548AC_MSG_RESULT($ntp_ok)
2294case "$ntp_ok$host" in
2549case "$ntp_ok$host" in
2295 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
2550 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2296esac
2297
2551esac
2552
2298AC_MSG_CHECKING([for NeoClock4X receiver])
2299AC_ARG_ENABLE(
2300 [NEOCLOCK4X],
2301 [AS_HELP_STRING(
2302 [--enable-NEOCLOCK4X],
2303 [+ NeoClock4X DCF77 / TDF receiver]
2304 )],
2305 [ntp_ok=$enableval],
2306 [ntp_ok=$ntp_eac]
2307)
2308case "$ntp_ok" in
2309 yes)
2553AC_MSG_CHECKING(for NeoClock4X receiver)
2554AC_ARG_ENABLE(NEOCLOCK4X,
2555 AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
2556 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2557if test "$ntp_ok" = "yes"; then
2310 ntp_refclock=yes
2558 ntp_refclock=yes
2311 AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
2312 ;;
2313esac
2314AC_MSG_RESULT([$ntp_ok])
2559 AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
2560fi
2561AC_MSG_RESULT($ntp_ok)
2315
2562
2316AC_MSG_CHECKING([NMEA GPS receiver])
2317AC_ARG_ENABLE(
2318 [NMEA],
2319 [AS_HELP_STRING(
2320 [--enable-NMEA],
2321 [+ NMEA GPS receiver]
2322 )],
2323 [ntp_ok=$enableval],
2324 [ntp_ok=$ntp_eac]
2325)
2326case "$ntp_ok" in
2327 yes)
2563AC_MSG_CHECKING(NMEA GPS receiver)
2564AC_ARG_ENABLE(NMEA,
2565 AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
2566 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2567if test "$ntp_ok" = "yes"; then
2328 ntp_refclock=yes
2568 ntp_refclock=yes
2329 AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
2330 ;;
2331esac
2332AC_MSG_RESULT([$ntp_ok])
2569 AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
2570fi
2571AC_MSG_RESULT($ntp_ok)
2333
2572
2334AC_CHECK_FUNCS([strtoll])
2335AC_MSG_CHECKING([for GPSD JSON receiver])
2336AC_ARG_ENABLE(
2337 [GPSD],
2338 [AS_HELP_STRING(
2339 [--enable-GPSD],
2340 [+ GPSD JSON receiver]
2341 )],
2342 [ntp_ok=$enableval],
2343 [case "$ac_cv_func_strtoll" in
2344 yes) ntp_ok=$ntp_eac ;;
2345 *) ntp_ok="no" ;;
2346 esac]
2347)
2348case "$ntp_ok" in
2349 yes)
2350 ntp_refclock=yes
2351 AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
2352 ;;
2353esac
2354AC_MSG_RESULT([$ntp_ok])
2355
2356AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
2357AC_ARG_ENABLE(
2358 [ONCORE],
2359 [AS_HELP_STRING(
2360 [--enable-ONCORE],
2361 [s Motorola VP/UT Oncore GPS receiver]
2362 )],
2363 [ntp_ok=$enableval],
2364 [ntp_ok=$ntp_eac]
2365)
2366case "$ntp_oncore_ok" in
2573AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
2574AC_ARG_ENABLE(ONCORE,
2575 AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
2576 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2577case "$ac_cv_var_oncore_ok" in
2367 no) ntp_ok=no ;;
2368esac
2578 no) ntp_ok=no ;;
2579esac
2369case "$ntp_ok" in
2370 yes)
2580if test "$ntp_ok" = "yes"; then
2371 ntp_refclock=yes
2581 ntp_refclock=yes
2372 AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
2373 ;;
2374esac
2375AC_MSG_RESULT([$ntp_ok])
2582 AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
2583fi
2584AC_MSG_RESULT($ntp_ok)
2376
2585
2377# Requires modem control
2378AC_MSG_CHECKING([for Palisade clock])
2379AC_ARG_ENABLE(
2380 [PALISADE],
2381 [AS_HELP_STRING(
2382 [--enable-PALISADE],
2383 [s Palisade clock]
2384 )],
2586AC_MSG_CHECKING(for Palisade clock)
2587AC_ARG_ENABLE(PALISADE,
2588 AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
2385 [ntp_ok=$enableval],
2589 [ntp_ok=$enableval],
2386 [ntp_ok=$ntp_enable_all_modem_control_clocks]
2387)
2388case "$ntp_ok" in
2389 yes)
2590 [case "$ac_cv_header_termios_h" in
2591 yes)
2592 ntp_ok=$ntp_eac
2593 ;;
2594 *) ntp_ok=no
2595 ;;
2596 esac])
2597
2598if test "$ntp_ok" = "yes"; then
2390 ntp_refclock=yes
2599 ntp_refclock=yes
2391 AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
2392 ;;
2393esac
2394AC_MSG_RESULT([$ntp_ok])
2600 AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
2601fi
2602AC_MSG_RESULT($ntp_ok)
2395
2603
2396AC_MSG_CHECKING([Conrad parallel port radio clock])
2397AC_ARG_ENABLE(
2398 [PCF],
2399 [AS_HELP_STRING(
2400 [--enable-PCF ],
2401 [+ Conrad parallel port radio clock]
2402 )],
2403 [ntp_ok=$enableval],
2404 [ntp_ok=$ntp_eac]
2405)
2406case "$ntp_ok" in
2407 yes)
2604AC_MSG_CHECKING(Conrad parallel port radio clock)
2605AC_ARG_ENABLE(PCF,
2606 AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
2607 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2608if test "$ntp_ok" = "yes"; then
2408 ntp_refclock=yes
2609 ntp_refclock=yes
2409 AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
2410 ;;
2411esac
2412AC_MSG_RESULT([$ntp_ok])
2610 AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
2611fi
2612AC_MSG_RESULT($ntp_ok)
2413
2613
2414AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
2415AC_ARG_ENABLE(
2416 [PST],
2417 [AS_HELP_STRING(
2418 [--enable-PST],
2419 [+ PST/Traconex 1020 WWV/WWVH receiver]
2420 )],
2421 [ntp_ok=$enableval],
2422 [ntp_ok=$ntp_eac]
2423)
2424case "$ntp_ok" in
2425 yes)
2614AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
2615AC_ARG_ENABLE(PST,
2616 AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
2617 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2618if test "$ntp_ok" = "yes"; then
2426 ntp_refclock=yes
2619 ntp_refclock=yes
2427 AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
2428 ;;
2429esac
2430AC_MSG_RESULT([$ntp_ok])
2620 AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
2621fi
2622AC_MSG_RESULT($ntp_ok)
2431
2623
2432AC_MSG_CHECKING([RIPENCC specific Trimble driver])
2433AC_ARG_ENABLE(
2434 [RIPENCC],
2435 [AS_HELP_STRING(
2436 [--enable-RIPENCC],
2437 [- RIPENCC specific Trimble driver]
2438 )],
2439 [ntp_ok=$enableval],
2440 [ntp_ok=no]
2441)
2624AC_MSG_CHECKING(RIPENCC specific Trimble driver)
2625AC_ARG_ENABLE(RIPENCC,
2626 AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
2627 [ntp_ok=$enableval], [ntp_ok=no])
2442# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2628# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
2443case "$ntp_ripe_ncc_ok" in
2629case "$ac_cv_var_ripe_ncc_ok" in
2444 no) ntp_ok=no ;;
2445esac
2630 no) ntp_ok=no ;;
2631esac
2446case "$ntp_ok" in
2447 yes)
2632if test "$ntp_ok" = "yes"; then
2448 ntp_refclock=yes
2633 ntp_refclock=yes
2449 AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
2450 ;;
2451esac
2452AC_MSG_RESULT([$ntp_ok])
2634 AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
2635fi
2636AC_MSG_RESULT($ntp_ok)
2453
2454# Danny Meyer says SHM compiles (with a few warnings) under Win32.
2455# For *IX, we need sys/ipc.h and sys/shm.h.
2637
2638# Danny Meyer says SHM compiles (with a few warnings) under Win32.
2639# For *IX, we need sys/ipc.h and sys/shm.h.
2456AC_MSG_CHECKING([for SHM clock attached thru shared memory])
2457AC_ARG_ENABLE(
2458 [SHM],
2459 [AS_HELP_STRING(
2460 [--enable-SHM],
2461 [s SHM clock attached thru shared memory]
2462 )],
2640AC_MSG_CHECKING(for SHM clock attached thru shared memory)
2641AC_ARG_ENABLE(SHM,
2642 AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
2463 [ntp_ok=$enableval],
2643 [ntp_ok=$enableval],
2464 [
2465 case "$ntp_eac$ntp_canshm" in
2466 *no*) ntp_ok=no ;;
2467 *) ntp_ok=yes ;;
2468 esac
2469 ]
2470)
2471case "$ntp_ok" in
2472 yes)
2644 [case "$ntp_eac$ntp_canshm" in
2645 *no*) ntp_ok=no ;;
2646 *) ntp_ok=yes ;;
2647esac])
2648if test "$ntp_ok" = "yes"; then
2473 ntp_refclock=yes
2649 ntp_refclock=yes
2474 AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
2475 ;;
2476esac
2477AC_MSG_RESULT([$ntp_ok])
2650 AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
2651fi
2652AC_MSG_RESULT($ntp_ok)
2478
2653
2479AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
2480AC_ARG_ENABLE(
2481 [SPECTRACOM],
2482 [AS_HELP_STRING(
2483 [--enable-SPECTRACOM],
2484 [+ Spectracom 8170/Netclock/2 WWVB receiver]
2485 )],
2486 [ntp_ok=$enableval],
2487 [ntp_ok=$ntp_eac]
2488)
2489case "$ntp_ok" in
2490 yes)
2654AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
2655AC_ARG_ENABLE(SPECTRACOM,
2656 AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
2657 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2658if test "$ntp_ok" = "yes"; then
2491 ntp_refclock=yes
2659 ntp_refclock=yes
2492 AC_DEFINE([CLOCK_SPECTRACOM], [1],
2493 [Spectracom 8170/Netclock/2 WWVB receiver])
2494 ;;
2495esac
2496AC_MSG_RESULT([$ntp_ok])
2660 AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
2661fi
2662AC_MSG_RESULT($ntp_ok)
2497
2663
2498AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2499AC_ARG_ENABLE(
2500 [TPRO],
2501 [AS_HELP_STRING(
2502 [--enable-TPRO],
2503 [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
2504 )],
2664AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
2665AC_ARG_ENABLE(TPRO,
2666 AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
2505 [ntp_ok=$enableval],
2667 [ntp_ok=$enableval],
2506 [
2507 case "$ac_cv_header_sys_tpro_h" in
2508 yes)
2509 ntp_ok=$ntp_eac
2510 ;;
2511 *)
2512 ntp_ok=no
2513 ;;
2514 esac
2515 ]
2516)
2517case "$ntp_ok" in
2518 yes)
2668 [case "$ac_cv_header_sys_tpro_h" in
2669 yes)
2670 ntp_ok=$ntp_eac
2671 ;;
2672 *) ntp_ok=no
2673 ;;
2674 esac])
2675if test "$ntp_ok" = "yes"; then
2519 ntp_refclock=yes
2676 ntp_refclock=yes
2520 AC_DEFINE([CLOCK_TPRO], [1],
2521 [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2522 ;;
2523esac
2524AC_MSG_RESULT([$ntp_ok])
2677 AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
2678fi
2679AC_MSG_RESULT($ntp_ok)
2525case "$ntp_ok$ac_cv_header_sys_tpro" in
2680case "$ntp_ok$ac_cv_header_sys_tpro" in
2526 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2681 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2527esac
2528
2682esac
2683
2684dnl Bug 342: longstanding unfixed bugs
2685dnl AC_MSG_CHECKING(TRAK 8810 GPS receiver)
2686dnl AC_ARG_ENABLE(TRAK,
2687dnl AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
2688dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2689dnl if test "$ntp_ok" = "yes"; then
2690dnl ntp_refclock=yes
2691dnl AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
2692dnl fi
2693dnl AC_MSG_RESULT($ntp_ok)
2694
2529# Not on a vax-dec-bsd
2695# Not on a vax-dec-bsd
2530AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
2531AC_ARG_ENABLE(
2532 [TRUETIME],
2533 [AS_HELP_STRING(
2534 [--enable-TRUETIME],
2535 [s Kinemetrics/TrueTime receivers]
2536 )],
2696AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
2697AC_ARG_ENABLE(TRUETIME,
2698 AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
2537 [ntp_ok=$enableval],
2699 [ntp_ok=$enableval],
2538 [
2539 case "$host" in
2540 vax-dec-bsd)
2541 ntp_ok=no
2542 ;;
2543 *)
2544 ntp_ok=$ntp_eac
2545 ;;
2546 esac
2547 ]
2548)
2549case "$ntp_ok" in
2550 yes)
2700 [case "$host" in
2701 vax-dec-bsd)
2702 ntp_ok=no
2703 ;;
2704 *)
2705 ntp_ok=$ntp_eac
2706 ;;
2707 esac])
2708if test "$ntp_ok" = "yes"; then
2551 ntp_refclock=yes
2709 ntp_refclock=yes
2552 AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
2553 ;;
2554esac
2555AC_MSG_RESULT([$ntp_ok])
2710 AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
2711fi
2712AC_MSG_RESULT($ntp_ok)
2556case "$ntp_ok$host" in
2713case "$ntp_ok$host" in
2557 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
2714 yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2558esac
2559
2715esac
2716
2560AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
2561AC_ARG_ENABLE(
2562 [TT560],
2563 [AS_HELP_STRING(
2564 [--enable-TT560],
2565 [- TrueTime 560 IRIG-B decoder]
2566 )],
2567 [ntp_ok=$enableval],
2568 [ntp_ok=no]
2569)
2570case "$ntp_ok" in
2571 yes)
2717AC_MSG_CHECKING(TrueTime 560 IRIG-B decoder)
2718AC_ARG_ENABLE(TT560,
2719 AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
2720 [ntp_ok=$enableval], [ntp_ok=no])
2721if test "$ntp_ok" = "yes"; then
2572 ntp_refclock=yes
2722 ntp_refclock=yes
2573 AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
2574 ;;
2575esac
2576AC_MSG_RESULT([$ntp_ok])
2723 AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
2724fi
2725AC_MSG_RESULT($ntp_ok)
2577
2726
2578AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
2579AC_ARG_ENABLE(
2580 [ULINK],
2581 [AS_HELP_STRING(
2582 [--enable-ULINK],
2583 [+ Ultralink WWVB receiver]
2584 )],
2585 [ntp_ok=$enableval],
2586 [ntp_ok=$ntp_eac]
2587)
2588case "$ntp_ok" in
2589 yes)
2727AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
2728AC_ARG_ENABLE(ULINK,
2729 AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
2730 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2731if test "$ntp_ok" = "yes"; then
2590 ntp_refclock=yes
2732 ntp_refclock=yes
2591 AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
2592 ;;
2593esac
2594AC_MSG_RESULT([$ntp_ok])
2733 AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
2734fi
2735AC_MSG_RESULT($ntp_ok)
2595
2736
2596AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
2597AC_ARG_ENABLE(
2598 [TSYNCPCI],
2599 [AS_HELP_STRING(
2600 [--enable-TSYNCPCI],
2601 [s Spectracom TSYNC timing board]
2602 )],
2737AC_MSG_CHECKING(WWV receiver)
2738AC_ARG_ENABLE(WWV,
2739 AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2603 [ntp_ok=$enableval],
2740 [ntp_ok=$enableval],
2604 [
2605 case "$host" in
2606 *-*-*linux*)
2607 ntp_ok=$ntp_eac
2608 ;;
2609 *)
2610 ntp_ok=no
2611 esac
2612 ]
2613)
2614case "$ntp_ok" in
2615 yes)
2741 [case "$ntp_eac$ntp_canaudio" in
2742 *no*) ntp_ok=no ;;
2743 *) ntp_ok=yes ;;
2744 esac])
2745if test "$ntp_ok" = "yes"; then
2616 ntp_refclock=yes
2746 ntp_refclock=yes
2617 AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
2618 ;;
2619esac
2620AC_MSG_RESULT([$ntp_ok])
2621
2622AC_MSG_CHECKING([WWV receiver])
2623AC_ARG_ENABLE(
2624 [WWV],
2625 [AS_HELP_STRING(
2626 [--enable-WWV],
2627 [s WWV Audio receiver]
2628 )],
2629 [ntp_ok=$enableval],
2630 [
2631 case "$ntp_eac$ntp_canaudio" in
2632 *no*) ntp_ok=no ;;
2633 *) ntp_ok=yes ;;
2634 esac
2635 ]
2636)
2637case "$ntp_ok" in
2638 yes)
2639 ntp_refclock=yes
2640 AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
2641 ;;
2642esac
2643AC_MSG_RESULT([$ntp_ok])
2747 AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2748fi
2749AC_MSG_RESULT($ntp_ok)
2644case "$ntp_ok$ntp_canaudio" in
2750case "$ntp_ok$ntp_canaudio" in
2645 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
2751 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2646esac
2647
2752esac
2753
2648AC_MSG_CHECKING([for Zyfer receiver])
2649AC_ARG_ENABLE(
2650 [ZYFER],
2651 [AS_HELP_STRING(
2652 [--enable-ZYFER],
2653 [+ Zyfer GPStarplus receiver]
2654 )],
2655 [ntp_ok=$enableval],
2656 [ntp_ok=$ntp_eac]
2657)
2658case "$ntp_ok" in
2659 yes)
2754AC_MSG_CHECKING(for Zyfer receiver)
2755AC_ARG_ENABLE(ZYFER,
2756 AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
2757 [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2758if test "$ntp_ok" = "yes"; then
2660 ntp_refclock=yes
2759 ntp_refclock=yes
2661 AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
2662 ;;
2663esac
2664AC_MSG_RESULT([$ntp_ok])
2760 AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
2761fi
2762AC_MSG_RESULT($ntp_ok)
2665
2763
2666AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
2667AC_ARG_ENABLE(
2668 [parse-clocks],
2669 [AS_HELP_STRING(
2670 [--enable-parse-clocks],
2671 [- include all suitable PARSE clocks:]
2672 )],
2764AC_MSG_CHECKING(for default inclusion of all suitable PARSE clocks)
2765AC_ARG_ENABLE(parse-clocks,
2766 AC_HELP_STRING([--enable-parse-clocks], [- include all suitable PARSE clocks:]),
2673 [ntp_eapc=$enableval],
2767 [ntp_eapc=$enableval],
2674 [
2675 case "$ntp_eac" in
2676 yes) ntp_eapc=$ntp_canparse ;;
2677 *) ntp_eapc=no ;;
2678 esac
2679 # Delete the next line one of these days
2680 ntp_eapc=no
2681 ]
2682)
2768 [case "$ntp_eac" in
2769 yes) ntp_eapc=$ntp_canparse ;;
2770 *) ntp_eapc=no ;;
2771 esac
2772 # Delete the next line one of these days
2773 ntp_eapc=no])
2683AC_MSG_RESULT($ntp_eapc)
2684
2685case "$ntp_eac$ntp_eapc$ntp_canparse" in
2686 noyes*)
2774AC_MSG_RESULT($ntp_eapc)
2775
2776case "$ntp_eac$ntp_eapc$ntp_canparse" in
2777 noyes*)
2687 AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
2778 AC_MSG_ERROR("--enable-parse-clocks" requires "--enable-all-clocks".)
2688 ;;
2689 yesyesno)
2779 ;;
2780 yesyesno)
2690 AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
2781 AC_MSG_ERROR(You said "--enable-parse-clocks" but PARSE isn't supported on this platform!)
2691 ;;
2782 ;;
2783 *) ;;
2692esac
2693
2694ntp_libparse=no
2695ntp_parseutil=no
2696ntp_rawdcf=no
2697
2784esac
2785
2786ntp_libparse=no
2787ntp_parseutil=no
2788ntp_rawdcf=no
2789
2698AC_MSG_CHECKING([Diem Computime Radio Clock])
2699AC_ARG_ENABLE(
2700 [COMPUTIME],
2701 [AS_HELP_STRING(
2702 [--enable-COMPUTIME],
2703 [s Diem Computime Radio Clock]
2704 )],
2705 [ntp_ok=$enableval],
2706 [ntp_ok=$ntp_eapc]
2707)
2708case "$ntp_ok" in
2709 yes)
2790AC_MSG_CHECKING(Diem Computime Radio Clock)
2791AC_ARG_ENABLE(COMPUTIME,
2792 AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
2793 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2794if test "$ntp_ok" = "yes"; then
2710 ntp_libparse=yes
2711 ntp_refclock=yes
2795 ntp_libparse=yes
2796 ntp_refclock=yes
2712 AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
2713 ;;
2714esac
2715AC_MSG_RESULT([$ntp_ok])
2797 AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
2798fi
2799AC_MSG_RESULT($ntp_ok)
2716case "$ntp_ok$ntp_canparse" in
2717 yesno)
2800case "$ntp_ok$ntp_canparse" in
2801 yesno)
2718 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2802 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2803 ;;
2719esac
2720
2804esac
2805
2721AC_MSG_CHECKING([ELV/DCF7000 clock])
2722AC_ARG_ENABLE(
2723 [DCF7000],
2724 [AS_HELP_STRING(
2725 [--enable-DCF7000],
2726 [s ELV/DCF7000 clock]
2727 )],
2728 [ntp_ok=$enableval],
2729 [ntp_ok=$ntp_eapc]
2730)
2731case "$ntp_ok" in
2732 yes)
2806AC_MSG_CHECKING(ELV/DCF7000 clock)
2807AC_ARG_ENABLE(DCF7000,
2808 AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
2809 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2810if test "$ntp_ok" = "yes"; then
2733 ntp_libparse=yes
2734 ntp_refclock=yes
2811 ntp_libparse=yes
2812 ntp_refclock=yes
2735 AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
2736 ;;
2737esac
2738AC_MSG_RESULT([$ntp_ok])
2813 AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
2814fi
2815AC_MSG_RESULT($ntp_ok)
2739case "$ntp_ok$ntp_canparse" in
2740 yesno)
2816case "$ntp_ok$ntp_canparse" in
2817 yesno)
2741 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2818 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2819 ;;
2742esac
2743
2820esac
2821
2744AC_MSG_CHECKING([HOPF 6021 clock])
2745AC_ARG_ENABLE(
2746 [HOPF6021],
2747 [AS_HELP_STRING(
2748 [--enable-HOPF6021],
2749 [s HOPF 6021 clock]
2750 )],
2751 [ntp_ok=$enableval],
2752 [ntp_ok=$ntp_eapc]
2753)
2754case "$ntp_ok" in
2755 yes)
2822AC_MSG_CHECKING(HOPF 6021 clock)
2823AC_ARG_ENABLE(HOPF6021,
2824 AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
2825 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2826if test "$ntp_ok" = "yes"; then
2756 ntp_libparse=yes
2757 ntp_refclock=yes
2827 ntp_libparse=yes
2828 ntp_refclock=yes
2758 AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
2759 ;;
2760esac
2761AC_MSG_RESULT([$ntp_ok])
2829 AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
2830fi
2831AC_MSG_RESULT($ntp_ok)
2762case "$ntp_ok$ntp_canparse" in
2763 yesno)
2832case "$ntp_ok$ntp_canparse" in
2833 yesno)
2764 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2834 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2835 ;;
2765esac
2766
2836esac
2837
2767AC_MSG_CHECKING([Meinberg clocks])
2768AC_ARG_ENABLE(
2769 [MEINBERG],
2770 [AS_HELP_STRING(
2771 [--enable-MEINBERG],
2772 [s Meinberg clocks]
2773 )],
2774 [ntp_ok=$enableval],
2775 [ntp_ok=$ntp_eapc]
2776)
2777case "$ntp_ok" in
2778 yes)
2838AC_MSG_CHECKING(Meinberg clocks)
2839AC_ARG_ENABLE(MEINBERG,
2840 AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
2841 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2842if test "$ntp_ok" = "yes"; then
2779 ntp_libparse=yes
2780 ntp_refclock=yes
2843 ntp_libparse=yes
2844 ntp_refclock=yes
2781 AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
2782 ;;
2783esac
2784AC_MSG_RESULT([$ntp_ok])
2845 AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
2846fi
2847AC_MSG_RESULT($ntp_ok)
2785case "$ntp_ok$ntp_canparse" in
2786 yesno)
2848case "$ntp_ok$ntp_canparse" in
2849 yesno)
2787 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2850 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2851 ;;
2788esac
2789
2852esac
2853
2790AC_MSG_CHECKING([DCF77 raw time code])
2791AC_ARG_ENABLE(
2792 [RAWDCF],
2793 [AS_HELP_STRING(
2794 [--enable-RAWDCF],
2795 [s DCF77 raw time code]
2796 )],
2797 [ntp_ok=$enableval],
2798 [ntp_ok=$ntp_eapc]
2799)
2800case "$ntp_ok" in
2801 yes)
2854AC_MSG_CHECKING(DCF77 raw time code)
2855AC_ARG_ENABLE(RAWDCF,
2856 AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
2857 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2858if test "$ntp_ok" = "yes"; then
2802 ntp_libparse=yes
2803 ntp_parseutil=yes
2804 ntp_refclock=yes
2805 ntp_rawdcf=yes
2859 ntp_libparse=yes
2860 ntp_parseutil=yes
2861 ntp_refclock=yes
2862 ntp_rawdcf=yes
2806 AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
2807 ;;
2808esac
2809AC_MSG_RESULT([$ntp_ok])
2863 AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
2864fi
2865AC_MSG_RESULT($ntp_ok)
2810case "$ntp_ok$ntp_canparse" in
2811 yesno)
2866case "$ntp_ok$ntp_canparse" in
2867 yesno)
2812 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2868 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2869 ;;
2813esac
2814
2815case "$ntp_rawdcf" in
2816 yes)
2870esac
2871
2872case "$ntp_rawdcf" in
2873 yes)
2817 AC_CACHE_CHECK([if we must enable parity for RAWDCF],
2818 [ntp_cv_rawdcf_parity],
2819 [
2820 ans=no
2821 case "$host" in
2822 *-*-*linux*)
2823 ans=yes
2824 ;;
2825 esac
2826 ntp_cv_rawdcf_parity=$ans
2827 ]
2828 )
2829 case "$ntp_cv_rawdcf_parity" in
2830 yes)
2831 AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
2832 [Should we not IGNPAR (Linux)?]) ;;
2874 AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2875 ac_cv_var_rawdcf_parity,
2876 [ans=no
2877 case "$host" in
2878 *-*-linux*)
2879 ans=yes
2880 ;;
2833 esac
2881 esac
2834esac
2882 ac_cv_var_rawdcf_parity=$ans])
2883 case "$ac_cv_var_rawdcf_parity" in
2884 yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
2885 esac
2886 ;;
2835
2887
2836AC_MSG_CHECKING([RCC 8000 clock])
2837AC_ARG_ENABLE(
2838 [RCC8000],
2839 [AS_HELP_STRING(
2840 [--enable-RCC8000],
2841 [s RCC 8000 clock]
2842 )],
2843 [ntp_ok=$enableval],
2844 [ntp_ok=$ntp_eapc]
2845)
2846case "$ntp_ok" in
2847 yes)
2848 ntp_libparse=yes
2849 ntp_refclock=yes
2850 AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
2888 *) # HMS: Is this a good idea?
2889 ac_cv_var_rawdcf_parity=no
2851 ;;
2852esac
2890 ;;
2891esac
2853AC_MSG_RESULT([$ntp_ok])
2854case "$ntp_ok$ntp_canparse" in
2855 yesno)
2856 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2857esac
2858
2892
2859AC_MSG_CHECKING([Schmid DCF77 clock])
2860AC_ARG_ENABLE(
2861 [SCHMID],
2862 [AS_HELP_STRING(
2863 [--enable-SCHMID ],
2864 [s Schmid DCF77 clock]
2865 )],
2866 [ntp_ok=$enableval],
2867 [ntp_ok=$ntp_eapc]
2868)
2869case "$ntp_ok" in
2870 yes)
2893AC_MSG_CHECKING(RCC 8000 clock)
2894AC_ARG_ENABLE(RCC8000,
2895 AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
2896 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2897if test "$ntp_ok" = "yes"; then
2871 ntp_libparse=yes
2872 ntp_refclock=yes
2898 ntp_libparse=yes
2899 ntp_refclock=yes
2873 AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
2874 ;;
2875esac
2876AC_MSG_RESULT([$ntp_ok])
2900 AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
2901fi
2902AC_MSG_RESULT($ntp_ok)
2877case "$ntp_ok$ntp_canparse" in
2878 yesno)
2903case "$ntp_ok$ntp_canparse" in
2904 yesno)
2879 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2905 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2906 ;;
2880esac
2881
2907esac
2908
2882AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
2883AC_ARG_ENABLE(
2884 [TRIMTAIP],
2885 [AS_HELP_STRING(
2886 [--enable-TRIMTAIP],
2887 [s Trimble GPS receiver/TAIP protocol]
2888 )],
2889 [ntp_ok=$enableval],
2890 [ntp_ok=$ntp_eapc]
2891)
2892case "$ntp_ok" in
2893 yes)
2909AC_MSG_CHECKING(Schmid DCF77 clock)
2910AC_ARG_ENABLE(SCHMID,
2911 AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
2912 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2913if test "$ntp_ok" = "yes"; then
2894 ntp_libparse=yes
2895 ntp_refclock=yes
2914 ntp_libparse=yes
2915 ntp_refclock=yes
2896 AC_DEFINE([CLOCK_TRIMTAIP], [1],
2897 [Trimble GPS receiver/TAIP protocol])
2898 ;;
2899esac
2900AC_MSG_RESULT([$ntp_ok])
2916 AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
2917fi
2918AC_MSG_RESULT($ntp_ok)
2901case "$ntp_ok$ntp_canparse" in
2902 yesno)
2919case "$ntp_ok$ntp_canparse" in
2920 yesno)
2903 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2921 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2922 ;;
2904esac
2905
2923esac
2924
2906AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
2907AC_ARG_ENABLE(
2908 [TRIMTSIP],
2909 [AS_HELP_STRING(
2910 [--enable-TRIMTSIP],
2911 [s Trimble GPS receiver/TSIP protocol]
2912 )],
2913 [ntp_ok=$enableval],
2914 [ntp_ok=$ntp_eapc]
2915)
2916case "$ntp_ok" in
2917 yes)
2925AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2926AC_ARG_ENABLE(TRIMTAIP,
2927 AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
2928 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2929if test "$ntp_ok" = "yes"; then
2918 ntp_libparse=yes
2919 ntp_refclock=yes
2930 ntp_libparse=yes
2931 ntp_refclock=yes
2920 AC_DEFINE([CLOCK_TRIMTSIP], [1],
2921 [Trimble GPS receiver/TSIP protocol])
2922 ;;
2923esac
2924AC_MSG_RESULT([$ntp_ok])
2932 AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
2933fi
2934AC_MSG_RESULT($ntp_ok)
2925case "$ntp_ok$ntp_canparse" in
2926 yesno)
2935case "$ntp_ok$ntp_canparse" in
2936 yesno)
2927 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2937 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2938 ;;
2928esac
2929
2939esac
2940
2930AC_MSG_CHECKING([WHARTON 400A Series clock])
2931AC_ARG_ENABLE(
2932 [WHARTON],
2933 [AS_HELP_STRING(
2934 [--enable-WHARTON],
2935 [s WHARTON 400A Series clock]
2936 )],
2937 [ntp_ok=$enableval],
2938 [ntp_ok=$ntp_eapc]
2939)
2940case "$ntp_ok" in
2941 yes)
2941AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2942AC_ARG_ENABLE(TRIMTSIP,
2943 AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
2944 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2945if test "$ntp_ok" = "yes"; then
2942 ntp_libparse=yes
2943 ntp_refclock=yes
2946 ntp_libparse=yes
2947 ntp_refclock=yes
2944 AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
2945 ;;
2946esac
2947AC_MSG_RESULT([$ntp_ok])
2948 AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
2949fi
2950AC_MSG_RESULT($ntp_ok)
2948case "$ntp_ok$ntp_canparse" in
2949 yesno)
2951case "$ntp_ok$ntp_canparse" in
2952 yesno)
2950 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2953 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2954 ;;
2951esac
2952
2955esac
2956
2953AC_MSG_CHECKING([VARITEXT clock])
2954AC_ARG_ENABLE(
2955 [VARITEXT],
2956 [AS_HELP_STRING(
2957 [--enable-VARITEXT],
2958 [s VARITEXT clock]
2959 )],
2960 [ntp_ok=$enableval],
2961 [ntp_ok=$ntp_eapc]
2962)
2963case "$ntp_ok" in
2964 yes)
2957AC_MSG_CHECKING(WHARTON 400A Series clock)
2958AC_ARG_ENABLE(WHARTON,
2959 AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
2960 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2961if test "$ntp_ok" = "yes"; then
2965 ntp_libparse=yes
2966 ntp_refclock=yes
2962 ntp_libparse=yes
2963 ntp_refclock=yes
2967 AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
2968 ;;
2969esac
2970AC_MSG_RESULT([$ntp_ok])
2964 AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
2965fi
2966AC_MSG_RESULT($ntp_ok)
2971case "$ntp_ok$ntp_canparse" in
2972 yesno)
2967case "$ntp_ok$ntp_canparse" in
2968 yesno)
2973 AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
2969 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2970 ;;
2974esac
2975
2971esac
2972
2976AC_MSG_CHECKING(SEL240X clock)
2977AC_ARG_ENABLE(SEL240X,
2978 AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
2973AC_MSG_CHECKING(VARITEXT clock)
2974AC_ARG_ENABLE(VARITEXT,
2975 AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
2979 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2980if test "$ntp_ok" = "yes"; then
2981 ntp_libparse=yes
2982 ntp_refclock=yes
2976 [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2977if test "$ntp_ok" = "yes"; then
2978 ntp_libparse=yes
2979 ntp_refclock=yes
2983 AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
2980 AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
2984fi
2985AC_MSG_RESULT($ntp_ok)
2986case "$ntp_ok$ntp_canparse" in
2987 yesno)
2988 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2989 ;;
2990esac
2981fi
2982AC_MSG_RESULT($ntp_ok)
2983case "$ntp_ok$ntp_canparse" in
2984 yesno)
2985 AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
2986 ;;
2987esac
2991
2992AC_SUBST([LIBPARSE])
2993AC_SUBST([MAKE_LIBPARSE])
2994AC_SUBST([MAKE_LIBPARSE_KERNEL])
2995AC_SUBST([MAKE_CHECK_Y2K])
2996
2997AC_MSG_CHECKING([if we need to make and use the parse libraries])
2988AC_SUBST(LIBPARSE)
2989AC_SUBST(MAKE_LIBPARSE)
2990AC_SUBST(MAKE_LIBPARSE_KERNEL)
2991AC_SUBST(MAKE_CHECK_Y2K)
2992AC_MSG_CHECKING(if we need to make and use the parse libraries)
2998ans=no
2999case "$ntp_libparse" in
3000 yes)
3001 ans=yes
2993ans=no
2994case "$ntp_libparse" in
2995 yes)
2996 ans=yes
3002 AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
2997 AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
3003 LIBPARSE=../libparse/libparse.a
3004 MAKE_LIBPARSE=libparse.a
3005 # HMS: check_y2k trips the 34 year problem now...
3006 false && MAKE_CHECK_Y2K=check_y2k
2998 LIBPARSE=../libparse/libparse.a
2999 MAKE_LIBPARSE=libparse.a
3000 # HMS: check_y2k trips the 34 year problem now...
3001 false && MAKE_CHECK_Y2K=check_y2k
3002 AC_DEFINE(PPS_SAMPLE, 1, [PPS auxiliary interface for ATOM?])
3003 AC_DEFINE(CLOCK_ATOM)
3004 ;;
3007esac
3005esac
3008AC_MSG_RESULT([$ans])
3006AC_MSG_RESULT($ans)
3009
3007
3010NTP_OPENSSL
3008# AC_SUBST(RSAOBJS)
3009# AC_SUBST(RSASRCS)
3010# AC_SUBST(RSADIR)
3011# AC_SUBST(RSAREF)
3012# AC_SUBST(LIBRSAREF)
3013# AC_SUBST(MAKE_LIBRSAREF)
3011
3014
3012NTP_CRYPTO_RAND
3015AC_SUBST(OPENSSL)
3016AC_SUBST(OPENSSL_INC)
3017AC_SUBST(OPENSSL_LIB)
3013
3018
3014# if we are using OpenSSL (--with-crypto), by default Autokey is enabled
3015AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
3016AC_ARG_ENABLE(
3017 [autokey],
3018 AS_HELP_STRING(
3019 [--enable-autokey],
3020 [+ support NTP Autokey protocol]
3021 ),
3022 [ntp_autokey=$enableval],
3023 [ntp_autokey=$ntp_openssl]
3024)
3025case "$ntp_autokey" in
3026 no)
3019AC_MSG_CHECKING(for openssl library directory)
3020AC_ARG_WITH(openssl-libdir,
3021 AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]),
3022[ans=$withval],
3023[case "$build" in
3024 $host) ans=yes ;;
3025 *) ans=no ;;
3026esac])
3027case "$ans" in
3028 no) ;;
3029 yes) # Look in:
3030 ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib"
3027 ;;
3031 ;;
3028 *)
3029 case "$ntp_openssl" in
3032 *) # Look where they said
3033 ;;
3034esac
3035case "$ans" in
3036 no) ;;
3037 *) # Look for libcrypto.a and libssl.a:
3038 for i in $ans no
3039 do
3040 case "$host" in
3041 *-*-darwin*)
3042 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
3043 ;;
3044 *)
3045 test -f $i/libcrypto.so -a -f $i/libssl.so && break
3046 test -f $i/libcrypto.a -a -f $i/libssl.a && break
3047 ;;
3048 esac
3049 done
3050 case "$i" in
3030 no)
3051 no)
3031 AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
3032 ntp_autokey=no
3052 ans=no
3053 OPENSSL_LIB=
3033 ;;
3054 ;;
3034 *)
3035 AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
3036 ntp_autokey=yes
3055 *) ans=$i
3056 OPENSSL_LIB=$ans
3037 ;;
3038 esac
3039 ;;
3040esac
3057 ;;
3058 esac
3059 ;;
3060esac
3041AC_MSG_RESULT([$ntp_autokey])
3061AC_MSG_RESULT($ans)
3042
3062
3043AC_SUBST([MAKE_CHECK_LAYOUT])
3044AC_MSG_CHECKING([if we want to run check-layout])
3063AC_MSG_CHECKING(for openssl include directory)
3064AC_ARG_WITH(openssl-incdir,
3065 AC_HELP_STRING([--with-openssl-incdir], [+ =/something/reasonable]),
3066[ans=$withval],
3067[case "$build" in
3068 $host) ans=yes ;;
3069 *) ans=no ;;
3070esac])
3071case "$ans" in
3072 no) ;;
3073 yes) # look in:
3074 ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include"
3075 ;;
3076 *) # Look where they said
3077 ;;
3078esac
3079case "$ans" in
3080 no) ;;
3081 *) # look for openssl/opensslconf.h:
3082 for i in $ans no
3083 do
3084 test -f $i/openssl/opensslconf.h && break
3085 done
3086 case "$i" in
3087 no)
3088 ans=no
3089 OPENSSL_INC=
3090 ;;
3091 *) ans=$i
3092 OPENSSL_INC=$ans
3093 ;;
3094 esac
3095 ;;
3096esac
3097AC_MSG_RESULT($ans)
3098
3099AC_ARG_WITH(crypto,
3100 AC_HELP_STRING([--with-crypto], [+ =openssl]),
3101[ans=$withval], [ans=yes])
3102case "$ans" in
3103 no) ;;
3104 yes|openssl)
3105 if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
3106 then
3107 ans=no
3108 else
3109 # We have OpenSSL inc/lib - use them.
3110 ans=openssl
3111 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
3112 LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
3113 case "$need_dash_r" in
3114 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB"
3115 ;;
3116 esac
3117 AC_SUBST(LCRYPTO, [-lcrypto])
3118 AC_DEFINE(OPENSSL, , [Use OpenSSL?])
3119 AC_CHECK_FUNCS(EVP_md2 EVP_mdc2)
3120 fi
3121 ;;
3122esac
3123AC_MSG_CHECKING(for the level of crypto support)
3124AC_MSG_RESULT($ans)
3125
3126AC_MSG_CHECKING(if we want to compile with ElectricFence)
3127AC_ARG_WITH(electricfence,
3128 AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
3129[ans=$withval], [ans=no])
3130case "$ans" in
3131 no) ;;
3132 *)
3133 LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
3134 EF_PROGS="eftest tstheap"
3135 AC_SUBST(EF_PROGS)
3136 EF_LIBS=libefence.a
3137 AC_SUBST(EF_LIBS)
3138 ans=yes
3139 ;;
3140esac
3141AC_MSG_RESULT($ans)
3142
3143AC_SUBST(MAKE_CHECK_LAYOUT)
3144AC_MSG_CHECKING(if we want to run check-layout)
3045case "$cross_compiling$PATH_PERL" in
3046 no/*)
3047 MAKE_CHECK_LAYOUT=check-layout
3048 ans=yes
3049 ;;
3050 *)
3051 ans=no
3052 ;;
3053esac
3145case "$cross_compiling$PATH_PERL" in
3146 no/*)
3147 MAKE_CHECK_LAYOUT=check-layout
3148 ans=yes
3149 ;;
3150 *)
3151 ans=no
3152 ;;
3153esac
3054AC_MSG_RESULT([$ans])
3154AC_MSG_RESULT($ans)
3055
3155
3056AC_SUBST([TESTDCF])
3057AC_SUBST([DCFD])
3058AC_MSG_CHECKING([if we can make dcf parse utilities])
3156AC_SUBST(TESTDCF)
3157AC_SUBST(DCFD)
3158
3159AC_MSG_CHECKING(if we can make dcf parse utilities)
3059ans=no
3160ans=no
3060case "$ntp_parseutil" in
3061 yes)
3161if test "$ntp_parseutil" = "yes"; then
3062 case "$host" in
3162 case "$host" in
3063 *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
3163 *-*-sunos4*|*-*-solaris2*|*-*-linux*|*-*-netbsd*)
3064 ans="dcfd testdcf"
3065 DCFD=dcfd
3164 ans="dcfd testdcf"
3165 DCFD=dcfd
3066 TESTDCF=testdcf
3166 TESTDCF=testdcf
3167 ;;
3067 esac
3168 esac
3068 ;;
3069esac
3070AC_MSG_RESULT([$ans])
3169fi
3170AC_MSG_RESULT($ans)
3071
3171
3072AC_SUBST([MAKE_PARSEKMODULE])
3073AC_MSG_CHECKING([if we can build kernel streams modules for parse])
3172AC_SUBST(MAKE_PARSEKMODULE)
3173AC_MSG_CHECKING(if we can build kernel streams modules for parse)
3074ans=no
3075case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3076 yesyes)
3077 case "$host" in
3078 sparc-*-sunos4*)
3174ans=no
3175case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
3176 yesyes)
3177 case "$host" in
3178 sparc-*-sunos4*)
3079 case "$ntp_cv_var_kernel_pll" in
3179 case "$ac_cv_var_kernel_pll" in
3080 yes)
3180 yes)
3081 AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
3181 AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
3082 ;;
3083 esac
3084 ans=parsestreams
3085 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3086 ;;
3087 sparc-*-solaris2*)
3088 ans=parsesolaris
3089 MAKE_PARSEKMODULE=parse
3182 ;;
3183 esac
3184 ans=parsestreams
3185 MAKE_PARSEKMODULE=parsestreams.loadable_module.o
3186 ;;
3187 sparc-*-solaris2*)
3188 ans=parsesolaris
3189 MAKE_PARSEKMODULE=parse
3090 AC_CHECK_HEADERS([strings.h])
3091 ;;
3092 esac
3093 ;;
3094esac
3190 ;;
3191 esac
3192 ;;
3193esac
3095AC_MSG_RESULT([$ans])
3194AC_MSG_RESULT($ans)
3096
3195
3097AC_MSG_CHECKING([if we need basic refclock support])
3098case "$ntp_refclock" in
3099 yes)
3100 AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
3101 ;;
3102esac
3196AC_MSG_CHECKING(if we need basic refclock support)
3197if test "$ntp_refclock" = "yes"; then
3198 AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
3199fi
3103AC_MSG_RESULT($ntp_refclock)
3104
3200AC_MSG_RESULT($ntp_refclock)
3201
3105dnl Things that can be made in clockstuff
3106AC_SUBST([PROPDELAY], [propdelay])
3107AC_SUBST([CHUTEST]) dnl needs work to compile
3202dnl Things that can be made in clockstuff/
3203AC_SUBST(PROPDELAY) dnl Set to "propdelay"
3204AC_SUBST(CHUTEST) dnl Set to "chutest"
3205AC_SUBST(CLKTEST) dnl Set to "clktest"
3108
3206
3109AC_SUBST([MAKE_ADJTIMED])
3110AC_MSG_CHECKING([if we want HP-UX adjtimed support])
3207AC_SUBST(MAKE_ADJTIMED)
3208AC_MSG_CHECKING(if we want HP-UX adjtimed support)
3111case "$host" in
3112 *-*-hpux[[56789]]*)
3113 ans=yes
3114 ;;
3115 *) ans=no
3116 ;;
3117esac
3209case "$host" in
3210 *-*-hpux[[56789]]*)
3211 ans=yes
3212 ;;
3213 *) ans=no
3214 ;;
3215esac
3118case "$ans" in
3119 yes)
3216if test "$ans" = "yes"; then
3120 MAKE_ADJTIMED=adjtimed
3217 MAKE_ADJTIMED=adjtimed
3121 AC_DEFINE([NEED_HPUX_ADJTIME], [1],
3122 [Do we need HPUX adjtime() library support?])
3123 ;;
3124 *) ADJTIMED_DB=
3125 ADJTIMED_DL=
3126 ADJTIMED_DS=
3127 ADJTIMED_MS=
3128 ;;
3129esac
3130AC_MSG_RESULT([$ans])
3218 AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
3219fi
3220AC_MSG_RESULT($ans)
3131
3221
3132AC_MSG_CHECKING([if we want QNX adjtime support])
3222AC_MSG_CHECKING(if we want QNX adjtime support)
3133case "$host" in
3134 *-*-qnx*)
3135 ans=yes
3136 ;;
3137 *) ans=no
3138 ;;
3139esac
3223case "$host" in
3224 *-*-qnx*)
3225 ans=yes
3226 ;;
3227 *) ans=no
3228 ;;
3229esac
3140case "$ans" in
3141 yes)
3142 AC_DEFINE([NEED_QNX_ADJTIME], [1],
3143 [Do we need the qnx adjtime call?])
3144 ;;
3145esac
3146AC_MSG_RESULT([$ans])
3230if test "$ans" = "yes"; then
3231 AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
3232fi
3233AC_MSG_RESULT($ans)
3147
3234
3148AC_MSG_CHECKING([if we can read kmem])
3235AC_CACHE_CHECK(if we can read kmem, ac_cv_var_can_kmem,
3236[AC_ARG_ENABLE(kmem,
3237 AC_HELP_STRING([--enable-kmem], [s read /dev/kmem for tick and/or tickadj]),
3238 [ans=$enableval],
3239 [case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3240 *yes*)
3241 ans=yes
3242 ;;
3243 *) ans=no
3244 ;;
3245 esac
3246 case "$host" in
3247 *-*-aix*)
3248 #ans=no
3249 ;;
3250 *-*-domainos) # Won't be found...
3251 ans=no
3252 ;;
3253 *-*-hpux*)
3254 #ans=no
3255 ;;
3256 *-*-irix[[456]]*)
3257 ans=no
3258 ;;
3259 *-*-linux*)
3260 ans=no
3261 ;;
3262 *-*-winnt3.5)
3263 ans=no
3264 ;;
3265 *-*-unicosmp*)
3266 ans=no
3267 ;;
3268 esac
3269 ])
3270ac_cv_var_can_kmem=$ans])
3149
3271
3150# the default is to enable it if the system has the capability
3272case "$ac_cv_var_can_kmem" in
3273 *yes*) ;;
3274 *) AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?]) ;;
3275esac
3151
3276
3152case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
3153 *yes*)
3154 ans=yes
3155 ;;
3156 *) ans=no
3157 ;;
3277AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
3278[AC_ARG_ENABLE(accurate-adjtime,
3279 AC_HELP_STRING([--enable-accurate-adjtime], [s the adjtime() call is accurate]),
3280 [ans=$enableval],
3281 [case "$host" in
3282 i386-sequent-ptx*)
3283 ans=no
3284 ;;
3285 i386-unknown-osf1*)
3286 ans=yes
3287 ;;
3288 mips-sgi-irix[[456]]*)
3289 ans=yes
3290 ;;
3291 *-fujitsu-uxp*)
3292 ans=yes
3293 ;;
3294 *-ibm-aix[[45]]*)
3295 ans=yes
3296 ;;
3297 *-*-linux*)
3298 ans=yes
3299 ;;
3300 *-*-solaris2.[[01]])
3301 ans=no
3302 ;;
3303 *-*-solaris2*)
3304 ans=yes
3305 ;;
3306 *-*-unicosmp*)
3307 ans=yes
3308 ;;
3309 *) ans=no
3310 ;;
3311 esac
3312 ])
3313ac_cv_var_adjtime_is_accurate=$ans])
3314case "$ac_cv_var_adjtime_is_accurate" in
3315 yes) AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?]) ;;
3158esac
3159
3316esac
3317
3318AC_CACHE_CHECK([the name of 'tick' in the kernel],
3319ac_cv_var_nlist_tick,
3320[ans=_tick
3160case "$host" in
3321case "$host" in
3161 *-*-domainos) # Won't be found...
3162 ans=no
3322 m68*-hp-hpux*) # HP9000/300?
3323 ans=_old_tick
3163 ;;
3324 ;;
3164 *-*-hpux*)
3165 #ans=no
3325 *-apple-aux[[23]]*)
3326 ans=tick
3166 ;;
3327 ;;
3167 *-*-irix[[456]]*)
3168 ans=no
3328 *-hp-hpux*)
3329 ans=old_tick
3169 ;;
3330 ;;
3170 *-*-*linux*)
3331 *-ibm-aix[[345]]*)
3171 ans=no
3172 ;;
3332 ans=no
3333 ;;
3173 *-*-winnt3.5)
3334 *-*-mpeix*)
3174 ans=no
3175 ;;
3335 ans=no
3336 ;;
3176 *-*-unicosmp*)
3337 *-*-ptx*)
3338 ans=tick
3339 ;;
3340 *-*-sco3.2v[[45]]*)
3177 ans=no
3178 ;;
3341 ans=no
3342 ;;
3343 *-*-solaris2*)
3344 ans=nsec_per_tick
3345 ;;
3346 *-*-sysv4*)
3347 ans=tick
3348 ;;
3179esac
3349esac
3180
3181# --enable-kmem / --disable-kmem controls if present
3182AC_ARG_ENABLE(
3183 [kmem],
3184 [AS_HELP_STRING(
3185 [--enable-kmem],
3186 [s read /dev/kmem for tick and/or tickadj]
3187 )],
3188 [ans=$enableval]
3189)
3190
3191AC_MSG_RESULT([$ans])
3192
3193case "$ans" in
3194 yes)
3195 can_kmem=yes
3350ac_cv_var_nlist_tick=$ans])
3351case "$ac_cv_var_nlist_tick" in
3352 ''|no) ;; # HMS: I think we can only get 'no' here...
3353 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
3354esac
3355#
3356AC_CACHE_CHECK([for the units of 'tick'],
3357ac_cv_var_tick_nano,
3358[ans=usec
3359case "$host" in
3360 *-*-solaris2*)
3361 ans=nsec
3196 ;;
3362 ;;
3197 *)
3198 can_kmem=no
3199 AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
3200esac
3363esac
3201
3202
3203AC_MSG_CHECKING([if adjtime is accurate])
3204
3205# target-dependent defaults
3206
3364ac_cv_var_tick_nano=$ans])
3365case "$ac_cv_var_tick_nano" in
3366 nsec)
3367 AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
3368 ;;
3369esac
3370#
3371AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
3372ac_cv_var_nlist_tickadj,
3373[ans=_tickadj
3207case "$host" in
3374case "$host" in
3208 i386-sequent-ptx*)
3209 ans=no
3375 m68*-hp-hpux*) # HP9000/300?
3376 ans=_tickadj
3210 ;;
3377 ;;
3211 i386-unknown-osf1*)
3212 ans=yes
3378 *-apple-aux[[23]]*)
3379 ans=tickadj
3213 ;;
3380 ;;
3214 mips-sgi-irix[[456]]*)
3215 ans=yes
3381 *-hp-hpux10*)
3382 ans=no
3216 ;;
3383 ;;
3217 *-fujitsu-uxp*)
3218 ans=yes
3384 *-hp-hpux9*)
3385 ans=no
3219 ;;
3386 ;;
3220 *-ibm-aix[[4-9]]*)
3221 # XXX only verified thru AIX6.
3222 ans=yes
3387 *-hp-hpux*)
3388 ans=tickadj
3223 ;;
3389 ;;
3224 *-*-*linux*)
3225 ans=yes
3390 *-*-aix*)
3391 ans=tickadj
3226 ;;
3392 ;;
3227 *-*-solaris2.[[01]])
3393 *-*-mpeix*)
3228 ans=no
3229 ;;
3394 ans=no
3395 ;;
3230 *-*-solaris2*)
3231 ans=yes
3396 *-*-ptx*)
3397 ans=tickadj
3232 ;;
3398 ;;
3233 *-*-unicosmp*)
3234 ans=yes
3399 *-*-sco3.2v4*)
3400 ans=no
3235 ;;
3401 ;;
3236 *) ans=no
3402 *-*-sco3.2v5.0*)
3403 ans=clock_drift
3237 ;;
3404 ;;
3238esac
3239
3240# --enable-accurate-adjtime / --disable-accurate-adjtime
3241# override the default
3242AC_ARG_ENABLE(
3243 [accurate-adjtime],
3244 [AS_HELP_STRING(
3245 [--enable-accurate-adjtime],
3246 [s the adjtime() call is accurate]
3247 )],
3248 [ans=$enableval]
3249)
3250
3251AC_MSG_RESULT([$ans])
3252
3253case "$ans" in
3254 yes)
3255 AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
3256 adjtime_is_accurate=yes
3405 *-*-solaris2*)
3406 ans=no # hrestime_adj
3257 ;;
3407 ;;
3258 *)
3259 adjtime_is_accurate=no
3408 *-*-sysv4*)
3409 ans=tickadj
3260 ;;
3261esac
3410 ;;
3411esac
3262
3263AC_CACHE_CHECK(
3264 [the name of 'tick' in the kernel],
3265 [ntp_cv_nlist_tick],
3266 [
3267 ans=_tick
3268 case "$host" in
3269 m68*-hp-hpux*) # HP9000/300?
3270 ans=_old_tick
3271 ;;
3272 *-apple-aux[[23]]*)
3273 ans=tick
3274 ;;
3275 *-hp-hpux*)
3276 ans=old_tick
3277 ;;
3278 *-ibm-aix[[3-9]]*)
3279 # XXX only verified thru AIX6.
3280 ans=no
3281 ;;
3282 *-*-mpeix*)
3283 ans=no
3284 ;;
3285 *-*-ptx*)
3286 ans=tick
3287 ;;
3288 *-*-sco3.2v[[45]]*)
3289 ans=no
3290 ;;
3291 *-*-solaris2*)
3292 ans=nsec_per_tick
3293 ;;
3294 *-*-sysv4*)
3295 ans=tick
3296 ;;
3297 esac
3298 ntp_cv_nlist_tick=$ans
3299 ]
3300)
3301case "$ntp_cv_nlist_tick" in
3302 ''|no)
3303 ;; # HMS: I think we can only get 'no' here...
3304 *)
3305 AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
3306 [What is the name of TICK in the kernel?])
3412ac_cv_var_nlist_tickadj=$ans])
3413case "$ac_cv_var_nlist_tickadj" in
3414 ''|no) ;; # HMS: I think we can only get 'no' here...
3415 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
3307esac
3416esac
3308
3309AC_CACHE_CHECK(
3310 [for the units of 'tick'],
3311 [ntp_cv_tick_nano],
3312 [
3313 ans=usec
3314 case "$host" in
3315 *-*-solaris2*)
3316 ans=nsec
3317 ;;
3318 esac
3319 ntp_cv_tick_nano=$ans
3320 ]
3321)
3322case "$ntp_cv_tick_nano" in
3323 nsec)
3324 AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
3417#
3418AC_CACHE_CHECK([for the units of 'tickadj'],
3419ac_cv_var_tickadj_nano,
3420[ans=usec
3421case "$host" in
3422 *-*-solaris2*)
3423 ans=nsec
3424 ;;
3325esac
3425esac
3326
3327AC_CACHE_CHECK(
3328 [the name of 'tickadj' in the kernel],
3329 [ntp_cv_nlist_tickadj],
3330 [
3331 ans=_tickadj
3332 case "$host" in
3333 m68*-hp-hpux*) # HP9000/300?
3334 ans=_tickadj
3335 ;;
3336 *-apple-aux[[23]]*)
3337 ans=tickadj
3338 ;;
3339 *-hp-hpux10*)
3340 ans=no
3341 ;;
3342 *-hp-hpux9*)
3343 ans=no
3344 ;;
3345 *-hp-hpux*)
3346 ans=tickadj
3347 ;;
3348 *-*-aix*)
3349 ans=tickadj
3350 ;;
3351 *-*-mpeix*)
3352 ans=no
3353 ;;
3354 *-*-ptx*)
3355 ans=tickadj
3356 ;;
3357 *-*-sco3.2v4*)
3358 ans=no
3359 ;;
3360 *-*-sco3.2v5.0*)
3361 ans=clock_drift
3362 ;;
3363 *-*-solaris2*)
3364 ans=no # hrestime_adj
3365 ;;
3366 *-*-sysv4*)
3367 ans=tickadj
3368 ;;
3369 esac
3370 ntp_cv_nlist_tickadj=$ans
3371 ]
3372)
3373case "$ntp_cv_nlist_tickadj" in
3374 ''|no)
3375 ;; # HMS: I think we can only get 'no' here...
3376 *)
3377 AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
3378 [What is the name of TICKADJ in the kernel?])
3379esac
3380
3381AC_CACHE_CHECK(
3382 [for the units of 'tickadj'],
3383 [ntp_cv_tickadj_nano],
3384 [
3385 ans=usec
3386 case "$host" in
3387 *-*-solaris2*)
3388 ans=nsec
3389 ;;
3390 esac
3391 ntp_cv_tickadj_nano=$ans
3392 ]
3393)
3394case "$ntp_cv_tickadj_nano" in
3426ac_cv_var_tickadj_nano=$ans])
3427case "$ac_cv_var_tickadj_nano" in
3395 nsec)
3428 nsec)
3396 AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
3397esac
3398
3399AC_CACHE_CHECK(
3400 [half-heartedly for 'dosynctodr' in the kernel],
3401 [ntp_cv_nlist_dosynctodr],
3402 [
3403 case "$host" in
3404 *-apple-aux[[23]]*)
3405 ans=no
3406 ;;
3407 *-sni-sysv*)
3408 ans=dosynctodr
3409 ;;
3410 *-stratus-vos)
3411 ans=no
3412 ;;
3413 *-*-aix*)
3414 ans=dosynctodr
3415 ;;
3416 *-*-hpux*)
3417 ans=no
3418 ;;
3419 *-*-mpeix*)
3420 ans=no
3421 ;;
3422 *-*-nextstep*)
3423 ans=_dosynctodr
3424 ;;
3425 *-*-ptx*)
3426 ans=doresettodr
3427 ;;
3428 *-*-sco3.2v4*)
3429 ans=no
3430 ;;
3431 *-*-sco3.2v5*)
3432 ans=track_rtc
3433 ;;
3434 *-*-solaris2*)
3435 ans=dosynctodr
3436 ;;
3437 *-*-sysv4*)
3438 ans=doresettodr
3439 ;;
3440 *)
3441 ans=_dosynctodr
3442 ;;
3443 esac
3444 ntp_cv_nlist_dosynctodr=$ans
3445 ]
3446)
3447case "$ntp_cv_nlist_dosynctodr" in
3448 no)
3429 AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
3449 ;;
3430 ;;
3450 *)
3451 AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
3452 [What is (probably) the name of DOSYNCTODR in the kernel?])
3453 ;;
3454esac
3431esac
3455
3456AC_CACHE_CHECK(
3457 [half-heartedly for 'noprintf' in the kernel],
3458 [ntp_cv_nlist_noprintf],
3459 [
3460 case "$host" in
3461 *-apple-aux[[23]]*)
3462 ans=no
3463 ;;
3464 *-sni-sysv*)
3465 ans=noprintf
3466 ;;
3467 *-stratus-vos)
3468 ans=no
3469 ;;
3470 *-*-aix*)
3471 ans=noprintf
3472 ;;
3473 *-*-hpux*)
3474 ans=no
3475 ;;
3476 *-*-mpeix*)
3477 ans=no
3478 ;;
3479 *-*-ptx*)
3480 ans=noprintf
3481 ;;
3482 *-*-nextstep*)
3483 ans=_noprintf
3484 ;;
3485 *-*-solaris2*)
3486 ans=noprintf
3487 ;;
3488 *-*-sysv4*)
3489 ans=noprintf
3490 ;;
3491 *)
3492 ans=_noprintf
3493 ;;
3494 esac
3495 ntp_cv_nlist_noprintf=$ans
3496 ]
3497)
3498case "$ntp_cv_nlist_noprintf" in
3499 no)
3432#
3433AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
3434ac_cv_var_nlist_dosynctodr,
3435[case "$host" in
3436 *-apple-aux[[23]]*)
3437 ans=no
3500 ;;
3438 ;;
3501 *)
3502 AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
3503 [What is (probably) the name of NOPRINTF in the kernel?])
3439 *-sni-sysv*)
3440 ans=dosynctodr
3504 ;;
3441 ;;
3505esac
3506
3507dnl The tick/tickadj sections were written by Skippy, who never learned
3508dnl that it's impolite (horridly gross) to show your guts in public.
3509
3510dnl tick tickadj
3511dnl 10000 80 Unixware
3512dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3513dnl 10000 150 sgi IRIX
3514dnl 1000000L/hz 1000 RS6000 && NOKMEM
3515dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3516dnl 1000000L/hz 500/HZ other && NOKMEM
3517dnl txc.tick 1 Linux
3518dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3519dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3520dnl (RS6000 && !NOKMEM), SINIX MIPS
3521
3522dnl But we'll only use these "values" if we can't find anything else.
3523
3524AC_MSG_CHECKING([for a default value for 'tick'])
3525
3526# target-dependent default for tick
3527
3528case "$host" in
3529 *-*-pc-cygwin*)
3530 AC_MSG_ERROR([tick needs work for cygwin])
3442 *-*-aix*)
3443 ans=dosynctodr
3531 ;;
3444 ;;
3532 *-univel-sysv*)
3533 ans=10000
3445 *-*-hpux*)
3446 ans=no
3534 ;;
3447 ;;
3535 *-*-irix*)
3536 ans=10000
3448 *-*-mpeix*)
3449 ans=no
3537 ;;
3450 ;;
3538 *-*-*linux*)
3539 ans=txc.tick
3451 *-*-nextstep*)
3452 ans=_dosynctodr
3540 ;;
3453 ;;
3541 *-*-mpeix*)
3454 *-*-ptx*)
3455 ans=doresettodr
3456 ;;
3457 *-*-sco3.2v4*)
3542 ans=no
3543 ;;
3458 ans=no
3459 ;;
3544 *-*-winnt3.5)
3545 ans='(every / 10)'
3460 *-*-sco3.2v5*)
3461 ans=track_rtc
3546 ;;
3462 ;;
3547 *-*-unicosmp*)
3548 ans=10000
3463 *-*-solaris2*)
3464 ans=dosynctodr
3549 ;;
3465 ;;
3466 *-*-sysv4*)
3467 ans=doresettodr
3468 ;;
3550 *)
3469 *)
3551 ans='1000000L/hz'
3470 ans=_dosynctodr
3552 ;;
3553esac
3471 ;;
3472esac
3554
3555AC_ARG_ENABLE(
3556 [tick],
3557 [AS_HELP_STRING(
3558 [--enable-tick=VALUE],
3559 [s force a value for 'tick']
3560 )],
3561 [ans=$enableval]
3562)
3563
3564AC_MSG_RESULT([$ans])
3565
3566case "$ans" in
3567 ''|no)
3568 ;; # HMS: I think we can only get 'no' here...
3569 *)
3570 AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
3571 [Preset a value for 'tick'?])
3473ac_cv_var_nlist_dosynctodr=$ans])
3474case "$ac_cv_var_nlist_dosynctodr" in
3475 no) ;;
3476 *) AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
3477 ;;
3572esac
3478esac
3573
3574AC_MSG_CHECKING([for a default value for 'tickadj'])
3575
3576# target-specific default
3577ans='500/hz'
3578case "$host" in
3579 *-fujitsu-uxp*)
3580 case "$adjtime_is_accurate" in
3581 yes)
3582 ans='tick/16'
3583 esac
3479#
3480AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
3481ac_cv_var_nlist_noprintf,
3482[case "$host" in
3483 *-apple-aux[[23]]*)
3484 ans=no
3584 ;;
3485 ;;
3585 *-univel-sysv*)
3586 ans=80
3486 *-sni-sysv*)
3487 ans=noprintf
3587 ;;
3588 *-*-aix*)
3488 ;;
3489 *-*-aix*)
3589 case "$can_kmem" in
3590 no)
3591 ans=1000
3592 ;;
3593 esac
3490 ans=noprintf
3594 ;;
3491 ;;
3595 *-*-domainos) # Skippy: won't be found...
3596 case "$can_kmem" in
3597 no)
3598 ans=668
3599 ;;
3600 esac
3601 ;;
3602 *-*-hpux*)
3492 *-*-hpux*)
3603 case "$adjtime_is_accurate" in
3604 yes)
3605 ans='tick/16'
3606 ;;
3607 esac
3493 ans=no
3608 ;;
3494 ;;
3609 *-*-irix*)
3610 ans=150
3611 ;;
3612 *-*-mpeix*)
3613 ans=no
3614 ;;
3495 *-*-mpeix*)
3496 ans=no
3497 ;;
3615 *-*-sco3.2v5.0*)
3616 ans=10000L/hz
3498 *-*-ptx*)
3499 ans=noprintf
3617 ;;
3500 ;;
3618 *-*-winnt3.5)
3619 ans=50
3501 *-*-nextstep*)
3502 ans=_noprintf
3620 ;;
3503 ;;
3621 *-*-unicosmp*)
3622 ans=150
3504 *-*-solaris2*)
3505 ans=noprintf
3623 ;;
3506 ;;
3507 *-*-sysv4*)
3508 ans=noprintf
3509 ;;
3510 *)
3511 ans=_noprintf
3512 ;;
3624esac
3513esac
3514ac_cv_var_nlist_noprintf=$ans])
3515case "$ac_cv_var_nlist_noprintf" in
3516 no) ;;
3517 *) AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
3518 ;;
3519esac
3625
3520
3626AC_ARG_ENABLE(
3627 [tickadj],
3628 [AS_HELP_STRING(
3629 [--enable-tickadj=VALUE],
3630 [s force a value for 'tickadj']
3631 )],
3632 [ans=$enableval]
3633)
3521dnl The tick/tickadj sections were written by Skippy, who never learned
3522dnl that it's impolite (horridly gross) to show your guts in public.
3634
3523
3635AC_MSG_RESULT([$ans])
3524dnl tick tickadj
3525dnl 10000 80 Unixware
3526dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
3527dnl 10000 150 sgi IRIX
3528dnl 1000000L/hz 1000 RS6000 && NOKMEM
3529dnl 1000000L/hz 668 DOMAINOS && NOKMEM
3530dnl 1000000L/hz 500/HZ other && NOKMEM
3531dnl txc.tick 1 Linux
3532dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
3533dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
3534dnl (RS6000 && !NOKMEM), SINIX MIPS
3636
3535
3637default_tickadj=$ans
3536dnl But we'll only use these "values" if we can't find anything else.
3638
3537
3639case "$default_tickadj" in
3640 ''|no)
3641 ;; # HMS: I think we can only get 'no' here...
3642 *)
3643 AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
3644 [Preset a value for 'tickadj'?]) ;;
3538AC_CACHE_CHECK(for a default value for 'tick', ac_cv_var_tick,
3539[AC_ARG_ENABLE(tick,
3540 AC_HELP_STRING([--enable-tick=VALUE], [s force a value for 'tick']),
3541 [ans=$enableval],
3542 [ans=no
3543 case "$host" in
3544 XXX-*-pc-cygwin*)
3545 ;;
3546 *-univel-sysv*)
3547 ans=10000
3548 ;;
3549 *-*-irix*)
3550 ans=10000
3551 ;;
3552 *-*-linux*)
3553 ans=txc.tick
3554 ;;
3555 *-*-mpeix*)
3556 ans=no
3557 ;;
3558 *-*-winnt3.5)
3559 ans='(every / 10)'
3560 ;;
3561 *-*-unicosmp*)
3562 ans=10000
3563 ;;
3564 *)
3565 ans='1000000L/hz'
3566 ;;
3567 esac])
3568ac_cv_var_tick=$ans])
3569case "$ac_cv_var_tick" in
3570 ''|no) ;; # HMS: I think we can only get 'no' here...
3571 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick, [Preset a value for 'tick'?]) ;;
3645esac
3646
3572esac
3573
3574AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
3575[AC_ARG_ENABLE(tickadj,
3576 AC_HELP_STRING([--enable-tickadj=VALUE], [s force a value for 'tickadj']),
3577 [ans=$enableval],
3578 [ans='500/hz'
3579 case "$host" in
3580 *-fujitsu-uxp*)
3581 case "$ac_cv_var_adjtime_is_accurate" in
3582 yes) ans='tick/16' ;;
3583 esac
3584 ;;
3585 XXX-*-pc-cygwin*)
3586 ans=no
3587 ;;
3588 *-univel-sysv*)
3589 ans=80
3590 ;;
3591 *-*-aix*)
3592 case "$ac_cv_var_can_kmem" in
3593 no) ans=1000 ;;
3594 esac
3595 ;;
3596 *-*-domainos) # Skippy: won't be found...
3597 case "$ac_cv_var_can_kmem" in
3598 no) ans=668 ;;
3599 esac
3600 ;;
3601 *-*-hpux*)
3602 case "$ac_cv_var_adjtime_is_accurate" in
3603 yes) ans='tick/16' ;;
3604 esac
3605 ;;
3606 *-*-irix*)
3607 ans=150
3608 ;;
3609 *-*-mpeix*)
3610 ans=no
3611 ;;
3612 *-*-sco3.2v5.0*)
3613 ans=10000L/hz
3614 ;;
3615 *-*-solaris2*)
3616 case "$ac_cv_var_adjtime_is_accurate" in
3617 yes)
3618 #ans='tick/16'
3619 ;;
3620 esac
3621 ;;
3622 *-*-winnt3.5)
3623 ans=50
3624 ;;
3625 *-*-unicosmp*)
3626 ans=150
3627 ;;
3628 esac])
3629ac_cv_var_tickadj=$ans])
3630case "$ac_cv_var_tickadj" in
3631 ''|no) ;; # HMS: I think we can only get 'no' here...
3632 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj, [Preset a value for 'tickadj'?]) ;;
3633esac
3634
3647# Newer versions of ReliantUNIX round adjtime() values down to
3648# 1/100s (system tick). Sigh ...
3649# Unfortunately, there is no easy way to know if particular release
3650# has this "feature" or any obvious way to test for it.
3651case "$host" in
3635# Newer versions of ReliantUNIX round adjtime() values down to
3636# 1/100s (system tick). Sigh ...
3637# Unfortunately, there is no easy way to know if particular release
3638# has this "feature" or any obvious way to test for it.
3639case "$host" in
3652 mips-sni-sysv4*)
3653 AC_DEFINE([RELIANTUNIX_CLOCK], [1],
3654 [Do we want the ReliantUNIX clock hacks?])
3640 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
3655esac
3656
3657case "$host" in
3641esac
3642
3643case "$host" in
3658 *-*-sco3.2v5*)
3659 AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
3644 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
3660esac
3661
3645esac
3646
3662ntp_cv_make_tickadj=yes
3663case "$can_kmem$ac_cv_var_tick$default_tickadj" in
3647ac_cv_make_tickadj=yes
3648case "$ac_cv_var_can_kmem$ac_cv_var_tick$ac_cv_var_tickadj" in
3664 nonono) # Don't read KMEM, no presets. Bogus.
3649 nonono) # Don't read KMEM, no presets. Bogus.
3665 AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
3666 ntp_cv_make_tickadj=no
3650 AC_MSG_WARN(Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.)
3651 ac_cv_make_tickadj=no
3667 ;;
3668 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3652 ;;
3653 nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3669 AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
3670 ntp_cv_make_tickadj=no
3654 AC_MSG_WARN(Can't read kmem but no PRESET_TICK. No tickadj.)
3655 ac_cv_make_tickadj=no
3671 ;;
3672 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3656 ;;
3657 no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
3673 AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
3674 ntp_cv_make_tickadj=no
3658 AC_MSG_WARN(Can't read kmem but no PRESET_TICKADJ. No tickadj.)
3659 ac_cv_make_tickadj=no
3675 ;;
3676 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3677 ;;
3678 yesnono) # Read KMEM, no presets. Cool.
3679 ;;
3680 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3660 ;;
3661 no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
3662 ;;
3663 yesnono) # Read KMEM, no presets. Cool.
3664 ;;
3665 yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
3681 AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
3666 AC_MSG_WARN(PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.)
3682 ;;
3683 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3684 ;;
3685 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3686 ;;
3687 *) # Generally bogus.
3667 ;;
3668 yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
3669 ;;
3670 yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
3671 ;;
3672 *) # Generally bogus.
3688 AC_MSG_ERROR([This shouldn't happen.])
3673 AC_MSG_ERROR(This shouldn't happen.)
3689 ;;
3690esac
3691
3692AC_SUBST(MAKE_NTPTIME)
3674 ;;
3675esac
3676
3677AC_SUBST(MAKE_NTPTIME)
3693AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
3678AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
3694[case "$host" in
3679[case "$host" in
3695 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
3680 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
3696 yesyes)
3697 ans=yes
3698 ;;
3699 *)
3700 ans=no
3701 ;;
3702 esac
3703 ;;
3704esac
3705ac_cv_make_ntptime=$ans])
3706case "$ac_cv_make_ntptime" in
3707 yes)
3708 MAKE_NTPTIME=ntptime
3709 ;;
3681 yesyes)
3682 ans=yes
3683 ;;
3684 *)
3685 ans=no
3686 ;;
3687 esac
3688 ;;
3689esac
3690ac_cv_make_ntptime=$ans])
3691case "$ac_cv_make_ntptime" in
3692 yes)
3693 MAKE_NTPTIME=ntptime
3694 ;;
3710 *)
3711 NTPTIME_DB=
3712 NTPTIME_DL=
3713 NTPTIME_DS=
3714 NTPTIME_MS=
3715 ;;
3716esac
3717
3695esac
3696
3718AC_SUBST([MAKE_TICKADJ])
3697AC_SUBST(MAKE_TICKADJ)
3719case "$host" in
3720 mips-sni-sysv4*)
3721 # tickadj is pretty useless on newer versions of ReliantUNIX
3722 # Do not bother
3698case "$host" in
3699 mips-sni-sysv4*)
3700 # tickadj is pretty useless on newer versions of ReliantUNIX
3701 # Do not bother
3723 ntp_cv_make_tickadj=no
3702 ac_cv_make_tickadj=no
3724 ;;
3725 *-*-irix*)
3703 ;;
3704 *-*-irix*)
3726 ntp_cv_make_tickadj=no
3705 ac_cv_make_tickadj=no
3727 ;;
3728 *-*-solaris2*)
3729 # DLM says tickadj is a no-no starting with solaris2.5
3730 case "$host" in
3731 *-*-solaris2.1[[0-9]]*)
3706 ;;
3707 *-*-solaris2*)
3708 # DLM says tickadj is a no-no starting with solaris2.5
3709 case "$host" in
3710 *-*-solaris2.1[[0-9]]*)
3732 ntp_cv_make_tickadj=no
3711 ac_cv_make_tickadj=no
3733 ;;
3734 *-*-solaris2.[[0-4]]*) ;;
3712 ;;
3713 *-*-solaris2.[[0-4]]*) ;;
3735 *) ntp_cv_make_tickadj=no ;;
3714 *) ac_cv_make_tickadj=no ;;
3736 esac
3737 ;;
3738 *-*-unicosmp*)
3715 esac
3716 ;;
3717 *-*-unicosmp*)
3739 ntp_cv_make_tickadj=no
3718 ac_cv_make_tickadj=no
3740 ;;
3741esac
3719 ;;
3720esac
3742
3743#
3744# Despite all the above, we always make tickadj. Setting
3745# ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
3746# report that the configuration variable was cached. It may
3747# be better to simply remove the hunk above, I did not want
3748# to remove it if there is hope it will be used again.
3749#
3750AS_UNSET([ntp_cv_make_tickadj])
3751
3752AC_CACHE_CHECK(
3753 [if we want and can make the tickadj utility],
3754 [ntp_cv_make_tickadj],
3755 [ntp_cv_make_tickadj=yes]
3756)
3757case "$ntp_cv_make_tickadj" in
3721AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
3722ac_cv_make_tickadj=yes)
3723case "$ac_cv_make_tickadj" in
3758 yes)
3759 MAKE_TICKADJ=tickadj
3760 ;;
3724 yes)
3725 MAKE_TICKADJ=tickadj
3726 ;;
3761 *)
3762 CALC_TICKADJ_DB=
3763 CALC_TICKADJ_DL=
3764 CALC_TICKADJ_DS=
3765 CALC_TICKADJ_MS=
3766 TICKADJ_DB=
3767 TICKADJ_DL=
3768 TICKADJ_DS=
3769 TICKADJ_MS=
3770 ;;
3771esac
3772
3727esac
3728
3773AC_SUBST([MAKE_TIMETRIM])
3774AC_CACHE_CHECK(
3775 [if we want and can make the timetrim utility],
3776 [ntp_cv_make_timetrim],
3777 [
3778 case "$host" in
3779 *-*-irix*)
3780 ntp_cv_make_timetrim=yes
3781 ;;
3782 *-*-unicosmp*)
3783 ntp_cv_make_timetrim=yes
3784 ;;
3785 *)
3786 ntp_cv_make_timetrim=no
3787 ;;
3788 esac
3789 ]
3790)
3791case "$ntp_cv_make_timetrim" in
3729AC_SUBST(MAKE_TIMETRIM)
3730AC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
3731[case "$host" in
3732 *-*-irix*)
3733 ac_cv_make_timetrim=yes
3734 ;;
3735 *-*-unicosmp*)
3736 ac_cv_make_timetrim=yes
3737 ;;
3738 *)
3739 ac_cv_make_timetrim=no
3740 ;;
3741esac])
3742case "$ac_cv_make_timetrim" in
3792 yes)
3793 MAKE_TIMETRIM=timetrim
3794 ;;
3743 yes)
3744 MAKE_TIMETRIM=timetrim
3745 ;;
3795 *) TIMETRIM_DB=
3796 TIMETRIM_DL=
3797 TIMETRIM_DS=
3798 TIMETRIM_MS=
3799 ;;
3800esac
3801
3746esac
3747
3802AC_SUBST([MAKE_LIBNTPSIM])
3803AC_SUBST([MAKE_NTPDSIM])
3804
3805AC_MSG_CHECKING([if we want to build the NTPD simulator])
3806AC_ARG_ENABLE(
3807 [simulator],
3808 [AS_HELP_STRING(
3809 [--enable-simulator],
3810 [- build/install the NTPD simulator?]
3811 )],
3812 [ans=$enableval],
3813 [ans=no]
3814)
3815AC_MSG_RESULT([$ans])
3816case "$ans" in
3748AC_SUBST(MAKE_LIBNTPSIM)
3749AC_SUBST(MAKE_NTPDSIM)
3750AC_CACHE_CHECK([if we want to build the NTPD simulator], ac_cv_var_ntpd_sim,
3751[AC_ARG_ENABLE(simulator,
3752 AC_HELP_STRING([--enable-simulator], [- build/install the NTPD simulator?]),
3753 [ans=$enableval], [ans=no])
3754ac_cv_var_ntpd_sim=$ans])
3755case "$ac_cv_var_ntpd_sim" in
3817 yes)
3818 MAKE_NTPDSIM=ntpdsim
3819 MAKE_LIBNTPSIM=libntpsim.a
3820 ;;
3756 yes)
3757 MAKE_NTPDSIM=ntpdsim
3758 MAKE_LIBNTPSIM=libntpsim.a
3759 ;;
3821 *)
3822 NTPDSIM_DB=
3823 NTPDSIM_DL=
3824 NTPDSIM_DS=
3825 NTPDSIM_MS=
3826 ;;
3827esac
3828
3829case "$build" in
3830 $host)
3831 ;;
3832 *) case "$host" in
3833 *-*-vxworks*)
3760esac
3761
3762case "$build" in
3763 $host)
3764 ;;
3765 *) case "$host" in
3766 *-*-vxworks*)
3834 LDFLAGS="$LDFLAGS -r"
3835 ;;
3767 LDFLAGS="$LDFLAGS -r"
3768 ;;
3836 esac
3837 ;;
3838esac
3839
3769 esac
3770 ;;
3771esac
3772
3840NTP_WITHSNTP
3841
3842AC_MSG_CHECKING([if we want to build ntpsnmpd])
3843AC_ARG_WITH(
3844 [ntpsnmpd],
3845 [AS_HELP_STRING(
3846 [--with-ntpsnmpd],
3847 [s Build ntpsnmpd MIB agent?]
3848 )],
3849 [ans=$withval],
3850 [
3851 case "$PATH_NET_SNMP_CONFIG" in
3852 /*) ans=yes ;;
3853 *) ans=no ;;
3854 esac
3855 ]
3856)
3857AC_MSG_RESULT([$ans])
3858case "$ans" in
3859 yes)
3860 case "$PATH_NET_SNMP_CONFIG" in
3861 /*)
3862 SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
3863 # Bug 2815. This is a bit of a hack, but it works...
3864 case "$ntp_cv_net_snmp_version" in
3865 5.3*) SNMP_LIBS=`echo $SNMP_LIBS | $SED -e 's/-lnetsnmpagent/-lnetsnmpagent -lnetsnmpmibs/'`
3866 ;;
3867 esac
3868 AC_SUBST([SNMP_LIBS])
3869 # HMS: we really want to separate CPPFLAGS and CFLAGS
3870 foo=`$PATH_NET_SNMP_CONFIG --cflags`
3871 SNMP_CPPFLAGS=
3872 SNMP_CFLAGS=
3873 for i in $foo; do
3874 case "$i" in
3875 -D*|-U*|-I*)
3876 SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
3877 ;;
3878 *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
3879 ;;
3880 esac
3881 done
3882 AC_SUBST([SNMP_CPPFLAGS])
3883 AC_SUBST([SNMP_CFLAGS])
3884
3885 save_CFLAGS=$CFLAGS
3886 save_CPPFLAGS=$CPPFLAGS
3887 save_LIBS=$LIBS
3888 CFLAGS=$SNMP_CFLAGS
3889 CPPFLAGS=$SNMP_CPPFLAGS
3890
3891 AC_CHECK_HEADER(
3892 [net-snmp/net-snmp-config.h],
3893 [MAKE_NTPSNMPD=ntpsnmpd],
3894 [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
3895 )
3896
3897 # Do this last, as we're messing up LIBS.
3898 # check -lnetsnmp for netsnmp_daemonize
3899 LIBS=`$PATH_NET_SNMP_CONFIG --libs`
3900 AC_CHECK_LIB(
3901 [netsnmp],
3902 [netsnmp_daemonize],
3903 [ans=yes],
3904 [ans=no]
3905 )
3906 case "$ans" in
3907 no)
3908 AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
3909 [We need to provide netsnmp_daemonize()])
3910 esac
3911
3912 CFLAGS=$save_CFLAGS
3913 AS_UNSET([save_CFLAGS])
3914 CPPFLAGS=$save_CPPFLAGS
3915 AS_UNSET([save_CPPFLAGS])
3916 LIBS=$save_LIBS
3917 AS_UNSET([save_LIBS])
3918 ;;
3919 *)
3920 AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
3921 ;;
3922 esac
3923 ;;
3773AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3774[AC_ARG_ENABLE(slew-always,
3775 AC_HELP_STRING([--enable-slew-always], [s always slew the time]),
3776 [ans=$enableval],
3777 [case "$host" in
3778 *-apple-aux[[23]]*)
3779 ans=yes
3780 ;;
3781 *-*-bsdi[[012]]*)
3782 ans=no
3783 ;;
3784 *-*-bsdi*)
3785 ans=yes
3786 ;;
3787 *-*-openvms*) # HMS: won't be found
3788 ans=yes
3789 ;;
3790 *) ans=no
3791 ;;
3792 esac
3793 ])
3794ac_cv_var_slew_always=$ans])
3795case "$ac_cv_var_slew_always" in
3796 yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
3924esac
3797esac
3925AC_SUBST([MAKE_NTPSNMPD])
3926
3798
3927case "$MAKE_NTPSNMPD" in
3928 '')
3929 NTPSNMPD_DB=
3930 NTPSNMPD_DL=
3931 NTPSNMPD_DS=
3932 NTPSNMPD_MS=
3933 ;;
3799AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3800[AC_ARG_ENABLE(step-slew,
3801 AC_HELP_STRING([--enable-step-slew], [s step and slew the time]),
3802 [ans=$enableval],
3803 [case "$host" in
3804 *-sni-sysv*)
3805 ans=yes
3806 ;;
3807 *-univel-sysv*)
3808 ans=no
3809 ;;
3810 *-*-ptx*)
3811 ans=yes
3812 ;;
3813 *-*-solaris2.1[[0-9]]*)
3814 ans=no
3815 ;;
3816 *-*-solaris2.[[012]]*)
3817 ans=yes
3818 ;;
3819 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
3820 ans=yes
3821 ;;
3822 *) ans=no
3823 ;;
3824 esac
3825 ])
3826ac_cv_var_step_slew=$ans])
3827case "$ac_cv_var_step_slew" in
3828 yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
3934esac
3935
3829esac
3830
3936AC_MSG_CHECKING([if we should always slew the time])
3937
3938# target-specific defaults
3939
3940case "$host" in
3941 *-apple-aux[[23]]*)
3942 ans=yes
3943 ;;
3944 *-*-bsdi[[012]]*)
3945 ans=no
3946 ;;
3947 *-*-bsdi*)
3948 ans=yes
3949 ;;
3950 *-*-openvms*) # HMS: won't be found
3951 ans=yes
3952 ;;
3953 *) ans=no
3954 ;;
3831AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3832[AC_ARG_ENABLE(ntpdate-step,
3833 AC_HELP_STRING([--enable-ntpdate-step], [s if ntpdate should step the time]),
3834 [ans=$enableval],
3835 [case "$host" in
3836 *-apple-aux[[23]]*)
3837 ans=yes
3838 ;;
3839 *) ans=no
3840 ;;
3841 esac
3842 ])
3843ac_cv_var_ntpdate_step=$ans])
3844case "$ac_cv_var_ntpdate_step" in
3845 yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
3955esac
3956
3846esac
3847
3957# --enable-slew-always / --disable-slew-always overrides default
3958
3959AC_ARG_ENABLE(
3960 [slew-always],
3961 [AS_HELP_STRING(
3962 [--enable-slew-always],
3963 [s always slew the time]
3964 )],
3965 [ans=$enableval]
3966)
3967
3968AC_MSG_RESULT([$ans])
3969
3970case "$ans" in
3971 yes)
3972 AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
3848AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3849[AC_ARG_ENABLE(hourly-todr-sync,
3850 AC_HELP_STRING([--enable-hourly-todr-sync],
3851 [s if we should sync TODR hourly]),
3852 [ans=$enableval],
3853 [case "$host" in
3854 *-*-nextstep*)
3855 ans=yes
3856 ;;
3857 *-*-openvms*) # HMS: won't be found
3858 ans=yes
3859 ;;
3860 *) ans=no
3861 ;;
3862 esac])
3863ac_cv_var_sync_todr=$ans])
3864case "$ac_cv_var_sync_todr" in
3865 yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
3973esac
3974
3866esac
3867
3975AC_MSG_CHECKING([if we should step and slew the time])
3976
3977case "$host" in
3978 *-sni-sysv*)
3979 ans=yes
3980 ;;
3981 *-stratus-vos)
3982 ans=no
3983 ;;
3984 *-univel-sysv*)
3985 ans=no
3986 ;;
3987 *-*-ptx*)
3988 ans=yes
3989 ;;
3990 *-*-solaris2.1[[0-9]]*)
3991 ans=no
3992 ;;
3993 *-*-solaris2.[[012]]*)
3994 ans=yes
3995 ;;
3996 *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
3997 ans=yes
3998 ;;
3999 *) ans=no
4000 ;;
3868AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3869[AC_ARG_ENABLE(kernel-fll-bug,
3870 AC_HELP_STRING([--enable-kernel-fll-bug],
3871 [s if we should avoid a kernel FLL bug]),
3872 [ans=$enableval],
3873 [case "$host" in
3874 *-*-solaris2.6)
3875 unamev=`uname -v`
3876 case "$unamev" in
3877 Generic_105181-*)
3878 old_IFS="$IFS"
3879 IFS="-"
3880 set $unamev
3881 IFS="$old_IFS"
3882 if test "$2" -ge 17
3883 then
3884 # Generic_105181-17 and higher
3885 ans=no
3886 else
3887 ans=yes
3888 fi
3889 ;;
3890 *) ans=yes
3891 ;;
3892 esac
3893 ;;
3894 *-*-solaris2.7)
3895 unamev=`uname -v`
3896 case "$unamev" in
3897 Generic_106541-*)
3898 old_IFS="$IFS"
3899 IFS="-"
3900 set $unamev
3901 IFS="$old_IFS"
3902 if test "$2" -ge 07
3903 then
3904 # Generic_106541-07 and higher
3905 ans=no
3906 else
3907 ans=yes
3908 fi
3909 ;;
3910 *) ans=yes
3911 ;;
3912 esac
3913 ;;
3914 *) ans=no
3915 ;;
3916 esac
3917 ])
3918ac_cv_var_kernel_fll_bug=$ans])
3919case "$ac_cv_var_kernel_fll_bug" in
3920 yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
4001esac
4002
3921esac
3922
4003AC_ARG_ENABLE(
4004 [step-slew],
4005 [AS_HELP_STRING(
4006 [--enable-step-slew],
4007 [s step and slew the time]
4008 )],
4009 [ans=$enableval]
4010)
4011
4012AC_MSG_RESULT([$ans])
4013
4014case "$ans" in
4015 yes)
4016 AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
3923AC_CACHE_CHECK(if we should use the IRIG sawtooth filter, ac_cv_var_irig_sucks,
3924[AC_ARG_ENABLE(irig-sawtooth,
3925 AC_HELP_STRING([--enable-irig-sawtooth],
3926 [s if we should enable the IRIG sawtooth filter]),
3927 [ans=$enableval],
3928 [case "$host" in
3929 *-*-solaris2.[[89]])
3930 ans=yes
3931 ;;
3932 *-*-solaris2.1[[0-9]]*)
3933 ans=yes
3934 ;;
3935 *) ans=no
3936 ;;
3937 esac
3938 ])
3939ac_cv_var_irig_sucks=$ans])
3940case "$ac_cv_var_irig_sucks" in
3941 yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
4017esac
4018
3942esac
3943
4019AC_MSG_CHECKING([if ntpdate should step the time])
4020
4021case "$host" in
4022 *-apple-aux[[23]]*)
4023 ans=yes
4024 ;;
4025 *) ans=no
4026 ;;
3944AC_CACHE_CHECK(if we should enable NIST lockclock scheme, ac_cv_var_nist_lockclock,
3945[AC_ARG_ENABLE(nist,
3946 AC_HELP_STRING([--enable-nist],
3947 [- if we should enable the NIST lockclock scheme]),
3948 [ans=$enableval],[ans=no])
3949ac_cv_var_nist_lockclock=$ans])
3950case "$ac_cv_var_nist_lockclock" in
3951 yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
4027esac
4028
3952esac
3953
4029AC_ARG_ENABLE(
4030 [ntpdate-step],
4031 [AS_HELP_STRING(
4032 [--enable-ntpdate-step],
4033 [s if ntpdate should step the time]
4034 )],
4035 [ans=$enableval]
4036)
3954#
3955# ISC stuff
3956#
4037
3957
4038AC_MSG_RESULT([$ans])
3958if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
3959 AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[ISC: struct sockaddr as sa_len?])
3960fi
4039
3961
4040case "$ans" in
4041 yes)
4042 AC_DEFINE([FORCE_NTPDATE_STEP], [1],
4043 [force ntpdate to step the clock if !defined(STEP_SLEW) ?])
4044esac
3962AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [s use IPv6?]))
4045
3963
4046
4047AC_MSG_CHECKING([if we should sync TODR clock every hour])
4048
4049case "$host" in
4050 *-*-nextstep*)
4051 ans=yes
4052 ;;
4053 *-*-openvms*) # HMS: won't be found
4054 ans=yes
4055 ;;
4056 *)
4057 ans=no
4058 ;;
4059esac
4060
4061AC_ARG_ENABLE(
4062 [hourly-todr-sync],
4063 [AS_HELP_STRING(
4064 [--enable-hourly-todr-sync],
4065 [s if we should sync TODR hourly]
4066 )],
4067 [ans=$enableval]
4068)
4069
4070AC_MSG_RESULT([$ans])
4071
4072case "$ac_cv_var_sync_todr" in
4073 yes)
4074 AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
4075esac
4076
4077
4078AC_MSG_CHECKING([if we should avoid kernel FLL bug])
4079
4080case "$host" in
4081 *-*-solaris2.6)
4082 unamev=`uname -v`
4083 case "$unamev" in
4084 Generic_105181-*)
4085 old_IFS="$IFS"
4086 IFS="-"
4087 set $unamev
4088 IFS="$old_IFS"
4089 if test "$2" -ge 17
4090 then
4091 # Generic_105181-17 and higher
4092 ans=no
4093 else
4094 ans=yes
4095 fi
4096 ;;
3964case "$enable_ipv6" in
3965 yes|''|autodetect)
3966 case "$host" in
3967 powerpc-ibm-aix4*) ;;
4097 *)
3968 *)
4098 ans=yes
3969 AC_DEFINE(WANT_IPV6, ,[ISC: Want IPv6?])
4099 ;;
4100 esac
4101 ;;
3970 ;;
3971 esac
3972 ;;
4102 *-*-solaris2.7)
4103 unamev=`uname -v`
4104 case "$unamev" in
4105 Generic_106541-*)
4106 old_IFS="$IFS"
4107 IFS="-"
4108 set $unamev
4109 IFS="$old_IFS"
4110 if test "$2" -ge 07
4111 then
4112 # Generic_106541-07 and higher
4113 ans=no
4114 else
4115 ans=yes
4116 fi
4117 ;;
4118 *)
4119 ans=yes
4120 ;;
4121 esac
3973 no)
4122 ;;
3974 ;;
4123 *)
4124 ans=no
4125 ;;
4126esac
4127
3975esac
3976
4128AC_ARG_ENABLE(
4129 [kernel-fll-bug],
4130 [AS_HELP_STRING(
4131 [--enable-kernel-fll-bug],
4132 [s if we should avoid a kernel FLL bug]
4133 )],
4134 [ans=$enableval]
4135)
3977AC_MSG_CHECKING(for IPv6 structures)
3978AC_TRY_COMPILE([
3979#include <sys/types.h>
3980#include <sys/socket.h>
3981#include <netinet/in.h>],
3982[struct sockaddr_in6 sin6; return (0);],
3983 [AC_MSG_RESULT(yes)
3984 found_ipv6=yes],
3985 [AC_MSG_RESULT(no)
3986 found_ipv6=no])
4136
3987
4137AC_MSG_RESULT([$ans])
3988#
3989# See whether IPv6 support is provided via a Kame add-on.
3990# This is done before other IPv6 linking tests so LIBS is properly set.
3991#
3992AC_MSG_CHECKING(for Kame IPv6 support)
3993AC_ARG_WITH(kame,
3994 AC_HELP_STRING([--with-kame], [- =/usr/local/v6]),
3995 use_kame="$withval", use_kame="no")
4138
3996
4139case "$ans" in
4140 yes)
4141 AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
3997case "$use_kame" in
3998 no)
3999 ;;
4000 yes)
4001 kame_path=/usr/local/v6
4002 ;;
4003 *)
4004 kame_path="$use_kame"
4005 ;;
4142esac
4143
4006esac
4007
4008case "$use_kame" in
4009 no)
4010 AC_MSG_RESULT(no)
4011 ;;
4012 *)
4013 if test -f $kame_path/lib/libinet6.a; then
4014 AC_MSG_RESULT($kame_path/lib/libinet6.a)
4015 LIBS="-L$kame_path/lib -linet6 $LIBS"
4016 else
4017 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
4144
4018
4145AC_MSG_CHECKING([if we want new session key behavior])
4146AC_ARG_ENABLE(
4147 [bug1243-fix],
4148 [AS_HELP_STRING(
4149 [--enable-bug1243-fix],
4150 [+ use unmodified autokey session keys]
4151 )],
4152 [ans=$enableval],
4153 [ans=yes]
4154)
4155AC_MSG_RESULT([$ans])
4156case "$ans" in
4157 no)
4158 AC_DEFINE([DISABLE_BUG1243_FIX], [1],
4159 [use old autokey session key behavior?])
4160esac
4019Please choose the proper path with the following command:
4161
4020
4162
4163AC_MSG_CHECKING([if we want the explicit 127.0.0.0/8 martian filter])
4164AC_ARG_ENABLE(
4165 [bug3020-fix],
4166 [AS_HELP_STRING(
4167 [--enable-bug3020-fix],
4168 [+ Provide the explicit 127.0.0.0/8 martian filter]
4169 )],
4170 [ans=$enableval],
4171 [ans=yes]
4172)
4173AC_MSG_RESULT([$ans])
4174case "$ans" in
4175 yes)
4176 AC_DEFINE([ENABLE_BUG3020_FIX], [1],
4177 [Provide the explicit 127.0.0.0/8 martian filter?])
4021 configure --with-kame=PATH
4022])
4023 fi
4024 ;;
4178esac
4179
4025esac
4026
4180
4181AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
4182
4027#
4028# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
4029# Including it on Kame-using platforms is very bad, though, because
4030# Kame uses #error against direct inclusion. So include it on only
4031# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
4032# This is done before the in6_pktinfo check because that's what
4033# netinet6/in6.h is needed for.
4034#
4183case "$host" in
4035case "$host" in
4184 *-*-solaris2.[[89]])
4185 ans=yes
4186 ;;
4187 *-*-solaris2.1[[0-9]]*)
4188 ans=yes
4189 ;;
4190 *) ans=no
4191 ;;
4036*-bsdi4.[[01]]*)
4037 ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
4038 LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
4039 isc_netinet6in6_hack="#include <netinet6/in6.h>"
4040 ;;
4041*)
4042 ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
4043 LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
4044 isc_netinet6in6_hack=""
4045 ;;
4192esac
4193
4046esac
4047
4194AC_ARG_ENABLE(
4195 [irig-sawtooth],
4196 [AS_HELP_STRING(
4197 [--enable-irig-sawtooth],
4198 [s if we should enable the IRIG sawtooth filter]
4199 )],
4200 [ans=$enableval]
4201)
4202
4203AC_MSG_RESULT([$ans])
4204
4205case "$ans" in
4206 yes)
4207 AC_DEFINE([IRIG_SUCKS], [1],
4208 [Should we use the IRIG sawtooth filter?])
4048#
4049# This is similar to the netinet6/in6.h issue.
4050#
4051case "$host" in
4052*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
4053 # UnixWare
4054 # ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
4055 # LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
4056 AC_DEFINE(ISC_PLATFORM_FIXIN6ISADDR, 1,[Do we need to fix in6isaddr?])
4057 isc_netinetin6_hack="#include <netinet/in6.h>"
4058 ;;
4059*)
4060 # ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
4061 # LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
4062 # ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
4063 isc_netinetin6_hack=""
4064 ;;
4209esac
4210
4065esac
4066
4211AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
4212AC_ARG_ENABLE(
4213 [nist],
4214 [AS_HELP_STRING(
4215 [--enable-nist],
4216 [- if we should enable the NIST lockclock scheme]
4217 )],
4218 [ans=$enableval],
4219 [ans=no]
4220)
4221
4067
4222AC_MSG_RESULT([$ans])
4068AC_MSG_CHECKING([for struct if_laddrconf])
4069AC_TRY_LINK([
4070#include <sys/types.h>
4071#include <net/if6.h>
4072],[ struct if_laddrconf a; ],
4073 [AC_MSG_RESULT(yes)
4074 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, ,
4075 [ISC: have struct if_laddrconf?])],
4076 [AC_MSG_RESULT(no)])
4223
4077
4224case "$ans" in
4078AC_MSG_CHECKING([for struct if_laddrreq])
4079AC_TRY_LINK([
4080#include <sys/types.h>
4081#include <net/if6.h>
4082],[ struct if_laddrreq a; ],
4083 [AC_MSG_RESULT(yes)
4084 AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, ,
4085 [ISC: have struct if_laddrreq?])],
4086 [AC_MSG_RESULT(no)])
4087
4088case "$found_ipv6" in
4225 yes)
4089 yes)
4226 AC_DEFINE([LOCKCLOCK], [1],
4227 [Should we align with the NIST lockclock scheme?]) ;;
4228esac
4090 AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[ISC: Have IPv6?])
4229
4091
4230AC_MSG_CHECKING([if we want support for Samba's signing daemon])
4231AC_ARG_ENABLE(
4232 [ntp-signd],
4233 [AS_HELP_STRING(
4234 [--enable-ntp-signd],
4235 [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
4236 )],
4237 [ans=$enableval],
4238 [ans=no]
4239)
4092 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , ,
4093[
4094#include <sys/types.h>
4095#include <sys/socket.h>
4096#include <netinet/in.h>
4097$isc_netinetin6_hack
4098$isc_netinet6in6_hack
4099])
4240
4100
4241AC_MSG_RESULT([$ans])
4101 AC_MSG_CHECKING(for in6_pktinfo)
4102 AC_TRY_COMPILE([
4103#include <sys/types.h>
4104#include <sys/socket.h>
4105#include <netinet/in.h>
4106$isc_netinetin6_hack
4107$isc_netinet6in6_hack
4108],
4109 [struct in6_pktinfo xyzzy; return (0);],
4110 [AC_MSG_RESULT(yes)
4111 AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, ,
4112 [ISC: Have struct in6_pktinfo?])],
4113 [AC_MSG_RESULT(no -- disabling runtime ipv6 support)])
4242
4114
4243case "$ans" in
4244 no)
4245 ntp_signd_path=
4246 ;;
4247 yes)
4248 ntp_signd_path=/var/run/ntp_signd
4249 ;;
4250 *)
4251 ntp_signd_path="$ans"
4252esac
4115 # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
4116 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
4117 AC_TRY_COMPILE([
4118#include <sys/types.h>
4119#include <sys/socket.h>
4120#include <netinet/in.h>
4121$isc_netinetin6_hack
4122$isc_netinet6in6_hack
4123],
4124 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
4125 [AC_MSG_RESULT(yes)
4126 AC_DEFINE(ISC_PLATFORM_HAVESCOPEID, ,
4127 [ISC: Have sin6_scope_id?])],
4128 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
4129 [AC_MSG_RESULT(no)
4130 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
4131 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
4132 LWRES_HAVE_SIN6_SCOPE_ID="$result"
4253
4133
4254case "$ntp_signd_path" in
4255 '')
4256 ;;
4134 ;;
4257 *)
4258 AC_DEFINE([HAVE_NTP_SIGND], [1],
4259 [Do we want support for Samba's signing daemon?])
4260 AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
4261 [Path to sign daemon rendezvous socket])
4262 ;;
4263esac
4264
4135esac
4136
4265AC_CHECK_HEADERS([libscf.h])
4266LSCF=
4267case "$ac_cv_header_libscf_h" in
4268 yes)
4269 LSCF='-lscf'
4270esac
4271AC_SUBST([LSCF])
4137# We need this check run all the time...
4138AC_MSG_CHECKING(for in6addr_any)
4139AC_TRY_LINK([
4140#include <sys/types.h>
4141#include <sys/socket.h>
4142#include <netinet/in.h>
4143$isc_netinetin6_hack
4144$isc_netinet6in6_hack
4145$isc_in_addr6_hack
4146],
4147 [[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);]],
4148 [AC_MSG_RESULT(yes)],
4149 [AC_MSG_RESULT(no)
4150 AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, ,
4151 [ISC: Need in6addr_any?])]
4152)
4272
4153
4273NTP_IPV6
4274
4275
4276#
4277# Look for a sysctl call to get the list of network interfaces.
4278#
4154#
4155# Look for a sysctl call to get the list of network interfaces.
4156#
4279AC_CACHE_CHECK(
4280 [for interface list sysctl],
4281 [ntp_cv_iflist_sysctl],
4282 [AC_PREPROC_IFELSE(
4283 [AC_LANG_SOURCE([
4284 #include <sys/param.h>
4285 #include <sys/sysctl.h>
4286 #include <sys/socket.h>
4287 #ifndef NET_RT_IFLIST
4288 # error
4289 #endif
4290 ])],
4291 [ntp_cv_iflist_sysctl=yes],
4292 [ntp_cv_iflist_sysctl=no]
4293 )]
4294)
4295case "$ntp_cv_iflist_sysctl" in
4296 yes)
4297 AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
4298esac
4157AC_MSG_CHECKING(for interface list sysctl)
4158AC_EGREP_CPP(found_rt_iflist, [
4159#include <sys/param.h>
4160#include <sys/sysctl.h>
4161#include <sys/socket.h>
4162#ifdef NET_RT_IFLIST
4163found_rt_iflist
4164#endif
4165],
4166 [AC_MSG_RESULT(yes)
4167 AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[ISC: Use iflist_sysctl?])],
4168 [AC_MSG_RESULT(no)])
4299
4300###
4301
4169
4170###
4171
4302AC_MSG_CHECKING([if we want the saveconfig mechanism])
4303AC_ARG_ENABLE(
4304 [saveconfig],
4305 [AS_HELP_STRING(
4306 [--enable-saveconfig],
4307 [+ saveconfig mechanism]
4308 )],
4309 [ntp_ok=$enableval],
4310 [ntp_ok=yes]
4311)
4312ntp_saveconfig_enabled=0
4313case "$ntp_ok" in
4314 yes)
4315 ntp_saveconfig_enabled=1
4316 AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
4317 ;;
4318esac
4319AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
4320AC_MSG_RESULT([$ntp_ok])
4172AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
4321
4173
4322###
4174AC_CONFIG_FILES(Makefile)
4175AC_CONFIG_FILES(ElectricFence/Makefile)
4176AC_CONFIG_FILES(adjtimed/Makefile)
4177AC_CONFIG_FILES(clockstuff/Makefile)
4178AC_CONFIG_FILES(include/Makefile)
4179AC_CONFIG_FILES(include/isc/Makefile)
4180AC_CONFIG_FILES(kernel/Makefile)
4181AC_CONFIG_FILES(kernel/sys/Makefile)
4182AC_CONFIG_FILES(libntp/Makefile)
4183AC_CONFIG_FILES(libparse/Makefile)
4184AC_CONFIG_FILES(ntpd/Makefile)
4185AC_CONFIG_FILES(ntpdate/Makefile)
4186AC_CONFIG_FILES(ntpdc/Makefile)
4187AC_CONFIG_FILES(ntpdc/nl.pl, [chmod +x ntpdc/nl.pl])
4188AC_CONFIG_FILES(ntpq/Makefile)
4189AC_CONFIG_FILES(parseutil/Makefile)
4190AC_CONFIG_FILES(scripts/Makefile)
4191AC_CONFIG_FILES(scripts/calc_tickadj, [chmod +x scripts/calc_tickadj])
4192AC_CONFIG_FILES(scripts/checktime, [chmod +x scripts/checktime])
4193AC_CONFIG_FILES(scripts/freq_adj, [chmod +x scripts/freq_adj])
4194AC_CONFIG_FILES(scripts/html2man, [chmod +x scripts/html2man])
4195AC_CONFIG_FILES(scripts/mkver, [chmod +x scripts/mkver])
4196AC_CONFIG_FILES(scripts/ntp-wait, [chmod +x scripts/ntp-wait])
4197AC_CONFIG_FILES(scripts/ntpsweep, [chmod +x scripts/ntpsweep])
4198AC_CONFIG_FILES(scripts/ntptrace, [chmod +x scripts/ntptrace])
4199AC_CONFIG_FILES(scripts/ntpver, [chmod +x scripts/ntpver])
4200AC_CONFIG_FILES(scripts/plot_summary, [chmod +x scripts/plot_summary])
4201AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary])
4202AC_CONFIG_FILES(util/Makefile)
4323
4203
4324AC_MSG_CHECKING([if we want the experimental leap smear code])
4325AC_ARG_ENABLE(
4326 [leap-smear],
4327 [AS_HELP_STRING(
4328 [--enable-leap-smear],
4329 [- experimental leap smear code]
4330 )],
4331 [ntp_ok=$enableval],
4332 [ntp_ok=no]
4333)
4334ntp_leap_smear_enabled=0
4335case "$ntp_ok" in
4336 yes)
4337 ntp_leap_smear_enabled=1
4338 AC_DEFINE([LEAP_SMEAR], [1], [leap smear mechanism])
4339 AC_SUBST([HAVE_LEAPSMEARINTERVAL])
4340 HAVE_LEAPSMEARINTERVAL="leapsmearinterval 0"
4341 ;;
4342esac
4343AC_MSG_RESULT([$ntp_ok])
4204AC_CONFIG_SUBDIRS(sntp)
4344
4205
4345###
4346
4347AC_MSG_CHECKING([if we want dynamic interleave support])
4348AC_ARG_ENABLE(
4349 [dynamic-interleave],
4350 [AS_HELP_STRING(
4351 [--enable-dynamic-interleave],
4352 [- dynamic interleave support]
4353 )],
4354 [ntp_ok=$enableval],
4355 [ntp_ok=no]
4356)
4357ntp_dynamic_interleave=0
4358case "$ntp_ok" in
4359 yes)
4360 ntp_dynamic_interleave=1
4361 ;;
4362esac
4363AC_DEFINE_UNQUOTED([DYNAMIC_INTERLEAVE], [$ntp_dynamic_interleave],
4364 [support dynamic interleave?])
4365AC_MSG_RESULT([$ntp_ok])
4366
4367NTP_UNITYBUILD
4368
4369dnl gtest is needed for our tests subdirs. It would be nice if we could
4370dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
4371dnl can't be conditionalized.
4372NTP_GOOGLETEST
4373
4374NTP_PROBLEM_TESTS
4375
4376###
4377
4378AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
4379 [Default location of crypto key info])
4380
4381AC_CONFIG_FILES([Makefile])
4382AC_CONFIG_FILES([adjtimed/Makefile])
4383AC_CONFIG_FILES([clockstuff/Makefile])
4384AC_CONFIG_FILES([include/Makefile])
4385AC_CONFIG_FILES([include/isc/Makefile])
4386AC_CONFIG_FILES([kernel/Makefile])
4387AC_CONFIG_FILES([kernel/sys/Makefile])
4388AC_CONFIG_FILES([libntp/Makefile])
4389AC_CONFIG_FILES([libparse/Makefile])
4390AC_CONFIG_FILES([ntpd/Makefile])
4391AC_CONFIG_FILES([ntpd/complete.conf], [sed -e '/^rlimit$/d' -e '/^$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf])
4392AC_CONFIG_FILES([ntpdate/Makefile])
4393AC_CONFIG_FILES([ntpdc/Makefile])
4394AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
4395AC_CONFIG_FILES([ntpq/Makefile])
4396AC_CONFIG_FILES([ntpsnmpd/Makefile])
4397AC_CONFIG_FILES([parseutil/Makefile])
4398AC_CONFIG_FILES([scripts/Makefile])
4399AC_CONFIG_FILES([scripts/build/Makefile])
4400AC_CONFIG_FILES([scripts/build/genAuthors], [chmod +x scripts/build/genAuthors])
4401AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
4402AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
4403AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
4404AC_CONFIG_FILES([scripts/lib/Makefile])
4405AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
4406AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
4407AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
4408AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
4409AC_CONFIG_FILES([scripts/ntptrace/Makefile])
4410AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
4411AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
4412AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
4413AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
4414AC_CONFIG_FILES([scripts/update-leap/Makefile])
4415AC_CONFIG_FILES([scripts/update-leap/update-leap], [chmod +x scripts/update-leap/update-leap])
4416AC_CONFIG_FILES([tests/Makefile])
4417AC_CONFIG_FILES([tests/bug-2803/Makefile])
4418AC_CONFIG_FILES([tests/libntp/Makefile])
4419AC_CONFIG_FILES([tests/ntpd/Makefile])
4420AC_CONFIG_FILES([tests/ntpq/Makefile])
4421AC_CONFIG_FILES([tests/sandbox/Makefile])
4422AC_CONFIG_FILES([tests/sec-2853/Makefile])
4423AC_CONFIG_FILES([util/Makefile])
4424
4425perllibdir="${datadir}/ntp/lib"
4426AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
4427
4428calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
4429AC_SUBST_FILE([calc_tickadj_opts])
4430ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
4431AC_SUBST_FILE([ntp_wait_opts])
4432ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
4433AC_SUBST_FILE([ntpsweep_opts])
4434ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
4435AC_SUBST_FILE([ntptrace_opts])
4436summary_opts="$srcdir/scripts/summary-opts"
4437AC_SUBST_FILE([summary_opts])
4438plot_summary_opts="$srcdir/scripts/plot_summary-opts"
4439AC_SUBST_FILE([plot_summary_opts])
4440
4441AC_CONFIG_SUBDIRS([sntp])
4442
4443AC_OUTPUT
4206AC_OUTPUT