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