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