]> andersk Git - openssh.git/blame - configure.ac
- (djm) Fix some bugs I introduced into ssh-rand-helper yesterday
[openssh.git] / configure.ac
CommitLineData
46058ce2 1i# $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.
4cca272e 12AC_PROG_CPP
5881cd60 13AC_PROG_RANLIB
cf8dd513 14AC_PROG_INSTALL
bee0a37e 15AC_PATH_PROG(AR, ar)
13dd877b 16AC_PATH_PROGS(PERL, perl5 perl)
a0f84251 17AC_SUBST(PERL)
ad85db64 18AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
77bb0bca 20AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
6958bd37 21AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
f498ed15 24
948fd8b9 25# System features
26AC_SYS_LARGEFILE
27
c193d002 28if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
30fi
31
2e73a022 32# Use LOGIN_PROGRAM from environment if possible
33if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
35else
36 # Search for login
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
40 fi
41fi
42
d423d822 43if test -z "$LD" ; then
44 LD=$CC
45fi
46AC_SUBST(LD)
47
d423d822 48AC_C_INLINE
5ed2bb5b 49if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
d423d822 51fi
52
a0391976 53# Check for some target-specific stuff
a7effaac 54case "$host" in
9d6b1b96 55*-*-aix*)
56 AFS_LIBS="-lld"
0c2fb82f 57 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
84afc958 58 LDFLAGS="$LDFLAGS -L/usr/local/lib"
e5fe9a1f 59 if (test "$LD" != "gcc" && test -z "$blibpath"); then
bd499f9e 60 blibpath="/usr/lib:/lib:/usr/local/lib"
61 fi
c1ef8333 62 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
4c8ef3fb 63 AC_DEFINE(BROKEN_GETADDRINFO)
a3cef3ca 64 dnl AIX handles lastlog as part of its login message
65 AC_DEFINE(DISABLE_LASTLOG)
9d6b1b96 66 ;;
3c62e7eb 67*-*-cygwin*)
ffb8d130 68 LIBS="$LIBS /usr/lib/textmode.o"
3c62e7eb 69 AC_DEFINE(HAVE_CYGWIN)
7043a38d 70 AC_DEFINE(USE_PIPES)
3c62e7eb 71 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
3d114925 74 AC_DEFINE(NO_X11_UNIX_SOCKETS)
3c62e7eb 75 ;;
d6fdb079 76*-*-dgux*)
77 AC_DEFINE(IP_TOS_IS_BROKEN)
78 ;;
39c98ef7 79*-*-darwin*)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 ;;
a7effaac 82*-*-hpux10*)
83 if test -z "$GCC"; then
fc1e8bf4 84 CFLAGS="$CFLAGS -Ae"
a7effaac 85 fi
28564873 86 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 87 IPADDR_IN_DISPLAY=yes
137d7b6c 88 AC_DEFINE(USE_PIPES)
0bbfbdeb 89 AC_DEFINE(DISABLE_SHADOW)
764d4113 90 AC_DEFINE(DISABLE_UTMP)
f5af5cd5 91 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
28564873 92 LIBS="$LIBS -lxnet -lsec"
a7effaac 93 ;;
2b763e31 94*-*-hpux11*)
b8fea62d 95 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 96 IPADDR_IN_DISPLAY=yes
adeebd37 97 AC_DEFINE(PAM_SUN_CODEBASE)
2b10f47a 98 AC_DEFINE(USE_PIPES)
0bbfbdeb 99 AC_DEFINE(DISABLE_SHADOW)
764d4113 100 AC_DEFINE(DISABLE_UTMP)
f5af5cd5 101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
b8fea62d 102 LIBS="$LIBS -lxnet -lsec"
2b763e31 103 ;;
d94aa2ae 104*-*-irix5*)
0c2fb82f 105 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
c5fa2eb0 106 LDFLAGS="$LDFLAGS"
6ac7829a 107 PATH="$PATH:/usr/etc"
416ed5a7 108 AC_DEFINE(BROKEN_INET_NTOA)
b9795b89 109 ;;
110*-*-irix6*)
0c2fb82f 111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
c5fa2eb0 112 LDFLAGS="$LDFLAGS"
6ac7829a 113 PATH="$PATH:/usr/etc"
3206bb3b 114 AC_DEFINE(WITH_IRIX_ARRAY)
115 AC_DEFINE(WITH_IRIX_PROJECT)
116 AC_DEFINE(WITH_IRIX_AUDIT)
0b49a754 117 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
416ed5a7 118 AC_DEFINE(BROKEN_INET_NTOA)
d94aa2ae 119 ;;
5cdfe03f 120*-*-linux*)
121 no_dev_ptmx=1
717057b6 122 check_for_libcrypt_later=1
80faa19f 123 AC_DEFINE(DONT_TRY_OTHER_AF)
a8545c6c 124 AC_DEFINE(PAM_TTY_KLUDGE)
80faa19f 125 inet6_default_4in6=yes
5cdfe03f 126 ;;
66d6c27e 127mips-sony-bsd|mips-sony-newsos4)
128 AC_DEFINE(HAVE_NEWS4)
129 SONY=1
130 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
ed6553e2 131 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
66d6c27e 132 )
133 ;;
d468fc76 134*-*-netbsd*)
a0391976 135 need_dash_r=1
d468fc76 136 ;;
86b416a7 137*-*-freebsd*)
138 check_for_libcrypt_later=1
139 ;;
729bfe59 140*-next-*)
729bfe59 141 conf_lastlog_location="/usr/adm/lastlog"
698d107e 142 conf_utmp_location=/etc/utmp
143 conf_wtmp_location=/usr/adm/wtmp
144 MAIL=/usr/spool/mail
729bfe59 145 AC_DEFINE(HAVE_NEXT)
443172c4 146 AC_DEFINE(BROKEN_REALPATH)
00937921 147 AC_DEFINE(USE_PIPES)
86b416a7 148 AC_DEFINE(BROKEN_SAVED_UIDS)
0c2fb82f 149 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
b1335fdf 150 CFLAGS="$CFLAGS"
729bfe59 151 ;;
9d6b1b96 152*-*-solaris*)
0c2fb82f 153 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
fbf305f1 154 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
a0391976 155 need_dash_r=1
adeebd37 156 AC_DEFINE(PAM_SUN_CODEBASE)
7e2d5fa4 157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
158 AC_DEFINE(LOGIN_NEEDS_TERM)
7f0a4ff1 159 AC_DEFINE(PAM_TTY_KLUDGE)
1d7b9b20 160 # hardwire lastlog location (can't detect it on some versions)
161 conf_lastlog_location="/var/adm/lastlog"
32c80420 162 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
163 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
164 if test "$sol2ver" -ge 8; then
165 AC_MSG_RESULT(yes)
166 AC_DEFINE(DISABLE_UTMP)
167 AC_DEFINE(DISABLE_WTMP)
168 else
169 AC_MSG_RESULT(no)
170 fi
9d6b1b96 171 ;;
a423beaf 172*-*-sunos4*)
0c2fb82f 173 CPPFLAGS="$CPPFLAGS -DSUNOS4"
a423beaf 174 AC_CHECK_FUNCS(getpwanam)
adeebd37 175 AC_DEFINE(PAM_SUN_CODEBASE)
667beaa9 176 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
32eec038 177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/var/adm/wtmp
179 conf_lastlog_location=/var/adm/lastlog
137d7b6c 180 AC_DEFINE(USE_PIPES)
a423beaf 181 ;;
6f68f28a 182*-ncr-sysv*)
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
184 LDFLAGS="$LDFLAGS -L/usr/local/lib"
98a7c37b 185 LIBS="$LIBS -lc89"
d8e76a0a 186 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
29525240 187 AC_DEFINE(USE_PIPES)
6f68f28a 188 ;;
132dd316 189*-sni-sysv*)
0c2fb82f 190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
c8c15bcb 191 # /usr/ucblib MUST NOT be searched on ReliantUNIX
192 LDFLAGS="$LDFLAGS -L/usr/local/lib"
9548d6c8 193 IPADDR_IN_DISPLAY=yes
194 AC_DEFINE(USE_PIPES)
132dd316 195 AC_DEFINE(IP_TOS_IS_BROKEN)
097ca118 196 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
c8c15bcb 197 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
198 # Attention: always take care to bind libsocket and libnsl before libc,
199 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
132dd316 200 ;;
77bb0bca 201*-*-sysv4.2*)
0c2fb82f 202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
77bb0bca 203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
cb547f98 204# enable_suid_ssh=no
ed6553e2 205 AC_DEFINE(USE_PIPES)
77bb0bca 206 ;;
207*-*-sysv5*)
0c2fb82f 208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
77bb0bca 209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
cb547f98 210# enable_suid_ssh=no
ed6553e2 211 AC_DEFINE(USE_PIPES)
77bb0bca 212 ;;
9d6b1b96 213*-*-sysv*)
0c2fb82f 214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
84afc958 215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
9d6b1b96 216 ;;
77bb0bca 217*-*-sco3.2v4*)
0c2fb82f 218 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
77bb0bca 219 LDFLAGS="$LDFLAGS -L/usr/local/lib"
98a7c37b 220 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
ed6553e2 221 rsh_path="/usr/bin/rcmd"
77bb0bca 222 RANLIB=true
ed6553e2 223 no_dev_ptmx=1
77bb0bca 224 AC_DEFINE(BROKEN_SYS_TERMIO_H)
ed6553e2 225 AC_DEFINE(USE_PIPES)
77bb0bca 226 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
d287c664 227 AC_DEFINE(DISABLE_SHADOW)
2c523de9 228 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
86b416a7 229 AC_DEFINE(BROKEN_SAVED_UIDS)
aca75d94 230 AC_CHECK_FUNCS(getluid setluid)
533875af 231 MANTYPE=man
98a7c37b 232 do_sco3_extra_lib_check=yes
77bb0bca 233 ;;
234*-*-sco3.2v5*)
0c2fb82f 235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
509b1f88 236 LDFLAGS="$LDFLAGS -L/usr/local/lib"
ed6553e2 237 LIBS="$LIBS -lprot -lx -ltinfo -lm"
509b1f88 238 no_dev_ptmx=1
77bb0bca 239 rsh_path="/usr/bin/rcmd"
ed6553e2 240 AC_DEFINE(USE_PIPES)
77bb0bca 241 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
d287c664 242 AC_DEFINE(DISABLE_SHADOW)
0dd78cd8 243 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
aca75d94 244 AC_CHECK_FUNCS(getluid setluid)
533875af 245 MANTYPE=man
509b1f88 246 ;;
ca5c7d6a 247*-*-unicos*)
a704dd54 248 no_libsocket=1
249 no_libnsl=1
ca5c7d6a 250 AC_DEFINE(USE_PIPES)
a704dd54 251 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
252 LIBS="$LIBS -lgen -lrsc"
253 ;;
4d33e531 254*-dec-osf*)
99c8ddac 255 AC_MSG_CHECKING(for Digital Unix SIA)
256 no_osfsia=""
257 AC_ARG_WITH(osfsia,
258 [ --with-osfsia Enable Digital Unix SIA],
259 [
260 if test "x$withval" = "xno" ; then
261 AC_MSG_RESULT(disabled)
262 no_osfsia=1
263 fi
264 ],
265 )
266 if test -z "$no_osfsia" ; then
4d33e531 267 if test -f /etc/sia/matrix.conf; then
268 AC_MSG_RESULT(yes)
269 AC_DEFINE(HAVE_OSF_SIA)
270 AC_DEFINE(DISABLE_LOGIN)
271 LIBS="$LIBS -lsecurity -ldb -lm -laud"
272 else
273 AC_MSG_RESULT(no)
274 fi
275 fi
276 ;;
41cb4569 277
278*-*-nto-qnx)
279 AC_DEFINE(USE_PIPES)
280 AC_DEFINE(NO_X11_UNIX_SOCKETS)
281 AC_DEFINE(MISSING_NFDBITS)
282 AC_DEFINE(MISSING_HOWMANY)
283 AC_DEFINE(MISSING_FD_MASK)
284 ;;
a7effaac 285esac
286
8e7b16f8 287# Allow user to specify flags
288AC_ARG_WITH(cflags,
289 [ --with-cflags Specify additional flags to pass to compiler],
290 [
291 if test "x$withval" != "xno" ; then
292 CFLAGS="$CFLAGS $withval"
293 fi
294 ]
295)
0c2fb82f 296AC_ARG_WITH(cppflags,
297 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
298 [
299 if test "x$withval" != "xno"; then
300 CPPFLAGS="$CPPFLAGS $withval"
301 fi
302 ]
303)
8e7b16f8 304AC_ARG_WITH(ldflags,
97b378bf 305 [ --with-ldflags Specify additional flags to pass to linker],
8e7b16f8 306 [
307 if test "x$withval" != "xno" ; then
308 LDFLAGS="$LDFLAGS $withval"
309 fi
310 ]
311)
312AC_ARG_WITH(libs,
313 [ --with-libs Specify additional libraries to link with],
314 [
315 if test "x$withval" != "xno" ; then
316 LIBS="$LIBS $withval"
317 fi
318 ]
319)
320
a0391976 321# Checks for libraries.
98a7c37b 322AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
323AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
2c523de9 324
f61d6b17 325dnl SCO OS3 needs this for libwrap
98a7c37b 326if test "x$with_tcp_wrappers" != "xno" ; then
327 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
328 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
329 fi
330fi
331
332AC_CHECK_FUNC(getspnam, ,
333 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
98a7c37b 334
335dnl zlib is required
336AC_ARG_WITH(zlib,
337 [ --with-zlib=PATH Use zlib in PATH],
338 [
f1b0ecc3 339 if test "x$withval" != "xno" ; then
340 AC_MSG_ERROR([*** zlib is required ***])
341 fi
98a7c37b 342 if test -d "$withval/lib"; then
343 if test -n "${need_dash_r}"; then
5a162955 344 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 345 else
5a162955 346 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 347 fi
348 else
349 if test -n "${need_dash_r}"; then
5a162955 350 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 351 else
5a162955 352 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 353 fi
354 fi
355 if test -d "$withval/include"; then
5a162955 356 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 357 else
5a162955 358 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 359 fi
360 ]
361)
362
051809f6 363AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
48e7916f 364
2c523de9 365dnl UnixWare 2.x
366AC_CHECK_FUNC(strcasecmp,
367 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
368)
369AC_CHECK_FUNC(utimes,
370 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
371)
4cca272e 372
7c6d759d 373dnl Checks for libutil functions
374AC_CHECK_HEADERS(libutil.h)
375AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
376AC_CHECK_FUNCS(logout updwtmp logwtmp)
377
a738c3b0 378AC_FUNC_STRFTIME
379
a0391976 380# Checks for header files.
98a7c37b 381AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
051809f6 382 getopt.h glob.h lastlog.h limits.h login.h \
98a7c37b 383 login_cap.h maillock.h netdb.h netgroup.h \
3f3ac025 384 netinet/in_systm.h paths.h poll.h pty.h \
98a7c37b 385 security/pam_appl.h shadow.h stddef.h stdint.h \
386 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
387 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
388 sys/stropts.h sys/sysmacros.h sys/time.h \
389 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
390 util.h utime.h utmp.h utmpx.h)
84ceda19 391
392# Check for ALTDIRFUNC glob() extension
393AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
394AC_EGREP_CPP(FOUNDIT,
395 [
396 #include <glob.h>
397 #ifdef GLOB_ALTDIRFUNC
398 FOUNDIT
399 #endif
400 ],
401 [
402 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
403 AC_MSG_RESULT(yes)
404 ],
405 [
406 AC_MSG_RESULT(no)
407 ]
408)
4cca272e 409
40849fdb 410# Check for g.gl_matchc glob() extension
411AC_MSG_CHECKING(for gl_matchc field in glob_t)
412AC_EGREP_CPP(FOUNDIT,
413 [
414 #include <glob.h>
415 int main(void){glob_t g; g.gl_matchc = 1;}
416 ],
417 [
418 AC_DEFINE(GLOB_HAS_GL_MATCHC)
419 AC_MSG_RESULT(yes)
420 ],
421 [
422 AC_MSG_RESULT(no)
423 ]
424)
425
edbe6722 426AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
427AC_TRY_RUN(
428 [
429#include <sys/types.h>
430#include <dirent.h>
431int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
432 ],
433 [AC_MSG_RESULT(yes)],
434 [
435 AC_MSG_RESULT(no)
436 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
437 ]
438)
439
278588d8 440# Check whether user wants S/Key support
441SKEY_MSG="no"
442AC_ARG_WITH(skey,
98a7c37b 443 [ --with-skey[[=PATH]] Enable S/Key support
444 (optionally in PATH)],
278588d8 445 [
446 if test "x$withval" != "xno" ; then
447
448 if test "x$withval" != "xyes" ; then
449 CPPFLAGS="$CPPFLAGS -I${withval}/include"
450 LDFLAGS="$LDFLAGS -L${withval}/lib"
451 fi
452
453 AC_DEFINE(SKEY)
454 LIBS="-lskey $LIBS"
455 SKEY_MSG="yes"
456
457 AC_CHECK_FUNC(skey_keyinfo,
458 [],
459 [
460 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
461 ])
462 fi
463 ]
464)
465
466# Check whether user wants TCP wrappers support
98a7c37b 467TCPW_MSG="no"
278588d8 468AC_ARG_WITH(tcp-wrappers,
98a7c37b 469 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
470 (optionally in PATH)],
278588d8 471 [
472 if test "x$withval" != "xno" ; then
473 saved_LIBS="$LIBS"
98a7c37b 474 saved_LDFLAGS="$LDFLAGS"
475 saved_CPPFLAGS="$CPPFLAGS"
476 if test -n "${withval}" -a "${withval}" != "yes"; then
477 if test -d "${withval}/lib"; then
478 if test -n "${need_dash_r}"; then
5a162955 479 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 480 else
5a162955 481 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 482 fi
483 else
484 if test -n "${need_dash_r}"; then
5a162955 485 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 486 else
5a162955 487 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 488 fi
489 fi
490 if test -d "${withval}/include"; then
5a162955 491 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 492 else
5a162955 493 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 494 fi
98a7c37b 495 fi
278588d8 496 LIBS="-lwrap $LIBS"
497 AC_MSG_CHECKING(for libwrap)
498 AC_TRY_LINK(
499 [
500#include <tcpd.h>
501 int deny_severity = 0, allow_severity = 0;
502 ],
503 [hosts_access(0);],
504 [
505 AC_MSG_RESULT(yes)
506 AC_DEFINE(LIBWRAP)
98a7c37b 507 TCPW_MSG="yes"
278588d8 508 ],
509 [
510 AC_MSG_ERROR([*** libwrap missing])
511 ]
512 )
513 fi
514 ]
515)
516
2e73a022 517dnl Checks for library functions.
98a7c37b 518AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
519 clock fchmod fchown freeaddrinfo futimes gai_strerror \
520 getaddrinfo getcwd getgrouplist getnameinfo getopt \
521 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
522 inet_ntop innetgr login_getcapbool md5_crypt memmove \
523 mkdtemp on_exit openpty readpassphrase realpath \
524 rresvport_af setdtablesize setegid setenv seteuid \
525 setlogin setproctitle setresgid setreuid setrlimit \
526 setsid setvbuf sigaction sigvec snprintf strerror \
527 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
528 vhangup vsnprintf waitpid __b64_ntop _getpty)
529
530dnl IRIX and Solaris 2.5.1 have dirname() in libgen
051809f6 531AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
98a7c37b 532 AC_CHECK_LIB(gen, dirname,[
533 AC_CACHE_CHECK([for broken dirname],
534 ac_cv_have_broken_dirname, [
051809f6 535 save_LIBS="$LIBS"
536 LIBS="$LIBS -lgen"
98a7c37b 537 AC_TRY_RUN(
538 [
539#include <libgen.h>
540#include <string.h>
541
542int main(int argc, char **argv) {
543 char *s, buf[32];
544
545 strncpy(buf,"/etc", 32);
546 s = dirname(buf);
051809f6 547 if (!s || strncmp(s, "/", 32) != 0) {
98a7c37b 548 exit(1);
549 } else {
550 exit(0);
551 }
552}
553 ],
554 [ ac_cv_have_broken_dirname="no" ],
555 [ ac_cv_have_broken_dirname="yes" ]
556 )
051809f6 557 LIBS="$save_LIBS"
98a7c37b 558 ])
051809f6 559 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
98a7c37b 560 LIBS="$LIBS -lgen"
561 AC_DEFINE(HAVE_DIRNAME)
051809f6 562 AC_CHECK_HEADERS(libgen.h)
98a7c37b 563 fi
564 ])
565])
566
2e73a022 567dnl Checks for time functions
1d7b9b20 568AC_CHECK_FUNCS(gettimeofday time)
2e73a022 569dnl Checks for utmp functions
b03bd394 570AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1d7b9b20 571AC_CHECK_FUNCS(utmpname)
2e73a022 572dnl Checks for utmpx functions
b03bd394 573AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1d7b9b20 574AC_CHECK_FUNCS(setutxent utmpxname)
76cd7316 575
5fa45897 576AC_CHECK_FUNC(getuserattr,
577 [AC_DEFINE(HAVE_GETUSERATTR)],
578 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
579)
580
beb43d31 581AC_CHECK_FUNC(daemon,
582 [AC_DEFINE(HAVE_DAEMON)],
583 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
584)
585
aa6bd60a 586AC_CHECK_FUNC(getpagesize,
587 [AC_DEFINE(HAVE_GETPAGESIZE)],
588 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
589)
590
2647ae26 591# Check for broken snprintf
592if test "x$ac_cv_func_snprintf" = "xyes" ; then
593 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
594 AC_TRY_RUN(
595 [
596#include <stdio.h>
597int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
598 ],
599 [AC_MSG_RESULT(yes)],
600 [
601 AC_MSG_RESULT(no)
602 AC_DEFINE(BROKEN_SNPRINTF)
603 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
604 ]
605 )
606fi
607
7f8f5e00 608AC_FUNC_GETPGRP
609
717057b6 610# Check for PAM libs
cbd7492e 611PAM_MSG="no"
a0391976 612AC_ARG_WITH(pam,
717057b6 613 [ --with-pam Enable PAM support ],
a0391976 614 [
717057b6 615 if test "x$withval" != "xno" ; then
616 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
617 AC_MSG_ERROR([PAM headers not found])
618 fi
a0391976 619
717057b6 620 AC_CHECK_LIB(dl, dlopen, , )
621 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
622 AC_CHECK_FUNCS(pam_getenvlist)
2b763e31 623
717057b6 624 disable_shadow=yes
625 PAM_MSG="yes"
4cb5ffa0 626
717057b6 627 AC_DEFINE(USE_PAM)
628 fi
629 ]
630)
cbd7492e 631
717057b6 632# Check for older PAM
633if test "x$PAM_MSG" = "xyes" ; then
a0391976 634 # Check PAM strerror arguments (old PAM)
635 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
636 AC_TRY_COMPILE(
637 [
18ba2aab 638#include <stdlib.h>
639#include <security/pam_appl.h>
a0391976 640 ],
641 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
642 [AC_MSG_RESULT(no)],
643 [
644 AC_DEFINE(HAVE_OLD_PAM)
645 AC_MSG_RESULT(yes)
cbd7492e 646 PAM_MSG="yes (old library)"
a0391976 647 ]
717057b6 648 )
a0391976 649fi
650
651# The big search for OpenSSL
652AC_ARG_WITH(ssl-dir,
653 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
654 [
e9e4a1c7 655 if test "x$withval" != "xno" ; then
a0391976 656 tryssldir=$withval
657 fi
658 ]
659)
660
661saved_LIBS="$LIBS"
cb0b7ea4 662saved_LDFLAGS="$LDFLAGS"
0c2fb82f 663saved_CPPFLAGS="$CPPFLAGS"
a0391976 664if test "x$prefix" != "xNONE" ; then
665 tryssldir="$tryssldir $prefix"
666fi
58d100bf 667AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
7950bf97 668 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
d6f13fbb 669 CPPFLAGS="$saved_CPPFLAGS"
670 LDFLAGS="$saved_LDFLAGS"
671 LIBS="$saved_LIBS -lcrypto"
672
673 # Skip directories if they don't exist
674 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
675 continue;
676 fi
717057b6 677 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
d6f13fbb 678 # Try to use $ssldir/lib if it exists, otherwise
679 # $ssldir
680 if test -d "$ssldir/lib" ; then
8d0cc79b 681 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
d6f13fbb 682 if test ! -z "$need_dash_r" ; then
8d0cc79b 683 LDFLAGS="-R$ssldir/lib $LDFLAGS"
d6f13fbb 684 fi
685 else
8d0cc79b 686 LDFLAGS="-L$ssldir $saved_LDFLAGS"
d6f13fbb 687 if test ! -z "$need_dash_r" ; then
8d0cc79b 688 LDFLAGS="-R$ssldir $LDFLAGS"
d6f13fbb 689 fi
690 fi
691 # Try to use $ssldir/include if it exists, otherwise
692 # $ssldir
693 if test -d "$ssldir/include" ; then
8d0cc79b 694 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
d6f13fbb 695 else
8d0cc79b 696 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
58d100bf 697 fi
a0391976 698 fi
a0391976 699
d45e3d76 700 # Basic test to check for compatible version and correct linking
701 # *does not* test for RSA - that comes later.
702 AC_TRY_RUN(
703 [
44fb55e9 704#include <string.h>
705#include <openssl/rand.h>
18ba2aab 706int main(void)
707{
d45e3d76 708 char a[2048];
709 memset(a, 0, sizeof(a));
18ba2aab 710 RAND_add(a, sizeof(a), sizeof(a));
d45e3d76 711 return(RAND_status() <= 0);
18ba2aab 712}
d45e3d76 713 ],
714 [
715 found_crypto=1
716 break;
717 ], []
718 )
58d100bf 719
720 if test ! -z "$found_crypto" ; then
721 break;
722 fi
bcf36c78 723 done
724
58d100bf 725 if test -z "$found_crypto" ; then
ed6553e2 726 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
58d100bf 727 fi
728 if test -z "$ssldir" ; then
729 ssldir="(system)"
bcf36c78 730 fi
a0391976 731
58d100bf 732 ac_cv_openssldir=$ssldir
733])
734
e5fe9a1f 735if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
58d100bf 736 AC_DEFINE(HAVE_OPENSSL)
737 dnl Need to recover ssldir - test above runs in subshell
738 ssldir=$ac_cv_openssldir
717057b6 739 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
d6f13fbb 740 # Try to use $ssldir/lib if it exists, otherwise
741 # $ssldir
742 if test -d "$ssldir/lib" ; then
8d0cc79b 743 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
d6f13fbb 744 if test ! -z "$need_dash_r" ; then
8d0cc79b 745 LDFLAGS="-R$ssldir/lib $LDFLAGS"
d6f13fbb 746 fi
747 else
8d0cc79b 748 LDFLAGS="-L$ssldir $saved_LDFLAGS"
d6f13fbb 749 if test ! -z "$need_dash_r" ; then
8d0cc79b 750 LDFLAGS="-R$ssldir $LDFLAGS"
d6f13fbb 751 fi
717057b6 752 fi
d6f13fbb 753 # Try to use $ssldir/include if it exists, otherwise
754 # $ssldir
755 if test -d "$ssldir/include" ; then
8d0cc79b 756 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
d6f13fbb 757 else
8d0cc79b 758 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
717057b6 759 fi
bd499f9e 760 fi
a0391976 761fi
d45e3d76 762LIBS="$saved_LIBS -lcrypto"
763
764# Now test RSA support
765saved_LIBS="$LIBS"
766AC_MSG_CHECKING([for RSA support])
767for WANTS_RSAREF in "" 1 ; do
768 if test -z "$WANTS_RSAREF" ; then
769 LIBS="$saved_LIBS"
770 else
771 LIBS="$saved_LIBS -lRSAglue -lrsaref"
772 fi
773 AC_TRY_RUN([
774#include <string.h>
775#include <openssl/rand.h>
776#include <openssl/rsa.h>
777#include <openssl/bn.h>
778#include <openssl/sha.h>
779int main(void)
780{
781 int num; RSA *key; static unsigned char p_in[] = "blahblah";
782 unsigned char c[256], p[256];
783 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
784 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
785 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
786 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
787}
788 ],
789 [
790 rsa_works=1
791 break;
792 ], [])
793done
0abe778b 794LIBS="$saved_LIBS"
d45e3d76 795
796if test ! -z "$no_rsa" ; then
797 AC_MSG_RESULT(disabled)
cbd7492e 798 RSA_MSG="disabled"
cb0b7ea4 799else
d45e3d76 800 if test -z "$rsa_works" ; then
801 AC_MSG_WARN([*** No RSA support found *** ])
cbd7492e 802 RSA_MSG="no"
d45e3d76 803 else
804 if test -z "$WANTS_RSAREF" ; then
805 AC_MSG_RESULT(yes)
cbd7492e 806 RSA_MSG="yes"
d45e3d76 807 else
cbd7492e 808 RSA_MSG="yes (using RSAref)"
d45e3d76 809 AC_MSG_RESULT(using RSAref)
0abe778b 810 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
d45e3d76 811 fi
812 fi
bcf36c78 813fi
58d100bf 814
717057b6 815# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
816# version in OpenSSL. Skip this for PAM
817if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
20cad736 818 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 819fi
820
f1b0ecc3 821
822### Configure cryptographic random number support
823
824# Check wheter OpenSSL seeds itself
825AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
826AC_TRY_RUN(
827 [
828#include <string.h>
829#include <openssl/rand.h>
830int main(void) { return(RAND_status() == 1 ? 0 : 1); }
831 ],
832 [
833 OPENSSL_SEEDS_ITSELF=yes
834 AC_MSG_RESULT(yes)
835 ],
836 [
837 AC_MSG_RESULT(no)
838 # Default to use of the rand helper if OpenSSL doesn't
839 # seed itself
840 USE_RAND_HELPER=yes
841 ]
842)
843
844
845# Do we want to force the use of the rand helper?
846AC_ARG_WITH(rand-helper,
847 [ --with-rand-helper Use subprocess to gather strong randomness ],
848 [
849 if test "x$withval" = "xno" ; then
850 # Force use of OpenSSL's internal RNG, even if
851 # the previous test showed it to be unseeded.
852 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
853 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
854 OPENSSL_SEEDS_ITSELF=yes
855 USE_RAND_HELPER=""
856 fi
857 else
858 USE_RAND_HELPER=yes
859 fi
860 ],
861)
862
863# Which randomness source do we use?
864if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
865 # OpenSSL only
866 AC_DEFINE(OPENSSL_PRNG_ONLY)
867 RAND_MSG="OpenSSL internal ONLY"
868 INSTALL_SSH_RAND_HELPER=""
869elif test ! -z "$OPENSSL_SEEDS_ITSELF" -a ! -z "$USE_RAND_HELPER" ; then
870 # OpenSSL with fallback to rand helper
871 RAND_MSG="ssh-rand-helper"
872 INSTALL_SSH_RAND_HELPER="yes"
873fi
874AC_SUBST(INSTALL_SSH_RAND_HELPER)
875
876### Configuration of ssh-rand-helper
877
878# PRNGD TCP socket
879AC_ARG_WITH(prngd-port,
880 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
881 [
882 if test ! -z "$withval" -a "x$withval" != "xno" ; then
883 PRNGD_PORT="$withval"
884 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
885 fi
886 ]
887)
888
889# PRNGD Unix domain socket
890AC_ARG_WITH(prngd-socket,
891 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
892 [
893 if test -z "$withval" ; then
894 withval="/var/run/egd-pool"
895 fi
896 if test "x$withval" != "xno" ; then
897 if test ! -z "$PRNGD_PORT" ; then
898 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
899 fi
900 if ! echo "$withval" | grep -q '^/' ; then
901 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
902 fi
903 if ! test -r "$withval" ; then
904 AC_MSG_WARN(Entropy socket is not readable)
905 fi
906 PRNGD_SOCKET="$withval"
907 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
908 fi
909 ]
910)
911
912# Change default command timeout for hashing entropy source
913entropy_timeout=200
914AC_ARG_WITH(entropy-timeout,
915 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
916 [
917 if test "x$withval" != "xno" ; then
918 entropy_timeout=$withval
919 fi
920 ]
921)
922
923AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
924
925# These programs are used by the command hashing source to gather entropy
926OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
927OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
928OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
929OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
930OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
931OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
932OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
933OSSH_PATH_ENTROPY_PROG(PROG_W, w)
934OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
935OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
936OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
937OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
938OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
939OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
940OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
941OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
942
943# Where does ssh-rand-helper get its randomness from?
944INSTALL_SSH_PRNG_CMDS=""
945if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
946 if test ! -z "$PRNGD_PORT" ; then
947 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
948 elif test ! -z "$PRNGD_SOCKET" ; then
949 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
950 else
951 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
952 RAND_HELPER_CMDHASH=yes
953 INSTALL_SSH_PRNG_CMDS="yes"
954 fi
955fi
956AC_SUBST(INSTALL_SSH_PRNG_CMDS)
957
958
66d6c27e 959# Cheap hack to ensure NEWS-OS libraries are arranged right.
960if test ! -z "$SONY" ; then
961 LIBS="$LIBS -liberty";
962fi
963
a0391976 964# Checks for data types
976f7e19 965AC_CHECK_SIZEOF(char, 1)
2b942fe0 966AC_CHECK_SIZEOF(short int, 2)
967AC_CHECK_SIZEOF(int, 4)
968AC_CHECK_SIZEOF(long int, 4)
969AC_CHECK_SIZEOF(long long int, 8)
970
a0391976 971# More checks for data types
14a9a859 972AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
973 AC_TRY_COMPILE(
974 [ #include <sys/types.h> ],
975 [ u_int a; a = 1;],
976 [ ac_cv_have_u_int="yes" ],
977 [ ac_cv_have_u_int="no" ]
978 )
979])
980if test "x$ac_cv_have_u_int" = "xyes" ; then
981 AC_DEFINE(HAVE_U_INT)
982 have_u_int=1
983fi
984
58d100bf 985AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
986 AC_TRY_COMPILE(
987 [ #include <sys/types.h> ],
988 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
989 [ ac_cv_have_intxx_t="yes" ],
990 [ ac_cv_have_intxx_t="no" ]
991 )
992])
993if test "x$ac_cv_have_intxx_t" = "xyes" ; then
994 AC_DEFINE(HAVE_INTXX_T)
995 have_intxx_t=1
996fi
41cb4569 997
998if (test -z "$have_intxx_t" && \
999 test "x$ac_cv_header_stdint_h" = "xyes")
1000then
1001 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1002 AC_TRY_COMPILE(
1003 [ #include <stdint.h> ],
1004 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1005 [
1006 AC_DEFINE(HAVE_INTXX_T)
1007 AC_MSG_RESULT(yes)
1008 ],
1009 [ AC_MSG_RESULT(no) ]
1010 )
1011fi
1012
bd590612 1013AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1014 AC_TRY_COMPILE(
1015 [ #include <sys/types.h> ],
1016 [ int64_t a; a = 1;],
1017 [ ac_cv_have_int64_t="yes" ],
1018 [ ac_cv_have_int64_t="no" ]
1019 )
1020])
1021if test "x$ac_cv_have_int64_t" = "xyes" ; then
1022 AC_DEFINE(HAVE_INT64_T)
1023 have_int64_t=1
1024fi
1025
41cb4569 1026if test -z "$have_int64_t" ; then
1027 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1028 AC_TRY_COMPILE(
1029 [ #include <sys/socket.h> ],
1030 [ int64_t a; a = 1],
1031 [
1032 AC_DEFINE(HAVE_INT64_T)
1033 AC_MSG_RESULT(yes)
1034 ],
1035 [ AC_MSG_RESULT(no) ]
1036 )
1037fi
1038
58d100bf 1039AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1040 AC_TRY_COMPILE(
1041 [ #include <sys/types.h> ],
1042 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1043 [ ac_cv_have_u_intxx_t="yes" ],
1044 [ ac_cv_have_u_intxx_t="no" ]
1045 )
1046])
1047if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1048 AC_DEFINE(HAVE_U_INTXX_T)
1049 have_u_intxx_t=1
1050fi
2b942fe0 1051
41cb4569 1052if test -z "$have_u_intxx_t" ; then
1053 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1054 AC_TRY_COMPILE(
1055 [ #include <sys/socket.h> ],
1056 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1057 [
1058 AC_DEFINE(HAVE_U_INTXX_T)
1059 AC_MSG_RESULT(yes)
1060 ],
1061 [ AC_MSG_RESULT(no) ]
1062 )
1063fi
1064
bd590612 1065AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1066 AC_TRY_COMPILE(
1067 [ #include <sys/types.h> ],
1068 [ u_int64_t a; a = 1;],
1069 [ ac_cv_have_u_int64_t="yes" ],
1070 [ ac_cv_have_u_int64_t="no" ]
1071 )
1072])
1073if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1074 AC_DEFINE(HAVE_U_INT64_T)
1075 have_u_int64_t=1
1076fi
1077
41cb4569 1078if test -z "$have_u_intxx_t" ; then
1079 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1080 AC_TRY_COMPILE(
1081 [
1082#include <sys/types.h>
1083 ],
1084 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1085 [ ac_cv_have_uintxx_t="yes" ],
1086 [ ac_cv_have_uintxx_t="no" ]
1087 )
1088 ])
1089 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1090 AC_DEFINE(HAVE_UINTXX_T)
1091 fi
1092fi
1093
1094if test -z "$have_uintxx_t" ; then
1095 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1096 AC_TRY_COMPILE(
1097 [ #include <stdint.h> ],
1098 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1099 [
1100 AC_DEFINE(HAVE_UINTXX_T)
1101 AC_MSG_RESULT(yes)
1102 ],
1103 [ AC_MSG_RESULT(no) ]
1104 )
1105fi
1106
e5fe9a1f 1107if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1108 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 1109then
1110 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1111 AC_TRY_COMPILE(
58d100bf 1112 [
1113#include <sys/bitypes.h>
1114 ],
5cdfe03f 1115 [
837c30b8 1116 int8_t a; int16_t b; int32_t c;
1117 u_int8_t e; u_int16_t f; u_int32_t g;
1118 a = b = c = e = f = g = 1;
5cdfe03f 1119 ],
1120 [
1121 AC_DEFINE(HAVE_U_INTXX_T)
1122 AC_DEFINE(HAVE_INTXX_T)
1123 AC_MSG_RESULT(yes)
1124 ],
1125 [AC_MSG_RESULT(no)]
1126 )
1127fi
1128
0362750e 1129
1130AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1131 AC_TRY_COMPILE(
1132 [
1133#include <sys/types.h>
1134 ],
1135 [ u_char foo; foo = 125; ],
1136 [ ac_cv_have_u_char="yes" ],
1137 [ ac_cv_have_u_char="no" ]
1138 )
1139])
1140if test "x$ac_cv_have_u_char" = "xyes" ; then
1141 AC_DEFINE(HAVE_U_CHAR)
1142fi
1143
98a7c37b 1144TYPE_SOCKLEN_T
2b942fe0 1145
58d100bf 1146AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1147 AC_TRY_COMPILE(
1148 [
18ba2aab 1149#include <sys/types.h>
58d100bf 1150 ],
1151 [ size_t foo; foo = 1235; ],
1152 [ ac_cv_have_size_t="yes" ],
1153 [ ac_cv_have_size_t="no" ]
1154 )
1155])
1156if test "x$ac_cv_have_size_t" = "xyes" ; then
1157 AC_DEFINE(HAVE_SIZE_T)
1158fi
ea1970a3 1159
c04f75f1 1160AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1161 AC_TRY_COMPILE(
1162 [
1163#include <sys/types.h>
1164 ],
1165 [ ssize_t foo; foo = 1235; ],
1166 [ ac_cv_have_ssize_t="yes" ],
1167 [ ac_cv_have_ssize_t="no" ]
1168 )
1169])
1170if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1171 AC_DEFINE(HAVE_SSIZE_T)
1172fi
1173
f1c4659d 1174AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1175 AC_TRY_COMPILE(
1176 [
1177#include <time.h>
1178 ],
1179 [ clock_t foo; foo = 1235; ],
1180 [ ac_cv_have_clock_t="yes" ],
1181 [ ac_cv_have_clock_t="no" ]
1182 )
1183])
1184if test "x$ac_cv_have_clock_t" = "xyes" ; then
1185 AC_DEFINE(HAVE_CLOCK_T)
1186fi
1187
1c04b088 1188AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1189 AC_TRY_COMPILE(
1190 [
1191#include <sys/types.h>
1192#include <sys/socket.h>
1193 ],
1194 [ sa_family_t foo; foo = 1235; ],
1195 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 1196 [ AC_TRY_COMPILE(
1197 [
1198#include <sys/types.h>
1199#include <sys/socket.h>
1200#include <netinet/in.h>
1201 ],
1202 [ sa_family_t foo; foo = 1235; ],
1203 [ ac_cv_have_sa_family_t="yes" ],
1204
1c04b088 1205 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 1206 )]
1c04b088 1207 )
1208])
1209if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1210 AC_DEFINE(HAVE_SA_FAMILY_T)
1211fi
1212
729bfe59 1213AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1214 AC_TRY_COMPILE(
1215 [
1216#include <sys/types.h>
1217 ],
1218 [ pid_t foo; foo = 1235; ],
1219 [ ac_cv_have_pid_t="yes" ],
1220 [ ac_cv_have_pid_t="no" ]
1221 )
1222])
1223if test "x$ac_cv_have_pid_t" = "xyes" ; then
1224 AC_DEFINE(HAVE_PID_T)
1225fi
1226
1227AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1228 AC_TRY_COMPILE(
1229 [
1230#include <sys/types.h>
1231 ],
1232 [ mode_t foo; foo = 1235; ],
1233 [ ac_cv_have_mode_t="yes" ],
1234 [ ac_cv_have_mode_t="no" ]
1235 )
1236])
1237if test "x$ac_cv_have_mode_t" = "xyes" ; then
1238 AC_DEFINE(HAVE_MODE_T)
1239fi
1240
e3a93db0 1241
58d100bf 1242AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1243 AC_TRY_COMPILE(
1244 [
18ba2aab 1245#include <sys/types.h>
1246#include <sys/socket.h>
58d100bf 1247 ],
1248 [ struct sockaddr_storage s; ],
1249 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1250 [ ac_cv_have_struct_sockaddr_storage="no" ]
1251 )
1252])
1253if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1254 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1255fi
48e671d5 1256
58d100bf 1257AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1258 AC_TRY_COMPILE(
1259 [
cbd7492e 1260#include <sys/types.h>
58d100bf 1261#include <netinet/in.h>
1262 ],
1263 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1264 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1265 [ ac_cv_have_struct_sockaddr_in6="no" ]
1266 )
1267])
1268if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1269 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1270fi
48e671d5 1271
58d100bf 1272AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1273 AC_TRY_COMPILE(
1274 [
cbd7492e 1275#include <sys/types.h>
58d100bf 1276#include <netinet/in.h>
1277 ],
1278 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1279 [ ac_cv_have_struct_in6_addr="yes" ],
1280 [ ac_cv_have_struct_in6_addr="no" ]
1281 )
1282])
1283if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1284 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1285fi
48e671d5 1286
58d100bf 1287AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1288 AC_TRY_COMPILE(
1289 [
18ba2aab 1290#include <sys/types.h>
1291#include <sys/socket.h>
1292#include <netdb.h>
58d100bf 1293 ],
1294 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1295 [ ac_cv_have_struct_addrinfo="yes" ],
1296 [ ac_cv_have_struct_addrinfo="no" ]
1297 )
1298])
1299if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1300 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1301fi
1302
89c7e31c 1303AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1304 AC_TRY_COMPILE(
1305 [ #include <sys/time.h> ],
1306 [ struct timeval tv; tv.tv_sec = 1;],
1307 [ ac_cv_have_struct_timeval="yes" ],
1308 [ ac_cv_have_struct_timeval="no" ]
1309 )
1310])
1311if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1312 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1313 have_struct_timeval=1
1314fi
1315
2c523de9 1316# If we don't have int64_t then we can't compile sftp-server. So don't
1317# even attempt to do it.
1318if test "x$ac_cv_have_int64_t" = "xno" -a \
1319 "x$ac_cv_sizeof_long_int" != "x8" -a \
1320 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1321 NO_SFTP='#'
733cf7f4 1322else
1323dnl test snprintf (broken on SCO w/gcc)
1324 AC_TRY_RUN(
1325 [
1326#include <stdio.h>
1327#include <string.h>
1328#ifdef HAVE_SNPRINTF
1329main()
1330{
1331 char buf[50];
1332 char expected_out[50];
1333 int mazsize = 50 ;
1334#if (SIZEOF_LONG_INT == 8)
1335 long int num = 0x7fffffffffffffff;
1336#else
763a1a18 1337 long long num = 0x7fffffffffffffffll;
733cf7f4 1338#endif
1339 strcpy(expected_out, "9223372036854775807");
1340 snprintf(buf, mazsize, "%lld", num);
1341 if(strcmp(buf, expected_out) != 0)
1342 exit(1);
1343 exit(0);
1344}
1345#else
1346main() { exit(0); }
1347#endif
1348 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1349 )
2c523de9 1350fi
89c7e31c 1351AC_SUBST(NO_SFTP)
2c523de9 1352
77bb0bca 1353dnl Checks for structure members
58d100bf 1354OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1355OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1356OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1357OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1358OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 1359OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 1360OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1361OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 1362OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 1363OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1364OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1365OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1366OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 1367OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1368OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1369OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1370OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 1371
1372AC_CHECK_MEMBERS([struct stat.st_blksize])
1d7b9b20 1373
58d100bf 1374AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1375 ac_cv_have_ss_family_in_struct_ss, [
1376 AC_TRY_COMPILE(
1377 [
18ba2aab 1378#include <sys/types.h>
1379#include <sys/socket.h>
58d100bf 1380 ],
1381 [ struct sockaddr_storage s; s.ss_family = 1; ],
1382 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1383 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1384 )
1385])
1386if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1387 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1388fi
1389
58d100bf 1390AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1391 ac_cv_have___ss_family_in_struct_ss, [
1392 AC_TRY_COMPILE(
1393 [
18ba2aab 1394#include <sys/types.h>
1395#include <sys/socket.h>
58d100bf 1396 ],
1397 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1398 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1399 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1400 )
1401])
1402if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1403 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1404fi
1405
2e73a022 1406AC_CACHE_CHECK([for pw_class field in struct passwd],
1407 ac_cv_have_pw_class_in_struct_passwd, [
1408 AC_TRY_COMPILE(
1409 [
2e73a022 1410#include <pwd.h>
1411 ],
97994d32 1412 [ struct passwd p; p.pw_class = 0; ],
2e73a022 1413 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1414 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1415 )
1416])
1417if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1418 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1419fi
1420
7751d4eb 1421AC_CACHE_CHECK([for pw_expire field in struct passwd],
1422 ac_cv_have_pw_expire_in_struct_passwd, [
1423 AC_TRY_COMPILE(
1424 [
1425#include <pwd.h>
1426 ],
1427 [ struct passwd p; p.pw_expire = 0; ],
1428 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1429 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1430 )
1431])
1432if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1433 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1434fi
1435
1436AC_CACHE_CHECK([for pw_change field in struct passwd],
1437 ac_cv_have_pw_change_in_struct_passwd, [
1438 AC_TRY_COMPILE(
1439 [
1440#include <pwd.h>
1441 ],
1442 [ struct passwd p; p.pw_change = 0; ],
1443 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1444 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1445 )
1446])
1447if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1448 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1449fi
58d100bf 1450
1451AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1452 AC_TRY_LINK([],
1453 [ extern char *__progname; printf("%s", __progname); ],
1454 [ ac_cv_libc_defines___progname="yes" ],
1455 [ ac_cv_libc_defines___progname="no" ]
1456 )
1457])
1458if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1459 AC_DEFINE(HAVE___PROGNAME)
1460fi
8946db53 1461
1812a662 1462AC_CACHE_CHECK([whether getopt has optreset support],
1463 ac_cv_have_getopt_optreset, [
1464 AC_TRY_LINK(
1465 [
1466#include <getopt.h>
1467 ],
1468 [ extern int optreset; optreset = 0; ],
1469 [ ac_cv_have_getopt_optreset="yes" ],
1470 [ ac_cv_have_getopt_optreset="no" ]
1471 )
1472])
1473if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1474 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1475fi
a0391976 1476
819b676f 1477AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1478 AC_TRY_LINK([],
1479 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1480 [ ac_cv_libc_defines_sys_errlist="yes" ],
1481 [ ac_cv_libc_defines_sys_errlist="no" ]
1482 )
1483])
1484if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1485 AC_DEFINE(HAVE_SYS_ERRLIST)
1486fi
1487
1488
416ed5a7 1489AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1490 AC_TRY_LINK([],
1491 [ extern int sys_nerr; printf("%i", sys_nerr);],
1492 [ ac_cv_libc_defines_sys_nerr="yes" ],
1493 [ ac_cv_libc_defines_sys_nerr="no" ]
1494 )
1495])
1496if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1497 AC_DEFINE(HAVE_SYS_NERR)
1498fi
1499
1500
d0b19c95 1501# Check whether user wants Kerberos support
1502SCARD_MSG="no"
1503AC_ARG_WITH(smartcard,
1504 [ --with-smartcard Enable smartcard support],
1505 [
1506 if test "x$withval" != "xno" ; then
1507 if test "x$withval" != "xyes" ; then
1508 CPPFLAGS="$CPPFLAGS -I${withval}"
1509 LDFLAGS="$LDFLAGS -L${withval}"
1510 if test ! -z "$need_dash_r" ; then
1511 LDFLAGS="$LDFLAGS -R${withval}"
1512 fi
1513 if test ! -z "$blibpath" ; then
1514 blibpath="$blibpath:${withval}"
1515 fi
1516 fi
1517 AC_CHECK_HEADERS(sectok.h)
1518 if test "$ac_cv_header_sectok_h" != yes; then
1519 AC_MSG_ERROR(Can't find sectok.h)
1520 fi
1521 AC_CHECK_LIB(sectok, sectok_open)
1522 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1523 AC_MSG_ERROR(Can't find libsectok)
1524 fi
1525 AC_DEFINE(SMARTCARD)
1526 SCARD_MSG="yes"
1527 fi
1528 ]
1529)
1530
b5b68128 1531# Check whether user wants Kerberos support
1532KRB4_MSG="no"
1533AC_ARG_WITH(kerberos4,
1534 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1535 [
1536 if test "x$withval" != "xno" ; then
b5b68128 1537 if test "x$withval" != "xyes" ; then
1538 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1539 LDFLAGS="$LDFLAGS -L${withval}/lib"
1540 if test ! -z "$need_dash_r" ; then
1541 LDFLAGS="$LDFLAGS -R${withval}/lib"
1542 fi
1543 if test ! -z "$blibpath" ; then
1544 blibpath="$blibpath:${withval}/lib"
1545 fi
1546 else
1547 if test -d /usr/include/kerberosIV ; then
1548 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1549 fi
1550 fi
1551
1552 AC_CHECK_HEADERS(krb.h)
b5b68128 1553 if test "$ac_cv_header_krb_h" != yes; then
1554 AC_MSG_WARN([Cannot find krb.h, build may fail])
1555 fi
cccfea16 1556 AC_CHECK_LIB(krb, main)
b5b68128 1557 if test "$ac_cv_lib_krb_main" != yes; then
cccfea16 1558 AC_CHECK_LIB(krb4, main)
1559 if test "$ac_cv_lib_krb4_main" != yes; then
1560 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1561 else
1562 KLIBS="-lkrb4"
1563 fi
1564 else
1565 KLIBS="-lkrb"
1566 fi
1567 AC_CHECK_LIB(des, des_cbc_encrypt)
1568 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1569 AC_CHECK_LIB(des425, des_cbc_encrypt)
1570 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1571 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1572 else
1573 KLIBS="-ldes425"
1574 fi
1575 else
1576 KLIBS="-ldes"
b5b68128 1577 fi
b5b68128 1578 AC_CHECK_LIB(resolv, dn_expand, , )
1579 KRB4=yes
1580 KRB4_MSG="yes"
1581 AC_DEFINE(KRB4)
1582 fi
1583 ]
1584)
1585
1586# Check whether user wants AFS support
1587AFS_MSG="no"
1588AC_ARG_WITH(afs,
1589 [ --with-afs=PATH Enable AFS support],
1590 [
1591 if test "x$withval" != "xno" ; then
1592
1593 if test "x$withval" != "xyes" ; then
1594 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1595 LDFLAGS="$LDFLAGS -L${withval}/lib"
1596 fi
1597
1598 if test -z "$KRB4" ; then
1599 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1600 fi
1601
1602 LIBS="-lkafs $LIBS"
1603 if test ! -z "$AFS_LIBS" ; then
1604 LIBS="$LIBS $AFS_LIBS"
1605 fi
1606 AC_DEFINE(AFS)
1607 AFS_MSG="yes"
1608 fi
1609 ]
1610)
1611LIBS="$LIBS $KLIBS"
1612
a0391976 1613# Looking for programs, paths and files
1614AC_ARG_WITH(rsh,
1615 [ --with-rsh=PATH Specify path to remote shell program ],
1616 [
bcf36c78 1617 if test "x$withval" != "$no" ; then
7a33f831 1618 rsh_path=$withval
a0391976 1619 fi
1620 ],
1621 [
1622 AC_PATH_PROG(rsh_path, rsh)
1623 ]
1624)
1625
1626AC_ARG_WITH(xauth,
1627 [ --with-xauth=PATH Specify path to xauth program ],
1628 [
00937921 1629 if test "x$withval" != "xno" ; then
cbd7492e 1630 xauth_path=$withval
a0391976 1631 fi
1632 ],
1633 [
77bb0bca 1634 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
e5fe9a1f 1635 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 1636 xauth_path="/usr/openwin/bin/xauth"
1637 fi
1638 ]
1639)
1640
b3ec54b4 1641if test -z "$xauth_path" ; then
1642 XAUTH_PATH="undefined"
1643 AC_SUBST(XAUTH_PATH)
1644else
a0391976 1645 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
b3ec54b4 1646 XAUTH_PATH=$xauth_path
1647 AC_SUBST(XAUTH_PATH)
a0391976 1648fi
1649if test ! -z "$rsh_path" ; then
1650 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1651fi
1652
1653# Check for mail directory (last resort if we cannot get it from headers)
1654if test ! -z "$MAIL" ; then
1655 maildir=`dirname $MAIL`
1656 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1657fi
1658
a0391976 1659if test -z "$no_dev_ptmx" ; then
3276571c 1660 AC_CHECK_FILE("/dev/ptmx",
1661 [
1662 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1663 have_dev_ptmx=1
1664 ]
1665 )
1666fi
1667AC_CHECK_FILE("/dev/ptc",
1668 [
1669 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1670 have_dev_ptc=1
1671 ]
1672)
1673
a0391976 1674# Options from here on. Some of these are preset by platform above
fdf6b7aa 1675AC_ARG_WITH(mantype,
5d97cfbf 1676 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 1677 [
5d97cfbf 1678 case "$withval" in
1679 man|cat|doc)
1680 MANTYPE=$withval
1681 ;;
1682 *)
1683 AC_MSG_ERROR(invalid man type: $withval)
1684 ;;
1685 esac
c54a6257 1686 ]
1687)
e0c4d3ac 1688if test -z "$MANTYPE"; then
533875af 1689 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
e0c4d3ac 1690 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1691 MANTYPE=doc
1692 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1693 MANTYPE=man
1694 else
1695 MANTYPE=cat
1696 fi
1697fi
c54a6257 1698AC_SUBST(MANTYPE)
e0c4d3ac 1699if test "$MANTYPE" = "doc"; then
1700 mansubdir=man;
1701else
1702 mansubdir=$MANTYPE;
1703fi
1704AC_SUBST(mansubdir)
0bc5b6fb 1705
a0391976 1706# Check whether to enable MD5 passwords
cbd7492e 1707MD5_MSG="no"
2ddcfdf3 1708AC_ARG_WITH(md5-passwords,
caf3bc51 1709 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 1710 [
bcf36c78 1711 if test "x$withval" != "xno" ; then
0bc5b6fb 1712 AC_DEFINE(HAVE_MD5_PASSWORDS)
cbd7492e 1713 MD5_MSG="yes"
0bc5b6fb 1714 fi
1715 ]
caf3bc51 1716)
1717
a0391976 1718# Whether to disable shadow password support
a7effaac 1719AC_ARG_WITH(shadow,
1720 [ --without-shadow Disable shadow password support],
1721 [
1722 if test "x$withval" = "xno" ; then
1723 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 1724 disable_shadow=yes
a7effaac 1725 fi
1726 ]
1727)
1728
4cb5ffa0 1729if test -z "$disable_shadow" ; then
1730 AC_MSG_CHECKING([if the systems has expire shadow information])
1731 AC_TRY_COMPILE(
1732 [
1733#include <sys/types.h>
1734#include <shadow.h>
1735 struct spwd sp;
1736 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1737 [ sp_expire_available=yes ], []
1738 )
1739
1740 if test "x$sp_expire_available" = "xyes" ; then
1741 AC_MSG_RESULT(yes)
1742 AC_DEFINE(HAS_SHADOW_EXPIRE)
1743 else
1744 AC_MSG_RESULT(no)
1745 fi
1746fi
1747
a0391976 1748# Use ip address instead of hostname in $DISPLAY
44839801 1749if test ! -z "$IPADDR_IN_DISPLAY" ; then
1750 DISPLAY_HACK_MSG="yes"
1751 AC_DEFINE(IPADDR_IN_DISPLAY)
1752else
1753 DISPLAY_HACK_MSG="no"
1754 AC_ARG_WITH(ipaddr-display,
1755 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1756 [
1757 if test "x$withval" != "xno" ; then
1758 AC_DEFINE(IPADDR_IN_DISPLAY)
1759 DISPLAY_HACK_MSG="yes"
1760 fi
1761 ]
1762 )
1763fi
a7effaac 1764
a0391976 1765# Whether to mess with the default path
cbd7492e 1766SERVER_PATH_MSG="(default)"
c43d69a9 1767AC_ARG_WITH(default-path,
cb807f40 1768 [ --with-default-path=PATH Specify default \$PATH environment for server],
1769 [
1770 if test "x$withval" != "xno" ; then
b2d818e6 1771 user_path="$withval"
cbd7492e 1772 SERVER_PATH_MSG="$withval"
cb807f40 1773 fi
b2d818e6 1774 ],
1775 [
1776 AC_TRY_RUN(
1777 [
1778/* find out what STDPATH is */
1779#include <stdio.h>
b2d818e6 1780#ifdef HAVE_PATHS_H
1781# include <paths.h>
1782#endif
1783#ifndef _PATH_STDPATH
1784# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1785#endif
1786#include <sys/types.h>
1787#include <sys/stat.h>
1788#include <fcntl.h>
1789#define DATA "conftest.stdpath"
1790
1791main()
1792{
1793 FILE *fd;
1794 int rc;
1795
1796 fd = fopen(DATA,"w");
1797 if(fd == NULL)
1798 exit(1);
1799
1800 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1801 exit(1);
1802
1803 exit(0);
1804}
1805 ], [ user_path=`cat conftest.stdpath` ],
1806 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1807 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1808 )
1809# make sure $bindir is in USER_PATH so scp will work
1810 t_bindir=`eval echo ${bindir}`
1811 case $t_bindir in
1812 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1813 esac
1814 case $t_bindir in
1815 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1816 esac
1817 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1818 if test $? -ne 0 ; then
1819 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1820 if test $? -ne 0 ; then
1821 user_path=$user_path:$t_bindir
1822 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1823 fi
1824 fi
cb807f40 1825 ]
1826)
b2d818e6 1827AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1828AC_SUBST(user_path)
cb807f40 1829
a0391976 1830# Whether to force IPv4 by default (needed on broken glibc Linux)
cbd7492e 1831IPV4_HACK_MSG="no"
59e76f33 1832AC_ARG_WITH(ipv4-default,
1833 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1834 [
1835 if test "x$withval" != "xno" ; then
1836 AC_DEFINE(IPV4_DEFAULT)
cbd7492e 1837 IPV4_HACK_MSG="yes"
59e76f33 1838 fi
1839 ]
1840)
1841
58d100bf 1842AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
cbd7492e 1843IPV4_IN6_HACK_MSG="no"
80faa19f 1844AC_ARG_WITH(4in6,
1845 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1846 [
1847 if test "x$withval" != "xno" ; then
1848 AC_MSG_RESULT(yes)
1849 AC_DEFINE(IPV4_IN_IPV6)
cbd7492e 1850 IPV4_IN6_HACK_MSG="yes"
80faa19f 1851 else
1852 AC_MSG_RESULT(no)
1853 fi
1854 ],[
1855 if test "x$inet6_default_4in6" = "xyes"; then
1856 AC_MSG_RESULT([yes (default)])
1857 AC_DEFINE(IPV4_IN_IPV6)
cbd7492e 1858 IPV4_IN6_HACK_MSG="yes"
80faa19f 1859 else
1860 AC_MSG_RESULT([no (default)])
1861 fi
1862 ]
1863)
1864
af774732 1865# Whether to enable BSD auth support
f1b0ecc3 1866BSD_AUTH_MSG=no
af774732 1867AC_ARG_WITH(bsd-auth,
1868 [ --with-bsd-auth Enable BSD auth support],
1869 [
1870 if test "x$withval" != "xno" ; then
1871 AC_DEFINE(BSD_AUTH)
f1b0ecc3 1872 BSD_AUTH_MSG=yes
af774732 1873 fi
1874 ]
1875)
1876
77bb0bca 1877AC_MSG_CHECKING(whether to install ssh as suid root)
1878AC_ARG_ENABLE(suid-ssh,
1879[ --enable-suid-ssh Install ssh as suid root (default)
1880 --disable-suid-ssh Install ssh without suid bit],
1881[ case "$enableval" in
1882 no)
1883 AC_MSG_RESULT(no)
1884 SSHMODE=0711
1885 ;;
1886 *) AC_MSG_RESULT(yes)
0b7d19eb 1887 SSHMODE=4711
77bb0bca 1888 ;;
1889 esac ],
1890 AC_MSG_RESULT(yes)
0b7d19eb 1891 SSHMODE=4711
77bb0bca 1892)
1893AC_SUBST(SSHMODE)
1894
1895
a0391976 1896# Where to place sshd.pid
19d9ac2a 1897piddir=/var/run
47e45e44 1898AC_ARG_WITH(pid-dir,
1899 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1900 [
1901 if test "x$withval" != "xno" ; then
19d9ac2a 1902 piddir=$withval
47e45e44 1903 fi
1904 ]
1905)
b7a87eea 1906
77bb0bca 1907# make sure the directory exists
1908if test ! -d $piddir ; then
1909 piddir=`eval echo ${sysconfdir}`
1910 case $piddir in
1911 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1912 esac
1913fi
1914
42f11eb2 1915AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
19d9ac2a 1916AC_SUBST(piddir)
47e45e44 1917
1d7b9b20 1918dnl allow user to disable some login recording features
1919AC_ARG_ENABLE(lastlog,
bfd550a2 1920 [ --disable-lastlog disable use of lastlog even if detected [no]],
1d7b9b20 1921 [ AC_DEFINE(DISABLE_LASTLOG) ]
1922)
1923AC_ARG_ENABLE(utmp,
bfd550a2 1924 [ --disable-utmp disable use of utmp even if detected [no]],
1d7b9b20 1925 [ AC_DEFINE(DISABLE_UTMP) ]
1926)
1927AC_ARG_ENABLE(utmpx,
bfd550a2 1928 [ --disable-utmpx disable use of utmpx even if detected [no]],
1d7b9b20 1929 [ AC_DEFINE(DISABLE_UTMPX) ]
1930)
1931AC_ARG_ENABLE(wtmp,
bfd550a2 1932 [ --disable-wtmp disable use of wtmp even if detected [no]],
1d7b9b20 1933 [ AC_DEFINE(DISABLE_WTMP) ]
1934)
1935AC_ARG_ENABLE(wtmpx,
bfd550a2 1936 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1d7b9b20 1937 [ AC_DEFINE(DISABLE_WTMPX) ]
1938)
1939AC_ARG_ENABLE(libutil,
bfd550a2 1940 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1d7b9b20 1941 [ AC_DEFINE(DISABLE_LOGIN) ]
1942)
1943AC_ARG_ENABLE(pututline,
bfd550a2 1944 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1d7b9b20 1945 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1946)
1947AC_ARG_ENABLE(pututxline,
bfd550a2 1948 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1d7b9b20 1949 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1950)
1951AC_ARG_WITH(lastlog,
bfd550a2 1952 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 1953 [
1954 if test "x$withval" = "xno" ; then
1955 AC_DEFINE(DISABLE_LASTLOG)
1956 else
1957 conf_lastlog_location=$withval
1958 fi
1959 ]
1960)
1d7b9b20 1961
1962dnl lastlog, [uw]tmpx? detection
1963dnl NOTE: set the paths in the platform section to avoid the
1964dnl need for command-line parameters
1965dnl lastlog and [uw]tmp are subject to a file search if all else fails
1966
1967dnl lastlog detection
1968dnl NOTE: the code itself will detect if lastlog is a directory
1969AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1970AC_TRY_COMPILE([
1971#include <sys/types.h>
1972#include <utmp.h>
1973#ifdef HAVE_LASTLOG_H
1974# include <lastlog.h>
1975#endif
d7c0f3d5 1976#ifdef HAVE_PATHS_H
1d7b9b20 1977# include <paths.h>
41cb4569 1978#endif
1979#ifdef HAVE_LOGIN_H
1980# include <login.h>
1d7b9b20 1981#endif
1982 ],
1983 [ char *lastlog = LASTLOG_FILE; ],
1984 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 1985 [
1986 AC_MSG_RESULT(no)
1987 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1988 AC_TRY_COMPILE([
1989#include <sys/types.h>
1990#include <utmp.h>
1991#ifdef HAVE_LASTLOG_H
1992# include <lastlog.h>
1993#endif
1994#ifdef HAVE_PATHS_H
1995# include <paths.h>
1996#endif
1997 ],
1998 [ char *lastlog = _PATH_LASTLOG; ],
1999 [ AC_MSG_RESULT(yes) ],
2000 [
f282b668 2001 AC_MSG_RESULT(no)
d7c0f3d5 2002 system_lastlog_path=no
2003 ])
2004 ]
1d7b9b20 2005)
d7c0f3d5 2006
1d7b9b20 2007if test -z "$conf_lastlog_location"; then
2008 if test x"$system_lastlog_path" = x"no" ; then
2009 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 2010 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 2011 conf_lastlog_location=$f
2012 fi
2013 done
2014 if test -z "$conf_lastlog_location"; then
f8119cef 2015 AC_MSG_WARN([** Cannot find lastlog **])
2016 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 2017 fi
2018 fi
2019fi
2020
2021if test -n "$conf_lastlog_location"; then
2022 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2023fi
2024
2025dnl utmp detection
2026AC_MSG_CHECKING([if your system defines UTMP_FILE])
2027AC_TRY_COMPILE([
2028#include <sys/types.h>
2029#include <utmp.h>
d7c0f3d5 2030#ifdef HAVE_PATHS_H
1d7b9b20 2031# include <paths.h>
2032#endif
2033 ],
2034 [ char *utmp = UTMP_FILE; ],
2035 [ AC_MSG_RESULT(yes) ],
2036 [ AC_MSG_RESULT(no)
2037 system_utmp_path=no ]
2038)
2039if test -z "$conf_utmp_location"; then
2040 if test x"$system_utmp_path" = x"no" ; then
2041 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2042 if test -f $f ; then
2043 conf_utmp_location=$f
2044 fi
2045 done
2046 if test -z "$conf_utmp_location"; then
2047 AC_DEFINE(DISABLE_UTMP)
2048 fi
2049 fi
2050fi
2051if test -n "$conf_utmp_location"; then
2052 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2053fi
2054
2055dnl wtmp detection
2056AC_MSG_CHECKING([if your system defines WTMP_FILE])
2057AC_TRY_COMPILE([
2058#include <sys/types.h>
2059#include <utmp.h>
d7c0f3d5 2060#ifdef HAVE_PATHS_H
1d7b9b20 2061# include <paths.h>
2062#endif
2063 ],
2064 [ char *wtmp = WTMP_FILE; ],
2065 [ AC_MSG_RESULT(yes) ],
2066 [ AC_MSG_RESULT(no)
2067 system_wtmp_path=no ]
2068)
2069if test -z "$conf_wtmp_location"; then
2070 if test x"$system_wtmp_path" = x"no" ; then
2071 for f in /usr/adm/wtmp /var/log/wtmp; do
2072 if test -f $f ; then
2073 conf_wtmp_location=$f
2074 fi
2075 done
2076 if test -z "$conf_wtmp_location"; then
2077 AC_DEFINE(DISABLE_WTMP)
2078 fi
2079 fi
2080fi
2081if test -n "$conf_wtmp_location"; then
2082 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2083fi
2084
2085
2086dnl utmpx detection - I don't know any system so perverse as to require
2087dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2088dnl there, though.
2089AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2090AC_TRY_COMPILE([
2091#include <sys/types.h>
2092#include <utmp.h>
2093#ifdef HAVE_UTMPX_H
2094#include <utmpx.h>
2095#endif
d7c0f3d5 2096#ifdef HAVE_PATHS_H
1d7b9b20 2097# include <paths.h>
2098#endif
2099 ],
2100 [ char *utmpx = UTMPX_FILE; ],
2101 [ AC_MSG_RESULT(yes) ],
2102 [ AC_MSG_RESULT(no)
2103 system_utmpx_path=no ]
2104)
2105if test -z "$conf_utmpx_location"; then
2106 if test x"$system_utmpx_path" = x"no" ; then
2107 AC_DEFINE(DISABLE_UTMPX)
2108 fi
2109else
2110 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2111fi
2112
2113dnl wtmpx detection
2114AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2115AC_TRY_COMPILE([
2116#include <sys/types.h>
2117#include <utmp.h>
2118#ifdef HAVE_UTMPX_H
2119#include <utmpx.h>
2120#endif
d7c0f3d5 2121#ifdef HAVE_PATHS_H
1d7b9b20 2122# include <paths.h>
2123#endif
2124 ],
2125 [ char *wtmpx = WTMPX_FILE; ],
2126 [ AC_MSG_RESULT(yes) ],
2127 [ AC_MSG_RESULT(no)
2128 system_wtmpx_path=no ]
2129)
2130if test -z "$conf_wtmpx_location"; then
2131 if test x"$system_wtmpx_path" = x"no" ; then
2132 AC_DEFINE(DISABLE_WTMPX)
2133 fi
2134else
2135 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2136fi
2137
b7a87eea 2138
bd499f9e 2139if test ! -z "$blibpath" ; then
2140 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2141 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2142fi
2143
3c62e7eb 2144AC_EXEEXT
98a7c37b 2145AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2146AC_OUTPUT
d3083fbd 2147
cbd7492e 2148# Print summary of options
2149
cbd7492e 2150# Someone please show me a better way :)
2151A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2152B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2153C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2154D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 2155E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 2156F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 2157G=`eval echo ${piddir}` ; G=`eval echo ${G}`
b2d818e6 2158H=`eval echo ${user_path}` ; H=`eval echo ${H}`
cbd7492e 2159
2160echo ""
26de7942 2161echo "OpenSSH has been configured with the following options:"
cbd7492e 2162echo " User binaries: $B"
2163echo " System binaries: $C"
2164echo " Configuration files: $D"
2165echo " Askpass program: $E"
2166echo " Manual pages: $F"
2167echo " PID file: $G"
b2d818e6 2168echo " sshd default user PATH: $H"
5d97cfbf 2169echo " Manpage format: $MANTYPE"
cbd7492e 2170echo " PAM support: ${PAM_MSG}"
2171echo " KerberosIV support: $KRB4_MSG"
d0b19c95 2172echo " Smartcard support: $SCARD_MSG"
cbd7492e 2173echo " AFS support: $AFS_MSG"
2174echo " S/KEY support: $SKEY_MSG"
2175echo " TCP Wrappers support: $TCPW_MSG"
2176echo " MD5 password support: $MD5_MSG"
2177echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2178echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2179echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
f1b0ecc3 2180echo " BSD Auth support: $BSD_AUTH_MSG"
2181echo " Random number source: $RAND_MSG"
2182if test ! -z "$USE_RAND_HELPER" ; then
2183 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 2184fi
2185
cbd7492e 2186echo ""
2187
0c2fb82f 2188echo " Host: ${host}"
2189echo " Compiler: ${CC}"
2190echo " Compiler flags: ${CFLAGS}"
2191echo "Preprocessor flags: ${CPPFLAGS}"
2192echo " Linker flags: ${LDFLAGS}"
2193echo " Libraries: ${LIBS}"
cbd7492e 2194
2195echo ""
2196
adeebd37 2197if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 2198 echo "PAM is enabled. You may need to install a PAM control file "
2199 echo "for sshd, otherwise password authentication may fail. "
2200 echo "Example PAM control files can be found in the contrib/ "
2201 echo "subdirectory"
adeebd37 2202 echo ""
2203fi
2204
f1b0ecc3 2205if test ! -z "$NO_SFTP"; then
2206 echo "sftp-server will be disabled. Your compiler does not "
2207 echo "support 64bit integers."
48e7916f 2208 echo ""
2209fi
2c523de9 2210
f1b0ecc3 2211if test ! -z "$RAND_HELPER_CMDHASH" ; then
2212 echo "WARNING: you are using the builtin random number collection "
2213 echo "service. Please read WARNING.RNG and request that your OS "
2214 echo "vendor includes kernel-based random number collection in "
2215 echo "future versions of your OS."
2c523de9 2216 echo ""
2217fi
af774732 2218
This page took 0.762033 seconds and 5 git commands to generate.