~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-10-11 16:10:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011161027-icyjbji8ujym633o
Tags: 1:4.2.0a-10ubuntu2
Use ntp.ubuntulinux.org instead of pool.ntp.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl -*-fundamental-*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
 
AC_INIT(ntpd/ntp_refclock.c)
4
 
AC_CANONICAL_SYSTEM
5
 
AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target")
 
3
m4_include([version.m4])
 
4
AC_INIT(ntp, VERSION_NUMBER)
 
5
AM_INIT_AUTOMAKE
 
6
AC_CANONICAL_HOST
 
7
AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) string])
6
8
AM_CONFIG_HEADER(config.h)
7
 
AC_ARG_PROGRAM
8
 
AM_INIT_AUTOMAKE(ntp, 4.1.0)
9
 
AC_PREREQ(2.49)
 
9
dnl AC_ARG_PROGRAM
 
10
AC_PREREQ(2.53)
10
11
 
 
12
ac_cv_var_atom_ok=no
11
13
ac_cv_var_oncore_ok=no
12
 
ac_cv_var_atom_ok=no
 
14
ac_cv_var_ripe_ncc_ok=no
 
15
ac_cv_var_jupiter_ok=no
13
16
 
14
17
dnl Grab any initial CFLAGS so we can pick better defaults.
15
18
iCFLAGS="$CFLAGS"
16
19
 
 
20
dnl check these early to avoid autoconf warnings
 
21
AC_AIX
 
22
AC_MINIX
 
23
 
17
24
dnl  we need to check for cross compile tools for vxWorks here
18
25
AC_PROG_CC
19
26
AC_PROG_CC_STDC
20
27
AC_PROG_CPP
21
28
 
22
 
case "$target" in
 
29
case "$host" in
 
30
 *-*-amigaos)
 
31
    CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
 
32
    ;;
23
33
 *-pc-cygwin*)
24
34
    CFLAGS="$CFLAGS -DSYS_CYGWIN32"
25
35
    ;;
26
36
 i386-sequent-sysv4)
27
37
    case "$CC" in
28
38
     cc)
29
 
        CFLAGS="$CFLAGS -Wc,+Abi-socket"
30
 
        ;;
31
 
    esac
32
 
    ;;
33
 
 alpha*-dec-osf*)
34
 
    case "$CC" in
35
 
     cc)
36
 
        CFLAGS="$CFLAGS -std1"
37
 
        ;;
38
 
    esac
39
 
    ;;
40
 
esac
41
 
 
42
 
case "$host" in
43
 
 $target)
44
 
    ;;
45
 
 *) case "$target" in
 
39
        CFLAGS="$CFLAGS -Wc,+abi-socket"
 
40
        ;;
 
41
    esac
 
42
    ;;
 
43
 *-*-mpeix*)
 
44
    CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
 
45
    LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
 
46
    LIBS="$LIBS -lcurses"
 
47
    ;;
 
48
esac
 
49
 
 
50
AC_CACHE_CHECK(if we should use /dev/clockctl, ac_clockctl,
 
51
[AC_ARG_ENABLE(clockctl,
 
52
   AC_HELP_STRING([--enable-clockctl], [Use /dev/clockctl for non-root clock control]),
 
53
    [ans=$enableval],
 
54
    [case "$host" in
 
55
      *-*-netbsd*)
 
56
         ans=yes
 
57
         ;;
 
58
      *) ans=no
 
59
         ;;
 
60
     esac
 
61
     ])
 
62
ac_clockctl=$ans])
 
63
# End of AC_CACHE_CHECK for clockctl
 
64
AC_CHECK_HEADERS(sys/clockctl.h)
 
65
case "$ac_clockctl$ac_cv_header_sys_clockctl_h" in
 
66
 yesyes)
 
67
    AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
 
68
    ;;
 
69
esac
 
70
 
 
71
AC_CACHE_CHECK(if we have linux capabilities (libcap), ac_linuxcaps,
 
72
[AC_ARG_ENABLE(linuxcaps,
 
73
   AC_HELP_STRING([--enable-linuxcaps], [Use Linux capabilities for non-root clock control]),
 
74
    [ans=$enableval],
 
75
    [ans=no])
 
76
ac_linuxcaps=$ans])
 
77
# End of AC_CACHE_CHECK for linuxcaps
 
78
AC_CHECK_HEADERS(sys/capability.h)
 
79
AC_CHECK_HEADERS(sys/prctl.h)
 
80
case "$ac_linuxcaps$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
 
81
 yesyesyes)
 
82
    AC_DEFINE(HAVE_LINUX_CAPABILITIES, ,[Do we have Linux capabilities?])
 
83
    AC_DEFINE(HAVE_DROPROOT, ,[Can we drop root privileges?])
 
84
    LIBS="$LIBS -lcap"
 
85
    ;;
 
86
esac
 
87
 
 
88
 
 
89
case "$build" in
 
90
 $host)
 
91
    ;;
 
92
 *) case "$host" in
46
93
     *-*-vxworks*)
47
94
        # Quick and dirty sanity check
48
95
        case "$VX_KERNEL" in
75
122
    # CFLAGS="$CFLAGS -Wtraditional"
76
123
    # CFLAGS="$CFLAGS -Wwrite-strings"
77
124
 
