-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
5641 lines (5252 loc) · 115 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl -*-fundamental-*-
dnl Process this file with autoconf to produce a configure script.
m4_include([version.m4])
AC_PREREQ([2.61])
AC_INIT([ntp], [VERSION_NUMBER])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([.])
# Increment ntp_configure_cache_version by one for each change to
# configure.ac or .m4 files which invalidates cached values from
# previous versions.
#
# If the change affects cache variables used only by the main NTP
# configure.ac, then only its version number should be bumped, while
# the subdir configure.ac version numbers should be unchanged. The
# same is true for a test/variable that is used only by one subdir
# being changed incompatibly; only that subdir's cache version needs
# bumping.
#
# If a change affects variables shared by all NTP configure scripts,
# please bump the version numbers of all three. If you are not sure,
# the safe choice is to bump all three on any cache-invalidating change.
#
# In order to avoid the risk of version stamp collision between -stable
# and -dev branches, do not simply increment the version, instead use
# the date YYYYMMDD optionally with -HHMM if there is more than one
# bump in a day.
ntp_configure_cache_version=20091117
# When the cache version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.
NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
AM_INIT_AUTOMAKE
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl the 'build' machine is where we run configure and compile
dnl the 'host' machine is where the resulting stuff runs.
AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
[canonical system (cpu-vendor-os) of where we should run])
AM_CONFIG_HEADER([config.h])
dnl AC_ARG_PROGRAM
ntp_atom_ok=${ntp_atom_ok=no}
ntp_oncore_ok=${ntp_oncore_ok=no}
ntp_parse_ok=${ntp_parse_ok=no}
ntp_ripe_ncc_ok=${ntp_parse_ok=no}
ntp_jupiter_ok=${ntp_jupiter_ok=no}
dnl check these early to avoid autoconf warnings
AC_AIX
AC_MINIX
# So far, the only shared library we might use is libopts.
# It's a small library - we might as well use a static version of it.
AC_DISABLE_SHARED
dnl we need to check for cross compile tools for vxWorks here
AC_PROG_CC
# Ralf Wildenhues: With per-target flags we need CC_C_O
# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_YACC
# AC_PROG_CC_STDC has two functions. It attempts to find a compiler
# capable of C99, or failing that, for C89. CC is set afterward with
# the selected invocation, such as "gcc --std=gnu99". Also, the
# ac_cv_prog_cc_stdc variable is no if the compiler selected for CC
# does not accept C89.
AC_PROG_CC_STDC
case "$ac_cv_prog_cc_stdc" in
no)
AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile NTP ]
[version 4.2.5 and higher.])
esac
# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
case "$host" in
*-pc-cygwin*)
CFLAGS="$CFLAGS -DSYS_CYGWIN32"
;;
i386-sequent-sysv4)
case "$CC" in
cc)
CFLAGS="$CFLAGS -Wc,+abi-socket"
;;
esac
;;
*-*-mpeix*)
CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
LIBS="$LIBS -lcurses"
;;
*-*-solaris*)
# see "man standards".
# -D_XOPEN_SOURCE=500 is probably OK for c89 and before
# -D_XOPEN_SOURCE=600 seems OK for c99
#CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
libxnet=-lxnet
;;
esac
NTP_OS_CFLAGS
NTP_DIR_SEP
NTP_VPATH_HACK
# NTP has (so far) been relying on leading-edge autogen.
# Therefore, by default:
# - use the version we ship with
# - do not install it
# - build a static copy (AC_DISABLE_SHARED - done earlier)
case "${enable_local_libopts+set}" in
set) ;;
*) enable_local_libopts=yes ;;
esac
case "${enable_libopts_install+set}" in
set) ;;
*) enable_libopts_install=no ;;
esac
LIBOPTS_CHECK_NOBUILD([sntp/libopts])
AC_FUNC_FORK
AC_CACHE_CHECK(
[if $CC can handle @%:@warning],
[ntp_cv_cpp_warning],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[#warning foo]])],
[ntp_cv_cpp_warning=yes],
[ntp_cv_cpp_warning=no]
)]
)
case "$ntp_cv_cpp_warning" in
no)
AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1],
[Should we avoid @%:@warning on option name collisions?])
esac
case "$GCC" in
yes)
SAVED_CFLAGS_NTP="$CFLAGS"
CFLAGS="$CFLAGS -Wstrict-overflow"
AC_CACHE_CHECK(
[if $CC can handle -Wstrict-overflow],
[ntp_cv_gcc_Wstrict_overflow],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[ntp_cv_gcc_Wstrict_overflow=yes],
[ntp_cv_gcc_Wstrict_overflow=no]
) ]
)
#
# $ntp_cv_gcc_Wstrict_overflow is tested later to add the
# flag to CFLAGS.
#
CFLAGS="$SAVED_CFLAGS_NTP -Winit-self"
AC_CACHE_CHECK(
[if $CC can handle -Winit-self],
[ntp_cv_gcc_Winit_self],
[
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[ntp_cv_gcc_Winit_self=yes],
[ntp_cv_gcc_Winit_self=no]
)
]
)
CFLAGS="$SAVED_CFLAGS_NTP"
AS_UNSET([SAVED_CFLAGS_NTP])
#
# $ntp_cv_gcc_Winit_self is tested later to add the
# flag to CFLAGS.
#
esac
# Expose a cross-compilation indicator to makefiles
AM_CONDITIONAL([NTP_CROSSCOMPILE], [test $build != $host])
AC_MSG_CHECKING([for bin subdirectory])
AC_ARG_WITH(
[binsubdir],
[AS_HELP_STRING(
[--with-binsubdir],
[bin ={bin,sbin}]
)],
[use_binsubdir="$withval"],
[use_binsubdir="bin"]
)
case "$use_binsubdir" in
bin)
;;
sbin)
;;
*)
AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
;;
esac
AC_MSG_RESULT([$use_binsubdir])
BINSUBDIR=$use_binsubdir
AC_SUBST([BINSUBDIR])
AM_CONDITIONAL([NTP_BINSUBDIR_IS_BIN], [test "bin" = "$BINSUBDIR"])
AC_MSG_CHECKING([for deprecated --with-arlib])
AC_ARG_WITH([arlib],
AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
[ans=$withval], [ans=no])
AC_MSG_RESULT([$ans])
case "$ans" in
yes)
AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
esac
AC_ARG_WITH(rpath,
AS_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
[ans=$withval], [ans=x])
case "$ans" in
no)
need_dash_r=
;;
yes)
need_dash_r=1
;;
esac
# HMS: Why isn't this $build?
# Well, that depends on if we need this for the build toolchain or
# for info in the host executable...
# I still have no idea which way this should go, but nobody has complained.
case "$host" in
*-*-netbsd*)
case "$need_dash_r" in
no) ;;
*) need_dash_r=1
;;
esac
;;
*-*-solaris*)
case "$need_dash_r" in
no) ;;
*) need_dash_r=1
;;
esac
;;
esac
dnl we need to check for cross compile tools for vxWorks here
AC_PROG_AWK
AC_PROG_MAKE_SET
rm -f conftest*
case "$GCC" in
yes)
CFLAGS="$CFLAGS -Wall"
# CFLAGS="$CFLAGS -Wcast-align"
CFLAGS="$CFLAGS -Wcast-qual"
# CFLAGS="$CFLAGS -Wconversion"
# CFLAGS="$CFLAGS -Werror"
# CFLAGS="$CFLAGS -Wextra"
# CFLAGS="$CFLAGS -Wfloat-equal"
CFLAGS="$CFLAGS -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wpointer-arith"
CFLAGS="$CFLAGS -Wshadow"
# CFLAGS="$CFLAGS -Wtraditional"
# CFLAGS="$CFLAGS -Wwrite-strings"
case "$ntp_cv_gcc_Winit_self" in
yes)
CFLAGS="$CFLAGS -Winit-self"
esac
case "$ntp_cv_gcc_Wstrict_overflow" in
yes)
CFLAGS="$CFLAGS -Wstrict-overflow"
esac
# -W[no-]strict-prototypes is added later depending on OpenSSL
esac
ac_busted_vpath_in_make=no
case "$build" in
*-*-irix6.1*) # 64 bit only
# busted vpath?
;;
*-*-irix6*) # 6.2 (and later?)
ac_busted_vpath_in_make=yes
;;
*-*-solaris2.5.1)
ac_busted_vpath_in_make=yes
;;
*-*-unicosmp*)
ac_busted_vpath_in_make=yes
;;
esac
case "$ac_busted_vpath_in_make$srcdir" in
no*) ;;
yes.) ;;
*) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
'')
AC_MSG_ERROR([building outside of the main directory requires GNU make])
;;
*) ;;
esac
;;
esac
AC_SUBST([CFLAGS])
AC_SUBST([LDFLAGS])
AC_PROG_LIBTOOL
AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
AC_C_VOLATILE
AC_ISC_POSIX
AC_PATH_PROG([PATH_PERL], [perl])
AC_PATH_PROG([PATH_SH], [sh])
AC_PATH_PROG([PATH_TEST], [test])
AC_ARG_WITH(
[net-snmp-config],
[AS_HELP_STRING(
[--with-net-snmp-config],
[+ =net-snmp-config]
)],
[ans=$withval],
[ans=yes]
)
case "$ans" in
no)
;;
yes)
ans=net-snmp-config
;;
/*)
;;
*/*)
AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
;;
*)
;;
esac
PROG_NET_SNMP_CONFIG=$ans
AC_MSG_CHECKING([for net-snmp-config path])
case "$PROG_NET_SNMP_CONFIG" in
no) ;;
/*)
PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
;;
*)
AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
;;
esac
AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
case "$host" in
*-*-vxworks*)
ac_link="$ac_link $VX_KERNEL"
;;
esac
AC_PROG_INSTALL
AC_CHECK_FUNC([gethostent], ,
AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket]))
AC_CHECK_FUNC([openlog], ,
AC_SEARCH_LIBS([openlog], [gen], ,
AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])))
AC_SEARCH_LIBS([MD5Init], [md5 md])
AC_CHECK_FUNCS(MD5Init)
NTP_LINEEDITLIBS
dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
dnl does Strange Things with extra processes using the Posix-compatibility
dnl real-time library, so we don't want to use it.
dnl
dnl 081118 Harlan got tired of looking for a way to get the sched*()
dnl functions to link OK with either cc or gcc.
case "$host" in
*-*-*linux*) ;;
*-*-osf4*) ;;
*-*-osf5*) ;;
*)
AC_CHECK_LIB([rt], [sched_setscheduler], [],
[AC_CHECK_LIB([posix4], [sched_setscheduler])])
;;
esac
AC_SEARCH_LIBS([setsockopt], [socket xnet])
AC_SEARCH_LIBS([res_init], [resolv], [], [], [-lsocket -lnsl])
case "$host" in
*-*-darwin*)
AC_CHECK_LIB([resolv],[res_9_init])
;;
esac
AC_HEADER_RESOLV
AC_CHECK_FUNCS([res_init __res_init])
AC_HEADER_STDC
AC_CHECK_HEADERS([bstring.h])
AC_CHECK_HEADER(
[dns_sd.h],
[AC_CHECK_LIB(
[dns_sd],
[DNSServiceRegister],
[AC_DEFINE([HAVE_DNSREGISTRATION], [1],
[Use Rendezvous/DNS-SD registration])]
)]
)
case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
yes)
LIBS="-ldns_sd $LIBS"
esac
AC_CHECK_HEADERS([errno.h fcntl.h ieeefp.h kvm.h math.h])
AC_CHECK_HEADERS(
[md5.h],
[],
[],
[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
]
)
AC_CHECK_HEADERS([memory.h netdb.h poll.h])
AC_CHECK_HEADERS([sgtty.h stdlib.h string.h termio.h])
AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
case "$host" in
*-*-aix*)
AC_CHECK_HEADERS([utmpx.h])
case "$ac_cv_header_utmpx_h" in
yes)
;;
*)
AC_CHECK_HEADERS([utmp.h])
;;
esac
;;
*)
AC_CHECK_HEADERS([utmp.h utmpx.h])
;;
esac
#
# On Suns only (so far) getpass() truncates the typed password to 8
# characters, but getpassphrase() allows up to 257. Most systems'
# getpass() does not truncate, at least not so as to affect ntpq and
# ntpdc password prompts.
#
# So check for getpassphrase(), but only on Sun operating systems.
#
case "$host" in
*-*-sunos*|*-*-solaris*)
AC_CHECK_FUNCS([getpassphrase])
esac
AC_CHECK_HEADERS([arpa/nameser.h])
AC_CHECK_HEADERS([sys/socket.h])
dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
dnl due to an incomplete type (a union) mpinfou used in an array. gcc3
dnl compiles it without complaint. The mpinfou union is defined later
dnl in the resulting preprocessed source than the spu_info array in
dnl /usr/include/machine/sys/getppdp.h:
dnl extern union mpinfou spu_info[];
dnl triggering the error. Our strategy is on HP-UX only, test for
dnl net/netmp.h, which is the file included by net/if.h that leads to
dnl getppdp.h. If it is present but can't be compiled, try adding
dnl a duplicate definition of mpinfou, which should then allow the
dnl following net/if.h and net/if6.h tests to proceed normally.
dnl Using net/netmp.h allows us to avoid polluting test results for
dnl net/if.h.
#
case "$host" in
*-hp-hpux*)
AC_CHECK_HEADERS(
[net/netmp.h],
[netmp_h_works=yes],
[netmp_h_works=no]
)
case "$netmp_h_works" in
no)
cat >>confdefs.h <<_ACEOF
#ifndef MPINFOU_PREDECLARED
# define MPINFOU_PREDECLARED
typedef union mpinfou { /* For lint */
struct pdk_mpinfo *pdkptr;
struct mpinfo *pikptr;
} mpinfou_t;
#endif
_ACEOF
AH_BOTTOM([
#ifndef MPINFOU_PREDECLARED
# define MPINFOU_PREDECLARED
typedef union mpinfou { /* For lint */
struct pdk_mpinfo *pdkptr;
struct mpinfo *pikptr;
} mpinfou_t;
#endif
])
;;
esac
;;
esac
case "$host" in
*-linux*)
AC_CHECK_HEADERS([linux/if_addr.h], [], [], [
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])
esac
AC_CHECK_HEADERS([net/if.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
AC_CHECK_HEADERS([net/if6.h])
AC_CHECK_HEADERS([net/route.h], [], [], [
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
])
AC_CHECK_HEADERS([netinet/in_system.h netinet/in_systm.h netinet/in.h])
AC_CHECK_HEADERS([net/if_var.h], [], [],
[#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
])
AC_CHECK_HEADERS([netinet/ip.h netinet/in_var.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NET_IF_VAR_H
#include <net/if_var.h>
#endif
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
])
# Check for IPTOS_PREC
AC_CACHE_CHECK(
[IPPROTO_IP IP_TOS IPTOS_LOWDELAY],
[ntp_cv_ip_tos],
[AC_EGREP_CPP(
[yes],
[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IP_H
# include <netinet/in.h>
# include <netinet/ip.h>
#endif
#if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY)
yes
#endif
],
[ntp_cv_ip_tos=yes],
[ntp_cv_ip_tos=no]
)]
)
case "$ntp_cv_ip_tos" in
yes)
AC_DEFINE([HAVE_IPTOS_SUPPORT], [1], [Do we have IPTOS support?])
esac
AC_CHECK_HEADERS([netinfo/ni.h])
case "$ac_cv_header_netinfo_ni_h" in
yes)
AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
esac
AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h])
dnl AC_CHECK_HEADERS([sys/chudefs.h])
AC_CHECK_HEADERS([sys/clkdefs.h sys/file.h])
case "$host" in
*-*-sunos4*)
;;
*)
AC_CHECK_HEADERS([sys/ioctl.h])
;;
esac
AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
AC_CHECK_HEADERS([sys/modem.h sys/param.h sys/ppsclock.h])
# HMS: Check sys/proc.h and sys/resource.h after some others
AC_CHECK_HEADERS([sys/ppstime.h sched.h])
case "$ac_cv_header_sched_h" in
yes)
;;
*)
AC_CHECK_HEADERS([sys/sched.h])
;;
esac
case "$host" in
*-*-sco*)
AC_CHECK_HEADERS([sys/sio.h])
;;
esac
# HMS: Check sys/shm.h after some others
AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
# HMS: Checked sys/socket.h earlier
case "$host" in
*-*-netbsd*)
;;
*)
AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
;;
esac
AC_CHECK_HEADERS([sys/stat.h sys/stream.h sys/stropts.h])
# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
[#if defined HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif])
AC_CHECK_HEADERS([sys/syssgi.h sys/systune.h])
AC_CHECK_HEADERS([sys/termios.h sys/time.h sys/signal.h])
AC_EGREP_CPP(
[yes],
[
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#include <sys/timepps.h>
#ifdef PPS_API_VERS_1
yes
#endif
],
[AC_CHECK_HEADERS(
[sys/timepps.h],
[],
[],
[
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
]
)]
)
AC_CHECK_HEADERS([sys/timers.h sys/tpro.h sys/types.h sys/wait.h])
AC_HEADER_TIME
case "$host" in
*-convex-*)
AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
;;
*-*-bsdi*)
AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
;;
esac
case "$host" in
*-*-*linux*)
AC_CHECK_FUNCS([__adjtimex __ntp_gettime])
;;
esac
case "$ac_cv_func___adjtimex" in
yes)
;;
*)
AC_CHECK_LIB([elf], [nlist]) dnl Only needed for tickadj...
dnl AC_CHECK_LIB(kvm, main, , , -lelf)
AC_CHECK_LIB([kvm], [main]) dnl We already know about -lelf here...
AC_CHECK_LIB([ld], [nlist])
AC_CHECK_LIB([mld], [nlist])
AC_CHECK_HEADERS([nlist.h sys/var.h])
case "$ac_cv_header_nlist_h" in
yes)
AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
esac
AC_CACHE_CHECK(
[for n_un in struct nlist],
[ntp_cv_struct_nlist_n_un],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <nlist.h>
]],
[[
struct nlist n;
n.n_un.n_name = 0;
]]
)]
[ntp_cv_struct_nlist_n_un=yes],
[ntp_cv_struct_nlist_n_un=no]
)]
)
case "$ntp_cv_struct_nlist_n_un" in
yes)
AC_DEFINE([NLIST_NAME_UNION], [1],
[does struct nlist use a name union?])
esac
;;
esac
AC_CHECK_HEADERS([sys/proc.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
])
AC_CHECK_HEADERS([sys/resource.h], [], [],
[#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
])
AC_CHECK_HEADERS([sys/shm.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_IPC_H
# include <sys/ipc.h>
#endif
])
AC_CHECK_HEADERS([sys/timex.h], [], [],
[#if HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
])
AC_CHECK_HEADERS([resolv.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
])
AC_CACHE_CHECK(
[for basic volatile support],
[ntp_cv_c_volatile],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
]],
[[
volatile int x;
]]
)]
[ntp_cv_c_volatile=yes],
[ntp_cv_c_volatile=no]
)]
)
case "$ntp_cv_c_volatile" in
yes)
;;
*)
AC_DEFINE([volatile], [], [define away volatile?])
;;
esac
AC_C_CONST
AC_C_BIGENDIAN
AC_TYPE_SIGNAL
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([time_t, long, uintptr_t])
AC_CHECK_SIZEOF([time_t])
AH_VERBATIM([TYPEDEF_UINTPTR_T],
[/* Provide a typedef for uintptr_t? */
#ifndef HAVE_UINTPTR_T
typedef unsigned int uintptr_t;
#define HAVE_UINTPTR_T 1
#endif])
AC_STRUCT_TM
AC_CACHE_CHECK(
[for u_int8_t],
[ntp_cv_type_u_int8_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
]],
[[
u_int8_t len = 42;
]]
)],
[ntp_cv_type_u_int8_t=yes],
[ntp_cv_type_u_int8_t=no]
)]
)
case "$ntp_cv_type_u_int8_t" in
yes)
AC_DEFINE([HAVE_TYPE_U_INT8_T], [1], [Does u_int8_t exist?])
esac
AC_CACHE_CHECK(
[for u_int64_t],
[ntp_cv_type_u_int64_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
]],
[[
u_int64_t len = 42;
]]
)],
[ntp_cv_type_u_int64_t=yes],
[ntp_cv_type_u_int64_t=no]
)]
)
case "$ntp_cv_type_u_int64_t" in
yes)
AC_DEFINE([HAVE_TYPE_U_INT64_T], [1], [Does u_int64_t exist?])
esac
AC_CACHE_CHECK(
[for a fallback value for HZ],
[ntp_cv_default_hz],
[
ntp_cv_default_hz=100
case "$host" in
alpha*-dec-osf4*|alpha*-dec-osf5*)
ntp_cv_default_hz=1024
;;
mips-dec-ultrix4*)
ntp_cv_default_hz=256
;;
esac
]
)
AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
[What is the fallback value for HZ?])
AC_CACHE_CHECK(
[if we need to override the system's value for HZ],
[ntp_cv_override_hz],
[
ntp_cv_override_hz=no
case "$host" in
alpha*-dec-osf4*|alpha*-dec-osf5*)
ntp_cv_override_hz=yes
;;
mips-dec-ultrix4*)
ntp_cv_override_hz=yes
;;
*-*-freebsd*)
ntp_cv_override_hz=yes
;;
*-*-sunos4*)
ntp_cv_override_hz=yes
;;
*-*-kfreebsd*)
ntp_cv_override_hz=yes
;;
esac
]
)
case "$ntp_cv_override_hz" in
yes)
AC_DEFINE([OVERRIDE_HZ], [1],
[Do we need to override the system's idea of HZ?])
esac
dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
dnl [AC_TRY_LINK([#include <sys/types.h>
dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
dnl if test $su_cv_func_ut_host_in_utmp = yes; then
dnl AC_DEFINE(HAVE_UT_HOST)
dnl fi
dnl AC_MSG_CHECKING(if we can get the system boot time)
dnl AC_CACHE_VAL(su_cv_have_boot_time,
dnl [AC_EGREP_CPP(yes,
dnl [#ifdef HAVE_UTMPX_H
dnl #include <utmpx.h>
dnl #else
dnl #include <utmp.h>
dnl #endif
dnl #ifdef BOOT_TIME
dnl yes
dnl #endif
dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
dnl AC_MSG_RESULT($su_cv_have_boot_time)
AC_CACHE_CHECK(
[for struct rt_msghdr],
[ntp_cv_struct_rt_msghdr],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/route.h>
]],
[[
struct rt_msghdr p;
]]
)],
[ntp_cv_struct_rt_msghdr=yes],
[ntp_cv_struct_rt_msghdr=no]
)]
)
AC_CACHE_CHECK(
[for struct rtattr],
[ntp_cv_rtattr],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stddef.h>
#include <sys/socket.h>
#include <linux/rtnetlink.h>
]],
[[
struct rtattr p;
]]
)],
[ntp_cv_rtattr=yes],
[ntp_cv_rtattr=no]
)]
)
case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
*yes*)
AC_DEFINE([HAS_ROUTING_SOCKET], [1],
[Do we have a routing socket (rt_msghdr or rtattr)?])
case "$ntp_cv_rtattr" in
yes)
AC_DEFINE([HAVE_RTNETLINK], [1],
[Do we have Linux routing socket?])
esac
esac
AC_CACHE_CHECK(
[struct sigaction for sa_sigaction],
[ntp_cv_struct_sigaction_has_sa_sigaction],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <signal.h>
]],
[[
struct sigaction act;
act.sa_sigaction = 0;
]]
)],
[ntp_cv_struct_sigaction_has_sa_sigaction=yes],
[ntp_cv_struct_sigaction_has_sa_sigaction=no]
)]
)
case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
yes)