/contrib/ntp/configure.ac

https://bitbucket.org/freebsd/freebsd-head/ · m4 · 4667 lines · 3824 code · 400 blank · 443 comment · 0 complexity · 6632014c43722c45fffbcdf4bfaef288 MD5 · raw file

Large files are truncated click here to view the full file

  1. dnl -*-fundamental-*-
  2. dnl Process this file with autoconf to produce a configure script.
  3. m4_include([version.m4])
  4. AC_INIT(ntp, VERSION_NUMBER)
  5. AM_INIT_AUTOMAKE
  6. AC_CANONICAL_HOST
  7. dnl the 'build' machine is where we run configure and compile
  8. dnl the 'host' machine is where the resulting stuff runs.
  9. AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) of where we should run])
  10. AM_CONFIG_HEADER([config.h])
  11. dnl AC_ARG_PROGRAM
  12. AC_PREREQ(2.53)
  13. ac_cv_var_atom_ok=no
  14. ac_cv_var_oncore_ok=no
  15. ac_cv_var_parse_ok=no
  16. ac_cv_var_ripe_ncc_ok=no
  17. ac_cv_var_jupiter_ok=no
  18. dnl Grab any initial CFLAGS so we can pick better defaults.
  19. iCFLAGS="$CFLAGS"
  20. dnl check these early to avoid autoconf warnings
  21. AC_AIX
  22. AC_MINIX
  23. # So far, the only shared library we might use is libopts.
  24. # It's a small library - we might as well use a static version of it.
  25. AC_DISABLE_SHARED
  26. dnl we need to check for cross compile tools for vxWorks here
  27. AC_PROG_CC
  28. # Ralf Wildenhues: With per-target flags we need CC_C_O
  29. # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
  30. AM_PROG_CC_C_O
  31. AC_PROG_CC_STDC
  32. AC_PROG_CPP
  33. # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
  34. case "$host" in
  35. *-*-amigaos)
  36. CFLAGS="$CFLAGS -Dfork=vfork -DSYS_AMIGA"
  37. ;;
  38. *-*-hpux10.*) # at least for hppa2.0-hp-hpux10.20
  39. case "$GCC" in
  40. yes)
  41. ;;
  42. *) CFLAGS="$CFLAGS -Wp,-H18816"
  43. ;;
  44. esac
  45. ;;
  46. *-pc-cygwin*)
  47. CFLAGS="$CFLAGS -DSYS_CYGWIN32"
  48. ;;
  49. i386-sequent-sysv4)
  50. case "$CC" in
  51. cc)
  52. CFLAGS="$CFLAGS -Wc,+abi-socket"
  53. ;;
  54. esac
  55. ;;
  56. *-*-mpeix*)
  57. CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
  58. LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
  59. LIBS="$LIBS -lcurses"
  60. ;;
  61. *-*-solaris*)
  62. # see "man standards".
  63. # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
  64. # -D_XOPEN_SOURCE=600 seems OK for c99
  65. #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
  66. CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
  67. libxnet=-lxnet
  68. ;;
  69. esac
  70. AMU_OS_CFLAGS
  71. # NTP has (so far) been relying on leading-edge autogen.
  72. # Therefore, by default:
  73. # - use the version we ship with
  74. # - do not install it
  75. # - build a static copy (AC_DISABLE_SHARED - done earlier)
  76. case "${enable_local_libopts+set}" in
  77. set) ;;
  78. *) enable_local_libopts=yes ;;
  79. esac
  80. case "${enable_libopts_install+set}" in
  81. set) ;;
  82. *) enable_libopts_install=no ;;
  83. esac
  84. LIBOPTS_CHECK(libopts)
  85. AC_CACHE_CHECK(
  86. [if $CC can handle @%:@warning],
  87. ac_cv_cpp_warning,
  88. [
  89. AC_COMPILE_IFELSE(
  90. AC_LANG_PROGRAM([], [#warning foo]),
  91. [ac_cv_cpp_warning=yes],
  92. [ac_cv_cpp_warning=no],
  93. )
  94. ]
  95. )
  96. case "$ac_cv_cpp_warning" in
  97. no)
  98. AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid @%:@warning on option name collisions?])
  99. esac
  100. case "$GCC" in
  101. yes)
  102. SAVED_CFLAGS_AC="$CFLAGS"
  103. CFLAGS="$CFLAGS -Wstrict-overflow"
  104. AC_CACHE_CHECK(
  105. [if $CC can handle -Wstrict-overflow],
  106. ac_cv_gcc_Wstrict_overflow,
  107. [
  108. AC_COMPILE_IFELSE(
  109. [AC_LANG_PROGRAM([], [])],
  110. [ac_cv_gcc_Wstrict_overflow=yes],
  111. [ac_cv_gcc_Wstrict_overflow=no]
  112. )
  113. ]
  114. )
  115. CFLAGS="$SAVED_CFLAGS_AC"
  116. unset SAVED_CFLAGS_AC
  117. #
  118. # $ac_cv_gcc_Wstrict_overflow is tested later to add the
  119. # flag to CFLAGS.
  120. #
  121. esac
  122. case "$GCC" in
  123. yes)
  124. SAVED_CFLAGS_AC="$CFLAGS"
  125. CFLAGS="$CFLAGS -Winit-self"
  126. AC_CACHE_CHECK(
  127. [if $CC can handle -Winit-self],
  128. ac_cv_gcc_Winit_self,
  129. [
  130. AC_COMPILE_IFELSE(
  131. [AC_LANG_PROGRAM([], [])],
  132. [ac_cv_gcc_Winit_self=yes],
  133. [ac_cv_gcc_Winit_self=no]
  134. )
  135. ]
  136. )
  137. CFLAGS="$SAVED_CFLAGS_AC"
  138. unset SAVED_CFLAGS_AC
  139. #
  140. # $ac_cv_gcc_Winit_self is tested later to add the
  141. # flag to CFLAGS.
  142. #
  143. esac
  144. AC_MSG_CHECKING([for bin subdirectory])
  145. AC_ARG_WITH(binsubdir,
  146. AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
  147. use_binsubdir="$withval", use_binsubdir="bin")
  148. case "$use_binsubdir" in
  149. bin)
  150. ;;
  151. sbin)
  152. ;;
  153. *)
  154. AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
  155. ;;
  156. esac
  157. AC_MSG_RESULT($use_binsubdir)
  158. BINSUBDIR=$use_binsubdir
  159. AC_SUBST(BINSUBDIR)
  160. AC_MSG_CHECKING([if we want to use arlib])
  161. AC_ARG_WITH(arlib,
  162. AC_HELP_STRING([--with-arlib], [- Compile the async resolver library?]),
  163. [ans=$withval], [ans=no])
  164. AC_MSG_RESULT([$ans])
  165. if test -d $srcdir/arlib
  166. then
  167. case "$ans" in
  168. yes)
  169. ARLIB_DIR=arlib
  170. AC_CONFIG_SUBDIRS(arlib)
  171. ;;
  172. esac
  173. fi
  174. AC_SUBST(ARLIB_DIR)
  175. AC_ARG_WITH(rpath,
  176. AC_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
  177. [ans=$withval], [ans=x])
  178. case "$ans" in
  179. no)
  180. need_dash_r=
  181. ;;
  182. yes)
  183. need_dash_r=1
  184. ;;
  185. esac
  186. # HMS: Why isn't this $build?
  187. # Well, that depends on if we need this for the build toolchain or
  188. # for info in the host executable...
  189. # I still have no idea which way this should go, but nobody has complained.
  190. case "$host" in
  191. *-*-netbsd*)
  192. case "$need_dash_r" in
  193. no) ;;
  194. *) need_dash_r=1
  195. ;;
  196. esac
  197. ;;
  198. *-*-solaris*)
  199. case "$need_dash_r" in
  200. no) ;;
  201. *) need_dash_r=1
  202. ;;
  203. esac
  204. ;;
  205. esac
  206. case "$build" in
  207. $host)
  208. ;;
  209. *) case "$host" in
  210. *-*-vxworks*)
  211. # Quick and dirty sanity check
  212. case "$VX_KERNEL" in
  213. '') AC_MSG_ERROR(Please follow the directions in html/build/hints/vxworks.html!)
  214. ;;
  215. esac
  216. CFLAGS="$CFLAGS -DSYS_VXWORKS"
  217. ;;
  218. esac
  219. ;;
  220. esac
  221. dnl we need to check for cross compile tools for vxWorks here
  222. AC_PROG_AWK
  223. AC_PROG_MAKE_SET
  224. rm -f conftest*
  225. case "$GCC" in
  226. yes)
  227. CFLAGS="$CFLAGS -Wall"
  228. # CFLAGS="$CFLAGS -Wcast-align"
  229. CFLAGS="$CFLAGS -Wcast-qual"
  230. # CFLAGS="$CFLAGS -Wconversion"
  231. # CFLAGS="$CFLAGS -Werror"
  232. # CFLAGS="$CFLAGS -Wextra"
  233. # CFLAGS="$CFLAGS -Wfloat-equal"
  234. CFLAGS="$CFLAGS -Wmissing-prototypes"
  235. CFLAGS="$CFLAGS -Wpointer-arith"
  236. CFLAGS="$CFLAGS -Wshadow"
  237. #
  238. # OpenSSL has a number of callback prototypes
  239. # inside other function prototypes which trigger
  240. # warnings with -Wstrict-prototypes, such as:
  241. #
  242. # int i2d_RSA_NET(const RSA *a, unsigned char **pp,
  243. # int (*cb)(), int sgckey);
  244. # ^^^^^^^^^^^
  245. #
  246. CFLAGS="$CFLAGS -Wno-strict-prototypes"
  247. # CFLAGS="$CFLAGS -Wtraditional"
  248. # CFLAGS="$CFLAGS -Wwrite-strings"
  249. case "$ac_cv_gcc_Winit_self" in
  250. yes)
  251. CFLAGS="$CFLAGS -Winit-self"
  252. esac
  253. case "$ac_cv_gcc_Wstrict_overflow" in
  254. yes)
  255. #not yet: CFLAGS="$CFLAGS -Wstrict-overflow"
  256. esac
  257. ;;
  258. esac
  259. case "$host" in
  260. *-next-nextstep3)
  261. CFLAGS="$CFLAGS -posix"
  262. ;;
  263. dnl This is currently commented out by bor.
  264. dnl The new versions of ReliantUNIX round adjtime() interval down
  265. dnl to 1/100s (system tick). This makes tickadj actually useless.
  266. dnl So, I'd better not use additional flags.
  267. dnl I leave it here just in case anybody has better idea
  268. dnl mips-sni-sysv4* )
  269. dnl #
  270. dnl # Add flags for 64 bit file access to enable tickadj to access /dev/kmem
  271. dnl #
  272. dnl if getconf _LFS_CFLAGS > /dev/null 2>&1 ; then
  273. dnl CFLAGS="$CFLAGS `getconf _LFS_CFLAGS`"
  274. dnl fi
  275. dnl ;;
  276. esac
  277. ac_busted_vpath_in_make=no
  278. case "$build" in
  279. *-*-irix6.1*) # 64 bit only
  280. # busted vpath?
  281. ;;
  282. *-*-irix6*) # 6.2 (and later?)
  283. ac_busted_vpath_in_make=yes
  284. ;;
  285. *-*-solaris2.5.1)
  286. ac_busted_vpath_in_make=yes
  287. ;;
  288. *-*-unicosmp*)
  289. ac_busted_vpath_in_make=yes
  290. ;;
  291. esac
  292. case "$ac_busted_vpath_in_make$srcdir" in
  293. no*) ;;
  294. yes.) ;;
  295. *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
  296. '')
  297. AC_MSG_ERROR([building outside of the main directory requires GNU make])
  298. ;;
  299. *) ;;
  300. esac
  301. ;;
  302. esac
  303. AC_SUBST(CFLAGS)dnl
  304. AC_SUBST(LDFLAGS)dnl
  305. m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
  306. m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
  307. AC_PROG_LIBTOOL
  308. AC_PROG_LN_S
  309. AC_PROG_GCC_TRADITIONAL
  310. AC_C_VOLATILE
  311. AC_ISC_POSIX
  312. AC_PATH_PROG(PATH_SH, sh)
  313. AC_PATH_PROG(PATH_PERL, perl)
  314. hs_ULONG_CONST # remove for 4.2.5
  315. case "$host" in
  316. *-*-vxworks*)
  317. ac_link="$ac_link $VX_KERNEL"
  318. ;;
  319. esac
  320. AC_PROG_INSTALL
  321. case "$host" in
  322. *-pc-cygwin*)
  323. AC_CHECK_LIB(advapi32, main)
  324. ;;
  325. esac
  326. AC_CHECK_FUNC([gethostent], ,
  327. AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket]))
  328. AC_CHECK_FUNC([openlog], ,
  329. AC_SEARCH_LIBS([openlog], [gen], ,
  330. AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])))
  331. AC_SEARCH_LIBS([MD5Init], [md5 md])
  332. AC_CHECK_FUNCS(MD5Init)
  333. # following block becomes on 4.2.5: NTP_LINEEDITLIBS
  334. dnl HMS: What a hack...
  335. AC_CHECK_HEADERS(readline/history.h readline/readline.h)
  336. case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
  337. *no*) ;;
  338. *) save_LIBS=$LIBS
  339. LIBS=
  340. # Ralf Wildenhues: either unset ... or cache READLINE_LIBS
  341. unset ac_cv_lib_readline_readline
  342. AC_CHECK_LIB(readline, readline, ,
  343. AC_MSG_NOTICE([Trying again with -lcurses])
  344. unset ac_cv_lib_readline_readline
  345. AC_CHECK_LIB(readline, readline,
  346. LIBS="-lreadline -lcurses $LIBS"
  347. AC_DEFINE(HAVE_LIBREADLINE)
  348. AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
  349. AC_CHECK_LIB(edit, readline,
  350. LIBS="-ledit -lcurses"
  351. AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
  352. AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
  353. , , -lcurses)
  354. , -lcurses))
  355. READLINE_LIBS=$LIBS
  356. AC_SUBST(READLINE_LIBS)
  357. LIBS=$save_LIBS
  358. ;;
  359. esac
  360. dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
  361. dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
  362. dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
  363. dnl does Strange Things with extra processes using the Posix-compatibility
  364. dnl real-time library, so we don't want to use it.
  365. case "$host" in
  366. *-*-*linux*) ;;
  367. *)
  368. AC_CHECK_LIB(rt, sched_setscheduler, ,
  369. AC_CHECK_LIB(posix4, sched_setscheduler))
  370. ;;
  371. esac
  372. AC_CHECK_FUNC(setsockopt, ,
  373. [AC_SEARCH_LIBS([setsockopt], [socket xnet])])
  374. AC_HEADER_STDC
  375. AC_CHECK_HEADERS(bstring.h)
  376. AC_CHECK_HEADER(dns_sd.h,
  377. [AC_CHECK_LIB(dns_sd,
  378. DNSServiceRegister,
  379. [AC_DEFINE(HAVE_DNSREGISTRATION, 1,
  380. [Use Rendezvous/DNS-SD registration])])])
  381. case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
  382. yes) LIBS="-ldns_sd $LIBS" ;;
  383. esac
  384. AC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h math.h)
  385. # HMS: Lame, but fast.
  386. if test -f /etc/redhat-release
  387. then
  388. :
  389. else
  390. AC_CHECK_HEADERS(md5.h, [], [],
  391. [#if HAVE_SYS_TYPES_H
  392. #include <sys/types.h>
  393. #endif
  394. ])
  395. fi
  396. AC_CHECK_HEADERS(memory.h netdb.h poll.h)
  397. AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
  398. AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
  399. case "$host" in
  400. *-*-aix*)
  401. AC_CHECK_HEADERS(utmpx.h)
  402. case "$ac_cv_header_utmpx_h" in
  403. yes) ;;
  404. *) AC_CHECK_HEADERS(utmp.h) ;;
  405. esac
  406. ;;
  407. *) AC_CHECK_HEADERS(utmp.h utmpx.h) ;;
  408. esac
  409. AC_CHECK_HEADERS(arpa/nameser.h)
  410. AC_CHECK_HEADERS(sys/socket.h)
  411. AC_CHECK_HEADERS(net/if.h, [], [],
  412. [#if HAVE_SYS_SOCKET_H
  413. #include <sys/socket.h>
  414. #endif
  415. ])
  416. AC_CHECK_HEADERS(net/if6.h)
  417. AC_CHECK_HEADERS(net/route.h, [], [], [
  418. #include <sys/types.h>
  419. #include <sys/socket.h>
  420. #include <net/if.h>
  421. ])
  422. AC_CHECK_HEADERS(netinet/in_system.h netinet/in_systm.h)
  423. AC_CHECK_HEADERS(netinet/in.h)
  424. AC_CHECK_HEADERS(netinet/ip.h, [], [],
  425. [#if HAVE_SYS_TYPES_H
  426. #include <sys/types.h>
  427. #endif
  428. #if HAVE_NETINET_IN_H
  429. #include <netinet/in.h>
  430. #endif
  431. #if HAVE_NETINET_IN_SYSTM_H
  432. #include <netinet/in_systm.h>
  433. #endif
  434. ])
  435. # Check for IPTOS_PREC
  436. AC_CACHE_CHECK(
  437. [IPPROTO_IP IP_TOS IPTOS_LOWDELAY],
  438. ac_cv_ip_tos,
  439. [
  440. AC_EGREP_CPP(
  441. [yes],
  442. [
  443. #if HAVE_SYS_TYPES_H
  444. #include <sys/types.h>
  445. #endif
  446. #if HAVE_NETINET_IP_H
  447. #include <netinet/in.h>
  448. #include <netinet/ip.h>
  449. #endif
  450. #if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY)
  451. yes
  452. #endif
  453. ],
  454. [ac_cv_ip_tos=yes],
  455. [ac_cv_ip_tos=no]
  456. )
  457. ]
  458. )
  459. case "$ac_cv_ip_tos" in
  460. yes)
  461. AC_DEFINE(HAVE_IPTOS_SUPPORT, 1, [Do we have IPTOS support?])
  462. esac
  463. AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO, 1, [NetInfo support?])])
  464. AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
  465. dnl AC_CHECK_HEADERS(sys/chudefs.h)
  466. AC_CHECK_HEADERS(sys/clkdefs.h sys/file.h)
  467. case "$host" in
  468. *-*-sunos4*) ;;
  469. *) AC_CHECK_HEADERS(sys/ioctl.h)
  470. ;;
  471. esac
  472. AC_CHECK_HEADERS(sys/ipc.h)
  473. AC_CHECK_HEADERS(sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h)
  474. # HMS: Check sys/proc.h and sys/resource.h after some others
  475. AC_CHECK_HEADERS(sys/ppstime.h)
  476. case "$ac_cv_header_sched_h" in
  477. yes) ;;
  478. *) AC_CHECK_HEADERS(sys/sched.h) ;;
  479. esac
  480. case "$host" in
  481. *-*-sco*)
  482. AC_CHECK_HEADERS(sys/sio.h)
  483. ;;
  484. esac
  485. # HMS: Check sys/shm.h after some others
  486. AC_CHECK_HEADERS(sys/select.h sys/signal.h sys/sockio.h)
  487. # HMS: Checked sys/socket.h earlier
  488. case "$host" in
  489. *-*-netbsd*) ;;
  490. *) AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
  491. ;;
  492. esac
  493. AC_CHECK_HEADERS(sys/stat.h sys/stream.h)
  494. AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/systune.h)
  495. AC_CHECK_HEADERS(sys/termios.h sys/time.h sys/signal.h)
  496. AC_EGREP_CPP(yes,
  497. [#if HAVE_SYS_TIME_H
  498. # include <sys/time.h>
  499. #endif
  500. #if HAVE_ERRNO_H
  501. # include <errno.h>
  502. #endif
  503. #include <sys/timepps.h>
  504. #ifdef PPS_API_VERS_1
  505. yes
  506. #endif
  507. ], [AC_CHECK_HEADERS(sys/timepps.h, [], [],
  508. [#if HAVE_SYS_TIME_H
  509. # include <sys/time.h>
  510. #endif
  511. #if HAVE_ERRNO_H
  512. # include <errno.h>
  513. #endif
  514. ])
  515. ])
  516. AC_CHECK_HEADERS(sys/timers.h sys/tpro.h sys/types.h sys/wait.h)
  517. AC_HEADER_TIME
  518. case "$host" in
  519. *-convex-*)
  520. AC_CHECK_HEADERS(/sys/sync/queue.h /sys/sync/sema.h)
  521. ;;
  522. *-*-bsdi*)
  523. AC_CHECK_HEADERS(machine/inline.h sys/pcl720.h sys/i8253.h)
  524. ;;
  525. esac
  526. case "$host" in
  527. *-*-*linux*)
  528. AC_CHECK_FUNCS(__adjtimex __ntp_gettime)
  529. ;;
  530. esac
  531. case "$ac_cv_func___adjtimex" in
  532. yes) ;;
  533. *)
  534. AC_CHECK_LIB(elf, nlist) dnl Only needed for tickadj...
  535. dnl AC_CHECK_LIB(kvm, main, , , -lelf)
  536. AC_CHECK_LIB(kvm, main) dnl We already know about -lelf here...
  537. AC_CHECK_LIB(ld, nlist)
  538. AC_CHECK_LIB(mld, nlist)
  539. AC_CHECK_HEADER(nlist.h,
  540. [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
  541. AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
  542. [AC_TRY_COMPILE([#include <nlist.h>],
  543. [struct nlist n; n.n_un.n_name = 0;],
  544. ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
  545. if test $ac_cv_struct_nlist_n_un = yes; then
  546. AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
  547. fi
  548. ])dnl
  549. ;;
  550. esac
  551. dnl AC_CHECK_HEADERS(net/if.h, [], [],
  552. dnl [#if HAVE_SYS_TYPES_H
  553. dnl # include <sys/types.h>
  554. dnl #endif
  555. dnl #if HAVE_SYS_SOCKET_H
  556. dnl # include <sys/socket.h>
  557. dnl #endif
  558. dnl ])
  559. AC_CHECK_HEADERS(sys/proc.h, [], [],
  560. [#if HAVE_SYS_TYPES_H
  561. # include <sys/types.h>
  562. #endif
  563. #if HAVE_SYS_TIME_H
  564. # include <sys/time.h>
  565. #endif
  566. ])
  567. AC_CHECK_HEADERS(sys/resource.h, [], [],
  568. [#if HAVE_SYS_TIME_H
  569. # include <sys/time.h>
  570. #endif
  571. ])
  572. AC_CHECK_HEADERS(sys/shm.h, [], [],
  573. [#if HAVE_SYS_TYPES_H
  574. # include <sys/types.h>
  575. #endif
  576. #if HAVE_SYS_IPC_H
  577. # include <sys/ipc.h>
  578. #endif
  579. ])
  580. AC_CHECK_HEADERS(sys/timex.h, [], [],
  581. [#if HAVE_SYS_TIME_H
  582. # include <sys/time.h>
  583. #endif
  584. ])
  585. AC_CHECK_HEADERS(resolv.h, [], [],
  586. [#if HAVE_SYS_TYPES_H
  587. #include <sys/types.h>
  588. #endif
  589. #if HAVE_NETINET_IN_H
  590. #include <netinet/in.h>
  591. #endif
  592. #if HAVE_ARPA_NAMESER_H
  593. #include <arpa/nameser.h>
  594. #endif
  595. ])
  596. AC_CACHE_CHECK([for basic volatile support], ac_cv_c_volatile,
  597. [AC_TRY_COMPILE([],[
  598. volatile int x;],
  599. ac_cv_c_volatile=yes,
  600. ac_cv_c_volatile=no)
  601. ])
  602. case "$ac_cv_c_volatile" in
  603. yes)
  604. ;;
  605. *) AC_DEFINE(volatile, , [Does the compiler like "volatile"?])
  606. ;;
  607. esac
  608. #
  609. # following block goes away in 4.2.5
  610. #
  611. # AM_C_PROTOTYPES gives us ansi2knr
  612. case "$build" in
  613. *-*-solaris2*)
  614. # Assume that solaris2 is Ansi C...
  615. ;;
  616. *)
  617. AM_C_PROTOTYPES
  618. ;;
  619. esac
  620. AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
  621. [AC_TRY_COMPILE([
  622. extern int foo (short);
  623. int foo(short i) { return i; }],[
  624. int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
  625. ])
  626. if test "$ac_cv_have_prototypes" = yes; then
  627. AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
  628. fi
  629. #
  630. # end block
  631. #
  632. AC_C_CONST
  633. AC_C_BIGENDIAN
  634. AC_TYPE_SIGNAL
  635. AC_TYPE_OFF_T
  636. AC_TYPE_SIZE_T
  637. AC_CHECK_TYPE(time_t, long)
  638. AC_CHECK_SIZEOF(time_t)
  639. AC_CHECK_TYPES(uintptr_t)
  640. AH_VERBATIM([TYPEDEF_UINTPTR_T],
  641. [/* Provide a typedef for uintptr_t? */
  642. #ifndef HAVE_UINTPTR_T
  643. typedef unsigned int uintptr_t;
  644. #define HAVE_UINTPTR_T 1
  645. #endif])
  646. AC_STRUCT_TM
  647. AC_CACHE_CHECK([for u_int8_t], ac_cv_type_u_int8_t,
  648. [AC_TRY_COMPILE([#include <sys/types.h>],
  649. [u_int8_t len = 42; return 0;],
  650. ac_cv_type_u_int8_t=yes,
  651. ac_cv_type_u_int8_t=no)
  652. ])
  653. if test $ac_cv_type_u_int8_t = yes; then
  654. AC_DEFINE(HAVE_TYPE_U_INT8_T, 1, [Does u_int8_t exist?])
  655. fi
  656. AC_CACHE_CHECK([for u_int64_t], ac_cv_type_u_int64_t,
  657. [AC_TRY_COMPILE([#include <sys/types.h>],
  658. [u_int64_t len = 42; return 0;],
  659. ac_cv_type_u_int64_t=yes,
  660. ac_cv_type_u_int64_t=no)
  661. ])
  662. if test $ac_cv_type_u_int64_t = yes; then
  663. AC_DEFINE(HAVE_TYPE_U_INT64_T, 1, [Does u_int64_t exist?])
  664. fi
  665. #
  666. # Look for in_port_t.
  667. #
  668. AC_MSG_CHECKING([for in_port_t])
  669. AC_TRY_COMPILE([
  670. #include <sys/types.h>
  671. #include <netinet/in.h>],
  672. [in_port_t port = 25; return (0);],
  673. [AC_MSG_RESULT(yes)
  674. ],
  675. [AC_MSG_RESULT(no)
  676. AC_DEFINE(ISC_PLATFORM_NEEDPORTT, 1, [Do we need our own in_port_t?])
  677. ])
  678. AC_CACHE_CHECK([for a fallback value for HZ], ac_cv_var_default_hz,
  679. [ac_cv_var_default_hz=100
  680. case "$host" in
  681. alpha*-dec-osf4*|alpha*-dec-osf5*)
  682. ac_cv_var_default_hz=1024
  683. ;;
  684. mips-dec-ultrix4*)
  685. ac_cv_var_default_hz=256
  686. ;;
  687. esac])
  688. AC_DEFINE_UNQUOTED(DEFAULT_HZ, $ac_cv_var_default_hz, [What is the fallback value for HZ?])
  689. AC_CACHE_CHECK([if we need to override the system's value for HZ], ac_cv_var_override_hz,
  690. [ac_cv_var_override_hz=no
  691. case "$host" in
  692. alpha*-dec-osf4*|alpha*-dec-osf5*)
  693. ac_cv_var_override_hz=yes
  694. ;;
  695. mips-dec-ultrix4*)
  696. ac_cv_var_override_hz=yes
  697. ;;
  698. *-*-freebsd*)
  699. ac_cv_var_override_hz=yes
  700. ;;
  701. *-*-sunos4*)
  702. ac_cv_var_override_hz=yes
  703. ;;
  704. esac])
  705. case "$ac_cv_var_override_hz" in
  706. yes)
  707. AC_DEFINE(OVERRIDE_HZ, 1, [Do we need to override the system's idea of HZ?])
  708. ;;
  709. esac
  710. dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
  711. dnl [AC_TRY_LINK([#include <sys/types.h>
  712. dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
  713. dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
  714. dnl if test $su_cv_func_ut_host_in_utmp = yes; then
  715. dnl AC_DEFINE(HAVE_UT_HOST)
  716. dnl fi
  717. dnl AC_MSG_CHECKING(if we can get the system boot time)
  718. dnl AC_CACHE_VAL(su_cv_have_boot_time,
  719. dnl [AC_EGREP_CPP(yes,
  720. dnl [#ifdef HAVE_UTMPX_H
  721. dnl #include <utmpx.h>
  722. dnl #else
  723. dnl #include <utmp.h>
  724. dnl #endif
  725. dnl #ifdef BOOT_TIME
  726. dnl yes
  727. dnl #endif
  728. dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
  729. dnl AC_MSG_RESULT($su_cv_have_boot_time)
  730. AC_CACHE_CHECK([for struct rt_msghdr], ac_cv_struct_rt_msghdr,
  731. [AC_TRY_COMPILE([
  732. #include <sys/types.h>
  733. #include <sys/socket.h>
  734. #include <net/if.h>
  735. #include <net/route.h>],
  736. [struct rt_msghdr p;],
  737. ac_cv_struct_rt_msghdr=yes,
  738. ac_cv_struct_rt_msghdr=no)
  739. ])
  740. if test $ac_cv_struct_rt_msghdr = yes; then
  741. AC_DEFINE(HAS_ROUTING_SOCKET, 1, [Do we have a routing socket (struct rt_msghdr)?])
  742. fi
  743. AC_CACHE_CHECK(
  744. [struct sigaction for sa_sigaction],
  745. ac_cv_struct_sigaction_has_sa_sigaction,
  746. [
  747. AC_TRY_COMPILE(
  748. [#include <signal.h>],
  749. [struct sigaction act; act.sa_sigaction = 0;],
  750. ac_cv_struct_sigaction_has_sa_sigaction=yes,
  751. ac_cv_struct_sigaction_has_sa_sigaction=no
  752. )
  753. ]
  754. )
  755. if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
  756. AC_DEFINE(HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION, 1, [Obvious...])
  757. fi
  758. AC_CACHE_CHECK([for struct ppsclockev], ac_cv_struct_ppsclockev,
  759. [AC_TRY_COMPILE([
  760. #include <sys/types.h>
  761. #ifdef HAVE_SYS_TERMIOS_H
  762. # include <sys/termios.h>
  763. #endif
  764. #ifdef HAVE_SYS_TIME_H
  765. # include <sys/time.h>
  766. #endif
  767. #ifdef HAVE_SYS_PPSCLOCK_H
  768. # include <sys/ppsclock.h>
  769. #endif],[
  770. extern struct ppsclockev *pce;
  771. return pce->serial;],
  772. ac_cv_struct_ppsclockev=yes,
  773. ac_cv_struct_ppsclockev=no)
  774. ])
  775. if test $ac_cv_struct_ppsclockev = yes; then
  776. AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
  777. fi
  778. AC_CACHE_CHECK([struct sockaddr for sa_len], ac_cv_struct_sockaddr_has_sa_len,
  779. [AC_TRY_COMPILE([
  780. #include <sys/types.h>
  781. #include <sys/socket.h>],[
  782. extern struct sockaddr *ps;
  783. return ps->sa_len;],
  784. ac_cv_struct_sockaddr_has_sa_len=yes,
  785. ac_cv_struct_sockaddr_has_sa_len=no)
  786. ])
  787. if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
  788. AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
  789. fi
  790. AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
  791. [AC_TRY_COMPILE([
  792. #include <sys/types.h>
  793. #include <sys/socket.h>
  794. #include <netinet/in.h>
  795. ],[
  796. struct sockaddr_storage n;],
  797. ac_cv_struct_sockaddr_storage=yes,
  798. ac_cv_struct_sockaddr_storage=no)
  799. ])
  800. if test $ac_cv_struct_sockaddr_storage = yes; then
  801. AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Does a system header define struct sockaddr_storage?])
  802. fi
  803. AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
  804. ac_cv_have_ss_family_in_struct_ss, [
  805. AC_TRY_COMPILE(
  806. [
  807. #include <sys/types.h>
  808. #include <sys/socket.h>
  809. ],
  810. [ struct sockaddr_storage s; s.ss_family = 1; ],
  811. [ ac_cv_have_ss_family_in_struct_ss="yes" ],
  812. [ ac_cv_have_ss_family_in_struct_ss="no" ],
  813. )
  814. ])
  815. if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
  816. AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
  817. else
  818. # Hack around a problem...
  819. # HMS: This is $host because we need the -D if we are building *for* it.
  820. # HMS: 061029: Now that we separate the ss_* checks this is causing
  821. # a problem - disable it until we get to the bottom of it.
  822. case "$host" in
  823. XXX*-*-hpux11.11) CPPFLAGS="$CPPFLAGS -D_NETINET_IN6_H"
  824. ;;
  825. esac
  826. fi
  827. AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
  828. ac_cv_have___ss_family_in_struct_ss, [
  829. AC_TRY_COMPILE(
  830. [
  831. #include <sys/types.h>
  832. #include <sys/socket.h>
  833. ],
  834. [ struct sockaddr_storage s; s.__ss_family = 1; ],
  835. [ ac_cv_have___ss_family_in_struct_ss="yes" ],
  836. [ ac_cv_have___ss_family_in_struct_ss="no" ]
  837. )
  838. ])
  839. if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
  840. AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
  841. fi
  842. AH_VERBATIM([X_HAVE_SS_FAMILY_IN_SS],
  843. [/* Handle ss_family */
  844. #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
  845. # define ss_family __ss_family
  846. #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */])
  847. AC_CACHE_CHECK([for ss_len field in struct sockaddr_storage],
  848. ac_cv_have_ss_len_in_struct_ss, [
  849. AC_TRY_COMPILE(
  850. [
  851. #include <sys/types.h>
  852. #include <sys/socket.h>
  853. ],
  854. [ struct sockaddr_storage s; s.ss_len = 1; ],
  855. [ ac_cv_have_ss_len_in_struct_ss="yes" ],
  856. [ ac_cv_have_ss_len_in_struct_ss="no" ],
  857. )
  858. ])
  859. if test "x$ac_cv_have_ss_len_in_struct_ss" = "xyes" ; then
  860. AC_DEFINE(HAVE_SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have ss_len?])
  861. fi
  862. AC_CACHE_CHECK([for __ss_len field in struct sockaddr_storage],
  863. ac_cv_have___ss_len_in_struct_ss, [
  864. AC_TRY_COMPILE(
  865. [
  866. #include <sys/types.h>
  867. #include <sys/socket.h>
  868. ],
  869. [ struct sockaddr_storage s; s.__ss_len = 1; ],
  870. [ ac_cv_have___ss_len_in_struct_ss="yes" ],
  871. [ ac_cv_have___ss_len_in_struct_ss="no" ]
  872. )
  873. ])
  874. if test "x$ac_cv_have___ss_len_in_struct_ss" = "xyes" ; then
  875. AC_DEFINE(HAVE___SS_LEN_IN_SS, 1, [Does struct sockaddr_storage have __ss_len?])
  876. fi
  877. AH_VERBATIM([X_HAVE_SS_LEN_IN_SS],
  878. [/* Handle ss_len */
  879. #if !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE___SS_LEN_IN_SS)
  880. # define ss_len __ss_len
  881. #endif /* !defined(HAVE_SS_LEN_IN_SS) && defined(HAVE_SA_LEN_IN_SS) */])
  882. case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
  883. *yes*)
  884. AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
  885. [AC_TRY_COMPILE([
  886. #ifdef HAVE_MACHINE_SOUNDCARD_H
  887. # include <machine/soundcard.h>
  888. #endif
  889. #ifdef HAVE_SYS_SOUNDCARD_H
  890. # include <sys/soundcard.h>
  891. #endif],[
  892. extern struct snd_size *ss;
  893. return ss->rec_size;],
  894. ac_cv_struct_snd_size=yes,
  895. ac_cv_struct_snd_size=no)
  896. ])
  897. case "$ac_cv_struct_snd_size" in
  898. yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
  899. esac
  900. ;;
  901. esac
  902. AC_CACHE_CHECK([struct clockinfo for hz], ac_cv_struct_clockinfo_has_hz,
  903. [AC_TRY_COMPILE([
  904. #include <sys/time.h>],[
  905. extern struct clockinfo *pc;
  906. return pc->hz;],
  907. ac_cv_struct_clockinfo_has_hz=yes,
  908. ac_cv_struct_clockinfo_has_hz=no)
  909. ])
  910. if test $ac_cv_struct_clockinfo_has_hz = yes; then
  911. AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
  912. fi
  913. AC_CACHE_CHECK([struct clockinfo for tickadj], ac_cv_struct_clockinfo_has_tickadj,
  914. [AC_TRY_COMPILE([
  915. #include <sys/time.h>],[
  916. extern struct clockinfo *pc;
  917. return pc->tickadj;],
  918. ac_cv_struct_clockinfo_has_tickadj=yes,
  919. ac_cv_struct_clockinfo_has_tickadj=no)
  920. ])
  921. if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
  922. AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
  923. fi
  924. AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
  925. [AC_TRY_COMPILE([
  926. #include <sys/time.h>
  927. /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
  928. #ifdef HAVE_ERRNO_H
  929. # include <errno.h>
  930. #endif
  931. #ifdef HAVE_SYS_TIMEPPS_H
  932. # define FRAC 4294967296
  933. # include <sys/timepps.h>
  934. #endif],
  935. [struct timespec n;],
  936. ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
  937. if test $ac_cv_struct_timespec = yes; then
  938. AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
  939. fi
  940. AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
  941. [AC_TRY_COMPILE([
  942. #include <sys/time.h>
  943. #include <sys/timex.h>],
  944. [struct ntptimeval n;],
  945. ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
  946. if test $ac_cv_struct_ntptimeval = yes; then
  947. AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
  948. fi
  949. AC_CHECK_MEMBERS([struct ntptimeval.time.tv_nsec], , ,
  950. [#ifdef HAVE_SYS_TIME_H
  951. #include <sys/time.h>
  952. #else
  953. # ifdef HAVE_TIME_H
  954. # include <time.h>
  955. # endif
  956. #endif
  957. #ifdef HAVE_SYS_TIMEX_H
  958. #include <sys/timex.h>
  959. #else
  960. # ifdef HAVE_TIMEX_H
  961. # include <timex.h>
  962. # endif
  963. #endif])
  964. AC_C_INLINE
  965. case "$ac_cv_c_inline" in
  966. '')
  967. ;;
  968. *)
  969. AC_DEFINE(HAVE_INLINE,1,[inline keyword or macro available])
  970. AC_SUBST(HAVE_INLINE)
  971. esac
  972. AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
  973. AC_CHECK_SIZEOF(signed char)
  974. AC_CHECK_SIZEOF(int)
  975. AC_CHECK_SIZEOF(long)
  976. AC_CHECK_TYPES([s_char])
  977. case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
  978. *yes)
  979. # We have a typedef for s_char. Might as well believe it...
  980. ;;
  981. no0no)
  982. # We have signed chars, can't say 'signed char', no s_char typedef.
  983. AC_DEFINE(NEED_S_CHAR_TYPEDEF, 1, [Do we need an s_char typedef?])
  984. ;;
  985. no1no)
  986. # We have signed chars, can say 'signed char', no s_char typedef.
  987. AC_DEFINE(NEED_S_CHAR_TYPEDEF)
  988. ;;
  989. yes0no)
  990. # We have unsigned chars, can't say 'signed char', no s_char typedef.
  991. AC_MSG_ERROR(No way to specify a signed character!)
  992. ;;
  993. yes1no)
  994. # We have unsigned chars, can say 'signed char', no s_char typedef.
  995. AC_DEFINE(NEED_S_CHAR_TYPEDEF)
  996. ;;
  997. esac
  998. AC_TYPE_UID_T
  999. case "$host" in
  1000. *-*-aix[[456]]*)
  1001. # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
  1002. # (returning ENOSYS). I didn't check 4.2. If, in the future,
  1003. # IBM pulls its thumbs out long enough to implement clock_settime,
  1004. # this conditional will need to change. Maybe use AC_TRY_RUN
  1005. # instead to try to set the time to itself and check errno.
  1006. ;;
  1007. *) AC_CHECK_FUNCS(clock_gettime clock_settime)
  1008. ;;
  1009. esac
  1010. AC_CHECK_FUNCS(daemon)
  1011. AC_CHECK_FUNCS(finite, ,
  1012. [AC_CHECK_FUNCS(isfinite, ,
  1013. [AC_MSG_CHECKING([for isfinite with <math.h>])
  1014. _libs=$LIBS
  1015. LIBS="$LIBS -lm"
  1016. AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
  1017. [AC_MSG_RESULT(yes)
  1018. AC_DEFINE(HAVE_ISFINITE)],
  1019. AC_MSG_RESULT(no))
  1020. LIBS=$_libs])])
  1021. AC_CHECK_FUNCS(getbootfile getclock getdtablesize)
  1022. AC_ARG_ENABLE(getifaddrs,
  1023. AC_HELP_STRING([--enable-getifaddrs],
  1024. [s Enable the use of getifaddrs() [[yes|no|glibc]].
  1025. glibc: Use getifaddrs() in glibc if you know it supports IPv6.]),
  1026. want_getifaddrs="$enableval", want_getifaddrs="yes")
  1027. case $want_getifaddrs in
  1028. yes|glibc)
  1029. #
  1030. # Do we have getifaddrs() ?
  1031. #
  1032. case $host in
  1033. *-*linux*)
  1034. # Some recent versions of glibc support getifaddrs() which does not
  1035. # provide AF_INET6 addresses while the function provided by the USAGI
  1036. # project handles the AF_INET6 case correctly. We need to avoid
  1037. # using the former but prefer the latter unless overridden by
  1038. # --enable-getifaddrs=glibc.
  1039. if test $want_getifaddrs = glibc
  1040. then
  1041. AC_CHECK_FUNCS(getifaddrs)
  1042. else
  1043. save_LIBS="$LIBS"
  1044. LIBS="-L/usr/local/v6/lib $LIBS"
  1045. AC_CHECK_LIB(inet6, getifaddrs,
  1046. LIBS="$LIBS -linet6"
  1047. AC_DEFINE(HAVE_GETIFADDRS),
  1048. LIBS=${save_LIBS})
  1049. fi
  1050. ;;
  1051. *)
  1052. AC_CHECK_FUNCS(getifaddrs)
  1053. ;;
  1054. esac
  1055. ;;
  1056. no)
  1057. ;;
  1058. esac
  1059. AC_MSG_CHECKING([type of socklen arg for getsockname()])
  1060. AC_CACHE_VAL(ac_cv_func_getsockname_arg2,dnl
  1061. [AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl
  1062. [for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do
  1063. for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
  1064. AC_TRY_COMPILE(dnl
  1065. [#ifdef HAVE_SYS_TYPES_H
  1066. #include <sys/types.h>
  1067. #endif
  1068. #ifdef HAVE_SYS_SOCKET_H
  1069. #include <sys/socket.h>
  1070. #endif
  1071. extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl
  1072. [ac_not_found=no ; break 2], ac_not_found=yes)
  1073. done
  1074. done
  1075. ])dnl AC_CACHE_VAL
  1076. ])dnl AC_CACHE_VAL
  1077. if test "$ac_not_found" = yes; then
  1078. ac_cv_func_getsockname_socklen_type='socklen_t'
  1079. fi
  1080. AC_MSG_RESULT([$ac_cv_func_getsockname_socklen_type])
  1081. AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
  1082. $ac_cv_func_getsockname_socklen_type,
  1083. [What is getsockname()'s socklen type?])
  1084. AC_CHECK_FUNCS(getrusage)
  1085. AC_CHECK_FUNC(gettimeofday, ,[
  1086. case "$host" in
  1087. *-*-mpeix*) ac_cv_func_gettimeofday=yes
  1088. ;;
  1089. esac])
  1090. case "$host" in
  1091. *-pc-cygwin*)
  1092. ;;
  1093. *) AC_CHECK_FUNCS(getuid)
  1094. ;;
  1095. esac
  1096. AC_CHECK_FUNCS(hstrerror)
  1097. #
  1098. # Check for if_nametoindex() for IPv6 scoped addresses support
  1099. #
  1100. AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
  1101. ac_cv_have_if_nametoindex=no)
  1102. case $ac_cv_have_if_nametoindex in
  1103. no)
  1104. case "$host" in
  1105. *-hp-hpux*)
  1106. AC_CHECK_LIB(ipv6, if_nametoindex,
  1107. ac_cv_have_if_nametoindex=yes
  1108. LIBS="-lipv6 $LIBS",)
  1109. ;;
  1110. esac
  1111. esac
  1112. case $ac_cv_have_if_nametoindex in
  1113. yes)
  1114. AC_DEFINE(ISC_PLATFORM_HAVEIFNAMETOINDEX, 1, [ISC: do we have if_nametoindex()?])
  1115. ;;
  1116. esac
  1117. AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])])
  1118. AC_CHECK_FUNC(inet_pton, [], [AC_DEFINE(ISC_PLATFORM_NEEDPTON, 1, [ISC: provide inet_pton()])])
  1119. AC_CHECK_FUNC(inet_aton, [], [AC_DEFINE(ISC_PLATFORM_NEEDATON, 1, [ISC: provide inet_aton()])])
  1120. AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset)
  1121. case "$host" in
  1122. *-*-sco3.2v5.0.*)
  1123. # Just stubs. Idiots.
  1124. ;;
  1125. *) AC_CHECK_FUNCS(mkstemp)
  1126. ;;
  1127. esac
  1128. AC_CHECK_FUNCS(mktime)
  1129. case "$host" in
  1130. *-*-aix[[456]]*)
  1131. # Just a stub. Idiots.
  1132. ;;
  1133. *-*-irix[[45]]*)
  1134. # Just a stub in "old" Irix. Idiots.
  1135. ;;
  1136. *-*-*linux*)
  1137. # there, but more trouble than it is worth for now (resolver problems)
  1138. ;;
  1139. *-*-qnx*)
  1140. # Apparently there but not working in QNX. Idiots?
  1141. ;;
  1142. *-*-sco3.2v5.0.*)
  1143. # Just a stub. Idiots.
  1144. ;;
  1145. alpha*-dec-osf4*|alpha*-dec-osf5*)
  1146. # mlockall is there, as a #define calling memlk via <sys/mman.h>
  1147. # Not easy to test for - cheat.
  1148. AC_CHECK_FUNCS(memlk, [ac_cv_func_mlockall='yes'])
  1149. AC_CHECK_FUNCS(mlockall)
  1150. ;;
  1151. *) AC_CHECK_FUNCS(mlockall)
  1152. ;;
  1153. esac
  1154. AC_CHECK_FUNCS(nice nlist)
  1155. case "$host" in
  1156. *-*-solaris2.6)
  1157. # Broken...
  1158. ;;
  1159. *) AC_CHECK_FUNCS(ntp_adjtime ntp_gettime)
  1160. ;;
  1161. esac
  1162. AC_CHECK_FUNCS(plock pututline pututxline readlink recvmsg rtprio)
  1163. case "$host" in
  1164. *-*-aix[[456]]*)
  1165. # Just a stub in AIX 4. Idiots.
  1166. ;;
  1167. *-*-solaris2.5*)
  1168. # Just stubs in solaris2.5. Idiots.
  1169. ;;
  1170. *) AC_CHECK_FUNCS(sched_setscheduler)
  1171. ;;
  1172. esac
  1173. AC_CHECK_FUNCS(setlinebuf setpgid setpriority setsid)
  1174. AC_CHECK_FUNCS(setrlimit)
  1175. AC_CHECK_FUNCS(settimeofday, ,[
  1176. case "$host" in
  1177. *-*-mpeix*) ac_cv_func_settimeofday=yes
  1178. ;;
  1179. esac])
  1180. AC_CHECK_FUNCS(setvbuf sigaction)
  1181. AC_CHECK_FUNCS(sigvec sigset sigsuspend stime strchr sysconf sysctl)
  1182. AC_CHECK_FUNCS(snprintf strdup strerror strstr)
  1183. AC_CHECK_FUNCS(timegm)
  1184. case "$host" in
  1185. *-*-aix[[456]]*)
  1186. # Just stubs. Idiots.
  1187. ;;
  1188. *-*-netbsd1*)
  1189. # Just stubs. Idiots.
  1190. ;;
  1191. *-*-netbsdelf1*)
  1192. # Just stubs. Idiots.
  1193. ;;
  1194. *-*-openbsd*)
  1195. # Just stubs. Idiots.
  1196. ;;
  1197. *) AC_CHECK_FUNCS(timer_create timer_settime)
  1198. ;;
  1199. esac
  1200. case "$host" in
  1201. *-pc-cygwin*)
  1202. # I have no idea...
  1203. ;;
  1204. *) AC_CHECK_FUNCS(umask)
  1205. ;;
  1206. esac
  1207. AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf)
  1208. ###
  1209. # http://bugs.ntp.org/737
  1210. case "$ac_cv_func_recvmsg" in
  1211. yes)
  1212. AC_MSG_CHECKING([if we need extra help to define struct iovec])
  1213. AC_CACHE_VAL(ac_cv_struct_iovec_help,dnl
  1214. [for ac_cv_struct_iovec_help in '0' '1'; do
  1215. AC_TRY_COMPILE(dnl
  1216. [#ifdef HAVE_SYS_TYPES_H
  1217. #include <sys/types.h>
  1218. #endif
  1219. #ifdef HAVE_SYS_SOCKET_H
  1220. #include <sys/socket.h>
  1221. #endif
  1222. #if $ac_cv_struct_iovec_help
  1223. #include <sys/uio.h>
  1224. #endif
  1225. void foo();
  1226. void foo() {
  1227. ssize_t x;
  1228. int s = 0;
  1229. struct iovec iov;
  1230. struct msghdr mh;
  1231. int flags = 0;
  1232. mh.msg_iov = &iov;
  1233. x = recvmsg(s, &mh, flags);
  1234. }],,dnl
  1235. [ac_worked=yes ; break 1], ac_worked=no)
  1236. done
  1237. ])dnl AC_CACHE_VAL
  1238. case "$ac_worked$ac_cv_struct_iovec_help" in
  1239. yes1)
  1240. AC_DEFINE(HAVE_SYS_UIO_H, 1, [Use sys/uio.h for struct iovec help])
  1241. ans=yes
  1242. ;;
  1243. *) ans=no
  1244. esac
  1245. AC_MSG_RESULT([$ans])
  1246. ;;
  1247. esac
  1248. case "$host" in
  1249. *-*-sunos4*)
  1250. AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*])
  1251. ;;
  1252. esac
  1253. AC_CACHE_CHECK([number of arguments to gettimeofday()], ac_cv_func_Xettimeofday_nargs,
  1254. [AC_TRY_COMPILE([#include <sys/time.h>],[
  1255. gettimeofday((struct timeval*)0,(struct timezone*)0);
  1256. settimeofday((struct timeval*)0,(struct timezone*)0);
  1257. ],
  1258. ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
  1259. ])
  1260. if test $ac_cv_func_Xettimeofday_nargs = 1; then
  1261. AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
  1262. fi
  1263. AC_CACHE_CHECK([number of arguments taken by setpgrp()], ac_cv_func_setpgrp_nargs,
  1264. [AC_TRY_COMPILE([
  1265. #ifdef HAVE_SYS_TYPES_H
  1266. # include <sys/types.h>
  1267. #endif
  1268. #ifdef HAVE_UNISTD_H
  1269. # include <unistd.h>
  1270. #endif
  1271. ],[setpgrp(0,0);],
  1272. ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
  1273. ])
  1274. if test $ac_cv_func_setpgrp_nargs = 0; then
  1275. AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
  1276. fi
  1277. save_CFLAGS=$CFLAGS
  1278. CFLAGS="$CFLAGS -I$srcdir/include"
  1279. AC_CACHE_CHECK([argument pointer type of qsort()'s compare function and base],
  1280. ac_cv_func_qsort_argtype,
  1281. [AC_TRY_COMPILE([
  1282. #include "l_stdlib.h"
  1283. #ifdef HAVE_PROTOTYPES
  1284. #define P(x) x
  1285. #else
  1286. #define P(x) ()
  1287. #endif
  1288. extern void *base;
  1289. extern sortfunc P((const void *, const void *));
  1290. int sortfunc(a, b)
  1291. const void *a;
  1292. const void *b; { return 0; }
  1293. ],[
  1294. qsort(base, 2, sizeof(char *), sortfunc);
  1295. ],
  1296. ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
  1297. ])
  1298. case "$ac_cv_func_qsort_argtype" in
  1299. void)
  1300. AC_DEFINE(QSORT_USES_VOID_P, 1, [Does qsort expect to work on "void *" stuff?])
  1301. ;;
  1302. esac
  1303. CFLAGS=$save_CFLAGS
  1304. AC_CACHE_CHECK([if we need to declare 'errno'], ac_cv_decl_errno,
  1305. [AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
  1306. #include <errno.h>
  1307. #endif],
  1308. [errno = 0;],
  1309. ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
  1310. case "$ac_cv_decl_errno" in
  1311. yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
  1312. esac
  1313. dnl FIXME: from ntpd/ntp_intres.c, but there's no info which header produces
  1314. dnl the clash. <resolv.h> isn't currently used.
  1315. dnl
  1316. dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
  1317. dnl MT purposes. This makes the line "extern int h_errno" choke
  1318. dnl the compiler. Hopefully adding !defined(h_errno) fixes this
  1319. dnl without breaking any other platforms.
  1320. dnl
  1321. AC_CACHE_CHECK([if we may declare 'h_errno'], ac_cv_decl_h_errno,
  1322. [AC_TRY_COMPILE([#include <sys/types.h>
  1323. #ifdef HAVE_NETINET_IN_H
  1324. #include <netinet/in.h>
  1325. #endif
  1326. #ifdef HAVE_ARPA_NAMESER_H
  1327. #include <arpa/nameser.h>
  1328. #endif
  1329. #ifdef HAVE_NETDB_H
  1330. #include <netdb.h>
  1331. #endif
  1332. #ifdef HAVE_RESOLV_H
  1333. #include <resolv.h>
  1334. #endif],
  1335. [extern int h_errno;],
  1336. ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
  1337. case "$ac_cv_decl_h_errno" in
  1338. yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
  1339. esac
  1340. dnl See if char *sys_errlist[] is OK.
  1341. AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
  1342. [AC_TRY_COMPILE([#include <stdio.h>
  1343. #ifdef HAVE_ERRNO_H
  1344. #include <errno.h>
  1345. #endif],
  1346. [extern char *sys_errlist[];
  1347. ],
  1348. ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
  1349. case "$ac_cv_decl_sys_errlist" in
  1350. yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
  1351. esac
  1352. AC_CACHE_CHECK([if declaring 'syscall()' is ok], ac_cv_decl_syscall,
  1353. [AC_TRY_COMPILE([
  1354. #ifdef HAVE_SYS_TYPES_H
  1355. # include <sys/types.h>
  1356. #endif
  1357. #ifdef HAVE_UNISTD_H
  1358. # include <unistd.h>
  1359. #endif
  1360. #ifdef HAVE_PROTOTYPES
  1361. #define P(x) x
  1362. #else
  1363. #define P(x) ()
  1364. #endif
  1365. ],
  1366. [extern int syscall P((int, ...));],
  1367. ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
  1368. case "$ac_cv_decl_syscall" in
  1369. yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
  1370. esac
  1371. case "$host" in
  1372. *-*-aix4.3.*)
  1373. AC_DEFINE(DECL_HSTRERROR_0, 1, [Declaration style]) # Needed for XLC under AIX 4.3.2
  1374. ;;
  1375. *-*-mpeix*)
  1376. AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
  1377. AC_DEFINE(DECL_INET_NTOA_0, 1, [Declaration style])
  1378. AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
  1379. AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
  1380. AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
  1381. AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
  1382. AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
  1383. ;;
  1384. *-*-osf[[45]]*)
  1385. AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
  1386. AC_DEFINE(DECL_STIME_1, 1, [Declaration style])
  1387. ;;
  1388. *-*-qnx*)
  1389. AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
  1390. ;;
  1391. *-*-riscos4*)
  1392. AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
  1393. AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
  1394. AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
  1395. AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
  1396. AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
  1397. AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
  1398. AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
  1399. AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
  1400. AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
  1401. AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
  1402. AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
  1403. AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
  1404. AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
  1405. AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
  1406. AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
  1407. AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
  1408. ;;
  1409. *-*-solaris2*)
  1410. AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
  1411. AC_DEFINE(DECL_SETPRIORITY_1, 1, [Declaration style])
  1412. case "$host" in
  1413. *-*-solaris2.4)
  1414. AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
  1415. ;;
  1416. esac
  1417. ;;
  1418. *-*-sunos4*)
  1419. AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
  1420. AC_DEFINE(DECL_BCOPY_0, 1, [Declaration style])
  1421. AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
  1422. AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
  1423. AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
  1424. AC_DEFINE(DECL_MEMMOVE_0, 1, [Declaration style])
  1425. AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
  1426. AC_DEFINE(DECL_MKSTEMP_0, 1, [Declaration style])
  1427. AC_DEFINE(DECL_RENAME_0, 1, [Declaration style])
  1428. AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
  1429. AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
  1430. AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
  1431. AC_DEFINE(DECL_SIGVEC_0, 1, [Declaration style])
  1432. case "`basename $ac_cv_prog_CC`" in
  1433. acc*) ;;
  1434. *) AC_DEFINE(DECL_STDIO_0, 1, [Declaration style])
  1435. ;;
  1436. esac
  1437. AC_DEFINE(DECL_STRTOL_0, 1, [Declaration style])
  1438. AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
  1439. AC_DEFINE(DECL_TIME_0, 1, [Declaration style])
  1440. AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
  1441. AC_DEFINE(DECL_TOLOWER_0, 1, [Declaration style])
  1442. AC_DEFINE(DECL_TOUPPER_0, 1, [Declaration style])
  1443. AC_DEFINE(DECL_STRERROR_0, 1, [Declaration style])
  1444. ;;
  1445. *-*-ultrix4*)
  1446. AC_DEFINE(DECL_ADJTIME_0, 1, [Declaration style])
  1447. AC_DEFINE(DECL_BZERO_0, 1, [Declaration style])
  1448. AC_DEFINE(DECL_CFSETISPEED_0, 1, [Declaration style])
  1449. AC_DEFINE(DECL_IOCTL_0, 1, [Declaration style])
  1450. AC_DEFINE(DECL_IPC_0, 1, [Declaration style])
  1451. AC_DEFINE(DECL_MKTEMP_0, 1, [Declaration style])
  1452. AC_DEFINE(DECL_NLIST_0, 1, [Declaration style])
  1453. AC_DEFINE(DECL_PLOCK_0, 1, [Declaration style])
  1454. AC_DEFINE(DECL_SELECT_0, 1, [Declaration style])
  1455. AC_DEFINE(DECL_SETITIMER_0, 1, [Declaration style])
  1456. AC_DEFINE(DECL_SETPRIORITY_0, 1, [Declaration style])
  1457. AC_DEFINE(DECL_STIME_0, 1, [Declaration style])
  1458. AC_DEFINE(DECL_SYSLOG_0, 1, [Declaration style])
  1459. AC_DEFINE(DECL_TIMEOFDAY_0, 1, [Declaration style])
  1460. ;;
  1461. esac
  1462. case "$host" in
  1463. *-*-sco3.2*)
  1464. AC_DEFINE(TERMIOS_NEEDS__SVID3, 1, [Do we need to #define _SVID3 when we #include <termios.h>?])
  1465. ;;
  1466. esac
  1467. AC_CACHE_CHECK([if we need extra room for SO_RCVBUF], ac_cv_var_rcvbuf_slop,
  1468. [ans=no
  1469. case "$host" in
  1470. *-*-hpux[[567]]*)
  1471. ans=yes
  1472. ;;
  1473. esac
  1474. ac_cv_var_rcvbuf_slop=$ans])
  1475. case "$ac_cv_var_rcvbuf_slop" in
  1476. yes) AC_DEFINE(NEED_RCVBUF_SLOP, 1, [Do we need extra room for SO_RCVBUF? (HPUX <8)]) ;;
  1477. esac
  1478. AC_CACHE_CHECK([if we will open the broadcast socket], ac_cv_var_open_bcast_socket,
  1479. [ans=yes
  1480. case "$host" in
  1481. *-*-domainos)
  1482. ans=no
  1483. ;;
  1484. esac
  1485. ac_cv_var_open_bcast_socket=$ans])
  1486. case "$ac_cv_var_open_bcast_socket" in
  1487. yes) AC_DEFINE(OPEN_BCAST_SOCKET, 1, [Should we open the broadcast socket?]) ;;
  1488. esac
  1489. AC_CACHE_CHECK([if we want the HPUX version of FindConfig()], ac_cv_var_hpux_findconfig,
  1490. [ans=no
  1491. case "$host" in
  1492. *-*-hpux*)
  1493. ans=yes
  1494. ;;
  1495. esac
  1496. ac_cv_var_hpux_findconfig=$ans])
  1497. case "$ac_cv_var_hpux_findconfig" in
  1498. yes) AC_DEFINE(NEED_HPUX_FINDCONFIG, 1, [Do we want the HPUX FindConfig()?]) ;;
  1499. esac
  1500. AC_CACHE_CHECK([if process groups are set with -pid], ac_cv_arg_setpgrp_negpid,
  1501. [case "$host" in
  1502. *-*-hpux[[567]]*)
  1503. ans=no
  1504. ;;
  1505. *-*-hpux*)
  1506. ans=yes
  1507. ;;
  1508. *-*-*linux*)
  1509. ans=yes
  1510. ;;
  1511. *-*-sunos3*)
  1512. ans=yes
  1513. ;;
  1514. *-*-ultrix2*)
  1515. ans=yes
  1516. ;;
  1517. *)
  1518. ans=no
  1519. ;;
  1520. esac
  1521. ac_cv_arg_setpgrp_negpid=$ans])
  1522. case "$ac_cv_arg_setpgrp_negpid" in
  1523. yes) AC_DEFINE(UDP_BACKWARDS_SETOWN, 1, [Do we set process groups with -pid?]) ;;
  1524. esac
  1525. AC_CACHE_CHECK([if we need a ctty for F_SETOWN], ac_cv_func_ctty_for_f_setown,
  1526. [[case "$host" in
  1527. *-*-bsdi[23]*)
  1528. ans=yes
  1529. ;;
  1530. *-*-freebsd*)
  1531. ans=yes
  1532. ;;
  1533. *-*-netbsd*3.[0-8]*|*-*-netbsd*[0-2].*|*-*-netbsd*3.99.[0-7])
  1534. ans=yes
  1535. ;;
  1536. *-*-openbsd*)
  1537. ans=yes
  1538. ;;
  1539. *-*-osf*)
  1540. ans=yes
  1541. ;;
  1542. *-*-darwin*)
  1543. ans=yes
  1544. ;;
  1545. *) ans=no
  1546. ;;
  1547. esac
  1548. ac_cv_func_ctty_for_f_setown=$ans]])
  1549. case "$ac_cv_func_ctty_for_f_setown" in
  1550. yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
  1551. esac
  1552. AC_CACHE_CHECK([if the OS fails to clear cached routes when more specific routes become available], ac_cv_os_routeupdates,
  1553. [[case "$host" in
  1554. *-*-netbsd*)
  1555. ans=yes
  1556. ;;
  1557. *) ans=no
  1558. ;;
  1559. esac
  1560. ac_cv_os_routeupdates=$ans]])
  1561. case "$ac_cv_os_routeupdates" in
  1562. yes) AC_DEFINE(OS_MISSES_SPECIFIC_ROUTE_UPDATES, 1, [need to recreate sockets on changed routing?]) ;;
  1563. esac
  1564. AC_CACHE_CHECK([if the OS needs the wildcard socket set to REUSEADDR for binding interface addresses], ac_cv_os_wildcardreuse,
  1565. [[case "$host" in
  1566. *-*-*linux*)
  1567. ans=yes
  1568. ;;
  1569. *) ans=no
  1570. ;;
  1571. esac
  1572. ac_cv_os_wildcardreuse=$ans]])
  1573. case "$ac_cv_os_wildcardreuse" in
  1574. yes) AC_DEFINE(OS_NEEDS_REUSEADDR_FOR_IFADDRBIND, 1, [wildcard socket needs to set REUSEADDR when binding to interface addresses]) ;;
  1575. esac
  1576. ntp_warning='GRONK'
  1577. AC_MSG_CHECKING([if we'll use clock_settime or settimeofday or stime])
  1578. case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
  1579. yes*)
  1580. ntp_warning=''
  1581. ans='clock_settime()'
  1582. ;;
  1583. noyes*)
  1584. ntp_warning='But clock_settime() would be better (if we had it)'
  1585. ans='settimeofday()'
  1586. ;;
  1587. nonoyes)
  1588. ntp_warning='Which is the worst of the three'
  1589. ans='stime()'
  1590. ;;
  1591. *)
  1592. case "$build" in
  1593. $host) ntp_warning='Which leaves us with nothing to use!'
  1594. ans=none
  1595. ;;
  1596. esac
  1597. esac
  1598. AC_MSG_RESULT([$ans])
  1599. case "$ntp_warning" in
  1600. '') ;;
  1601. *) AC_MSG_WARN([*** $ntp_warning ***])
  1602. ;;
  1603. esac
  1604. AC_CACHE_CHECK([if we have a losing syscall()], ac_cv_var_syscall_bug,
  1605. [case "$host" in
  1606. *-*-solaris2.4*)
  1607. ans=yes
  1608. ;;
  1609. *) ans=no
  1610. ;;
  1611. esac
  1612. ac_cv_var_syscall_bug=$ans])
  1613. case "$ac_cv_var_syscall_bug" in
  1614. yes) AC_DEFINE(SYSCALL_BUG, 1, [Buggy syscall() (Solaris2.4)?]) ;;
  1615. esac
  1616. AC_CACHE_CHECK([for SIGIO], ac_cv_hdr_def_sigio,
  1617. AC_EGREP_CPP(yes,
  1618. [#include <signal.h>
  1619. #ifdef SIGIO
  1620. yes
  1621. #endif
  1622. ], ac_cv_hdr_def_sigio=yes, ac_cv_hdr_def_sigio=no))
  1623. dnl Override those system that have a losing SIGIO
  1624. AC_CACHE_CHECK([if we want to use signalled IO], ac_cv_var_signalled_io,
  1625. [ans=no
  1626. case "$ac_cv_hdr_def_sigio" in
  1627. yes)
  1628. ans=yes
  1629. case "$host" in
  1630. alpha*-dec-osf4*|alpha*-dec-osf5*)
  1631. ans=no
  1632. ;;
  1633. *-convex-*)
  1634. ans=no
  1635. ;;
  1636. *-dec-*)
  1637. ans=no
  1638. ;;
  1639. *-pc-cygwin*)
  1640. ans=no
  1641. ;;
  1642. *-sni-sysv*)
  1643. ans=no
  1644. ;;
  1645. *-univel-sysv*)
  1646. ans=no
  1647. ;;
  1648. *-*-irix6*)
  1649. ans=no
  1650. ;;
  1651. *-*-freebsd*)
  1652. ans=no
  1653. ;;
  1654. *-*-*linux*)
  1655. ans=no
  1656. ;;
  1657. *-*-unicosmp*)
  1658. ans=no
  1659. ;;
  1660. esac
  1661. ;;
  1662. esac
  1663. ac_cv_var_signalled_io=$ans])
  1664. case "$ac_cv_var_signalled_io" in
  1665. yes) AC_DEFINE(HAVE_SIGNALED_IO, 1, [Can we use SIGIO for tcp and udp IO?]) ;;
  1666. esac
  1667. AC_CACHE_CHECK([for SIGPOLL], ac_cv_hdr_def_sigpoll,
  1668. AC_EGREP_CPP(yes,
  1669. [#include <signal.h>
  1670. #ifdef SIGPOLL
  1671. yes
  1672. #endif
  1673. ], ac_cv_hdr_def_sigpoll=yes, ac_cv_hdr_def_sigpoll=no))
  1674. AC_CACHE_CHECK([for SIGSYS], ac_cv_hdr_def_sigsys,
  1675. AC_EGREP_CPP(yes,
  1676. [#include <signal.h>
  1677. #ifdef SIGSYS
  1678. yes
  1679. #endif
  1680. ], ac_cv_hdr_def_sigsys=yes, ac_cv_hdr_def_sigsys=no))
  1681. AC_CACHE_CHECK([if we can use SIGPOLL for UDP I/O], ac_cv_var_use_udp_sigpoll,
  1682. [ans=no
  1683. case "$ac_cv_hdr_def_sigpoll" in
  1684. yes)
  1685. case "$host" in
  1686. mips-sgi-irix*)
  1687. ans=no
  1688. ;;
  1689. vax-dec-bsd)
  1690. ans=no
  1691. ;;
  1692. *-pc-cygwin*)
  1693. ans=no
  1694. ;;
  1695. *-sni-sysv*)
  1696. ans=no
  1697. ;;
  1698. *-*-aix[[456]]*)
  1699. ans=no
  1700. ;;
  1701. *-*-hpux*)
  1702. ans=no
  1703. ;;
  1704. *-*-*linux*)
  1705. ans=no
  1706. ;;
  1707. *-*-osf*)
  1708. ans=no
  1709. ;;
  1710. *-*-qnx*)
  1711. ans=no
  1712. ;;
  1713. *-*-sunos*)
  1714. ans=no
  1715. ;;
  1716. *-*-solaris*)
  1717. ans=no
  1718. ;;
  1719. *-*-ultrix*)
  1720. ans=no
  1721. ;;
  1722. *-*-unicosmp*)
  1723. ans=no
  1724. ;;
  1725. *) ans=yes
  1726. ;;
  1727. esac
  1728. ;;
  1729. esac
  1730. ac_cv_var_use_udp_sigpoll=$ans])
  1731. case "$ac_cv_var_use_udp_sigpoll" in
  1732. yes) AC_DEFINE(USE_UDP_SIGPOLL, 1, [Can we use SIGPOLL for UDP?]) ;;
  1733. esac
  1734. AC_CACHE_CHECK([if we can use SIGPOLL for TTY I/O], ac_cv_var_use_tty_sigpoll,
  1735. [ans=no
  1736. case "$ac_cv_hdr_def_sigpoll" in
  1737. yes)
  1738. case "$host" in
  1739. mips-sgi-irix*)
  1740. ans=no
  1741. ;;
  1742. vax-dec-bsd)
  1743. ans=no
  1744. ;;
  1745. *-pc-cygwin*)
  1746. ans=no
  1747. ;;
  1748. *-sni-sysv*)
  1749. ans=no
  1750. ;;
  1751. *-*-aix[[456]]*)
  1752. ans=no
  1753. ;;
  1754. *-*-hpux*)
  1755. ans=no
  1756. ;;
  1757. *-*-*linux*)
  1758. ans=no
  1759. ;;
  1760. *-*-osf*)
  1761. ans=no
  1762. ;;
  1763. *-*-sunos*)
  1764. ans=no
  1765. ;;
  1766. *-*-ultrix*)
  1767. ans=no
  1768. ;;
  1769. *-*-qnx*)
  1770. ans=no
  1771. ;;
  1772. *-*-unicosmp*)
  1773. ans=no
  1774. ;;
  1775. *) ans=yes
  1776. ;;
  1777. esac
  1778. ;;
  1779. esac
  1780. ac_cv_var_use_tty_sigpoll=$ans])
  1781. case "$ac_cv_var_use_tty_sigpoll" in
  1782. yes) AC_DEFINE(USE_TTY_SIGPOLL, 1, [Can we use SIGPOLL for tty IO?]) ;;
  1783. esac
  1784. case "$ac_cv_header_sys_sio_h" in
  1785. yes)
  1786. AC_CACHE_CHECK([sys/sio.h for TIOCDCDTIMESTAMP], ac_cv_hdr_def_tiocdcdtimestamp,
  1787. AC_EGREP_CPP(yes,
  1788. [#include <sys/sio.h>
  1789. #ifdef TIOCDCDTIMESTAMP
  1790. yes
  1791. #endif
  1792. ], ac_cv_hdr_def_tiocdcdtimestamp=yes, ac_cv_hdr_def_tiocdcdtimestamp=no))
  1793. ;;
  1794. esac
  1795. case "$ac_cv_hdr_def_tiocdcdtimestamp" in
  1796. yes)
  1797. ac_cv_var_oncore_ok=yes
  1798. ;;
  1799. esac
  1800. AC_CACHE_CHECK([if nlist() values might require extra indirection],
  1801. ac_cv_var_nlist_extra_indirection,
  1802. [ans=no
  1803. case "$host" in
  1804. *-*-aix*)
  1805. ans=yes
  1806. ;;
  1807. esac
  1808. ac_cv_var_nlist_extra_indirection=$ans])
  1809. case "$ac_cv_var_nlist_extra_indirection" in
  1810. yes) AC_DEFINE(NLIST_EXTRA_INDIRECTION, 1, [Might nlist() values require an extra level of indirection (AIX)?]) ;;
  1811. esac
  1812. AC_CACHE_CHECK([for a minimum recommended value of tickadj],
  1813. ac_cv_var_min_rec_tickadj,
  1814. [ans=no
  1815. case "$host" in
  1816. *-*-aix*)
  1817. ans=40
  1818. ;;
  1819. esac
  1820. ac_cv_var_min_rec_tickadj=$ans])
  1821. case "$ac_cv_var_min_rec_tickadj" in
  1822. ''|no) ;;
  1823. *) AC_DEFINE_UNQUOTED(MIN_REC_TICKADJ, $ac_cv_var_min_rec_tickadj, [Should we recommend a minimum value for tickadj?]) ;;
  1824. esac
  1825. AC_CACHE_CHECK([if the TTY code permits PARENB and IGNPAR],
  1826. ac_cv_var_no_parenb_ignpar,
  1827. [ans=no
  1828. case "$host" in
  1829. i?86-*-*linux*)
  1830. ans=yes
  1831. ;;
  1832. mips-sgi-irix*)
  1833. ans=yes
  1834. ;;
  1835. i?86-*-freebsd[[123]].*)
  1836. ;;
  1837. i?86-*-freebsd*)
  1838. ans=yes
  1839. ;;
  1840. *-*-unicosmp*)
  1841. ans=yes
  1842. ;;
  1843. esac
  1844. ac_cv_var_no_parenb_ignpar=$ans])
  1845. case "$ac_cv_var_no_parenb_ignpar" in
  1846. yes) AC_DEFINE(NO_PARENB_IGNPAR, 1, [Is there a problem using PARENB and IGNPAR (IRIX)?]) ;;
  1847. esac
  1848. AC_MSG_CHECKING([if we're including debugging code])
  1849. AC_ARG_ENABLE(debugging,
  1850. AC_HELP_STRING([--enable-debugging], [+ include debugging code]),
  1851. [ntp_ok=$enableval], [ntp_ok=yes])
  1852. if test "$ntp_ok" = "yes"; then
  1853. AC_DEFINE(DEBUG, 1, [Enable debugging?])
  1854. fi
  1855. AC_MSG_RESULT($ntp_ok)
  1856. AC_MSG_CHECKING([if we including processing time debugging code])
  1857. AC_ARG_ENABLE(debug-timing,
  1858. AC_HELP_STRING([--enable-debug-timing], [- include processing time debugging code (costs performance)]),
  1859. [ntp_ok=$enableval], [ntp_ok=no])
  1860. if test "$ntp_ok" = "yes"; then
  1861. AC_DEFINE(DEBUG_TIMING, 1, [Enable processing time debugging?])
  1862. fi
  1863. AC_MSG_RESULT($ntp_ok)
  1864. AC_MSG_C