78
 
    AC_CACHE_CHECK(whether ${CC-cc} -pipe works, ac_cv_prog_cc_pipe,
79
 
    [echo 'void f(){}' > conftest.c
80
 
    if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`" -a -s conftest.o; then
81
 
      ac_cv_prog_cc_pipe=yes
82
 
    else
83
 
      ac_cv_prog_cc_pipe=no
84
 
    fi
85
 
    rm -f conftest*
86
 
    ])
87
 
 
88
 
    case "$ac_cv_prog_cc_pipe" in
89
 
     yes)
90
 
        CFLAGS="$CFLAGS -pipe"
91
 
        ;;
92
 
    esac
93
125
    ;;
94
126
esac
95
127
 
96
128
ac_busted_vpath_in_make=no
97
129
 
98
 
case "$target" in
 
130
case "$host" in
99
131
 *-next-nextstep3)
100
132
    CFLAGS="$CFLAGS -posix"
101
133
    ;;
109
141
      case "$CFLAGS" in
110
142
       *-n32*) ;;
111
143
       *-n64*) ;;
 
144
       *-64*) ;;
112
145
       *) case "$iCFLAGS" in
113
146
           '') CFLAGS="-O2 -g3 -n32" ;;
114
147
           *)  CFLAGS="$CFLAGS -n32" ;;
118
151
      case "$LDFLAGS" in
119
152
       *-n32*) ;;
120
153
       *-n64*) ;;
 
154
       *-64*) ;;
121
155
       *) LDFLAGS="$LDFLAGS -n32" ;;
122
156
      esac
123
157
    fi
125
159
 *-*-solaris2.5.1)
126
160
    ac_busted_vpath_in_make=yes
127
161
    ;;
 
162
 *-*-unicosmp*)
 
163
    ac_busted_vpath_in_make=yes
 
164
    ;;
128
165
dnl This is currently commented out by bor. 
129
166
dnl The new versions of ReliantUNIX round adjtime() interval down
130
167
dnl to 1/100s (system tick). This makes tickadj actually useless.
157
194
 
158
195
AC_PROG_LN_S
159
196
AC_PROG_GCC_TRADITIONAL
160
 
AC_AIX
161
 
AC_MINIX
 
197
AC_C_VOLATILE
162
198
AC_ISC_POSIX
163
199
AC_PROG_RANLIB
164
200
AC_PATH_PROG(PATH_SH, sh)
166
202
 
167
203
hs_ULONG_CONST
168
204
 
169
 
case "$target" in
 
205
case "$host" in
170
206
 *-*-vxworks*)
171
207
    ac_link="$ac_link $VX_KERNEL"
172
208
    ;;
174
210
 
175
211
AC_PROG_INSTALL
176
212
 
177
 
case "$target" in
 
213
case "$host" in
178
214
 *-pc-cygwin*)
179
215
    AC_CHECK_LIB(advapi32, main)
180
216
    ;;
185
221
AC_CHECK_LIB(ld, nlist)
186
222
AC_CHECK_LIB(mld, nlist)
187
223
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket))
188
 
AC_CHECK_FUNC(openlog, , AC_CHECK_LIB(gen, openlog))
189
 
AC_CHECK_LIB(readline, readline)
 
224
AC_CHECK_FUNC(openlog, , 
 
225
  AC_CHECK_LIB(gen, openlog, , 
 
226
  AC_CHECK_LIB(syslog, openlog, , , -lsocket)))
 
227
AC_CHECK_LIB(md5, MD5Init, , 
 
228
  AC_CHECK_LIB(md, MD5Init))
 
229
AC_CHECK_FUNCS(MD5Init)
 
230
dnl HMS: What a hack...
 
231
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
 
232
case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
 
233
 *no*) ;;
 
234
 *) save_LIBS=$LIBS
 
235
    LIBS=
 
236
    AC_CHECK_LIB(readline, readline, ,
 
237
     AC_MSG_NOTICE([Trying again with -lcurses])
 
238
     unset ac_cv_lib_readline_readline
 
239
     AC_CHECK_LIB(readline, readline,
 
240
      LIBS="-lreadline -lcurses $LIBS"
 
241
      AC_DEFINE(HAVE_LIBREADLINE)
 
242
      AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
 
243
      AC_CHECK_LIB(edit, readline,
 
244
       LIBS="-ledit -lcurses"
 
245
       AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
 
246
       AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
 
247
       , , -lcurses)
 
248
      , -lcurses))
 
249
    READLINE_LIBS=$LIBS
 
250
    AC_SUBST(READLINE_LIBS)
 
251
    LIBS=$save_LIBS
 
252
    ;;
 
253
esac
190
254
 
191
255
dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
192
256
dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
194
258
dnl does Strange Things with extra processes using the Posix-compatibility
195
259
dnl real-time library, so we don't want to use it.
196
260
 
197
 
case "$target" in
 
261
case "$host" in
198
262
 *-*-linux*) ;;
199
263
 *)
200
264
    AC_CHECK_LIB(rt, sched_setscheduler, ,
205
269
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
206
270
 
207
271
AC_HEADER_STDC
208
 
AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h memory.h netdb.h)
209
 
AC_CHECK_HEADERS(poll.h resolv.h sched.h sgtty.h stdlib.h string.h termio.h)
210
 
AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h utmp.h utmpx.h)
211
 
AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in_systm.h netinet/in.h)
212
 
AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO)])
 
272
AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h)
 
273
# HMS: Lame, but fast.
 
274
if test -f /etc/redhat-release
 
275
then
 
276
    :
 
277
else
 
278
    AC_CHECK_HEADERS(md5.h)
 
279
fi
 
280
AC_CHECK_HEADERS(memory.h netdb.h poll.h)
 
281
AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
 
282
AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
 
283
case "$host" in
 
284
 *-*-aix*)
 
285
    AC_CHECK_HEADERS(utmpx.h)
 
286
    case "$ac_cv_header_utmpx_h" in
 
287
     yes) ;;
 
288
     *) AC_CHECK_HEADERS(utmp.h) ;;
 
289
    esac
 
290
    ;;
 
291
 *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
 
292
esac
 
293
AC_CHECK_HEADERS(arpa/nameser.h)
 
294
AC_CHECK_HEADERS(net/if.h, [], [],
 
295
[#if HAVE_SYS_SOCKET_H
 
296
#include <sys/socket.h>
 
297
#endif
 
298
])
 
299
AC_CHECK_HEADERS(net/if6.h)
 
300
AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
 
301
AC_CHECK_HEADERS(netinet/in.h)
 
302
AC_CHECK_HEADERS(netinet/ip.h, [], [],
 
303
[#if HAVE_SYS_TYPES_H
 
304
#include <sys/types.h>
 
305
#endif
 
306
#if HAVE_NETINET_IN_H
 
307
#include <netinet/in.h>
 
308
#endif
 
309
#if HAVE_NETINET_IN_SYSTM_H
 
310
#include <netinet/in_systm.h>
 
311
#endif
 
312
])
 
313
AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
213
314
AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
214
315
dnl AC_CHECK_HEADERS(sys/chudefs.h)
215
 
AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
216
 
case "$target" in
 
316
AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h sys/var.h)
 
317
case "$host" in
217
318
 *-*-sunos4*) ;;
218
319
 *) AC_CHECK_HEADERS(sys/ioctl.h)
219
320
    ;;
220
321
esac
 
322
AC_CHECK_HEADERS(sys/ipc.h)
221
323
AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
222
324
AC_CHECK_HEADERS(sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h)
223
 
case "$target" in
 
325
case "$host" in
224
326
 *-*-sco*)
225
327
    AC_CHECK_HEADERS(sys/sio.h)
226
328
    ;;
227
329
esac
228
 
AC_CHECK_HEADERS(sys/select.h sys/sockio.h sys/stat.h sys/stream.h)
229
 
AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/termios.h)
230
 
AC_CHECK_HEADERS(sys/time.h)
 
330
AC_CHECK_HEADERS(sys/select.h sys/shm.h sys/signal.h sys/sockio.h)
 
331
case "$host" in
 
332
 *-*-netbsd*) ;;
 
333
 *) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
 
334
    ;;
 
335
esac
 
336
AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
 
337
AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
 
338
AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
231
339
AC_EGREP_CPP(yes,
232
340
[#include <sys/timepps.h>
233
341
#ifdef PPS_API_VERS_1
234
342
yes
235
343
#endif
236
 
], AC_CHECK_HEADERS(sys/timepps.h))
 
344
], [AC_CHECK_HEADERS(sys/timepps.h)])
237
345
AC_CHECK_HEADERS(sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h)
238
346
AC_HEADER_TIME
239
 
case "$target" in
 
347
case "$host" in
240
348
*-convex-*)
241
349
  AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
242
350
  ;;
246
354
esac
247
355
 
248
356
AC_CHECK_HEADER(nlist.h,
249
 
[AC_DEFINE(NLIST_STRUCT)
 
357
[AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
250
358
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
251
359
[AC_TRY_COMPILE([#include <nlist.h>],
252
360
[struct nlist n; n.n_un.n_name = 0;],
253
361
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
254
362
if test $ac_cv_struct_nlist_n_un = yes; then
255
 
  AC_DEFINE(NLIST_NAME_UNION)
 
363
  AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
256
364
fi
257
365
])dnl
258
366
 
259
367
AC_CHECK_HEADER(libelf/nlist.h,
260
 
[AC_DEFINE(LIBELF_NLIST_STRUCT)
 
368
[AC_DEFINE(LIBELF_NLIST_STRUCT, 1, [nlist stuff])
261
369
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
262
 
[AC_TRY_COMPILE([#include <nlist.h>],
 
370
[AC_TRY_COMPILE([#include <libelf/nlist.h>],
263
371
[struct nlist n; n.n_un.n_name = 0;],
264
372
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
265
373
if test $ac_cv_struct_nlist_n_un = yes; then
266
 
  AC_DEFINE(NLIST_NAME_UNION)
 
374
  AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
267
375
fi
268
376
])dnl
269
377
 
 
378
dnl AC_CHECK_HEADERS(net/if.h, [], [],
 
379
dnl [#if HAVE_SYS_TYPES_H
 
380
dnl # include <sys/types.h>
 
381
dnl #endif
 
382
dnl #if HAVE_SYS_SOCKET_H
 
383
dnl # include <sys/socket.h>
 
384
dnl #endif
 
385
dnl ])
 
386
 
 
387
AC_CHECK_HEADERS(resolv.h, [], [],
 
388
[#if HAVE_SYS_TYPES_H
 
389
#include <sys/types.h>
 
390
#endif
 
391
#if HAVE_NETINET_IN_H
 
392
#include <netinet/in.h>
 
393
#endif
 
394
#if HAVE_ARPA_NAMESER_H
 
395
#include <arpa/nameser.h>
 
396
#endif
 
397
])
270
398
 
271
399
AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
272
400
[AC_TRY_COMPILE([],[
277
405
case "$ac_cv_c_volatile" in
278
406
 yes)
279
407
    ;;
280
 
 *) AC_DEFINE(volatile,)
 
408
 *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
281
409
    ;;
282
410
esac
283
411
 
284
 
case "$target" in
 
412
case "$host" in
285
413
 sparc-*-solaris2*)
286
414
    # Assume that solaris2 is Ansi C...
287
415
    ;;
296
424
int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
297
425
])
298
426
if test "$ac_cv_have_prototypes" = yes; then
299
 
  AC_DEFINE(HAVE_PROTOTYPES)
 
427
  AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
300
428
fi
301
429
 
302
430
AC_C_CONST
303
 
case "$host" in
304
 
 $target)
305
 
    AC_C_BIGENDIAN
306
 
    ;;
307
 
 *) case "$target" in
308
 
     i*86-*-vxworks*)
309
 
        # LITTLEENDIAN
310
 
        ;;
311
 
     *-*-vxworks*)
312
 
        AC_DEFINE(WORDS_BIGENDIAN)
313
 
        ;;
314
 
     *) AC_MSG_ERROR(Cross-compiling needs explicit byte order)
315
 
        ;;
316
 
    esac
317
 
    ;;
318
 
esac
 
431
AC_C_BIGENDIAN
319
432
AC_TYPE_SIGNAL
320
433
AC_TYPE_OFF_T
321
434
AC_TYPE_SIZE_T
322
435
AC_CHECK_TYPE(time_t, long)
323
436
AC_STRUCT_TM
324
437
 
 
438
AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
 
439
[AC_TRY_COMPILE([#include <sys/types.h>],
 
440
        [u_int8_t len = 42; return 0;],
 
441
        ac_cv_type_u_int8_t=yes,
 
442
        ac_cv_type_u_int8_t=no)
 
443
])
 
444
if test $ac_cv_type_u_int8_t = yes; then
 
445
        AC_DEFINE(HAVE_TYPE_U_INT8_T,1,Does u_int8_t exist)
 
446
fi
 
447
 
 
448
AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
 
449
[AC_TRY_COMPILE([#include <sys/types.h>],
 
450
        [u_int64_t len = 42; return 0;],
 
451
        ac_cv_type_u_int64_t=yes,
 
452
        ac_cv_type_u_int64_t=no)
 
453
])
 
454
if test $ac_cv_type_u_int64_t = yes; then
 
455
        AC_DEFINE(HAVE_TYPE_U_INT64_T,1,Does u_int64_t exist)
 
456
fi
 
457
 
325
458
AC_CACHE_CHECK(for a fallback value for HZ, ac_cv_var_default_hz,
326
459
[ac_cv_var_default_hz=100
327
 
case "$target" in
 
460
case "$host" in
328
461
 alpha*-dec-osf4*|alpha*-dec-osf5*)
329
462
    ac_cv_var_default_hz=1024
330
463
    ;;
332
465
    ac_cv_var_default_hz=256
333
466
    ;;
334
467
esac])
335
 
AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz)
 
468
AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
336
469
 
337
470
AC_CACHE_CHECK(if we need to override the system's value for HZ, ac_cv_var_override_hz,
338
471
[ac_cv_var_override_hz=no
339
 
case "$target" in
 
472
case "$host" in
340
473
 alpha*-dec-osf4*|alpha*-dec-osf5*)
341
474
    ac_cv_var_override_hz=yes
342
475
    ;;
352
485
esac])
353
486
case "$ac_cv_var_override_hz" in
354
487
 yes)
355
 
    AC_DEFINE(OVERRIDE_HZ)
 
488
    AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
356
489
    ;;
357
490
esac
358
491
 
391
524
  ]
392
525
)
393
526
if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
394
 
  AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION)
 
527
  AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
395
528
fi
396
529
 
397
530
AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
412
545
        ac_cv_struct_ppsclockev=no)
413
546
])
414
547
if test $ac_cv_struct_ppsclockev = yes; then
415
 
    AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV)
 
548
    AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
416
549
fi
417
550
 
418
551
AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
425
558
        ac_cv_struct_sockaddr_has_sa_len=no)
426
559
])
427
560
if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
428
 
    AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR)
429
 
fi
 
561
    AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
 
562
fi
 
563
 
 
564
AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage,
 
565
[AC_TRY_COMPILE([
 
566
#include <sys/types.h>
 
567
#include <sys/socket.h>
 
568
#include <netinet/in.h>
 
569
],[
 
570
extern struct sockaddr_storage *ss;
 
571
return 0;],
 
572
        ac_cv_struct_sockaddr_storage=yes,
 
573
        ac_cv_struct_sockaddr_storage=no)
 
574
])
 
575
if test $ac_cv_struct_sockaddr_storage = yes; then
 
576
    AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
 
577
fi
 
578
 
 
579
AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
 
580
                ac_cv_have_ss_family_in_struct_ss, [
 
581
        AC_TRY_COMPILE(
 
582
                [
 
583
#include <sys/types.h>
 
584
#include <sys/socket.h>
 
585
                ],
 
586
                [ struct sockaddr_storage s; s.ss_family = 1; ],
 
587
                [ ac_cv_have_ss_family_in_struct_ss="yes" ],
 
588
                [ ac_cv_have_ss_family_in_struct_ss="no" ],
 
589
        )
 
590
])
 
591
if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
 
592
        AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
 
593
else
 
594
    # Hack around a problem...
 
595
    case "$host" in
 
596
     *-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
 
597
        ;;
 
598
    esac
 
599
fi
 
600
 
 
601
AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
 
602
                ac_cv_have___ss_family_in_struct_ss, [
 
603
        AC_TRY_COMPILE(
 
604
                [
 
605
#include <sys/types.h>
 
606
#include <sys/socket.h>
 
607
                ],
 
608
                [ struct sockaddr_storage s; s.__ss_family = 1; ],
 
609
                [ ac_cv_have___ss_family_in_struct_ss="yes" ],
 
610
                [ ac_cv_have___ss_family_in_struct_ss="no" ]
 
611
        )
 
612
])
 
613
if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
 
614
        AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
 
615
fi
 
616
 
 
617
AH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
 
618
[/* Handle ss_family */
 
619
#if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
 
620
# define ss_family __ss_family
 
621
# define ss_len __ss_len
 
622
#endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
 
623
 
 
624
case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
 
625
  *yes*)
 
626
    AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
 
627
[AC_TRY_COMPILE([
 
628
#ifdef HAVE_MACHINE_SOUNDCARD_H
 
629
# include <machine/soundcard.h>
 
630
#endif
 
631
#ifdef HAVE_SYS_SOUNDCARD_H
 
632
# include <sys/soundcard.h>
 
633
#endif],[
 
634
extern struct snd_size *ss;
 
635
return ss->rec_size;],
 
636
    ac_cv_struct_snd_size=yes,
 
637
    ac_cv_struct_snd_size=no)
 
638
])
 
639
    case "$ac_cv_struct_snd_size" in
 
640
     yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
 
641
    esac
 
642
    ;;
 
643
esac
430
644
 
431
645
AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
432
646
[AC_TRY_COMPILE([
437
651
        ac_cv_struct_clockinfo_has_hz=no)
438
652
])
439
653
if test $ac_cv_struct_clockinfo_has_hz = yes; then
440
 
    AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO)
 
654
    AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
441
655
fi
442
656
 
443
657
AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
449
663
        ac_cv_struct_clockinfo_has_tickadj=no)
450
664
])
451
665
if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
452
 
    AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO)
 
666
    AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
453
667
fi
454
668
 
455
669
AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
497
711
 
498
712
AC_C_INLINE
499
713
AC_C_CHAR_UNSIGNED              dnl CROSS_COMPILE?
500
 
case "$host" in
501
 
 $target)
502
 
    AC_CHECK_SIZEOF(signed char)
503
 
    ;;
504
 
 *) case "$target" in
505
 
     *-*-vxworks*)
506
 
        AC_CHECK_SIZEOF(signed char, 1)
507
 
        ;;
508
 
     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_SIGNED_LONG)
509
 
        ;;
510
 
    esac
511
 
    ;;
512
 
esac
513
 
 
514
 
case "$host" in
515
 
 $target)
516
 
    AC_CHECK_SIZEOF(int)
517
 
    ;;
518
 
 *) case "$target" in
519
 
     *-*-vxworks*)
520
 
        AC_CHECK_SIZEOF(int, 4)
521
 
        ;;
522
 
     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_INT)
523
 
        ;;
524
 
    esac
525
 
    ;;
526
 
esac
527
 
 
528
 
case "$host" in
529
 
 $target)
530
 
    AC_CHECK_SIZEOF(long)
531
 
    ;;
532
 
 *) case "$target" in
533
 
     *-*-vxworks*)
534
 
        AC_CHECK_SIZEOF(long, 4)
535
 
        ;;
536
 
     *) AC_MSG_ERROR(Cross-compiling needs explicit SIZEOF_LONG)
537
 
        ;;
538
 
    esac
539
 
    ;;
540
 
esac
 
714
AC_CHECK_SIZEOF(signed char)
 
715
AC_CHECK_SIZEOF(int)
 
716
AC_CHECK_SIZEOF(long)
541
717
 
542
718
AC_CHECK_TYPES([s_char])
543
719
case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
546
722
    ;;
547
723
 no0no)
548
724
    # We have signed chars, can't say 'signed char', no s_char typedef.
549
 
    AC_DEFINE(NEED_S_CHAR_TYPEDEF)
 
725
    AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
550
726
    ;;
551
727
 no1no)
552
728
    # We have signed chars, can say 'signed char', no s_char typedef.
563
739
esac
564
740
AC_TYPE_UID_T
565
741
 
566
 
case "$target" in
 
742
case "$host" in
567
743
 *-*-linux*)
568
744
    AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
569
745
    ;;
570
746
esac
571
 
case "$target" in
572
 
 *-*-aix4*)
 
747
case "$host" in
 
748
 *-*-aix[[45]]*)
573
749
        # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
574
750
        # (returning ENOSYS).  I didn't check 4.2.  If, in the future,
575
751
        # IBM pulls its thumbs out long enough to implement clock_settime,
576
752
        # this conditional will need to change.  Maybe use AC_TRY_RUN
577
753
        # instead to try to set the time to itself and check errno.
578
754
    ;;
579
 
 *) AC_CHECK_FUNCS(clock_settime)
 
755
 *) AC_CHECK_FUNCS(clock_gettime clock_settime)
580
756
    ;;
581
757
esac
582
758
AC_CHECK_FUNCS(daemon)
590
766
      AC_DEFINE(HAVE_ISFINITE)],
591
767
      AC_MSG_RESULT(no))
592
768
    LIBS=$_libs])])
593
 
AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage gettimeofday)
594
 
case "$target" in
 
769
AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage)
 
770
AC_CHECK_FUNC(gettimeofday, ,[
 
771
case "$host" in
 
772
  *-*-mpeix*) ac_cv_func_gettimeofday=yes
 
773
    ;;
 
774
esac])
 
775
case "$host" in
595
776
 *-pc-cygwin*)
596
777
    ;;
597
778
 *) AC_CHECK_FUNCS(getuid)
598
779
    ;;
599
780
esac
600
 
AC_CHECK_FUNCS(hstrerror K_open kvm_open memcpy memmove memset)
601
 
case "$target" in
 
781
AC_CHECK_FUNCS(hstrerror)
 
782
AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
 
783
AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
 
784
case "$host" in
602
785
 *-*-sco3.2v5.0.*)
603
786
    # Just stubs.  Idiots.
604
787
    ;;
605
788
 *) AC_CHECK_FUNCS(mkstemp)
606
789
    ;;
607
790
esac
608
 
AC_REPLACE_FUNCS(mktime)
609
 
case "$target" in
610
 
 *-*-aix4*)
 
791
AC_CHECK_FUNCS(mktime)
 
792
case "$host" in
 
793
 *-*-aix[[45]]*)
611
794
    # Just a stub.  Idiots.
612
795
    ;;
613
 
 *-*-irix*)
614
 
    # Just stubs in Irix.  Idiots.
 
796
 *-*-irix[[45]]*)
 
797
    # Just a stub in "old" Irix.  Idiots.
 
798
    ;;
 
799
 *-*-qnx*)
 
800
    # Apparently there but not working in QNX.  Idiots?
615
801
    ;;
616
802
 *-*-sco3.2v5.0.*)
617
 
    # Just stubs.  Idiots.
 
803
    # Just a stub.  Idiots.
618
804
    ;;
619
805
 alpha*-dec-osf4*|alpha*-dec-osf5*)
620
806
    # mlockall is there, as a #define calling memlk via <sys/mman.h>
626
812
    ;;
627
813
esac
628
814
AC_CHECK_FUNCS(mrand48 srand48 nice nlist)
629
 
case "$target" in
 
815
case "$host" in
630
816
 *-*-solaris2.6)
631
817
    # Broken...
632
818
    ;;
638
824
 yes) ;;
639
825
 *) AC_REPLACE_FUNCS(random) ;;
640
826
esac
641
 
case "$target" in
642
 
 *-*-aix4*)
 
827
case "$host" in
 
828
 *-*-aix[[45]]*)
643
829
    # Just a stub in AIX 4.  Idiots.
644
830
    ;;
645
831
 *-*-solaris2.5*)
648
834
 *) AC_CHECK_FUNCS(sched_setscheduler)
649
835
    ;;
650
836
esac
651
 
AC_CHECK_FUNCS(setlinebuf)
652
 
AC_CHECK_FUNCS(setpgid setpriority setsid settimeofday setvbuf sigaction)
 
837
AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
 
838
AC_CHECK_FUNCS(setrlimit)
 
839
AC_CHECK_FUNCS(settimeofday, ,[
 
840
case "$host" in
 
841
  *-*-mpeix*) ac_cv_func_settimeofday=yes
 
842
    ;;
 
843
esac])
 
844
AC_CHECK_FUNCS(setvbuf sigaction)
653
845
AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
654
 
AC_REPLACE_FUNCS(snprintf strdup strerror)
655
 
case "$target" in
656
 
 *-*-aix4*)
657
 
    # Just stubs.  Idiots.
658
 
    ;;
659
 
 *-*-netbsd*)
 
846
AC_CHECK_FUNCS(snprintf strdup strerror strstr)
 
847
AC_CHECK_FUNCS(timegm)
 
848
case "$host" in
 
849
 *-*-aix[[45]]*)
 
850
    # Just stubs.  Idiots.
 
851
    ;;
 
852
 *-*-netbsd1*)
 
853
    # Just stubs.  Idiots.
 
854
    ;;
 
855
 *-*-netbsdelf1*)
660
856
    # Just stubs.  Idiots.
661
857
    ;;
662
858
 *-*-openbsd*)
665
861
 *) AC_CHECK_FUNCS(timer_create timer_settime)
666
862
    ;;
667
863
esac
668
 
case "$target" in
 
864
case "$host" in
669
865
 *-pc-cygwin*)
670
866
    # I have no idea...
671
867
    ;;
672
868
 *) AC_CHECK_FUNCS(umask)
673
869
    ;;
674
870
esac
675
 
AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
 
871
AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
 
872
 
 
873
case "$host" in
 
874
 *-*-sunos4*)
 
875
    AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
 
876
    ;;
 
877
esac
676
878
 
677
879
AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
678
880
[AC_TRY_COMPILE([#include <sys/time.h>],[
682
884
        ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
683
885
])
684
886
if test $ac_cv_func_Xettimeofday_nargs = 1; then
685
 
        AC_DEFINE(SYSV_TIMEOFDAY)
 
887
        AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
686
888
fi
687
889
 
688
890
AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
697
899
        ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
698
900
])
699
901
if test $ac_cv_func_setpgrp_nargs = 0; then
700
 
        AC_DEFINE(HAVE_SETPGRP_0)
 
902
        AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
701
903
fi
702
904
 
703
905
save_CFLAGS=$CFLAGS
726
928
])
727
929
case "$ac_cv_func_qsort_argtype" in
728
930
 void)
729
 
    AC_DEFINE(QSORT_USES_VOID_P)
 
931
    AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
730
932
    ;;
731
933
esac
732
934
 
739
941
  [errno = 0;],
740
942
  ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
741
943
case "$ac_cv_decl_errno" in
742
 
 yes) AC_DEFINE(DECL_ERRNO) ;;
 
944
 yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
743
945
esac
744
946
 
745
947
dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
767
969
  [extern int h_errno;],
768
970
  ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
769
971
case "$ac_cv_decl_h_errno" in
770
 
 yes) AC_DEFINE(DECL_H_ERRNO) ;;
 
972
 yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
771
973
esac
772
974
 
773
975
dnl See if char *sys_errlist[] is OK.
780
982
],
781
983
  ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
782
984
case "$ac_cv_decl_sys_errlist" in
783
 
 yes) AC_DEFINE(CHAR_SYS_ERRLIST) ;;
 
985
 yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
784
986
esac
785
987
 
786
988
AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
800
1002
  [extern int syscall P((int, ...));],
801
1003
  ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
802
1004
case "$ac_cv_decl_syscall" in
803
 
 yes) AC_DEFINE(DECL_SYSCALL) ;;
 
1005
 yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
804
1006
esac
805
1007
 
806
 
case "$target" in
 
1008
case "$host" in
807
1009
 *-*-aix4.3.*)
808
 
    AC_DEFINE(DECL_HSTRERROR_0)         # Needed for XLC under AIX 4.3.2
 
1010
    AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style])         # Needed for XLC under AIX 4.3.2
 
1011
    ;;
 
1012
 *-*-mpeix*)
 
1013
    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
 
1014
    AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
 
1015
    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
 
1016
    AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
 
1017
    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
 
1018
    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
 
1019
    AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
 
1020
    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
 
1021
    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
809
1022
    ;;
810
1023
 *-*-osf[[45]]*)
811
 
    AC_DEFINE(DECL_PLOCK_0)
812
 
    AC_DEFINE(DECL_STIME_1)
 
1024
    AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
 
1025
    AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
 
1026
    ;;
 
1027
 *-*-qnx*)
 
1028
    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
813
1029
    ;;
814
1030
 *-*-riscos4*)
815
 
    AC_DEFINE(DECL_ADJTIME_0)
816
 
    AC_DEFINE(DECL_BZERO_0)
817
 
    AC_DEFINE(DECL_IOCTL_0)
818
 
    AC_DEFINE(DECL_IPC_0)
819
 
    AC_DEFINE(DECL_MEMMOVE_0)
820
 
    AC_DEFINE(DECL_MKTEMP_0)
821
 
    AC_DEFINE(DECL_RENAME_0)
822
 
    AC_DEFINE(DECL_SELECT_0)
823
 
    AC_DEFINE(DECL_SETITIMER_0)
824
 
    AC_DEFINE(DECL_SETPRIORITY_0)
825
 
    AC_DEFINE(DECL_STDIO_0)
826
 
    AC_DEFINE(DECL_STRTOL_0)
827
 
    AC_DEFINE(DECL_SYSLOG_0)
828
 
    AC_DEFINE(DECL_TIME_0)
829
 
    AC_DEFINE(DECL_TIMEOFDAY_0)
830
 
    AC_DEFINE(DECL_TOLOWER_0)
 
1031
    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
 
1032
    AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
 
1033
    AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
 
1034
    AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
 
1035
    AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
 
1036
    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
 
1037
    AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
 
1038
    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
 
1039
    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
 
1040
    AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
 
1041
    AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
 
1042
    AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
 
1043
    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
 
1044
    AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
 
1045
    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
 
1046
    AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
831
1047
    ;;
832
1048
 *-*-solaris2*)
833
 
    AC_DEFINE(DECL_MKSTEMP_0)
834
 
    AC_DEFINE(DECL_SETPRIORITY_1)
835
 
    case "$target" in
 
1049
    AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
 
1050
    AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
 
1051
    case "$host" in
836
1052
     *-*-solaris2.4)
837
 
        AC_DEFINE(DECL_TIMEOFDAY_0)
 
1053
        AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
838
1054
        ;;
839
1055
    esac
840
1056
    ;;
841
1057
 *-*-sunos4*)
842
 
    AC_DEFINE(DECL_ADJTIME_0)
843
 
    AC_DEFINE(DECL_BCOPY_0)
844
 
    AC_DEFINE(DECL_BZERO_0)
845
 
    AC_DEFINE(DECL_IOCTL_0)
846
 
    AC_DEFINE(DECL_IPC_0)
847
 
    AC_DEFINE(DECL_MEMMOVE_0)
848
 
    AC_DEFINE(DECL_MKTEMP_0)
849
 
    AC_DEFINE(DECL_MKSTEMP_0)
850
 
    AC_DEFINE(DECL_MRAND48_0)
851
 
    AC_DEFINE(DECL_RENAME_0)
852
 
    AC_DEFINE(DECL_SELECT_0)
853
 
    AC_DEFINE(DECL_SETITIMER_0)
854
 
    AC_DEFINE(DECL_SETPRIORITY_0)
855
 
    AC_DEFINE(DECL_SIGVEC_0)
856
 
    AC_DEFINE(DECL_SRAND48_0)
 
1058
    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
 
1059
    AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
 
1060
    AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
 
1061
    AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
 
1062
    AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
 
1063
    AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
 
1064
    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
 
1065
    AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
 
1066
    AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
 
1067
    AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
 
1068
    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
 
1069
    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
 
1070
    AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
 
1071
    AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
 
1072
    AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
857
1073
    case "`basename $ac_cv_prog_CC`" in
858
1074
     acc*) ;;
859
 
     *) AC_DEFINE(DECL_STDIO_0)
 
1075
     *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
860
1076
        ;;
861
1077
    esac
862
 
    AC_DEFINE(DECL_STRTOL_0)
863
 
    AC_DEFINE(DECL_SYSLOG_0)
864
 
    AC_DEFINE(DECL_TIME_0)
865
 
    AC_DEFINE(DECL_TIMEOFDAY_0)
866
 
    AC_DEFINE(DECL_TOLOWER_0)
867
 
    AC_DEFINE(DECL_TOUPPER_0)
868
 
    AC_DEFINE(DECL_STRERROR_0)
 
1078
    AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
 
1079
    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
 
1080
    AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
 
1081
    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
 
1082
    AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
 
1083
    AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
 
1084
    AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
869
1085
    ;;
870
1086
 *-*-ultrix4*)
871
 
    AC_DEFINE(DECL_ADJTIME_0)
872
 
    AC_DEFINE(DECL_BZERO_0)
873
 
    AC_DEFINE(DECL_CFSETISPEED_0)
874
 
    AC_DEFINE(DECL_IOCTL_0)
875
 
    AC_DEFINE(DECL_IPC_0)
876
 
    AC_DEFINE(DECL_MKTEMP_0)
877
 
    AC_DEFINE(DECL_MRAND48_0)
878
 
    AC_DEFINE(DECL_NLIST_0)
879
 
    AC_DEFINE(DECL_PLOCK_0)
880
 
    AC_DEFINE(DECL_SELECT_0)
881
 
    AC_DEFINE(DECL_SETITIMER_0)
882
 
    AC_DEFINE(DECL_SETPRIORITY_0)
883
 
    AC_DEFINE(DECL_SRAND48_0)
884
 
    AC_DEFINE(DECL_STIME_0)
885
 
    AC_DEFINE(DECL_SYSLOG_0)
886
 
    AC_DEFINE(DECL_TIMEOFDAY_0)
 
1087
    AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
 
1088
    AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
 
1089
    AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
 
1090
    AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
 
1091
    AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
 
1092
    AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
 
1093
    AC_DEFINE(DECL_MRAND48_0, 1, [Declaration style])
 
1094
    AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
 
1095
    AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
 
1096
    AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
 
1097
    AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
 
1098
    AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
 
1099
    AC_DEFINE(DECL_SRAND48_0, 1, [Declaration style])
 
1100
    AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
 
1101
    AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
 
1102
    AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
887
1103
    ;;
888
1104
esac
889
1105
 
890
 
case "$target" in
 
1106
case "$host" in
891
1107
 *-*-sco3.2*)
892
 
    AC_DEFINE(TERMIOS_NEEDS__SVID3)
 
1108
    AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
893
1109
    ;;
894
1110
esac
895
1111
 
896
 
AC_CACHE_CHECK(if we should use a streams device for ifconfig,
897
 
 ac_cv_var_use_streams_device_for_ifconfig,
898
 
 ac_cv_var_use_streams_device_for_ifconfig=no)
899
 
 
900
1112
AC_CACHE_CHECK(if we need extra room for SO_RCVBUF, ac_cv_var_rcvbuf_slop,
901
1113
[ans=no
902
 
case "$target" in
 
1114
case "$host" in
903
1115
 *-*-hpux[[567]]*)
904
1116
    ans=yes
905
1117
    ;;
906
1118
esac
907
1119
ac_cv_var_rcvbuf_slop=$ans])
908
1120
case "$ac_cv_var_rcvbuf_slop" in
909
 
 yes) AC_DEFINE(NEED_RCVBUF_SLOP) ;;
 
1121
 yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
910
1122
esac
911
1123
 
912
1124
AC_CACHE_CHECK(if we will open the broadcast socket, ac_cv_var_open_bcast_socket,
913
1125
[ans=yes
914
 
case "$target" in
 
1126
case "$host" in
915
1127
 *-*-domainos)
916
1128
    ans=no
917
1129
    ;;
918
 
 *-*-linux*)
919
 
    ans=no
920
 
    ;;
921
1130
esac
922
1131
ac_cv_var_open_bcast_socket=$ans])
923
1132
case "$ac_cv_var_open_bcast_socket" in
924
 
 yes) AC_DEFINE(OPEN_BCAST_SOCKET) ;;
 
1133
 yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
925
1134
esac
926
1135
 
927
1136
AC_CACHE_CHECK(if we want the HPUX version of FindConfig(), ac_cv_var_hpux_findconfig,
928
1137
[ans=no
929
 
case "$target" in
 
1138
case "$host" in
930
1139
 *-*-hpux*)
931
1140
    ans=yes
932
1141
    ;;
933
1142
esac
934
1143
ac_cv_var_hpux_findconfig=$ans])
935
1144
case "$ac_cv_var_hpux_findconfig" in
936
 
 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG) ;;
 
1145
 yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
937
1146
esac
938
1147
 
939
1148
AC_CACHE_CHECK(if process groups are set with -pid, ac_cv_arg_setpgrp_negpid,
940
 
[case "$target" in
 
1149
[case "$host" in
941
1150
 *-*-hpux[[567]]*)
942
1151
    ans=no
943
1152
    ;;
959
1168
esac
960
1169
ac_cv_arg_setpgrp_negpid=$ans])
961
1170
case "$ac_cv_arg_setpgrp_negpid" in
962
 
 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN) ;;
 
1171
 yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
963
1172
esac
964
1173
 
965
1174
AC_CACHE_CHECK(if we need a ctty for F_SETOWN, ac_cv_func_ctty_for_f_setown,
966
 
[case "$target" in
967
 
 *-*-bsdi[23]*)
 
1175
[case "$host" in
 
1176
 *-*-bsdi[[23]]*)
968
1177
    ans=yes
969
1178
    ;;
970
1179
 *-*-freebsd*)
984
1193
esac
985
1194
ac_cv_func_ctty_for_f_setown=$ans])
986
1195
case "$ac_cv_func_ctty_for_f_setown" in
987
 
 yes) AC_DEFINE(USE_FSETOWNCTTY) ;;
 
1196
 yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
988
1197
esac
989
1198
 
990
1199
ntp_warning='GRONK'
1003
1212
    ans='stime()'
1004
1213
    ;;
1005
1214
 *) 
1006
 
    case "$host" in
1007
 
     $target) ntp_warning='Which leaves us with nothing to use!'
 
1215
    case "$build" in
 
1216
     $host) ntp_warning='Which leaves us with nothing to use!'
1008
1217
    ans=none
1009
1218
    ;;
1010
1219
esac
1017
1226
esac
1018
1227
 
1019
1228
AC_CACHE_CHECK(if we have a losing syscall(), ac_cv_var_syscall_bug,
1020
 
[case "$target" in
 
1229
[case "$host" in
1021
1230
 *-*-solaris2.4*)
1022
1231
    ans=yes
1023
1232
    ;;
1026
1235
esac
1027
1236
ac_cv_var_syscall_bug=$ans])
1028
1237
case "$ac_cv_var_syscall_bug" in
1029
 
 yes) AC_DEFINE(SYSCALL_BUG) ;;
 
1238
 yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
1030
1239
esac
1031
1240
 
1032
1241
AC_CACHE_CHECK(for Streams/TLI, ac_cv_var_streams_tli,
1034
1243
  yes)
1035
1244
     ans=no
1036
1245
     # There must be a better way...
1037
 
     case "$target" in
 
1246
     case "$host" in
1038
1247
      *-*-ptx*)
1039
1248
         ans=yes
1040
1249
         ;;
1044
1253
 ac_cv_var_streams_tli=$ans])
1045
1254
case "$ac_cv_var_streams_tli" in
1046
1255
 yes)
1047
 
    AC_DEFINE(STREAMS_TLI)
 
1256
    AC_DEFINE(STREAMS_TLI, 1, [Do we have STREAMS/TLI? (Can we replace this with HAVE_SYS_STROPTS_H?)])
1048
1257
    ;;
1049
1258
esac
1050
1259
 
1062
1271
case "$ac_cv_hdr_def_sigio" in
1063
1272
 yes)
1064
1273
    ans=yes
1065
 
    case "$target" in
 
1274
    case "$host" in
1066
1275
     alpha*-dec-osf4*|alpha*-dec-osf5*)
1067
1276
        ans=no
1068
1277
        ;;
1090
1299
     *-*-linux*)
1091
1300
        ans=no
1092
1301
        ;;
 
1302
     *-*-unicosmp*)
 
1303
        ans=no
 
1304
        ;;
1093
1305
    esac
1094
1306
    ;;
1095
1307
esac
1096
1308
ac_cv_var_signalled_io=$ans])
1097
1309
case "$ac_cv_var_signalled_io" in
1098
 
 yes) AC_DEFINE(HAVE_SIGNALED_IO) ;;
 
1310
 yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
1099
1311
esac
1100
1312
 
1101
1313
AC_CACHE_CHECK(for SIGPOLL, ac_cv_hdr_def_sigpoll,
1118
1330
[ans=no
1119
1331
case "$ac_cv_hdr_def_sigpoll" in
1120
1332
 yes)
1121
 
    case "$target" in
 
1333
    case "$host" in
1122
1334
     mips-sgi-irix*)
1123
1335
        ans=no
1124
1336
        ;;
1131
1343
     *-sni-sysv*)
1132
1344
        ans=no
1133
1345
        ;;
1134
 
     *-*-aix4*)
 
1346
     *-*-aix[[45]]*)
1135
1347
        ans=no
1136
1348
        ;;
1137
1349
     *-*-hpux*)
1143
1355
     *-*-osf*)
1144
1356
        ans=no
1145
1357
        ;;
 
1358
     *-*-qnx*)
 
1359
        ans=no
 
1360
        ;;
1146
1361
     *-*-sunos*)
1147
1362
        ans=no
1148
1363
        ;;
1149
1364
     *-*-ultrix*)
1150
1365
        ans=no
1151
1366
        ;;
 
1367
     *-*-unicosmp*)
 
1368
        ans=no
 
1369
        ;;
1152
1370
     *) ans=yes
1153
1371
        ;;
1154
1372
    esac
1156
1374
esac
1157
1375
ac_cv_var_use_udp_sigpoll=$ans])
1158
1376
case "$ac_cv_var_use_udp_sigpoll" in
1159
 
 yes) AC_DEFINE(USE_UDP_SIGPOLL) ;;
 
1377
 yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
1160
1378
esac
1161
1379
 
1162
1380
AC_CACHE_CHECK(if we can use SIGPOLL for TTY I/O, ac_cv_var_use_tty_sigpoll,
1163
1381
[ans=no
1164
1382
case "$ac_cv_hdr_def_sigpoll" in
1165
1383
 yes)
1166
 
    case "$target" in
 
1384
    case "$host" in
1167
1385
     mips-sgi-irix*)
1168
1386
        ans=no
1169
1387
        ;;
1176
1394
     *-sni-sysv*)
1177
1395
        ans=no
1178
1396
        ;;
1179
 
     *-*-aix4*)
 
1397
     *-*-aix[[45]]*)
1180
1398
        ans=no
1181
1399
        ;;
1182
1400
     *-*-hpux*)
1194
1412
     *-*-ultrix*)
1195
1413
        ans=no
1196
1414
        ;;
 
1415
     *-*-qnx*)
 
1416
        ans=no
 
1417
        ;;
 
1418
     *-*-unicosmp*)
 
1419
        ans=no
 
1420
        ;;
1197
1421
     *) ans=yes
1198
1422
        ;;
1199
1423
    esac
1201
1425
esac
1202
1426
ac_cv_var_use_tty_sigpoll=$ans])
1203
1427
case "$ac_cv_var_use_tty_sigpoll" in
1204
 
 yes) AC_DEFINE(USE_TTY_SIGPOLL) ;;
 
1428
 yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
1205
1429
esac
1206
1430
 
1207
1431
case "$ac_cv_header_sys_sio_h" in
1225
1449
AC_CACHE_CHECK(if nlist() values might require extra indirection,
1226
1450
ac_cv_var_nlist_extra_indirection,
1227
1451
[ans=no
1228
 
case "$target" in
 
1452
case "$host" in
1229
1453
 *-*-aix*)
1230
1454
    ans=yes
1231
1455
    ;;
1232
1456
esac
1233
1457
ac_cv_var_nlist_extra_indirection=$ans])
1234
1458
case "$ac_cv_var_nlist_extra_indirection" in
1235
 
 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION) ;;
 
1459
 yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
1236
1460
esac
1237
1461
 
1238
1462
AC_CACHE_CHECK(for a minimum recommended value of tickadj,
1239
1463
ac_cv_var_min_rec_tickadj,
1240
1464
[ans=no
1241
 
case "$target" in
 
1465
case "$host" in
1242
1466
 *-*-aix*)
1243
1467
    ans=40
1244
1468
    ;;
1246
1470
ac_cv_var_min_rec_tickadj=$ans])
1247
1471
case "$ac_cv_var_min_rec_tickadj" in
1248
1472
 ''|no) ;;
1249
 
 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj) ;;
 
1473
 *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
1250
1474
esac
1251
1475
 
1252
1476
AC_CACHE_CHECK(if the TTY code permits PARENB and IGNPAR,
1253
1477
ac_cv_var_no_parenb_ignpar,
1254
1478
[ans=no
1255
 
case "$target" in
 
1479
case "$host" in
1256
1480
 i?86-*-linux*)
1257
1481
    ans=yes
1258
1482
    ;;
1259
1483
 mips-sgi-irix*)
1260
1484
    ans=yes
1261
1485
    ;;
 
1486
 i?86-*-freebsd[[123]].*)
 
1487
    ;;
 
1488
 i?86-*-freebsd*)
 
1489
    ans=yes
 
1490
    ;;
 
1491
 *-*-unicosmp*)
 
1492
    ans=yes
 
1493
    ;;
1262
1494
esac
1263
1495
ac_cv_var_no_parenb_ignpar=$ans])
1264
1496
case "$ac_cv_var_no_parenb_ignpar" in
1265
 
 yes) AC_DEFINE(NO_PARENB_IGNPAR) ;;
 
1497
 yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
1266
1498
esac
1267
1499
 
1268
1500
AC_MSG_CHECKING(if we're including debugging code)
1269
1501
AC_ARG_ENABLE(debugging,        [  --enable-debugging      + include debugging code],
1270
1502
    [ntp_ok=$enableval], [ntp_ok=yes])
1271
1503
if test "$ntp_ok" = "yes"; then
1272
 
    AC_DEFINE(DEBUG)
 
1504
    AC_DEFINE(DEBUG, 1, [Enable debugging?])
1273
1505
fi
1274
1506
AC_MSG_RESULT($ntp_ok)
1275
1507
 
1276
1508
AC_MSG_CHECKING(for a the number of minutes in a DST adjustment)
1277
1509
AC_ARG_ENABLE(dst_minutes,      [  --enable-dst-minutes=60 + minutes per DST adjustment],
1278
1510
    [ans=$enableval], [ans=60])
1279
 
AC_DEFINE_UNQUOTED(DSTMINUTES, $ans)
 
1511
AC_DEFINE_UNQUOTED(DSTMINUTES, $ans, [The number of minutes in a DST adjustment])
1280
1512
AC_MSG_RESULT($ans)
1281
1513
 
1282
1514
AC_CACHE_CHECK(if we have the tty_clk line discipline/streams module,
1285
1517
  *yes*) ac_cv_var_tty_clk=yes ;;
1286
1518
 esac])
1287
1519
case "$ac_cv_var_tty_clk" in
1288
 
 yes) AC_DEFINE(TTYCLK) ;;
 
1520
 yes) AC_DEFINE(TTYCLK, 1, [Do we have the tty_clk line discipline/streams module?]) ;;
1289
1521
esac
1290
1522
 
1291
1523
AC_CACHE_CHECK(for the ppsclock streams module,
1292
1524
 ac_cv_var_ppsclock,
1293
1525
 ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev)
1294
1526
case "$ac_cv_var_ppsclock" in
1295
 
 yes) AC_DEFINE(PPS) ;;
 
1527
 yes) AC_DEFINE(PPS, 1, [Do we have the ppsclock streams module?]) ;;
1296
1528
esac
1297
1529
 
1298
1530
AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
1299
1531
  [ac_cv_var_mcast=no
1300
 
  case "$target" in
 
1532
  case "$host" in
1301
1533
   i386-sequent-sysv4) ;;
1302
1534
   *) AC_EGREP_CPP(yes,
1303
1535
  [#include <netinet/in.h>
1307
1539
  ], ac_cv_var_mcast=yes) ;;
1308
1540
  esac])
1309
1541
case "$ac_cv_var_mcast" in
1310
 
 yes) AC_DEFINE(MCAST) ;;
 
1542
 yes) AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?]) ;;
1311
1543
esac
1312
1544
 
1313
1545
AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
1314
1546
 [ac_cv_var_ntp_syscalls=no
1315
 
 case "$ac_cv_func___adjtimex" in
1316
 
  yes)
1317
 
    ac_cv_var_ntp_syscalls=libc
1318
 
    ;;
1319
 
  *) case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
1320
 
      yesyes)
1321
 
        ac_cv_var_ntp_syscalls=libc
1322
 
        ;;
 
1547
 case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime" in
 
1548
  yesyes)
 
1549
     ac_cv_var_ntp_syscalls=libc
 
1550
     ;;
 
1551
  *) case "$ac_cv_func___adjtimex" in
 
1552
      yes)
 
1553
         ac_cv_var_ntp_syscalls=adjtimex
 
1554
         ;;
1323
1555
      *) AC_EGREP_CPP(yes,
1324
1556
         [#include <sys/syscall.h>
1325
1557
#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
1332
1564
 esac])
1333
1565
case "$ac_cv_var_ntp_syscalls" in
1334
1566
 libc)
1335
 
    AC_DEFINE(NTP_SYSCALLS_LIBC)
 
1567
    AC_DEFINE(NTP_SYSCALLS_LIBC, 1, [Do we have ntp_{adj,get}time in libc?])
1336
1568
    ;;
1337
1569
 kernel)
1338
 
    AC_DEFINE(NTP_SYSCALLS_STD)
 
1570
    AC_DEFINE(NTP_SYSCALLS_STD, 1, [Do we have ntp_{adj,get}time in the kernel?])
1339
1571
    ;;
1340
1572
 *)
1341
1573
    ;;
1360
1592
esac])
1361
1593
case "$ac_cv_var_kernel_pll" in
1362
1594
 yes)
1363
 
    AC_DEFINE(KERNEL_PLL)
 
1595
    AC_DEFINE(KERNEL_PLL, 1, [Does the kernel support precision time discipline?])
1364
1596
    ;;
1365
1597
esac
1366
1598
 
1367
1599
AC_CACHE_CHECK(if SIOCGIFCONF returns buffer size in the buffer, ac_cv_var_size_returned_in_buffer,
1368
1600
  [ans=no
1369
 
  case "$target" in
 
1601
  case "$host" in
1370
1602
   *-fujitsu-uxp*)
1371
1603
      ans=yes
1372
1604
      ;;
1379
1611
  esac
1380
1612
  ac_cv_var_size_returned_in_buffer=$ans])
1381
1613
case "$ac_cv_var_size_returned_in_buffer" in
1382
 
 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER) ;;
 
1614
 yes) AC_DEFINE(SIZE_RETURNED_IN_BUFFER, 1, [Does SIOCGIFCONF return size in the buffer?]) ;;
1383
1615
esac
1384
1616
 
1385
1617
dnl AC_CACHE_CHECK(if we want GDT surveying code, ac_cv_var_gdt_surveying,
1387
1619
dnl     [ans=$enableval], [ans=no])
1388
1620
dnl ac_cv_var_gdt_surveying=$ans])
1389
1621
dnl case "$ac_cv_var_gdt_surveying" in
1390
 
dnl  yes) AC_DEFINE(GDT_SURVEYING) ;;
 
1622
dnl  yes) AC_DEFINE(GDT_SURVEYING, 1, [Include the GDT Surveying code?]) ;;
1391
1623
dnl esac
1392
1624
 
1393
1625
# Check for ioctls TIOCGPPSEV
1403
1635
ntp_ok=no
1404
1636
fi
1405
1637
if test "$ntp_ok" = "yes"; then
1406
 
    AC_DEFINE(HAVE_TIOCGPPSEV)
 
1638
    AC_DEFINE(HAVE_TIOCGPPSEV, 1, [Do we have the TIOCGPPSEV ioctl (Solaris)?])
1407
1639
    ac_cv_var_oncore_ok=yes
1408
1640
fi
1409
1641
AC_MSG_RESULT($ntp_ok)
1422
1654
fi
1423
1655
 
1424
1656
if test "$ntp_ok" = "yes"; then
1425
 
    AC_DEFINE(HAVE_TIOCSPPS)
 
1657
    AC_DEFINE(HAVE_TIOCSPPS, 1, [Do we have the TIOCSPPS ioctl (Solaris)?])
1426
1658
fi
1427
1659
AC_MSG_RESULT($ntp_ok)
1428
1660
 
1440
1672
fi
1441
1673
if test "$ntp_ok" = "yes"; then
1442
1674
    ac_cv_var_oncore_ok=yes
1443
 
    AC_DEFINE(HAVE_CIOGETEV)
 
1675
    AC_DEFINE(HAVE_CIOGETEV, 1, [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
1444
1676
fi
1445
1677
AC_MSG_RESULT($ntp_ok)
1446
1678
 
1466
1698
 
1467
1699
case "$ac_cv_c_inline$ac_cv_struct_timespec$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h" in
1468
1700
 inlineyes*yes*)
1469
 
    AC_DEFINE(HAVE_PPSAPI)
 
1701
    AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
1470
1702
    ac_cv_var_oncore_ok=yes
 
1703
    ac_cv_var_ripe_ncc_ok=yes
 
1704
    ac_cv_var_jupiter_ok=yes
1471
1705
    ;;
1472
1706
esac
1473
1707
 
1501
1735
        ;;
1502
1736
esac
1503
1737
if test "$ntp_ok" = "yes"; then
1504
 
    AC_DEFINE(HAVE_TIO_SERIAL_STUFF)
 
1738
    AC_DEFINE(HAVE_TIO_SERIAL_STUFF, 1, [Do we have the TIO serial stuff?])
1505
1739
fi
1506
1740
AC_MSG_RESULT($ntp_ok)
1507
1741
 
1512
1746
 *)   ntp_ok=no  ;;
1513
1747
esac
1514
1748
if test "$ntp_ok" = "yes"; then
1515
 
    AC_DEFINE(ONCORE_SHMEM_STATUS)
 
1749
    AC_DEFINE(ONCORE_SHMEM_STATUS, 1, [Do we have support for SHMEM_STATUS?])
1516
1750
fi
1517
1751
AC_MSG_RESULT($ntp_ok)
1518
1752
 
1531
1765
 
1532
1766
ntp_refclock=no
1533
1767
 
1534
 
AC_MSG_CHECKING(for hopf serial clock device)
1535
 
AC_ARG_ENABLE(HOPFSERIAL,               [  --enable-HOPFSERIAL     + hopf serial clock device],
1536
 
      [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1537
 
  if test "$ntp_ok" = "yes"; then
1538
 
      ntp_refclock=yes
1539
 
      AC_DEFINE(CLOCK_HOPF_SERIAL)
1540
 
  fi
1541
 
  AC_MSG_RESULT($ntp_ok)
1542
 
 
1543
 
 
1544
 
AC_MSG_CHECKING(for hopf PCI clock 6039)
1545
 
AC_ARG_ENABLE(HOPFPCI,          [  --enable-HOPFPCI        + hopf 6039 PCI board],
1546
 
      [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1547
 
if test "$ntp_ok" = "yes"; then
1548
 
    ntp_refclock=yes
1549
 
    AC_DEFINE(CLOCK_HOPF_PCI)
1550
 
fi
1551
 
AC_MSG_RESULT($ntp_ok)
1552
 
 
1553
1768
# HPUX only, and by explicit request
1554
1769
AC_MSG_CHECKING(Datum/Bancomm bc635/VME interface)
1555
 
AC_ARG_ENABLE(BANCOMM,          [  --enable-BANCOMM        - Datum/Bancomm bc635/VME interface],
 
1770
AC_ARG_ENABLE(BANCOMM,
 
1771
    AC_HELP_STRING([--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface]),
1556
1772
    [ntp_ok=$enableval], [ntp_ok=no])
1557
1773
if test "$ntp_ok" = "yes"; then
1558
1774
    ntp_refclock=yes
1559
 
    AC_DEFINE(CLOCK_BANC)
 
1775
    AC_DEFINE(CLOCK_BANC, 1, [Datum/Bancomm bc635/VME interface?])
1560
1776
fi
1561
1777
AC_MSG_RESULT($ntp_ok)
1562
 
case "$ntp_ok$target" in
 
1778
case "$ntp_ok$host" in
1563
1779
 yes*-*-hpux*) ;;
1564
1780
 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1565
1781
esac
1566
1782
 
1567
1783
#HPUX only, and only by explicit request
1568
1784
AC_MSG_CHECKING(TrueTime GPS receiver/VME interface)
1569
 
AC_ARG_ENABLE(GPSVME,           [  --enable-GPSVME         - TrueTime GPS receiver/VME interface],
 
1785
AC_ARG_ENABLE(GPSVME,
 
1786
    AC_HELP_STRING([--enable-GPSVME], [- TrueTime GPS receiver/VME interface]),
1570
1787
    [ntp_ok=$enableval], [ntp_ok=no])
1571
1788
if test "$ntp_ok" = "yes"; then
1572
1789
    ntp_refclock=yes
1573
 
    AC_DEFINE(CLOCK_GPSVME)
 
1790
    AC_DEFINE(CLOCK_GPSVME, 1, [TrueTime GPS receiver/VME interface?])
1574
1791
fi
1575
1792
AC_MSG_RESULT($ntp_ok)
1576
 
case "$ntp_ok$target" in
 
1793
case "$ntp_ok$host" in
1577
1794
 yes*-*-hpux*) ;;
1578
1795
 yes*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1579
1796
esac
1581
1798
AC_MSG_CHECKING(for PCL720 clock support)
1582
1799
case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
1583
1800
 yesyesyes)
1584
 
    AC_DEFINE(CLOCK_PPS720)
 
1801
    AC_DEFINE(CLOCK_PPS720, 1, [PCL 720 clock support])
1585
1802
    ans=yes
1586
1803
    ;;
1587
1804
 *)
1590
1807
esac
1591
1808
AC_MSG_RESULT($ans)
1592
1809
 
1593
 
AC_MSG_CHECKING(for SHM clock attached thru shared memory)
1594
 
AC_ARG_ENABLE(SHM,              [  --enable-SHM            - SHM clock attached thru shared memory],
1595
 
    [ntp_ok=$enableval], [ntp_ok=no])
1596
 
if test "$ntp_ok" = "yes"; then
1597
 
    ntp_refclock=yes
1598
 
    AC_DEFINE(CLOCK_SHM)
1599
 
fi
1600
 
AC_MSG_RESULT($ntp_ok)
1601
 
 
1602
1810
AC_MSG_CHECKING(for default inclusion of all suitable non-PARSE clocks)
1603
 
AC_ARG_ENABLE(all-clocks,       [  --enable-all-clocks     + include all suitable non-PARSE clocks:],
 
1811
AC_ARG_ENABLE(all-clocks,
 
1812
    AC_HELP_STRING([--enable-all-clocks], [+ include all suitable non-PARSE clocks:]),
1604
1813
    [ntp_eac=$enableval], [ntp_eac=yes])
1605
1814
AC_MSG_RESULT($ntp_eac)
1606
1815
 
1615
1824
AC_MSG_RESULT($ntp_canparse)
1616
1825
 
1617
1826
AC_MSG_CHECKING([if we have support for audio clocks])
1618
 
case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
 
1827
case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
1619
1828
 *yes*)
1620
1829
    ntp_canaudio=yes
1621
1830
    AC_DEFINE(HAVE_AUDIO, , [Do we have audio support?])
1624
1833
esac
1625
1834
AC_MSG_RESULT($ntp_canaudio)
1626
1835
 
 
1836
AC_MSG_CHECKING([if we have support for the SHM refclock interface])
 
1837
case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
 
1838
 yesyes)
 
1839
    ntp_canshm=yes
 
1840
    ;;
 
1841
 *) ntp_canshm=no ;;
 
1842
esac
 
1843
AC_MSG_RESULT($ntp_canshm)
 
1844
 
1627
1845
# Requires modem control
1628
1846
AC_MSG_CHECKING(ACTS modem service)
1629
 
AC_ARG_ENABLE(ACTS,             [  --enable-ACTS           + ACTS modem service],
 
1847
AC_ARG_ENABLE(ACTS,
 
1848
    AC_HELP_STRING([--enable-ACTS], [s ACTS modem service]),
1630
1849
    [ntp_ok=$enableval],
1631
1850
    [AC_EGREP_CPP(yes,
1632
1851
        [#include <termios.h>
1639
1858
         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1640
1859
if test "$ntp_ok" = "yes"; then
1641
1860
    ntp_refclock=yes
1642
 
    AC_DEFINE(CLOCK_ACTS)
 
1861
    AC_DEFINE(CLOCK_ACTS, 1, [ACTS modem service])
1643
1862
fi
1644
1863
AC_MSG_RESULT($ntp_ok)
1645
1864
 
1646
1865
AC_MSG_CHECKING(Arbiter 1088A/B GPS receiver)
1647
 
AC_ARG_ENABLE(ARBITER,          [  --enable-ARBITER        + Arbiter 1088A/B GPS receiver],
 
1866
AC_ARG_ENABLE(ARBITER,
 
1867
    AC_HELP_STRING([--enable-ARBITER], [+ Arbiter 1088A/B GPS receiver]),
1648
1868
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1649
1869
if test "$ntp_ok" = "yes"; then
1650
1870
    ntp_refclock=yes
1651
 
    AC_DEFINE(CLOCK_ARBITER)
 
1871
    AC_DEFINE(CLOCK_ARBITER, 1, [Arbiter 1088A/B GPS receiver])
1652
1872
fi
1653
1873
AC_MSG_RESULT($ntp_ok)
1654
1874
 
1655
1875
AC_MSG_CHECKING(Arcron MSF receiver)
1656
 
AC_ARG_ENABLE(ARCRON_MSF,       [  --enable-ARCRON-MSF     + Arcron MSF receiver],
1657
 
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1658
 
if test "$ntp_ok" = "yes"; then
1659
 
    ntp_refclock=yes
1660
 
    AC_DEFINE(CLOCK_ARCRON_MSF)
 
1876
AC_ARG_ENABLE(ARCRON_MSF,
 
1877
    AC_HELP_STRING([--enable-ARCRON-MSF], [+ Arcron MSF receiver]),
 
1878
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
1879
if test "$ntp_ok" = "yes"; then
 
1880
    ntp_refclock=yes
 
1881
    AC_DEFINE(CLOCK_ARCRON_MSF, 1, [ARCRON support?])
 
1882
fi
 
1883
AC_MSG_RESULT($ntp_ok)
 
1884
 
 
1885
AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
 
1886
AC_ARG_ENABLE(AS2201,
 
1887
    AC_HELP_STRING([--enable-AS2201], [+ Austron 2200A/2201A GPS receiver]),
 
1888
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
1889
if test "$ntp_ok" = "yes"; then
 
1890
    ntp_refclock=yes
 
1891
    AC_DEFINE(CLOCK_AS2201, 1, [Austron 2200A/2201A GPS receiver?])
1661
1892
fi
1662
1893
AC_MSG_RESULT($ntp_ok)
1663
1894
 
1664
1895
AC_MSG_CHECKING(ATOM PPS interface)
1665
 
AC_ARG_ENABLE(ATOM,             [  --enable-ATOM           s ATOM PPS interface],
 
1896
AC_ARG_ENABLE(ATOM,     
 
1897
    AC_HELP_STRING([--enable-ATOM], [s ATOM PPS interface]),
1666
1898
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1667
1899
case "$ac_cv_var_atom_ok" in
1668
1900
 no) ntp_ok=no ;;
1669
1901
esac
1670
1902
if test "$ntp_ok" = "yes"; then
1671
1903
    ntp_refclock=yes
1672
 
    AC_DEFINE(CLOCK_ATOM)
 
1904
    AC_DEFINE(CLOCK_ATOM, 1, [PPS interface?])
1673
1905
fi
1674
1906
AC_MSG_RESULT($ntp_ok)
1675
1907
 
1676
 
AC_MSG_CHECKING(Austron 2200A/2201A GPS receiver)
1677
 
AC_ARG_ENABLE(AS2201,           [  --enable-AS2201         + Austron 2200A/2201A GPS receiver],
 
1908
AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
 
1909
AC_ARG_ENABLE(CHRONOLOG,
 
1910
    AC_HELP_STRING([--enable-CHRONOLOG], [+ Chrono-log K-series WWVB receiver]),
1678
1911
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1679
1912
if test "$ntp_ok" = "yes"; then
1680
1913
    ntp_refclock=yes
1681
 
    AC_DEFINE(CLOCK_AS2201)
 
1914
    AC_DEFINE(CLOCK_CHRONOLOG, 1, [Chronolog K-series WWVB receiver?])
1682
1915
fi
1683
1916
AC_MSG_RESULT($ntp_ok)
1684
1917
 
1685
1918
AC_MSG_CHECKING(CHU modem/decoder)
1686
 
AC_ARG_ENABLE(CHU,              [  --enable-CHU            - CHU modem/decoder],
 
1919
AC_ARG_ENABLE(CHU,
 
1920
    AC_HELP_STRING([--enable-CHU], [+ CHU modem/decoder]),
1687
1921
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1688
1922
if test "$ntp_ok" = "yes"; then
1689
1923
    ntp_refclock=yes
1690
 
    AC_DEFINE(CLOCK_CHU)
 
1924
    AC_DEFINE(CLOCK_CHU, 1, [CHU modem/decoder])
1691
1925
fi
1692
1926
AC_MSG_RESULT($ntp_ok)
1693
1927
ac_refclock_chu=$ntp_ok
1694
1928
 
1695
1929
AC_MSG_CHECKING(CHU audio/decoder)
1696
 
AC_ARG_ENABLE(AUDIO-CHU,        [  --enable-AUDIO-CHU      s CHU audio/decoder],
 
1930
AC_ARG_ENABLE(AUDIO-CHU,
 
1931
    AC_HELP_STRING([--enable-AUDIO-CHU], [s CHU audio/decoder]),
1697
1932
    [ntp_ok=$enableval],
1698
1933
    [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
1699
1934
 *no*)  ntp_ok=no  ;;
1700
1935
 *)     ntp_ok=yes ;;
1701
1936
esac])
1702
1937
if test "$ntp_ok" = "yes"; then
1703
 
    AC_DEFINE(AUDIO_CHU)
 
1938
    AC_DEFINE(AUDIO_CHU, 1, [CHU audio/decoder?])
1704
1939
fi
1705
1940
AC_MSG_RESULT($ntp_ok)
1706
1941
# We used to check for sunos/solaris target...
1710
1945
 
1711
1946
# Not under HP-UX
1712
1947
AC_MSG_CHECKING(Datum Programmable Time System)
1713
 
AC_ARG_ENABLE(DATUM,            [  --enable-DATUM          s Datum Programmable Time System],
 
1948
AC_ARG_ENABLE(DATUM,
 
1949
    AC_HELP_STRING([--enable-DATUM], [s Datum Programmable Time System]),
1714
1950
    [ntp_ok=$enableval],
1715
1951
    [case "$ac_cv_header_termios_h" in
1716
1952
    yes)
1721
1957
    esac])
1722
1958
if test "$ntp_ok" = "yes"; then
1723
1959
    ntp_refclock=yes
1724
 
    AC_DEFINE(CLOCK_DATUM)
 
1960
    AC_DEFINE(CLOCK_DATUM, 1, [Datum Programmable Time System?])
 
1961
fi
 
1962
AC_MSG_RESULT($ntp_ok)
 
1963
 
 
1964
AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
 
1965
AC_ARG_ENABLE(DUMBCLOCK,
 
1966
    AC_HELP_STRING([--enable-DUMBCLOCK], [+ Dumb generic hh:mm:ss local clock]),
 
1967
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
1968
if test "$ntp_ok" = "yes"; then
 
1969
    ntp_refclock=yes
 
1970
    AC_DEFINE(CLOCK_DUMBCLOCK, 1, [Dumb generic hh:mm:ss local clock?])
1725
1971
fi
1726
1972
AC_MSG_RESULT($ntp_ok)
1727
1973
 
1728
1974
AC_MSG_CHECKING(Forum Graphic GPS)
1729
 
AC_ARG_ENABLE(FG,               [  --enable-FG             + Forum Graphic GPS],
 
1975
AC_ARG_ENABLE(FG,
 
1976
    AC_HELP_STRING([--enable-FG], [+ Forum Graphic GPS]),
1730
1977
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1731
1978
if test "$ntp_ok" = "yes"; then
1732
1979
    ntp_refclock=yes
1733
 
    AC_DEFINE(CLOCK_FG)
 
1980
    AC_DEFINE(CLOCK_FG, 1, [Forum Graphic GPS datating station driver?])
1734
1981
fi
1735
1982
AC_MSG_RESULT($ntp_ok)
1736
1983
 
1737
1984
# Requires modem control
1738
1985
AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
1739
 
AC_ARG_ENABLE(HEATH,            [  --enable-HEATH          s Heath GC-1000 WWV/WWVH receiver],
 
1986
AC_ARG_ENABLE(HEATH,
 
1987
    AC_HELP_STRING([--enable-HEATH], [s Heath GC-1000 WWV/WWVH receiver]),
1740
1988
    [ntp_ok=$enableval],
1741
1989
    [AC_EGREP_CPP(yes,
1742
1990
        [#include <termios.h>
1749
1997
         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1750
1998
if test "$ntp_ok" = "yes"; then
1751
1999
    ntp_refclock=yes
1752
 
    AC_DEFINE(CLOCK_HEATH)
 
2000
    AC_DEFINE(CLOCK_HEATH, 1, [Heath GC-1000 WWV/WWVH receiver?])
 
2001
fi
 
2002
AC_MSG_RESULT($ntp_ok)
 
2003
 
 
2004
AC_MSG_CHECKING(for hopf serial clock device)
 
2005
AC_ARG_ENABLE(HOPFSERIAL,
 
2006
    AC_HELP_STRING([--enable-HOPFSERIAL], [+ hopf serial clock device]),
 
2007
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2008
if test "$ntp_ok" = "yes"; then
 
2009
    ntp_refclock=yes
 
2010
    AC_DEFINE(CLOCK_HOPF_SERIAL, 1, [HOPF serial clock device?])
 
2011
fi
 
2012
AC_MSG_RESULT($ntp_ok)
 
2013
 
 
2014
AC_MSG_CHECKING(for hopf PCI clock 6039)
 
2015
AC_ARG_ENABLE(HOPFPCI,
 
2016
    AC_HELP_STRING([--enable-HOPFPCI], [+ hopf 6039 PCI board]),
 
2017
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2018
if test "$ntp_ok" = "yes"; then
 
2019
    ntp_refclock=yes
 
2020
    AC_DEFINE(CLOCK_HOPF_PCI, 1, [HOPF PCI clock device?])
1753
2021
fi
1754
2022
AC_MSG_RESULT($ntp_ok)
1755
2023
 
1756
2024
AC_MSG_CHECKING(HP 58503A GPS receiver)
1757
 
AC_ARG_ENABLE(HPGPS,            [  --enable-HPGPS          + HP 58503A GPS receiver],
 
2025
AC_ARG_ENABLE(HPGPS,
 
2026
    AC_HELP_STRING([--enable-HPGPS], [+ HP 58503A GPS receiver]),
1758
2027
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1759
2028
if test "$ntp_ok" = "yes"; then
1760
2029
    ntp_refclock=yes
1761
 
    AC_DEFINE(CLOCK_HPGPS)
 
2030
    AC_DEFINE(CLOCK_HPGPS, 1, [HP 58503A GPS receiver?])
1762
2031
fi
1763
2032
AC_MSG_RESULT($ntp_ok)
1764
2033
 
1765
 
AC_MSG_CHECKING(Sun IRIG audio decoder)
1766
 
AC_ARG_ENABLE(IRIG,             [  --enable-IRIG           s Sun IRIG audio decoder],
 
2034
AC_MSG_CHECKING(IRIG audio decoder)
 
2035
AC_ARG_ENABLE(IRIG,
 
2036
    AC_HELP_STRING([--enable-IRIG], [s IRIG audio decoder]),
1767
2037
    [ntp_ok=$enableval],
1768
2038
    [case "$ntp_eac$ntp_canaudio" in
1769
2039
     *no*)      ntp_ok=no  ;;
1771
2041
    esac])
1772
2042
if test "$ntp_ok" = "yes"; then
1773
2043
    ntp_refclock=yes
1774
 
    AC_DEFINE(CLOCK_IRIG)
 
2044
    AC_DEFINE(CLOCK_IRIG, 1, [IRIG audio decoder?])
1775
2045
fi
1776
2046
AC_MSG_RESULT($ntp_ok)
1777
2047
case "$ntp_ok$ntp_canaudio" in
1778
2048
 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1779
2049
esac
1780
2050
 
 
2051
AC_MSG_CHECKING(for JJY receiver)
 
2052
AC_ARG_ENABLE(JJY,
 
2053
    AC_HELP_STRING([--enable-JJY], [+ JJY receiver]),
 
2054
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2055
if test "$ntp_ok" = "yes"; then
 
2056
    ntp_refclock=yes
 
2057
    AC_DEFINE(CLOCK_JJY, 1, [JJY receiver?])
 
2058
fi
 
2059
AC_MSG_RESULT($ntp_ok)
 
2060
 
 
2061
AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
 
2062
AC_ARG_ENABLE(JUPITER,
 
2063
    AC_HELP_STRING([--enable-JUPITER], [s Rockwell Jupiter GPS receiver]),
 
2064
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2065
case "$ac_cv_var_jupiter_ok" in
 
2066
 no) ntp_ok=no ;;
 
2067
esac
 
2068
if test "$ntp_ok" = "yes"; then
 
2069
    ntp_refclock=yes
 
2070
    AC_DEFINE(CLOCK_JUPITER, 1, [Rockwell Jupiter GPS clock?])
 
2071
fi
 
2072
AC_MSG_RESULT($ntp_ok)
 
2073
 
1781
2074
AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
1782
 
AC_ARG_ENABLE(LEITCH,           [  --enable-LEITCH         + Leitch CSD 5300 Master Clock System Driver],
 
2075
AC_ARG_ENABLE(LEITCH,
 
2076
    AC_HELP_STRING([--enable-LEITCH], [+ Leitch CSD 5300 Master Clock System Driver]),
1783
2077
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1784
2078
if test "$ntp_ok" = "yes"; then
1785
2079
    ntp_refclock=yes
1786
 
    AC_DEFINE(CLOCK_LEITCH)
 
2080
    AC_DEFINE(CLOCK_LEITCH, 1, [Leitch CSD 5300 Master Clock System Driver?])
1787
2081
fi
1788
2082
AC_MSG_RESULT($ntp_ok)
1789
2083
 
1790
2084
AC_MSG_CHECKING(local clock reference)
1791
 
AC_ARG_ENABLE(LOCAL-CLOCK,      [  --enable-LOCAL-CLOCK    + local clock reference],
 
2085
AC_ARG_ENABLE(LOCAL-CLOCK,
 
2086
    AC_HELP_STRING([--enable-LOCAL-CLOCK], [+ local clock reference]),
1792
2087
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1793
2088
if test "$ntp_ok" = "yes"; then
1794
2089
    ntp_refclock=yes
1795
 
    AC_DEFINE(CLOCK_LOCAL)
 
2090
    AC_DEFINE(CLOCK_LOCAL, 1, [local clock reference?])
1796
2091
fi
1797
2092
AC_MSG_RESULT($ntp_ok)
1798
2093
 
1799
2094
AC_MSG_CHECKING(EES M201 MSF receiver)
1800
 
AC_ARG_ENABLE(MSFEES,           [  --enable-MSFEES         + EES M201 MSF receiver],
 
2095
AC_ARG_ENABLE(MSFEES,
 
2096
    AC_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver]),
1801
2097
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1802
2098
if test "$ntp_ok" = "yes"; then
1803
2099
    ntp_refclock=yes
1804
 
    AC_DEFINE(CLOCK_MSFEES)
 
2100
    AC_DEFINE(CLOCK_MSFEES, 1, [EES M201 MSF receiver])
1805
2101
fi
1806
2102
AC_MSG_RESULT($ntp_ok)
1807
2103
 
1808
2104
# Not Ultrix
1809
2105
AC_MSG_CHECKING(Magnavox MX4200 GPS receiver)
1810
 
AC_ARG_ENABLE(MX4200,           [  --enable-MX4200         s Magnavox MX4200 GPS receiver],
 
2106
AC_ARG_ENABLE(MX4200,
 
2107
    AC_HELP_STRING([--enable-MX4200 ], [s Magnavox MX4200 GPS receiver]),
1811
2108
    [ntp_ok=$enableval],
1812
2109
    [case "$ac_cv_var_ppsclock" in
1813
2110
     yes) ntp_ok=$ntp_eac
1817
2114
    esac])
1818
2115
if test "$ntp_ok" = "yes"; then
1819
2116
    ntp_refclock=yes
1820
 
    AC_DEFINE(CLOCK_MX4200)
 
2117
    AC_DEFINE(CLOCK_MX4200, 1, [Magnavox MX4200 GPS receiver])
1821
2118
fi
1822
2119
AC_MSG_RESULT($ntp_ok)
1823
 
case "$ntp_ok$target" in
 
2120
case "$ntp_ok$host" in
1824
2121
 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1825
2122
esac
1826
2123
 
 
2124
AC_MSG_CHECKING(for NeoClock4X receiver)
 
2125
AC_ARG_ENABLE(NEOCLOCK4X,
 
2126
    AC_HELP_STRING([--enable-NEOCLOCK4X], [+ NeoClock4X DCF77 / TDF receiver]),
 
2127
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2128
if test "$ntp_ok" = "yes"; then
 
2129
    ntp_refclock=yes
 
2130
    AC_DEFINE(CLOCK_NEOCLOCK4X, 1, [NeoClock4X])
 
2131
fi
 
2132
AC_MSG_RESULT($ntp_ok)
 
2133
 
1827
2134
AC_MSG_CHECKING(NMEA GPS receiver)
1828
 
AC_ARG_ENABLE(NMEA,             [  --enable-NMEA           + NMEA GPS receiver],
 
2135
AC_ARG_ENABLE(NMEA,
 
2136
    AC_HELP_STRING([--enable-NMEA], [+ NMEA GPS receiver]),
1829
2137
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1830
2138
if test "$ntp_ok" = "yes"; then
1831
2139
    ntp_refclock=yes
1832
 
    AC_DEFINE(CLOCK_NMEA)
 
2140
    AC_DEFINE(CLOCK_NMEA, 1, [NMEA GPS receiver])
1833
2141
fi
1834
2142
AC_MSG_RESULT($ntp_ok)
1835
2143
 
1836
2144
AC_MSG_CHECKING(for ONCORE Motorola VP/UT Oncore GPS)
1837
 
AC_ARG_ENABLE(ONCORE,           [  --enable-ONCORE         s Motorola VP/UT Oncore GPS receiver],
 
2145
AC_ARG_ENABLE(ONCORE,
 
2146
    AC_HELP_STRING([--enable-ONCORE], [s Motorola VP/UT Oncore GPS receiver]),
1838
2147
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1839
2148
case "$ac_cv_var_oncore_ok" in
1840
2149
 no) ntp_ok=no ;;
1841
2150
esac
1842
2151
if test "$ntp_ok" = "yes"; then
1843
2152
    ntp_refclock=yes
1844
 
    AC_DEFINE(CLOCK_ONCORE)
 
2153
    AC_DEFINE(CLOCK_ONCORE, 1, [Motorola UT Oncore GPS])
1845
2154
fi
1846
2155
AC_MSG_RESULT($ntp_ok)
1847
2156
 
1848
2157
AC_MSG_CHECKING(for Palisade clock)
1849
 
AC_ARG_ENABLE(PALISADE,         [  --enable-PALISADE       + Palisade clock],
 
2158
AC_ARG_ENABLE(PALISADE,
 
2159
    AC_HELP_STRING([--enable-PALISADE], [s Palisade clock]),
1850
2160
    [ntp_ok=$enableval],
1851
2161
    [case "$ac_cv_header_termios_h" in
1852
2162
    yes)
1858
2168
 
1859
2169
if test "$ntp_ok" = "yes"; then
1860
2170
    ntp_refclock=yes
1861
 
    AC_DEFINE(CLOCK_PALISADE)
 
2171
    AC_DEFINE(CLOCK_PALISADE, 1, [Palisade clock])
 
2172
fi
 
2173
AC_MSG_RESULT($ntp_ok)
 
2174
 
 
2175
AC_MSG_CHECKING(Conrad parallel port radio clock)
 
2176
AC_ARG_ENABLE(PCF,
 
2177
    AC_HELP_STRING([--enable-PCF ], [+ Conrad parallel port radio clock]),
 
2178
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2179
if test "$ntp_ok" = "yes"; then
 
2180
    ntp_refclock=yes
 
2181
    AC_DEFINE(CLOCK_PCF, 1, [Conrad parallel port radio clock])
1862
2182
fi
1863
2183
AC_MSG_RESULT($ntp_ok)
1864
2184
 
1865
2185
AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
1866
 
AC_ARG_ENABLE(PST,              [  --enable-PST            + PST/Traconex 1020 WWV/WWVH receiver],
 
2186
AC_ARG_ENABLE(PST,
 
2187
    AC_HELP_STRING([--enable-PST], [+ PST/Traconex 1020 WWV/WWVH receiver]),
1867
2188
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1868
2189
if test "$ntp_ok" = "yes"; then
1869
2190
    ntp_refclock=yes
1870
 
    AC_DEFINE(CLOCK_PST)
1871
 
fi
1872
 
AC_MSG_RESULT($ntp_ok)
1873
 
 
1874
 
# Not Ultrix
1875
 
AC_MSG_CHECKING(Rockwell Jupiter GPS receiver)
1876
 
AC_ARG_ENABLE(JUPITER,          [  --enable-JUPITER        s Rockwell Jupiter GPS receiver],
1877
 
    [ntp_ok=$enableval],
1878
 
    [case "$ac_cv_var_ppsclock" in
1879
 
#     yes) ntp_ok=$ntp_eac
1880
 
#        ;;
1881
 
     *) ntp_ok=no
1882
 
        ;;
1883
 
    esac])
1884
 
if test "$ntp_ok" = "yes"; then
1885
 
    ntp_refclock=yes
1886
 
    AC_DEFINE(CLOCK_JUPITER)
1887
 
fi
1888
 
AC_MSG_RESULT($ntp_ok)
1889
 
case "$ntp_ok$target" in
1890
 
 yes*-*-ultrix*) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1891
 
esac
 
2191
    AC_DEFINE(CLOCK_PST, 1, [PST/Traconex 1020 WWV/WWVH receiver])
 
2192
fi
 
2193
AC_MSG_RESULT($ntp_ok)
1892
2194
 
1893
2195
# Requires modem control
1894
2196
AC_MSG_CHECKING(PTB modem service)
1895
 
AC_ARG_ENABLE(PTBACTS,          [  --enable-PTBACTS        s PTB modem service],
 
2197
AC_ARG_ENABLE(PTBACTS,
 
2198
    AC_HELP_STRING([--enable-PTBACTS], [s PTB modem service]),
1896
2199
    [ntp_ok=$enableval],
1897
2200
    [AC_EGREP_CPP(yes,
1898
2201
        [#include <termios.h>
1905
2208
         ], ntp_ok=$ntp_eac, ntp_ok=no)])
1906
2209
if test "$ntp_ok" = "yes"; then
1907
2210
    ntp_refclock=yes
1908
 
    AC_DEFINE(CLOCK_PTBACTS)
 
2211
    AC_DEFINE(CLOCK_PTBACTS, 1, [PTB modem service])
 
2212
fi
 
2213
AC_MSG_RESULT($ntp_ok)
 
2214
 
 
2215
AC_MSG_CHECKING(RIPENCC specific Trimble driver)
 
2216
AC_ARG_ENABLE(RIPENCC,
 
2217
    AC_HELP_STRING([--enable-RIPENCC], [- RIPENCC specific Trimble driver]),
 
2218
    [ntp_ok=$enableval], [ntp_ok=no])
 
2219
# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
 
2220
case "$ac_cv_var_ripe_ncc_ok" in
 
2221
 no) ntp_ok=no ;;
 
2222
esac
 
2223
if test "$ntp_ok" = "yes"; then
 
2224
    ntp_refclock=yes
 
2225
    AC_DEFINE(CLOCK_RIPENCC, ,[RIPE NCC Trimble clock])
 
2226
fi
 
2227
AC_MSG_RESULT($ntp_ok)
 
2228
 
 
2229
# Danny Meyer says SHM compiles (with a few warnings) under Win32.
 
2230
# For *IX, we need sys/ipc.h and sys/shm.h.
 
2231
AC_MSG_CHECKING(for SHM clock attached thru shared memory)
 
2232
AC_ARG_ENABLE(SHM,
 
2233
    AC_HELP_STRING([--enable-SHM], [s SHM clock attached thru shared memory]),
 
2234
    [ntp_ok=$enableval],
 
2235
    [case "$ntp_eac$ntp_canshm" in
 
2236
 *no*)  ntp_ok=no  ;;
 
2237
 *)     ntp_ok=yes ;;
 
2238
esac])
 
2239
if test "$ntp_ok" = "yes"; then
 
2240
    ntp_refclock=yes
 
2241
    AC_DEFINE(CLOCK_SHM, 1, [clock thru shared memory])
 
2242
fi
 
2243
AC_MSG_RESULT($ntp_ok)
 
2244
 
 
2245
AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
 
2246
AC_ARG_ENABLE(SPECTRACOM,
 
2247
    AC_HELP_STRING([--enable-SPECTRACOM], [+ Spectracom 8170/Netclock/2 WWVB receiver]),
 
2248
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2249
if test "$ntp_ok" = "yes"; then
 
2250
    ntp_refclock=yes
 
2251
    AC_DEFINE(CLOCK_SPECTRACOM, 1, [Spectracom 8170/Netclock/2 WWVB receiver])
1909
2252
fi
1910
2253
AC_MSG_RESULT($ntp_ok)
1911
2254
 
1912
2255
AC_MSG_CHECKING(KSI/Odetics TPRO/S GPS receiver/IRIG interface)
1913
 
AC_ARG_ENABLE(TPRO,             [  --enable-TPRO           s KSI/Odetics TPRO/S GPS receiver/IRIG interface],
 
2256
AC_ARG_ENABLE(TPRO,
 
2257
    AC_HELP_STRING([--enable-TPRO], [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]),
1914
2258
    [ntp_ok=$enableval],
1915
2259
    [case "$ac_cv_header_sys_tpro_h" in
1916
2260
     yes)
1921
2265
    esac])
1922
2266
if test "$ntp_ok" = "yes"; then
1923
2267
    ntp_refclock=yes
1924
 
    AC_DEFINE(CLOCK_TPRO)
 
2268
    AC_DEFINE(CLOCK_TPRO, 1, [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
1925
2269
fi
1926
2270
AC_MSG_RESULT($ntp_ok)
1927
2271
case "$ntp_ok$ac_cv_header_sys_tpro" in
1929
2273
esac
1930
2274
 
1931
2275
AC_MSG_CHECKING(TRAK 8810 GPS receiver)
1932
 
AC_ARG_ENABLE(TRAK,             [  --enable-TRAK           + TRAK 8810 GPS receiver],
1933
 
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1934
 
if test "$ntp_ok" = "yes"; then
1935
 
    ntp_refclock=yes
1936
 
    AC_DEFINE(CLOCK_TRAK)
1937
 
fi
1938
 
AC_MSG_RESULT($ntp_ok)
1939
 
 
1940
 
AC_MSG_CHECKING(Chrono-log K-series WWVB receiver)
1941
 
AC_ARG_ENABLE(CHRONOLOG,        [  --enable-CHRONOLOG      + Chrono-log K-series WWVB receiver],
1942
 
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1943
 
if test "$ntp_ok" = "yes"; then
1944
 
    ntp_refclock=yes
1945
 
    AC_DEFINE(CLOCK_CHRONOLOG)
1946
 
fi
1947
 
AC_MSG_RESULT($ntp_ok)
1948
 
 
1949
 
AC_MSG_CHECKING(Dumb generic hh:mm:ss local clock)
1950
 
AC_ARG_ENABLE(DUMBCLOCK,        [  --enable-DUMBCLOCK      + Dumb generic hh:mm:ss local clock],
1951
 
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1952
 
if test "$ntp_ok" = "yes"; then
1953
 
    ntp_refclock=yes
1954
 
    AC_DEFINE(CLOCK_DUMBCLOCK)
1955
 
fi
1956
 
AC_MSG_RESULT($ntp_ok)
1957
 
 
1958
 
AC_MSG_CHECKING(Conrad parallel port radio clock)
1959
 
AC_ARG_ENABLE(PCF,              [  --enable-PCF            + Conrad parallel port radio clock],
1960
 
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1961
 
if test "$ntp_ok" = "yes"; then
1962
 
    ntp_refclock=yes
1963
 
    AC_DEFINE(CLOCK_PCF)
1964
 
fi
1965
 
AC_MSG_RESULT($ntp_ok)
1966
 
 
1967
 
AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
1968
 
AC_ARG_ENABLE(SPECTRACOM,       [  --enable-SPECTRACOM     + Spectracom 8170/Netclock/2 WWVB receiver],
1969
 
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
1970
 
if test "$ntp_ok" = "yes"; then
1971
 
    ntp_refclock=yes
1972
 
    AC_DEFINE(CLOCK_SPECTRACOM)
 
2276
AC_ARG_ENABLE(TRAK,
 
2277
    AC_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver]),
 
2278
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
 
2279
if test "$ntp_ok" = "yes"; then
 
2280
    ntp_refclock=yes
 
2281
    AC_DEFINE(CLOCK_TRAK, 1, [TRAK 8810 GPS receiver])
1973
2282
fi
1974
2283
AC_MSG_RESULT($ntp_ok)
1975
2284
 
1976
2285
# Not on a vax-dec-bsd
1977
2286
AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
1978
 
AC_ARG_ENABLE(TRUETIME,         [  --enable-TRUETIME       s Kinemetrics/TrueTime receivers],
 
2287
AC_ARG_ENABLE(TRUETIME,
 
2288
    AC_HELP_STRING([--enable-TRUETIME], [s Kinemetrics/TrueTime receivers]),
1979
2289
    [ntp_ok=$enableval],
1980
 
    [case "$target" in
 
2290
    [case "$host" in
1981
2291
     vax-dec-bsd)
1982
2292
        ntp_ok=no
1983
2293
        ;;
1987
2297
    esac])
1988
2298
if test "$ntp_ok" = "yes"; then
1989
2299
    ntp_refclock=yes
1990
 
    AC_DEFINE(CLOCK_TRUETIME)
 
2300
    AC_DEFINE(CLOCK_TRUETIME, 1, [Kinemetrics/TrueTime receivers])
1991
2301
fi
1992
2302
AC_MSG_RESULT($ntp_ok)
1993
 
case "$ntp_ok$target" in
 
2303
case "$ntp_ok$host" in
1994
2304
 yesvax-dec-bsd) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
1995
2305
esac
1996
2306
 
 
2307
AC_MSG_CHECKING(TrueTime 560 IRIG-B decoder)
 
2308
AC_ARG_ENABLE(TT560,
 
2309
    AC_HELP_STRING([--enable-TT560], [- TrueTime 560 IRIG-B decoder]),
 
2310
    [ntp_ok=$enableval], [ntp_ok=no])
 
2311
if test "$ntp_ok" = "yes"; then
 
2312
    ntp_refclock=yes
 
2313
    AC_DEFINE(CLOCK_TT560, , [TrueTime 560 IRIG-B decoder?])
 
2314
fi
 
2315
AC_MSG_RESULT($ntp_ok)
 
2316
 
1997
2317
AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
1998
 
AC_ARG_ENABLE(ULINK,            [  --enable-ULINK          + Ultralink WWVB receiver],
 
2318
AC_ARG_ENABLE(ULINK,
 
2319
    AC_HELP_STRING([--enable-ULINK], [+ Ultralink WWVB receiver]),
1999
2320
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2000
2321
if test "$ntp_ok" = "yes"; then
2001
2322
    ntp_refclock=yes
2002
 
    AC_DEFINE(CLOCK_ULINK)
 
2323
    AC_DEFINE(CLOCK_ULINK, 1, [Ultralink M320 WWVB receiver?])
 
2324
fi
 
2325
AC_MSG_RESULT($ntp_ok)
 
2326
 
 
2327
# Requires modem control
 
2328
AC_MSG_CHECKING(USNO modem service)
 
2329
AC_ARG_ENABLE(USNO,
 
2330
    AC_HELP_STRING([--enable-USNO], [s USNO modem service]),
 
2331
    [ntp_ok=$enableval],
 
2332
    [AC_EGREP_CPP(yes,
 
2333
        [#include <termios.h>
 
2334
#ifdef HAVE_SYS_IOCTL_H
 
2335
#include <sys/ioctl.h>
 
2336
#endif
 
2337
#ifdef TIOCMBIS
 
2338
         yes
 
2339
#endif
 
2340
         ], ntp_ok=$ntp_eac, ntp_ok=no)])
 
2341
if test "$ntp_ok" = "yes"; then
 
2342
    ntp_refclock=yes
 
2343
    AC_DEFINE(CLOCK_USNO, 1, [USNO modem service])
2003
2344
fi
2004
2345
AC_MSG_RESULT($ntp_ok)
2005
2346
 
2006
2347
AC_MSG_CHECKING(WWV receiver)
2007
 
AC_ARG_ENABLE(WWV,              [  --enable-WWV            + WWV Audio receiver],
 
2348
AC_ARG_ENABLE(WWV,
 
2349
    AC_HELP_STRING([--enable-WWV], [s WWV Audio receiver]),
2008
2350
    [ntp_ok=$enableval],
2009
2351
    [case "$ntp_eac$ntp_canaudio" in
2010
2352
     *no*)      ntp_ok=no  ;;
2012
2354
    esac])
2013
2355
if test "$ntp_ok" = "yes"; then
2014
2356
    ntp_refclock=yes
2015
 
    AC_DEFINE(CLOCK_WWV)
 
2357
    AC_DEFINE(CLOCK_WWV, 1, [WWV audio driver])
2016
2358
fi
2017
2359
AC_MSG_RESULT($ntp_ok)
2018
2360
case "$ntp_ok$ntp_canaudio" in
2019
2361
 yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
2020
2362
esac
2021
2363
 
2022
 
# Requires modem control
2023
 
AC_MSG_CHECKING(USNO modem service)
2024
 
AC_ARG_ENABLE(USNO,             [  --enable-USNO           s USNO modem service],
2025
 
    [ntp_ok=$enableval],
2026
 
    [AC_EGREP_CPP(yes,
2027
 
        [#include <termios.h>
2028
 
#ifdef HAVE_SYS_IOCTL_H
2029
 
#include <sys/ioctl.h>
2030
 
#endif
2031
 
#ifdef TIOCMBIS
2032
 
         yes
2033
 
#endif
2034
 
         ], ntp_ok=$ntp_eac, ntp_ok=no)])
 
2364
AC_MSG_CHECKING(for Zyfer receiver)
 
2365
AC_ARG_ENABLE(ZYFER,
 
2366
    AC_HELP_STRING([--enable-ZYFER], [+ Zyfer GPStarplus receiver]),
 
2367
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
2035
2368
if test "$ntp_ok" = "yes"; then
2036
2369
    ntp_refclock=yes
2037
 
    AC_DEFINE(CLOCK_USNO)
 
2370
    AC_DEFINE(CLOCK_ZYFER, 1, [Zyfer GPStarplus])
2038
2371
fi
2039
2372
AC_MSG_RESULT($ntp_ok)
2040
2373
 
2063
2396
ntp_rawdcf=no
2064
2397
 
2065
2398
AC_MSG_CHECKING(Diem Computime Radio Clock)
2066
 
AC_ARG_ENABLE(COMPUTIME,        [  --enable-COMPUTIME      s Diem Computime Radio Clock],
 
2399
AC_ARG_ENABLE(COMPUTIME,
 
2400
    AC_HELP_STRING([--enable-COMPUTIME], [s Diem Computime Radio Clock]),
2067
2401
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2068
2402
if test "$ntp_ok" = "yes"; then
2069
2403
    ntp_libparse=yes
2070
2404
    ntp_refclock=yes
2071
 
    AC_DEFINE(CLOCK_COMPUTIME)
 
2405
    AC_DEFINE(CLOCK_COMPUTIME, 1, [Diems Computime Radio Clock?])
2072
2406
fi
2073
2407
AC_MSG_RESULT($ntp_ok)
2074
2408
case "$ntp_ok$ntp_canparse" in
2078
2412
esac
2079
2413
 
2080
2414
AC_MSG_CHECKING(ELV/DCF7000 clock)
2081
 
AC_ARG_ENABLE(DCF7000,          [  --enable-DCF7000        s ELV/DCF7000 clock],
 
2415
AC_ARG_ENABLE(DCF7000,
 
2416
    AC_HELP_STRING([--enable-DCF7000], [s ELV/DCF7000 clock]),
2082
2417
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2083
2418
if test "$ntp_ok" = "yes"; then
2084
2419
    ntp_libparse=yes
2085
2420
    ntp_refclock=yes
2086
 
    AC_DEFINE(CLOCK_DCF7000)
 
2421
    AC_DEFINE(CLOCK_DCF7000, 1, [ELV/DCF7000 clock?])
2087
2422
fi
2088
2423
AC_MSG_RESULT($ntp_ok)
2089
2424
case "$ntp_ok$ntp_canparse" in
2093
2428
esac
2094
2429
 
2095
2430
AC_MSG_CHECKING(HOPF 6021 clock)
2096
 
AC_ARG_ENABLE(HOPF6021,         [  --enable-HOPF6021       s HOPF 6021 clock],
 
2431
AC_ARG_ENABLE(HOPF6021,
 
2432
    AC_HELP_STRING([--enable-HOPF6021 ], [s HOPF 6021 clock]),
2097
2433
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2098
2434
if test "$ntp_ok" = "yes"; then
2099
2435
    ntp_libparse=yes
2100
2436
    ntp_refclock=yes
2101
 
    AC_DEFINE(CLOCK_HOPF6021)
 
2437
    AC_DEFINE(CLOCK_HOPF6021, 1, [HOPF 6021 clock?])
2102
2438
fi
2103
2439
AC_MSG_RESULT($ntp_ok)
2104
2440
case "$ntp_ok$ntp_canparse" in
2108
2444
esac
2109
2445
 
2110
2446
AC_MSG_CHECKING(Meinberg clocks)
2111
 
AC_ARG_ENABLE(MEINBERG,         [  --enable-MEINBERG       s Meinberg clocks],
 
2447
AC_ARG_ENABLE(MEINBERG,
 
2448
    AC_HELP_STRING([--enable-MEINBERG], [s Meinberg clocks]),
2112
2449
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2113
2450
if test "$ntp_ok" = "yes"; then
2114
2451
    ntp_libparse=yes
2115
2452
    ntp_refclock=yes
2116
 
    AC_DEFINE(CLOCK_MEINBERG)
 
2453
    AC_DEFINE(CLOCK_MEINBERG, 1, [Meinberg clocks])
2117
2454
fi
2118
2455
AC_MSG_RESULT($ntp_ok)
2119
2456
case "$ntp_ok$ntp_canparse" in
2123
2460
esac
2124
2461
 
2125
2462
AC_MSG_CHECKING(DCF77 raw time code)
2126
 
AC_ARG_ENABLE(RAWDCF,           [  --enable-RAWDCF         s DCF77 raw time code],
 
2463
AC_ARG_ENABLE(RAWDCF,
 
2464
    AC_HELP_STRING([--enable-RAWDCF], [s DCF77 raw time code]),
2127
2465
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2128
2466
if test "$ntp_ok" = "yes"; then
2129
2467
    ntp_libparse=yes
2130
2468
    ntp_parseutil=yes
2131
2469
    ntp_refclock=yes
2132
2470
    ntp_rawdcf=yes
2133
 
    AC_DEFINE(CLOCK_RAWDCF)
 
2471
    AC_DEFINE(CLOCK_RAWDCF, 1, [DCF77 raw time code])
2134
2472
fi
2135
2473
AC_MSG_RESULT($ntp_ok)
2136
2474
case "$ntp_ok$ntp_canparse" in
2144
2482
    AC_CACHE_CHECK(if we must enable parity for RAWDCF,
2145
2483
    ac_cv_var_rawdcf_parity,
2146
2484
    [ans=no
2147
 
    case "$target" in
 
2485
    case "$host" in
2148
2486
     *-*-linux*)
2149
2487
        ans=yes
2150
2488
        ;;
2151
2489
    esac
2152
2490
    ac_cv_var_rawdcf_parity=$ans])
2153
2491
    case "$ac_cv_var_rawdcf_parity" in
2154
 
     yes) AC_DEFINE(RAWDCF_NO_IGNPAR) ;;
 
2492
     yes) AC_DEFINE(RAWDCF_NO_IGNPAR, 1, [Should we not IGNPAR (Linux)?]) ;;
2155
2493
    esac
2156
2494
    ;;
2157
2495
 
2161
2499
esac
2162
2500
 
2163
2501
AC_MSG_CHECKING(RCC 8000 clock)
2164
 
AC_ARG_ENABLE(RCC8000,          [  --enable-RCC8000        s RCC 8000 clock],
 
2502
AC_ARG_ENABLE(RCC8000,
 
2503
    AC_HELP_STRING([--enable-RCC8000], [s RCC 8000 clock]),
2165
2504
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2166
2505
if test "$ntp_ok" = "yes"; then
2167
2506
    ntp_libparse=yes
2168
2507
    ntp_refclock=yes
2169
 
    AC_DEFINE(CLOCK_RCC8000)
 
2508
    AC_DEFINE(CLOCK_RCC8000, 1, [RCC 8000 clock])
2170
2509
fi
2171
2510
AC_MSG_RESULT($ntp_ok)
2172
2511
case "$ntp_ok$ntp_canparse" in
2176
2515
esac
2177
2516
 
2178
2517
AC_MSG_CHECKING(Schmid DCF77 clock)
2179
 
AC_ARG_ENABLE(SCHMID,           [  --enable-SCHMID         s Schmid DCF77 clock],
 
2518
AC_ARG_ENABLE(SCHMID,
 
2519
    AC_HELP_STRING([--enable-SCHMID ], [s Schmid DCF77 clock]),
2180
2520
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2181
2521
if test "$ntp_ok" = "yes"; then
2182
2522
    ntp_libparse=yes
2183
2523
    ntp_refclock=yes
2184
 
    AC_DEFINE(CLOCK_SCHMID)
 
2524
    AC_DEFINE(CLOCK_SCHMID, 1, [Schmid DCF77 clock])
2185
2525
fi
2186
2526
AC_MSG_RESULT($ntp_ok)
2187
2527
case "$ntp_ok$ntp_canparse" in
2191
2531
esac
2192
2532
 
2193
2533
AC_MSG_CHECKING(Trimble GPS receiver/TAIP protocol)
2194
 
AC_ARG_ENABLE(TRIMTAIP,         [  --enable-TRIMTAIP       s Trimble GPS receiver/TAIP protocol],
 
2534
AC_ARG_ENABLE(TRIMTAIP,
 
2535
    AC_HELP_STRING([--enable-TRIMTAIP], [s Trimble GPS receiver/TAIP protocol]),
2195
2536
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2196
2537
if test "$ntp_ok" = "yes"; then
2197
2538
    ntp_libparse=yes
2198
2539
    ntp_refclock=yes
2199
 
    AC_DEFINE(CLOCK_TRIMTAIP)
 
2540
    AC_DEFINE(CLOCK_TRIMTAIP, 1, [Trimble GPS receiver/TAIP protocol])
2200
2541
fi
2201
2542
AC_MSG_RESULT($ntp_ok)
2202
2543
case "$ntp_ok$ntp_canparse" in
2206
2547
esac
2207
2548
 
2208
2549
AC_MSG_CHECKING(Trimble GPS receiver/TSIP protocol)
2209
 
AC_ARG_ENABLE(TRIMTSIP,         [  --enable-TRIMTSIP       s Trimble GPS receiver/TSIP protocol],
 
2550
AC_ARG_ENABLE(TRIMTSIP,
 
2551
    AC_HELP_STRING([--enable-TRIMTSIP], [s Trimble GPS receiver/TSIP protocol]),
2210
2552
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2211
2553
if test "$ntp_ok" = "yes"; then
2212
2554
    ntp_libparse=yes
2213
2555
    ntp_refclock=yes
2214
 
    AC_DEFINE(CLOCK_TRIMTSIP)
 
2556
    AC_DEFINE(CLOCK_TRIMTSIP, 1, [Trimble GPS receiver/TSIP protocol])
2215
2557
fi
2216
2558
AC_MSG_RESULT($ntp_ok)
2217
2559
case "$ntp_ok$ntp_canparse" in
2221
2563
esac
2222
2564
 
2223
2565
AC_MSG_CHECKING(WHARTON 400A Series clock)
2224
 
AC_ARG_ENABLE(WHARTON,          [  --enable-WHARTON        s WHARTON 400A Series clock],
 
2566
AC_ARG_ENABLE(WHARTON,
 
2567
    AC_HELP_STRING([--enable-WHARTON], [s WHARTON 400A Series clock]),
2225
2568
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2226
2569
if test "$ntp_ok" = "yes"; then
2227
2570
    ntp_libparse=yes
2228
2571
    ntp_refclock=yes
2229
 
    AC_DEFINE(CLOCK_WHARTON_400A)
 
2572
    AC_DEFINE(CLOCK_WHARTON_400A, 1, [WHARTON 400A Series protocol])
2230
2573
fi
2231
2574
AC_MSG_RESULT($ntp_ok)
2232
2575
case "$ntp_ok$ntp_canparse" in
2236
2579
esac
2237
2580
 
2238
2581
AC_MSG_CHECKING(VARITEXT clock)
2239
 
AC_ARG_ENABLE(VARITEXT,         [  --enable-VARITEXT       s VARITEXT clock],
 
2582
AC_ARG_ENABLE(VARITEXT,
 
2583
    AC_HELP_STRING([--enable-VARITEXT], [s VARITEXT clock]),
2240
2584
    [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
2241
2585
if test "$ntp_ok" = "yes"; then
2242
2586
    ntp_libparse=yes
2243
2587
    ntp_refclock=yes
2244
 
    AC_DEFINE(CLOCK_VARITEXT)
 
2588
    AC_DEFINE(CLOCK_VARITEXT, 1, [VARITEXT protocol])
2245
2589
fi
2246
2590
AC_MSG_RESULT($ntp_ok)
2247
2591
case "$ntp_ok$ntp_canparse" in
2258
2602
case "$ntp_libparse" in
2259
2603
 yes)
2260
2604
    ans=yes
2261
 
    AC_DEFINE(CLOCK_PARSE)
 
2605
    AC_DEFINE(CLOCK_PARSE, 1, [PARSE driver interface])
2262
2606
    LIBPARSE=../libparse/libparse.a
2263
2607
    MAKE_LIBPARSE=libparse.a
2264
 
    MAKE_CHECK_Y2K=check_y2k
2265
 
    AC_DEFINE(PPS_SAMPLE)
 
2608
    # HMS: check_y2k trips the 34 year problem now...
 
2609
    0 && MAKE_CHECK_Y2K=check_y2k
 
2610
    AC_DEFINE(PPS_SAMPLE, 1, [PPS auxiliary interface for ATOM?])
2266
2611
    AC_DEFINE(CLOCK_ATOM)
2267
2612
    ;;
2268
2613
esac
2269
2614
AC_MSG_RESULT($ans)
2270
2615
 
2271
 
AC_SUBST(RSAOBJS)
2272
 
AC_SUBST(RSASRCS)
2273
 
AC_SUBST(RSADIR)
2274
 
AC_SUBST(RSAREF)
2275
 
AC_SUBST(LIBRSAREF)
2276
 
AC_SUBST(MAKE_LIBRSAREF)
 
2616
# AC_SUBST(RSAOBJS)
 
2617
# AC_SUBST(RSASRCS)
 
2618
# AC_SUBST(RSADIR)
 
2619
# AC_SUBST(RSAREF)
 
2620
# AC_SUBST(LIBRSAREF)
 
2621
# AC_SUBST(MAKE_LIBRSAREF)
2277
2622
 
2278
2623
AC_SUBST(OPENSSL)
2279
2624
AC_SUBST(OPENSSL_INC)
2280
2625
AC_SUBST(OPENSSL_LIB)
2281
2626
 
2282
 
AC_SUBST(MAKE_NTP_GENKEYS)
 
2627
AC_SUBST(MAKE_NTP_KEYGEN)
2283
2628
 
2284
2629
AC_MSG_CHECKING(for openssl library directory)
2285
2630
AC_ARG_WITH(openssl-libdir,
2288
2633
case "$ans" in
2289
2634
 no) ;;
2290
2635
 yes) # Look in:
2291
 
    ans="/usr/lib /usr/local/lib /usr/local/ssl/lib"
 
2636
    ans="/usr/lib /usr/lib/openssl /usr/local/lib /usr/local/ssl/lib"
2292
2637
    ;;
2293
2638
 *) # Look where they said
2294
2639
    ;;
2298
2643
 *) # Look for libcrypto.a and libssl.a:
2299
2644
    for i in $ans no
2300
2645
    do
2301
 
        test -f $i/libcrypto.a -a -f $i/libssl.a && break
 
2646
        case "$host" in
 
2647
         *-*-darwin*)
 
2648
            test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
 
2649
            ;;
 
2650
         *)
 
2651
            test -f $i/libcrypto.a -a -f $i/libssl.a && break
 
2652
            ;;
 
2653
        esac
2302
2654
    done
2303
2655
    case "$i" in
2304
2656
     no)
2345
2697
esac
2346
2698
AC_MSG_RESULT($ans)
2347
2699
 
 
2700
AC_ARG_WITH(crypto,
 
2701
        AC_HELP_STRING([--with-crypto], [+ =openssl]),
 
2702
[ans=$withval], [ans=yes])
 
2703
case "$ans" in
 
2704
 no) ;;
 
2705
 yes|openssl)
 
2706
    if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
 
2707
    then
 
2708
        ans=no
 
2709
    else
 
2710
        # We have OpenSSL inc/lib - use them.
 
2711
        ans=openssl
 
2712
        CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
 
2713
        LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
 
2714
        AC_SUBST(LCRYPTO, [-lcrypto])
 
2715
        MAKE_NTP_KEYGEN=ntp-keygen
 
2716
        AC_DEFINE(OPENSSL, , [Use OpenSSL?])
 
2717
        AC_CHECK_FUNCS(EVP_md2 EVP_mdc2)
 
2718
    fi
 
2719
    ;;
 
2720
esac
2348
2721
AC_MSG_CHECKING(for the level of crypto support)
2349
 
AC_ARG_WITH(crypto,
2350
 
        AC_HELP_STRING([--with-crypto], [+ ={autokey,rsaref}]),
2351
 
dnl     AC_HELP_STRING([--with-crypto], [+ ={autokey,openssl,rsaref}]),
2352
 
[ans=$withval], [ans=yes])
2353
 
case "$ans" in
2354
 
 no) ;;
2355
 
 yes|rsaref|openssl)
2356
 
    case "$ans" in
2357
 
     yes|rsaref) # Just "rsaref" when OpenSSL is ready
2358
 
        ans=no
2359
 
        ;;
2360
 
     *)
2361
 
        if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
2362
 
        then
2363
 
            ans=no
2364
 
        else
2365
 
            # We have OpenSSL inc/lib - use them.
2366
 
            ans=openssl
2367
 
            CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
2368
 
            LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
2369
 
            LIBS="$LIBS -lcrypto"
2370
 
            AC_DEFINE(DES)
2371
 
            AC_DEFINE(OPENSSL, , [Use OpenSSL?])
2372
 
            AC_DEFINE(PUBKEY, , [Public key?])
2373
 
        fi
2374
 
        ;;
2375
 
    esac
2376
 
 
2377
 
    case "$ans" in
2378
 
     no)
2379
 
        if test -f $srcdir/rsaref2/source/digit.c
2380
 
        then
2381
 
            ans=rsaref
2382
 
            RSAOBJS=digit.o
2383
 
            RSASRCS="digit.c digit.h"
2384
 
            RSADIR=rsaref2
2385
 
        fi
2386
 
        if test -f $srcdir/rsaeuro1/source/rsaeuro.h
2387
 
        then
2388
 
            ans=rsaref
2389
 
            RSAOBJS="md4c.o shsc.o"
2390
 
            RSASRCS="md4c.c shsc.c"
2391
 
            RSADIR=rsaeuro1
2392
 
        fi
2393
 
        if test "$ans" = "rsaref"; then
2394
 
            LIBRSAREF=../librsaref/librsaref.a
2395
 
            MAKE_LIBRSAREF=librsaref.a
2396
 
            AC_DEFINE(DES)
2397
 
            AC_DEFINE(PUBKEY)
2398
 
            AC_DEFINE(RSAREF, , [Use RSAREF?])
2399
 
        fi
2400
 
        ;;
2401
 
    esac
2402
 
    ;;
2403
 
esac
2404
 
AC_SUBST(AUTOKEY)
2405
 
case "$ans" in
2406
 
 no) ;;
2407
 
 *)
2408
 
    AC_DEFINE(AUTOKEY, , [Autokey?])
2409
 
    AUTOKEY=1
2410
 
    ;;
2411
 
esac
2412
2722
AC_MSG_RESULT($ans)
2413
2723
 
2414
2724
AC_MSG_CHECKING(if we want to compile with ElectricFence)
2415
 
AC_ARG_WITH(electricfence,      [  --with-electricfence    - compile with ElectricFence malloc debugger],
 
2725
AC_ARG_WITH(electricfence,
 
2726
        AC_HELP_STRING([--with-electricfence], [- compile with ElectricFence malloc debugger]),
2416
2727
[ans=$withval], [ans=no])
2417
2728
case "$ans" in
2418
2729
 no) ;;
2427
2738
esac
2428
2739
AC_MSG_RESULT($ans)
2429
2740
 
 
2741
AC_MSG_CHECKING(if we want to try SNTP)
 
2742
AC_ARG_WITH(sntp,
 
2743
        AC_HELP_STRING([--with-sntp], [- Build SNTP?]),
 
2744
[ans=$withval], [ans=no])
 
2745
case "$ans" in
 
2746
 no) ;;
 
2747
 *)
 
2748
    MAKE_SNTP="sntp"
 
2749
    AC_SUBST(MAKE_SNTP)
 
2750
    ans=yes
 
2751
    ;;
 
2752
esac
 
2753
AC_MSG_RESULT($ans)
 
2754
 
2430
2755
AC_SUBST(TESTDCF)
2431
2756
AC_SUBST(DCFD)
2432
2757
 
2433
2758
AC_MSG_CHECKING(if we can make dcf parse utilities)
2434
2759
ans=no
2435
2760
if test "$ntp_parseutil" = "yes"; then
2436
 
    case "$target" in
 
2761
    case "$host" in
2437
2762
     *-*-sunos4*|*-*-solaris2*|*-*-linux*)
2438
2763
        ans="dcfd testdcf"
2439
2764
        DCFD=dcfd
2448
2773
ans=no
2449
2774
case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
2450
2775
 yesyes)
2451
 
    case "$target" in
 
2776
    case "$host" in
2452
2777
     sparc-*-sunos4*)
2453
2778
        case "$ac_cv_var_kernel_pll" in
2454
2779
        yes)
2455
 
            AC_DEFINE(PPS_SYNC)
 
2780
            AC_DEFINE(PPS_SYNC, 1, [PARSE kernel PLL PPS support])
2456
2781
            ;;
2457
2782
        esac
2458
2783
        ans=parsestreams
2469
2794
 
2470
2795
AC_MSG_CHECKING(if we need basic refclock support)
2471
2796
if test "$ntp_refclock" = "yes"; then
2472
 
    AC_DEFINE(REFCLOCK)
 
2797
    AC_DEFINE(REFCLOCK, 1, [Basic refclock support?])
2473
2798
fi
2474
2799
AC_MSG_RESULT($ntp_refclock)
2475
2800
 
2480
2805
 
2481
2806
AC_SUBST(MAKE_ADJTIMED)
2482
2807
AC_MSG_CHECKING(if we want HP-UX adjtimed support)
2483
 
case "$target" in
 
2808
case "$host" in
2484
2809
 *-*-hpux[[56789]]*)
2485
2810
    ans=yes
2486
2811
    ;;
2489
2814
esac
2490
2815
if test "$ans" = "yes"; then
2491
2816
    MAKE_ADJTIMED=adjtimed
2492
 
    AC_DEFINE(NEED_HPUX_ADJTIME)
 
2817
    AC_DEFINE(NEED_HPUX_ADJTIME, 1, [Do we need HPUX adjtime() library support?])
 
2818
fi
 
2819
AC_MSG_RESULT($ans)
 
2820
 
 
2821
AC_MSG_CHECKING(if we want QNX adjtime support)
 
2822
case "$host" in
 
2823
 *-*-qnx*)
 
2824
    ans=yes
 
2825
    ;;
 
2826
 *) ans=no
 
2827
    ;;
 
2828
esac
 
2829
if test "$ans" = "yes"; then
 
2830
    AC_DEFINE(NEED_QNX_ADJTIME, 1, [Do we need the qnx adjtime call?])
2493
2831
fi
2494
2832
AC_MSG_RESULT($ans)
2495
2833
 
2503
2841
     *) ans=no
2504
2842
        ;;
2505
2843
    esac
2506
 
    case "$target" in
 
2844
    case "$host" in
2507
2845
     *-*-aix*)
2508
2846
        #ans=no
2509
2847
        ;;
2522
2860
     *-*-winnt3.5)
2523
2861
        ans=no
2524
2862
        ;;
 
2863
     *-*-unicosmp*)
 
2864
        ans=no
 
2865
        ;;
2525
2866
    esac
2526
2867
    ])
2527
2868
ac_cv_var_can_kmem=$ans])
2528
2869
 
2529
2870
case "$ac_cv_var_can_kmem" in
2530
2871
 *yes*) ;;
2531
 
 *) AC_DEFINE(NOKMEM) ;;
 
2872
 *) AC_DEFINE(NOKMEM, 1, [Should we NOT read /dev/kmem?]) ;;
2532
2873
esac
2533
2874
 
2534
2875
AC_CACHE_CHECK(if adjtime is accurate, ac_cv_var_adjtime_is_accurate,
2535
2876
[AC_ARG_ENABLE(accurate-adjtime, [  --enable-accurate-adjtime
2536
2877
                          s the adjtime() call is accurate],
2537
2878
    [ans=$enableval],
2538
 
    [case "$target" in
 
2879
    [case "$host" in
2539
2880
      i386-sequent-ptx*)
2540
2881
         ans=no
2541
2882
         ;;
2548
2889
      *-fujitsu-uxp*)
2549
2890
         ans=yes
2550
2891
         ;;
2551
 
      *-ibm-aix4*)
 
2892
      *-ibm-aix[[45]]*)
2552
2893
         ans=yes
2553
2894
         ;;
2554
2895
      *-*-linux*)
2555
2896
         ans=yes
2556
2897
         ;;
2557
 
      *-*-solaris2.[[01]]*)
 
2898
      *-*-solaris2.[[01]])
2558
2899
         ans=no
2559
2900
         ;;
2560
2901
      *-*-solaris2*)
2561
2902
         ans=yes
2562
2903
         ;;
 
2904
      *-*-unicosmp*)
 
2905
         ans=yes
 
2906
         ;;
2563
2907
      *) ans=no
2564
2908
         ;;
2565
2909
     esac
2566
2910
     ])
2567
2911
ac_cv_var_adjtime_is_accurate=$ans])
2568
2912
case "$ac_cv_var_adjtime_is_accurate" in
2569
 
 yes) AC_DEFINE(ADJTIME_IS_ACCURATE) ;;
 
2913
 yes) AC_DEFINE(ADJTIME_IS_ACCURATE, 1, [Is adjtime() accurate?]) ;;
2570
2914
esac
2571
2915
 
2572
2916
AC_CACHE_CHECK([the name of 'tick' in the kernel],
2573
2917
ac_cv_var_nlist_tick,
2574
2918
[ans=_tick
2575
 
case "$target" in
 
2919
case "$host" in
2576
2920
 m68*-hp-hpux*) # HP9000/300?
2577
2921
    ans=_old_tick
2578
2922
    ;;
2582
2926
 *-hp-hpux*)
2583
2927
    ans=old_tick
2584
2928
    ;;
2585
 
 *-ibm-aix[[34]]*)
 
2929
 *-ibm-aix[[345]]*)
 
2930
    ans=no
 
2931
    ;;
 
2932
 *-*-mpeix*)
2586
2933
    ans=no
2587
2934
    ;;
2588
2935
 *-*-ptx*)
2601
2948
ac_cv_var_nlist_tick=$ans])
2602
2949
case "$ac_cv_var_nlist_tick" in
2603
2950
 ''|no) ;;      # HMS: I think we can only get 'no' here...
2604
 
 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick") ;;
 
2951
 *) AC_DEFINE_UNQUOTED(K_TICK_NAME, "$ac_cv_var_nlist_tick", [What is the name of TICK in the kernel?]) ;;
2605
2952
esac
2606
2953
#
2607
2954
AC_CACHE_CHECK([for the units of 'tick'],
2608
2955
ac_cv_var_tick_nano,
2609
2956
[ans=usec
2610
 
case "$target" in
 
2957
case "$host" in
2611
2958
 *-*-solaris2*)
2612
2959
    ans=nsec
2613
2960
    ;;
2615
2962
ac_cv_var_tick_nano=$ans])
2616
2963
case "$ac_cv_var_tick_nano" in
2617
2964
 nsec)
2618
 
    AC_DEFINE(TICK_NANO)
 
2965
    AC_DEFINE(TICK_NANO, 1, [Is K_TICK_NAME in nanoseconds?])
2619
2966
    ;;
2620
2967
esac
2621
2968
#
2622
2969
AC_CACHE_CHECK([the name of 'tickadj' in the kernel],
2623
2970
ac_cv_var_nlist_tickadj,
2624
2971
[ans=_tickadj
2625
 
case "$target" in
 
2972
case "$host" in
2626
2973
 m68*-hp-hpux*) # HP9000/300?
2627
2974
    ans=_tickadj
2628
2975
    ;;
2641
2988
 *-*-aix*)
2642
2989
    ans=tickadj
2643
2990
    ;;
 
2991
 *-*-mpeix*)
 
2992
    ans=no
 
2993
    ;;
2644
2994
 *-*-ptx*)
2645
2995
    ans=tickadj
2646
2996
    ;;
2660
3010
ac_cv_var_nlist_tickadj=$ans])
2661
3011
case "$ac_cv_var_nlist_tickadj" in
2662
3012
 ''|no) ;;      # HMS: I think we can only get 'no' here...
2663
 
 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj") ;;
 
3013
 *) AC_DEFINE_UNQUOTED(K_TICKADJ_NAME, "$ac_cv_var_nlist_tickadj", [What is the name of TICKADJ in the kernel?]) ;;
2664
3014
esac
2665
3015
#
2666
3016
AC_CACHE_CHECK([for the units of 'tickadj'],
2667
3017
ac_cv_var_tickadj_nano,
2668
3018
[ans=usec
2669
 
case "$target" in
 
3019
case "$host" in
2670
3020
 *-*-solaris2*)
2671
3021
    ans=nsec
2672
3022
    ;;
2674
3024
ac_cv_var_tickadj_nano=$ans])
2675
3025
case "$ac_cv_var_tickadj_nano" in
2676
3026
 nsec)
2677
 
    AC_DEFINE(TICKADJ_NANO)
 
3027
    AC_DEFINE(TICKADJ_NANO, 1, [Is K_TICKADJ_NAME in nanoseconds?])
2678
3028
    ;;
2679
3029
esac
2680
3030
#
2681
3031
AC_CACHE_CHECK([half-heartedly for 'dosynctodr' in the kernel],
2682
3032
ac_cv_var_nlist_dosynctodr,
2683
 
[case "$target" in
 
3033
[case "$host" in
2684
3034
 *-apple-aux[[23]]*)
2685
3035
    ans=no
2686
3036
    ;;
2693
3043
 *-*-hpux*)
2694
3044
    ans=no
2695
3045
    ;;
 
3046
 *-*-mpeix*)
 
3047
    ans=no
 
3048
    ;;
2696
3049
 *-*-nextstep*)
2697
3050
    ans=_dosynctodr
2698
3051
    ;;
2718
3071
ac_cv_var_nlist_dosynctodr=$ans])
2719
3072
case "$ac_cv_var_nlist_dosynctodr" in
2720
3073
 no) ;;
2721
 
 *)  AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr")
 
3074
 *)  AC_DEFINE_UNQUOTED(K_DOSYNCTODR_NAME, "$ac_cv_var_nlist_dosynctodr", [What is (probably) the name of DOSYNCTODR in the kernel?])
2722
3075
     ;;
2723
3076
esac
2724
3077
#
2725
3078
AC_CACHE_CHECK([half-heartedly for 'noprintf' in the kernel],
2726
3079
ac_cv_var_nlist_noprintf,
2727
 
[case "$target" in
 
3080
[case "$host" in
2728
3081
 *-apple-aux[[23]]*)
2729
3082
    ans=no
2730
3083
    ;;
2737
3090
 *-*-hpux*)
2738
3091
    ans=no
2739
3092
    ;;
 
3093
 *-*-mpeix*)
 
3094
    ans=no
 
3095
    ;;
2740
3096
 *-*-ptx*)
2741
3097
    ans=noprintf
2742
3098
    ;;
2756
3112
ac_cv_var_nlist_noprintf=$ans])
2757
3113
case "$ac_cv_var_nlist_noprintf" in
2758
3114
 no) ;;
2759
 
 *)  AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf")
 
3115
 *)  AC_DEFINE_UNQUOTED(K_NOPRINTF_NAME, "$ac_cv_var_nlist_noprintf", [What is (probably) the name of NOPRINTF in the kernel?])
2760
3116
     ;;
2761
3117
esac
2762
3118
 
2781
3137
[AC_ARG_ENABLE(tick,            [  --enable-tick=VALUE     s force a value for 'tick'],
2782
3138
    [ans=$enableval],
2783
3139
    [ans=no
2784
 
     case "$target" in
 
3140
     case "$host" in
2785
3141
      XXX-*-pc-cygwin*)
2786
3142
         ;;
2787
3143
      *-univel-sysv*)
2793
3149
      *-*-linux*)
2794
3150
         ans=txc.tick
2795
3151
         ;;
 
3152
      *-*-mpeix*)
 
3153
         ans=no
 
3154
         ;;
2796
3155
      *-*-winnt3.5)
2797
3156
         ans='(every / 10)'
2798
3157
         ;;
 
3158
      *-*-unicosmp*)
 
3159
         ans=10000
 
3160
         ;;
2799
3161
      *)
2800
3162
         ans='1000000L/hz'
2801
3163
         ;;
2803
3165
ac_cv_var_tick=$ans])
2804
3166
case "$ac_cv_var_tick" in
2805
3167
 ''|no) ;;      # HMS: I think we can only get 'no' here...
2806
 
 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick) ;;
 
3168
 *) AC_DEFINE_UNQUOTED(PRESET_TICK, $ac_cv_var_tick, [Preset a value for 'tick'?]) ;;
2807
3169
esac
2808
3170
 
2809
3171
AC_CACHE_CHECK(for a default value for 'tickadj', ac_cv_var_tickadj,
2810
3172
[AC_ARG_ENABLE(tickadj,         [  --enable-tickadj=VALUE  s force a value for 'tickadj'],
2811
3173
  [ans=$enableval],
2812
3174
  [ans='500/hz'
2813
 
  case "$target" in
 
3175
  case "$host" in
2814
3176
   *-fujitsu-uxp*)
2815
3177
      case "$ac_cv_var_adjtime_is_accurate" in
2816
3178
       yes) ans='tick/16' ;;
2840
3202
   *-*-irix*)
2841
3203
      ans=150
2842
3204
      ;;
 
3205
   *-*-mpeix*)
 
3206
      ans=no
 
3207
      ;;
2843
3208
   *-*-sco3.2v5.0*)
2844
3209
      ans=10000L/hz
2845
3210
      ;;
2853
3218
   *-*-winnt3.5)
2854
3219
      ans=50
2855
3220
      ;;
 
3221
   *-*-unicosmp*)
 
3222
      ans=150
 
3223
      ;;
2856
3224
  esac])
2857
3225
ac_cv_var_tickadj=$ans])
2858
3226
case "$ac_cv_var_tickadj" in
2859
3227
 ''|no) ;;      # HMS: I think we can only get 'no' here...
2860
 
 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj) ;;
 
3228
 *) AC_DEFINE_UNQUOTED(PRESET_TICKADJ, $ac_cv_var_tickadj, [Preset a value for 'tickadj'?]) ;;
2861
3229
esac
2862
3230
 
2863
3231
# Newer versions of ReliantUNIX round adjtime() values down to
2864
3232
# 1/100s (system tick). Sigh ...
2865
3233
# Unfortunately, there is no easy way to know if particular release
2866
3234
# has this "feature" or any obvious way to test for it.
2867
 
case "$target" in
2868
 
 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK) ;;
 
3235
case "$host" in
 
3236
 mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX_CLOCK, 1, [Do we want the ReliantUNIX clock hacks?]) ;;
2869
3237
esac
2870
3238
 
2871
 
case "$target" in
2872
 
 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK) ;;
 
3239
case "$host" in
 
3240
 *-*-sco3.2v5*) AC_DEFINE(SCO5_CLOCK, 1, [Do we want the SCO clock hacks?]) ;;
2873
3241
esac
2874
3242
 
2875
3243
ac_cv_make_tickadj=yes
2904
3272
 
2905
3273
AC_SUBST(MAKE_NTPTIME)
2906
3274
AC_CACHE_CHECK(if we want and can make the ntptime utility, ac_cv_make_ntptime,
2907
 
[case "$target" in
 
3275
[case "$host" in
2908
3276
 *) case "$ac_cv_struct_ntptimeval$ac_cv_var_kernel_pll" in
2909
3277
     yesyes)
2910
3278
        ans=yes
2923
3291
esac
2924
3292
 
2925
3293
AC_SUBST(MAKE_TICKADJ)
2926
 
case "$target" in
 
3294
case "$host" in
2927
3295
 mips-sni-sysv4*)
2928
3296
    # tickadj is pretty useless on newer versions of ReliantUNIX
2929
3297
    # Do not bother
2934
3302
    ;;
2935
3303
 *-*-solaris2*)
2936
3304
    # DLM says tickadj is a no-no starting with solaris2.5
2937
 
    case "$target" in
2938
 
     *-*-solaris2.[0-4]*) ;;
 
3305
    case "$host" in
 
3306
     *-*-solaris2.1[[0-9]]*)
 
3307
        ac_cv_make_tickadj=no
 
3308
        ;;
 
3309
     *-*-solaris2.[[0-4]]*) ;;
2939
3310
     *) ac_cv_make_tickadj=no ;;
2940
3311
    esac
2941
3312
    ;;
 
3313
 *-*-unicosmp*)
 
3314
    ac_cv_make_tickadj=no
 
3315
    ;;
2942
3316
esac
2943
3317
AC_CACHE_CHECK(if we want and can make the tickadj utility, ac_cv_make_tickadj,
2944
3318
ac_cv_make_tickadj=yes)
2950
3324
 
2951
3325
AC_SUBST(MAKE_TIMETRIM)
2952
3326
AC_CACHE_CHECK(if we want and can make the timetrim utility, ac_cv_make_timetrim,
2953
 
[case "$target" in
 
3327
[case "$host" in
2954
3328
 *-*-irix*)
2955
3329
    ac_cv_make_timetrim=yes
2956
3330
    ;;
 
3331
 *-*-unicosmp*)
 
3332
    ac_cv_make_timetrim=yes
 
3333
    ;;
2957
3334
 *)
2958
3335
    ac_cv_make_timetrim=no
2959
3336
    ;;
2964
3341
    ;;
2965
3342
esac
2966
3343
 
 
3344
AC_SUBST(MAKE_LIBNTPSIM)
 
3345
AC_SUBST(MAKE_NTPDSIM)
 
3346
AC_CACHE_CHECK([if we want to build the NTPD simulator], ac_cv_var_ntpd_sim,
 
3347
[AC_ARG_ENABLE(simulator,
 
3348
    AC_HELP_STRING([--enable-simulator], [- build/install the NTPD simulator?]),
 
3349
    [ans=$enableval], [ans=no])
 
3350
ac_cv_var_ntpd_sim=$ans])
 
3351
case "$ac_cv_var_ntpd_sim" in
 
3352
 yes)
 
3353
    MAKE_NTPDSIM=ntpdsim
 
3354
    MAKE_LIBNTPSIM=libntpsim.a
 
3355
    ;;
 
3356
esac
 
3357
 
2967
3358
AC_CACHE_CHECK(if we want UDP wildcard delivery, ac_cv_var_udp_wildcard_delivery,
2968
3359
[AC_ARG_ENABLE(udp-wildcard,    [  --enable-udp-wildcard   s use UDP wildcard delivery],
2969
3360
    [ans=$enableval],
2970
3361
    [ans=no
2971
 
     case "$target" in
 
3362
     case "$host" in
2972
3363
      *-fujitsu-uxp*)
2973
3364
         ans=yes
2974
3365
         ;;
2978
3369
      *-*-aix3.2*)
2979
3370
         ans=yes
2980
3371
         ;;
2981
 
      *-*-aix4*)
 
3372
      *-*-aix[[45]]*)
2982
3373
         ans=yes
2983
3374
         ;;
2984
3375
      *-*-bsdi*)
2999
3390
      *-*-linux*)
3000
3391
         ans=yes
3001
3392
         ;;
 
3393
      *-*-mpeix*)
 
3394
         ans=yes
 
3395
         ;;
3002
3396
      *-*-osf*)
3003
3397
         ans=yes
3004
3398
         ;;
3011
3405
      *-*-sunos4*)
3012
3406
         ans=yes
3013
3407
         ;;
 
3408
      *-*-unicosmp*)
 
3409
         ans=yes
 
3410
         ;;
3014
3411
     esac])
3015
3412
ac_cv_var_udp_wildcard_delivery=$ans])
3016
3413
case "$ac_cv_var_udp_wildcard_delivery" in
3017
 
 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY) ;;
 
3414
 yes) AC_DEFINE(UDP_WILDCARD_DELIVERY, 1, [use UDP Wildcard Delivery?]) ;;
3018
3415
esac
3019
3416
 
3020
 
case "$host" in
3021
 
 $target)
 
3417
case "$build" in
 
3418
 $host)
3022
3419
    ;;
3023
 
 *) case "$target" in
 
3420
 *) case "$host" in
3024
3421
     *-*-vxworks*)
3025
3422
        LDFLAGS="$LDFLAGS -r"
3026
3423
        ;;
3031
3428
AC_CACHE_CHECK(if we should always slew the time, ac_cv_var_slew_always,
3032
3429
[AC_ARG_ENABLE(slew-always,      [  --enable-slew-always    s always slew the time],
3033
3430
    [ans=$enableval],
3034
 
    [case "$target" in
 
3431
    [case "$host" in
3035
3432
      *-apple-aux[[23]]*)
3036
3433
         ans=yes
3037
3434
         ;;
3050
3447
     ])
3051
3448
ac_cv_var_slew_always=$ans])
3052
3449
case "$ac_cv_var_slew_always" in
3053
 
 yes) AC_DEFINE(SLEWALWAYS) ;;
 
3450
 yes) AC_DEFINE(SLEWALWAYS, 1, [Slew always?]) ;;
3054
3451
esac
3055
3452
 
3056
3453
AC_CACHE_CHECK(if we should step and slew the time, ac_cv_var_step_slew,
3057
3454
[AC_ARG_ENABLE(step-slew,        [  --enable-step-slew      s step and slew the time],
3058
3455
    [ans=$enableval],
3059
 
    [case "$target" in
 
3456
    [case "$host" in
3060
3457
      *-sni-sysv*)
3061
3458
         ans=yes
3062
3459
         ;;
3066
3463
      *-*-ptx*)
3067
3464
         ans=yes
3068
3465
         ;;
 
3466
      *-*-solaris2.1[[0-9]]*)
 
3467
         ans-no
 
3468
         ;;
3069
3469
      *-*-solaris2.[[012]]*)
3070
3470
         ans=yes
3071
3471
         ;;
3078
3478
     ])
3079
3479
ac_cv_var_step_slew=$ans])
3080
3480
case "$ac_cv_var_step_slew" in
3081
 
 yes) AC_DEFINE(STEP_SLEW) ;;
 
3481
 yes) AC_DEFINE(STEP_SLEW, 1, [Step, then slew the clock?]) ;;
3082
3482
esac
3083
3483
 
3084
3484
AC_CACHE_CHECK(if ntpdate should step the time, ac_cv_var_ntpdate_step,
3085
3485
[AC_ARG_ENABLE(ntpdate-step,     [  --enable-ntpdate-step   s if ntpdate should step the time],
3086
3486
    [ans=$enableval],
3087
 
    [case "$target" in
 
3487
    [case "$host" in
3088
3488
      *-apple-aux[[23]]*)
3089
3489
         ans=yes
3090
3490
         ;;
3094
3494
     ])
3095
3495
ac_cv_var_ntpdate_step=$ans])
3096
3496
case "$ac_cv_var_ntpdate_step" in
3097
 
 yes) AC_DEFINE(FORCE_NTPDATE_STEP) ;;
 
3497
 yes) AC_DEFINE(FORCE_NTPDATE_STEP, 1, [force ntpdate to step the clock if !defined(STEP_SLEW) ?]) ;;
3098
3498
esac
3099
3499
 
3100
3500
AC_CACHE_CHECK(if we should sync TODR clock every hour, ac_cv_var_sync_todr,
3101
3501
[AC_ARG_ENABLE(hourly-todr-sync, [  --enable-hourly-todr-sync
3102
3502
                          s if we should sync TODR hourly],
3103
3503
    [ans=$enableval],
3104
 
    [case "$target" in
 
3504
    [case "$host" in
3105
3505
      *-*-nextstep*)
3106
3506
         ans=yes
3107
3507
         ;;
3113
3513
     esac])
3114
3514
ac_cv_var_sync_todr=$ans])
3115
3515
case "$ac_cv_var_sync_todr" in
3116
 
 yes) AC_DEFINE(DOSYNCTODR) ;;
 
3516
 yes) AC_DEFINE(DOSYNCTODR, 1, [synch TODR hourly?]) ;;
3117
3517
esac
3118
3518
 
3119
3519
AC_CACHE_CHECK(if we should avoid kernel FLL bug, ac_cv_var_kernel_fll_bug,
3120
3520
[AC_ARG_ENABLE(kernel-fll-bug, [  --enable-kernel-fll-bug s if we should avoid a kernel FLL bug],
3121
3521
    [ans=$enableval],
3122
 
    [case "$target" in
 
3522
    [case "$host" in
3123
3523
     *-*-solaris2.6)
3124
3524
         unamev=`uname -v`
3125
3525
         case "$unamev" in
3166
3566
    ])
3167
3567
ac_cv_var_kernel_fll_bug=$ans])
3168
3568
case "$ac_cv_var_kernel_fll_bug" in
3169
 
 yes) AC_DEFINE(KERNEL_FLL_BUG) ;;
3170
 
esac
3171
 
 
 
3569
 yes) AC_DEFINE(KERNEL_FLL_BUG, 1, [Does the kernel have an FLL bug?]) ;;
 
3570
esac
 
3571
 
 
3572
AC_CACHE_CHECK(if we should use the IRIG sawtooth filter, ac_cv_var_irig_sucks,
 
3573
[AC_ARG_ENABLE(irig-sawtooth, 
 
3574
        AC_HELP_STRING([--enable-irig-sawtooth], [s if we should enable the IRIG sawtooth filter]),
 
3575
    [ans=$enableval],
 
3576
    [case "$host" in
 
3577
     *-*-solaris2.[[89]])
 
3578
        ans=yes
 
3579
        ;;
 
3580
     *-*-solaris2.1[[0-9]]*)
 
3581
        ans=yes
 
3582
        ;;
 
3583
     *) ans=no
 
3584
        ;;
 
3585
    esac
 
3586
    ])
 
3587
ac_cv_var_irig_sucks=$ans])
 
3588
case "$ac_cv_var_irig_sucks" in
 
3589
 yes) AC_DEFINE(IRIG_SUCKS, 1, [Should we use the IRIG sawtooth filter?]) ;;
 
3590
esac
 
3591
 
 
3592
AC_CACHE_CHECK(if we should enable NIST lockclock scheme, ac_cv_var_nist_lockclock,
 
3593
[AC_ARG_ENABLE(nist, 
 
3594
        AC_HELP_STRING([--enable-nist], [- if we should enable the NIST lockclock scheme]),
 
3595
    [ans=$enableval],[ans=no])
 
3596
ac_cv_var_nist_lockclock=$ans])
 
3597
case "$ac_cv_var_nist_lockclock" in
 
3598
 yes) AC_DEFINE(LOCKCLOCK, 1, [Should we align with the NIST lockclock scheme?]) ;;
 
3599
esac
 
3600
 
 
3601
AC_CACHE_CHECK(if we should cache bad destination addresses, ac_cv_errorcache,
 
3602
[AC_ARG_ENABLE(errorcache, 
 
3603
        AC_HELP_STRING([--enable-errorcache], [- if we should enable caching bad IP destinations]),
 
3604
    [ans=$enableval],[ans=no])
 
3605
ac_cv_errorcache=$ans])
 
3606
case "$ac_cv_errorcache" in
 
3607
 yes) AC_DEFINE(ERRORCACHE, 10, [Should we cache bad destination addresses?]) ;;
 
3608
 no) AC_DEFINE(ERRORCACHE, 0, [Should we cache bad destination addresses?]) ;;
 
3609
esac
 
3610
 
 
3611
#
 
3612
# ISC stuff
 
3613
#
 
3614
 
 
3615
if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
 
3616
    AC_DEFINE(ISC_PLATFORM_HAVESALEN, ,[ISC: struct sockaddr as sa_len?])
 
3617
fi
 
3618
 
 
3619
AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [use IPv6?]))
 
3620
 
 
3621
case "$enable_ipv6" in
 
3622
 yes|''|autodetect)
 
3623
    case "$host" in
 
3624
     powerpc-ibm-aix4*) ;;
 
3625
     *)
 
3626
        AC_DEFINE(WANT_IPV6, ,[ISC: Want IPv6?])
 
3627
        ;;
 
3628
    esac
 
3629
    ;;
 
3630
 no)
 
3631
    ;;
 
3632
esac
 
3633
 
 
3634
AC_MSG_CHECKING(for IPv6 structures)
 
3635
AC_TRY_COMPILE([
 
3636
#include <sys/types.h>
 
3637
#include <sys/socket.h>
 
3638
#include <netinet/in.h>],
 
3639
[struct sockaddr_in6 sin6; return (0);],
 
3640
        [AC_MSG_RESULT(yes)
 
3641
         found_ipv6=yes],
 
3642
        [AC_MSG_RESULT(no)
 
3643
         found_ipv6=no])
 
3644
 
 
3645
#
 
3646
# See whether IPv6 support is provided via a Kame add-on.
 
3647
# This is done before other IPv6 linking tests so LIBS is properly set.
 
3648
#
 
3649
AC_MSG_CHECKING(for Kame IPv6 support)
 
3650
AC_ARG_WITH(kame,
 
3651
        [  --with-kame[=PATH]   use Kame IPv6 [default path /usr/local/v6]],
 
3652
        use_kame="$withval", use_kame="no")
 
3653
 
 
3654
case "$use_kame" in
 
3655
        no)
 
3656
                ;;
 
3657
        yes)
 
3658
                kame_path=/usr/local/v6
 
3659
                ;;
 
3660
        *)
 
3661
                kame_path="$use_kame"
 
3662
                ;;
 
3663
esac
 
3664
 
 
3665
case "$use_kame" in
 
3666
        no)
 
3667
                AC_MSG_RESULT(no)
 
3668
                ;;
 
3669
        *)
 
3670
                if test -f $kame_path/lib/libinet6.a; then
 
3671
                        AC_MSG_RESULT($kame_path/lib/libinet6.a)
 
3672
                        LIBS="-L$kame_path/lib -linet6 $LIBS"
 
3673
                else
 
3674
                        AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
 
3675
 
 
3676
Please choose the proper path with the following command:
 
3677
 
 
3678
    configure --with-kame=PATH
 
3679
])
 
3680
                fi
 
3681
                ;;
 
3682
esac
 
3683
 
 
3684
#
 
3685
# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
 
3686
# Including it on Kame-using platforms is very bad, though, because
 
3687
# Kame uses #error against direct inclusion.   So include it on only
 
3688
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
 
3689
# This is done before the in6_pktinfo check because that's what
 
3690
# netinet6/in6.h is needed for.
 
3691
#
3172
3692
case "$host" in
3173
 
 $target)
3174
 
    ;;
3175
 
 *) case "$target" in
 
3693
*-bsdi4.[[01]]*)
 
3694
        ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
 
3695
        LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
 
3696
        isc_netinet6in6_hack="#include <netinet6/in6.h>"
 
3697
        ;;
 
3698
*)
 
3699
        ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
 
3700
        LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
 
3701
        isc_netinet6in6_hack=""
 
3702
        ;;
 
3703
esac
 
3704
 
 
3705
AC_MSG_CHECKING([for struct if_laddrconf])
 
3706
AC_TRY_LINK([
 
3707
#include <sys/types.h>
 
3708
#include <net/if6.h>
 
3709
],[ struct if_laddrconf a; ],
 
3710
        [AC_MSG_RESULT(yes)
 
3711
         AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRCONF, ,
 
3712
                [ISC: have struct if_laddrconf?])],
 
3713
        [AC_MSG_RESULT(no)])
 
3714
 
 
3715
AC_MSG_CHECKING([for struct if_laddrreq])
 
3716
AC_TRY_LINK([
 
3717
#include <sys/types.h>
 
3718
#include <net/if6.h>
 
3719
],[ struct if_laddrreq a; ],
 
3720
        [AC_MSG_RESULT(yes)
 
3721
         AC_DEFINE(ISC_PLATFORM_HAVEIF_LADDRREQ, ,
 
3722
                [ISC: have struct if_laddrreq?])],
 
3723
        [AC_MSG_RESULT(no)])
 
3724
 
 
3725
case "$found_ipv6" in
 
3726
 yes)
 
3727
    AC_DEFINE(ISC_PLATFORM_HAVEIPV6, ,[ISC: Have IPv6?])
 
3728
 
 
3729
    AC_MSG_CHECKING(for in6_pktinfo)
 
3730
    AC_TRY_COMPILE([
 
3731
#include <sys/types.h>
 
3732
#include <sys/socket.h>
 
3733
#include <netinet/in.h>
 
3734
$isc_netinetin6_hack
 
3735
$isc_netinet6in6_hack
 
3736
],
 
3737
        [struct in6_pktinfo xyzzy; return (0);],
 
3738
        [AC_MSG_RESULT(yes)
 
3739
         AC_DEFINE(ISC_PLATFORM_HAVEIN6PKTINFO, ,
 
3740
                [ISC: Have struct in6_pktinfo?])],
 
3741
        [AC_MSG_RESULT(no -- disabling runtime ipv6 support)])
 
3742
 
 
3743
    AC_MSG_CHECKING(for in6addr_any)
 
3744
    AC_TRY_LINK([
 
3745
#include <sys/types.h>
 
3746
#include <sys/socket.h>
 
3747
#include <netinet/in.h>
 
3748
$isc_netinetin6_hack
 
3749
$isc_netinet6in6_hack
 
3750
$isc_in_addr6_hack
 
3751
],
 
3752
        [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
 
3753
        [AC_MSG_RESULT(yes)],
 
3754
        [AC_MSG_RESULT(no)
 
3755
         AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, ,
 
3756
                [ISC: Need in6addr_any?])]
 
3757
        )
 
3758
    ;;
 
3759
esac
 
3760
 
 
3761
#
 
3762
# Look for a sysctl call to get the list of network interfaces.
 
3763
#
 
3764
AC_MSG_CHECKING(for interface list sysctl)
 
3765
AC_EGREP_CPP(found_rt_iflist, [
 
3766
#include <sys/param.h>
 
3767
#include <sys/sysctl.h>
 
3768
#include <sys/socket.h>
 
3769
#ifdef NET_RT_IFLIST  
 
3770
found_rt_iflist
 
3771
#endif
 
3772
],
 
3773
        [AC_MSG_RESULT(yes)
 
3774
         AC_DEFINE(HAVE_IFLIST_SYSCTL,1,[ISC: Use iflist_sysctl?])],
 
3775
        [AC_MSG_RESULT(no)])
 
3776
 
 
3777
###
 
3778
 
 
3779
case "$build" in
 
3780
 $host)
 
3781
    ;;
 
3782
 *) case "$host" in
3176
3783
     *-*-vxworks*)
3177
3784
        LDFLAGS="$LDFLAGS -r"
3178
3785
        ;;
3182
3789
 
3183
3790
AC_DEFINE_DIR(NTP_KEYSDIR, sysconfdir, [Default location of crypto key info])
3184
3791
 
3185
 
# This is necessary so that .o files in LIBOBJS are also built via
3186
 
# the ANSI2KNR-filtering rules.
3187
 
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
3188
 
 
3189
 
AC_CONFIG_FILES(Makefile adjtimed/Makefile clockstuff/Makefile \
3190
 
ElectricFence/Makefile
3191
 
include/Makefile kernel/Makefile kernel/sys/Makefile libntp/Makefile \
3192
 
libparse/Makefile librsaref/Makefile ntpd/Makefile ntpdc/Makefile \
3193
 
ntpdate/Makefile ntpq/Makefile ntptrace/Makefile parseutil/Makefile \
3194
 
scripts/Makefile scripts/calc_tickadj scripts/checktime scripts/freq_adj \
3195
 
scripts/mkver scripts/ntp-wait scripts/ntpsweep scripts/ntpver \
3196
 
scripts/plot_summary scripts/summary util/Makefile)
3197
 
AC_CONFIG_COMMANDS(default, [[chmod +x scripts/calc_tickadj scripts/checktime scripts/freq_adj scripts/mkver scripts/ntp-wait scripts/ntpsweep scripts/ntpver scripts/plot_summary scripts/summary]], [])
 
3792
AC_SUBST(ARLIB_DIR)
 
3793
if test -d $srcdir/arlib
 
3794
then
 
3795
    AC_ARG_WITH(arlib,
 
3796
        AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
 
3797
    [ans=$withval], [ans=no])
 
3798
 
 
3799
    case "$ans" in
 
3800
     yes)
 
3801
        ARLIB_DIR=arlib
 
3802
        AC_CONFIG_SUBDIRS(arlib)
 
3803
        ;;
 
3804
    esac
 
3805
fi
 
3806
 
 
3807
AC_CONFIG_FILES(Makefile)
 
3808
AC_CONFIG_FILES(ElectricFence/Makefile)
 
3809
AC_CONFIG_FILES(adjtimed/Makefile)
 
3810
AC_CONFIG_FILES(clockstuff/Makefile)
 
3811
AC_CONFIG_FILES(include/Makefile)
 
3812
AC_CONFIG_FILES(include/isc/Makefile)
 
3813
AC_CONFIG_FILES(kernel/Makefile)
 
3814
AC_CONFIG_FILES(kernel/sys/Makefile)
 
3815
AC_CONFIG_FILES(libntp/Makefile)
 
3816
AC_CONFIG_FILES(libparse/Makefile)
 
3817
AC_CONFIG_FILES(ntpd/Makefile)
 
3818
AC_CONFIG_FILES(ntpdate/Makefile)
 
3819
AC_CONFIG_FILES(ntpdc/Makefile)
 
3820
AC_CONFIG_FILES(ntpdc/nl.pl,            [chmod +x ntpdc/nl.pl])
 
3821
AC_CONFIG_FILES(ntpq/Makefile)
 
3822
AC_CONFIG_FILES(parseutil/Makefile)
 
3823
AC_CONFIG_FILES(scripts/Makefile)
 
3824
AC_CONFIG_FILES(scripts/calc_tickadj,   [chmod +x scripts/calc_tickadj])
 
3825
AC_CONFIG_FILES(scripts/checktime,      [chmod +x scripts/checktime])
 
3826
AC_CONFIG_FILES(scripts/freq_adj,       [chmod +x scripts/freq_adj])
 
3827
AC_CONFIG_FILES(scripts/mkver,          [chmod +x scripts/mkver])
 
3828
AC_CONFIG_FILES(scripts/ntp-wait,       [chmod +x scripts/ntp-wait])
 
3829
AC_CONFIG_FILES(scripts/ntpsweep,       [chmod +x scripts/ntpsweep])
 
3830
AC_CONFIG_FILES(scripts/ntptrace,       [chmod +x scripts/ntptrace])
 
3831
AC_CONFIG_FILES(scripts/ntpver,         [chmod +x scripts/ntpver])
 
3832
AC_CONFIG_FILES(scripts/plot_summary,   [chmod +x scripts/plot_summary])
 
3833
AC_CONFIG_FILES(scripts/summary,        [chmod +x scripts/summary])
 
3834
AC_CONFIG_FILES(util/Makefile)
 
3835
 
 
3836
case "$MAKE_SNTP" in
 
3837
 '') ;;
 
3838
 *)
 
3839
    AC_CONFIG_SUBDIRS(sntp)
 
3840
    ;;
 
3841
esac
 
3842
 
3198
3843
AC_OUTPUT
3199
 
#test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])