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