]> andersk Git - openssh.git/blame - configure.ac
- (dtucker) [regress/try-ciphers.sh] Skip acss if not compiled in (eg if we
[openssh.git] / configure.ac
CommitLineData
eb5d7ff6 1# $Id$
0b202697 2
98a7c37b 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
5881cd60 5
6AC_CONFIG_HEADER(config.h)
b14b2ae7 7AC_PROG_CC
a7effaac 8AC_CANONICAL_HOST
cf0c5df5 9AC_C_BIGENDIAN
5881cd60 10
a0391976 11# Checks for programs.
4bbf95fa 12AC_PROG_AWK
4cca272e 13AC_PROG_CPP
5881cd60 14AC_PROG_RANLIB
cf8dd513 15AC_PROG_INSTALL
bee0a37e 16AC_PATH_PROG(AR, ar)
13dd877b 17AC_PATH_PROGS(PERL, perl5 perl)
c3690df3 18AC_PATH_PROG(SED, sed)
a0f84251 19AC_SUBST(PERL)
ad85db64 20AC_PATH_PROG(ENT, ent)
21AC_SUBST(ENT)
6958bd37 22AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24AC_PATH_PROG(TEST_MINUS_S_SH, sh)
6193497b 25AC_PATH_PROG(SH, sh)
f498ed15 26
948fd8b9 27# System features
28AC_SYS_LARGEFILE
29
c193d002 30if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32fi
33
2e73a022 34# Use LOGIN_PROGRAM from environment if possible
35if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37else
38 # Search for login
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
42 fi
43fi
44
37656beb 45AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
46if test ! -z "$PATH_PASSWD_PROG" ; then
47 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
48fi
49
d423d822 50if test -z "$LD" ; then
51 LD=$CC
52fi
53AC_SUBST(LD)
54
d423d822 55AC_C_INLINE
aff51935 56if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
5ed2bb5b 57 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
d423d822 58fi
59
e6354014 60AC_ARG_WITH(rpath,
61 [ --without-rpath Disable auto-added -R linker paths],
62 [
63 if test "x$withval" = "xno" ; then
64 need_dash_r=""
65 fi
66 if test "x$withval" = "xyes" ; then
67 need_dash_r=1
68 fi
69 ]
70)
71
a0391976 72# Check for some target-specific stuff
a7effaac 73case "$host" in
9d6b1b96 74*-*-aix*)
aff51935 75 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
68ece370 76 if (test -z "$blibpath"); then
0a15d73b 77 blibpath="/usr/lib:/lib"
68ece370 78 fi
79 saved_LDFLAGS="$LDFLAGS"
80 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
81 if (test -z "$blibflags"); then
82 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
83 AC_TRY_LINK([], [], [blibflags=$tryflags])
84 fi
85 done
86 if (test -z "$blibflags"); then
87 AC_MSG_RESULT(not found)
88 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
89 else
90 AC_MSG_RESULT($blibflags)
bd499f9e 91 fi
68ece370 92 LDFLAGS="$saved_LDFLAGS"
e351e493 93 dnl Check for authenticate. Might be in libs.a on older AIXes
94 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
0764e748 95 [AC_CHECK_LIB(s,authenticate,
e351e493 96 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
0764e748 97 LIBS="$LIBS -ls"
98 ])
99 ])
e351e493 100 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
101 AC_CHECK_DECL(loginfailed,
102 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
103 AC_TRY_COMPILE(
f58c0e01 104 [#include <usersec.h>],
e351e493 105 [(void)loginfailed("user","host","tty",0);],
106 [AC_MSG_RESULT(yes)
107 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
f58c0e01 108 [AC_MSG_RESULT(no)]
e351e493 109 )],
110 [],
111 [#include <usersec.h>]
112 )
2aa3a16c 113 AC_CHECK_FUNCS(setauthdb)
4c8ef3fb 114 AC_DEFINE(BROKEN_GETADDRINFO)
1352689f 115 AC_DEFINE(BROKEN_REALPATH)
3b8dff69 116 AC_DEFINE(SETEUID_BREAKS_SETUID)
117 AC_DEFINE(BROKEN_SETREUID)
118 AC_DEFINE(BROKEN_SETREGID)
a3cef3ca 119 dnl AIX handles lastlog as part of its login message
120 AC_DEFINE(DISABLE_LASTLOG)
58177c0a 121 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3a2b2b44 122 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
9d6b1b96 123 ;;
3c62e7eb 124*-*-cygwin*)
a52997bd 125 check_for_libcrypt_later=1
ffb8d130 126 LIBS="$LIBS /usr/lib/textmode.o"
3c62e7eb 127 AC_DEFINE(HAVE_CYGWIN)
7043a38d 128 AC_DEFINE(USE_PIPES)
3c62e7eb 129 AC_DEFINE(DISABLE_SHADOW)
3c62e7eb 130 AC_DEFINE(IP_TOS_IS_BROKEN)
3d114925 131 AC_DEFINE(NO_X11_UNIX_SOCKETS)
e6f15ed1 132 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
94d8258b 133 AC_DEFINE(DISABLE_FD_PASSING)
246446cd 134 AC_DEFINE(SETGROUPS_NOOP)
3c62e7eb 135 ;;
d6fdb079 136*-*-dgux*)
137 AC_DEFINE(IP_TOS_IS_BROKEN)
0c6a72a5 138 AC_DEFINE(SETEUID_BREAKS_SETUID)
139 AC_DEFINE(BROKEN_SETREUID)
140 AC_DEFINE(BROKEN_SETREGID)
d6fdb079 141 ;;
39c98ef7 142*-*-darwin*)
33e2e066 143 AC_MSG_CHECKING(if we have working getaddrinfo)
144 AC_TRY_RUN([#include <mach-o/dyld.h>
145main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
146 exit(0);
147 else
148 exit(1);
149}], [AC_MSG_RESULT(working)],
150 [AC_MSG_RESULT(buggy)
151 AC_DEFINE(BROKEN_GETADDRINFO)],
b27e573d 152 [AC_MSG_RESULT(assume it is working)])
635e0c42 153 AC_DEFINE(SETEUID_BREAKS_SETUID)
154 AC_DEFINE(BROKEN_SETREUID)
155 AC_DEFINE(BROKEN_SETREGID)
ff620033 156 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
39c98ef7 157 ;;
6e879cb4 158*-*-hpux10.26)
159 if test -z "$GCC"; then
160 CFLAGS="$CFLAGS -Ae"
161 fi
162 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
163 IPADDR_IN_DISPLAY=yes
164 AC_DEFINE(HAVE_SECUREWARE)
165 AC_DEFINE(USE_PIPES)
166 AC_DEFINE(LOGIN_NO_ENDOPT)
167 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3e6e3da0 168 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
3a2b2b44 169 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
f75ca46d 170 LIBS="$LIBS -lsec -lsecpw"
171 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
6e879cb4 172 disable_ptmx_check=yes
173 ;;
a7effaac 174*-*-hpux10*)
175 if test -z "$GCC"; then
fc1e8bf4 176 CFLAGS="$CFLAGS -Ae"
a7effaac 177 fi
28564873 178 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 179 IPADDR_IN_DISPLAY=yes
137d7b6c 180 AC_DEFINE(USE_PIPES)
a2572aa7 181 AC_DEFINE(LOGIN_NO_ENDOPT)
182 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3e6e3da0 183 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
3a2b2b44 184 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
f75ca46d 185 LIBS="$LIBS -lsec"
186 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
a7effaac 187 ;;
2b763e31 188*-*-hpux11*)
b8fea62d 189 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 190 IPADDR_IN_DISPLAY=yes
adeebd37 191 AC_DEFINE(PAM_SUN_CODEBASE)
2b10f47a 192 AC_DEFINE(USE_PIPES)
a2572aa7 193 AC_DEFINE(LOGIN_NO_ENDOPT)
194 AC_DEFINE(LOGIN_NEEDS_UTMPX)
764d4113 195 AC_DEFINE(DISABLE_UTMP)
3e6e3da0 196 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
3a2b2b44 197 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
38b69c0b 198 case "$host" in
199 *-*-hpux11.11*)
200 AC_DEFINE(BROKEN_GETADDRINFO);;
201 esac
f75ca46d 202 LIBS="$LIBS -lsec"
203 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
2b763e31 204 ;;
d94aa2ae 205*-*-irix5*)
6ac7829a 206 PATH="$PATH:/usr/etc"
416ed5a7 207 AC_DEFINE(BROKEN_INET_NTOA)
cb433561 208 AC_DEFINE(SETEUID_BREAKS_SETUID)
209 AC_DEFINE(BROKEN_SETREUID)
210 AC_DEFINE(BROKEN_SETREGID)
0e8f4eba 211 AC_DEFINE(WITH_ABBREV_NO_TTY)
3e6e3da0 212 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
b9795b89 213 ;;
214*-*-irix6*)
6ac7829a 215 PATH="$PATH:/usr/etc"
3206bb3b 216 AC_DEFINE(WITH_IRIX_ARRAY)
217 AC_DEFINE(WITH_IRIX_PROJECT)
218 AC_DEFINE(WITH_IRIX_AUDIT)
b5171f93 219 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
416ed5a7 220 AC_DEFINE(BROKEN_INET_NTOA)
412c0eaa 221 AC_DEFINE(SETEUID_BREAKS_SETUID)
222 AC_DEFINE(BROKEN_SETREUID)
223 AC_DEFINE(BROKEN_SETREGID)
0e8f4eba 224 AC_DEFINE(WITH_ABBREV_NO_TTY)
3e6e3da0 225 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
d94aa2ae 226 ;;
5cdfe03f 227*-*-linux*)
228 no_dev_ptmx=1
717057b6 229 check_for_libcrypt_later=1
eacb954e 230 check_for_openpty_ctty_bug=1
80faa19f 231 AC_DEFINE(DONT_TRY_OTHER_AF)
a8545c6c 232 AC_DEFINE(PAM_TTY_KLUDGE)
3e6e3da0 233 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
3a2b2b44 234 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
80faa19f 235 inet6_default_4in6=yes
bf7c1e6c 236 case `uname -r` in
ad84c479 237 1.*|2.0.*)
bf7c1e6c 238 AC_DEFINE(BROKEN_CMSG_TYPE)
239 ;;
bf7c1e6c 240 esac
5cdfe03f 241 ;;
66d6c27e 242mips-sony-bsd|mips-sony-newsos4)
243 AC_DEFINE(HAVE_NEWS4)
244 SONY=1
66d6c27e 245 ;;
d468fc76 246*-*-netbsd*)
33e2e066 247 check_for_libcrypt_before=1
e6354014 248 if test "x$withval" != "xno" ; then
249 need_dash_r=1
250 fi
d468fc76 251 ;;
86b416a7 252*-*-freebsd*)
253 check_for_libcrypt_later=1
254 ;;
8707b7eb 255*-*-bsdi*)
256 AC_DEFINE(SETEUID_BREAKS_SETUID)
257 AC_DEFINE(BROKEN_SETREUID)
258 AC_DEFINE(BROKEN_SETREGID)
259 ;;
729bfe59 260*-next-*)
729bfe59 261 conf_lastlog_location="/usr/adm/lastlog"
698d107e 262 conf_utmp_location=/etc/utmp
263 conf_wtmp_location=/usr/adm/wtmp
264 MAIL=/usr/spool/mail
729bfe59 265 AC_DEFINE(HAVE_NEXT)
443172c4 266 AC_DEFINE(BROKEN_REALPATH)
00937921 267 AC_DEFINE(USE_PIPES)
86b416a7 268 AC_DEFINE(BROKEN_SAVED_UIDS)
729bfe59 269 ;;
9d6b1b96 270*-*-solaris*)
adeebd37 271 AC_DEFINE(PAM_SUN_CODEBASE)
7e2d5fa4 272 AC_DEFINE(LOGIN_NEEDS_UTMPX)
273 AC_DEFINE(LOGIN_NEEDS_TERM)
7f0a4ff1 274 AC_DEFINE(PAM_TTY_KLUDGE)
3e6e3da0 275 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
ad84c479 276 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
277 AC_DEFINE(SSHD_ACQUIRES_CTTY)
95b99395 278 external_path_file=/etc/default/login
1d7b9b20 279 # hardwire lastlog location (can't detect it on some versions)
280 conf_lastlog_location="/var/adm/lastlog"
32c80420 281 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
282 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
283 if test "$sol2ver" -ge 8; then
284 AC_MSG_RESULT(yes)
285 AC_DEFINE(DISABLE_UTMP)
286 AC_DEFINE(DISABLE_WTMP)
287 else
288 AC_MSG_RESULT(no)
289 fi
9d6b1b96 290 ;;
a423beaf 291*-*-sunos4*)
0c2fb82f 292 CPPFLAGS="$CPPFLAGS -DSUNOS4"
a423beaf 293 AC_CHECK_FUNCS(getpwanam)
adeebd37 294 AC_DEFINE(PAM_SUN_CODEBASE)
32eec038 295 conf_utmp_location=/etc/utmp
296 conf_wtmp_location=/var/adm/wtmp
297 conf_lastlog_location=/var/adm/lastlog
137d7b6c 298 AC_DEFINE(USE_PIPES)
a423beaf 299 ;;
6f68f28a 300*-ncr-sysv*)
98a7c37b 301 LIBS="$LIBS -lc89"
29525240 302 AC_DEFINE(USE_PIPES)
eabb99c6 303 AC_DEFINE(SSHD_ACQUIRES_CTTY)
6fb3618d 304 AC_DEFINE(SETEUID_BREAKS_SETUID)
305 AC_DEFINE(BROKEN_SETREUID)
306 AC_DEFINE(BROKEN_SETREGID)
6f68f28a 307 ;;
132dd316 308*-sni-sysv*)
c8c15bcb 309 # /usr/ucblib MUST NOT be searched on ReliantUNIX
e2798e96 310 AC_CHECK_LIB(dl, dlsym, ,)
9548d6c8 311 IPADDR_IN_DISPLAY=yes
312 AC_DEFINE(USE_PIPES)
132dd316 313 AC_DEFINE(IP_TOS_IS_BROKEN)
605369bb 314 AC_DEFINE(SETEUID_BREAKS_SETUID)
315 AC_DEFINE(BROKEN_SETREUID)
316 AC_DEFINE(BROKEN_SETREGID)
eabb99c6 317 AC_DEFINE(SSHD_ACQUIRES_CTTY)
95b99395 318 external_path_file=/etc/default/login
c8c15bcb 319 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
320 # Attention: always take care to bind libsocket and libnsl before libc,
321 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
132dd316 322 ;;
77bb0bca 323*-*-sysv4.2*)
ed6553e2 324 AC_DEFINE(USE_PIPES)
7ed101c0 325 AC_DEFINE(SETEUID_BREAKS_SETUID)
326 AC_DEFINE(BROKEN_SETREUID)
327 AC_DEFINE(BROKEN_SETREGID)
77bb0bca 328 ;;
329*-*-sysv5*)
ed6553e2 330 AC_DEFINE(USE_PIPES)
7ed101c0 331 AC_DEFINE(SETEUID_BREAKS_SETUID)
332 AC_DEFINE(BROKEN_SETREUID)
333 AC_DEFINE(BROKEN_SETREGID)
77bb0bca 334 ;;
9d6b1b96 335*-*-sysv*)
9d6b1b96 336 ;;
77bb0bca 337*-*-sco3.2v4*)
0a15d73b 338 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
f9e4952c 339 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
77bb0bca 340 RANLIB=true
ed6553e2 341 no_dev_ptmx=1
77bb0bca 342 AC_DEFINE(BROKEN_SYS_TERMIO_H)
ed6553e2 343 AC_DEFINE(USE_PIPES)
6e879cb4 344 AC_DEFINE(HAVE_SECUREWARE)
d287c664 345 AC_DEFINE(DISABLE_SHADOW)
86b416a7 346 AC_DEFINE(BROKEN_SAVED_UIDS)
bcebad47 347 AC_DEFINE(WITH_ABBREV_NO_TTY)
aca75d94 348 AC_CHECK_FUNCS(getluid setluid)
533875af 349 MANTYPE=man
98a7c37b 350 do_sco3_extra_lib_check=yes
77bb0bca 351 ;;
352*-*-sco3.2v5*)
21710e39 353 if test -z "$GCC"; then
354 CFLAGS="$CFLAGS -belf"
355 fi
ed6553e2 356 LIBS="$LIBS -lprot -lx -ltinfo -lm"
509b1f88 357 no_dev_ptmx=1
ed6553e2 358 AC_DEFINE(USE_PIPES)
6e879cb4 359 AC_DEFINE(HAVE_SECUREWARE)
d287c664 360 AC_DEFINE(DISABLE_SHADOW)
94d8258b 361 AC_DEFINE(DISABLE_FD_PASSING)
7ed101c0 362 AC_DEFINE(SETEUID_BREAKS_SETUID)
363 AC_DEFINE(BROKEN_SETREUID)
364 AC_DEFINE(BROKEN_SETREGID)
bcebad47 365 AC_DEFINE(WITH_ABBREV_NO_TTY)
aca75d94 366 AC_CHECK_FUNCS(getluid setluid)
533875af 367 MANTYPE=man
509b1f88 368 ;;
ccbb983c 369*-*-unicosmk*)
c1ad5966 370 AC_DEFINE(NO_SSH_LASTLOG)
371 AC_DEFINE(SETEUID_BREAKS_SETUID)
372 AC_DEFINE(BROKEN_SETREUID)
373 AC_DEFINE(BROKEN_SETREGID)
ccbb983c 374 AC_DEFINE(USE_PIPES)
375 AC_DEFINE(DISABLE_FD_PASSING)
376 LDFLAGS="$LDFLAGS"
377 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
378 MANTYPE=cat
d262b7f2 379 ;;
7b9a8c6e 380*-*-unicosmp*)
c1ad5966 381 AC_DEFINE(SETEUID_BREAKS_SETUID)
382 AC_DEFINE(BROKEN_SETREUID)
383 AC_DEFINE(BROKEN_SETREGID)
7b9a8c6e 384 AC_DEFINE(WITH_ABBREV_NO_TTY)
385 AC_DEFINE(USE_PIPES)
386 AC_DEFINE(DISABLE_FD_PASSING)
387 LDFLAGS="$LDFLAGS"
c1ad5966 388 LIBS="$LIBS -lgen -lacid -ldb"
7b9a8c6e 389 MANTYPE=cat
390 ;;
ca5c7d6a 391*-*-unicos*)
c1ad5966 392 AC_DEFINE(SETEUID_BREAKS_SETUID)
393 AC_DEFINE(BROKEN_SETREUID)
394 AC_DEFINE(BROKEN_SETREGID)
ca5c7d6a 395 AC_DEFINE(USE_PIPES)
94d8258b 396 AC_DEFINE(DISABLE_FD_PASSING)
ef51930f 397 AC_DEFINE(NO_SSH_LASTLOG)
ccbb983c 398 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
399 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
400 MANTYPE=cat
a704dd54 401 ;;
4d33e531 402*-dec-osf*)
99c8ddac 403 AC_MSG_CHECKING(for Digital Unix SIA)
404 no_osfsia=""
405 AC_ARG_WITH(osfsia,
406 [ --with-osfsia Enable Digital Unix SIA],
407 [
408 if test "x$withval" = "xno" ; then
409 AC_MSG_RESULT(disabled)
410 no_osfsia=1
411 fi
412 ],
413 )
414 if test -z "$no_osfsia" ; then
4d33e531 415 if test -f /etc/sia/matrix.conf; then
416 AC_MSG_RESULT(yes)
417 AC_DEFINE(HAVE_OSF_SIA)
418 AC_DEFINE(DISABLE_LOGIN)
58d0df4e 419 AC_DEFINE(DISABLE_FD_PASSING)
4d33e531 420 LIBS="$LIBS -lsecurity -ldb -lm -laud"
421 else
422 AC_MSG_RESULT(no)
dbf8efb3 423 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
4d33e531 424 fi
425 fi
a6e67b60 426 AC_DEFINE(BROKEN_GETADDRINFO)
f4f2ff4f 427 AC_DEFINE(SETEUID_BREAKS_SETUID)
08da2d08 428 AC_DEFINE(BROKEN_SETREUID)
429 AC_DEFINE(BROKEN_SETREGID)
4d33e531 430 ;;
41cb4569 431
432*-*-nto-qnx)
433 AC_DEFINE(USE_PIPES)
434 AC_DEFINE(NO_X11_UNIX_SOCKETS)
435 AC_DEFINE(MISSING_NFDBITS)
436 AC_DEFINE(MISSING_HOWMANY)
437 AC_DEFINE(MISSING_FD_MASK)
438 ;;
a7effaac 439esac
440
8e7b16f8 441# Allow user to specify flags
442AC_ARG_WITH(cflags,
443 [ --with-cflags Specify additional flags to pass to compiler],
444 [
445 if test "x$withval" != "xno" ; then
446 CFLAGS="$CFLAGS $withval"
447 fi
448 ]
449)
0c2fb82f 450AC_ARG_WITH(cppflags,
451 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
452 [
453 if test "x$withval" != "xno"; then
454 CPPFLAGS="$CPPFLAGS $withval"
455 fi
456 ]
457)
8e7b16f8 458AC_ARG_WITH(ldflags,
97b378bf 459 [ --with-ldflags Specify additional flags to pass to linker],
8e7b16f8 460 [
461 if test "x$withval" != "xno" ; then
462 LDFLAGS="$LDFLAGS $withval"
463 fi
464 ]
465)
466AC_ARG_WITH(libs,
467 [ --with-libs Specify additional libraries to link with],
468 [
469 if test "x$withval" != "xno" ; then
470 LIBS="$LIBS $withval"
471 fi
472 ]
473)
474
c5829391 475AC_MSG_CHECKING(compiler and flags for sanity)
476AC_TRY_RUN([
477#include <stdio.h>
478int main(){exit(0);}
479 ],
480 [ AC_MSG_RESULT(yes) ],
481 [
482 AC_MSG_RESULT(no)
483 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
484 ]
485)
486
ddceb1c8 487# Checks for header files.
688eed4a 488AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
af940dcb 489 getopt.h glob.h ia.h lastlog.h limits.h login.h \
ddceb1c8 490 login_cap.h maillock.h netdb.h netgroup.h \
2511d104 491 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
5bbbc661 492 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
f58c0e01 493 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
9e833a9b 494 sys/cdefs.h sys/mman.h sys/pstat.h sys/ptms.h sys/select.h sys/stat.h \
51693efd 495 sys/stream.h sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
ef51930f 496 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
0a23d79f 497 util.h utime.h utmp.h utmpx.h vis.h)
ddceb1c8 498
a0391976 499# Checks for libraries.
98a7c37b 500AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
501AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
2c523de9 502
f61d6b17 503dnl SCO OS3 needs this for libwrap
98a7c37b 504if test "x$with_tcp_wrappers" != "xno" ; then
505 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
506 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
507 fi
508fi
509
446227d6 510dnl IRIX and Solaris 2.5.1 have dirname() in libgen
511AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
512 AC_CHECK_LIB(gen, dirname,[
513 AC_CACHE_CHECK([for broken dirname],
514 ac_cv_have_broken_dirname, [
515 save_LIBS="$LIBS"
516 LIBS="$LIBS -lgen"
517 AC_TRY_RUN(
518 [
519#include <libgen.h>
520#include <string.h>
521
522int main(int argc, char **argv) {
523 char *s, buf[32];
524
525 strncpy(buf,"/etc", 32);
526 s = dirname(buf);
527 if (!s || strncmp(s, "/", 32) != 0) {
528 exit(1);
529 } else {
530 exit(0);
531 }
532}
533 ],
534 [ ac_cv_have_broken_dirname="no" ],
535 [ ac_cv_have_broken_dirname="yes" ]
536 )
537 LIBS="$save_LIBS"
538 ])
539 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
540 LIBS="$LIBS -lgen"
541 AC_DEFINE(HAVE_DIRNAME)
542 AC_CHECK_HEADERS(libgen.h)
543 fi
544 ])
545])
546
547AC_CHECK_FUNC(getspnam, ,
548 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
549AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
550
98a7c37b 551dnl zlib is required
552AC_ARG_WITH(zlib,
553 [ --with-zlib=PATH Use zlib in PATH],
554 [
846f83ab 555 if test "x$withval" = "xno" ; then
f1b0ecc3 556 AC_MSG_ERROR([*** zlib is required ***])
557 fi
98a7c37b 558 if test -d "$withval/lib"; then
559 if test -n "${need_dash_r}"; then
5a162955 560 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 561 else
5a162955 562 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 563 fi
564 else
565 if test -n "${need_dash_r}"; then
5a162955 566 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 567 else
5a162955 568 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 569 fi
570 fi
571 if test -d "$withval/include"; then
5a162955 572 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 573 else
5a162955 574 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 575 fi
576 ]
577)
578
0a15d73b 579AC_CHECK_LIB(z, deflate, ,
580 [
581 saved_CPPFLAGS="$CPPFLAGS"
582 saved_LDFLAGS="$LDFLAGS"
583 save_LIBS="$LIBS"
584 dnl Check default zlib install dir
585 if test -n "${need_dash_r}"; then
586 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
587 else
588 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
589 fi
590 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
591 LIBS="$LIBS -lz"
592 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
593 [
594 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
595 ]
596 )
597 ]
598)
4ad65809 599AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
8068d564 600
601AC_ARG_WITH(zlib-version-check,
602 [ --without-zlib-version-check Disable zlib version check],
603 [ if test "x$withval" = "xno" ; then
604 zlib_check_nonfatal=1
605 fi
606 ]
607)
608
4ad65809 609AC_MSG_CHECKING(for zlib 1.1.4 or greater)
610AC_TRY_RUN([
611#include <zlib.h>
612int main()
613{
614 int a, b, c, v;
615 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
616 exit(1);
617 v = a*1000000 + b*1000 + c;
618 if (v >= 1001004)
619 exit(0);
620 exit(2);
621}
622 ],
623 AC_MSG_RESULT(yes),
624 [ AC_MSG_RESULT(no)
8068d564 625 if test -z "$zlib_check_nonfatal" ; then
626 AC_MSG_ERROR([*** zlib too old - check config.log ***
627Your reported zlib version has known security problems. It's possible your
628vendor has fixed these problems without changing the version number. If you
629are sure this is the case, you can disable the check by running
630"./configure --without-zlib-version-check".
631If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
632 else
633 AC_MSG_WARN([zlib version may have security problems])
634 fi
635 ]
4ad65809 636)
48e7916f 637
2c523de9 638dnl UnixWare 2.x
aff51935 639AC_CHECK_FUNC(strcasecmp,
2c523de9 640 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
641)
aff51935 642AC_CHECK_FUNC(utimes,
cda1ebcb 643 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
644 LIBS="$LIBS -lc89"]) ]
2c523de9 645)
4cca272e 646
7c6d759d 647dnl Checks for libutil functions
648AC_CHECK_HEADERS(libutil.h)
649AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
650AC_CHECK_FUNCS(logout updwtmp logwtmp)
651
a738c3b0 652AC_FUNC_STRFTIME
653
84ceda19 654# Check for ALTDIRFUNC glob() extension
655AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
656AC_EGREP_CPP(FOUNDIT,
657 [
658 #include <glob.h>
659 #ifdef GLOB_ALTDIRFUNC
660 FOUNDIT
661 #endif
aff51935 662 ],
84ceda19 663 [
664 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
665 AC_MSG_RESULT(yes)
666 ],
667 [
668 AC_MSG_RESULT(no)
669 ]
670)
4cca272e 671
40849fdb 672# Check for g.gl_matchc glob() extension
673AC_MSG_CHECKING(for gl_matchc field in glob_t)
674AC_EGREP_CPP(FOUNDIT,
aff51935 675 [
676 #include <glob.h>
40849fdb 677 int main(void){glob_t g; g.gl_matchc = 1;}
aff51935 678 ],
679 [
680 AC_DEFINE(GLOB_HAS_GL_MATCHC)
681 AC_MSG_RESULT(yes)
682 ],
683 [
684 AC_MSG_RESULT(no)
685 ]
40849fdb 686)
687
edbe6722 688AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
689AC_TRY_RUN(
690 [
691#include <sys/types.h>
692#include <dirent.h>
aec4cb4f 693int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
edbe6722 694 ],
aff51935 695 [AC_MSG_RESULT(yes)],
edbe6722 696 [
697 AC_MSG_RESULT(no)
698 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
699 ]
700)
701
278588d8 702# Check whether user wants S/Key support
aff51935 703SKEY_MSG="no"
278588d8 704AC_ARG_WITH(skey,
98a7c37b 705 [ --with-skey[[=PATH]] Enable S/Key support
aff51935 706 (optionally in PATH)],
278588d8 707 [
708 if test "x$withval" != "xno" ; then
709
710 if test "x$withval" != "xyes" ; then
711 CPPFLAGS="$CPPFLAGS -I${withval}/include"
712 LDFLAGS="$LDFLAGS -L${withval}/lib"
713 fi
714
715 AC_DEFINE(SKEY)
716 LIBS="-lskey $LIBS"
aff51935 717 SKEY_MSG="yes"
278588d8 718
ddceb1c8 719 AC_MSG_CHECKING([for s/key support])
720 AC_TRY_RUN(
721 [
722#include <stdio.h>
723#include <skey.h>
aec4cb4f 724int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
ddceb1c8 725 ],
726 [AC_MSG_RESULT(yes)],
278588d8 727 [
ddceb1c8 728 AC_MSG_RESULT(no)
278588d8 729 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
730 ])
731 fi
732 ]
733)
734
735# Check whether user wants TCP wrappers support
98a7c37b 736TCPW_MSG="no"
278588d8 737AC_ARG_WITH(tcp-wrappers,
98a7c37b 738 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
aff51935 739 (optionally in PATH)],
278588d8 740 [
741 if test "x$withval" != "xno" ; then
742 saved_LIBS="$LIBS"
98a7c37b 743 saved_LDFLAGS="$LDFLAGS"
744 saved_CPPFLAGS="$CPPFLAGS"
745 if test -n "${withval}" -a "${withval}" != "yes"; then
746 if test -d "${withval}/lib"; then
747 if test -n "${need_dash_r}"; then
5a162955 748 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 749 else
5a162955 750 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 751 fi
752 else
753 if test -n "${need_dash_r}"; then
5a162955 754 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 755 else
5a162955 756 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 757 fi
758 fi
759 if test -d "${withval}/include"; then
5a162955 760 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 761 else
5a162955 762 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 763 fi
98a7c37b 764 fi
ddceb1c8 765 LIBWRAP="-lwrap"
766 LIBS="$LIBWRAP $LIBS"
278588d8 767 AC_MSG_CHECKING(for libwrap)
768 AC_TRY_LINK(
769 [
770#include <tcpd.h>
771 int deny_severity = 0, allow_severity = 0;
772 ],
773 [hosts_access(0);],
774 [
775 AC_MSG_RESULT(yes)
776 AC_DEFINE(LIBWRAP)
ddceb1c8 777 AC_SUBST(LIBWRAP)
98a7c37b 778 TCPW_MSG="yes"
278588d8 779 ],
780 [
781 AC_MSG_ERROR([*** libwrap missing])
782 ]
783 )
ddceb1c8 784 LIBS="$saved_LIBS"
278588d8 785 fi
786 ]
787)
788
19160674 789dnl Checks for library functions. Please keep in alphabetical order
790AC_CHECK_FUNCS(\
48646332 791 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
688eed4a 792 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
1a086f97 793 getaddrinfo getcwd getgrouplist getnameinfo getopt \
309709db 794 getpeereid _getpty getrlimit getttyent glob inet_aton \
19160674 795 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
79d4fc55 796 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
797 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
798 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
3f176010 799 setproctitle setregid setreuid setrlimit \
688eed4a 800 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
7111a85c 801 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
41c64c91 802 truncate updwtmpx utimes vhangup vsnprintf waitpid \
19160674 803)
98a7c37b 804
1a086f97 805# IRIX has a const char return value for gai_strerror()
806AC_CHECK_FUNCS(gai_strerror,[
807 AC_DEFINE(HAVE_GAI_STRERROR)
808 AC_TRY_COMPILE([
809#include <sys/types.h>
810#include <sys/socket.h>
811#include <netdb.h>
812
813const char *gai_strerror(int);],[
814char *str;
815
816str = gai_strerror(0);],[
817 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
818 [Define if gai_strerror() returns const char *])])])
819
92b1decf 820AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
821
309709db 822dnl Make sure prototypes are defined for these before using them.
08412d26 823AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
309709db 824AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
08412d26 825
3490699c 826dnl tcsendbreak might be a macro
827AC_CHECK_DECL(tcsendbreak,
828 [AC_DEFINE(HAVE_TCSENDBREAK)],
aff51935 829 [AC_CHECK_FUNCS(tcsendbreak)],
3490699c 830 [#include <termios.h>]
831)
832
3f176010 833AC_CHECK_FUNCS(setresuid, [
834 dnl Some platorms have setresuid that isn't implemented, test for this
835 AC_MSG_CHECKING(if setresuid seems to work)
836 AC_TRY_RUN([
9a3fe0e2 837#include <stdlib.h>
838#include <errno.h>
839int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
3f176010 840 ],
841 [AC_MSG_RESULT(yes)],
24a9171d 842 [AC_DEFINE(BROKEN_SETRESUID)
3f176010 843 AC_MSG_RESULT(not implemented)]
844 )
845])
9a3fe0e2 846
3f176010 847AC_CHECK_FUNCS(setresgid, [
848 dnl Some platorms have setresgid that isn't implemented, test for this
849 AC_MSG_CHECKING(if setresgid seems to work)
850 AC_TRY_RUN([
9a3fe0e2 851#include <stdlib.h>
852#include <errno.h>
853int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
3f176010 854 ],
855 [AC_MSG_RESULT(yes)],
856 [AC_DEFINE(BROKEN_SETRESGID)
857 AC_MSG_RESULT(not implemented)]
858 )
859])
9a3fe0e2 860
2e73a022 861dnl Checks for time functions
1d7b9b20 862AC_CHECK_FUNCS(gettimeofday time)
2e73a022 863dnl Checks for utmp functions
b03bd394 864AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1d7b9b20 865AC_CHECK_FUNCS(utmpname)
2e73a022 866dnl Checks for utmpx functions
b03bd394 867AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1d7b9b20 868AC_CHECK_FUNCS(setutxent utmpxname)
76cd7316 869
aff51935 870AC_CHECK_FUNC(daemon,
beb43d31 871 [AC_DEFINE(HAVE_DAEMON)],
872 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
873)
874
aff51935 875AC_CHECK_FUNC(getpagesize,
aa6bd60a 876 [AC_DEFINE(HAVE_GETPAGESIZE)],
877 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
878)
879
2647ae26 880# Check for broken snprintf
881if test "x$ac_cv_func_snprintf" = "xyes" ; then
882 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
883 AC_TRY_RUN(
884 [
885#include <stdio.h>
aec4cb4f 886int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
2647ae26 887 ],
aff51935 888 [AC_MSG_RESULT(yes)],
2647ae26 889 [
890 AC_MSG_RESULT(no)
891 AC_DEFINE(BROKEN_SNPRINTF)
892 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
893 ]
894 )
895fi
896
70e7d0b0 897dnl see whether mkstemp() requires XXXXXX
898if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
899AC_MSG_CHECKING([for (overly) strict mkstemp])
900AC_TRY_RUN(
901 [
902#include <stdlib.h>
903main() { char template[]="conftest.mkstemp-test";
904if (mkstemp(template) == -1)
905 exit(1);
906unlink(template); exit(0);
907}
908 ],
909 [
910 AC_MSG_RESULT(no)
911 ],
aff51935 912 [
70e7d0b0 913 AC_MSG_RESULT(yes)
914 AC_DEFINE(HAVE_STRICT_MKSTEMP)
915 ],
916 [
917 AC_MSG_RESULT(yes)
918 AC_DEFINE(HAVE_STRICT_MKSTEMP)
aff51935 919 ]
70e7d0b0 920)
921fi
922
eacb954e 923dnl make sure that openpty does not reacquire controlling terminal
924if test ! -z "$check_for_openpty_ctty_bug"; then
925 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
926 AC_TRY_RUN(
927 [
928#include <stdio.h>
929#include <sys/fcntl.h>
930#include <sys/types.h>
931#include <sys/wait.h>
932
933int
934main()
935{
936 pid_t pid;
937 int fd, ptyfd, ttyfd, status;
938
939 pid = fork();
940 if (pid < 0) { /* failed */
941 exit(1);
942 } else if (pid > 0) { /* parent */
943 waitpid(pid, &status, 0);
aff51935 944 if (WIFEXITED(status))
eacb954e 945 exit(WEXITSTATUS(status));
946 else
947 exit(2);
948 } else { /* child */
949 close(0); close(1); close(2);
950 setsid();
951 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
952 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
953 if (fd >= 0)
954 exit(3); /* Acquired ctty: broken */
955 else
956 exit(0); /* Did not acquire ctty: OK */
957 }
958}
959 ],
960 [
961 AC_MSG_RESULT(yes)
962 ],
963 [
964 AC_MSG_RESULT(no)
965 AC_DEFINE(SSHD_ACQUIRES_CTTY)
966 ]
967 )
968fi
969
7f8f5e00 970AC_FUNC_GETPGRP
971
717057b6 972# Check for PAM libs
cbd7492e 973PAM_MSG="no"
a0391976 974AC_ARG_WITH(pam,
717057b6 975 [ --with-pam Enable PAM support ],
a0391976 976 [
717057b6 977 if test "x$withval" != "xno" ; then
2511d104 978 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
979 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
717057b6 980 AC_MSG_ERROR([PAM headers not found])
981 fi
a0391976 982
717057b6 983 AC_CHECK_LIB(dl, dlopen, , )
984 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
985 AC_CHECK_FUNCS(pam_getenvlist)
749560dd 986 AC_CHECK_FUNCS(pam_putenv)
2b763e31 987
717057b6 988 PAM_MSG="yes"
4cb5ffa0 989
717057b6 990 AC_DEFINE(USE_PAM)
98f2d9d5 991 if test $ac_cv_lib_dl_dlopen = yes; then
992 LIBPAM="-lpam -ldl"
993 else
994 LIBPAM="-lpam"
995 fi
996 AC_SUBST(LIBPAM)
717057b6 997 fi
998 ]
999)
cbd7492e 1000
717057b6 1001# Check for older PAM
1002if test "x$PAM_MSG" = "xyes" ; then
a0391976 1003 # Check PAM strerror arguments (old PAM)
1004 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1005 AC_TRY_COMPILE(
1006 [
18ba2aab 1007#include <stdlib.h>
2511d104 1008#if defined(HAVE_SECURITY_PAM_APPL_H)
18ba2aab 1009#include <security/pam_appl.h>
2511d104 1010#elif defined (HAVE_PAM_PAM_APPL_H)
1011#include <pam/pam_appl.h>
1012#endif
aff51935 1013 ],
1014 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
a0391976 1015 [AC_MSG_RESULT(no)],
1016 [
1017 AC_DEFINE(HAVE_OLD_PAM)
1018 AC_MSG_RESULT(yes)
cbd7492e 1019 PAM_MSG="yes (old library)"
a0391976 1020 ]
717057b6 1021 )
a0391976 1022fi
1023
5b991353 1024# Search for OpenSSL
1025saved_CPPFLAGS="$CPPFLAGS"
1026saved_LDFLAGS="$LDFLAGS"
a0391976 1027AC_ARG_WITH(ssl-dir,
1028 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1029 [
e9e4a1c7 1030 if test "x$withval" != "xno" ; then
5b991353 1031 if test -d "$withval/lib"; then
1032 if test -n "${need_dash_r}"; then
1033 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1034 else
1035 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
d6f13fbb 1036 fi
1037 else
5b991353 1038 if test -n "${need_dash_r}"; then
1039 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1040 else
1041 LDFLAGS="-L${withval} ${LDFLAGS}"
d6f13fbb 1042 fi
1043 fi
5b991353 1044 if test -d "$withval/include"; then
1045 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
d6f13fbb 1046 else
5b991353 1047 CPPFLAGS="-I${withval} ${CPPFLAGS}"
58d100bf 1048 fi
a0391976 1049 fi
5b991353 1050 ]
1051)
5486a457 1052LIBS="-lcrypto $LIBS"
5b991353 1053AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
d45e3d76 1054 [
5b991353 1055 dnl Check default openssl install dir
1056 if test -n "${need_dash_r}"; then
1057 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1058 else
5b991353 1059 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1060 fi
5b991353 1061 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1062 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1063 [
1064 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1065 ]
1066 )
1067 ]
1068)
1069
cd018561 1070# Determine OpenSSL header version
1071AC_MSG_CHECKING([OpenSSL header version])
1072AC_TRY_RUN(
1073 [
1074#include <stdio.h>
1075#include <string.h>
1076#include <openssl/opensslv.h>
1077#define DATA "conftest.sslincver"
1078int main(void) {
aff51935 1079 FILE *fd;
1080 int rc;
cd018561 1081
aff51935 1082 fd = fopen(DATA,"w");
1083 if(fd == NULL)
1084 exit(1);
cd018561 1085
1086 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1087 exit(1);
1088
1089 exit(0);
1090}
1091 ],
1092 [
1093 ssl_header_ver=`cat conftest.sslincver`
1094 AC_MSG_RESULT($ssl_header_ver)
1095 ],
1096 [
1097 AC_MSG_RESULT(not found)
1098 AC_MSG_ERROR(OpenSSL version header not found.)
1099 ]
1100)
1101
1102# Determine OpenSSL library version
1103AC_MSG_CHECKING([OpenSSL library version])
1104AC_TRY_RUN(
1105 [
1106#include <stdio.h>
1107#include <string.h>
1108#include <openssl/opensslv.h>
1109#include <openssl/crypto.h>
1110#define DATA "conftest.ssllibver"
1111int main(void) {
aff51935 1112 FILE *fd;
1113 int rc;
cd018561 1114
aff51935 1115 fd = fopen(DATA,"w");
1116 if(fd == NULL)
1117 exit(1);
cd018561 1118
1119 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1120 exit(1);
1121
1122 exit(0);
1123}
1124 ],
1125 [
1126 ssl_library_ver=`cat conftest.ssllibver`
1127 AC_MSG_RESULT($ssl_library_ver)
1128 ],
1129 [
1130 AC_MSG_RESULT(not found)
1131 AC_MSG_ERROR(OpenSSL library not found.)
1132 ]
1133)
58d100bf 1134
9780116c 1135# Sanity check OpenSSL headers
1136AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1137AC_TRY_RUN(
1138 [
1139#include <string.h>
1140#include <openssl/opensslv.h>
aec4cb4f 1141int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
9780116c 1142 ],
1143 [
1144 AC_MSG_RESULT(yes)
1145 ],
1146 [
1147 AC_MSG_RESULT(no)
e15ba28b 1148 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1149Check config.log for details.
1150Also see contrib/findssl.sh for help identifying header/library mismatches.])
9780116c 1151 ]
1152)
1153
5486a457 1154# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1155# because the system crypt() is more featureful.
1156if test "x$check_for_libcrypt_before" = "x1"; then
1157 AC_CHECK_LIB(crypt, crypt)
1158fi
1159
aff51935 1160# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
8087c5ee 1161# version in OpenSSL.
05114c74 1162if test "x$check_for_libcrypt_later" = "x1"; then
20cad736 1163 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 1164fi
1165
f1b0ecc3 1166
1167### Configure cryptographic random number support
1168
1169# Check wheter OpenSSL seeds itself
1170AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1171AC_TRY_RUN(
1172 [
1173#include <string.h>
1174#include <openssl/rand.h>
aec4cb4f 1175int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
f1b0ecc3 1176 ],
1177 [
1178 OPENSSL_SEEDS_ITSELF=yes
1179 AC_MSG_RESULT(yes)
1180 ],
1181 [
1182 AC_MSG_RESULT(no)
1183 # Default to use of the rand helper if OpenSSL doesn't
1184 # seed itself
1185 USE_RAND_HELPER=yes
1186 ]
1187)
1188
1189
1190# Do we want to force the use of the rand helper?
1191AC_ARG_WITH(rand-helper,
1192 [ --with-rand-helper Use subprocess to gather strong randomness ],
1193 [
1194 if test "x$withval" = "xno" ; then
aff51935 1195 # Force use of OpenSSL's internal RNG, even if
f1b0ecc3 1196 # the previous test showed it to be unseeded.
1197 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1198 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1199 OPENSSL_SEEDS_ITSELF=yes
1200 USE_RAND_HELPER=""
1201 fi
1202 else
1203 USE_RAND_HELPER=yes
1204 fi
1205 ],
1206)
1207
1208# Which randomness source do we use?
1209if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1210 # OpenSSL only
1211 AC_DEFINE(OPENSSL_PRNG_ONLY)
1212 RAND_MSG="OpenSSL internal ONLY"
1213 INSTALL_SSH_RAND_HELPER=""
70e2f2f3 1214elif test ! -z "$USE_RAND_HELPER" ; then
1215 # install rand helper
f1b0ecc3 1216 RAND_MSG="ssh-rand-helper"
1217 INSTALL_SSH_RAND_HELPER="yes"
1218fi
1219AC_SUBST(INSTALL_SSH_RAND_HELPER)
1220
1221### Configuration of ssh-rand-helper
1222
1223# PRNGD TCP socket
1224AC_ARG_WITH(prngd-port,
1225 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1226 [
eb5d7ff6 1227 case "$withval" in
1228 no)
1229 withval=""
1230 ;;
1231 [[0-9]]*)
1232 ;;
1233 *)
1234 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1235 ;;
1236 esac
1237 if test ! -z "$withval" ; then
f1b0ecc3 1238 PRNGD_PORT="$withval"
1239 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1240 fi
1241 ]
1242)
1243
1244# PRNGD Unix domain socket
1245AC_ARG_WITH(prngd-socket,
1246 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1247 [
eb5d7ff6 1248 case "$withval" in
1249 yes)
f1b0ecc3 1250 withval="/var/run/egd-pool"
eb5d7ff6 1251 ;;
1252 no)
1253 withval=""
1254 ;;
1255 /*)
1256 ;;
1257 *)
1258 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1259 ;;
1260 esac
1261
1262 if test ! -z "$withval" ; then
f1b0ecc3 1263 if test ! -z "$PRNGD_PORT" ; then
1264 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1265 fi
906e811b 1266 if test ! -r "$withval" ; then
f1b0ecc3 1267 AC_MSG_WARN(Entropy socket is not readable)
1268 fi
1269 PRNGD_SOCKET="$withval"
1270 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1271 fi
ddceb1c8 1272 ],
1273 [
1274 # Check for existing socket only if we don't have a random device already
1275 if test "$USE_RAND_HELPER" = yes ; then
1276 AC_MSG_CHECKING(for PRNGD/EGD socket)
1277 # Insert other locations here
1278 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1279 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1280 PRNGD_SOCKET="$sock"
1281 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1282 break;
1283 fi
1284 done
1285 if test ! -z "$PRNGD_SOCKET" ; then
1286 AC_MSG_RESULT($PRNGD_SOCKET)
1287 else
1288 AC_MSG_RESULT(not found)
1289 fi
1290 fi
f1b0ecc3 1291 ]
1292)
1293
1294# Change default command timeout for hashing entropy source
1295entropy_timeout=200
1296AC_ARG_WITH(entropy-timeout,
1297 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1298 [
1299 if test "x$withval" != "xno" ; then
1300 entropy_timeout=$withval
1301 fi
1302 ]
1303)
f1b0ecc3 1304AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1305
fd3cbf67 1306SSH_PRIVSEP_USER=sshd
9a0fbcb3 1307AC_ARG_WITH(privsep-user,
5222e7ef 1308 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
9a0fbcb3 1309 [
1310 if test -n "$withval"; then
fd3cbf67 1311 SSH_PRIVSEP_USER=$withval
9a0fbcb3 1312 fi
1313 ]
1314)
fd3cbf67 1315AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1316AC_SUBST(SSH_PRIVSEP_USER)
9a0fbcb3 1317
81dadca3 1318# We do this little dance with the search path to insure
1319# that programs that we select for use by installed programs
1320# (which may be run by the super-user) come from trusted
1321# locations before they come from the user's private area.
1322# This should help avoid accidentally configuring some
1323# random version of a program in someone's personal bin.
1324
1325OPATH=$PATH
1326PATH=/bin:/usr/bin
f95c8ce8 1327test -h /bin 2> /dev/null && PATH=/usr/bin
81dadca3 1328test -d /sbin && PATH=$PATH:/sbin
1329test -d /usr/sbin && PATH=$PATH:/usr/sbin
1330PATH=$PATH:/etc:$OPATH
1331
aff51935 1332# These programs are used by the command hashing source to gather entropy
f1b0ecc3 1333OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1334OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1335OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1336OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1337OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1338OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1339OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1340OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1341OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1342OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1343OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1344OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1345OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1346OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1347OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1348OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
81dadca3 1349# restore PATH
1350PATH=$OPATH
f1b0ecc3 1351
1352# Where does ssh-rand-helper get its randomness from?
1353INSTALL_SSH_PRNG_CMDS=""
1354if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1355 if test ! -z "$PRNGD_PORT" ; then
1356 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1357 elif test ! -z "$PRNGD_SOCKET" ; then
1358 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1359 else
1360 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1361 RAND_HELPER_CMDHASH=yes
1362 INSTALL_SSH_PRNG_CMDS="yes"
1363 fi
1364fi
1365AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1366
1367
66d6c27e 1368# Cheap hack to ensure NEWS-OS libraries are arranged right.
1369if test ! -z "$SONY" ; then
1370 LIBS="$LIBS -liberty";
1371fi
1372
a0391976 1373# Checks for data types
976f7e19 1374AC_CHECK_SIZEOF(char, 1)
2b942fe0 1375AC_CHECK_SIZEOF(short int, 2)
1376AC_CHECK_SIZEOF(int, 4)
1377AC_CHECK_SIZEOF(long int, 4)
1378AC_CHECK_SIZEOF(long long int, 8)
1379
52f1ccb2 1380# Sanity check long long for some platforms (AIX)
1381if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1382 ac_cv_sizeof_long_long_int=0
1383fi
1384
a0391976 1385# More checks for data types
14a9a859 1386AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1387 AC_TRY_COMPILE(
aff51935 1388 [ #include <sys/types.h> ],
1389 [ u_int a; a = 1;],
14a9a859 1390 [ ac_cv_have_u_int="yes" ],
1391 [ ac_cv_have_u_int="no" ]
1392 )
1393])
1394if test "x$ac_cv_have_u_int" = "xyes" ; then
1395 AC_DEFINE(HAVE_U_INT)
1396 have_u_int=1
1397fi
1398
58d100bf 1399AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1400 AC_TRY_COMPILE(
aff51935 1401 [ #include <sys/types.h> ],
1402 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
58d100bf 1403 [ ac_cv_have_intxx_t="yes" ],
1404 [ ac_cv_have_intxx_t="no" ]
1405 )
1406])
1407if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1408 AC_DEFINE(HAVE_INTXX_T)
1409 have_intxx_t=1
1410fi
41cb4569 1411
1412if (test -z "$have_intxx_t" && \
aff51935 1413 test "x$ac_cv_header_stdint_h" = "xyes")
41cb4569 1414then
1415 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1416 AC_TRY_COMPILE(
aff51935 1417 [ #include <stdint.h> ],
1418 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
41cb4569 1419 [
1420 AC_DEFINE(HAVE_INTXX_T)
1421 AC_MSG_RESULT(yes)
1422 ],
1423 [ AC_MSG_RESULT(no) ]
1424 )
1425fi
1426
bd590612 1427AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1428 AC_TRY_COMPILE(
1cbbe6c8 1429 [
1430#include <sys/types.h>
1431#ifdef HAVE_STDINT_H
1432# include <stdint.h>
1433#endif
1434#include <sys/socket.h>
1435#ifdef HAVE_SYS_BITYPES_H
1436# include <sys/bitypes.h>
1437#endif
aff51935 1438 ],
1439 [ int64_t a; a = 1;],
bd590612 1440 [ ac_cv_have_int64_t="yes" ],
1441 [ ac_cv_have_int64_t="no" ]
1442 )
1443])
1444if test "x$ac_cv_have_int64_t" = "xyes" ; then
1445 AC_DEFINE(HAVE_INT64_T)
ddceb1c8 1446fi
1447
58d100bf 1448AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1449 AC_TRY_COMPILE(
aff51935 1450 [ #include <sys/types.h> ],
1451 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
58d100bf 1452 [ ac_cv_have_u_intxx_t="yes" ],
1453 [ ac_cv_have_u_intxx_t="no" ]
1454 )
1455])
1456if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1457 AC_DEFINE(HAVE_U_INTXX_T)
1458 have_u_intxx_t=1
1459fi
2b942fe0 1460
41cb4569 1461if test -z "$have_u_intxx_t" ; then
1462 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1463 AC_TRY_COMPILE(
aff51935 1464 [ #include <sys/socket.h> ],
1465 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
41cb4569 1466 [
1467 AC_DEFINE(HAVE_U_INTXX_T)
1468 AC_MSG_RESULT(yes)
1469 ],
1470 [ AC_MSG_RESULT(no) ]
1471 )
1472fi
1473
bd590612 1474AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1475 AC_TRY_COMPILE(
aff51935 1476 [ #include <sys/types.h> ],
1477 [ u_int64_t a; a = 1;],
bd590612 1478 [ ac_cv_have_u_int64_t="yes" ],
1479 [ ac_cv_have_u_int64_t="no" ]
1480 )
1481])
1482if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1483 AC_DEFINE(HAVE_U_INT64_T)
1484 have_u_int64_t=1
1485fi
1486
ddceb1c8 1487if test -z "$have_u_int64_t" ; then
1488 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1489 AC_TRY_COMPILE(
aff51935 1490 [ #include <sys/bitypes.h> ],
ddceb1c8 1491 [ u_int64_t a; a = 1],
1492 [
1493 AC_DEFINE(HAVE_U_INT64_T)
1494 AC_MSG_RESULT(yes)
1495 ],
1496 [ AC_MSG_RESULT(no) ]
1497 )
1498fi
1499
41cb4569 1500if test -z "$have_u_intxx_t" ; then
1501 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1502 AC_TRY_COMPILE(
1503 [
1504#include <sys/types.h>
aff51935 1505 ],
1506 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
41cb4569 1507 [ ac_cv_have_uintxx_t="yes" ],
1508 [ ac_cv_have_uintxx_t="no" ]
1509 )
1510 ])
1511 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1512 AC_DEFINE(HAVE_UINTXX_T)
1513 fi
1514fi
1515
1516if test -z "$have_uintxx_t" ; then
1517 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1518 AC_TRY_COMPILE(
aff51935 1519 [ #include <stdint.h> ],
1520 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
41cb4569 1521 [
1522 AC_DEFINE(HAVE_UINTXX_T)
1523 AC_MSG_RESULT(yes)
1524 ],
1525 [ AC_MSG_RESULT(no) ]
1526 )
1527fi
1528
e5fe9a1f 1529if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
aff51935 1530 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 1531then
1532 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1533 AC_TRY_COMPILE(
58d100bf 1534 [
1535#include <sys/bitypes.h>
aff51935 1536 ],
5cdfe03f 1537 [
837c30b8 1538 int8_t a; int16_t b; int32_t c;
1539 u_int8_t e; u_int16_t f; u_int32_t g;
1540 a = b = c = e = f = g = 1;
aff51935 1541 ],
5cdfe03f 1542 [
1543 AC_DEFINE(HAVE_U_INTXX_T)
1544 AC_DEFINE(HAVE_INTXX_T)
1545 AC_MSG_RESULT(yes)
1546 ],
1547 [AC_MSG_RESULT(no)]
aff51935 1548 )
5cdfe03f 1549fi
1550
0362750e 1551
1552AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1553 AC_TRY_COMPILE(
1554 [
1555#include <sys/types.h>
1556 ],
1557 [ u_char foo; foo = 125; ],
1558 [ ac_cv_have_u_char="yes" ],
1559 [ ac_cv_have_u_char="no" ]
1560 )
1561])
1562if test "x$ac_cv_have_u_char" = "xyes" ; then
1563 AC_DEFINE(HAVE_U_CHAR)
1564fi
1565
98a7c37b 1566TYPE_SOCKLEN_T
2b942fe0 1567
2d16d9a3 1568AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
ddceb1c8 1569
58d100bf 1570AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1571 AC_TRY_COMPILE(
1572 [
18ba2aab 1573#include <sys/types.h>
58d100bf 1574 ],
1575 [ size_t foo; foo = 1235; ],
1576 [ ac_cv_have_size_t="yes" ],
1577 [ ac_cv_have_size_t="no" ]
1578 )
1579])
1580if test "x$ac_cv_have_size_t" = "xyes" ; then
1581 AC_DEFINE(HAVE_SIZE_T)
1582fi
ea1970a3 1583
c04f75f1 1584AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1585 AC_TRY_COMPILE(
1586 [
1587#include <sys/types.h>
1588 ],
1589 [ ssize_t foo; foo = 1235; ],
1590 [ ac_cv_have_ssize_t="yes" ],
1591 [ ac_cv_have_ssize_t="no" ]
1592 )
1593])
1594if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1595 AC_DEFINE(HAVE_SSIZE_T)
1596fi
1597
f1c4659d 1598AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1599 AC_TRY_COMPILE(
1600 [
1601#include <time.h>
1602 ],
1603 [ clock_t foo; foo = 1235; ],
1604 [ ac_cv_have_clock_t="yes" ],
1605 [ ac_cv_have_clock_t="no" ]
1606 )
1607])
1608if test "x$ac_cv_have_clock_t" = "xyes" ; then
1609 AC_DEFINE(HAVE_CLOCK_T)
1610fi
1611
1c04b088 1612AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1613 AC_TRY_COMPILE(
1614 [
1615#include <sys/types.h>
1616#include <sys/socket.h>
1617 ],
1618 [ sa_family_t foo; foo = 1235; ],
1619 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 1620 [ AC_TRY_COMPILE(
1621 [
1622#include <sys/types.h>
1623#include <sys/socket.h>
1624#include <netinet/in.h>
1625 ],
1626 [ sa_family_t foo; foo = 1235; ],
1627 [ ac_cv_have_sa_family_t="yes" ],
1628
1c04b088 1629 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 1630 )]
1c04b088 1631 )
1632])
1633if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1634 AC_DEFINE(HAVE_SA_FAMILY_T)
1635fi
1636
729bfe59 1637AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1638 AC_TRY_COMPILE(
1639 [
1640#include <sys/types.h>
1641 ],
1642 [ pid_t foo; foo = 1235; ],
1643 [ ac_cv_have_pid_t="yes" ],
1644 [ ac_cv_have_pid_t="no" ]
1645 )
1646])
1647if test "x$ac_cv_have_pid_t" = "xyes" ; then
1648 AC_DEFINE(HAVE_PID_T)
1649fi
1650
1651AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1652 AC_TRY_COMPILE(
1653 [
1654#include <sys/types.h>
1655 ],
1656 [ mode_t foo; foo = 1235; ],
1657 [ ac_cv_have_mode_t="yes" ],
1658 [ ac_cv_have_mode_t="no" ]
1659 )
1660])
1661if test "x$ac_cv_have_mode_t" = "xyes" ; then
1662 AC_DEFINE(HAVE_MODE_T)
1663fi
1664
e3a93db0 1665
58d100bf 1666AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1667 AC_TRY_COMPILE(
1668 [
18ba2aab 1669#include <sys/types.h>
1670#include <sys/socket.h>
58d100bf 1671 ],
1672 [ struct sockaddr_storage s; ],
1673 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1674 [ ac_cv_have_struct_sockaddr_storage="no" ]
1675 )
1676])
1677if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1678 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1679fi
48e671d5 1680
58d100bf 1681AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1682 AC_TRY_COMPILE(
1683 [
cbd7492e 1684#include <sys/types.h>
58d100bf 1685#include <netinet/in.h>
1686 ],
1687 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1688 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1689 [ ac_cv_have_struct_sockaddr_in6="no" ]
1690 )
1691])
1692if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1693 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1694fi
48e671d5 1695
58d100bf 1696AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1697 AC_TRY_COMPILE(
1698 [
cbd7492e 1699#include <sys/types.h>
58d100bf 1700#include <netinet/in.h>
1701 ],
1702 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1703 [ ac_cv_have_struct_in6_addr="yes" ],
1704 [ ac_cv_have_struct_in6_addr="no" ]
1705 )
1706])
1707if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1708 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1709fi
48e671d5 1710
58d100bf 1711AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1712 AC_TRY_COMPILE(
1713 [
18ba2aab 1714#include <sys/types.h>
1715#include <sys/socket.h>
1716#include <netdb.h>
58d100bf 1717 ],
1718 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1719 [ ac_cv_have_struct_addrinfo="yes" ],
1720 [ ac_cv_have_struct_addrinfo="no" ]
1721 )
1722])
1723if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1724 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1725fi
1726
89c7e31c 1727AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1728 AC_TRY_COMPILE(
aff51935 1729 [ #include <sys/time.h> ],
1730 [ struct timeval tv; tv.tv_sec = 1;],
89c7e31c 1731 [ ac_cv_have_struct_timeval="yes" ],
1732 [ ac_cv_have_struct_timeval="no" ]
1733 )
1734])
1735if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1736 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1737 have_struct_timeval=1
1738fi
1739
5271b55c 1740AC_CHECK_TYPES(struct timespec)
1741
85abc74b 1742# We need int64_t or else certian parts of the compile will fail.
2c523de9 1743if test "x$ac_cv_have_int64_t" = "xno" -a \
1744 "x$ac_cv_sizeof_long_int" != "x8" -a \
1745 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
85abc74b 1746 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1747 echo "an alternative compiler (I.E., GCC) before continuing."
1748 echo ""
1749 exit 1;
733cf7f4 1750else
1751dnl test snprintf (broken on SCO w/gcc)
1752 AC_TRY_RUN(
1753 [
1754#include <stdio.h>
1755#include <string.h>
1756#ifdef HAVE_SNPRINTF
1757main()
1758{
1759 char buf[50];
1760 char expected_out[50];
1761 int mazsize = 50 ;
1762#if (SIZEOF_LONG_INT == 8)
1763 long int num = 0x7fffffffffffffff;
1764#else
763a1a18 1765 long long num = 0x7fffffffffffffffll;
733cf7f4 1766#endif
1767 strcpy(expected_out, "9223372036854775807");
1768 snprintf(buf, mazsize, "%lld", num);
1769 if(strcmp(buf, expected_out) != 0)
aff51935 1770 exit(1);
733cf7f4 1771 exit(0);
1772}
1773#else
1774main() { exit(0); }
1775#endif
1776 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1777 )
2c523de9 1778fi
1779
77bb0bca 1780dnl Checks for structure members
58d100bf 1781OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1782OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1783OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1784OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1785OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 1786OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 1787OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1788OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 1789OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 1790OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1791OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1792OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1793OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 1794OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1795OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1796OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1797OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 1798
1799AC_CHECK_MEMBERS([struct stat.st_blksize])
1d7b9b20 1800
58d100bf 1801AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1802 ac_cv_have_ss_family_in_struct_ss, [
1803 AC_TRY_COMPILE(
1804 [
18ba2aab 1805#include <sys/types.h>
1806#include <sys/socket.h>
58d100bf 1807 ],
1808 [ struct sockaddr_storage s; s.ss_family = 1; ],
1809 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1810 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1811 )
1812])
1813if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1814 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1815fi
1816
58d100bf 1817AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1818 ac_cv_have___ss_family_in_struct_ss, [
1819 AC_TRY_COMPILE(
1820 [
18ba2aab 1821#include <sys/types.h>
1822#include <sys/socket.h>
58d100bf 1823 ],
1824 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1825 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1826 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1827 )
1828])
1829if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1830 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1831fi
1832
2e73a022 1833AC_CACHE_CHECK([for pw_class field in struct passwd],
1834 ac_cv_have_pw_class_in_struct_passwd, [
1835 AC_TRY_COMPILE(
1836 [
2e73a022 1837#include <pwd.h>
1838 ],
97994d32 1839 [ struct passwd p; p.pw_class = 0; ],
2e73a022 1840 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1841 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1842 )
1843])
1844if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1845 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1846fi
1847
7751d4eb 1848AC_CACHE_CHECK([for pw_expire field in struct passwd],
1849 ac_cv_have_pw_expire_in_struct_passwd, [
1850 AC_TRY_COMPILE(
1851 [
1852#include <pwd.h>
1853 ],
1854 [ struct passwd p; p.pw_expire = 0; ],
1855 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1856 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1857 )
1858])
1859if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1860 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1861fi
1862
1863AC_CACHE_CHECK([for pw_change field in struct passwd],
1864 ac_cv_have_pw_change_in_struct_passwd, [
1865 AC_TRY_COMPILE(
1866 [
1867#include <pwd.h>
1868 ],
1869 [ struct passwd p; p.pw_change = 0; ],
1870 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1871 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1872 )
1873])
1874if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1875 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1876fi
58d100bf 1877
637f9177 1878dnl make sure we're using the real structure members and not defines
6f34652e 1879AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1880 ac_cv_have_accrights_in_msghdr, [
637f9177 1881 AC_TRY_RUN(
6f34652e 1882 [
f95c8ce8 1883#include <sys/types.h>
6f34652e 1884#include <sys/socket.h>
1885#include <sys/uio.h>
637f9177 1886int main() {
1887#ifdef msg_accrights
1888exit(1);
1889#endif
1890struct msghdr m;
1891m.msg_accrights = 0;
1892exit(0);
1893}
6f34652e 1894 ],
6f34652e 1895 [ ac_cv_have_accrights_in_msghdr="yes" ],
1896 [ ac_cv_have_accrights_in_msghdr="no" ]
1897 )
1898])
1899if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1900 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1901fi
1902
7176df4f 1903AC_CACHE_CHECK([for msg_control field in struct msghdr],
1904 ac_cv_have_control_in_msghdr, [
637f9177 1905 AC_TRY_RUN(
7176df4f 1906 [
f95c8ce8 1907#include <sys/types.h>
7176df4f 1908#include <sys/socket.h>
1909#include <sys/uio.h>
637f9177 1910int main() {
1911#ifdef msg_control
1912exit(1);
1913#endif
1914struct msghdr m;
1915m.msg_control = 0;
1916exit(0);
1917}
7176df4f 1918 ],
7176df4f 1919 [ ac_cv_have_control_in_msghdr="yes" ],
1920 [ ac_cv_have_control_in_msghdr="no" ]
1921 )
1922])
1923if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1924 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1925fi
1926
58d100bf 1927AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
aff51935 1928 AC_TRY_LINK([],
1929 [ extern char *__progname; printf("%s", __progname); ],
58d100bf 1930 [ ac_cv_libc_defines___progname="yes" ],
1931 [ ac_cv_libc_defines___progname="no" ]
1932 )
1933])
1934if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1935 AC_DEFINE(HAVE___PROGNAME)
1936fi
8946db53 1937
c921ee00 1938AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1939 AC_TRY_LINK([
1940#include <stdio.h>
aff51935 1941],
1942 [ printf("%s", __FUNCTION__); ],
c921ee00 1943 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1944 [ ac_cv_cc_implements___FUNCTION__="no" ]
1945 )
1946])
1947if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1948 AC_DEFINE(HAVE___FUNCTION__)
1949fi
1950
1951AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1952 AC_TRY_LINK([
1953#include <stdio.h>
aff51935 1954],
1955 [ printf("%s", __func__); ],
c921ee00 1956 [ ac_cv_cc_implements___func__="yes" ],
1957 [ ac_cv_cc_implements___func__="no" ]
1958 )
1959])
1960if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1961 AC_DEFINE(HAVE___func__)
1962fi
1963
1812a662 1964AC_CACHE_CHECK([whether getopt has optreset support],
1965 ac_cv_have_getopt_optreset, [
1966 AC_TRY_LINK(
1967 [
1968#include <getopt.h>
1969 ],
1970 [ extern int optreset; optreset = 0; ],
1971 [ ac_cv_have_getopt_optreset="yes" ],
1972 [ ac_cv_have_getopt_optreset="no" ]
1973 )
1974])
1975if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1976 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1977fi
a0391976 1978
819b676f 1979AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
aff51935 1980 AC_TRY_LINK([],
1981 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
819b676f 1982 [ ac_cv_libc_defines_sys_errlist="yes" ],
1983 [ ac_cv_libc_defines_sys_errlist="no" ]
1984 )
1985])
1986if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1987 AC_DEFINE(HAVE_SYS_ERRLIST)
1988fi
1989
1990
416ed5a7 1991AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
aff51935 1992 AC_TRY_LINK([],
1993 [ extern int sys_nerr; printf("%i", sys_nerr);],
416ed5a7 1994 [ ac_cv_libc_defines_sys_nerr="yes" ],
1995 [ ac_cv_libc_defines_sys_nerr="no" ]
1996 )
1997])
1998if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1999 AC_DEFINE(HAVE_SYS_NERR)
2000fi
2001
aff51935 2002SCARD_MSG="no"
295c8801 2003# Check whether user wants sectok support
2004AC_ARG_WITH(sectok,
2005 [ --with-sectok Enable smartcard support using libsectok],
d0b19c95 2006 [
2007 if test "x$withval" != "xno" ; then
2008 if test "x$withval" != "xyes" ; then
2009 CPPFLAGS="$CPPFLAGS -I${withval}"
2010 LDFLAGS="$LDFLAGS -L${withval}"
2011 if test ! -z "$need_dash_r" ; then
2012 LDFLAGS="$LDFLAGS -R${withval}"
2013 fi
2014 if test ! -z "$blibpath" ; then
2015 blibpath="$blibpath:${withval}"
2016 fi
2017 fi
2018 AC_CHECK_HEADERS(sectok.h)
2019 if test "$ac_cv_header_sectok_h" != yes; then
2020 AC_MSG_ERROR(Can't find sectok.h)
2021 fi
2022 AC_CHECK_LIB(sectok, sectok_open)
2023 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2024 AC_MSG_ERROR(Can't find libsectok)
2025 fi
2026 AC_DEFINE(SMARTCARD)
295c8801 2027 AC_DEFINE(USE_SECTOK)
aff51935 2028 SCARD_MSG="yes, using sectok"
295c8801 2029 fi
2030 ]
2031)
2032
2033# Check whether user wants OpenSC support
2034AC_ARG_WITH(opensc,
49ef62db 2035 AC_HELP_STRING([--with-opensc=PFX],
2036 [Enable smartcard support using OpenSC]),
2037 opensc_config_prefix="$withval", opensc_config_prefix="")
2038if test x$opensc_config_prefix != x ; then
2039 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2040 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2041 if test "$OPENSC_CONFIG" != "no"; then
2042 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2043 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2044 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2045 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2046 AC_DEFINE(SMARTCARD)
2047 AC_DEFINE(USE_OPENSC)
aff51935 2048 SCARD_MSG="yes, using OpenSC"
49ef62db 2049 fi
2050fi
d0b19c95 2051
c31dc31c 2052# Check libraries needed by DNS fingerprint support
aff51935 2053AC_SEARCH_LIBS(getrrsetbyname, resolv,
c31dc31c 2054 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
3e05e934 2055 [
c31dc31c 2056 # Needed by our getrrsetbyname()
2057 AC_SEARCH_LIBS(res_query, resolv)
2058 AC_SEARCH_LIBS(dn_expand, resolv)
2059 AC_CHECK_FUNCS(_getshort _getlong)
2060 AC_CHECK_MEMBER(HEADER.ad,
2061 [AC_DEFINE(HAVE_HEADER_AD)],,
2062 [#include <arpa/nameser.h>])
2063 ])
3e05e934 2064
12928e80 2065# Check whether user wants Kerberos 5 support
aff51935 2066KRB5_MSG="no"
12928e80 2067AC_ARG_WITH(kerberos5,
aff51935 2068 [ --with-kerberos5=PATH Enable Kerberos 5 support],
5585c441 2069 [ if test "x$withval" != "xno" ; then
2070 if test "x$withval" = "xyes" ; then
2071 KRB5ROOT="/usr/local"
2072 else
2073 KRB5ROOT=${withval}
2074 fi
2075
2076 AC_DEFINE(KRB5)
2077 KRB5_MSG="yes"
2078
2079 AC_MSG_CHECKING(for krb5-config)
2080 if test -x $KRB5ROOT/bin/krb5-config ; then
2081 KRB5CONF=$KRB5ROOT/bin/krb5-config
2082 AC_MSG_RESULT($KRB5CONF)
2083
2084 AC_MSG_CHECKING(for gssapi support)
2085 if $KRB5CONF | grep gssapi >/dev/null ; then
2086 AC_MSG_RESULT(yes)
071970fb 2087 AC_DEFINE(GSSAPI)
2088 k5confopts=gssapi
aff51935 2089 else
5585c441 2090 AC_MSG_RESULT(no)
071970fb 2091 k5confopts=""
aff51935 2092 fi
071970fb 2093 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2094 K5LIBS="`$KRB5CONF --libs $k5confopts`"
5585c441 2095 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
5585c441 2096 AC_MSG_CHECKING(whether we are using Heimdal)
2097 AC_TRY_COMPILE([ #include <krb5.h> ],
2098 [ char *tmp = heimdal_version; ],
2099 [ AC_MSG_RESULT(yes)
2100 AC_DEFINE(HEIMDAL) ],
2101 AC_MSG_RESULT(no)
2102 )
2103 else
2104 AC_MSG_RESULT(no)
12928e80 2105 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
aff51935 2106 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
aff51935 2107 AC_MSG_CHECKING(whether we are using Heimdal)
2108 AC_TRY_COMPILE([ #include <krb5.h> ],
2109 [ char *tmp = heimdal_version; ],
2110 [ AC_MSG_RESULT(yes)
2111 AC_DEFINE(HEIMDAL)
2112 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2113 ],
2114 [ AC_MSG_RESULT(no)
2115 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2116 ]
2117 )
4e00038c 2118 AC_SEARCH_LIBS(dn_expand, resolv)
12928e80 2119
749560dd 2120 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2121 [ AC_DEFINE(GSSAPI)
2122 K5LIBS="-lgssapi $K5LIBS" ],
2123 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2124 [ AC_DEFINE(GSSAPI)
aff51935 2125 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
749560dd 2126 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2127 $K5LIBS)
2128 ],
2129 $K5LIBS)
2130
2131 AC_CHECK_HEADER(gssapi.h, ,
2132 [ unset ac_cv_header_gssapi_h
aff51935 2133 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
749560dd 2134 AC_CHECK_HEADERS(gssapi.h, ,
2135 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
aff51935 2136 )
749560dd 2137 ]
2138 )
2139
2140 oldCPP="$CPPFLAGS"
2141 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2142 AC_CHECK_HEADER(gssapi_krb5.h, ,
2143 [ CPPFLAGS="$oldCPP" ])
2144
aff51935 2145 fi
5585c441 2146 if test ! -z "$need_dash_r" ; then
2147 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2148 fi
2149 if test ! -z "$blibpath" ; then
2150 blibpath="$blibpath:${KRB5ROOT}/lib"
2151 fi
071970fb 2152 fi
2153
2154 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2155 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2156 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2157
2158 LIBS="$LIBS $K5LIBS"
2159 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
2160 ]
12928e80 2161)
b5b68128 2162
a0391976 2163# Looking for programs, paths and files
a0391976 2164
ecac8ee5 2165PRIVSEP_PATH=/var/empty
2166AC_ARG_WITH(privsep-path,
cda1ebcb 2167 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
ecac8ee5 2168 [
2169 if test "x$withval" != "$no" ; then
2170 PRIVSEP_PATH=$withval
2171 fi
2172 ]
2173)
2174AC_SUBST(PRIVSEP_PATH)
2175
a0391976 2176AC_ARG_WITH(xauth,
2177 [ --with-xauth=PATH Specify path to xauth program ],
2178 [
00937921 2179 if test "x$withval" != "xno" ; then
cbd7492e 2180 xauth_path=$withval
a0391976 2181 fi
2182 ],
2183 [
2bf42e4a 2184 TestPath="$PATH"
2185 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2186 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2187 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2188 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2189 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
e5fe9a1f 2190 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 2191 xauth_path="/usr/openwin/bin/xauth"
2192 fi
2193 ]
2194)
2195
65a4b4af 2196STRIP_OPT=-s
2197AC_ARG_ENABLE(strip,
2198 [ --disable-strip Disable calling strip(1) on install],
2199 [
2200 if test "x$enableval" = "xno" ; then
2201 STRIP_OPT=
2202 fi
2203 ]
2204)
2205AC_SUBST(STRIP_OPT)
2206
b3ec54b4 2207if test -z "$xauth_path" ; then
2208 XAUTH_PATH="undefined"
2209 AC_SUBST(XAUTH_PATH)
2210else
a0391976 2211 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
b3ec54b4 2212 XAUTH_PATH=$xauth_path
2213 AC_SUBST(XAUTH_PATH)
a0391976 2214fi
a0391976 2215
2216# Check for mail directory (last resort if we cannot get it from headers)
2217if test ! -z "$MAIL" ; then
2218 maildir=`dirname $MAIL`
2219 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2220fi
2221
a0391976 2222if test -z "$no_dev_ptmx" ; then
6e879cb4 2223 if test "x$disable_ptmx_check" != "xyes" ; then
aff51935 2224 AC_CHECK_FILE("/dev/ptmx",
6e879cb4 2225 [
2226 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2227 have_dev_ptmx=1
2228 ]
2229 )
2230 fi
3276571c 2231fi
aff51935 2232AC_CHECK_FILE("/dev/ptc",
3276571c 2233 [
2234 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2235 have_dev_ptc=1
2236 ]
2237)
2238
a0391976 2239# Options from here on. Some of these are preset by platform above
fdf6b7aa 2240AC_ARG_WITH(mantype,
5d97cfbf 2241 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 2242 [
5d97cfbf 2243 case "$withval" in
2244 man|cat|doc)
2245 MANTYPE=$withval
2246 ;;
2247 *)
2248 AC_MSG_ERROR(invalid man type: $withval)
2249 ;;
2250 esac
c54a6257 2251 ]
2252)
e0c4d3ac 2253if test -z "$MANTYPE"; then
2bf42e4a 2254 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2255 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
e0c4d3ac 2256 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2257 MANTYPE=doc
2258 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2259 MANTYPE=man
2260 else
2261 MANTYPE=cat
2262 fi
2263fi
c54a6257 2264AC_SUBST(MANTYPE)
e0c4d3ac 2265if test "$MANTYPE" = "doc"; then
2266 mansubdir=man;
2267else
2268 mansubdir=$MANTYPE;
2269fi
2270AC_SUBST(mansubdir)
0bc5b6fb 2271
a0391976 2272# Check whether to enable MD5 passwords
aff51935 2273MD5_MSG="no"
2ddcfdf3 2274AC_ARG_WITH(md5-passwords,
caf3bc51 2275 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 2276 [
bcf36c78 2277 if test "x$withval" != "xno" ; then
0bc5b6fb 2278 AC_DEFINE(HAVE_MD5_PASSWORDS)
aff51935 2279 MD5_MSG="yes"
0bc5b6fb 2280 fi
2281 ]
caf3bc51 2282)
2283
a0391976 2284# Whether to disable shadow password support
a7effaac 2285AC_ARG_WITH(shadow,
2286 [ --without-shadow Disable shadow password support],
2287 [
2288 if test "x$withval" = "xno" ; then
2289 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 2290 disable_shadow=yes
a7effaac 2291 fi
2292 ]
2293)
2294
4cb5ffa0 2295if test -z "$disable_shadow" ; then
2296 AC_MSG_CHECKING([if the systems has expire shadow information])
2297 AC_TRY_COMPILE(
2298 [
2299#include <sys/types.h>
2300#include <shadow.h>
2301 struct spwd sp;
2302 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2303 [ sp_expire_available=yes ], []
2304 )
2305
2306 if test "x$sp_expire_available" = "xyes" ; then
2307 AC_MSG_RESULT(yes)
2308 AC_DEFINE(HAS_SHADOW_EXPIRE)
2309 else
2310 AC_MSG_RESULT(no)
2311 fi
2312fi
2313
a0391976 2314# Use ip address instead of hostname in $DISPLAY
44839801 2315if test ! -z "$IPADDR_IN_DISPLAY" ; then
2316 DISPLAY_HACK_MSG="yes"
2317 AC_DEFINE(IPADDR_IN_DISPLAY)
2318else
aff51935 2319 DISPLAY_HACK_MSG="no"
44839801 2320 AC_ARG_WITH(ipaddr-display,
2321 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2322 [
2323 if test "x$withval" != "xno" ; then
2324 AC_DEFINE(IPADDR_IN_DISPLAY)
aff51935 2325 DISPLAY_HACK_MSG="yes"
44839801 2326 fi
2327 ]
2328 )
2329fi
a7effaac 2330
95b99395 2331# check for /etc/default/login and use it if present.
daa41e62 2332AC_ARG_ENABLE(etc-default-login,
2333 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2334[
95b99395 2335AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2336
2337if test "x$external_path_file" = "x/etc/default/login"; then
2338 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2339fi
daa41e62 2340])
95b99395 2341
8d184c09 2342dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2343if test $ac_cv_func_login_getcapbool = "yes" -a \
2344 $ac_cv_header_login_cap_h = "yes" ; then
95b99395 2345 external_path_file=/etc/login.conf
8d184c09 2346fi
95b99395 2347
a0391976 2348# Whether to mess with the default path
aff51935 2349SERVER_PATH_MSG="(default)"
c43d69a9 2350AC_ARG_WITH(default-path,
75817f90 2351 [ --with-default-path= Specify default \$PATH environment for server],
cb807f40 2352 [
95b99395 2353 if test "x$external_path_file" = "x/etc/login.conf" ; then
8d184c09 2354 AC_MSG_WARN([
2355--with-default-path=PATH has no effect on this system.
2356Edit /etc/login.conf instead.])
2357 elif test "x$withval" != "xno" ; then
89bbd457 2358 if test ! -z "$external_path_file" ; then
95b99395 2359 AC_MSG_WARN([
2360--with-default-path=PATH will only be used if PATH is not defined in
2361$external_path_file .])
2362 fi
b2d818e6 2363 user_path="$withval"
aff51935 2364 SERVER_PATH_MSG="$withval"
cb807f40 2365 fi
b2d818e6 2366 ],
95b99395 2367 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2368 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
8d184c09 2369 else
89bbd457 2370 if test ! -z "$external_path_file" ; then
95b99395 2371 AC_MSG_WARN([
2372If PATH is defined in $external_path_file, ensure the path to scp is included,
2373otherwise scp will not work.])
2374 fi
2375 AC_TRY_RUN(
2376 [
b2d818e6 2377/* find out what STDPATH is */
2378#include <stdio.h>
b2d818e6 2379#ifdef HAVE_PATHS_H
2380# include <paths.h>
2381#endif
2382#ifndef _PATH_STDPATH
d9a4e55b 2383# ifdef _PATH_USERPATH /* Irix */
2384# define _PATH_STDPATH _PATH_USERPATH
2385# else
2386# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2387# endif
b2d818e6 2388#endif
2389#include <sys/types.h>
2390#include <sys/stat.h>
2391#include <fcntl.h>
2392#define DATA "conftest.stdpath"
2393
2394main()
2395{
2396 FILE *fd;
2397 int rc;
2398
2399 fd = fopen(DATA,"w");
2400 if(fd == NULL)
2401 exit(1);
2402
2403 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2404 exit(1);
2405
2406 exit(0);
2407}
2408 ], [ user_path=`cat conftest.stdpath` ],
2409 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2410 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2411 )
2412# make sure $bindir is in USER_PATH so scp will work
2413 t_bindir=`eval echo ${bindir}`
2414 case $t_bindir in
2415 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2416 esac
2417 case $t_bindir in
2418 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2419 esac
2420 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2421 if test $? -ne 0 ; then
2422 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2423 if test $? -ne 0 ; then
2424 user_path=$user_path:$t_bindir
2425 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2426 fi
2427 fi
8d184c09 2428 fi ]
cb807f40 2429)
95b99395 2430if test "x$external_path_file" != "x/etc/login.conf" ; then
8d184c09 2431 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2432 AC_SUBST(user_path)
2433fi
cb807f40 2434
06617857 2435# Set superuser path separately to user path
06617857 2436AC_ARG_WITH(superuser-path,
2437 [ --with-superuser-path= Specify different path for super-user],
2438 [
2439 if test "x$withval" != "xno" ; then
2440 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2441 superuser_path=$withval
2442 fi
2443 ]
2444)
2445
2446
58d100bf 2447AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
aff51935 2448IPV4_IN6_HACK_MSG="no"
80faa19f 2449AC_ARG_WITH(4in6,
2450 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2451 [
2452 if test "x$withval" != "xno" ; then
2453 AC_MSG_RESULT(yes)
2454 AC_DEFINE(IPV4_IN_IPV6)
aff51935 2455 IPV4_IN6_HACK_MSG="yes"
80faa19f 2456 else
2457 AC_MSG_RESULT(no)
2458 fi
2459 ],[
2460 if test "x$inet6_default_4in6" = "xyes"; then
2461 AC_MSG_RESULT([yes (default)])
2462 AC_DEFINE(IPV4_IN_IPV6)
aff51935 2463 IPV4_IN6_HACK_MSG="yes"
80faa19f 2464 else
2465 AC_MSG_RESULT([no (default)])
2466 fi
2467 ]
2468)
2469
af774732 2470# Whether to enable BSD auth support
f1b0ecc3 2471BSD_AUTH_MSG=no
af774732 2472AC_ARG_WITH(bsd-auth,
2473 [ --with-bsd-auth Enable BSD auth support],
2474 [
2475 if test "x$withval" != "xno" ; then
2476 AC_DEFINE(BSD_AUTH)
f1b0ecc3 2477 BSD_AUTH_MSG=yes
af774732 2478 fi
2479 ]
2480)
2481
a0391976 2482# Where to place sshd.pid
19d9ac2a 2483piddir=/var/run
81dadca3 2484# make sure the directory exists
2485if test ! -d $piddir ; then
2486 piddir=`eval echo ${sysconfdir}`
2487 case $piddir in
aff51935 2488 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
81dadca3 2489 esac
2490fi
2491
47e45e44 2492AC_ARG_WITH(pid-dir,
2493 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2494 [
2495 if test "x$withval" != "xno" ; then
19d9ac2a 2496 piddir=$withval
81dadca3 2497 if test ! -d $piddir ; then
2498 AC_MSG_WARN([** no $piddir directory on this system **])
2499 fi
47e45e44 2500 fi
2501 ]
2502)
b7a87eea 2503
42f11eb2 2504AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
19d9ac2a 2505AC_SUBST(piddir)
47e45e44 2506
1d7b9b20 2507dnl allow user to disable some login recording features
2508AC_ARG_ENABLE(lastlog,
bfd550a2 2509 [ --disable-lastlog disable use of lastlog even if detected [no]],
ddb154b3 2510 [
2511 if test "x$enableval" = "xno" ; then
2512 AC_DEFINE(DISABLE_LASTLOG)
2513 fi
2514 ]
1d7b9b20 2515)
2516AC_ARG_ENABLE(utmp,
bfd550a2 2517 [ --disable-utmp disable use of utmp even if detected [no]],
ddb154b3 2518 [
2519 if test "x$enableval" = "xno" ; then
2520 AC_DEFINE(DISABLE_UTMP)
2521 fi
2522 ]
1d7b9b20 2523)
2524AC_ARG_ENABLE(utmpx,
bfd550a2 2525 [ --disable-utmpx disable use of utmpx even if detected [no]],
ddb154b3 2526 [
2527 if test "x$enableval" = "xno" ; then
2528 AC_DEFINE(DISABLE_UTMPX)
2529 fi
2530 ]
1d7b9b20 2531)
2532AC_ARG_ENABLE(wtmp,
bfd550a2 2533 [ --disable-wtmp disable use of wtmp even if detected [no]],
ddb154b3 2534 [
2535 if test "x$enableval" = "xno" ; then
2536 AC_DEFINE(DISABLE_WTMP)
2537 fi
2538 ]
1d7b9b20 2539)
2540AC_ARG_ENABLE(wtmpx,
bfd550a2 2541 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
ddb154b3 2542 [
2543 if test "x$enableval" = "xno" ; then
2544 AC_DEFINE(DISABLE_WTMPX)
2545 fi
2546 ]
1d7b9b20 2547)
2548AC_ARG_ENABLE(libutil,
bfd550a2 2549 [ --disable-libutil disable use of libutil (login() etc.) [no]],
ddb154b3 2550 [
2551 if test "x$enableval" = "xno" ; then
2552 AC_DEFINE(DISABLE_LOGIN)
2553 fi
2554 ]
1d7b9b20 2555)
2556AC_ARG_ENABLE(pututline,
bfd550a2 2557 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
ddb154b3 2558 [
2559 if test "x$enableval" = "xno" ; then
aff51935 2560 AC_DEFINE(DISABLE_PUTUTLINE)
ddb154b3 2561 fi
2562 ]
1d7b9b20 2563)
2564AC_ARG_ENABLE(pututxline,
bfd550a2 2565 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
ddb154b3 2566 [
2567 if test "x$enableval" = "xno" ; then
2568 AC_DEFINE(DISABLE_PUTUTXLINE)
2569 fi
2570 ]
1d7b9b20 2571)
2572AC_ARG_WITH(lastlog,
bfd550a2 2573 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 2574 [
2575 if test "x$withval" = "xno" ; then
2576 AC_DEFINE(DISABLE_LASTLOG)
2577 else
2578 conf_lastlog_location=$withval
2579 fi
2580 ]
2581)
1d7b9b20 2582
2583dnl lastlog, [uw]tmpx? detection
2584dnl NOTE: set the paths in the platform section to avoid the
2585dnl need for command-line parameters
2586dnl lastlog and [uw]tmp are subject to a file search if all else fails
2587
2588dnl lastlog detection
2589dnl NOTE: the code itself will detect if lastlog is a directory
2590AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2591AC_TRY_COMPILE([
2592#include <sys/types.h>
2593#include <utmp.h>
2594#ifdef HAVE_LASTLOG_H
2595# include <lastlog.h>
2596#endif
d7c0f3d5 2597#ifdef HAVE_PATHS_H
1d7b9b20 2598# include <paths.h>
41cb4569 2599#endif
2600#ifdef HAVE_LOGIN_H
2601# include <login.h>
1d7b9b20 2602#endif
2603 ],
2604 [ char *lastlog = LASTLOG_FILE; ],
2605 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 2606 [
2607 AC_MSG_RESULT(no)
2608 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2609 AC_TRY_COMPILE([
2610#include <sys/types.h>
2611#include <utmp.h>
2612#ifdef HAVE_LASTLOG_H
2613# include <lastlog.h>
2614#endif
2615#ifdef HAVE_PATHS_H
2616# include <paths.h>
2617#endif
2618 ],
2619 [ char *lastlog = _PATH_LASTLOG; ],
2620 [ AC_MSG_RESULT(yes) ],
2621 [
f282b668 2622 AC_MSG_RESULT(no)
d7c0f3d5 2623 system_lastlog_path=no
2624 ])
2625 ]
1d7b9b20 2626)
d7c0f3d5 2627
1d7b9b20 2628if test -z "$conf_lastlog_location"; then
2629 if test x"$system_lastlog_path" = x"no" ; then
2630 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 2631 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 2632 conf_lastlog_location=$f
2633 fi
2634 done
2635 if test -z "$conf_lastlog_location"; then
f8119cef 2636 AC_MSG_WARN([** Cannot find lastlog **])
2637 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 2638 fi
2639 fi
2640fi
2641
2642if test -n "$conf_lastlog_location"; then
2643 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2644fi
2645
2646dnl utmp detection
2647AC_MSG_CHECKING([if your system defines UTMP_FILE])
2648AC_TRY_COMPILE([
2649#include <sys/types.h>
2650#include <utmp.h>
d7c0f3d5 2651#ifdef HAVE_PATHS_H
1d7b9b20 2652# include <paths.h>
2653#endif
2654 ],
2655 [ char *utmp = UTMP_FILE; ],
2656 [ AC_MSG_RESULT(yes) ],
2657 [ AC_MSG_RESULT(no)
2658 system_utmp_path=no ]
2659)
2660if test -z "$conf_utmp_location"; then
2661 if test x"$system_utmp_path" = x"no" ; then
2662 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2663 if test -f $f ; then
2664 conf_utmp_location=$f
2665 fi
2666 done
2667 if test -z "$conf_utmp_location"; then
2668 AC_DEFINE(DISABLE_UTMP)
2669 fi
2670 fi
2671fi
2672if test -n "$conf_utmp_location"; then
2673 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2674fi
2675
2676dnl wtmp detection
2677AC_MSG_CHECKING([if your system defines WTMP_FILE])
2678AC_TRY_COMPILE([
2679#include <sys/types.h>
2680#include <utmp.h>
d7c0f3d5 2681#ifdef HAVE_PATHS_H
1d7b9b20 2682# include <paths.h>
2683#endif
2684 ],
2685 [ char *wtmp = WTMP_FILE; ],
2686 [ AC_MSG_RESULT(yes) ],
2687 [ AC_MSG_RESULT(no)
2688 system_wtmp_path=no ]
2689)
2690if test -z "$conf_wtmp_location"; then
2691 if test x"$system_wtmp_path" = x"no" ; then
2692 for f in /usr/adm/wtmp /var/log/wtmp; do
2693 if test -f $f ; then
2694 conf_wtmp_location=$f
2695 fi
2696 done
2697 if test -z "$conf_wtmp_location"; then
2698 AC_DEFINE(DISABLE_WTMP)
2699 fi
2700 fi
2701fi
2702if test -n "$conf_wtmp_location"; then
2703 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2704fi
2705
2706
2707dnl utmpx detection - I don't know any system so perverse as to require
2708dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2709dnl there, though.
2710AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2711AC_TRY_COMPILE([
2712#include <sys/types.h>
2713#include <utmp.h>
2714#ifdef HAVE_UTMPX_H
2715#include <utmpx.h>
2716#endif
d7c0f3d5 2717#ifdef HAVE_PATHS_H
1d7b9b20 2718# include <paths.h>
2719#endif
2720 ],
2721 [ char *utmpx = UTMPX_FILE; ],
2722 [ AC_MSG_RESULT(yes) ],
2723 [ AC_MSG_RESULT(no)
2724 system_utmpx_path=no ]
2725)
2726if test -z "$conf_utmpx_location"; then
2727 if test x"$system_utmpx_path" = x"no" ; then
2728 AC_DEFINE(DISABLE_UTMPX)
2729 fi
2730else
2731 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2732fi
2733
2734dnl wtmpx detection
2735AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2736AC_TRY_COMPILE([
2737#include <sys/types.h>
2738#include <utmp.h>
2739#ifdef HAVE_UTMPX_H
2740#include <utmpx.h>
2741#endif
d7c0f3d5 2742#ifdef HAVE_PATHS_H
1d7b9b20 2743# include <paths.h>
2744#endif
2745 ],
2746 [ char *wtmpx = WTMPX_FILE; ],
2747 [ AC_MSG_RESULT(yes) ],
2748 [ AC_MSG_RESULT(no)
2749 system_wtmpx_path=no ]
2750)
2751if test -z "$conf_wtmpx_location"; then
2752 if test x"$system_wtmpx_path" = x"no" ; then
2753 AC_DEFINE(DISABLE_WTMPX)
2754 fi
2755else
2756 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2757fi
2758
b7a87eea 2759
bd499f9e 2760if test ! -z "$blibpath" ; then
68ece370 2761 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2762 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
bd499f9e 2763fi
2764
ddceb1c8 2765dnl remove pam and dl because they are in $LIBPAM
2766if test "$PAM_MSG" = yes ; then
98f2d9d5 2767 LIBS=`echo $LIBS | sed 's/-lpam //'`
2768fi
2769if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2770 LIBS=`echo $LIBS | sed 's/-ldl //'`
ddceb1c8 2771fi
2772
3c62e7eb 2773AC_EXEEXT
98a7c37b 2774AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2775AC_OUTPUT
d3083fbd 2776
cbd7492e 2777# Print summary of options
2778
cbd7492e 2779# Someone please show me a better way :)
2780A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2781B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2782C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2783D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 2784E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 2785F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 2786G=`eval echo ${piddir}` ; G=`eval echo ${G}`
ecac8ee5 2787H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2788I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2789J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
cbd7492e 2790
2791echo ""
26de7942 2792echo "OpenSSH has been configured with the following options:"
ecac8ee5 2793echo " User binaries: $B"
2794echo " System binaries: $C"
2795echo " Configuration files: $D"
2796echo " Askpass program: $E"
2797echo " Manual pages: $F"
2798echo " PID file: $G"
2799echo " Privilege separation chroot path: $H"
95b99395 2800if test "x$external_path_file" = "x/etc/login.conf" ; then
2801echo " At runtime, sshd will use the path defined in $external_path_file"
2802echo " Make sure the path to scp is present, otherwise scp will not work"
8d184c09 2803else
ecac8ee5 2804echo " sshd default user PATH: $I"
89bbd457 2805 if test ! -z "$external_path_file"; then
95b99395 2806echo " (If PATH is set in $external_path_file it will be used instead. If"
2807echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2808 fi
8d184c09 2809fi
06617857 2810if test ! -z "$superuser_path" ; then
ecac8ee5 2811echo " sshd superuser user PATH: $J"
2812fi
2813echo " Manpage format: $MANTYPE"
3e05e934 2814echo " PAM support: $PAM_MSG"
ecac8ee5 2815echo " KerberosV support: $KRB5_MSG"
2816echo " Smartcard support: $SCARD_MSG"
ecac8ee5 2817echo " S/KEY support: $SKEY_MSG"
2818echo " TCP Wrappers support: $TCPW_MSG"
2819echo " MD5 password support: $MD5_MSG"
3deb1408 2820echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
ecac8ee5 2821echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2822echo " BSD Auth support: $BSD_AUTH_MSG"
2823echo " Random number source: $RAND_MSG"
f1b0ecc3 2824if test ! -z "$USE_RAND_HELPER" ; then
ecac8ee5 2825echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 2826fi
2827
cbd7492e 2828echo ""
2829
0c2fb82f 2830echo " Host: ${host}"
2831echo " Compiler: ${CC}"
2832echo " Compiler flags: ${CFLAGS}"
2833echo "Preprocessor flags: ${CPPFLAGS}"
2834echo " Linker flags: ${LDFLAGS}"
ddceb1c8 2835echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
cbd7492e 2836
2837echo ""
2838
adeebd37 2839if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 2840 echo "PAM is enabled. You may need to install a PAM control file "
2841 echo "for sshd, otherwise password authentication may fail. "
aff51935 2842 echo "Example PAM control files can be found in the contrib/ "
f1b0ecc3 2843 echo "subdirectory"
adeebd37 2844 echo ""
2845fi
2846
f1b0ecc3 2847if test ! -z "$RAND_HELPER_CMDHASH" ; then
2848 echo "WARNING: you are using the builtin random number collection "
2849 echo "service. Please read WARNING.RNG and request that your OS "
2850 echo "vendor includes kernel-based random number collection in "
2851 echo "future versions of your OS."
2c523de9 2852 echo ""
2853fi
af774732 2854
This page took 1.618737 seconds and 5 git commands to generate.