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