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