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