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