]> andersk Git - openssh.git/blame - configure.ac
- (bal) [openbsd-compat/bsd-misc.c] unset 'signal' defined if we are
[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
9a3fe0e2 783dnl Some platorms have setresuid that isn't implemented
784AC_MSG_CHECKING(if setresuid seems to work)
785AC_TRY_RUN([
786#include <stdlib.h>
787#include <errno.h>
788int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
789 ],
790 [AC_MSG_RESULT(yes)],
791 [AC_DEFINE(BROKEN_SETRESUID),
792 AC_MSG_RESULT(not implemented)]
793)
794
795dnl Some platorms have setresgid that isn't implemented
796AC_MSG_CHECKING(if setresgid seems to work)
797AC_TRY_RUN([
798#include <stdlib.h>
799#include <errno.h>
800int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
801 ],
802 [AC_MSG_RESULT(yes)],
803 [AC_DEFINE(BROKEN_SETRESGID)
804 AC_MSG_RESULT(not implemented)]
805)
806
2e73a022 807dnl Checks for time functions
1d7b9b20 808AC_CHECK_FUNCS(gettimeofday time)
2e73a022 809dnl Checks for utmp functions
b03bd394 810AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1d7b9b20 811AC_CHECK_FUNCS(utmpname)
2e73a022 812dnl Checks for utmpx functions
b03bd394 813AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1d7b9b20 814AC_CHECK_FUNCS(setutxent utmpxname)
76cd7316 815
aff51935 816AC_CHECK_FUNC(daemon,
beb43d31 817 [AC_DEFINE(HAVE_DAEMON)],
818 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
819)
820
aff51935 821AC_CHECK_FUNC(getpagesize,
aa6bd60a 822 [AC_DEFINE(HAVE_GETPAGESIZE)],
823 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
824)
825
2647ae26 826# Check for broken snprintf
827if test "x$ac_cv_func_snprintf" = "xyes" ; then
828 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
829 AC_TRY_RUN(
830 [
831#include <stdio.h>
aec4cb4f 832int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
2647ae26 833 ],
aff51935 834 [AC_MSG_RESULT(yes)],
2647ae26 835 [
836 AC_MSG_RESULT(no)
837 AC_DEFINE(BROKEN_SNPRINTF)
838 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
839 ]
840 )
841fi
842
70e7d0b0 843dnl see whether mkstemp() requires XXXXXX
844if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
845AC_MSG_CHECKING([for (overly) strict mkstemp])
846AC_TRY_RUN(
847 [
848#include <stdlib.h>
849main() { char template[]="conftest.mkstemp-test";
850if (mkstemp(template) == -1)
851 exit(1);
852unlink(template); exit(0);
853}
854 ],
855 [
856 AC_MSG_RESULT(no)
857 ],
aff51935 858 [
70e7d0b0 859 AC_MSG_RESULT(yes)
860 AC_DEFINE(HAVE_STRICT_MKSTEMP)
861 ],
862 [
863 AC_MSG_RESULT(yes)
864 AC_DEFINE(HAVE_STRICT_MKSTEMP)
aff51935 865 ]
70e7d0b0 866)
867fi
868
eacb954e 869dnl make sure that openpty does not reacquire controlling terminal
870if test ! -z "$check_for_openpty_ctty_bug"; then
871 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
872 AC_TRY_RUN(
873 [
874#include <stdio.h>
875#include <sys/fcntl.h>
876#include <sys/types.h>
877#include <sys/wait.h>
878
879int
880main()
881{
882 pid_t pid;
883 int fd, ptyfd, ttyfd, status;
884
885 pid = fork();
886 if (pid < 0) { /* failed */
887 exit(1);
888 } else if (pid > 0) { /* parent */
889 waitpid(pid, &status, 0);
aff51935 890 if (WIFEXITED(status))
eacb954e 891 exit(WEXITSTATUS(status));
892 else
893 exit(2);
894 } else { /* child */
895 close(0); close(1); close(2);
896 setsid();
897 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
898 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
899 if (fd >= 0)
900 exit(3); /* Acquired ctty: broken */
901 else
902 exit(0); /* Did not acquire ctty: OK */
903 }
904}
905 ],
906 [
907 AC_MSG_RESULT(yes)
908 ],
909 [
910 AC_MSG_RESULT(no)
911 AC_DEFINE(SSHD_ACQUIRES_CTTY)
912 ]
913 )
914fi
915
7f8f5e00 916AC_FUNC_GETPGRP
917
717057b6 918# Check for PAM libs
cbd7492e 919PAM_MSG="no"
a0391976 920AC_ARG_WITH(pam,
717057b6 921 [ --with-pam Enable PAM support ],
a0391976 922 [
717057b6 923 if test "x$withval" != "xno" ; then
924 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
925 AC_MSG_ERROR([PAM headers not found])
926 fi
a0391976 927
717057b6 928 AC_CHECK_LIB(dl, dlopen, , )
929 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
930 AC_CHECK_FUNCS(pam_getenvlist)
749560dd 931 AC_CHECK_FUNCS(pam_putenv)
2b763e31 932
717057b6 933 PAM_MSG="yes"
4cb5ffa0 934
717057b6 935 AC_DEFINE(USE_PAM)
98f2d9d5 936 if test $ac_cv_lib_dl_dlopen = yes; then
937 LIBPAM="-lpam -ldl"
938 else
939 LIBPAM="-lpam"
940 fi
941 AC_SUBST(LIBPAM)
717057b6 942 fi
943 ]
944)
cbd7492e 945
717057b6 946# Check for older PAM
947if test "x$PAM_MSG" = "xyes" ; then
a0391976 948 # Check PAM strerror arguments (old PAM)
949 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
950 AC_TRY_COMPILE(
951 [
18ba2aab 952#include <stdlib.h>
953#include <security/pam_appl.h>
aff51935 954 ],
955 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
a0391976 956 [AC_MSG_RESULT(no)],
957 [
958 AC_DEFINE(HAVE_OLD_PAM)
959 AC_MSG_RESULT(yes)
cbd7492e 960 PAM_MSG="yes (old library)"
a0391976 961 ]
717057b6 962 )
a0391976 963fi
964
33e2e066 965# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
966# because the system crypt() is more featureful.
967if test "x$check_for_libcrypt_before" = "x1"; then
968 AC_CHECK_LIB(crypt, crypt)
969fi
970
5b991353 971# Search for OpenSSL
972saved_CPPFLAGS="$CPPFLAGS"
973saved_LDFLAGS="$LDFLAGS"
a0391976 974AC_ARG_WITH(ssl-dir,
975 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
976 [
e9e4a1c7 977 if test "x$withval" != "xno" ; then
5b991353 978 if test -d "$withval/lib"; then
979 if test -n "${need_dash_r}"; then
980 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
981 else
982 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
d6f13fbb 983 fi
984 else
5b991353 985 if test -n "${need_dash_r}"; then
986 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
987 else
988 LDFLAGS="-L${withval} ${LDFLAGS}"
d6f13fbb 989 fi
990 fi
5b991353 991 if test -d "$withval/include"; then
992 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
d6f13fbb 993 else
5b991353 994 CPPFLAGS="-I${withval} ${CPPFLAGS}"
58d100bf 995 fi
a0391976 996 fi
5b991353 997 ]
998)
999LIBS="$LIBS -lcrypto"
1000AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
d45e3d76 1001 [
5b991353 1002 dnl Check default openssl install dir
1003 if test -n "${need_dash_r}"; then
1004 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1005 else
5b991353 1006 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1007 fi
5b991353 1008 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1009 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1010 [
1011 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1012 ]
1013 )
1014 ]
1015)
1016
cd018561 1017# Determine OpenSSL header version
1018AC_MSG_CHECKING([OpenSSL header version])
1019AC_TRY_RUN(
1020 [
1021#include <stdio.h>
1022#include <string.h>
1023#include <openssl/opensslv.h>
1024#define DATA "conftest.sslincver"
1025int main(void) {
aff51935 1026 FILE *fd;
1027 int rc;
cd018561 1028
aff51935 1029 fd = fopen(DATA,"w");
1030 if(fd == NULL)
1031 exit(1);
cd018561 1032
1033 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1034 exit(1);
1035
1036 exit(0);
1037}
1038 ],
1039 [
1040 ssl_header_ver=`cat conftest.sslincver`
1041 AC_MSG_RESULT($ssl_header_ver)
1042 ],
1043 [
1044 AC_MSG_RESULT(not found)
1045 AC_MSG_ERROR(OpenSSL version header not found.)
1046 ]
1047)
1048
1049# Determine OpenSSL library version
1050AC_MSG_CHECKING([OpenSSL library version])
1051AC_TRY_RUN(
1052 [
1053#include <stdio.h>
1054#include <string.h>
1055#include <openssl/opensslv.h>
1056#include <openssl/crypto.h>
1057#define DATA "conftest.ssllibver"
1058int main(void) {
aff51935 1059 FILE *fd;
1060 int rc;
cd018561 1061
aff51935 1062 fd = fopen(DATA,"w");
1063 if(fd == NULL)
1064 exit(1);
cd018561 1065
1066 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1067 exit(1);
1068
1069 exit(0);
1070}
1071 ],
1072 [
1073 ssl_library_ver=`cat conftest.ssllibver`
1074 AC_MSG_RESULT($ssl_library_ver)
1075 ],
1076 [
1077 AC_MSG_RESULT(not found)
1078 AC_MSG_ERROR(OpenSSL library not found.)
1079 ]
1080)
58d100bf 1081
9780116c 1082# Sanity check OpenSSL headers
1083AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1084AC_TRY_RUN(
1085 [
1086#include <string.h>
1087#include <openssl/opensslv.h>
aec4cb4f 1088int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
9780116c 1089 ],
1090 [
1091 AC_MSG_RESULT(yes)
1092 ],
1093 [
1094 AC_MSG_RESULT(no)
e15ba28b 1095 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1096Check config.log for details.
1097Also see contrib/findssl.sh for help identifying header/library mismatches.])
9780116c 1098 ]
1099)
1100
aff51935 1101# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
717057b6 1102# version in OpenSSL. Skip this for PAM
05114c74 1103if test "x$check_for_libcrypt_later" = "x1"; then
20cad736 1104 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 1105fi
1106
f1b0ecc3 1107
1108### Configure cryptographic random number support
1109
1110# Check wheter OpenSSL seeds itself
1111AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1112AC_TRY_RUN(
1113 [
1114#include <string.h>
1115#include <openssl/rand.h>
aec4cb4f 1116int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
f1b0ecc3 1117 ],
1118 [
1119 OPENSSL_SEEDS_ITSELF=yes
1120 AC_MSG_RESULT(yes)
1121 ],
1122 [
1123 AC_MSG_RESULT(no)
1124 # Default to use of the rand helper if OpenSSL doesn't
1125 # seed itself
1126 USE_RAND_HELPER=yes
1127 ]
1128)
1129
1130
1131# Do we want to force the use of the rand helper?
1132AC_ARG_WITH(rand-helper,
1133 [ --with-rand-helper Use subprocess to gather strong randomness ],
1134 [
1135 if test "x$withval" = "xno" ; then
aff51935 1136 # Force use of OpenSSL's internal RNG, even if
f1b0ecc3 1137 # the previous test showed it to be unseeded.
1138 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1139 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1140 OPENSSL_SEEDS_ITSELF=yes
1141 USE_RAND_HELPER=""
1142 fi
1143 else
1144 USE_RAND_HELPER=yes
1145 fi
1146 ],
1147)
1148
1149# Which randomness source do we use?
1150if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1151 # OpenSSL only
1152 AC_DEFINE(OPENSSL_PRNG_ONLY)
1153 RAND_MSG="OpenSSL internal ONLY"
1154 INSTALL_SSH_RAND_HELPER=""
70e2f2f3 1155elif test ! -z "$USE_RAND_HELPER" ; then
1156 # install rand helper
f1b0ecc3 1157 RAND_MSG="ssh-rand-helper"
1158 INSTALL_SSH_RAND_HELPER="yes"
1159fi
1160AC_SUBST(INSTALL_SSH_RAND_HELPER)
1161
1162### Configuration of ssh-rand-helper
1163
1164# PRNGD TCP socket
1165AC_ARG_WITH(prngd-port,
1166 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1167 [
eb5d7ff6 1168 case "$withval" in
1169 no)
1170 withval=""
1171 ;;
1172 [[0-9]]*)
1173 ;;
1174 *)
1175 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1176 ;;
1177 esac
1178 if test ! -z "$withval" ; then
f1b0ecc3 1179 PRNGD_PORT="$withval"
1180 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1181 fi
1182 ]
1183)
1184
1185# PRNGD Unix domain socket
1186AC_ARG_WITH(prngd-socket,
1187 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1188 [
eb5d7ff6 1189 case "$withval" in
1190 yes)
f1b0ecc3 1191 withval="/var/run/egd-pool"
eb5d7ff6 1192 ;;
1193 no)
1194 withval=""
1195 ;;
1196 /*)
1197 ;;
1198 *)
1199 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1200 ;;
1201 esac
1202
1203 if test ! -z "$withval" ; then
f1b0ecc3 1204 if test ! -z "$PRNGD_PORT" ; then
1205 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1206 fi
906e811b 1207 if test ! -r "$withval" ; then
f1b0ecc3 1208 AC_MSG_WARN(Entropy socket is not readable)
1209 fi
1210 PRNGD_SOCKET="$withval"
1211 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1212 fi
ddceb1c8 1213 ],
1214 [
1215 # Check for existing socket only if we don't have a random device already
1216 if test "$USE_RAND_HELPER" = yes ; then
1217 AC_MSG_CHECKING(for PRNGD/EGD socket)
1218 # Insert other locations here
1219 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1220 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1221 PRNGD_SOCKET="$sock"
1222 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1223 break;
1224 fi
1225 done
1226 if test ! -z "$PRNGD_SOCKET" ; then
1227 AC_MSG_RESULT($PRNGD_SOCKET)
1228 else
1229 AC_MSG_RESULT(not found)
1230 fi
1231 fi
f1b0ecc3 1232 ]
1233)
1234
1235# Change default command timeout for hashing entropy source
1236entropy_timeout=200
1237AC_ARG_WITH(entropy-timeout,
1238 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1239 [
1240 if test "x$withval" != "xno" ; then
1241 entropy_timeout=$withval
1242 fi
1243 ]
1244)
f1b0ecc3 1245AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1246
fd3cbf67 1247SSH_PRIVSEP_USER=sshd
9a0fbcb3 1248AC_ARG_WITH(privsep-user,
5222e7ef 1249 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
9a0fbcb3 1250 [
1251 if test -n "$withval"; then
fd3cbf67 1252 SSH_PRIVSEP_USER=$withval
9a0fbcb3 1253 fi
1254 ]
1255)
fd3cbf67 1256AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1257AC_SUBST(SSH_PRIVSEP_USER)
9a0fbcb3 1258
81dadca3 1259# We do this little dance with the search path to insure
1260# that programs that we select for use by installed programs
1261# (which may be run by the super-user) come from trusted
1262# locations before they come from the user's private area.
1263# This should help avoid accidentally configuring some
1264# random version of a program in someone's personal bin.
1265
1266OPATH=$PATH
1267PATH=/bin:/usr/bin
f95c8ce8 1268test -h /bin 2> /dev/null && PATH=/usr/bin
81dadca3 1269test -d /sbin && PATH=$PATH:/sbin
1270test -d /usr/sbin && PATH=$PATH:/usr/sbin
1271PATH=$PATH:/etc:$OPATH
1272
aff51935 1273# These programs are used by the command hashing source to gather entropy
f1b0ecc3 1274OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1275OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1276OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1277OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1278OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1279OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1280OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1281OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1282OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1283OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1284OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1285OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1286OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1287OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1288OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1289OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
81dadca3 1290# restore PATH
1291PATH=$OPATH
f1b0ecc3 1292
1293# Where does ssh-rand-helper get its randomness from?
1294INSTALL_SSH_PRNG_CMDS=""
1295if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1296 if test ! -z "$PRNGD_PORT" ; then
1297 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1298 elif test ! -z "$PRNGD_SOCKET" ; then
1299 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1300 else
1301 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1302 RAND_HELPER_CMDHASH=yes
1303 INSTALL_SSH_PRNG_CMDS="yes"
1304 fi
1305fi
1306AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1307
1308
66d6c27e 1309# Cheap hack to ensure NEWS-OS libraries are arranged right.
1310if test ! -z "$SONY" ; then
1311 LIBS="$LIBS -liberty";
1312fi
1313
a0391976 1314# Checks for data types
976f7e19 1315AC_CHECK_SIZEOF(char, 1)
2b942fe0 1316AC_CHECK_SIZEOF(short int, 2)
1317AC_CHECK_SIZEOF(int, 4)
1318AC_CHECK_SIZEOF(long int, 4)
1319AC_CHECK_SIZEOF(long long int, 8)
1320
52f1ccb2 1321# Sanity check long long for some platforms (AIX)
1322if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1323 ac_cv_sizeof_long_long_int=0
1324fi
1325
a0391976 1326# More checks for data types
14a9a859 1327AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1328 AC_TRY_COMPILE(
aff51935 1329 [ #include <sys/types.h> ],
1330 [ u_int a; a = 1;],
14a9a859 1331 [ ac_cv_have_u_int="yes" ],
1332 [ ac_cv_have_u_int="no" ]
1333 )
1334])
1335if test "x$ac_cv_have_u_int" = "xyes" ; then
1336 AC_DEFINE(HAVE_U_INT)
1337 have_u_int=1
1338fi
1339
58d100bf 1340AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1341 AC_TRY_COMPILE(
aff51935 1342 [ #include <sys/types.h> ],
1343 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
58d100bf 1344 [ ac_cv_have_intxx_t="yes" ],
1345 [ ac_cv_have_intxx_t="no" ]
1346 )
1347])
1348if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1349 AC_DEFINE(HAVE_INTXX_T)
1350 have_intxx_t=1
1351fi
41cb4569 1352
1353if (test -z "$have_intxx_t" && \
aff51935 1354 test "x$ac_cv_header_stdint_h" = "xyes")
41cb4569 1355then
1356 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1357 AC_TRY_COMPILE(
aff51935 1358 [ #include <stdint.h> ],
1359 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
41cb4569 1360 [
1361 AC_DEFINE(HAVE_INTXX_T)
1362 AC_MSG_RESULT(yes)
1363 ],
1364 [ AC_MSG_RESULT(no) ]
1365 )
1366fi
1367
bd590612 1368AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1369 AC_TRY_COMPILE(
1cbbe6c8 1370 [
1371#include <sys/types.h>
1372#ifdef HAVE_STDINT_H
1373# include <stdint.h>
1374#endif
1375#include <sys/socket.h>
1376#ifdef HAVE_SYS_BITYPES_H
1377# include <sys/bitypes.h>
1378#endif
aff51935 1379 ],
1380 [ int64_t a; a = 1;],
bd590612 1381 [ ac_cv_have_int64_t="yes" ],
1382 [ ac_cv_have_int64_t="no" ]
1383 )
1384])
1385if test "x$ac_cv_have_int64_t" = "xyes" ; then
1386 AC_DEFINE(HAVE_INT64_T)
ddceb1c8 1387fi
1388
58d100bf 1389AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1390 AC_TRY_COMPILE(
aff51935 1391 [ #include <sys/types.h> ],
1392 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
58d100bf 1393 [ ac_cv_have_u_intxx_t="yes" ],
1394 [ ac_cv_have_u_intxx_t="no" ]
1395 )
1396])
1397if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1398 AC_DEFINE(HAVE_U_INTXX_T)
1399 have_u_intxx_t=1
1400fi
2b942fe0 1401
41cb4569 1402if test -z "$have_u_intxx_t" ; then
1403 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1404 AC_TRY_COMPILE(
aff51935 1405 [ #include <sys/socket.h> ],
1406 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
41cb4569 1407 [
1408 AC_DEFINE(HAVE_U_INTXX_T)
1409 AC_MSG_RESULT(yes)
1410 ],
1411 [ AC_MSG_RESULT(no) ]
1412 )
1413fi
1414
bd590612 1415AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1416 AC_TRY_COMPILE(
aff51935 1417 [ #include <sys/types.h> ],
1418 [ u_int64_t a; a = 1;],
bd590612 1419 [ ac_cv_have_u_int64_t="yes" ],
1420 [ ac_cv_have_u_int64_t="no" ]
1421 )
1422])
1423if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1424 AC_DEFINE(HAVE_U_INT64_T)
1425 have_u_int64_t=1
1426fi
1427
ddceb1c8 1428if test -z "$have_u_int64_t" ; then
1429 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1430 AC_TRY_COMPILE(
aff51935 1431 [ #include <sys/bitypes.h> ],
ddceb1c8 1432 [ u_int64_t a; a = 1],
1433 [
1434 AC_DEFINE(HAVE_U_INT64_T)
1435 AC_MSG_RESULT(yes)
1436 ],
1437 [ AC_MSG_RESULT(no) ]
1438 )
1439fi
1440
41cb4569 1441if test -z "$have_u_intxx_t" ; then
1442 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1443 AC_TRY_COMPILE(
1444 [
1445#include <sys/types.h>
aff51935 1446 ],
1447 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
41cb4569 1448 [ ac_cv_have_uintxx_t="yes" ],
1449 [ ac_cv_have_uintxx_t="no" ]
1450 )
1451 ])
1452 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1453 AC_DEFINE(HAVE_UINTXX_T)
1454 fi
1455fi
1456
1457if test -z "$have_uintxx_t" ; then
1458 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1459 AC_TRY_COMPILE(
aff51935 1460 [ #include <stdint.h> ],
1461 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
41cb4569 1462 [
1463 AC_DEFINE(HAVE_UINTXX_T)
1464 AC_MSG_RESULT(yes)
1465 ],
1466 [ AC_MSG_RESULT(no) ]
1467 )
1468fi
1469
e5fe9a1f 1470if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
aff51935 1471 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 1472then
1473 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1474 AC_TRY_COMPILE(
58d100bf 1475 [
1476#include <sys/bitypes.h>
aff51935 1477 ],
5cdfe03f 1478 [
837c30b8 1479 int8_t a; int16_t b; int32_t c;
1480 u_int8_t e; u_int16_t f; u_int32_t g;
1481 a = b = c = e = f = g = 1;
aff51935 1482 ],
5cdfe03f 1483 [
1484 AC_DEFINE(HAVE_U_INTXX_T)
1485 AC_DEFINE(HAVE_INTXX_T)
1486 AC_MSG_RESULT(yes)
1487 ],
1488 [AC_MSG_RESULT(no)]
aff51935 1489 )
5cdfe03f 1490fi
1491
0362750e 1492
1493AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1494 AC_TRY_COMPILE(
1495 [
1496#include <sys/types.h>
1497 ],
1498 [ u_char foo; foo = 125; ],
1499 [ ac_cv_have_u_char="yes" ],
1500 [ ac_cv_have_u_char="no" ]
1501 )
1502])
1503if test "x$ac_cv_have_u_char" = "xyes" ; then
1504 AC_DEFINE(HAVE_U_CHAR)
1505fi
1506
98a7c37b 1507TYPE_SOCKLEN_T
2b942fe0 1508
2d16d9a3 1509AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
ddceb1c8 1510
58d100bf 1511AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1512 AC_TRY_COMPILE(
1513 [
18ba2aab 1514#include <sys/types.h>
58d100bf 1515 ],
1516 [ size_t foo; foo = 1235; ],
1517 [ ac_cv_have_size_t="yes" ],
1518 [ ac_cv_have_size_t="no" ]
1519 )
1520])
1521if test "x$ac_cv_have_size_t" = "xyes" ; then
1522 AC_DEFINE(HAVE_SIZE_T)
1523fi
ea1970a3 1524
c04f75f1 1525AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1526 AC_TRY_COMPILE(
1527 [
1528#include <sys/types.h>
1529 ],
1530 [ ssize_t foo; foo = 1235; ],
1531 [ ac_cv_have_ssize_t="yes" ],
1532 [ ac_cv_have_ssize_t="no" ]
1533 )
1534])
1535if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1536 AC_DEFINE(HAVE_SSIZE_T)
1537fi
1538
f1c4659d 1539AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1540 AC_TRY_COMPILE(
1541 [
1542#include <time.h>
1543 ],
1544 [ clock_t foo; foo = 1235; ],
1545 [ ac_cv_have_clock_t="yes" ],
1546 [ ac_cv_have_clock_t="no" ]
1547 )
1548])
1549if test "x$ac_cv_have_clock_t" = "xyes" ; then
1550 AC_DEFINE(HAVE_CLOCK_T)
1551fi
1552
1c04b088 1553AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1554 AC_TRY_COMPILE(
1555 [
1556#include <sys/types.h>
1557#include <sys/socket.h>
1558 ],
1559 [ sa_family_t foo; foo = 1235; ],
1560 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 1561 [ AC_TRY_COMPILE(
1562 [
1563#include <sys/types.h>
1564#include <sys/socket.h>
1565#include <netinet/in.h>
1566 ],
1567 [ sa_family_t foo; foo = 1235; ],
1568 [ ac_cv_have_sa_family_t="yes" ],
1569
1c04b088 1570 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 1571 )]
1c04b088 1572 )
1573])
1574if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1575 AC_DEFINE(HAVE_SA_FAMILY_T)
1576fi
1577
729bfe59 1578AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1579 AC_TRY_COMPILE(
1580 [
1581#include <sys/types.h>
1582 ],
1583 [ pid_t foo; foo = 1235; ],
1584 [ ac_cv_have_pid_t="yes" ],
1585 [ ac_cv_have_pid_t="no" ]
1586 )
1587])
1588if test "x$ac_cv_have_pid_t" = "xyes" ; then
1589 AC_DEFINE(HAVE_PID_T)
1590fi
1591
1592AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1593 AC_TRY_COMPILE(
1594 [
1595#include <sys/types.h>
1596 ],
1597 [ mode_t foo; foo = 1235; ],
1598 [ ac_cv_have_mode_t="yes" ],
1599 [ ac_cv_have_mode_t="no" ]
1600 )
1601])
1602if test "x$ac_cv_have_mode_t" = "xyes" ; then
1603 AC_DEFINE(HAVE_MODE_T)
1604fi
1605
e3a93db0 1606
58d100bf 1607AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1608 AC_TRY_COMPILE(
1609 [
18ba2aab 1610#include <sys/types.h>
1611#include <sys/socket.h>
58d100bf 1612 ],
1613 [ struct sockaddr_storage s; ],
1614 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1615 [ ac_cv_have_struct_sockaddr_storage="no" ]
1616 )
1617])
1618if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1619 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1620fi
48e671d5 1621
58d100bf 1622AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1623 AC_TRY_COMPILE(
1624 [
cbd7492e 1625#include <sys/types.h>
58d100bf 1626#include <netinet/in.h>
1627 ],
1628 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1629 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1630 [ ac_cv_have_struct_sockaddr_in6="no" ]
1631 )
1632])
1633if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1634 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1635fi
48e671d5 1636
58d100bf 1637AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1638 AC_TRY_COMPILE(
1639 [
cbd7492e 1640#include <sys/types.h>
58d100bf 1641#include <netinet/in.h>
1642 ],
1643 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1644 [ ac_cv_have_struct_in6_addr="yes" ],
1645 [ ac_cv_have_struct_in6_addr="no" ]
1646 )
1647])
1648if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1649 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1650fi
48e671d5 1651
58d100bf 1652AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1653 AC_TRY_COMPILE(
1654 [
18ba2aab 1655#include <sys/types.h>
1656#include <sys/socket.h>
1657#include <netdb.h>
58d100bf 1658 ],
1659 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1660 [ ac_cv_have_struct_addrinfo="yes" ],
1661 [ ac_cv_have_struct_addrinfo="no" ]
1662 )
1663])
1664if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1665 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1666fi
1667
89c7e31c 1668AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1669 AC_TRY_COMPILE(
aff51935 1670 [ #include <sys/time.h> ],
1671 [ struct timeval tv; tv.tv_sec = 1;],
89c7e31c 1672 [ ac_cv_have_struct_timeval="yes" ],
1673 [ ac_cv_have_struct_timeval="no" ]
1674 )
1675])
1676if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1677 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1678 have_struct_timeval=1
1679fi
1680
5271b55c 1681AC_CHECK_TYPES(struct timespec)
1682
85abc74b 1683# We need int64_t or else certian parts of the compile will fail.
2c523de9 1684if test "x$ac_cv_have_int64_t" = "xno" -a \
1685 "x$ac_cv_sizeof_long_int" != "x8" -a \
1686 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
85abc74b 1687 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1688 echo "an alternative compiler (I.E., GCC) before continuing."
1689 echo ""
1690 exit 1;
733cf7f4 1691else
1692dnl test snprintf (broken on SCO w/gcc)
1693 AC_TRY_RUN(
1694 [
1695#include <stdio.h>
1696#include <string.h>
1697#ifdef HAVE_SNPRINTF
1698main()
1699{
1700 char buf[50];
1701 char expected_out[50];
1702 int mazsize = 50 ;
1703#if (SIZEOF_LONG_INT == 8)
1704 long int num = 0x7fffffffffffffff;
1705#else
763a1a18 1706 long long num = 0x7fffffffffffffffll;
733cf7f4 1707#endif
1708 strcpy(expected_out, "9223372036854775807");
1709 snprintf(buf, mazsize, "%lld", num);
1710 if(strcmp(buf, expected_out) != 0)
aff51935 1711 exit(1);
733cf7f4 1712 exit(0);
1713}
1714#else
1715main() { exit(0); }
1716#endif
1717 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1718 )
2c523de9 1719fi
1720
77bb0bca 1721dnl Checks for structure members
58d100bf 1722OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1723OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1724OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1725OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1726OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 1727OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 1728OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1729OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 1730OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 1731OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1732OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1733OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1734OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 1735OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1736OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1737OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1738OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 1739
1740AC_CHECK_MEMBERS([struct stat.st_blksize])
1d7b9b20 1741
58d100bf 1742AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1743 ac_cv_have_ss_family_in_struct_ss, [
1744 AC_TRY_COMPILE(
1745 [
18ba2aab 1746#include <sys/types.h>
1747#include <sys/socket.h>
58d100bf 1748 ],
1749 [ struct sockaddr_storage s; s.ss_family = 1; ],
1750 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1751 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1752 )
1753])
1754if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1755 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1756fi
1757
58d100bf 1758AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1759 ac_cv_have___ss_family_in_struct_ss, [
1760 AC_TRY_COMPILE(
1761 [
18ba2aab 1762#include <sys/types.h>
1763#include <sys/socket.h>
58d100bf 1764 ],
1765 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1766 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1767 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1768 )
1769])
1770if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1771 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1772fi
1773
2e73a022 1774AC_CACHE_CHECK([for pw_class field in struct passwd],
1775 ac_cv_have_pw_class_in_struct_passwd, [
1776 AC_TRY_COMPILE(
1777 [
2e73a022 1778#include <pwd.h>
1779 ],
97994d32 1780 [ struct passwd p; p.pw_class = 0; ],
2e73a022 1781 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1782 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1783 )
1784])
1785if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1786 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1787fi
1788
7751d4eb 1789AC_CACHE_CHECK([for pw_expire field in struct passwd],
1790 ac_cv_have_pw_expire_in_struct_passwd, [
1791 AC_TRY_COMPILE(
1792 [
1793#include <pwd.h>
1794 ],
1795 [ struct passwd p; p.pw_expire = 0; ],
1796 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1797 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1798 )
1799])
1800if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1801 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1802fi
1803
1804AC_CACHE_CHECK([for pw_change field in struct passwd],
1805 ac_cv_have_pw_change_in_struct_passwd, [
1806 AC_TRY_COMPILE(
1807 [
1808#include <pwd.h>
1809 ],
1810 [ struct passwd p; p.pw_change = 0; ],
1811 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1812 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1813 )
1814])
1815if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1816 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1817fi
58d100bf 1818
637f9177 1819dnl make sure we're using the real structure members and not defines
6f34652e 1820AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1821 ac_cv_have_accrights_in_msghdr, [
637f9177 1822 AC_TRY_RUN(
6f34652e 1823 [
f95c8ce8 1824#include <sys/types.h>
6f34652e 1825#include <sys/socket.h>
1826#include <sys/uio.h>
637f9177 1827int main() {
1828#ifdef msg_accrights
1829exit(1);
1830#endif
1831struct msghdr m;
1832m.msg_accrights = 0;
1833exit(0);
1834}
6f34652e 1835 ],
6f34652e 1836 [ ac_cv_have_accrights_in_msghdr="yes" ],
1837 [ ac_cv_have_accrights_in_msghdr="no" ]
1838 )
1839])
1840if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1841 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1842fi
1843
7176df4f 1844AC_CACHE_CHECK([for msg_control field in struct msghdr],
1845 ac_cv_have_control_in_msghdr, [
637f9177 1846 AC_TRY_RUN(
7176df4f 1847 [
f95c8ce8 1848#include <sys/types.h>
7176df4f 1849#include <sys/socket.h>
1850#include <sys/uio.h>
637f9177 1851int main() {
1852#ifdef msg_control
1853exit(1);
1854#endif
1855struct msghdr m;
1856m.msg_control = 0;
1857exit(0);
1858}
7176df4f 1859 ],
7176df4f 1860 [ ac_cv_have_control_in_msghdr="yes" ],
1861 [ ac_cv_have_control_in_msghdr="no" ]
1862 )
1863])
1864if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1865 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1866fi
1867
58d100bf 1868AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
aff51935 1869 AC_TRY_LINK([],
1870 [ extern char *__progname; printf("%s", __progname); ],
58d100bf 1871 [ ac_cv_libc_defines___progname="yes" ],
1872 [ ac_cv_libc_defines___progname="no" ]
1873 )
1874])
1875if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1876 AC_DEFINE(HAVE___PROGNAME)
1877fi
8946db53 1878
c921ee00 1879AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1880 AC_TRY_LINK([
1881#include <stdio.h>
aff51935 1882],
1883 [ printf("%s", __FUNCTION__); ],
c921ee00 1884 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1885 [ ac_cv_cc_implements___FUNCTION__="no" ]
1886 )
1887])
1888if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1889 AC_DEFINE(HAVE___FUNCTION__)
1890fi
1891
1892AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1893 AC_TRY_LINK([
1894#include <stdio.h>
aff51935 1895],
1896 [ printf("%s", __func__); ],
c921ee00 1897 [ ac_cv_cc_implements___func__="yes" ],
1898 [ ac_cv_cc_implements___func__="no" ]
1899 )
1900])
1901if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1902 AC_DEFINE(HAVE___func__)
1903fi
1904
1812a662 1905AC_CACHE_CHECK([whether getopt has optreset support],
1906 ac_cv_have_getopt_optreset, [
1907 AC_TRY_LINK(
1908 [
1909#include <getopt.h>
1910 ],
1911 [ extern int optreset; optreset = 0; ],
1912 [ ac_cv_have_getopt_optreset="yes" ],
1913 [ ac_cv_have_getopt_optreset="no" ]
1914 )
1915])
1916if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1917 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1918fi
a0391976 1919
819b676f 1920AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
aff51935 1921 AC_TRY_LINK([],
1922 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
819b676f 1923 [ ac_cv_libc_defines_sys_errlist="yes" ],
1924 [ ac_cv_libc_defines_sys_errlist="no" ]
1925 )
1926])
1927if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1928 AC_DEFINE(HAVE_SYS_ERRLIST)
1929fi
1930
1931
416ed5a7 1932AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
aff51935 1933 AC_TRY_LINK([],
1934 [ extern int sys_nerr; printf("%i", sys_nerr);],
416ed5a7 1935 [ ac_cv_libc_defines_sys_nerr="yes" ],
1936 [ ac_cv_libc_defines_sys_nerr="no" ]
1937 )
1938])
1939if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1940 AC_DEFINE(HAVE_SYS_NERR)
1941fi
1942
aff51935 1943SCARD_MSG="no"
295c8801 1944# Check whether user wants sectok support
1945AC_ARG_WITH(sectok,
1946 [ --with-sectok Enable smartcard support using libsectok],
d0b19c95 1947 [
1948 if test "x$withval" != "xno" ; then
1949 if test "x$withval" != "xyes" ; then
1950 CPPFLAGS="$CPPFLAGS -I${withval}"
1951 LDFLAGS="$LDFLAGS -L${withval}"
1952 if test ! -z "$need_dash_r" ; then
1953 LDFLAGS="$LDFLAGS -R${withval}"
1954 fi
1955 if test ! -z "$blibpath" ; then
1956 blibpath="$blibpath:${withval}"
1957 fi
1958 fi
1959 AC_CHECK_HEADERS(sectok.h)
1960 if test "$ac_cv_header_sectok_h" != yes; then
1961 AC_MSG_ERROR(Can't find sectok.h)
1962 fi
1963 AC_CHECK_LIB(sectok, sectok_open)
1964 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1965 AC_MSG_ERROR(Can't find libsectok)
1966 fi
1967 AC_DEFINE(SMARTCARD)
295c8801 1968 AC_DEFINE(USE_SECTOK)
aff51935 1969 SCARD_MSG="yes, using sectok"
295c8801 1970 fi
1971 ]
1972)
1973
1974# Check whether user wants OpenSC support
1975AC_ARG_WITH(opensc,
49ef62db 1976 AC_HELP_STRING([--with-opensc=PFX],
1977 [Enable smartcard support using OpenSC]),
1978 opensc_config_prefix="$withval", opensc_config_prefix="")
1979if test x$opensc_config_prefix != x ; then
1980 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1981 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1982 if test "$OPENSC_CONFIG" != "no"; then
1983 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1984 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1985 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1986 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1987 AC_DEFINE(SMARTCARD)
1988 AC_DEFINE(USE_OPENSC)
aff51935 1989 SCARD_MSG="yes, using OpenSC"
49ef62db 1990 fi
1991fi
d0b19c95 1992
c31dc31c 1993# Check libraries needed by DNS fingerprint support
aff51935 1994AC_SEARCH_LIBS(getrrsetbyname, resolv,
c31dc31c 1995 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
3e05e934 1996 [
c31dc31c 1997 # Needed by our getrrsetbyname()
1998 AC_SEARCH_LIBS(res_query, resolv)
1999 AC_SEARCH_LIBS(dn_expand, resolv)
2000 AC_CHECK_FUNCS(_getshort _getlong)
2001 AC_CHECK_MEMBER(HEADER.ad,
2002 [AC_DEFINE(HAVE_HEADER_AD)],,
2003 [#include <arpa/nameser.h>])
2004 ])
3e05e934 2005
12928e80 2006# Check whether user wants Kerberos 5 support
aff51935 2007KRB5_MSG="no"
12928e80 2008AC_ARG_WITH(kerberos5,
aff51935 2009 [ --with-kerberos5=PATH Enable Kerberos 5 support],
2010 [
2011 if test "x$withval" != "xno" ; then
2012 if test "x$withval" = "xyes" ; then
2013 KRB5ROOT="/usr/local"
2014 else
2015 KRB5ROOT=${withval}
2016 fi
12928e80 2017 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
aff51935 2018 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
2019 AC_DEFINE(KRB5)
12928e80 2020 KRB5_MSG="yes"
aff51935 2021 AC_MSG_CHECKING(whether we are using Heimdal)
2022 AC_TRY_COMPILE([ #include <krb5.h> ],
2023 [ char *tmp = heimdal_version; ],
2024 [ AC_MSG_RESULT(yes)
2025 AC_DEFINE(HEIMDAL)
2026 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2027 ],
2028 [ AC_MSG_RESULT(no)
2029 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2030 ]
2031 )
2032 if test ! -z "$need_dash_r" ; then
2033 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2034 fi
2035 if test ! -z "$blibpath" ; then
2036 blibpath="$blibpath:${KRB5ROOT}/lib"
2037 fi
4e00038c 2038 AC_SEARCH_LIBS(dn_expand, resolv)
12928e80 2039
749560dd 2040 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2041 [ AC_DEFINE(GSSAPI)
2042 K5LIBS="-lgssapi $K5LIBS" ],
2043 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2044 [ AC_DEFINE(GSSAPI)
aff51935 2045 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
749560dd 2046 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2047 $K5LIBS)
2048 ],
2049 $K5LIBS)
2050
2051 AC_CHECK_HEADER(gssapi.h, ,
2052 [ unset ac_cv_header_gssapi_h
aff51935 2053 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
749560dd 2054 AC_CHECK_HEADERS(gssapi.h, ,
2055 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
aff51935 2056 )
749560dd 2057 ]
2058 )
2059
2060 oldCPP="$CPPFLAGS"
2061 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2062 AC_CHECK_HEADER(gssapi_krb5.h, ,
2063 [ CPPFLAGS="$oldCPP" ])
2064
aff51935 2065 KRB5=yes
2066 fi
2067 ]
12928e80 2068)
1c590258 2069LIBS="$LIBS $K5LIBS"
b5b68128 2070
a0391976 2071# Looking for programs, paths and files
a0391976 2072
ecac8ee5 2073PRIVSEP_PATH=/var/empty
2074AC_ARG_WITH(privsep-path,
cda1ebcb 2075 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
ecac8ee5 2076 [
2077 if test "x$withval" != "$no" ; then
2078 PRIVSEP_PATH=$withval
2079 fi
2080 ]
2081)
2082AC_SUBST(PRIVSEP_PATH)
2083
a0391976 2084AC_ARG_WITH(xauth,
2085 [ --with-xauth=PATH Specify path to xauth program ],
2086 [
00937921 2087 if test "x$withval" != "xno" ; then
cbd7492e 2088 xauth_path=$withval
a0391976 2089 fi
2090 ],
2091 [
2bf42e4a 2092 TestPath="$PATH"
2093 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2094 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2095 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2096 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2097 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
e5fe9a1f 2098 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 2099 xauth_path="/usr/openwin/bin/xauth"
2100 fi
2101 ]
2102)
2103
65a4b4af 2104STRIP_OPT=-s
2105AC_ARG_ENABLE(strip,
2106 [ --disable-strip Disable calling strip(1) on install],
2107 [
2108 if test "x$enableval" = "xno" ; then
2109 STRIP_OPT=
2110 fi
2111 ]
2112)
2113AC_SUBST(STRIP_OPT)
2114
b3ec54b4 2115if test -z "$xauth_path" ; then
2116 XAUTH_PATH="undefined"
2117 AC_SUBST(XAUTH_PATH)
2118else
a0391976 2119 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
b3ec54b4 2120 XAUTH_PATH=$xauth_path
2121 AC_SUBST(XAUTH_PATH)
a0391976 2122fi
a0391976 2123
2124# Check for mail directory (last resort if we cannot get it from headers)
2125if test ! -z "$MAIL" ; then
2126 maildir=`dirname $MAIL`
2127 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2128fi
2129
a0391976 2130if test -z "$no_dev_ptmx" ; then
6e879cb4 2131 if test "x$disable_ptmx_check" != "xyes" ; then
aff51935 2132 AC_CHECK_FILE("/dev/ptmx",
6e879cb4 2133 [
2134 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2135 have_dev_ptmx=1
2136 ]
2137 )
2138 fi
3276571c 2139fi
aff51935 2140AC_CHECK_FILE("/dev/ptc",
3276571c 2141 [
2142 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2143 have_dev_ptc=1
2144 ]
2145)
2146
a0391976 2147# Options from here on. Some of these are preset by platform above
fdf6b7aa 2148AC_ARG_WITH(mantype,
5d97cfbf 2149 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 2150 [
5d97cfbf 2151 case "$withval" in
2152 man|cat|doc)
2153 MANTYPE=$withval
2154 ;;
2155 *)
2156 AC_MSG_ERROR(invalid man type: $withval)
2157 ;;
2158 esac
c54a6257 2159 ]
2160)
e0c4d3ac 2161if test -z "$MANTYPE"; then
2bf42e4a 2162 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2163 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
e0c4d3ac 2164 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2165 MANTYPE=doc
2166 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2167 MANTYPE=man
2168 else
2169 MANTYPE=cat
2170 fi
2171fi
c54a6257 2172AC_SUBST(MANTYPE)
e0c4d3ac 2173if test "$MANTYPE" = "doc"; then
2174 mansubdir=man;
2175else
2176 mansubdir=$MANTYPE;
2177fi
2178AC_SUBST(mansubdir)
0bc5b6fb 2179
a0391976 2180# Check whether to enable MD5 passwords
aff51935 2181MD5_MSG="no"
2ddcfdf3 2182AC_ARG_WITH(md5-passwords,
caf3bc51 2183 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 2184 [
bcf36c78 2185 if test "x$withval" != "xno" ; then
0bc5b6fb 2186 AC_DEFINE(HAVE_MD5_PASSWORDS)
aff51935 2187 MD5_MSG="yes"
0bc5b6fb 2188 fi
2189 ]
caf3bc51 2190)
2191
a0391976 2192# Whether to disable shadow password support
a7effaac 2193AC_ARG_WITH(shadow,
2194 [ --without-shadow Disable shadow password support],
2195 [
2196 if test "x$withval" = "xno" ; then
2197 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 2198 disable_shadow=yes
a7effaac 2199 fi
2200 ]
2201)
2202
4cb5ffa0 2203if test -z "$disable_shadow" ; then
2204 AC_MSG_CHECKING([if the systems has expire shadow information])
2205 AC_TRY_COMPILE(
2206 [
2207#include <sys/types.h>
2208#include <shadow.h>
2209 struct spwd sp;
2210 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2211 [ sp_expire_available=yes ], []
2212 )
2213
2214 if test "x$sp_expire_available" = "xyes" ; then
2215 AC_MSG_RESULT(yes)
2216 AC_DEFINE(HAS_SHADOW_EXPIRE)
2217 else
2218 AC_MSG_RESULT(no)
2219 fi
2220fi
2221
a0391976 2222# Use ip address instead of hostname in $DISPLAY
44839801 2223if test ! -z "$IPADDR_IN_DISPLAY" ; then
2224 DISPLAY_HACK_MSG="yes"
2225 AC_DEFINE(IPADDR_IN_DISPLAY)
2226else
aff51935 2227 DISPLAY_HACK_MSG="no"
44839801 2228 AC_ARG_WITH(ipaddr-display,
2229 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2230 [
2231 if test "x$withval" != "xno" ; then
2232 AC_DEFINE(IPADDR_IN_DISPLAY)
aff51935 2233 DISPLAY_HACK_MSG="yes"
44839801 2234 fi
2235 ]
2236 )
2237fi
a7effaac 2238
95b99395 2239# check for /etc/default/login and use it if present.
daa41e62 2240AC_ARG_ENABLE(etc-default-login,
2241 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2242[
95b99395 2243AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2244
2245if test "x$external_path_file" = "x/etc/default/login"; then
2246 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2247fi
daa41e62 2248])
95b99395 2249
8d184c09 2250dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2251if test $ac_cv_func_login_getcapbool = "yes" -a \
2252 $ac_cv_header_login_cap_h = "yes" ; then
95b99395 2253 external_path_file=/etc/login.conf
8d184c09 2254fi
95b99395 2255
a0391976 2256# Whether to mess with the default path
aff51935 2257SERVER_PATH_MSG="(default)"
c43d69a9 2258AC_ARG_WITH(default-path,
75817f90 2259 [ --with-default-path= Specify default \$PATH environment for server],
cb807f40 2260 [
95b99395 2261 if test "x$external_path_file" = "x/etc/login.conf" ; then
8d184c09 2262 AC_MSG_WARN([
2263--with-default-path=PATH has no effect on this system.
2264Edit /etc/login.conf instead.])
2265 elif test "x$withval" != "xno" ; then
89bbd457 2266 if test ! -z "$external_path_file" ; then
95b99395 2267 AC_MSG_WARN([
2268--with-default-path=PATH will only be used if PATH is not defined in
2269$external_path_file .])
2270 fi
b2d818e6 2271 user_path="$withval"
aff51935 2272 SERVER_PATH_MSG="$withval"
cb807f40 2273 fi
b2d818e6 2274 ],
95b99395 2275 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2276 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
8d184c09 2277 else
89bbd457 2278 if test ! -z "$external_path_file" ; then
95b99395 2279 AC_MSG_WARN([
2280If PATH is defined in $external_path_file, ensure the path to scp is included,
2281otherwise scp will not work.])
2282 fi
2283 AC_TRY_RUN(
2284 [
b2d818e6 2285/* find out what STDPATH is */
2286#include <stdio.h>
b2d818e6 2287#ifdef HAVE_PATHS_H
2288# include <paths.h>
2289#endif
2290#ifndef _PATH_STDPATH
d9a4e55b 2291# ifdef _PATH_USERPATH /* Irix */
2292# define _PATH_STDPATH _PATH_USERPATH
2293# else
2294# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2295# endif
b2d818e6 2296#endif
2297#include <sys/types.h>
2298#include <sys/stat.h>
2299#include <fcntl.h>
2300#define DATA "conftest.stdpath"
2301
2302main()
2303{
2304 FILE *fd;
2305 int rc;
2306
2307 fd = fopen(DATA,"w");
2308 if(fd == NULL)
2309 exit(1);
2310
2311 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2312 exit(1);
2313
2314 exit(0);
2315}
2316 ], [ user_path=`cat conftest.stdpath` ],
2317 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2318 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2319 )
2320# make sure $bindir is in USER_PATH so scp will work
2321 t_bindir=`eval echo ${bindir}`
2322 case $t_bindir in
2323 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2324 esac
2325 case $t_bindir in
2326 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2327 esac
2328 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2329 if test $? -ne 0 ; then
2330 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2331 if test $? -ne 0 ; then
2332 user_path=$user_path:$t_bindir
2333 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2334 fi
2335 fi
8d184c09 2336 fi ]
cb807f40 2337)
95b99395 2338if test "x$external_path_file" != "x/etc/login.conf" ; then
8d184c09 2339 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2340 AC_SUBST(user_path)
2341fi
cb807f40 2342
06617857 2343# Set superuser path separately to user path
06617857 2344AC_ARG_WITH(superuser-path,
2345 [ --with-superuser-path= Specify different path for super-user],
2346 [
2347 if test "x$withval" != "xno" ; then
2348 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2349 superuser_path=$withval
2350 fi
2351 ]
2352)
2353
2354
58d100bf 2355AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
aff51935 2356IPV4_IN6_HACK_MSG="no"
80faa19f 2357AC_ARG_WITH(4in6,
2358 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2359 [
2360 if test "x$withval" != "xno" ; then
2361 AC_MSG_RESULT(yes)
2362 AC_DEFINE(IPV4_IN_IPV6)
aff51935 2363 IPV4_IN6_HACK_MSG="yes"
80faa19f 2364 else
2365 AC_MSG_RESULT(no)
2366 fi
2367 ],[
2368 if test "x$inet6_default_4in6" = "xyes"; then
2369 AC_MSG_RESULT([yes (default)])
2370 AC_DEFINE(IPV4_IN_IPV6)
aff51935 2371 IPV4_IN6_HACK_MSG="yes"
80faa19f 2372 else
2373 AC_MSG_RESULT([no (default)])
2374 fi
2375 ]
2376)
2377
af774732 2378# Whether to enable BSD auth support
f1b0ecc3 2379BSD_AUTH_MSG=no
af774732 2380AC_ARG_WITH(bsd-auth,
2381 [ --with-bsd-auth Enable BSD auth support],
2382 [
2383 if test "x$withval" != "xno" ; then
2384 AC_DEFINE(BSD_AUTH)
f1b0ecc3 2385 BSD_AUTH_MSG=yes
af774732 2386 fi
2387 ]
2388)
2389
a0391976 2390# Where to place sshd.pid
19d9ac2a 2391piddir=/var/run
81dadca3 2392# make sure the directory exists
2393if test ! -d $piddir ; then
2394 piddir=`eval echo ${sysconfdir}`
2395 case $piddir in
aff51935 2396 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
81dadca3 2397 esac
2398fi
2399
47e45e44 2400AC_ARG_WITH(pid-dir,
2401 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2402 [
2403 if test "x$withval" != "xno" ; then
19d9ac2a 2404 piddir=$withval
81dadca3 2405 if test ! -d $piddir ; then
2406 AC_MSG_WARN([** no $piddir directory on this system **])
2407 fi
47e45e44 2408 fi
2409 ]
2410)
b7a87eea 2411
42f11eb2 2412AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
19d9ac2a 2413AC_SUBST(piddir)
47e45e44 2414
1d7b9b20 2415dnl allow user to disable some login recording features
2416AC_ARG_ENABLE(lastlog,
bfd550a2 2417 [ --disable-lastlog disable use of lastlog even if detected [no]],
ddb154b3 2418 [
2419 if test "x$enableval" = "xno" ; then
2420 AC_DEFINE(DISABLE_LASTLOG)
2421 fi
2422 ]
1d7b9b20 2423)
2424AC_ARG_ENABLE(utmp,
bfd550a2 2425 [ --disable-utmp disable use of utmp even if detected [no]],
ddb154b3 2426 [
2427 if test "x$enableval" = "xno" ; then
2428 AC_DEFINE(DISABLE_UTMP)
2429 fi
2430 ]
1d7b9b20 2431)
2432AC_ARG_ENABLE(utmpx,
bfd550a2 2433 [ --disable-utmpx disable use of utmpx even if detected [no]],
ddb154b3 2434 [
2435 if test "x$enableval" = "xno" ; then
2436 AC_DEFINE(DISABLE_UTMPX)
2437 fi
2438 ]
1d7b9b20 2439)
2440AC_ARG_ENABLE(wtmp,
bfd550a2 2441 [ --disable-wtmp disable use of wtmp even if detected [no]],
ddb154b3 2442 [
2443 if test "x$enableval" = "xno" ; then
2444 AC_DEFINE(DISABLE_WTMP)
2445 fi
2446 ]
1d7b9b20 2447)
2448AC_ARG_ENABLE(wtmpx,
bfd550a2 2449 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
ddb154b3 2450 [
2451 if test "x$enableval" = "xno" ; then
2452 AC_DEFINE(DISABLE_WTMPX)
2453 fi
2454 ]
1d7b9b20 2455)
2456AC_ARG_ENABLE(libutil,
bfd550a2 2457 [ --disable-libutil disable use of libutil (login() etc.) [no]],
ddb154b3 2458 [
2459 if test "x$enableval" = "xno" ; then
2460 AC_DEFINE(DISABLE_LOGIN)
2461 fi
2462 ]
1d7b9b20 2463)
2464AC_ARG_ENABLE(pututline,
bfd550a2 2465 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
ddb154b3 2466 [
2467 if test "x$enableval" = "xno" ; then
aff51935 2468 AC_DEFINE(DISABLE_PUTUTLINE)
ddb154b3 2469 fi
2470 ]
1d7b9b20 2471)
2472AC_ARG_ENABLE(pututxline,
bfd550a2 2473 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
ddb154b3 2474 [
2475 if test "x$enableval" = "xno" ; then
2476 AC_DEFINE(DISABLE_PUTUTXLINE)
2477 fi
2478 ]
1d7b9b20 2479)
2480AC_ARG_WITH(lastlog,
bfd550a2 2481 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 2482 [
2483 if test "x$withval" = "xno" ; then
2484 AC_DEFINE(DISABLE_LASTLOG)
2485 else
2486 conf_lastlog_location=$withval
2487 fi
2488 ]
2489)
1d7b9b20 2490
2491dnl lastlog, [uw]tmpx? detection
2492dnl NOTE: set the paths in the platform section to avoid the
2493dnl need for command-line parameters
2494dnl lastlog and [uw]tmp are subject to a file search if all else fails
2495
2496dnl lastlog detection
2497dnl NOTE: the code itself will detect if lastlog is a directory
2498AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2499AC_TRY_COMPILE([
2500#include <sys/types.h>
2501#include <utmp.h>
2502#ifdef HAVE_LASTLOG_H
2503# include <lastlog.h>
2504#endif
d7c0f3d5 2505#ifdef HAVE_PATHS_H
1d7b9b20 2506# include <paths.h>
41cb4569 2507#endif
2508#ifdef HAVE_LOGIN_H
2509# include <login.h>
1d7b9b20 2510#endif
2511 ],
2512 [ char *lastlog = LASTLOG_FILE; ],
2513 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 2514 [
2515 AC_MSG_RESULT(no)
2516 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2517 AC_TRY_COMPILE([
2518#include <sys/types.h>
2519#include <utmp.h>
2520#ifdef HAVE_LASTLOG_H
2521# include <lastlog.h>
2522#endif
2523#ifdef HAVE_PATHS_H
2524# include <paths.h>
2525#endif
2526 ],
2527 [ char *lastlog = _PATH_LASTLOG; ],
2528 [ AC_MSG_RESULT(yes) ],
2529 [
f282b668 2530 AC_MSG_RESULT(no)
d7c0f3d5 2531 system_lastlog_path=no
2532 ])
2533 ]
1d7b9b20 2534)
d7c0f3d5 2535
1d7b9b20 2536if test -z "$conf_lastlog_location"; then
2537 if test x"$system_lastlog_path" = x"no" ; then
2538 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 2539 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 2540 conf_lastlog_location=$f
2541 fi
2542 done
2543 if test -z "$conf_lastlog_location"; then
f8119cef 2544 AC_MSG_WARN([** Cannot find lastlog **])
2545 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 2546 fi
2547 fi
2548fi
2549
2550if test -n "$conf_lastlog_location"; then
2551 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2552fi
2553
2554dnl utmp detection
2555AC_MSG_CHECKING([if your system defines UTMP_FILE])
2556AC_TRY_COMPILE([
2557#include <sys/types.h>
2558#include <utmp.h>
d7c0f3d5 2559#ifdef HAVE_PATHS_H
1d7b9b20 2560# include <paths.h>
2561#endif
2562 ],
2563 [ char *utmp = UTMP_FILE; ],
2564 [ AC_MSG_RESULT(yes) ],
2565 [ AC_MSG_RESULT(no)
2566 system_utmp_path=no ]
2567)
2568if test -z "$conf_utmp_location"; then
2569 if test x"$system_utmp_path" = x"no" ; then
2570 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2571 if test -f $f ; then
2572 conf_utmp_location=$f
2573 fi
2574 done
2575 if test -z "$conf_utmp_location"; then
2576 AC_DEFINE(DISABLE_UTMP)
2577 fi
2578 fi
2579fi
2580if test -n "$conf_utmp_location"; then
2581 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2582fi
2583
2584dnl wtmp detection
2585AC_MSG_CHECKING([if your system defines WTMP_FILE])
2586AC_TRY_COMPILE([
2587#include <sys/types.h>
2588#include <utmp.h>
d7c0f3d5 2589#ifdef HAVE_PATHS_H
1d7b9b20 2590# include <paths.h>
2591#endif
2592 ],
2593 [ char *wtmp = WTMP_FILE; ],
2594 [ AC_MSG_RESULT(yes) ],
2595 [ AC_MSG_RESULT(no)
2596 system_wtmp_path=no ]
2597)
2598if test -z "$conf_wtmp_location"; then
2599 if test x"$system_wtmp_path" = x"no" ; then
2600 for f in /usr/adm/wtmp /var/log/wtmp; do
2601 if test -f $f ; then
2602 conf_wtmp_location=$f
2603 fi
2604 done
2605 if test -z "$conf_wtmp_location"; then
2606 AC_DEFINE(DISABLE_WTMP)
2607 fi
2608 fi
2609fi
2610if test -n "$conf_wtmp_location"; then
2611 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2612fi
2613
2614
2615dnl utmpx detection - I don't know any system so perverse as to require
2616dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2617dnl there, though.
2618AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2619AC_TRY_COMPILE([
2620#include <sys/types.h>
2621#include <utmp.h>
2622#ifdef HAVE_UTMPX_H
2623#include <utmpx.h>
2624#endif
d7c0f3d5 2625#ifdef HAVE_PATHS_H
1d7b9b20 2626# include <paths.h>
2627#endif
2628 ],
2629 [ char *utmpx = UTMPX_FILE; ],
2630 [ AC_MSG_RESULT(yes) ],
2631 [ AC_MSG_RESULT(no)
2632 system_utmpx_path=no ]
2633)
2634if test -z "$conf_utmpx_location"; then
2635 if test x"$system_utmpx_path" = x"no" ; then
2636 AC_DEFINE(DISABLE_UTMPX)
2637 fi
2638else
2639 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2640fi
2641
2642dnl wtmpx detection
2643AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2644AC_TRY_COMPILE([
2645#include <sys/types.h>
2646#include <utmp.h>
2647#ifdef HAVE_UTMPX_H
2648#include <utmpx.h>
2649#endif
d7c0f3d5 2650#ifdef HAVE_PATHS_H
1d7b9b20 2651# include <paths.h>
2652#endif
2653 ],
2654 [ char *wtmpx = WTMPX_FILE; ],
2655 [ AC_MSG_RESULT(yes) ],
2656 [ AC_MSG_RESULT(no)
2657 system_wtmpx_path=no ]
2658)
2659if test -z "$conf_wtmpx_location"; then
2660 if test x"$system_wtmpx_path" = x"no" ; then
2661 AC_DEFINE(DISABLE_WTMPX)
2662 fi
2663else
2664 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2665fi
2666
b7a87eea 2667
bd499f9e 2668if test ! -z "$blibpath" ; then
68ece370 2669 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2670 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
bd499f9e 2671fi
2672
ddceb1c8 2673dnl remove pam and dl because they are in $LIBPAM
2674if test "$PAM_MSG" = yes ; then
98f2d9d5 2675 LIBS=`echo $LIBS | sed 's/-lpam //'`
2676fi
2677if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2678 LIBS=`echo $LIBS | sed 's/-ldl //'`
ddceb1c8 2679fi
2680
3c62e7eb 2681AC_EXEEXT
98a7c37b 2682AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2683AC_OUTPUT
d3083fbd 2684
cbd7492e 2685# Print summary of options
2686
cbd7492e 2687# Someone please show me a better way :)
2688A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2689B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2690C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2691D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 2692E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 2693F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 2694G=`eval echo ${piddir}` ; G=`eval echo ${G}`
ecac8ee5 2695H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2696I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2697J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
cbd7492e 2698
2699echo ""
26de7942 2700echo "OpenSSH has been configured with the following options:"
ecac8ee5 2701echo " User binaries: $B"
2702echo " System binaries: $C"
2703echo " Configuration files: $D"
2704echo " Askpass program: $E"
2705echo " Manual pages: $F"
2706echo " PID file: $G"
2707echo " Privilege separation chroot path: $H"
95b99395 2708if test "x$external_path_file" = "x/etc/login.conf" ; then
2709echo " At runtime, sshd will use the path defined in $external_path_file"
2710echo " Make sure the path to scp is present, otherwise scp will not work"
8d184c09 2711else
ecac8ee5 2712echo " sshd default user PATH: $I"
89bbd457 2713 if test ! -z "$external_path_file"; then
95b99395 2714echo " (If PATH is set in $external_path_file it will be used instead. If"
2715echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2716 fi
8d184c09 2717fi
06617857 2718if test ! -z "$superuser_path" ; then
ecac8ee5 2719echo " sshd superuser user PATH: $J"
2720fi
2721echo " Manpage format: $MANTYPE"
3deeea1a 2722echo " DNS support: $DNS_MSG"
3e05e934 2723echo " PAM support: $PAM_MSG"
ecac8ee5 2724echo " KerberosV support: $KRB5_MSG"
2725echo " Smartcard support: $SCARD_MSG"
ecac8ee5 2726echo " S/KEY support: $SKEY_MSG"
2727echo " TCP Wrappers support: $TCPW_MSG"
2728echo " MD5 password support: $MD5_MSG"
3deb1408 2729echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
ecac8ee5 2730echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2731echo " BSD Auth support: $BSD_AUTH_MSG"
2732echo " Random number source: $RAND_MSG"
f1b0ecc3 2733if test ! -z "$USE_RAND_HELPER" ; then
ecac8ee5 2734echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 2735fi
2736
cbd7492e 2737echo ""
2738
0c2fb82f 2739echo " Host: ${host}"
2740echo " Compiler: ${CC}"
2741echo " Compiler flags: ${CFLAGS}"
2742echo "Preprocessor flags: ${CPPFLAGS}"
2743echo " Linker flags: ${LDFLAGS}"
ddceb1c8 2744echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
cbd7492e 2745
2746echo ""
2747
adeebd37 2748if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 2749 echo "PAM is enabled. You may need to install a PAM control file "
2750 echo "for sshd, otherwise password authentication may fail. "
aff51935 2751 echo "Example PAM control files can be found in the contrib/ "
f1b0ecc3 2752 echo "subdirectory"
adeebd37 2753 echo ""
2754fi
2755
f1b0ecc3 2756if test ! -z "$RAND_HELPER_CMDHASH" ; then
2757 echo "WARNING: you are using the builtin random number collection "
2758 echo "service. Please read WARNING.RNG and request that your OS "
2759 echo "vendor includes kernel-based random number collection in "
2760 echo "future versions of your OS."
2c523de9 2761 echo ""
2762fi
af774732 2763
This page took 0.739874 seconds and 5 git commands to generate.