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