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