]> andersk Git - openssh.git/blame - configure.ac
more
[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
9780116c 815# Sanity check OpenSSL headers
816AC_MSG_CHECKING([whether OpenSSL's headers match the library])
817AC_TRY_RUN(
818 [
819#include <string.h>
820#include <openssl/opensslv.h>
821int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
822 ],
823 [
824 AC_MSG_RESULT(yes)
825 ],
826 [
827 AC_MSG_RESULT(no)
828 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
829 ]
830)
831
717057b6 832# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
833# version in OpenSSL. Skip this for PAM
834if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
20cad736 835 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 836fi
837
f1b0ecc3 838
839### Configure cryptographic random number support
840
841# Check wheter OpenSSL seeds itself
842AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
843AC_TRY_RUN(
844 [
845#include <string.h>
846#include <openssl/rand.h>
847int main(void) { return(RAND_status() == 1 ? 0 : 1); }
848 ],
849 [
850 OPENSSL_SEEDS_ITSELF=yes
851 AC_MSG_RESULT(yes)
852 ],
853 [
854 AC_MSG_RESULT(no)
855 # Default to use of the rand helper if OpenSSL doesn't
856 # seed itself
857 USE_RAND_HELPER=yes
858 ]
859)
860
861
862# Do we want to force the use of the rand helper?
863AC_ARG_WITH(rand-helper,
864 [ --with-rand-helper Use subprocess to gather strong randomness ],
865 [
866 if test "x$withval" = "xno" ; then
867 # Force use of OpenSSL's internal RNG, even if
868 # the previous test showed it to be unseeded.
869 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
870 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
871 OPENSSL_SEEDS_ITSELF=yes
872 USE_RAND_HELPER=""
873 fi
874 else
875 USE_RAND_HELPER=yes
876 fi
877 ],
878)
879
880# Which randomness source do we use?
881if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
882 # OpenSSL only
883 AC_DEFINE(OPENSSL_PRNG_ONLY)
884 RAND_MSG="OpenSSL internal ONLY"
885 INSTALL_SSH_RAND_HELPER=""
886elif test ! -z "$OPENSSL_SEEDS_ITSELF" -a ! -z "$USE_RAND_HELPER" ; then
887 # OpenSSL with fallback to rand helper
888 RAND_MSG="ssh-rand-helper"
889 INSTALL_SSH_RAND_HELPER="yes"
890fi
891AC_SUBST(INSTALL_SSH_RAND_HELPER)
892
893### Configuration of ssh-rand-helper
894
895# PRNGD TCP socket
896AC_ARG_WITH(prngd-port,
897 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
898 [
899 if test ! -z "$withval" -a "x$withval" != "xno" ; then
900 PRNGD_PORT="$withval"
901 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
902 fi
903 ]
904)
905
906# PRNGD Unix domain socket
907AC_ARG_WITH(prngd-socket,
908 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
909 [
910 if test -z "$withval" ; then
911 withval="/var/run/egd-pool"
912 fi
913 if test "x$withval" != "xno" ; then
914 if test ! -z "$PRNGD_PORT" ; then
915 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
916 fi
917 if ! echo "$withval" | grep -q '^/' ; then
918 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
919 fi
920 if ! test -r "$withval" ; then
921 AC_MSG_WARN(Entropy socket is not readable)
922 fi
923 PRNGD_SOCKET="$withval"
924 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
925 fi
926 ]
927)
928
929# Change default command timeout for hashing entropy source
930entropy_timeout=200
931AC_ARG_WITH(entropy-timeout,
932 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
933 [
934 if test "x$withval" != "xno" ; then
935 entropy_timeout=$withval
936 fi
937 ]
938)
939
940AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
941
942# These programs are used by the command hashing source to gather entropy
943OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
944OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
945OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
946OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
947OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
948OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
949OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
950OSSH_PATH_ENTROPY_PROG(PROG_W, w)
951OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
952OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
953OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
954OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
955OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
956OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
957OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
958OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
959
960# Where does ssh-rand-helper get its randomness from?
961INSTALL_SSH_PRNG_CMDS=""
962if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
963 if test ! -z "$PRNGD_PORT" ; then
964 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
965 elif test ! -z "$PRNGD_SOCKET" ; then
966 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
967 else
968 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
969 RAND_HELPER_CMDHASH=yes
970 INSTALL_SSH_PRNG_CMDS="yes"
971 fi
972fi
973AC_SUBST(INSTALL_SSH_PRNG_CMDS)
974
975
66d6c27e 976# Cheap hack to ensure NEWS-OS libraries are arranged right.
977if test ! -z "$SONY" ; then
978 LIBS="$LIBS -liberty";
979fi
980
a0391976 981# Checks for data types
976f7e19 982AC_CHECK_SIZEOF(char, 1)
2b942fe0 983AC_CHECK_SIZEOF(short int, 2)
984AC_CHECK_SIZEOF(int, 4)
985AC_CHECK_SIZEOF(long int, 4)
986AC_CHECK_SIZEOF(long long int, 8)
987
a0391976 988# More checks for data types
14a9a859 989AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
990 AC_TRY_COMPILE(
991 [ #include <sys/types.h> ],
992 [ u_int a; a = 1;],
993 [ ac_cv_have_u_int="yes" ],
994 [ ac_cv_have_u_int="no" ]
995 )
996])
997if test "x$ac_cv_have_u_int" = "xyes" ; then
998 AC_DEFINE(HAVE_U_INT)
999 have_u_int=1
1000fi
1001
58d100bf 1002AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1003 AC_TRY_COMPILE(
1004 [ #include <sys/types.h> ],
1005 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1006 [ ac_cv_have_intxx_t="yes" ],
1007 [ ac_cv_have_intxx_t="no" ]
1008 )
1009])
1010if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1011 AC_DEFINE(HAVE_INTXX_T)
1012 have_intxx_t=1
1013fi
41cb4569 1014
1015if (test -z "$have_intxx_t" && \
1016 test "x$ac_cv_header_stdint_h" = "xyes")
1017then
1018 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1019 AC_TRY_COMPILE(
1020 [ #include <stdint.h> ],
1021 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1022 [
1023 AC_DEFINE(HAVE_INTXX_T)
1024 AC_MSG_RESULT(yes)
1025 ],
1026 [ AC_MSG_RESULT(no) ]
1027 )
1028fi
1029
bd590612 1030AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1031 AC_TRY_COMPILE(
1032 [ #include <sys/types.h> ],
1033 [ int64_t a; a = 1;],
1034 [ ac_cv_have_int64_t="yes" ],
1035 [ ac_cv_have_int64_t="no" ]
1036 )
1037])
1038if test "x$ac_cv_have_int64_t" = "xyes" ; then
1039 AC_DEFINE(HAVE_INT64_T)
1040 have_int64_t=1
1041fi
1042
41cb4569 1043if test -z "$have_int64_t" ; then
1044 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1045 AC_TRY_COMPILE(
1046 [ #include <sys/socket.h> ],
1047 [ int64_t a; a = 1],
1048 [
1049 AC_DEFINE(HAVE_INT64_T)
1050 AC_MSG_RESULT(yes)
1051 ],
1052 [ AC_MSG_RESULT(no) ]
1053 )
1054fi
1055
58d100bf 1056AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1057 AC_TRY_COMPILE(
1058 [ #include <sys/types.h> ],
1059 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1060 [ ac_cv_have_u_intxx_t="yes" ],
1061 [ ac_cv_have_u_intxx_t="no" ]
1062 )
1063])
1064if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1065 AC_DEFINE(HAVE_U_INTXX_T)
1066 have_u_intxx_t=1
1067fi
2b942fe0 1068
41cb4569 1069if test -z "$have_u_intxx_t" ; then
1070 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1071 AC_TRY_COMPILE(
1072 [ #include <sys/socket.h> ],
1073 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1074 [
1075 AC_DEFINE(HAVE_U_INTXX_T)
1076 AC_MSG_RESULT(yes)
1077 ],
1078 [ AC_MSG_RESULT(no) ]
1079 )
1080fi
1081
bd590612 1082AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1083 AC_TRY_COMPILE(
1084 [ #include <sys/types.h> ],
1085 [ u_int64_t a; a = 1;],
1086 [ ac_cv_have_u_int64_t="yes" ],
1087 [ ac_cv_have_u_int64_t="no" ]
1088 )
1089])
1090if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1091 AC_DEFINE(HAVE_U_INT64_T)
1092 have_u_int64_t=1
1093fi
1094
41cb4569 1095if test -z "$have_u_intxx_t" ; then
1096 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1097 AC_TRY_COMPILE(
1098 [
1099#include <sys/types.h>
1100 ],
1101 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1102 [ ac_cv_have_uintxx_t="yes" ],
1103 [ ac_cv_have_uintxx_t="no" ]
1104 )
1105 ])
1106 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1107 AC_DEFINE(HAVE_UINTXX_T)
1108 fi
1109fi
1110
1111if test -z "$have_uintxx_t" ; then
1112 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1113 AC_TRY_COMPILE(
1114 [ #include <stdint.h> ],
1115 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1116 [
1117 AC_DEFINE(HAVE_UINTXX_T)
1118 AC_MSG_RESULT(yes)
1119 ],
1120 [ AC_MSG_RESULT(no) ]
1121 )
1122fi
1123
e5fe9a1f 1124if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1125 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 1126then
1127 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1128 AC_TRY_COMPILE(
58d100bf 1129 [
1130#include <sys/bitypes.h>
1131 ],
5cdfe03f 1132 [
837c30b8 1133 int8_t a; int16_t b; int32_t c;
1134 u_int8_t e; u_int16_t f; u_int32_t g;
1135 a = b = c = e = f = g = 1;
5cdfe03f 1136 ],
1137 [
1138 AC_DEFINE(HAVE_U_INTXX_T)
1139 AC_DEFINE(HAVE_INTXX_T)
1140 AC_MSG_RESULT(yes)
1141 ],
1142 [AC_MSG_RESULT(no)]
1143 )
1144fi
1145
0362750e 1146
1147AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1148 AC_TRY_COMPILE(
1149 [
1150#include <sys/types.h>
1151 ],
1152 [ u_char foo; foo = 125; ],
1153 [ ac_cv_have_u_char="yes" ],
1154 [ ac_cv_have_u_char="no" ]
1155 )
1156])
1157if test "x$ac_cv_have_u_char" = "xyes" ; then
1158 AC_DEFINE(HAVE_U_CHAR)
1159fi
1160
98a7c37b 1161TYPE_SOCKLEN_T
2b942fe0 1162
58d100bf 1163AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1164 AC_TRY_COMPILE(
1165 [
18ba2aab 1166#include <sys/types.h>
58d100bf 1167 ],
1168 [ size_t foo; foo = 1235; ],
1169 [ ac_cv_have_size_t="yes" ],
1170 [ ac_cv_have_size_t="no" ]
1171 )
1172])
1173if test "x$ac_cv_have_size_t" = "xyes" ; then
1174 AC_DEFINE(HAVE_SIZE_T)
1175fi
ea1970a3 1176
c04f75f1 1177AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1178 AC_TRY_COMPILE(
1179 [
1180#include <sys/types.h>
1181 ],
1182 [ ssize_t foo; foo = 1235; ],
1183 [ ac_cv_have_ssize_t="yes" ],
1184 [ ac_cv_have_ssize_t="no" ]
1185 )
1186])
1187if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1188 AC_DEFINE(HAVE_SSIZE_T)
1189fi
1190
f1c4659d 1191AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1192 AC_TRY_COMPILE(
1193 [
1194#include <time.h>
1195 ],
1196 [ clock_t foo; foo = 1235; ],
1197 [ ac_cv_have_clock_t="yes" ],
1198 [ ac_cv_have_clock_t="no" ]
1199 )
1200])
1201if test "x$ac_cv_have_clock_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_CLOCK_T)
1203fi
1204
1c04b088 1205AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1206 AC_TRY_COMPILE(
1207 [
1208#include <sys/types.h>
1209#include <sys/socket.h>
1210 ],
1211 [ sa_family_t foo; foo = 1235; ],
1212 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 1213 [ AC_TRY_COMPILE(
1214 [
1215#include <sys/types.h>
1216#include <sys/socket.h>
1217#include <netinet/in.h>
1218 ],
1219 [ sa_family_t foo; foo = 1235; ],
1220 [ ac_cv_have_sa_family_t="yes" ],
1221
1c04b088 1222 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 1223 )]
1c04b088 1224 )
1225])
1226if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1227 AC_DEFINE(HAVE_SA_FAMILY_T)
1228fi
1229
729bfe59 1230AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1231 AC_TRY_COMPILE(
1232 [
1233#include <sys/types.h>
1234 ],
1235 [ pid_t foo; foo = 1235; ],
1236 [ ac_cv_have_pid_t="yes" ],
1237 [ ac_cv_have_pid_t="no" ]
1238 )
1239])
1240if test "x$ac_cv_have_pid_t" = "xyes" ; then
1241 AC_DEFINE(HAVE_PID_T)
1242fi
1243
1244AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1245 AC_TRY_COMPILE(
1246 [
1247#include <sys/types.h>
1248 ],
1249 [ mode_t foo; foo = 1235; ],
1250 [ ac_cv_have_mode_t="yes" ],
1251 [ ac_cv_have_mode_t="no" ]
1252 )
1253])
1254if test "x$ac_cv_have_mode_t" = "xyes" ; then
1255 AC_DEFINE(HAVE_MODE_T)
1256fi
1257
e3a93db0 1258
58d100bf 1259AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1260 AC_TRY_COMPILE(
1261 [
18ba2aab 1262#include <sys/types.h>
1263#include <sys/socket.h>
58d100bf 1264 ],
1265 [ struct sockaddr_storage s; ],
1266 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1267 [ ac_cv_have_struct_sockaddr_storage="no" ]
1268 )
1269])
1270if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1271 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1272fi
48e671d5 1273
58d100bf 1274AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1275 AC_TRY_COMPILE(
1276 [
cbd7492e 1277#include <sys/types.h>
58d100bf 1278#include <netinet/in.h>
1279 ],
1280 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1281 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1282 [ ac_cv_have_struct_sockaddr_in6="no" ]
1283 )
1284])
1285if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1286 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1287fi
48e671d5 1288
58d100bf 1289AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1290 AC_TRY_COMPILE(
1291 [
cbd7492e 1292#include <sys/types.h>
58d100bf 1293#include <netinet/in.h>
1294 ],
1295 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1296 [ ac_cv_have_struct_in6_addr="yes" ],
1297 [ ac_cv_have_struct_in6_addr="no" ]
1298 )
1299])
1300if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1301 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1302fi
48e671d5 1303
58d100bf 1304AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1305 AC_TRY_COMPILE(
1306 [
18ba2aab 1307#include <sys/types.h>
1308#include <sys/socket.h>
1309#include <netdb.h>
58d100bf 1310 ],
1311 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1312 [ ac_cv_have_struct_addrinfo="yes" ],
1313 [ ac_cv_have_struct_addrinfo="no" ]
1314 )
1315])
1316if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1317 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1318fi
1319
89c7e31c 1320AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1321 AC_TRY_COMPILE(
1322 [ #include <sys/time.h> ],
1323 [ struct timeval tv; tv.tv_sec = 1;],
1324 [ ac_cv_have_struct_timeval="yes" ],
1325 [ ac_cv_have_struct_timeval="no" ]
1326 )
1327])
1328if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1329 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1330 have_struct_timeval=1
1331fi
1332
2c523de9 1333# If we don't have int64_t then we can't compile sftp-server. So don't
1334# even attempt to do it.
1335if test "x$ac_cv_have_int64_t" = "xno" -a \
1336 "x$ac_cv_sizeof_long_int" != "x8" -a \
1337 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1338 NO_SFTP='#'
733cf7f4 1339else
1340dnl test snprintf (broken on SCO w/gcc)
1341 AC_TRY_RUN(
1342 [
1343#include <stdio.h>
1344#include <string.h>
1345#ifdef HAVE_SNPRINTF
1346main()
1347{
1348 char buf[50];
1349 char expected_out[50];
1350 int mazsize = 50 ;
1351#if (SIZEOF_LONG_INT == 8)
1352 long int num = 0x7fffffffffffffff;
1353#else
763a1a18 1354 long long num = 0x7fffffffffffffffll;
733cf7f4 1355#endif
1356 strcpy(expected_out, "9223372036854775807");
1357 snprintf(buf, mazsize, "%lld", num);
1358 if(strcmp(buf, expected_out) != 0)
1359 exit(1);
1360 exit(0);
1361}
1362#else
1363main() { exit(0); }
1364#endif
1365 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1366 )
2c523de9 1367fi
89c7e31c 1368AC_SUBST(NO_SFTP)
2c523de9 1369
77bb0bca 1370dnl Checks for structure members
58d100bf 1371OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1372OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1373OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1374OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1375OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 1376OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 1377OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1378OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 1379OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 1380OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1381OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1382OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1383OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 1384OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1385OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1386OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1387OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 1388
1389AC_CHECK_MEMBERS([struct stat.st_blksize])
1d7b9b20 1390
58d100bf 1391AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1392 ac_cv_have_ss_family_in_struct_ss, [
1393 AC_TRY_COMPILE(
1394 [
18ba2aab 1395#include <sys/types.h>
1396#include <sys/socket.h>
58d100bf 1397 ],
1398 [ struct sockaddr_storage s; s.ss_family = 1; ],
1399 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1400 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1401 )
1402])
1403if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1404 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1405fi
1406
58d100bf 1407AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1408 ac_cv_have___ss_family_in_struct_ss, [
1409 AC_TRY_COMPILE(
1410 [
18ba2aab 1411#include <sys/types.h>
1412#include <sys/socket.h>
58d100bf 1413 ],
1414 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1415 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1416 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1417 )
1418])
1419if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1420 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1421fi
1422
2e73a022 1423AC_CACHE_CHECK([for pw_class field in struct passwd],
1424 ac_cv_have_pw_class_in_struct_passwd, [
1425 AC_TRY_COMPILE(
1426 [
2e73a022 1427#include <pwd.h>
1428 ],
97994d32 1429 [ struct passwd p; p.pw_class = 0; ],
2e73a022 1430 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1431 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1432 )
1433])
1434if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1435 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1436fi
1437
7751d4eb 1438AC_CACHE_CHECK([for pw_expire field in struct passwd],
1439 ac_cv_have_pw_expire_in_struct_passwd, [
1440 AC_TRY_COMPILE(
1441 [
1442#include <pwd.h>
1443 ],
1444 [ struct passwd p; p.pw_expire = 0; ],
1445 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1446 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1447 )
1448])
1449if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1450 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1451fi
1452
1453AC_CACHE_CHECK([for pw_change field in struct passwd],
1454 ac_cv_have_pw_change_in_struct_passwd, [
1455 AC_TRY_COMPILE(
1456 [
1457#include <pwd.h>
1458 ],
1459 [ struct passwd p; p.pw_change = 0; ],
1460 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1461 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1462 )
1463])
1464if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1465 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1466fi
58d100bf 1467
1468AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1469 AC_TRY_LINK([],
1470 [ extern char *__progname; printf("%s", __progname); ],
1471 [ ac_cv_libc_defines___progname="yes" ],
1472 [ ac_cv_libc_defines___progname="no" ]
1473 )
1474])
1475if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1476 AC_DEFINE(HAVE___PROGNAME)
1477fi
8946db53 1478
1812a662 1479AC_CACHE_CHECK([whether getopt has optreset support],
1480 ac_cv_have_getopt_optreset, [
1481 AC_TRY_LINK(
1482 [
1483#include <getopt.h>
1484 ],
1485 [ extern int optreset; optreset = 0; ],
1486 [ ac_cv_have_getopt_optreset="yes" ],
1487 [ ac_cv_have_getopt_optreset="no" ]
1488 )
1489])
1490if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1491 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1492fi
a0391976 1493
819b676f 1494AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1495 AC_TRY_LINK([],
1496 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1497 [ ac_cv_libc_defines_sys_errlist="yes" ],
1498 [ ac_cv_libc_defines_sys_errlist="no" ]
1499 )
1500])
1501if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1502 AC_DEFINE(HAVE_SYS_ERRLIST)
1503fi
1504
1505
416ed5a7 1506AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1507 AC_TRY_LINK([],
1508 [ extern int sys_nerr; printf("%i", sys_nerr);],
1509 [ ac_cv_libc_defines_sys_nerr="yes" ],
1510 [ ac_cv_libc_defines_sys_nerr="no" ]
1511 )
1512])
1513if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1514 AC_DEFINE(HAVE_SYS_NERR)
1515fi
1516
1517
d0b19c95 1518# Check whether user wants Kerberos support
1519SCARD_MSG="no"
1520AC_ARG_WITH(smartcard,
1521 [ --with-smartcard Enable smartcard support],
1522 [
1523 if test "x$withval" != "xno" ; then
1524 if test "x$withval" != "xyes" ; then
1525 CPPFLAGS="$CPPFLAGS -I${withval}"
1526 LDFLAGS="$LDFLAGS -L${withval}"
1527 if test ! -z "$need_dash_r" ; then
1528 LDFLAGS="$LDFLAGS -R${withval}"
1529 fi
1530 if test ! -z "$blibpath" ; then
1531 blibpath="$blibpath:${withval}"
1532 fi
1533 fi
1534 AC_CHECK_HEADERS(sectok.h)
1535 if test "$ac_cv_header_sectok_h" != yes; then
1536 AC_MSG_ERROR(Can't find sectok.h)
1537 fi
1538 AC_CHECK_LIB(sectok, sectok_open)
1539 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1540 AC_MSG_ERROR(Can't find libsectok)
1541 fi
1542 AC_DEFINE(SMARTCARD)
1543 SCARD_MSG="yes"
1544 fi
1545 ]
1546)
1547
b5b68128 1548# Check whether user wants Kerberos support
1549KRB4_MSG="no"
1550AC_ARG_WITH(kerberos4,
1551 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1552 [
1553 if test "x$withval" != "xno" ; then
b5b68128 1554 if test "x$withval" != "xyes" ; then
1555 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1556 LDFLAGS="$LDFLAGS -L${withval}/lib"
1557 if test ! -z "$need_dash_r" ; then
1558 LDFLAGS="$LDFLAGS -R${withval}/lib"
1559 fi
1560 if test ! -z "$blibpath" ; then
1561 blibpath="$blibpath:${withval}/lib"
1562 fi
1563 else
1564 if test -d /usr/include/kerberosIV ; then
1565 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1566 fi
1567 fi
1568
1569 AC_CHECK_HEADERS(krb.h)
b5b68128 1570 if test "$ac_cv_header_krb_h" != yes; then
1571 AC_MSG_WARN([Cannot find krb.h, build may fail])
1572 fi
cccfea16 1573 AC_CHECK_LIB(krb, main)
b5b68128 1574 if test "$ac_cv_lib_krb_main" != yes; then
cccfea16 1575 AC_CHECK_LIB(krb4, main)
1576 if test "$ac_cv_lib_krb4_main" != yes; then
1577 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1578 else
1579 KLIBS="-lkrb4"
1580 fi
1581 else
1582 KLIBS="-lkrb"
1583 fi
1584 AC_CHECK_LIB(des, des_cbc_encrypt)
1585 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1586 AC_CHECK_LIB(des425, des_cbc_encrypt)
1587 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1588 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1589 else
1590 KLIBS="-ldes425"
1591 fi
1592 else
1593 KLIBS="-ldes"
b5b68128 1594 fi
b5b68128 1595 AC_CHECK_LIB(resolv, dn_expand, , )
1596 KRB4=yes
1597 KRB4_MSG="yes"
1598 AC_DEFINE(KRB4)
1599 fi
1600 ]
1601)
1602
1603# Check whether user wants AFS support
1604AFS_MSG="no"
1605AC_ARG_WITH(afs,
1606 [ --with-afs=PATH Enable AFS support],
1607 [
1608 if test "x$withval" != "xno" ; then
1609
1610 if test "x$withval" != "xyes" ; then
1611 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1612 LDFLAGS="$LDFLAGS -L${withval}/lib"
1613 fi
1614
1615 if test -z "$KRB4" ; then
1616 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1617 fi
1618
1619 LIBS="-lkafs $LIBS"
1620 if test ! -z "$AFS_LIBS" ; then
1621 LIBS="$LIBS $AFS_LIBS"
1622 fi
1623 AC_DEFINE(AFS)
1624 AFS_MSG="yes"
1625 fi
1626 ]
1627)
1628LIBS="$LIBS $KLIBS"
1629
a0391976 1630# Looking for programs, paths and files
1631AC_ARG_WITH(rsh,
1632 [ --with-rsh=PATH Specify path to remote shell program ],
1633 [
bcf36c78 1634 if test "x$withval" != "$no" ; then
7a33f831 1635 rsh_path=$withval
a0391976 1636 fi
1637 ],
1638 [
1639 AC_PATH_PROG(rsh_path, rsh)
1640 ]
1641)
1642
1643AC_ARG_WITH(xauth,
1644 [ --with-xauth=PATH Specify path to xauth program ],
1645 [
00937921 1646 if test "x$withval" != "xno" ; then
cbd7492e 1647 xauth_path=$withval
a0391976 1648 fi
1649 ],
1650 [
77bb0bca 1651 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
e5fe9a1f 1652 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 1653 xauth_path="/usr/openwin/bin/xauth"
1654 fi
1655 ]
1656)
1657
b3ec54b4 1658if test -z "$xauth_path" ; then
1659 XAUTH_PATH="undefined"
1660 AC_SUBST(XAUTH_PATH)
1661else
a0391976 1662 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
b3ec54b4 1663 XAUTH_PATH=$xauth_path
1664 AC_SUBST(XAUTH_PATH)
a0391976 1665fi
1666if test ! -z "$rsh_path" ; then
1667 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1668fi
1669
1670# Check for mail directory (last resort if we cannot get it from headers)
1671if test ! -z "$MAIL" ; then
1672 maildir=`dirname $MAIL`
1673 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1674fi
1675
a0391976 1676if test -z "$no_dev_ptmx" ; then
3276571c 1677 AC_CHECK_FILE("/dev/ptmx",
1678 [
1679 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1680 have_dev_ptmx=1
1681 ]
1682 )
1683fi
1684AC_CHECK_FILE("/dev/ptc",
1685 [
1686 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1687 have_dev_ptc=1
1688 ]
1689)
1690
a0391976 1691# Options from here on. Some of these are preset by platform above
fdf6b7aa 1692AC_ARG_WITH(mantype,
5d97cfbf 1693 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 1694 [
5d97cfbf 1695 case "$withval" in
1696 man|cat|doc)
1697 MANTYPE=$withval
1698 ;;
1699 *)
1700 AC_MSG_ERROR(invalid man type: $withval)
1701 ;;
1702 esac
c54a6257 1703 ]
1704)
e0c4d3ac 1705if test -z "$MANTYPE"; then
533875af 1706 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
e0c4d3ac 1707 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1708 MANTYPE=doc
1709 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1710 MANTYPE=man
1711 else
1712 MANTYPE=cat
1713 fi
1714fi
c54a6257 1715AC_SUBST(MANTYPE)
e0c4d3ac 1716if test "$MANTYPE" = "doc"; then
1717 mansubdir=man;
1718else
1719 mansubdir=$MANTYPE;
1720fi
1721AC_SUBST(mansubdir)
0bc5b6fb 1722
a0391976 1723# Check whether to enable MD5 passwords
cbd7492e 1724MD5_MSG="no"
2ddcfdf3 1725AC_ARG_WITH(md5-passwords,
caf3bc51 1726 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 1727 [
bcf36c78 1728 if test "x$withval" != "xno" ; then
0bc5b6fb 1729 AC_DEFINE(HAVE_MD5_PASSWORDS)
cbd7492e 1730 MD5_MSG="yes"
0bc5b6fb 1731 fi
1732 ]
caf3bc51 1733)
1734
a0391976 1735# Whether to disable shadow password support
a7effaac 1736AC_ARG_WITH(shadow,
1737 [ --without-shadow Disable shadow password support],
1738 [
1739 if test "x$withval" = "xno" ; then
1740 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 1741 disable_shadow=yes
a7effaac 1742 fi
1743 ]
1744)
1745
4cb5ffa0 1746if test -z "$disable_shadow" ; then
1747 AC_MSG_CHECKING([if the systems has expire shadow information])
1748 AC_TRY_COMPILE(
1749 [
1750#include <sys/types.h>
1751#include <shadow.h>
1752 struct spwd sp;
1753 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1754 [ sp_expire_available=yes ], []
1755 )
1756
1757 if test "x$sp_expire_available" = "xyes" ; then
1758 AC_MSG_RESULT(yes)
1759 AC_DEFINE(HAS_SHADOW_EXPIRE)
1760 else
1761 AC_MSG_RESULT(no)
1762 fi
1763fi
1764
a0391976 1765# Use ip address instead of hostname in $DISPLAY
44839801 1766if test ! -z "$IPADDR_IN_DISPLAY" ; then
1767 DISPLAY_HACK_MSG="yes"
1768 AC_DEFINE(IPADDR_IN_DISPLAY)
1769else
1770 DISPLAY_HACK_MSG="no"
1771 AC_ARG_WITH(ipaddr-display,
1772 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1773 [
1774 if test "x$withval" != "xno" ; then
1775 AC_DEFINE(IPADDR_IN_DISPLAY)
1776 DISPLAY_HACK_MSG="yes"
1777 fi
1778 ]
1779 )
1780fi
a7effaac 1781
a0391976 1782# Whether to mess with the default path
cbd7492e 1783SERVER_PATH_MSG="(default)"
c43d69a9 1784AC_ARG_WITH(default-path,
cb807f40 1785 [ --with-default-path=PATH Specify default \$PATH environment for server],
1786 [
1787 if test "x$withval" != "xno" ; then
b2d818e6 1788 user_path="$withval"
cbd7492e 1789 SERVER_PATH_MSG="$withval"
cb807f40 1790 fi
b2d818e6 1791 ],
1792 [
1793 AC_TRY_RUN(
1794 [
1795/* find out what STDPATH is */
1796#include <stdio.h>
b2d818e6 1797#ifdef HAVE_PATHS_H
1798# include <paths.h>
1799#endif
1800#ifndef _PATH_STDPATH
1801# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1802#endif
1803#include <sys/types.h>
1804#include <sys/stat.h>
1805#include <fcntl.h>
1806#define DATA "conftest.stdpath"
1807
1808main()
1809{
1810 FILE *fd;
1811 int rc;
1812
1813 fd = fopen(DATA,"w");
1814 if(fd == NULL)
1815 exit(1);
1816
1817 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1818 exit(1);
1819
1820 exit(0);
1821}
1822 ], [ user_path=`cat conftest.stdpath` ],
1823 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1824 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1825 )
1826# make sure $bindir is in USER_PATH so scp will work
1827 t_bindir=`eval echo ${bindir}`
1828 case $t_bindir in
1829 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1830 esac
1831 case $t_bindir in
1832 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1833 esac
1834 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1835 if test $? -ne 0 ; then
1836 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1837 if test $? -ne 0 ; then
1838 user_path=$user_path:$t_bindir
1839 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1840 fi
1841 fi
cb807f40 1842 ]
1843)
b2d818e6 1844AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1845AC_SUBST(user_path)
cb807f40 1846
a0391976 1847# Whether to force IPv4 by default (needed on broken glibc Linux)
cbd7492e 1848IPV4_HACK_MSG="no"
59e76f33 1849AC_ARG_WITH(ipv4-default,
1850 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1851 [
1852 if test "x$withval" != "xno" ; then
1853 AC_DEFINE(IPV4_DEFAULT)
cbd7492e 1854 IPV4_HACK_MSG="yes"
59e76f33 1855 fi
1856 ]
1857)
1858
58d100bf 1859AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
cbd7492e 1860IPV4_IN6_HACK_MSG="no"
80faa19f 1861AC_ARG_WITH(4in6,
1862 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1863 [
1864 if test "x$withval" != "xno" ; then
1865 AC_MSG_RESULT(yes)
1866 AC_DEFINE(IPV4_IN_IPV6)
cbd7492e 1867 IPV4_IN6_HACK_MSG="yes"
80faa19f 1868 else
1869 AC_MSG_RESULT(no)
1870 fi
1871 ],[
1872 if test "x$inet6_default_4in6" = "xyes"; then
1873 AC_MSG_RESULT([yes (default)])
1874 AC_DEFINE(IPV4_IN_IPV6)
cbd7492e 1875 IPV4_IN6_HACK_MSG="yes"
80faa19f 1876 else
1877 AC_MSG_RESULT([no (default)])
1878 fi
1879 ]
1880)
1881
af774732 1882# Whether to enable BSD auth support
f1b0ecc3 1883BSD_AUTH_MSG=no
af774732 1884AC_ARG_WITH(bsd-auth,
1885 [ --with-bsd-auth Enable BSD auth support],
1886 [
1887 if test "x$withval" != "xno" ; then
1888 AC_DEFINE(BSD_AUTH)
f1b0ecc3 1889 BSD_AUTH_MSG=yes
af774732 1890 fi
1891 ]
1892)
1893
77bb0bca 1894AC_MSG_CHECKING(whether to install ssh as suid root)
1895AC_ARG_ENABLE(suid-ssh,
1896[ --enable-suid-ssh Install ssh as suid root (default)
1897 --disable-suid-ssh Install ssh without suid bit],
1898[ case "$enableval" in
1899 no)
1900 AC_MSG_RESULT(no)
1901 SSHMODE=0711
1902 ;;
1903 *) AC_MSG_RESULT(yes)
0b7d19eb 1904 SSHMODE=4711
77bb0bca 1905 ;;
1906 esac ],
1907 AC_MSG_RESULT(yes)
0b7d19eb 1908 SSHMODE=4711
77bb0bca 1909)
1910AC_SUBST(SSHMODE)
1911
1912
a0391976 1913# Where to place sshd.pid
19d9ac2a 1914piddir=/var/run
47e45e44 1915AC_ARG_WITH(pid-dir,
1916 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1917 [
1918 if test "x$withval" != "xno" ; then
19d9ac2a 1919 piddir=$withval
47e45e44 1920 fi
1921 ]
1922)
b7a87eea 1923
77bb0bca 1924# make sure the directory exists
1925if test ! -d $piddir ; then
1926 piddir=`eval echo ${sysconfdir}`
1927 case $piddir in
1928 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1929 esac
1930fi
1931
42f11eb2 1932AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
19d9ac2a 1933AC_SUBST(piddir)
47e45e44 1934
1d7b9b20 1935dnl allow user to disable some login recording features
1936AC_ARG_ENABLE(lastlog,
bfd550a2 1937 [ --disable-lastlog disable use of lastlog even if detected [no]],
1d7b9b20 1938 [ AC_DEFINE(DISABLE_LASTLOG) ]
1939)
1940AC_ARG_ENABLE(utmp,
bfd550a2 1941 [ --disable-utmp disable use of utmp even if detected [no]],
1d7b9b20 1942 [ AC_DEFINE(DISABLE_UTMP) ]
1943)
1944AC_ARG_ENABLE(utmpx,
bfd550a2 1945 [ --disable-utmpx disable use of utmpx even if detected [no]],
1d7b9b20 1946 [ AC_DEFINE(DISABLE_UTMPX) ]
1947)
1948AC_ARG_ENABLE(wtmp,
bfd550a2 1949 [ --disable-wtmp disable use of wtmp even if detected [no]],
1d7b9b20 1950 [ AC_DEFINE(DISABLE_WTMP) ]
1951)
1952AC_ARG_ENABLE(wtmpx,
bfd550a2 1953 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1d7b9b20 1954 [ AC_DEFINE(DISABLE_WTMPX) ]
1955)
1956AC_ARG_ENABLE(libutil,
bfd550a2 1957 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1d7b9b20 1958 [ AC_DEFINE(DISABLE_LOGIN) ]
1959)
1960AC_ARG_ENABLE(pututline,
bfd550a2 1961 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1d7b9b20 1962 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1963)
1964AC_ARG_ENABLE(pututxline,
bfd550a2 1965 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1d7b9b20 1966 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1967)
1968AC_ARG_WITH(lastlog,
bfd550a2 1969 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 1970 [
1971 if test "x$withval" = "xno" ; then
1972 AC_DEFINE(DISABLE_LASTLOG)
1973 else
1974 conf_lastlog_location=$withval
1975 fi
1976 ]
1977)
1d7b9b20 1978
1979dnl lastlog, [uw]tmpx? detection
1980dnl NOTE: set the paths in the platform section to avoid the
1981dnl need for command-line parameters
1982dnl lastlog and [uw]tmp are subject to a file search if all else fails
1983
1984dnl lastlog detection
1985dnl NOTE: the code itself will detect if lastlog is a directory
1986AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1987AC_TRY_COMPILE([
1988#include <sys/types.h>
1989#include <utmp.h>
1990#ifdef HAVE_LASTLOG_H
1991# include <lastlog.h>
1992#endif
d7c0f3d5 1993#ifdef HAVE_PATHS_H
1d7b9b20 1994# include <paths.h>
41cb4569 1995#endif
1996#ifdef HAVE_LOGIN_H
1997# include <login.h>
1d7b9b20 1998#endif
1999 ],
2000 [ char *lastlog = LASTLOG_FILE; ],
2001 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 2002 [
2003 AC_MSG_RESULT(no)
2004 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2005 AC_TRY_COMPILE([
2006#include <sys/types.h>
2007#include <utmp.h>
2008#ifdef HAVE_LASTLOG_H
2009# include <lastlog.h>
2010#endif
2011#ifdef HAVE_PATHS_H
2012# include <paths.h>
2013#endif
2014 ],
2015 [ char *lastlog = _PATH_LASTLOG; ],
2016 [ AC_MSG_RESULT(yes) ],
2017 [
f282b668 2018 AC_MSG_RESULT(no)
d7c0f3d5 2019 system_lastlog_path=no
2020 ])
2021 ]
1d7b9b20 2022)
d7c0f3d5 2023
1d7b9b20 2024if test -z "$conf_lastlog_location"; then
2025 if test x"$system_lastlog_path" = x"no" ; then
2026 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 2027 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 2028 conf_lastlog_location=$f
2029 fi
2030 done
2031 if test -z "$conf_lastlog_location"; then
f8119cef 2032 AC_MSG_WARN([** Cannot find lastlog **])
2033 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 2034 fi
2035 fi
2036fi
2037
2038if test -n "$conf_lastlog_location"; then
2039 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2040fi
2041
2042dnl utmp detection
2043AC_MSG_CHECKING([if your system defines UTMP_FILE])
2044AC_TRY_COMPILE([
2045#include <sys/types.h>
2046#include <utmp.h>
d7c0f3d5 2047#ifdef HAVE_PATHS_H
1d7b9b20 2048# include <paths.h>
2049#endif
2050 ],
2051 [ char *utmp = UTMP_FILE; ],
2052 [ AC_MSG_RESULT(yes) ],
2053 [ AC_MSG_RESULT(no)
2054 system_utmp_path=no ]
2055)
2056if test -z "$conf_utmp_location"; then
2057 if test x"$system_utmp_path" = x"no" ; then
2058 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2059 if test -f $f ; then
2060 conf_utmp_location=$f
2061 fi
2062 done
2063 if test -z "$conf_utmp_location"; then
2064 AC_DEFINE(DISABLE_UTMP)
2065 fi
2066 fi
2067fi
2068if test -n "$conf_utmp_location"; then
2069 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2070fi
2071
2072dnl wtmp detection
2073AC_MSG_CHECKING([if your system defines WTMP_FILE])
2074AC_TRY_COMPILE([
2075#include <sys/types.h>
2076#include <utmp.h>
d7c0f3d5 2077#ifdef HAVE_PATHS_H
1d7b9b20 2078# include <paths.h>
2079#endif
2080 ],
2081 [ char *wtmp = WTMP_FILE; ],
2082 [ AC_MSG_RESULT(yes) ],
2083 [ AC_MSG_RESULT(no)
2084 system_wtmp_path=no ]
2085)
2086if test -z "$conf_wtmp_location"; then
2087 if test x"$system_wtmp_path" = x"no" ; then
2088 for f in /usr/adm/wtmp /var/log/wtmp; do
2089 if test -f $f ; then
2090 conf_wtmp_location=$f
2091 fi
2092 done
2093 if test -z "$conf_wtmp_location"; then
2094 AC_DEFINE(DISABLE_WTMP)
2095 fi
2096 fi
2097fi
2098if test -n "$conf_wtmp_location"; then
2099 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2100fi
2101
2102
2103dnl utmpx detection - I don't know any system so perverse as to require
2104dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2105dnl there, though.
2106AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2107AC_TRY_COMPILE([
2108#include <sys/types.h>
2109#include <utmp.h>
2110#ifdef HAVE_UTMPX_H
2111#include <utmpx.h>
2112#endif
d7c0f3d5 2113#ifdef HAVE_PATHS_H
1d7b9b20 2114# include <paths.h>
2115#endif
2116 ],
2117 [ char *utmpx = UTMPX_FILE; ],
2118 [ AC_MSG_RESULT(yes) ],
2119 [ AC_MSG_RESULT(no)
2120 system_utmpx_path=no ]
2121)
2122if test -z "$conf_utmpx_location"; then
2123 if test x"$system_utmpx_path" = x"no" ; then
2124 AC_DEFINE(DISABLE_UTMPX)
2125 fi
2126else
2127 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2128fi
2129
2130dnl wtmpx detection
2131AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2132AC_TRY_COMPILE([
2133#include <sys/types.h>
2134#include <utmp.h>
2135#ifdef HAVE_UTMPX_H
2136#include <utmpx.h>
2137#endif
d7c0f3d5 2138#ifdef HAVE_PATHS_H
1d7b9b20 2139# include <paths.h>
2140#endif
2141 ],
2142 [ char *wtmpx = WTMPX_FILE; ],
2143 [ AC_MSG_RESULT(yes) ],
2144 [ AC_MSG_RESULT(no)
2145 system_wtmpx_path=no ]
2146)
2147if test -z "$conf_wtmpx_location"; then
2148 if test x"$system_wtmpx_path" = x"no" ; then
2149 AC_DEFINE(DISABLE_WTMPX)
2150 fi
2151else
2152 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2153fi
2154
b7a87eea 2155
bd499f9e 2156if test ! -z "$blibpath" ; then
2157 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2158 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2159fi
2160
3c62e7eb 2161AC_EXEEXT
98a7c37b 2162AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2163AC_OUTPUT
d3083fbd 2164
cbd7492e 2165# Print summary of options
2166
cbd7492e 2167# Someone please show me a better way :)
2168A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2169B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2170C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2171D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 2172E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 2173F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 2174G=`eval echo ${piddir}` ; G=`eval echo ${G}`
b2d818e6 2175H=`eval echo ${user_path}` ; H=`eval echo ${H}`
cbd7492e 2176
2177echo ""
26de7942 2178echo "OpenSSH has been configured with the following options:"
cbd7492e 2179echo " User binaries: $B"
2180echo " System binaries: $C"
2181echo " Configuration files: $D"
2182echo " Askpass program: $E"
2183echo " Manual pages: $F"
2184echo " PID file: $G"
b2d818e6 2185echo " sshd default user PATH: $H"
5d97cfbf 2186echo " Manpage format: $MANTYPE"
cbd7492e 2187echo " PAM support: ${PAM_MSG}"
2188echo " KerberosIV support: $KRB4_MSG"
d0b19c95 2189echo " Smartcard support: $SCARD_MSG"
cbd7492e 2190echo " AFS support: $AFS_MSG"
2191echo " S/KEY support: $SKEY_MSG"
2192echo " TCP Wrappers support: $TCPW_MSG"
2193echo " MD5 password support: $MD5_MSG"
2194echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2195echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2196echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
f1b0ecc3 2197echo " BSD Auth support: $BSD_AUTH_MSG"
2198echo " Random number source: $RAND_MSG"
2199if test ! -z "$USE_RAND_HELPER" ; then
2200 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 2201fi
2202
cbd7492e 2203echo ""
2204
0c2fb82f 2205echo " Host: ${host}"
2206echo " Compiler: ${CC}"
2207echo " Compiler flags: ${CFLAGS}"
2208echo "Preprocessor flags: ${CPPFLAGS}"
2209echo " Linker flags: ${LDFLAGS}"
2210echo " Libraries: ${LIBS}"
cbd7492e 2211
2212echo ""
2213
adeebd37 2214if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 2215 echo "PAM is enabled. You may need to install a PAM control file "
2216 echo "for sshd, otherwise password authentication may fail. "
2217 echo "Example PAM control files can be found in the contrib/ "
2218 echo "subdirectory"
adeebd37 2219 echo ""
2220fi
2221
f1b0ecc3 2222if test ! -z "$NO_SFTP"; then
2223 echo "sftp-server will be disabled. Your compiler does not "
2224 echo "support 64bit integers."
48e7916f 2225 echo ""
2226fi
2c523de9 2227
f1b0ecc3 2228if test ! -z "$RAND_HELPER_CMDHASH" ; then
2229 echo "WARNING: you are using the builtin random number collection "
2230 echo "service. Please read WARNING.RNG and request that your OS "
2231 echo "vendor includes kernel-based random number collection in "
2232 echo "future versions of your OS."
2c523de9 2233 echo ""
2234fi
af774732 2235
This page took 0.547533 seconds and 5 git commands to generate.