]> andersk Git - openssh.git/blame - configure.ac
- (dtucker) [configure.ac] Bug #657: uid swappping issues on BSDi.
[openssh.git] / configure.ac
CommitLineData
eb5d7ff6 1# $Id$
0b202697 2
98a7c37b 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
5881cd60 5
6AC_CONFIG_HEADER(config.h)
b14b2ae7 7AC_PROG_CC
a7effaac 8AC_CANONICAL_HOST
cf0c5df5 9AC_C_BIGENDIAN
5881cd60 10
a0391976 11# Checks for programs.
4bbf95fa 12AC_PROG_AWK
4cca272e 13AC_PROG_CPP
5881cd60 14AC_PROG_RANLIB
cf8dd513 15AC_PROG_INSTALL
bee0a37e 16AC_PATH_PROG(AR, ar)
13dd877b 17AC_PATH_PROGS(PERL, perl5 perl)
c3690df3 18AC_PATH_PROG(SED, sed)
a0f84251 19AC_SUBST(PERL)
ad85db64 20AC_PATH_PROG(ENT, ent)
21AC_SUBST(ENT)
6958bd37 22AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24AC_PATH_PROG(TEST_MINUS_S_SH, sh)
6193497b 25AC_PATH_PROG(SH, sh)
f498ed15 26
948fd8b9 27# System features
28AC_SYS_LARGEFILE
29
c193d002 30if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32fi
33
2e73a022 34# Use LOGIN_PROGRAM from environment if possible
35if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37else
38 # Search for login
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
42 fi
43fi
44
d423d822 45if test -z "$LD" ; then
46 LD=$CC
47fi
48AC_SUBST(LD)
49
d423d822 50AC_C_INLINE
5ed2bb5b 51if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
52 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
d423d822 53fi
54
a0391976 55# Check for some target-specific stuff
a7effaac 56case "$host" in
9d6b1b96 57*-*-aix*)
0c2fb82f 58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
84afc958 59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
68ece370 60 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
63 fi
64 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
69 fi
70 done
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 else
75 AC_MSG_RESULT($blibflags)
bd499f9e 76 fi
68ece370 77 LDFLAGS="$saved_LDFLAGS"
e351e493 78 dnl Check for authenticate. Might be in libs.a on older AIXes
79 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
0764e748 80 [AC_CHECK_LIB(s,authenticate,
e351e493 81 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
0764e748 82 LIBS="$LIBS -ls"
83 ])
84 ])
e351e493 85 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
86 AC_CHECK_DECL(loginfailed,
87 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
88 AC_TRY_COMPILE(
f58c0e01 89 [#include <usersec.h>],
e351e493 90 [(void)loginfailed("user","host","tty",0);],
91 [AC_MSG_RESULT(yes)
92 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
f58c0e01 93 [AC_MSG_RESULT(no)]
e351e493 94 )],
95 [],
96 [#include <usersec.h>]
97 )
2aa3a16c 98 AC_CHECK_FUNCS(setauthdb)
4c8ef3fb 99 AC_DEFINE(BROKEN_GETADDRINFO)
1352689f 100 AC_DEFINE(BROKEN_REALPATH)
3b8dff69 101 AC_DEFINE(SETEUID_BREAKS_SETUID)
102 AC_DEFINE(BROKEN_SETREUID)
103 AC_DEFINE(BROKEN_SETREGID)
a3cef3ca 104 dnl AIX handles lastlog as part of its login message
105 AC_DEFINE(DISABLE_LASTLOG)
58177c0a 106 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3a2b2b44 107 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
9d6b1b96 108 ;;
3c62e7eb 109*-*-cygwin*)
a52997bd 110 check_for_libcrypt_later=1
ffb8d130 111 LIBS="$LIBS /usr/lib/textmode.o"
3c62e7eb 112 AC_DEFINE(HAVE_CYGWIN)
7043a38d 113 AC_DEFINE(USE_PIPES)
3c62e7eb 114 AC_DEFINE(DISABLE_SHADOW)
3c62e7eb 115 AC_DEFINE(IP_TOS_IS_BROKEN)
3d114925 116 AC_DEFINE(NO_X11_UNIX_SOCKETS)
e6f15ed1 117 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
94d8258b 118 AC_DEFINE(DISABLE_FD_PASSING)
246446cd 119 AC_DEFINE(SETGROUPS_NOOP)
3c62e7eb 120 ;;
d6fdb079 121*-*-dgux*)
122 AC_DEFINE(IP_TOS_IS_BROKEN)
123 ;;
39c98ef7 124*-*-darwin*)
33e2e066 125 AC_MSG_CHECKING(if we have working getaddrinfo)
126 AC_TRY_RUN([#include <mach-o/dyld.h>
127main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
128 exit(0);
129 else
130 exit(1);
131}], [AC_MSG_RESULT(working)],
132 [AC_MSG_RESULT(buggy)
133 AC_DEFINE(BROKEN_GETADDRINFO)],
635e0c42 134 AC_DEFINE(SETEUID_BREAKS_SETUID)
135 AC_DEFINE(BROKEN_SETREUID)
136 AC_DEFINE(BROKEN_SETREGID)
33e2e066 137 [AC_MSG_RESULT(assume it is working)])
39c98ef7 138 ;;
6e879cb4 139*-*-hpux10.26)
140 if test -z "$GCC"; then
141 CFLAGS="$CFLAGS -Ae"
142 fi
143 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
144 IPADDR_IN_DISPLAY=yes
145 AC_DEFINE(HAVE_SECUREWARE)
146 AC_DEFINE(USE_PIPES)
147 AC_DEFINE(LOGIN_NO_ENDOPT)
148 AC_DEFINE(LOGIN_NEEDS_UTMPX)
149 AC_DEFINE(DISABLE_SHADOW)
150 AC_DEFINE(DISABLE_UTMP)
3e6e3da0 151 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
3a2b2b44 152 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
f75ca46d 153 LIBS="$LIBS -lsec -lsecpw"
154 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
6e879cb4 155 disable_ptmx_check=yes
156 ;;
a7effaac 157*-*-hpux10*)
158 if test -z "$GCC"; then
fc1e8bf4 159 CFLAGS="$CFLAGS -Ae"
a7effaac 160 fi
28564873 161 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 162 IPADDR_IN_DISPLAY=yes
137d7b6c 163 AC_DEFINE(USE_PIPES)
a2572aa7 164 AC_DEFINE(LOGIN_NO_ENDOPT)
165 AC_DEFINE(LOGIN_NEEDS_UTMPX)
0bbfbdeb 166 AC_DEFINE(DISABLE_SHADOW)
764d4113 167 AC_DEFINE(DISABLE_UTMP)
3e6e3da0 168 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
3a2b2b44 169 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
f75ca46d 170 LIBS="$LIBS -lsec"
171 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
a7effaac 172 ;;
2b763e31 173*-*-hpux11*)
b8fea62d 174 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 175 IPADDR_IN_DISPLAY=yes
adeebd37 176 AC_DEFINE(PAM_SUN_CODEBASE)
2b10f47a 177 AC_DEFINE(USE_PIPES)
a2572aa7 178 AC_DEFINE(LOGIN_NO_ENDOPT)
179 AC_DEFINE(LOGIN_NEEDS_UTMPX)
0bbfbdeb 180 AC_DEFINE(DISABLE_SHADOW)
764d4113 181 AC_DEFINE(DISABLE_UTMP)
3e6e3da0 182 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
3a2b2b44 183 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
f75ca46d 184 LIBS="$LIBS -lsec"
185 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
2b763e31 186 ;;
d94aa2ae 187*-*-irix5*)
0c2fb82f 188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
c5fa2eb0 189 LDFLAGS="$LDFLAGS"
6ac7829a 190 PATH="$PATH:/usr/etc"
416ed5a7 191 AC_DEFINE(BROKEN_INET_NTOA)
0e8f4eba 192 AC_DEFINE(WITH_ABBREV_NO_TTY)
3e6e3da0 193 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
b9795b89 194 ;;
195*-*-irix6*)
0c2fb82f 196 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
c5fa2eb0 197 LDFLAGS="$LDFLAGS"
6ac7829a 198 PATH="$PATH:/usr/etc"
3206bb3b 199 AC_DEFINE(WITH_IRIX_ARRAY)
200 AC_DEFINE(WITH_IRIX_PROJECT)
201 AC_DEFINE(WITH_IRIX_AUDIT)
b5171f93 202 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
416ed5a7 203 AC_DEFINE(BROKEN_INET_NTOA)
0e8f4eba 204 AC_DEFINE(WITH_ABBREV_NO_TTY)
3e6e3da0 205 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
d94aa2ae 206 ;;
5cdfe03f 207*-*-linux*)
208 no_dev_ptmx=1
717057b6 209 check_for_libcrypt_later=1
eacb954e 210 check_for_openpty_ctty_bug=1
80faa19f 211 AC_DEFINE(DONT_TRY_OTHER_AF)
a8545c6c 212 AC_DEFINE(PAM_TTY_KLUDGE)
3e6e3da0 213 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
3a2b2b44 214 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
80faa19f 215 inet6_default_4in6=yes
bf7c1e6c 216 case `uname -r` in
ad84c479 217 1.*|2.0.*)
bf7c1e6c 218 AC_DEFINE(BROKEN_CMSG_TYPE)
219 ;;
bf7c1e6c 220 esac
5cdfe03f 221 ;;
66d6c27e 222mips-sony-bsd|mips-sony-newsos4)
223 AC_DEFINE(HAVE_NEWS4)
224 SONY=1
66d6c27e 225 ;;
d468fc76 226*-*-netbsd*)
33e2e066 227 check_for_libcrypt_before=1
a0391976 228 need_dash_r=1
d468fc76 229 ;;
86b416a7 230*-*-freebsd*)
231 check_for_libcrypt_later=1
232 ;;
8707b7eb 233*-*-bsdi*)
234 AC_DEFINE(SETEUID_BREAKS_SETUID)
235 AC_DEFINE(BROKEN_SETREUID)
236 AC_DEFINE(BROKEN_SETREGID)
237 ;;
729bfe59 238*-next-*)
729bfe59 239 conf_lastlog_location="/usr/adm/lastlog"
698d107e 240 conf_utmp_location=/etc/utmp
241 conf_wtmp_location=/usr/adm/wtmp
242 MAIL=/usr/spool/mail
729bfe59 243 AC_DEFINE(HAVE_NEXT)
443172c4 244 AC_DEFINE(BROKEN_REALPATH)
00937921 245 AC_DEFINE(USE_PIPES)
86b416a7 246 AC_DEFINE(BROKEN_SAVED_UIDS)
0c2fb82f 247 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
b1335fdf 248 CFLAGS="$CFLAGS"
729bfe59 249 ;;
9d6b1b96 250*-*-solaris*)
0c2fb82f 251 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
fbf305f1 252 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
a0391976 253 need_dash_r=1
adeebd37 254 AC_DEFINE(PAM_SUN_CODEBASE)
7e2d5fa4 255 AC_DEFINE(LOGIN_NEEDS_UTMPX)
256 AC_DEFINE(LOGIN_NEEDS_TERM)
7f0a4ff1 257 AC_DEFINE(PAM_TTY_KLUDGE)
3e6e3da0 258 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
ad84c479 259 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
260 AC_DEFINE(SSHD_ACQUIRES_CTTY)
95b99395 261 external_path_file=/etc/default/login
1d7b9b20 262 # hardwire lastlog location (can't detect it on some versions)
263 conf_lastlog_location="/var/adm/lastlog"
32c80420 264 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
265 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
266 if test "$sol2ver" -ge 8; then
267 AC_MSG_RESULT(yes)
268 AC_DEFINE(DISABLE_UTMP)
269 AC_DEFINE(DISABLE_WTMP)
270 else
271 AC_MSG_RESULT(no)
272 fi
9d6b1b96 273 ;;
a423beaf 274*-*-sunos4*)
0c2fb82f 275 CPPFLAGS="$CPPFLAGS -DSUNOS4"
a423beaf 276 AC_CHECK_FUNCS(getpwanam)
adeebd37 277 AC_DEFINE(PAM_SUN_CODEBASE)
32eec038 278 conf_utmp_location=/etc/utmp
279 conf_wtmp_location=/var/adm/wtmp
280 conf_lastlog_location=/var/adm/lastlog
137d7b6c 281 AC_DEFINE(USE_PIPES)
a423beaf 282 ;;
6f68f28a 283*-ncr-sysv*)
284 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
285 LDFLAGS="$LDFLAGS -L/usr/local/lib"
98a7c37b 286 LIBS="$LIBS -lc89"
29525240 287 AC_DEFINE(USE_PIPES)
eabb99c6 288 AC_DEFINE(SSHD_ACQUIRES_CTTY)
6f68f28a 289 ;;
132dd316 290*-sni-sysv*)
0c2fb82f 291 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
c8c15bcb 292 # /usr/ucblib MUST NOT be searched on ReliantUNIX
293 LDFLAGS="$LDFLAGS -L/usr/local/lib"
9548d6c8 294 IPADDR_IN_DISPLAY=yes
295 AC_DEFINE(USE_PIPES)
132dd316 296 AC_DEFINE(IP_TOS_IS_BROKEN)
eabb99c6 297 AC_DEFINE(SSHD_ACQUIRES_CTTY)
95b99395 298 external_path_file=/etc/default/login
c8c15bcb 299 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
300 # Attention: always take care to bind libsocket and libnsl before libc,
301 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
132dd316 302 ;;
77bb0bca 303*-*-sysv4.2*)
0c2fb82f 304 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
77bb0bca 305 LDFLAGS="$LDFLAGS -L/usr/local/lib"
ed6553e2 306 AC_DEFINE(USE_PIPES)
7ed101c0 307 AC_DEFINE(SETEUID_BREAKS_SETUID)
308 AC_DEFINE(BROKEN_SETREUID)
309 AC_DEFINE(BROKEN_SETREGID)
77bb0bca 310 ;;
311*-*-sysv5*)
0c2fb82f 312 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
77bb0bca 313 LDFLAGS="$LDFLAGS -L/usr/local/lib"
ed6553e2 314 AC_DEFINE(USE_PIPES)
7ed101c0 315 AC_DEFINE(SETEUID_BREAKS_SETUID)
316 AC_DEFINE(BROKEN_SETREUID)
317 AC_DEFINE(BROKEN_SETREGID)
77bb0bca 318 ;;
9d6b1b96 319*-*-sysv*)
0c2fb82f 320 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
84afc958 321 LDFLAGS="$LDFLAGS -L/usr/local/lib"
9d6b1b96 322 ;;
77bb0bca 323*-*-sco3.2v4*)
0c2fb82f 324 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
77bb0bca 325 LDFLAGS="$LDFLAGS -L/usr/local/lib"
98a7c37b 326 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
77bb0bca 327 RANLIB=true
ed6553e2 328 no_dev_ptmx=1
77bb0bca 329 AC_DEFINE(BROKEN_SYS_TERMIO_H)
ed6553e2 330 AC_DEFINE(USE_PIPES)
6e879cb4 331 AC_DEFINE(HAVE_SECUREWARE)
d287c664 332 AC_DEFINE(DISABLE_SHADOW)
86b416a7 333 AC_DEFINE(BROKEN_SAVED_UIDS)
bcebad47 334 AC_DEFINE(WITH_ABBREV_NO_TTY)
aca75d94 335 AC_CHECK_FUNCS(getluid setluid)
533875af 336 MANTYPE=man
98a7c37b 337 do_sco3_extra_lib_check=yes
77bb0bca 338 ;;
339*-*-sco3.2v5*)
21710e39 340 if test -z "$GCC"; then
341 CFLAGS="$CFLAGS -belf"
342 fi
0c2fb82f 343 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
509b1f88 344 LDFLAGS="$LDFLAGS -L/usr/local/lib"
ed6553e2 345 LIBS="$LIBS -lprot -lx -ltinfo -lm"
509b1f88 346 no_dev_ptmx=1
ed6553e2 347 AC_DEFINE(USE_PIPES)
6e879cb4 348 AC_DEFINE(HAVE_SECUREWARE)
d287c664 349 AC_DEFINE(DISABLE_SHADOW)
94d8258b 350 AC_DEFINE(DISABLE_FD_PASSING)
7ed101c0 351 AC_DEFINE(SETEUID_BREAKS_SETUID)
352 AC_DEFINE(BROKEN_SETREUID)
353 AC_DEFINE(BROKEN_SETREGID)
bcebad47 354 AC_DEFINE(WITH_ABBREV_NO_TTY)
aca75d94 355 AC_CHECK_FUNCS(getluid setluid)
533875af 356 MANTYPE=man
509b1f88 357 ;;
ccbb983c 358*-*-unicosmk*)
ccbb983c 359 AC_DEFINE(USE_PIPES)
360 AC_DEFINE(DISABLE_FD_PASSING)
361 LDFLAGS="$LDFLAGS"
362 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
363 MANTYPE=cat
d262b7f2 364 ;;
7b9a8c6e 365*-*-unicosmp*)
366 AC_DEFINE(WITH_ABBREV_NO_TTY)
367 AC_DEFINE(USE_PIPES)
368 AC_DEFINE(DISABLE_FD_PASSING)
369 LDFLAGS="$LDFLAGS"
370 LIBS="$LIBS -lgen -lacid"
371 MANTYPE=cat
372 ;;
ca5c7d6a 373*-*-unicos*)
ca5c7d6a 374 AC_DEFINE(USE_PIPES)
94d8258b 375 AC_DEFINE(DISABLE_FD_PASSING)
ef51930f 376 AC_DEFINE(NO_SSH_LASTLOG)
ccbb983c 377 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
378 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
379 MANTYPE=cat
a704dd54 380 ;;
4d33e531 381*-dec-osf*)
99c8ddac 382 AC_MSG_CHECKING(for Digital Unix SIA)
383 no_osfsia=""
384 AC_ARG_WITH(osfsia,
385 [ --with-osfsia Enable Digital Unix SIA],
386 [
387 if test "x$withval" = "xno" ; then
388 AC_MSG_RESULT(disabled)
389 no_osfsia=1
390 fi
391 ],
392 )
393 if test -z "$no_osfsia" ; then
4d33e531 394 if test -f /etc/sia/matrix.conf; then
395 AC_MSG_RESULT(yes)
396 AC_DEFINE(HAVE_OSF_SIA)
397 AC_DEFINE(DISABLE_LOGIN)
58d0df4e 398 AC_DEFINE(DISABLE_FD_PASSING)
4d33e531 399 LIBS="$LIBS -lsecurity -ldb -lm -laud"
400 else
401 AC_MSG_RESULT(no)
402 fi
403 fi
6af8f131 404 AC_DEFINE(DISABLE_FD_PASSING)
a6e67b60 405 AC_DEFINE(BROKEN_GETADDRINFO)
3e6e3da0 406 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
4d33e531 407 ;;
41cb4569 408
409*-*-nto-qnx)
410 AC_DEFINE(USE_PIPES)
411 AC_DEFINE(NO_X11_UNIX_SOCKETS)
412 AC_DEFINE(MISSING_NFDBITS)
413 AC_DEFINE(MISSING_HOWMANY)
414 AC_DEFINE(MISSING_FD_MASK)
415 ;;
a7effaac 416esac
417
8e7b16f8 418# Allow user to specify flags
419AC_ARG_WITH(cflags,
420 [ --with-cflags Specify additional flags to pass to compiler],
421 [
422 if test "x$withval" != "xno" ; then
423 CFLAGS="$CFLAGS $withval"
424 fi
425 ]
426)
0c2fb82f 427AC_ARG_WITH(cppflags,
428 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
429 [
430 if test "x$withval" != "xno"; then
431 CPPFLAGS="$CPPFLAGS $withval"
432 fi
433 ]
434)
8e7b16f8 435AC_ARG_WITH(ldflags,
97b378bf 436 [ --with-ldflags Specify additional flags to pass to linker],
8e7b16f8 437 [
438 if test "x$withval" != "xno" ; then
439 LDFLAGS="$LDFLAGS $withval"
440 fi
441 ]
442)
443AC_ARG_WITH(libs,
444 [ --with-libs Specify additional libraries to link with],
445 [
446 if test "x$withval" != "xno" ; then
447 LIBS="$LIBS $withval"
448 fi
449 ]
450)
451
c5829391 452AC_MSG_CHECKING(compiler and flags for sanity)
453AC_TRY_RUN([
454#include <stdio.h>
455int main(){exit(0);}
456 ],
457 [ AC_MSG_RESULT(yes) ],
458 [
459 AC_MSG_RESULT(no)
460 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
461 ]
462)
463
ddceb1c8 464# Checks for header files.
688eed4a 465AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
af940dcb 466 getopt.h glob.h ia.h lastlog.h limits.h login.h \
ddceb1c8 467 login_cap.h maillock.h netdb.h netgroup.h \
75817f90 468 netinet/in_systm.h paths.h pty.h readpassphrase.h \
5bbbc661 469 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
f58c0e01 470 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
471 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
ad137007 472 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
ef51930f 473 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
ddceb1c8 474 util.h utime.h utmp.h utmpx.h)
475
a0391976 476# Checks for libraries.
98a7c37b 477AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
478AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
2c523de9 479
f61d6b17 480dnl SCO OS3 needs this for libwrap
98a7c37b 481if test "x$with_tcp_wrappers" != "xno" ; then
482 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
483 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
484 fi
485fi
486
446227d6 487dnl IRIX and Solaris 2.5.1 have dirname() in libgen
488AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
489 AC_CHECK_LIB(gen, dirname,[
490 AC_CACHE_CHECK([for broken dirname],
491 ac_cv_have_broken_dirname, [
492 save_LIBS="$LIBS"
493 LIBS="$LIBS -lgen"
494 AC_TRY_RUN(
495 [
496#include <libgen.h>
497#include <string.h>
498
499int main(int argc, char **argv) {
500 char *s, buf[32];
501
502 strncpy(buf,"/etc", 32);
503 s = dirname(buf);
504 if (!s || strncmp(s, "/", 32) != 0) {
505 exit(1);
506 } else {
507 exit(0);
508 }
509}
510 ],
511 [ ac_cv_have_broken_dirname="no" ],
512 [ ac_cv_have_broken_dirname="yes" ]
513 )
514 LIBS="$save_LIBS"
515 ])
516 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
517 LIBS="$LIBS -lgen"
518 AC_DEFINE(HAVE_DIRNAME)
519 AC_CHECK_HEADERS(libgen.h)
520 fi
521 ])
522])
523
524AC_CHECK_FUNC(getspnam, ,
525 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
526AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
527
9d6b6505 528AC_ARG_WITH(rpath,
529 [ --without-rpath Disable auto-added -R linker paths],
530 [
531 if test "x$withval" = "xno" ; then
532 need_dash_r=""
533 fi
534 if test "x$withval" = "xyes" ; then
535 need_dash_r=1
536 fi
537 ]
538)
539
98a7c37b 540dnl zlib is required
541AC_ARG_WITH(zlib,
542 [ --with-zlib=PATH Use zlib in PATH],
543 [
846f83ab 544 if test "x$withval" = "xno" ; then
f1b0ecc3 545 AC_MSG_ERROR([*** zlib is required ***])
546 fi
98a7c37b 547 if test -d "$withval/lib"; then
548 if test -n "${need_dash_r}"; then
5a162955 549 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 550 else
5a162955 551 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 552 fi
553 else
554 if test -n "${need_dash_r}"; then
5a162955 555 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 556 else
5a162955 557 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 558 fi
559 fi
560 if test -d "$withval/include"; then
5a162955 561 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 562 else
5a162955 563 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 564 fi
565 ]
566)
567
051809f6 568AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
48e7916f 569
2c523de9 570dnl UnixWare 2.x
571AC_CHECK_FUNC(strcasecmp,
572 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
573)
574AC_CHECK_FUNC(utimes,
cda1ebcb 575 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
576 LIBS="$LIBS -lc89"]) ]
2c523de9 577)
4cca272e 578
7c6d759d 579dnl Checks for libutil functions
580AC_CHECK_HEADERS(libutil.h)
581AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
582AC_CHECK_FUNCS(logout updwtmp logwtmp)
583
a738c3b0 584AC_FUNC_STRFTIME
585
84ceda19 586# Check for ALTDIRFUNC glob() extension
587AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
588AC_EGREP_CPP(FOUNDIT,
589 [
590 #include <glob.h>
591 #ifdef GLOB_ALTDIRFUNC
592 FOUNDIT
593 #endif
594 ],
595 [
596 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
597 AC_MSG_RESULT(yes)
598 ],
599 [
600 AC_MSG_RESULT(no)
601 ]
602)
4cca272e 603
40849fdb 604# Check for g.gl_matchc glob() extension
605AC_MSG_CHECKING(for gl_matchc field in glob_t)
606AC_EGREP_CPP(FOUNDIT,
607 [
608 #include <glob.h>
609 int main(void){glob_t g; g.gl_matchc = 1;}
610 ],
611 [
612 AC_DEFINE(GLOB_HAS_GL_MATCHC)
613 AC_MSG_RESULT(yes)
614 ],
615 [
616 AC_MSG_RESULT(no)
617 ]
618)
619
edbe6722 620AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
621AC_TRY_RUN(
622 [
623#include <sys/types.h>
624#include <dirent.h>
aec4cb4f 625int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
edbe6722 626 ],
627 [AC_MSG_RESULT(yes)],
628 [
629 AC_MSG_RESULT(no)
630 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
631 ]
632)
633
278588d8 634# Check whether user wants S/Key support
635SKEY_MSG="no"
636AC_ARG_WITH(skey,
98a7c37b 637 [ --with-skey[[=PATH]] Enable S/Key support
638 (optionally in PATH)],
278588d8 639 [
640 if test "x$withval" != "xno" ; then
641
642 if test "x$withval" != "xyes" ; then
643 CPPFLAGS="$CPPFLAGS -I${withval}/include"
644 LDFLAGS="$LDFLAGS -L${withval}/lib"
645 fi
646
647 AC_DEFINE(SKEY)
648 LIBS="-lskey $LIBS"
649 SKEY_MSG="yes"
650
ddceb1c8 651 AC_MSG_CHECKING([for s/key support])
652 AC_TRY_RUN(
653 [
654#include <stdio.h>
655#include <skey.h>
aec4cb4f 656int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
ddceb1c8 657 ],
658 [AC_MSG_RESULT(yes)],
278588d8 659 [
ddceb1c8 660 AC_MSG_RESULT(no)
278588d8 661 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
662 ])
663 fi
664 ]
665)
666
667# Check whether user wants TCP wrappers support
98a7c37b 668TCPW_MSG="no"
278588d8 669AC_ARG_WITH(tcp-wrappers,
98a7c37b 670 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
671 (optionally in PATH)],
278588d8 672 [
673 if test "x$withval" != "xno" ; then
674 saved_LIBS="$LIBS"
98a7c37b 675 saved_LDFLAGS="$LDFLAGS"
676 saved_CPPFLAGS="$CPPFLAGS"
677 if test -n "${withval}" -a "${withval}" != "yes"; then
678 if test -d "${withval}/lib"; then
679 if test -n "${need_dash_r}"; then
5a162955 680 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 681 else
5a162955 682 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 683 fi
684 else
685 if test -n "${need_dash_r}"; then
5a162955 686 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 687 else
5a162955 688 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 689 fi
690 fi
691 if test -d "${withval}/include"; then
5a162955 692 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 693 else
5a162955 694 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 695 fi
98a7c37b 696 fi
ddceb1c8 697 LIBWRAP="-lwrap"
698 LIBS="$LIBWRAP $LIBS"
278588d8 699 AC_MSG_CHECKING(for libwrap)
700 AC_TRY_LINK(
701 [
702#include <tcpd.h>
703 int deny_severity = 0, allow_severity = 0;
704 ],
705 [hosts_access(0);],
706 [
707 AC_MSG_RESULT(yes)
708 AC_DEFINE(LIBWRAP)
ddceb1c8 709 AC_SUBST(LIBWRAP)
98a7c37b 710 TCPW_MSG="yes"
278588d8 711 ],
712 [
713 AC_MSG_ERROR([*** libwrap missing])
714 ]
715 )
ddceb1c8 716 LIBS="$saved_LIBS"
278588d8 717 fi
718 ]
719)
720
19160674 721dnl Checks for library functions. Please keep in alphabetical order
722AC_CHECK_FUNCS(\
48646332 723 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
688eed4a 724 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
19160674 725 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
309709db 726 getpeereid _getpty getrlimit getttyent glob inet_aton \
19160674 727 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
79d4fc55 728 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
729 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
730 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
688eed4a 731 setproctitle setregid setresgid setresuid setreuid setrlimit \
732 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
3490699c 733 strlcat strlcpy strmode strnvis sysconf tcgetpgrp \
5af25b1d 734 truncate utimes vhangup vsnprintf waitpid \
19160674 735)
98a7c37b 736
92b1decf 737AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
738
309709db 739dnl Make sure prototypes are defined for these before using them.
08412d26 740AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
309709db 741AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
08412d26 742
3490699c 743dnl tcsendbreak might be a macro
744AC_CHECK_DECL(tcsendbreak,
745 [AC_DEFINE(HAVE_TCSENDBREAK)],
746 [AC_CHECK_FUNCS(tcsendbreak)],
747 [#include <termios.h>]
748)
749
2e73a022 750dnl Checks for time functions
1d7b9b20 751AC_CHECK_FUNCS(gettimeofday time)
2e73a022 752dnl Checks for utmp functions
b03bd394 753AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1d7b9b20 754AC_CHECK_FUNCS(utmpname)
2e73a022 755dnl Checks for utmpx functions
b03bd394 756AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1d7b9b20 757AC_CHECK_FUNCS(setutxent utmpxname)
76cd7316 758
beb43d31 759AC_CHECK_FUNC(daemon,
760 [AC_DEFINE(HAVE_DAEMON)],
761 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
762)
763
aa6bd60a 764AC_CHECK_FUNC(getpagesize,
765 [AC_DEFINE(HAVE_GETPAGESIZE)],
766 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
767)
768
2647ae26 769# Check for broken snprintf
770if test "x$ac_cv_func_snprintf" = "xyes" ; then
771 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
772 AC_TRY_RUN(
773 [
774#include <stdio.h>
aec4cb4f 775int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
2647ae26 776 ],
777 [AC_MSG_RESULT(yes)],
778 [
779 AC_MSG_RESULT(no)
780 AC_DEFINE(BROKEN_SNPRINTF)
781 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
782 ]
783 )
784fi
785
70e7d0b0 786dnl see whether mkstemp() requires XXXXXX
787if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
788AC_MSG_CHECKING([for (overly) strict mkstemp])
789AC_TRY_RUN(
790 [
791#include <stdlib.h>
792main() { char template[]="conftest.mkstemp-test";
793if (mkstemp(template) == -1)
794 exit(1);
795unlink(template); exit(0);
796}
797 ],
798 [
799 AC_MSG_RESULT(no)
800 ],
801 [
802 AC_MSG_RESULT(yes)
803 AC_DEFINE(HAVE_STRICT_MKSTEMP)
804 ],
805 [
806 AC_MSG_RESULT(yes)
807 AC_DEFINE(HAVE_STRICT_MKSTEMP)
808 ]
809)
810fi
811
eacb954e 812dnl make sure that openpty does not reacquire controlling terminal
813if test ! -z "$check_for_openpty_ctty_bug"; then
814 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
815 AC_TRY_RUN(
816 [
817#include <stdio.h>
818#include <sys/fcntl.h>
819#include <sys/types.h>
820#include <sys/wait.h>
821
822int
823main()
824{
825 pid_t pid;
826 int fd, ptyfd, ttyfd, status;
827
828 pid = fork();
829 if (pid < 0) { /* failed */
830 exit(1);
831 } else if (pid > 0) { /* parent */
832 waitpid(pid, &status, 0);
833 if (WIFEXITED(status))
834 exit(WEXITSTATUS(status));
835 else
836 exit(2);
837 } else { /* child */
838 close(0); close(1); close(2);
839 setsid();
840 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
841 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
842 if (fd >= 0)
843 exit(3); /* Acquired ctty: broken */
844 else
845 exit(0); /* Did not acquire ctty: OK */
846 }
847}
848 ],
849 [
850 AC_MSG_RESULT(yes)
851 ],
852 [
853 AC_MSG_RESULT(no)
854 AC_DEFINE(SSHD_ACQUIRES_CTTY)
855 ]
856 )
857fi
858
7f8f5e00 859AC_FUNC_GETPGRP
860
717057b6 861# Check for PAM libs
cbd7492e 862PAM_MSG="no"
a0391976 863AC_ARG_WITH(pam,
717057b6 864 [ --with-pam Enable PAM support ],
a0391976 865 [
717057b6 866 if test "x$withval" != "xno" ; then
867 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
868 AC_MSG_ERROR([PAM headers not found])
869 fi
a0391976 870
717057b6 871 AC_CHECK_LIB(dl, dlopen, , )
872 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
873 AC_CHECK_FUNCS(pam_getenvlist)
749560dd 874 AC_CHECK_FUNCS(pam_putenv)
2b763e31 875
717057b6 876 disable_shadow=yes
877 PAM_MSG="yes"
4cb5ffa0 878
717057b6 879 AC_DEFINE(USE_PAM)
98f2d9d5 880 if test $ac_cv_lib_dl_dlopen = yes; then
881 LIBPAM="-lpam -ldl"
882 else
883 LIBPAM="-lpam"
884 fi
885 AC_SUBST(LIBPAM)
717057b6 886 fi
887 ]
888)
cbd7492e 889
717057b6 890# Check for older PAM
891if test "x$PAM_MSG" = "xyes" ; then
a0391976 892 # Check PAM strerror arguments (old PAM)
893 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
894 AC_TRY_COMPILE(
895 [
18ba2aab 896#include <stdlib.h>
897#include <security/pam_appl.h>
a0391976 898 ],
899 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
900 [AC_MSG_RESULT(no)],
901 [
902 AC_DEFINE(HAVE_OLD_PAM)
903 AC_MSG_RESULT(yes)
cbd7492e 904 PAM_MSG="yes (old library)"
a0391976 905 ]
717057b6 906 )
a0391976 907fi
908
33e2e066 909# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
910# because the system crypt() is more featureful.
911if test "x$check_for_libcrypt_before" = "x1"; then
912 AC_CHECK_LIB(crypt, crypt)
913fi
914
5b991353 915# Search for OpenSSL
916saved_CPPFLAGS="$CPPFLAGS"
917saved_LDFLAGS="$LDFLAGS"
a0391976 918AC_ARG_WITH(ssl-dir,
919 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
920 [
e9e4a1c7 921 if test "x$withval" != "xno" ; then
5b991353 922 if test -d "$withval/lib"; then
923 if test -n "${need_dash_r}"; then
924 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
925 else
926 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
d6f13fbb 927 fi
928 else
5b991353 929 if test -n "${need_dash_r}"; then
930 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
931 else
932 LDFLAGS="-L${withval} ${LDFLAGS}"
d6f13fbb 933 fi
934 fi
5b991353 935 if test -d "$withval/include"; then
936 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
d6f13fbb 937 else
5b991353 938 CPPFLAGS="-I${withval} ${CPPFLAGS}"
58d100bf 939 fi
a0391976 940 fi
5b991353 941 ]
942)
943LIBS="$LIBS -lcrypto"
944AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
d45e3d76 945 [
5b991353 946 dnl Check default openssl install dir
947 if test -n "${need_dash_r}"; then
948 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 949 else
5b991353 950 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 951 fi
5b991353 952 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
953 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
954 [
955 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
956 ]
957 )
958 ]
959)
960
cd018561 961# Determine OpenSSL header version
962AC_MSG_CHECKING([OpenSSL header version])
963AC_TRY_RUN(
964 [
965#include <stdio.h>
966#include <string.h>
967#include <openssl/opensslv.h>
968#define DATA "conftest.sslincver"
969int main(void) {
970 FILE *fd;
971 int rc;
972
973 fd = fopen(DATA,"w");
974 if(fd == NULL)
975 exit(1);
976
977 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
978 exit(1);
979
980 exit(0);
981}
982 ],
983 [
984 ssl_header_ver=`cat conftest.sslincver`
985 AC_MSG_RESULT($ssl_header_ver)
986 ],
987 [
988 AC_MSG_RESULT(not found)
989 AC_MSG_ERROR(OpenSSL version header not found.)
990 ]
991)
992
993# Determine OpenSSL library version
994AC_MSG_CHECKING([OpenSSL library version])
995AC_TRY_RUN(
996 [
997#include <stdio.h>
998#include <string.h>
999#include <openssl/opensslv.h>
1000#include <openssl/crypto.h>
1001#define DATA "conftest.ssllibver"
1002int main(void) {
1003 FILE *fd;
1004 int rc;
1005
1006 fd = fopen(DATA,"w");
1007 if(fd == NULL)
1008 exit(1);
1009
1010 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1011 exit(1);
1012
1013 exit(0);
1014}
1015 ],
1016 [
1017 ssl_library_ver=`cat conftest.ssllibver`
1018 AC_MSG_RESULT($ssl_library_ver)
1019 ],
1020 [
1021 AC_MSG_RESULT(not found)
1022 AC_MSG_ERROR(OpenSSL library not found.)
1023 ]
1024)
58d100bf 1025
9780116c 1026# Sanity check OpenSSL headers
1027AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1028AC_TRY_RUN(
1029 [
1030#include <string.h>
1031#include <openssl/opensslv.h>
aec4cb4f 1032int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
9780116c 1033 ],
1034 [
1035 AC_MSG_RESULT(yes)
1036 ],
1037 [
1038 AC_MSG_RESULT(no)
e15ba28b 1039 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1040Check config.log for details.
1041Also see contrib/findssl.sh for help identifying header/library mismatches.])
9780116c 1042 ]
1043)
1044
717057b6 1045# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1046# version in OpenSSL. Skip this for PAM
05114c74 1047if test "x$check_for_libcrypt_later" = "x1"; then
20cad736 1048 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 1049fi
1050
f1b0ecc3 1051
1052### Configure cryptographic random number support
1053
1054# Check wheter OpenSSL seeds itself
1055AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1056AC_TRY_RUN(
1057 [
1058#include <string.h>
1059#include <openssl/rand.h>
aec4cb4f 1060int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
f1b0ecc3 1061 ],
1062 [
1063 OPENSSL_SEEDS_ITSELF=yes
1064 AC_MSG_RESULT(yes)
1065 ],
1066 [
1067 AC_MSG_RESULT(no)
1068 # Default to use of the rand helper if OpenSSL doesn't
1069 # seed itself
1070 USE_RAND_HELPER=yes
1071 ]
1072)
1073
1074
1075# Do we want to force the use of the rand helper?
1076AC_ARG_WITH(rand-helper,
1077 [ --with-rand-helper Use subprocess to gather strong randomness ],
1078 [
1079 if test "x$withval" = "xno" ; then
1080 # Force use of OpenSSL's internal RNG, even if
1081 # the previous test showed it to be unseeded.
1082 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1083 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1084 OPENSSL_SEEDS_ITSELF=yes
1085 USE_RAND_HELPER=""
1086 fi
1087 else
1088 USE_RAND_HELPER=yes
1089 fi
1090 ],
1091)
1092
1093# Which randomness source do we use?
1094if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1095 # OpenSSL only
1096 AC_DEFINE(OPENSSL_PRNG_ONLY)
1097 RAND_MSG="OpenSSL internal ONLY"
1098 INSTALL_SSH_RAND_HELPER=""
70e2f2f3 1099elif test ! -z "$USE_RAND_HELPER" ; then
1100 # install rand helper
f1b0ecc3 1101 RAND_MSG="ssh-rand-helper"
1102 INSTALL_SSH_RAND_HELPER="yes"
1103fi
1104AC_SUBST(INSTALL_SSH_RAND_HELPER)
1105
1106### Configuration of ssh-rand-helper
1107
1108# PRNGD TCP socket
1109AC_ARG_WITH(prngd-port,
1110 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1111 [
eb5d7ff6 1112 case "$withval" in
1113 no)
1114 withval=""
1115 ;;
1116 [[0-9]]*)
1117 ;;
1118 *)
1119 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1120 ;;
1121 esac
1122 if test ! -z "$withval" ; then
f1b0ecc3 1123 PRNGD_PORT="$withval"
1124 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1125 fi
1126 ]
1127)
1128
1129# PRNGD Unix domain socket
1130AC_ARG_WITH(prngd-socket,
1131 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1132 [
eb5d7ff6 1133 case "$withval" in
1134 yes)
f1b0ecc3 1135 withval="/var/run/egd-pool"
eb5d7ff6 1136 ;;
1137 no)
1138 withval=""
1139 ;;
1140 /*)
1141 ;;
1142 *)
1143 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1144 ;;
1145 esac
1146
1147 if test ! -z "$withval" ; then
f1b0ecc3 1148 if test ! -z "$PRNGD_PORT" ; then
1149 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1150 fi
906e811b 1151 if test ! -r "$withval" ; then
f1b0ecc3 1152 AC_MSG_WARN(Entropy socket is not readable)
1153 fi
1154 PRNGD_SOCKET="$withval"
1155 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1156 fi
ddceb1c8 1157 ],
1158 [
1159 # Check for existing socket only if we don't have a random device already
1160 if test "$USE_RAND_HELPER" = yes ; then
1161 AC_MSG_CHECKING(for PRNGD/EGD socket)
1162 # Insert other locations here
1163 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1164 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1165 PRNGD_SOCKET="$sock"
1166 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1167 break;
1168 fi
1169 done
1170 if test ! -z "$PRNGD_SOCKET" ; then
1171 AC_MSG_RESULT($PRNGD_SOCKET)
1172 else
1173 AC_MSG_RESULT(not found)
1174 fi
1175 fi
f1b0ecc3 1176 ]
1177)
1178
1179# Change default command timeout for hashing entropy source
1180entropy_timeout=200
1181AC_ARG_WITH(entropy-timeout,
1182 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1183 [
1184 if test "x$withval" != "xno" ; then
1185 entropy_timeout=$withval
1186 fi
1187 ]
1188)
f1b0ecc3 1189AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1190
fd3cbf67 1191SSH_PRIVSEP_USER=sshd
9a0fbcb3 1192AC_ARG_WITH(privsep-user,
5222e7ef 1193 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
9a0fbcb3 1194 [
1195 if test -n "$withval"; then
fd3cbf67 1196 SSH_PRIVSEP_USER=$withval
9a0fbcb3 1197 fi
1198 ]
1199)
fd3cbf67 1200AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1201AC_SUBST(SSH_PRIVSEP_USER)
9a0fbcb3 1202
81dadca3 1203# We do this little dance with the search path to insure
1204# that programs that we select for use by installed programs
1205# (which may be run by the super-user) come from trusted
1206# locations before they come from the user's private area.
1207# This should help avoid accidentally configuring some
1208# random version of a program in someone's personal bin.
1209
1210OPATH=$PATH
1211PATH=/bin:/usr/bin
f95c8ce8 1212test -h /bin 2> /dev/null && PATH=/usr/bin
81dadca3 1213test -d /sbin && PATH=$PATH:/sbin
1214test -d /usr/sbin && PATH=$PATH:/usr/sbin
1215PATH=$PATH:/etc:$OPATH
1216
f1b0ecc3 1217# These programs are used by the command hashing source to gather entropy
1218OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1219OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1220OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1221OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1222OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1223OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1224OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1225OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1226OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1227OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1228OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1229OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1230OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1231OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1232OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1233OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
81dadca3 1234# restore PATH
1235PATH=$OPATH
f1b0ecc3 1236
1237# Where does ssh-rand-helper get its randomness from?
1238INSTALL_SSH_PRNG_CMDS=""
1239if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1240 if test ! -z "$PRNGD_PORT" ; then
1241 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1242 elif test ! -z "$PRNGD_SOCKET" ; then
1243 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1244 else
1245 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1246 RAND_HELPER_CMDHASH=yes
1247 INSTALL_SSH_PRNG_CMDS="yes"
1248 fi
1249fi
1250AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1251
1252
66d6c27e 1253# Cheap hack to ensure NEWS-OS libraries are arranged right.
1254if test ! -z "$SONY" ; then
1255 LIBS="$LIBS -liberty";
1256fi
1257
a0391976 1258# Checks for data types
976f7e19 1259AC_CHECK_SIZEOF(char, 1)
2b942fe0 1260AC_CHECK_SIZEOF(short int, 2)
1261AC_CHECK_SIZEOF(int, 4)
1262AC_CHECK_SIZEOF(long int, 4)
1263AC_CHECK_SIZEOF(long long int, 8)
1264
52f1ccb2 1265# Sanity check long long for some platforms (AIX)
1266if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1267 ac_cv_sizeof_long_long_int=0
1268fi
1269
a0391976 1270# More checks for data types
14a9a859 1271AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1272 AC_TRY_COMPILE(
1273 [ #include <sys/types.h> ],
1274 [ u_int a; a = 1;],
1275 [ ac_cv_have_u_int="yes" ],
1276 [ ac_cv_have_u_int="no" ]
1277 )
1278])
1279if test "x$ac_cv_have_u_int" = "xyes" ; then
1280 AC_DEFINE(HAVE_U_INT)
1281 have_u_int=1
1282fi
1283
58d100bf 1284AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1285 AC_TRY_COMPILE(
1286 [ #include <sys/types.h> ],
1287 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1288 [ ac_cv_have_intxx_t="yes" ],
1289 [ ac_cv_have_intxx_t="no" ]
1290 )
1291])
1292if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1293 AC_DEFINE(HAVE_INTXX_T)
1294 have_intxx_t=1
1295fi
41cb4569 1296
1297if (test -z "$have_intxx_t" && \
1298 test "x$ac_cv_header_stdint_h" = "xyes")
1299then
1300 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1301 AC_TRY_COMPILE(
1302 [ #include <stdint.h> ],
1303 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1304 [
1305 AC_DEFINE(HAVE_INTXX_T)
1306 AC_MSG_RESULT(yes)
1307 ],
1308 [ AC_MSG_RESULT(no) ]
1309 )
1310fi
1311
bd590612 1312AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1313 AC_TRY_COMPILE(
1cbbe6c8 1314 [
1315#include <sys/types.h>
1316#ifdef HAVE_STDINT_H
1317# include <stdint.h>
1318#endif
1319#include <sys/socket.h>
1320#ifdef HAVE_SYS_BITYPES_H
1321# include <sys/bitypes.h>
1322#endif
1323 ],
bd590612 1324 [ int64_t a; a = 1;],
1325 [ ac_cv_have_int64_t="yes" ],
1326 [ ac_cv_have_int64_t="no" ]
1327 )
1328])
1329if test "x$ac_cv_have_int64_t" = "xyes" ; then
1330 AC_DEFINE(HAVE_INT64_T)
ddceb1c8 1331fi
1332
58d100bf 1333AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1334 AC_TRY_COMPILE(
1335 [ #include <sys/types.h> ],
1336 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1337 [ ac_cv_have_u_intxx_t="yes" ],
1338 [ ac_cv_have_u_intxx_t="no" ]
1339 )
1340])
1341if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1342 AC_DEFINE(HAVE_U_INTXX_T)
1343 have_u_intxx_t=1
1344fi
2b942fe0 1345
41cb4569 1346if test -z "$have_u_intxx_t" ; then
1347 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1348 AC_TRY_COMPILE(
1349 [ #include <sys/socket.h> ],
1350 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1351 [
1352 AC_DEFINE(HAVE_U_INTXX_T)
1353 AC_MSG_RESULT(yes)
1354 ],
1355 [ AC_MSG_RESULT(no) ]
1356 )
1357fi
1358
bd590612 1359AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1360 AC_TRY_COMPILE(
1361 [ #include <sys/types.h> ],
1362 [ u_int64_t a; a = 1;],
1363 [ ac_cv_have_u_int64_t="yes" ],
1364 [ ac_cv_have_u_int64_t="no" ]
1365 )
1366])
1367if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1368 AC_DEFINE(HAVE_U_INT64_T)
1369 have_u_int64_t=1
1370fi
1371
ddceb1c8 1372if test -z "$have_u_int64_t" ; then
1373 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1374 AC_TRY_COMPILE(
1375 [ #include <sys/bitypes.h> ],
1376 [ u_int64_t a; a = 1],
1377 [
1378 AC_DEFINE(HAVE_U_INT64_T)
1379 AC_MSG_RESULT(yes)
1380 ],
1381 [ AC_MSG_RESULT(no) ]
1382 )
1383fi
1384
41cb4569 1385if test -z "$have_u_intxx_t" ; then
1386 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1387 AC_TRY_COMPILE(
1388 [
1389#include <sys/types.h>
1390 ],
1391 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1392 [ ac_cv_have_uintxx_t="yes" ],
1393 [ ac_cv_have_uintxx_t="no" ]
1394 )
1395 ])
1396 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1397 AC_DEFINE(HAVE_UINTXX_T)
1398 fi
1399fi
1400
1401if test -z "$have_uintxx_t" ; then
1402 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1403 AC_TRY_COMPILE(
1404 [ #include <stdint.h> ],
1405 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1406 [
1407 AC_DEFINE(HAVE_UINTXX_T)
1408 AC_MSG_RESULT(yes)
1409 ],
1410 [ AC_MSG_RESULT(no) ]
1411 )
1412fi
1413
e5fe9a1f 1414if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1415 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 1416then
1417 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1418 AC_TRY_COMPILE(
58d100bf 1419 [
1420#include <sys/bitypes.h>
1421 ],
5cdfe03f 1422 [
837c30b8 1423 int8_t a; int16_t b; int32_t c;
1424 u_int8_t e; u_int16_t f; u_int32_t g;
1425 a = b = c = e = f = g = 1;
5cdfe03f 1426 ],
1427 [
1428 AC_DEFINE(HAVE_U_INTXX_T)
1429 AC_DEFINE(HAVE_INTXX_T)
1430 AC_MSG_RESULT(yes)
1431 ],
1432 [AC_MSG_RESULT(no)]
1433 )
1434fi
1435
0362750e 1436
1437AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1438 AC_TRY_COMPILE(
1439 [
1440#include <sys/types.h>
1441 ],
1442 [ u_char foo; foo = 125; ],
1443 [ ac_cv_have_u_char="yes" ],
1444 [ ac_cv_have_u_char="no" ]
1445 )
1446])
1447if test "x$ac_cv_have_u_char" = "xyes" ; then
1448 AC_DEFINE(HAVE_U_CHAR)
1449fi
1450
98a7c37b 1451TYPE_SOCKLEN_T
2b942fe0 1452
2d16d9a3 1453AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
ddceb1c8 1454
58d100bf 1455AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1456 AC_TRY_COMPILE(
1457 [
18ba2aab 1458#include <sys/types.h>
58d100bf 1459 ],
1460 [ size_t foo; foo = 1235; ],
1461 [ ac_cv_have_size_t="yes" ],
1462 [ ac_cv_have_size_t="no" ]
1463 )
1464])
1465if test "x$ac_cv_have_size_t" = "xyes" ; then
1466 AC_DEFINE(HAVE_SIZE_T)
1467fi
ea1970a3 1468
c04f75f1 1469AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1470 AC_TRY_COMPILE(
1471 [
1472#include <sys/types.h>
1473 ],
1474 [ ssize_t foo; foo = 1235; ],
1475 [ ac_cv_have_ssize_t="yes" ],
1476 [ ac_cv_have_ssize_t="no" ]
1477 )
1478])
1479if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1480 AC_DEFINE(HAVE_SSIZE_T)
1481fi
1482
f1c4659d 1483AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1484 AC_TRY_COMPILE(
1485 [
1486#include <time.h>
1487 ],
1488 [ clock_t foo; foo = 1235; ],
1489 [ ac_cv_have_clock_t="yes" ],
1490 [ ac_cv_have_clock_t="no" ]
1491 )
1492])
1493if test "x$ac_cv_have_clock_t" = "xyes" ; then
1494 AC_DEFINE(HAVE_CLOCK_T)
1495fi
1496
1c04b088 1497AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1498 AC_TRY_COMPILE(
1499 [
1500#include <sys/types.h>
1501#include <sys/socket.h>
1502 ],
1503 [ sa_family_t foo; foo = 1235; ],
1504 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 1505 [ AC_TRY_COMPILE(
1506 [
1507#include <sys/types.h>
1508#include <sys/socket.h>
1509#include <netinet/in.h>
1510 ],
1511 [ sa_family_t foo; foo = 1235; ],
1512 [ ac_cv_have_sa_family_t="yes" ],
1513
1c04b088 1514 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 1515 )]
1c04b088 1516 )
1517])
1518if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1519 AC_DEFINE(HAVE_SA_FAMILY_T)
1520fi
1521
729bfe59 1522AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1523 AC_TRY_COMPILE(
1524 [
1525#include <sys/types.h>
1526 ],
1527 [ pid_t foo; foo = 1235; ],
1528 [ ac_cv_have_pid_t="yes" ],
1529 [ ac_cv_have_pid_t="no" ]
1530 )
1531])
1532if test "x$ac_cv_have_pid_t" = "xyes" ; then
1533 AC_DEFINE(HAVE_PID_T)
1534fi
1535
1536AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1537 AC_TRY_COMPILE(
1538 [
1539#include <sys/types.h>
1540 ],
1541 [ mode_t foo; foo = 1235; ],
1542 [ ac_cv_have_mode_t="yes" ],
1543 [ ac_cv_have_mode_t="no" ]
1544 )
1545])
1546if test "x$ac_cv_have_mode_t" = "xyes" ; then
1547 AC_DEFINE(HAVE_MODE_T)
1548fi
1549
e3a93db0 1550
58d100bf 1551AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1552 AC_TRY_COMPILE(
1553 [
18ba2aab 1554#include <sys/types.h>
1555#include <sys/socket.h>
58d100bf 1556 ],
1557 [ struct sockaddr_storage s; ],
1558 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1559 [ ac_cv_have_struct_sockaddr_storage="no" ]
1560 )
1561])
1562if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1563 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1564fi
48e671d5 1565
58d100bf 1566AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1567 AC_TRY_COMPILE(
1568 [
cbd7492e 1569#include <sys/types.h>
58d100bf 1570#include <netinet/in.h>
1571 ],
1572 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1573 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1574 [ ac_cv_have_struct_sockaddr_in6="no" ]
1575 )
1576])
1577if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1578 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1579fi
48e671d5 1580
58d100bf 1581AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1582 AC_TRY_COMPILE(
1583 [
cbd7492e 1584#include <sys/types.h>
58d100bf 1585#include <netinet/in.h>
1586 ],
1587 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1588 [ ac_cv_have_struct_in6_addr="yes" ],
1589 [ ac_cv_have_struct_in6_addr="no" ]
1590 )
1591])
1592if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1593 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1594fi
48e671d5 1595
58d100bf 1596AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1597 AC_TRY_COMPILE(
1598 [
18ba2aab 1599#include <sys/types.h>
1600#include <sys/socket.h>
1601#include <netdb.h>
58d100bf 1602 ],
1603 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1604 [ ac_cv_have_struct_addrinfo="yes" ],
1605 [ ac_cv_have_struct_addrinfo="no" ]
1606 )
1607])
1608if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1609 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1610fi
1611
89c7e31c 1612AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1613 AC_TRY_COMPILE(
1614 [ #include <sys/time.h> ],
1615 [ struct timeval tv; tv.tv_sec = 1;],
1616 [ ac_cv_have_struct_timeval="yes" ],
1617 [ ac_cv_have_struct_timeval="no" ]
1618 )
1619])
1620if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1621 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1622 have_struct_timeval=1
1623fi
1624
5271b55c 1625AC_CHECK_TYPES(struct timespec)
1626
85abc74b 1627# We need int64_t or else certian parts of the compile will fail.
2c523de9 1628if test "x$ac_cv_have_int64_t" = "xno" -a \
1629 "x$ac_cv_sizeof_long_int" != "x8" -a \
1630 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
85abc74b 1631 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1632 echo "an alternative compiler (I.E., GCC) before continuing."
1633 echo ""
1634 exit 1;
733cf7f4 1635else
1636dnl test snprintf (broken on SCO w/gcc)
1637 AC_TRY_RUN(
1638 [
1639#include <stdio.h>
1640#include <string.h>
1641#ifdef HAVE_SNPRINTF
1642main()
1643{
1644 char buf[50];
1645 char expected_out[50];
1646 int mazsize = 50 ;
1647#if (SIZEOF_LONG_INT == 8)
1648 long int num = 0x7fffffffffffffff;
1649#else
763a1a18 1650 long long num = 0x7fffffffffffffffll;
733cf7f4 1651#endif
1652 strcpy(expected_out, "9223372036854775807");
1653 snprintf(buf, mazsize, "%lld", num);
1654 if(strcmp(buf, expected_out) != 0)
1655 exit(1);
1656 exit(0);
1657}
1658#else
1659main() { exit(0); }
1660#endif
1661 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1662 )
2c523de9 1663fi
1664
77bb0bca 1665dnl Checks for structure members
58d100bf 1666OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1667OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1668OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1669OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1670OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 1671OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 1672OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1673OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 1674OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 1675OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1676OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1677OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1678OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 1679OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1680OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1681OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1682OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 1683
1684AC_CHECK_MEMBERS([struct stat.st_blksize])
1d7b9b20 1685
58d100bf 1686AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1687 ac_cv_have_ss_family_in_struct_ss, [
1688 AC_TRY_COMPILE(
1689 [
18ba2aab 1690#include <sys/types.h>
1691#include <sys/socket.h>
58d100bf 1692 ],
1693 [ struct sockaddr_storage s; s.ss_family = 1; ],
1694 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1695 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1696 )
1697])
1698if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1699 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1700fi
1701
58d100bf 1702AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1703 ac_cv_have___ss_family_in_struct_ss, [
1704 AC_TRY_COMPILE(
1705 [
18ba2aab 1706#include <sys/types.h>
1707#include <sys/socket.h>
58d100bf 1708 ],
1709 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1710 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1711 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1712 )
1713])
1714if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1715 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1716fi
1717
2e73a022 1718AC_CACHE_CHECK([for pw_class field in struct passwd],
1719 ac_cv_have_pw_class_in_struct_passwd, [
1720 AC_TRY_COMPILE(
1721 [
2e73a022 1722#include <pwd.h>
1723 ],
97994d32 1724 [ struct passwd p; p.pw_class = 0; ],
2e73a022 1725 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1726 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1727 )
1728])
1729if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1730 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1731fi
1732
7751d4eb 1733AC_CACHE_CHECK([for pw_expire field in struct passwd],
1734 ac_cv_have_pw_expire_in_struct_passwd, [
1735 AC_TRY_COMPILE(
1736 [
1737#include <pwd.h>
1738 ],
1739 [ struct passwd p; p.pw_expire = 0; ],
1740 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1741 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1742 )
1743])
1744if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1745 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1746fi
1747
1748AC_CACHE_CHECK([for pw_change field in struct passwd],
1749 ac_cv_have_pw_change_in_struct_passwd, [
1750 AC_TRY_COMPILE(
1751 [
1752#include <pwd.h>
1753 ],
1754 [ struct passwd p; p.pw_change = 0; ],
1755 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1756 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1757 )
1758])
1759if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1760 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1761fi
58d100bf 1762
637f9177 1763dnl make sure we're using the real structure members and not defines
6f34652e 1764AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1765 ac_cv_have_accrights_in_msghdr, [
637f9177 1766 AC_TRY_RUN(
6f34652e 1767 [
f95c8ce8 1768#include <sys/types.h>
6f34652e 1769#include <sys/socket.h>
1770#include <sys/uio.h>
637f9177 1771int main() {
1772#ifdef msg_accrights
1773exit(1);
1774#endif
1775struct msghdr m;
1776m.msg_accrights = 0;
1777exit(0);
1778}
6f34652e 1779 ],
6f34652e 1780 [ ac_cv_have_accrights_in_msghdr="yes" ],
1781 [ ac_cv_have_accrights_in_msghdr="no" ]
1782 )
1783])
1784if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1785 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1786fi
1787
7176df4f 1788AC_CACHE_CHECK([for msg_control field in struct msghdr],
1789 ac_cv_have_control_in_msghdr, [
637f9177 1790 AC_TRY_RUN(
7176df4f 1791 [
f95c8ce8 1792#include <sys/types.h>
7176df4f 1793#include <sys/socket.h>
1794#include <sys/uio.h>
637f9177 1795int main() {
1796#ifdef msg_control
1797exit(1);
1798#endif
1799struct msghdr m;
1800m.msg_control = 0;
1801exit(0);
1802}
7176df4f 1803 ],
7176df4f 1804 [ ac_cv_have_control_in_msghdr="yes" ],
1805 [ ac_cv_have_control_in_msghdr="no" ]
1806 )
1807])
1808if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1809 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1810fi
1811
58d100bf 1812AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1813 AC_TRY_LINK([],
1814 [ extern char *__progname; printf("%s", __progname); ],
1815 [ ac_cv_libc_defines___progname="yes" ],
1816 [ ac_cv_libc_defines___progname="no" ]
1817 )
1818])
1819if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1820 AC_DEFINE(HAVE___PROGNAME)
1821fi
8946db53 1822
c921ee00 1823AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1824 AC_TRY_LINK([
1825#include <stdio.h>
1826],
1827 [ printf("%s", __FUNCTION__); ],
1828 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1829 [ ac_cv_cc_implements___FUNCTION__="no" ]
1830 )
1831])
1832if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1833 AC_DEFINE(HAVE___FUNCTION__)
1834fi
1835
1836AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1837 AC_TRY_LINK([
1838#include <stdio.h>
1839],
1840 [ printf("%s", __func__); ],
1841 [ ac_cv_cc_implements___func__="yes" ],
1842 [ ac_cv_cc_implements___func__="no" ]
1843 )
1844])
1845if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1846 AC_DEFINE(HAVE___func__)
1847fi
1848
1812a662 1849AC_CACHE_CHECK([whether getopt has optreset support],
1850 ac_cv_have_getopt_optreset, [
1851 AC_TRY_LINK(
1852 [
1853#include <getopt.h>
1854 ],
1855 [ extern int optreset; optreset = 0; ],
1856 [ ac_cv_have_getopt_optreset="yes" ],
1857 [ ac_cv_have_getopt_optreset="no" ]
1858 )
1859])
1860if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1861 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1862fi
a0391976 1863
819b676f 1864AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1865 AC_TRY_LINK([],
1866 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1867 [ ac_cv_libc_defines_sys_errlist="yes" ],
1868 [ ac_cv_libc_defines_sys_errlist="no" ]
1869 )
1870])
1871if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1872 AC_DEFINE(HAVE_SYS_ERRLIST)
1873fi
1874
1875
416ed5a7 1876AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1877 AC_TRY_LINK([],
1878 [ extern int sys_nerr; printf("%i", sys_nerr);],
1879 [ ac_cv_libc_defines_sys_nerr="yes" ],
1880 [ ac_cv_libc_defines_sys_nerr="no" ]
1881 )
1882])
1883if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1884 AC_DEFINE(HAVE_SYS_NERR)
1885fi
1886
d0b19c95 1887SCARD_MSG="no"
295c8801 1888# Check whether user wants sectok support
1889AC_ARG_WITH(sectok,
1890 [ --with-sectok Enable smartcard support using libsectok],
d0b19c95 1891 [
1892 if test "x$withval" != "xno" ; then
1893 if test "x$withval" != "xyes" ; then
1894 CPPFLAGS="$CPPFLAGS -I${withval}"
1895 LDFLAGS="$LDFLAGS -L${withval}"
1896 if test ! -z "$need_dash_r" ; then
1897 LDFLAGS="$LDFLAGS -R${withval}"
1898 fi
1899 if test ! -z "$blibpath" ; then
1900 blibpath="$blibpath:${withval}"
1901 fi
1902 fi
1903 AC_CHECK_HEADERS(sectok.h)
1904 if test "$ac_cv_header_sectok_h" != yes; then
1905 AC_MSG_ERROR(Can't find sectok.h)
1906 fi
1907 AC_CHECK_LIB(sectok, sectok_open)
1908 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1909 AC_MSG_ERROR(Can't find libsectok)
1910 fi
1911 AC_DEFINE(SMARTCARD)
295c8801 1912 AC_DEFINE(USE_SECTOK)
1913 SCARD_MSG="yes, using sectok"
1914 fi
1915 ]
1916)
1917
1918# Check whether user wants OpenSC support
1919AC_ARG_WITH(opensc,
49ef62db 1920 AC_HELP_STRING([--with-opensc=PFX],
1921 [Enable smartcard support using OpenSC]),
1922 opensc_config_prefix="$withval", opensc_config_prefix="")
1923if test x$opensc_config_prefix != x ; then
1924 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1925 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1926 if test "$OPENSC_CONFIG" != "no"; then
1927 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1928 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1929 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1930 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1931 AC_DEFINE(SMARTCARD)
1932 AC_DEFINE(USE_OPENSC)
1933 SCARD_MSG="yes, using OpenSC"
1934 fi
1935fi
d0b19c95 1936
3e05e934 1937# Check whether user wants DNS support
1938DNS_MSG="no"
1939AC_ARG_WITH(dns,
1940 [ --with-dns Support for fetching keys from DNS (experimental)],
1941 [
1942 if test "x$withval" != "xno" ; then
4460d509 1943 DNS_MSG="yes"
1944 AC_DEFINE(DNS)
1945 AC_SEARCH_LIBS(getrrsetbyname, resolv,
4e00038c 1946 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1947 [
1948 # Needed by our getrrsetbyname()
1949 AC_SEARCH_LIBS(res_query, resolv)
1950 AC_SEARCH_LIBS(dn_expand, resolv)
252ff4df 1951 AC_CHECK_FUNCS(_getshort _getlong)
078ec045 1952 AC_CHECK_MEMBER(HEADER.ad,
1953 [AC_DEFINE(HAVE_HEADER_AD)],,
1954 [#include <arpa/nameser.h>])
4e00038c 1955 ])
3e05e934 1956 fi
1957 ]
1958)
1959
12928e80 1960# Check whether user wants Kerberos 5 support
1961KRB5_MSG="no"
1962AC_ARG_WITH(kerberos5,
1963 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1964 [
1965 if test "x$withval" != "xno" ; then
1966 if test "x$withval" = "xyes" ; then
1967 KRB5ROOT="/usr/local"
1968 else
1969 KRB5ROOT=${withval}
1970 fi
1971 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1972 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1973 AC_DEFINE(KRB5)
1974 KRB5_MSG="yes"
1975 AC_MSG_CHECKING(whether we are using Heimdal)
1976 AC_TRY_COMPILE([ #include <krb5.h> ],
1977 [ char *tmp = heimdal_version; ],
1978 [ AC_MSG_RESULT(yes)
1979 AC_DEFINE(HEIMDAL)
1980 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1981 ],
1982 [ AC_MSG_RESULT(no)
1983 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1984 ]
1985 )
1986 if test ! -z "$need_dash_r" ; then
1987 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1988 fi
1989 if test ! -z "$blibpath" ; then
1990 blibpath="$blibpath:${KRB5ROOT}/lib"
1991 fi
4e00038c 1992 AC_SEARCH_LIBS(dn_expand, resolv)
12928e80 1993
749560dd 1994 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1995 [ AC_DEFINE(GSSAPI)
1996 K5LIBS="-lgssapi $K5LIBS" ],
1997 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1998 [ AC_DEFINE(GSSAPI)
1999 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
2000 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2001 $K5LIBS)
2002 ],
2003 $K5LIBS)
2004
2005 AC_CHECK_HEADER(gssapi.h, ,
2006 [ unset ac_cv_header_gssapi_h
2007 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2008 AC_CHECK_HEADERS(gssapi.h, ,
2009 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2010 )
2011 ]
2012 )
2013
2014 oldCPP="$CPPFLAGS"
2015 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2016 AC_CHECK_HEADER(gssapi_krb5.h, ,
2017 [ CPPFLAGS="$oldCPP" ])
2018
12928e80 2019 KRB5=yes
2020 fi
2021 ]
2022)
1c590258 2023LIBS="$LIBS $K5LIBS"
b5b68128 2024
a0391976 2025# Looking for programs, paths and files
a0391976 2026
ecac8ee5 2027PRIVSEP_PATH=/var/empty
2028AC_ARG_WITH(privsep-path,
cda1ebcb 2029 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
ecac8ee5 2030 [
2031 if test "x$withval" != "$no" ; then
2032 PRIVSEP_PATH=$withval
2033 fi
2034 ]
2035)
2036AC_SUBST(PRIVSEP_PATH)
2037
a0391976 2038AC_ARG_WITH(xauth,
2039 [ --with-xauth=PATH Specify path to xauth program ],
2040 [
00937921 2041 if test "x$withval" != "xno" ; then
cbd7492e 2042 xauth_path=$withval
a0391976 2043 fi
2044 ],
2045 [
2bf42e4a 2046 TestPath="$PATH"
2047 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2048 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2049 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2050 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2051 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
e5fe9a1f 2052 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 2053 xauth_path="/usr/openwin/bin/xauth"
2054 fi
2055 ]
2056)
2057
65a4b4af 2058STRIP_OPT=-s
2059AC_ARG_ENABLE(strip,
2060 [ --disable-strip Disable calling strip(1) on install],
2061 [
2062 if test "x$enableval" = "xno" ; then
2063 STRIP_OPT=
2064 fi
2065 ]
2066)
2067AC_SUBST(STRIP_OPT)
2068
b3ec54b4 2069if test -z "$xauth_path" ; then
2070 XAUTH_PATH="undefined"
2071 AC_SUBST(XAUTH_PATH)
2072else
a0391976 2073 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
b3ec54b4 2074 XAUTH_PATH=$xauth_path
2075 AC_SUBST(XAUTH_PATH)
a0391976 2076fi
a0391976 2077
2078# Check for mail directory (last resort if we cannot get it from headers)
2079if test ! -z "$MAIL" ; then
2080 maildir=`dirname $MAIL`
2081 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2082fi
2083
a0391976 2084if test -z "$no_dev_ptmx" ; then
6e879cb4 2085 if test "x$disable_ptmx_check" != "xyes" ; then
2086 AC_CHECK_FILE("/dev/ptmx",
2087 [
2088 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2089 have_dev_ptmx=1
2090 ]
2091 )
2092 fi
3276571c 2093fi
2094AC_CHECK_FILE("/dev/ptc",
2095 [
2096 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2097 have_dev_ptc=1
2098 ]
2099)
2100
a0391976 2101# Options from here on. Some of these are preset by platform above
fdf6b7aa 2102AC_ARG_WITH(mantype,
5d97cfbf 2103 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 2104 [
5d97cfbf 2105 case "$withval" in
2106 man|cat|doc)
2107 MANTYPE=$withval
2108 ;;
2109 *)
2110 AC_MSG_ERROR(invalid man type: $withval)
2111 ;;
2112 esac
c54a6257 2113 ]
2114)
e0c4d3ac 2115if test -z "$MANTYPE"; then
2bf42e4a 2116 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2117 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
e0c4d3ac 2118 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2119 MANTYPE=doc
2120 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2121 MANTYPE=man
2122 else
2123 MANTYPE=cat
2124 fi
2125fi
c54a6257 2126AC_SUBST(MANTYPE)
e0c4d3ac 2127if test "$MANTYPE" = "doc"; then
2128 mansubdir=man;
2129else
2130 mansubdir=$MANTYPE;
2131fi
2132AC_SUBST(mansubdir)
0bc5b6fb 2133
a0391976 2134# Check whether to enable MD5 passwords
cbd7492e 2135MD5_MSG="no"
2ddcfdf3 2136AC_ARG_WITH(md5-passwords,
caf3bc51 2137 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 2138 [
bcf36c78 2139 if test "x$withval" != "xno" ; then
0bc5b6fb 2140 AC_DEFINE(HAVE_MD5_PASSWORDS)
cbd7492e 2141 MD5_MSG="yes"
0bc5b6fb 2142 fi
2143 ]
caf3bc51 2144)
2145
a0391976 2146# Whether to disable shadow password support
a7effaac 2147AC_ARG_WITH(shadow,
2148 [ --without-shadow Disable shadow password support],
2149 [
2150 if test "x$withval" = "xno" ; then
2151 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 2152 disable_shadow=yes
a7effaac 2153 fi
2154 ]
2155)
2156
4cb5ffa0 2157if test -z "$disable_shadow" ; then
2158 AC_MSG_CHECKING([if the systems has expire shadow information])
2159 AC_TRY_COMPILE(
2160 [
2161#include <sys/types.h>
2162#include <shadow.h>
2163 struct spwd sp;
2164 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2165 [ sp_expire_available=yes ], []
2166 )
2167
2168 if test "x$sp_expire_available" = "xyes" ; then
2169 AC_MSG_RESULT(yes)
2170 AC_DEFINE(HAS_SHADOW_EXPIRE)
2171 else
2172 AC_MSG_RESULT(no)
2173 fi
2174fi
2175
a0391976 2176# Use ip address instead of hostname in $DISPLAY
44839801 2177if test ! -z "$IPADDR_IN_DISPLAY" ; then
2178 DISPLAY_HACK_MSG="yes"
2179 AC_DEFINE(IPADDR_IN_DISPLAY)
2180else
2181 DISPLAY_HACK_MSG="no"
2182 AC_ARG_WITH(ipaddr-display,
2183 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2184 [
2185 if test "x$withval" != "xno" ; then
2186 AC_DEFINE(IPADDR_IN_DISPLAY)
2187 DISPLAY_HACK_MSG="yes"
2188 fi
2189 ]
2190 )
2191fi
a7effaac 2192
95b99395 2193# check for /etc/default/login and use it if present.
2194AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2195
2196if test "x$external_path_file" = "x/etc/default/login"; then
2197 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2198fi
2199
8d184c09 2200dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2201if test $ac_cv_func_login_getcapbool = "yes" -a \
2202 $ac_cv_header_login_cap_h = "yes" ; then
95b99395 2203 external_path_file=/etc/login.conf
8d184c09 2204fi
95b99395 2205
a0391976 2206# Whether to mess with the default path
cbd7492e 2207SERVER_PATH_MSG="(default)"
c43d69a9 2208AC_ARG_WITH(default-path,
75817f90 2209 [ --with-default-path= Specify default \$PATH environment for server],
cb807f40 2210 [
95b99395 2211 if test "x$external_path_file" = "x/etc/login.conf" ; then
8d184c09 2212 AC_MSG_WARN([
2213--with-default-path=PATH has no effect on this system.
2214Edit /etc/login.conf instead.])
2215 elif test "x$withval" != "xno" ; then
89bbd457 2216 if test ! -z "$external_path_file" ; then
95b99395 2217 AC_MSG_WARN([
2218--with-default-path=PATH will only be used if PATH is not defined in
2219$external_path_file .])
2220 fi
b2d818e6 2221 user_path="$withval"
cbd7492e 2222 SERVER_PATH_MSG="$withval"
cb807f40 2223 fi
b2d818e6 2224 ],
95b99395 2225 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2226 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
8d184c09 2227 else
89bbd457 2228 if test ! -z "$external_path_file" ; then
95b99395 2229 AC_MSG_WARN([
2230If PATH is defined in $external_path_file, ensure the path to scp is included,
2231otherwise scp will not work.])
2232 fi
2233 AC_TRY_RUN(
2234 [
b2d818e6 2235/* find out what STDPATH is */
2236#include <stdio.h>
b2d818e6 2237#ifdef HAVE_PATHS_H
2238# include <paths.h>
2239#endif
2240#ifndef _PATH_STDPATH
d9a4e55b 2241# ifdef _PATH_USERPATH /* Irix */
2242# define _PATH_STDPATH _PATH_USERPATH
2243# else
2244# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2245# endif
b2d818e6 2246#endif
2247#include <sys/types.h>
2248#include <sys/stat.h>
2249#include <fcntl.h>
2250#define DATA "conftest.stdpath"
2251
2252main()
2253{
2254 FILE *fd;
2255 int rc;
2256
2257 fd = fopen(DATA,"w");
2258 if(fd == NULL)
2259 exit(1);
2260
2261 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2262 exit(1);
2263
2264 exit(0);
2265}
2266 ], [ user_path=`cat conftest.stdpath` ],
2267 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2268 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2269 )
2270# make sure $bindir is in USER_PATH so scp will work
2271 t_bindir=`eval echo ${bindir}`
2272 case $t_bindir in
2273 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2274 esac
2275 case $t_bindir in
2276 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2277 esac
2278 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2279 if test $? -ne 0 ; then
2280 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2281 if test $? -ne 0 ; then
2282 user_path=$user_path:$t_bindir
2283 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2284 fi
2285 fi
8d184c09 2286 fi ]
cb807f40 2287)
95b99395 2288if test "x$external_path_file" != "x/etc/login.conf" ; then
8d184c09 2289 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2290 AC_SUBST(user_path)
2291fi
cb807f40 2292
06617857 2293# Set superuser path separately to user path
06617857 2294AC_ARG_WITH(superuser-path,
2295 [ --with-superuser-path= Specify different path for super-user],
2296 [
2297 if test "x$withval" != "xno" ; then
2298 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2299 superuser_path=$withval
2300 fi
2301 ]
2302)
2303
2304
58d100bf 2305AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
cbd7492e 2306IPV4_IN6_HACK_MSG="no"
80faa19f 2307AC_ARG_WITH(4in6,
2308 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2309 [
2310 if test "x$withval" != "xno" ; then
2311 AC_MSG_RESULT(yes)
2312 AC_DEFINE(IPV4_IN_IPV6)
cbd7492e 2313 IPV4_IN6_HACK_MSG="yes"
80faa19f 2314 else
2315 AC_MSG_RESULT(no)
2316 fi
2317 ],[
2318 if test "x$inet6_default_4in6" = "xyes"; then
2319 AC_MSG_RESULT([yes (default)])
2320 AC_DEFINE(IPV4_IN_IPV6)
cbd7492e 2321 IPV4_IN6_HACK_MSG="yes"
80faa19f 2322 else
2323 AC_MSG_RESULT([no (default)])
2324 fi
2325 ]
2326)
2327
af774732 2328# Whether to enable BSD auth support
f1b0ecc3 2329BSD_AUTH_MSG=no
af774732 2330AC_ARG_WITH(bsd-auth,
2331 [ --with-bsd-auth Enable BSD auth support],
2332 [
2333 if test "x$withval" != "xno" ; then
2334 AC_DEFINE(BSD_AUTH)
f1b0ecc3 2335 BSD_AUTH_MSG=yes
af774732 2336 fi
2337 ]
2338)
2339
a0391976 2340# Where to place sshd.pid
19d9ac2a 2341piddir=/var/run
81dadca3 2342# make sure the directory exists
2343if test ! -d $piddir ; then
2344 piddir=`eval echo ${sysconfdir}`
2345 case $piddir in
2346 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2347 esac
2348fi
2349
47e45e44 2350AC_ARG_WITH(pid-dir,
2351 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2352 [
2353 if test "x$withval" != "xno" ; then
19d9ac2a 2354 piddir=$withval
81dadca3 2355 if test ! -d $piddir ; then
2356 AC_MSG_WARN([** no $piddir directory on this system **])
2357 fi
47e45e44 2358 fi
2359 ]
2360)
b7a87eea 2361
42f11eb2 2362AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
19d9ac2a 2363AC_SUBST(piddir)
47e45e44 2364
1d7b9b20 2365dnl allow user to disable some login recording features
2366AC_ARG_ENABLE(lastlog,
bfd550a2 2367 [ --disable-lastlog disable use of lastlog even if detected [no]],
ddb154b3 2368 [
2369 if test "x$enableval" = "xno" ; then
2370 AC_DEFINE(DISABLE_LASTLOG)
2371 fi
2372 ]
1d7b9b20 2373)
2374AC_ARG_ENABLE(utmp,
bfd550a2 2375 [ --disable-utmp disable use of utmp even if detected [no]],
ddb154b3 2376 [
2377 if test "x$enableval" = "xno" ; then
2378 AC_DEFINE(DISABLE_UTMP)
2379 fi
2380 ]
1d7b9b20 2381)
2382AC_ARG_ENABLE(utmpx,
bfd550a2 2383 [ --disable-utmpx disable use of utmpx even if detected [no]],
ddb154b3 2384 [
2385 if test "x$enableval" = "xno" ; then
2386 AC_DEFINE(DISABLE_UTMPX)
2387 fi
2388 ]
1d7b9b20 2389)
2390AC_ARG_ENABLE(wtmp,
bfd550a2 2391 [ --disable-wtmp disable use of wtmp even if detected [no]],
ddb154b3 2392 [
2393 if test "x$enableval" = "xno" ; then
2394 AC_DEFINE(DISABLE_WTMP)
2395 fi
2396 ]
1d7b9b20 2397)
2398AC_ARG_ENABLE(wtmpx,
bfd550a2 2399 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
ddb154b3 2400 [
2401 if test "x$enableval" = "xno" ; then
2402 AC_DEFINE(DISABLE_WTMPX)
2403 fi
2404 ]
1d7b9b20 2405)
2406AC_ARG_ENABLE(libutil,
bfd550a2 2407 [ --disable-libutil disable use of libutil (login() etc.) [no]],
ddb154b3 2408 [
2409 if test "x$enableval" = "xno" ; then
2410 AC_DEFINE(DISABLE_LOGIN)
2411 fi
2412 ]
1d7b9b20 2413)
2414AC_ARG_ENABLE(pututline,
bfd550a2 2415 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
ddb154b3 2416 [
2417 if test "x$enableval" = "xno" ; then
2418 AC_DEFINE(DISABLE_PUTUTLINE)
2419 fi
2420 ]
1d7b9b20 2421)
2422AC_ARG_ENABLE(pututxline,
bfd550a2 2423 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
ddb154b3 2424 [
2425 if test "x$enableval" = "xno" ; then
2426 AC_DEFINE(DISABLE_PUTUTXLINE)
2427 fi
2428 ]
1d7b9b20 2429)
2430AC_ARG_WITH(lastlog,
bfd550a2 2431 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 2432 [
2433 if test "x$withval" = "xno" ; then
2434 AC_DEFINE(DISABLE_LASTLOG)
2435 else
2436 conf_lastlog_location=$withval
2437 fi
2438 ]
2439)
1d7b9b20 2440
2441dnl lastlog, [uw]tmpx? detection
2442dnl NOTE: set the paths in the platform section to avoid the
2443dnl need for command-line parameters
2444dnl lastlog and [uw]tmp are subject to a file search if all else fails
2445
2446dnl lastlog detection
2447dnl NOTE: the code itself will detect if lastlog is a directory
2448AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2449AC_TRY_COMPILE([
2450#include <sys/types.h>
2451#include <utmp.h>
2452#ifdef HAVE_LASTLOG_H
2453# include <lastlog.h>
2454#endif
d7c0f3d5 2455#ifdef HAVE_PATHS_H
1d7b9b20 2456# include <paths.h>
41cb4569 2457#endif
2458#ifdef HAVE_LOGIN_H
2459# include <login.h>
1d7b9b20 2460#endif
2461 ],
2462 [ char *lastlog = LASTLOG_FILE; ],
2463 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 2464 [
2465 AC_MSG_RESULT(no)
2466 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2467 AC_TRY_COMPILE([
2468#include <sys/types.h>
2469#include <utmp.h>
2470#ifdef HAVE_LASTLOG_H
2471# include <lastlog.h>
2472#endif
2473#ifdef HAVE_PATHS_H
2474# include <paths.h>
2475#endif
2476 ],
2477 [ char *lastlog = _PATH_LASTLOG; ],
2478 [ AC_MSG_RESULT(yes) ],
2479 [
f282b668 2480 AC_MSG_RESULT(no)
d7c0f3d5 2481 system_lastlog_path=no
2482 ])
2483 ]
1d7b9b20 2484)
d7c0f3d5 2485
1d7b9b20 2486if test -z "$conf_lastlog_location"; then
2487 if test x"$system_lastlog_path" = x"no" ; then
2488 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 2489 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 2490 conf_lastlog_location=$f
2491 fi
2492 done
2493 if test -z "$conf_lastlog_location"; then
f8119cef 2494 AC_MSG_WARN([** Cannot find lastlog **])
2495 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 2496 fi
2497 fi
2498fi
2499
2500if test -n "$conf_lastlog_location"; then
2501 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2502fi
2503
2504dnl utmp detection
2505AC_MSG_CHECKING([if your system defines UTMP_FILE])
2506AC_TRY_COMPILE([
2507#include <sys/types.h>
2508#include <utmp.h>
d7c0f3d5 2509#ifdef HAVE_PATHS_H
1d7b9b20 2510# include <paths.h>
2511#endif
2512 ],
2513 [ char *utmp = UTMP_FILE; ],
2514 [ AC_MSG_RESULT(yes) ],
2515 [ AC_MSG_RESULT(no)
2516 system_utmp_path=no ]
2517)
2518if test -z "$conf_utmp_location"; then
2519 if test x"$system_utmp_path" = x"no" ; then
2520 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2521 if test -f $f ; then
2522 conf_utmp_location=$f
2523 fi
2524 done
2525 if test -z "$conf_utmp_location"; then
2526 AC_DEFINE(DISABLE_UTMP)
2527 fi
2528 fi
2529fi
2530if test -n "$conf_utmp_location"; then
2531 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2532fi
2533
2534dnl wtmp detection
2535AC_MSG_CHECKING([if your system defines WTMP_FILE])
2536AC_TRY_COMPILE([
2537#include <sys/types.h>
2538#include <utmp.h>
d7c0f3d5 2539#ifdef HAVE_PATHS_H
1d7b9b20 2540# include <paths.h>
2541#endif
2542 ],
2543 [ char *wtmp = WTMP_FILE; ],
2544 [ AC_MSG_RESULT(yes) ],
2545 [ AC_MSG_RESULT(no)
2546 system_wtmp_path=no ]
2547)
2548if test -z "$conf_wtmp_location"; then
2549 if test x"$system_wtmp_path" = x"no" ; then
2550 for f in /usr/adm/wtmp /var/log/wtmp; do
2551 if test -f $f ; then
2552 conf_wtmp_location=$f
2553 fi
2554 done
2555 if test -z "$conf_wtmp_location"; then
2556 AC_DEFINE(DISABLE_WTMP)
2557 fi
2558 fi
2559fi
2560if test -n "$conf_wtmp_location"; then
2561 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2562fi
2563
2564
2565dnl utmpx detection - I don't know any system so perverse as to require
2566dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2567dnl there, though.
2568AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2569AC_TRY_COMPILE([
2570#include <sys/types.h>
2571#include <utmp.h>
2572#ifdef HAVE_UTMPX_H
2573#include <utmpx.h>
2574#endif
d7c0f3d5 2575#ifdef HAVE_PATHS_H
1d7b9b20 2576# include <paths.h>
2577#endif
2578 ],
2579 [ char *utmpx = UTMPX_FILE; ],
2580 [ AC_MSG_RESULT(yes) ],
2581 [ AC_MSG_RESULT(no)
2582 system_utmpx_path=no ]
2583)
2584if test -z "$conf_utmpx_location"; then
2585 if test x"$system_utmpx_path" = x"no" ; then
2586 AC_DEFINE(DISABLE_UTMPX)
2587 fi
2588else
2589 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2590fi
2591
2592dnl wtmpx detection
2593AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2594AC_TRY_COMPILE([
2595#include <sys/types.h>
2596#include <utmp.h>
2597#ifdef HAVE_UTMPX_H
2598#include <utmpx.h>
2599#endif
d7c0f3d5 2600#ifdef HAVE_PATHS_H
1d7b9b20 2601# include <paths.h>
2602#endif
2603 ],
2604 [ char *wtmpx = WTMPX_FILE; ],
2605 [ AC_MSG_RESULT(yes) ],
2606 [ AC_MSG_RESULT(no)
2607 system_wtmpx_path=no ]
2608)
2609if test -z "$conf_wtmpx_location"; then
2610 if test x"$system_wtmpx_path" = x"no" ; then
2611 AC_DEFINE(DISABLE_WTMPX)
2612 fi
2613else
2614 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2615fi
2616
b7a87eea 2617
bd499f9e 2618if test ! -z "$blibpath" ; then
68ece370 2619 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2620 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
bd499f9e 2621fi
2622
ddceb1c8 2623dnl remove pam and dl because they are in $LIBPAM
2624if test "$PAM_MSG" = yes ; then
98f2d9d5 2625 LIBS=`echo $LIBS | sed 's/-lpam //'`
2626fi
2627if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2628 LIBS=`echo $LIBS | sed 's/-ldl //'`
ddceb1c8 2629fi
2630
3c62e7eb 2631AC_EXEEXT
98a7c37b 2632AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2633AC_OUTPUT
d3083fbd 2634
cbd7492e 2635# Print summary of options
2636
cbd7492e 2637# Someone please show me a better way :)
2638A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2639B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2640C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2641D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 2642E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 2643F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 2644G=`eval echo ${piddir}` ; G=`eval echo ${G}`
ecac8ee5 2645H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2646I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2647J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
cbd7492e 2648
2649echo ""
26de7942 2650echo "OpenSSH has been configured with the following options:"
ecac8ee5 2651echo " User binaries: $B"
2652echo " System binaries: $C"
2653echo " Configuration files: $D"
2654echo " Askpass program: $E"
2655echo " Manual pages: $F"
2656echo " PID file: $G"
2657echo " Privilege separation chroot path: $H"
95b99395 2658if test "x$external_path_file" = "x/etc/login.conf" ; then
2659echo " At runtime, sshd will use the path defined in $external_path_file"
2660echo " Make sure the path to scp is present, otherwise scp will not work"
8d184c09 2661else
ecac8ee5 2662echo " sshd default user PATH: $I"
89bbd457 2663 if test ! -z "$external_path_file"; then
95b99395 2664echo " (If PATH is set in $external_path_file it will be used instead. If"
2665echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2666 fi
8d184c09 2667fi
06617857 2668if test ! -z "$superuser_path" ; then
ecac8ee5 2669echo " sshd superuser user PATH: $J"
2670fi
2671echo " Manpage format: $MANTYPE"
3deeea1a 2672echo " DNS support: $DNS_MSG"
3e05e934 2673echo " PAM support: $PAM_MSG"
ecac8ee5 2674echo " KerberosV support: $KRB5_MSG"
2675echo " Smartcard support: $SCARD_MSG"
ecac8ee5 2676echo " S/KEY support: $SKEY_MSG"
2677echo " TCP Wrappers support: $TCPW_MSG"
2678echo " MD5 password support: $MD5_MSG"
3deb1408 2679echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
ecac8ee5 2680echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2681echo " BSD Auth support: $BSD_AUTH_MSG"
2682echo " Random number source: $RAND_MSG"
f1b0ecc3 2683if test ! -z "$USE_RAND_HELPER" ; then
ecac8ee5 2684echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 2685fi
2686
cbd7492e 2687echo ""
2688
0c2fb82f 2689echo " Host: ${host}"
2690echo " Compiler: ${CC}"
2691echo " Compiler flags: ${CFLAGS}"
2692echo "Preprocessor flags: ${CPPFLAGS}"
2693echo " Linker flags: ${LDFLAGS}"
ddceb1c8 2694echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
cbd7492e 2695
2696echo ""
2697
adeebd37 2698if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 2699 echo "PAM is enabled. You may need to install a PAM control file "
2700 echo "for sshd, otherwise password authentication may fail. "
2701 echo "Example PAM control files can be found in the contrib/ "
2702 echo "subdirectory"
adeebd37 2703 echo ""
2704fi
2705
f1b0ecc3 2706if test ! -z "$RAND_HELPER_CMDHASH" ; then
2707 echo "WARNING: you are using the builtin random number collection "
2708 echo "service. Please read WARNING.RNG and request that your OS "
2709 echo "vendor includes kernel-based random number collection in "
2710 echo "future versions of your OS."
2c523de9 2711 echo ""
2712fi
af774732 2713
This page took 0.720822 seconds and 5 git commands to generate.