]> andersk Git - openssh.git/blame - configure.ac
- (dtucker) [configure.ac] Relocate LLONG_MAX calculation to after the
[openssh.git] / configure.ac
CommitLineData
eb5d7ff6 1# $Id$
2b983b95 2#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0b202697 16
76e6410a 17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
98a7c37b 18AC_CONFIG_SRCDIR([ssh.c])
5881cd60 19
20AC_CONFIG_HEADER(config.h)
b14b2ae7 21AC_PROG_CC
a7effaac 22AC_CANONICAL_HOST
cf0c5df5 23AC_C_BIGENDIAN
5881cd60 24
a0391976 25# Checks for programs.
4bbf95fa 26AC_PROG_AWK
4cca272e 27AC_PROG_CPP
5881cd60 28AC_PROG_RANLIB
cf8dd513 29AC_PROG_INSTALL
bee0a37e 30AC_PATH_PROG(AR, ar)
ddd8c95b 31AC_PATH_PROG(CAT, cat)
32AC_PATH_PROG(KILL, kill)
13dd877b 33AC_PATH_PROGS(PERL, perl5 perl)
c3690df3 34AC_PATH_PROG(SED, sed)
a0f84251 35AC_SUBST(PERL)
ad85db64 36AC_PATH_PROG(ENT, ent)
37AC_SUBST(ENT)
6958bd37 38AC_PATH_PROG(TEST_MINUS_S_SH, bash)
39AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
40AC_PATH_PROG(TEST_MINUS_S_SH, sh)
6193497b 41AC_PATH_PROG(SH, sh)
a3245b92 42AC_SUBST(TEST_SHELL,sh)
f498ed15 43
9cefe228 44dnl for buildpkg.sh
45AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
46 [/usr/sbin${PATH_SEPARATOR}/etc])
47AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
50
948fd8b9 51# System features
52AC_SYS_LARGEFILE
53
c193d002 54if test -z "$AR" ; then
55 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
56fi
57
2e73a022 58# Use LOGIN_PROGRAM from environment if possible
59if test ! -z "$LOGIN_PROGRAM" ; then
3466e002 60 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM",
61 [If your header files don't define LOGIN_PROGRAM,
62 then use this (detected) from environment and PATH])
2e73a022 63else
64 # Search for login
65 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
66 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
67 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
68 fi
69fi
70
37656beb 71AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
72if test ! -z "$PATH_PASSWD_PROG" ; then
3466e002 73 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG",
74 [Full path of your "passwd" program])
37656beb 75fi
76
d423d822 77if test -z "$LD" ; then
78 LD=$CC
79fi
80AC_SUBST(LD)
82f4e93d 81
d423d822 82AC_C_INLINE
dfafb2e1 83
84AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
85
aff51935 86if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
af40ca44 87 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
5fdabf45 88 GCC_VER=`$CC --version`
89 case $GCC_VER in
90 1.*) ;;
91 2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;;
92 2.*) ;;
93 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
94 esac
8a3ff1aa 95
dfafb2e1 96 if test -z "$have_llong_max"; then
97 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
98 unset ac_cv_have_decl_LLONG_MAX
99 saved_CFLAGS="$CFLAGS"
100 CFLAGS="$CFLAGS -std=gnu99"
101 AC_CHECK_DECL(LLONG_MAX,
102 [have_llong_max=1],
103 [CFLAGS="$saved_CFLAGS"],
104 [#include <limits.h>]
105 )
106 fi
d423d822 107fi
108
e6354014 109AC_ARG_WITH(rpath,
110 [ --without-rpath Disable auto-added -R linker paths],
111 [
82f4e93d 112 if test "x$withval" = "xno" ; then
e6354014 113 need_dash_r=""
114 fi
115 if test "x$withval" = "xyes" ; then
116 need_dash_r=1
117 fi
118 ]
119)
120
a0391976 121# Check for some target-specific stuff
a7effaac 122case "$host" in
9d6b1b96 123*-*-aix*)
aff51935 124 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
68ece370 125 if (test -z "$blibpath"); then
0a15d73b 126 blibpath="/usr/lib:/lib"
68ece370 127 fi
128 saved_LDFLAGS="$LDFLAGS"
129 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
130 if (test -z "$blibflags"); then
131 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
132 AC_TRY_LINK([], [], [blibflags=$tryflags])
133 fi
134 done
135 if (test -z "$blibflags"); then
136 AC_MSG_RESULT(not found)
137 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
138 else
139 AC_MSG_RESULT($blibflags)
bd499f9e 140 fi
68ece370 141 LDFLAGS="$saved_LDFLAGS"
e351e493 142 dnl Check for authenticate. Might be in libs.a on older AIXes
3466e002 143 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE, 1,
144 [Define if you want to enable AIX4's authenticate function])],
0764e748 145 [AC_CHECK_LIB(s,authenticate,
e351e493 146 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
0764e748 147 LIBS="$LIBS -ls"
148 ])
149 ])
ba603e06 150 dnl Check for various auth function declarations in headers.
c85ed8e2 151 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
72ad335d 152 passwdexpired, setauthdb], , , [#include <usersec.h>])
e351e493 153 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
ba603e06 154 AC_CHECK_DECLS(loginfailed,
e351e493 155 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
156 AC_TRY_COMPILE(
f58c0e01 157 [#include <usersec.h>],
e351e493 158 [(void)loginfailed("user","host","tty",0);],
159 [AC_MSG_RESULT(yes)
3466e002 160 AC_DEFINE(AIX_LOGINFAILED_4ARG, 1,
161 [Define if your AIX loginfailed() function
162 takes 4 arguments (AIX >= 5.2)])],
f58c0e01 163 [AC_MSG_RESULT(no)]
e351e493 164 )],
165 [],
166 [#include <usersec.h>]
167 )
2aa3a16c 168 AC_CHECK_FUNCS(setauthdb)
5ccf88cb 169 check_for_aix_broken_getaddrinfo=1
3466e002 170 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.])
171 AC_DEFINE(SETEUID_BREAKS_SETUID, 1,
172 [Define if your platform breaks doing a seteuid before a setuid])
173 AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken])
174 AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken])
a3cef3ca 175 dnl AIX handles lastlog as part of its login message
3466e002 176 AC_DEFINE(DISABLE_LASTLOG, 1, [Define if you don't want to use lastlog])
177 AC_DEFINE(LOGIN_NEEDS_UTMPX, 1,
178 [Some systems need a utmpx entry for /bin/login to work])
179 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV,
180 [Define to a Set Process Title type if your system is
181 supported by bsd-setproctitle.c])
9d6b1b96 182 ;;
3c62e7eb 183*-*-cygwin*)
a52997bd 184 check_for_libcrypt_later=1
ffb8d130 185 LIBS="$LIBS /usr/lib/textmode.o"
3466e002 186 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin])
187 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
188 AC_DEFINE(DISABLE_SHADOW, 1,
189 [Define if you want to disable shadow passwords])
190 AC_DEFINE(IP_TOS_IS_BROKEN, 1,
191 [Define if your system choked on IP TOS setting])
192 AC_DEFINE(NO_X11_UNIX_SOCKETS, 1,
193 [Define if X11 doesn't support AF_UNIX sockets on that system])
194 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT, 1,
195 [Define if the concept of ports only accessible to
196 superusers isn't known])
197 AC_DEFINE(DISABLE_FD_PASSING, 1,
198 [Define if your platform needs to skip post auth
199 file descriptor passing])
3c62e7eb 200 ;;
d6fdb079 201*-*-dgux*)
202 AC_DEFINE(IP_TOS_IS_BROKEN)
0c6a72a5 203 AC_DEFINE(SETEUID_BREAKS_SETUID)
204 AC_DEFINE(BROKEN_SETREUID)
205 AC_DEFINE(BROKEN_SETREGID)
d6fdb079 206 ;;
39c98ef7 207*-*-darwin*)
33e2e066 208 AC_MSG_CHECKING(if we have working getaddrinfo)
209 AC_TRY_RUN([#include <mach-o/dyld.h>
210main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
211 exit(0);
212 else
213 exit(1);
214}], [AC_MSG_RESULT(working)],
215 [AC_MSG_RESULT(buggy)
3466e002 216 AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])],
b27e573d 217 [AC_MSG_RESULT(assume it is working)])
635e0c42 218 AC_DEFINE(SETEUID_BREAKS_SETUID)
219 AC_DEFINE(BROKEN_SETREUID)
220 AC_DEFINE(BROKEN_SETREGID)
3466e002 221 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1,
222 [Define if your resolver libs need this for getrrsetbyname])
39c98ef7 223 ;;
7d458c86 224*-*-hpux*)
225 # first we define all of the options common to all HP-UX releases
b8fea62d 226 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
44839801 227 IPADDR_IN_DISPLAY=yes
2b10f47a 228 AC_DEFINE(USE_PIPES)
3466e002 229 AC_DEFINE(LOGIN_NO_ENDOPT, 1,
230 [Define if your login program cannot handle end of options ("--")])
a2572aa7 231 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3466e002 232 AC_DEFINE(LOCKED_PASSWD_STRING, "*",
233 [String used in /etc/passwd to denote locked account])
3a2b2b44 234 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
83f987c3 235 MAIL="/var/mail/username"
f75ca46d 236 LIBS="$LIBS -lsec"
7d458c86 237 AC_CHECK_LIB(xnet, t_error, ,
238 AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
239
240 # next, we define all of the options specific to major releases
241 case "$host" in
242 *-*-hpux10*)
243 if test -z "$GCC"; then
244 CFLAGS="$CFLAGS -Ae"
245 fi
246 ;;
247 *-*-hpux11*)
3466e002 248 AC_DEFINE(PAM_SUN_CODEBASE, 1,
249 [Define if you are using Solaris-derived PAM which
250 passes pam_messages to the conversation function
251 with an extra level of indirection])
252 AC_DEFINE(DISABLE_UTMP, 1,
253 [Define if you don't want to use utmp])
7d458c86 254 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
255 check_for_hpux_broken_getaddrinfo=1
256 check_for_conflicting_getspnam=1
257 ;;
258 esac
259
260 # lastly, we define options specific to minor releases
261 case "$host" in
262 *-*-hpux10.26)
3466e002 263 AC_DEFINE(HAVE_SECUREWARE, 1,
264 [Define if you have SecureWare-based
265 protected password database])
7d458c86 266 disable_ptmx_check=yes
267 LIBS="$LIBS -lsecpw"
268 ;;
269 esac
2b763e31 270 ;;
d94aa2ae 271*-*-irix5*)
6ac7829a 272 PATH="$PATH:/usr/etc"
3466e002 273 AC_DEFINE(BROKEN_INET_NTOA, 1,
274 [Define if you system's inet_ntoa is busted
275 (e.g. Irix gcc issue)])
cb433561 276 AC_DEFINE(SETEUID_BREAKS_SETUID)
277 AC_DEFINE(BROKEN_SETREUID)
278 AC_DEFINE(BROKEN_SETREGID)
3466e002 279 AC_DEFINE(WITH_ABBREV_NO_TTY, 1,
280 [Define if you shouldn't strip 'tty' from your
281 ttyname in [uw]tmp])
3e6e3da0 282 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
b9795b89 283 ;;
284*-*-irix6*)
6ac7829a 285 PATH="$PATH:/usr/etc"
3466e002 286 AC_DEFINE(WITH_IRIX_ARRAY, 1,
287 [Define if you have/want arrays
288 (cluster-wide session managment, not C arrays)])
289 AC_DEFINE(WITH_IRIX_PROJECT, 1,
290 [Define if you want IRIX project management])
291 AC_DEFINE(WITH_IRIX_AUDIT, 1,
292 [Define if you want IRIX audit trails])
293 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS, 1,
294 [Define if you want IRIX kernel jobs])])
416ed5a7 295 AC_DEFINE(BROKEN_INET_NTOA)
412c0eaa 296 AC_DEFINE(SETEUID_BREAKS_SETUID)
297 AC_DEFINE(BROKEN_SETREUID)
298 AC_DEFINE(BROKEN_SETREGID)
3466e002 299 AC_DEFINE(BROKEN_UPDWTMPX, 1, [updwtmpx is broken (if present)])
0e8f4eba 300 AC_DEFINE(WITH_ABBREV_NO_TTY)
3e6e3da0 301 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
d94aa2ae 302 ;;
5cdfe03f 303*-*-linux*)
304 no_dev_ptmx=1
717057b6 305 check_for_libcrypt_later=1
eacb954e 306 check_for_openpty_ctty_bug=1
3466e002 307 AC_DEFINE(DONT_TRY_OTHER_AF, 1, [Workaround more Linux IPv6 quirks])
308 AC_DEFINE(PAM_TTY_KLUDGE, 1,
309 [Work around problematic Linux PAM modules handling of PAM_TTY])
310 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!",
311 [String used in /etc/passwd to denote locked account])
3a2b2b44 312 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
3466e002 313 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM,
314 [Define to whatever link() returns for "not supported"
315 if it doesn't return EOPNOTSUPP.])
b6610e8f 316 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
3466e002 317 AC_DEFINE(USE_BTMP)
80faa19f 318 inet6_default_4in6=yes
bf7c1e6c 319 case `uname -r` in
ad84c479 320 1.*|2.0.*)
3466e002 321 AC_DEFINE(BROKEN_CMSG_TYPE, 1,
322 [Define if cmsg_type is not passed correctly])
bf7c1e6c 323 ;;
bf7c1e6c 324 esac
5cdfe03f 325 ;;
66d6c27e 326mips-sony-bsd|mips-sony-newsos4)
3466e002 327 AC_DEFINE(NEED_SETPRGP, 1, [Need setpgrp to acquire controlling tty])
66d6c27e 328 SONY=1
66d6c27e 329 ;;
d468fc76 330*-*-netbsd*)
33e2e066 331 check_for_libcrypt_before=1
82f4e93d 332 if test "x$withval" != "xno" ; then
e6354014 333 need_dash_r=1
334 fi
d468fc76 335 ;;
86b416a7 336*-*-freebsd*)
337 check_for_libcrypt_later=1
988c5031 338 AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)])
86b416a7 339 ;;
8707b7eb 340*-*-bsdi*)
341 AC_DEFINE(SETEUID_BREAKS_SETUID)
342 AC_DEFINE(BROKEN_SETREUID)
343 AC_DEFINE(BROKEN_SETREGID)
344 ;;
729bfe59 345*-next-*)
729bfe59 346 conf_lastlog_location="/usr/adm/lastlog"
698d107e 347 conf_utmp_location=/etc/utmp
348 conf_wtmp_location=/usr/adm/wtmp
349 MAIL=/usr/spool/mail
3466e002 350 AC_DEFINE(HAVE_NEXT, 1, [Define if you are on NeXT])
443172c4 351 AC_DEFINE(BROKEN_REALPATH)
00937921 352 AC_DEFINE(USE_PIPES)
3466e002 353 AC_DEFINE(BROKEN_SAVED_UIDS, 1, [Needed for NeXT])
729bfe59 354 ;;
5b7b5e23 355*-*-openbsd*)
356 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
8034a348 357 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
5b7b5e23 358 ;;
9d6b1b96 359*-*-solaris*)
82f4e93d 360 if test "x$withval" != "xno" ; then
010e9d5b 361 need_dash_r=1
362 fi
adeebd37 363 AC_DEFINE(PAM_SUN_CODEBASE)
7e2d5fa4 364 AC_DEFINE(LOGIN_NEEDS_UTMPX)
3466e002 365 AC_DEFINE(LOGIN_NEEDS_TERM, 1,
366 [Some versions of /bin/login need the TERM supplied
367 on the commandline])
7f0a4ff1 368 AC_DEFINE(PAM_TTY_KLUDGE)
3466e002 369 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
370 [Define if pam_chauthtok wants real uid set
371 to the unpriv'ed user])
3e6e3da0 372 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
ad84c479 373 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
3466e002 374 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1,
375 [Define if sshd somehow reacquires a controlling TTY
376 after setsid()])
95b99395 377 external_path_file=/etc/default/login
1d7b9b20 378 # hardwire lastlog location (can't detect it on some versions)
379 conf_lastlog_location="/var/adm/lastlog"
32c80420 380 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
381 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
382 if test "$sol2ver" -ge 8; then
383 AC_MSG_RESULT(yes)
384 AC_DEFINE(DISABLE_UTMP)
3466e002 385 AC_DEFINE(DISABLE_WTMP, 1,
386 [Define if you don't want to use wtmp])
32c80420 387 else
388 AC_MSG_RESULT(no)
389 fi
9d6b1b96 390 ;;
a423beaf 391*-*-sunos4*)
0c2fb82f 392 CPPFLAGS="$CPPFLAGS -DSUNOS4"
a423beaf 393 AC_CHECK_FUNCS(getpwanam)
adeebd37 394 AC_DEFINE(PAM_SUN_CODEBASE)
32eec038 395 conf_utmp_location=/etc/utmp
396 conf_wtmp_location=/var/adm/wtmp
397 conf_lastlog_location=/var/adm/lastlog
137d7b6c 398 AC_DEFINE(USE_PIPES)
a423beaf 399 ;;
6f68f28a 400*-ncr-sysv*)
98a7c37b 401 LIBS="$LIBS -lc89"
29525240 402 AC_DEFINE(USE_PIPES)
eabb99c6 403 AC_DEFINE(SSHD_ACQUIRES_CTTY)
6fb3618d 404 AC_DEFINE(SETEUID_BREAKS_SETUID)
405 AC_DEFINE(BROKEN_SETREUID)
406 AC_DEFINE(BROKEN_SETREGID)
6f68f28a 407 ;;
132dd316 408*-sni-sysv*)
c8c15bcb 409 # /usr/ucblib MUST NOT be searched on ReliantUNIX
e2798e96 410 AC_CHECK_LIB(dl, dlsym, ,)
85cf54ec 411 # -lresolv needs to be at then end of LIBS or DNS lookups break
412 AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
9548d6c8 413 IPADDR_IN_DISPLAY=yes
414 AC_DEFINE(USE_PIPES)
132dd316 415 AC_DEFINE(IP_TOS_IS_BROKEN)
605369bb 416 AC_DEFINE(SETEUID_BREAKS_SETUID)
417 AC_DEFINE(BROKEN_SETREUID)
418 AC_DEFINE(BROKEN_SETREGID)
eabb99c6 419 AC_DEFINE(SSHD_ACQUIRES_CTTY)
95b99395 420 external_path_file=/etc/default/login
c8c15bcb 421 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
422 # Attention: always take care to bind libsocket and libnsl before libc,
423 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
132dd316 424 ;;
79a7ba96 425# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
77bb0bca 426*-*-sysv4.2*)
ed6553e2 427 AC_DEFINE(USE_PIPES)
7ed101c0 428 AC_DEFINE(SETEUID_BREAKS_SETUID)
429 AC_DEFINE(BROKEN_SETREUID)
430 AC_DEFINE(BROKEN_SETREGID)
46f853b9 431 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
77bb0bca 432 ;;
79a7ba96 433# UnixWare 7.x, OpenUNIX 8
77bb0bca 434*-*-sysv5*)
d7d2cc6e 435 check_for_libcrypt_later=1
436 AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars])
ed6553e2 437 AC_DEFINE(USE_PIPES)
7ed101c0 438 AC_DEFINE(SETEUID_BREAKS_SETUID)
439 AC_DEFINE(BROKEN_SETREUID)
440 AC_DEFINE(BROKEN_SETREGID)
3466e002 441 AC_DEFINE(PASSWD_NEEDS_USERNAME)
822015dd 442 case "$host" in
443 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
444 TEST_SHELL=/u95/bin/sh
3466e002 445 AC_DEFINE(BROKEN_LIBIAF, 1,
446 [ia_uinfo routines not supported by OS yet])
822015dd 447 ;;
448 esac
77bb0bca 449 ;;
9d6b1b96 450*-*-sysv*)
9d6b1b96 451 ;;
79a7ba96 452# SCO UNIX and OEM versions of SCO UNIX
77bb0bca 453*-*-sco3.2v4*)
11cf4f1f 454 AC_MSG_ERROR("This Platform is no longer supported.")
77bb0bca 455 ;;
79a7ba96 456# SCO OpenServer 5.x
77bb0bca 457*-*-sco3.2v5*)
21710e39 458 if test -z "$GCC"; then
459 CFLAGS="$CFLAGS -belf"
460 fi
ed6553e2 461 LIBS="$LIBS -lprot -lx -ltinfo -lm"
509b1f88 462 no_dev_ptmx=1
ed6553e2 463 AC_DEFINE(USE_PIPES)
6e879cb4 464 AC_DEFINE(HAVE_SECUREWARE)
d287c664 465 AC_DEFINE(DISABLE_SHADOW)
94d8258b 466 AC_DEFINE(DISABLE_FD_PASSING)
7ed101c0 467 AC_DEFINE(SETEUID_BREAKS_SETUID)
468 AC_DEFINE(BROKEN_SETREUID)
469 AC_DEFINE(BROKEN_SETREGID)
bcebad47 470 AC_DEFINE(WITH_ABBREV_NO_TTY)
34f2baf0 471 AC_DEFINE(BROKEN_UPDWTMPX)
3466e002 472 AC_DEFINE(PASSWD_NEEDS_USERNAME)
aca75d94 473 AC_CHECK_FUNCS(getluid setluid)
533875af 474 MANTYPE=man
a3245b92 475 TEST_SHELL=ksh
509b1f88 476 ;;
ccbb983c 477*-*-unicosmk*)
3466e002 478 AC_DEFINE(NO_SSH_LASTLOG, 1,
479 [Define if you don't want to use lastlog in session.c])
c1ad5966 480 AC_DEFINE(SETEUID_BREAKS_SETUID)
481 AC_DEFINE(BROKEN_SETREUID)
482 AC_DEFINE(BROKEN_SETREGID)
ccbb983c 483 AC_DEFINE(USE_PIPES)
484 AC_DEFINE(DISABLE_FD_PASSING)
485 LDFLAGS="$LDFLAGS"
486 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
487 MANTYPE=cat
d262b7f2 488 ;;
7b9a8c6e 489*-*-unicosmp*)
c1ad5966 490 AC_DEFINE(SETEUID_BREAKS_SETUID)
491 AC_DEFINE(BROKEN_SETREUID)
492 AC_DEFINE(BROKEN_SETREGID)
7b9a8c6e 493 AC_DEFINE(WITH_ABBREV_NO_TTY)
494 AC_DEFINE(USE_PIPES)
495 AC_DEFINE(DISABLE_FD_PASSING)
496 LDFLAGS="$LDFLAGS"
c1ad5966 497 LIBS="$LIBS -lgen -lacid -ldb"
7b9a8c6e 498 MANTYPE=cat
499 ;;
ca5c7d6a 500*-*-unicos*)
c1ad5966 501 AC_DEFINE(SETEUID_BREAKS_SETUID)
502 AC_DEFINE(BROKEN_SETREUID)
503 AC_DEFINE(BROKEN_SETREGID)
ca5c7d6a 504 AC_DEFINE(USE_PIPES)
94d8258b 505 AC_DEFINE(DISABLE_FD_PASSING)
ef51930f 506 AC_DEFINE(NO_SSH_LASTLOG)
ccbb983c 507 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
508 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
509 MANTYPE=cat
a704dd54 510 ;;
4d33e531 511*-dec-osf*)
99c8ddac 512 AC_MSG_CHECKING(for Digital Unix SIA)
513 no_osfsia=""
514 AC_ARG_WITH(osfsia,
515 [ --with-osfsia Enable Digital Unix SIA],
516 [
517 if test "x$withval" = "xno" ; then
518 AC_MSG_RESULT(disabled)
519 no_osfsia=1
520 fi
521 ],
522 )
523 if test -z "$no_osfsia" ; then
4d33e531 524 if test -f /etc/sia/matrix.conf; then
525 AC_MSG_RESULT(yes)
3466e002 526 AC_DEFINE(HAVE_OSF_SIA, 1,
527 [Define if you have Digital Unix Security
528 Integration Architecture])
529 AC_DEFINE(DISABLE_LOGIN, 1,
530 [Define if you don't want to use your
531 system's login() call])
58d0df4e 532 AC_DEFINE(DISABLE_FD_PASSING)
4d33e531 533 LIBS="$LIBS -lsecurity -ldb -lm -laud"
534 else
535 AC_MSG_RESULT(no)
3466e002 536 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin",
537 [String used in /etc/passwd to denote locked account])
4d33e531 538 fi
539 fi
a6e67b60 540 AC_DEFINE(BROKEN_GETADDRINFO)
f4f2ff4f 541 AC_DEFINE(SETEUID_BREAKS_SETUID)
08da2d08 542 AC_DEFINE(BROKEN_SETREUID)
543 AC_DEFINE(BROKEN_SETREGID)
4d33e531 544 ;;
41cb4569 545
546*-*-nto-qnx)
547 AC_DEFINE(USE_PIPES)
548 AC_DEFINE(NO_X11_UNIX_SOCKETS)
3466e002 549 AC_DEFINE(MISSING_NFDBITS, 1, [Define on *nto-qnx systems])
550 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems])
551 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
41cb4569 552 ;;
35fc74ed 553
554*-*-ultrix*)
3466e002 555 AC_DEFINE(BROKEN_GETGROUPS, 1, [getgroups(0,NULL) will return -1])
556 AC_DEFINE(BROKEN_MMAP, 1, [Ultrix mmap can't map files])
557 AC_DEFINE(NEED_SETPRGP)
b5765e1d 558 AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix])
559 ;;
157b6700 560
561*-*-lynxos)
562 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
3466e002 563 AC_DEFINE(MISSING_HOWMANY)
157b6700 564 AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation])
565 ;;
a7effaac 566esac
567
8e7b16f8 568# Allow user to specify flags
569AC_ARG_WITH(cflags,
570 [ --with-cflags Specify additional flags to pass to compiler],
571 [
6cf0200f 572 if test -n "$withval" && test "x$withval" != "xno" && \
573 test "x${withval}" != "xyes"; then
8e7b16f8 574 CFLAGS="$CFLAGS $withval"
575 fi
82f4e93d 576 ]
8e7b16f8 577)
0c2fb82f 578AC_ARG_WITH(cppflags,
579 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
580 [
6cf0200f 581 if test -n "$withval" && test "x$withval" != "xno" && \
582 test "x${withval}" != "xyes"; then
0c2fb82f 583 CPPFLAGS="$CPPFLAGS $withval"
584 fi
585 ]
586)
8e7b16f8 587AC_ARG_WITH(ldflags,
97b378bf 588 [ --with-ldflags Specify additional flags to pass to linker],
8e7b16f8 589 [
6cf0200f 590 if test -n "$withval" && test "x$withval" != "xno" && \
591 test "x${withval}" != "xyes"; then
8e7b16f8 592 LDFLAGS="$LDFLAGS $withval"
593 fi
82f4e93d 594 ]
8e7b16f8 595)
596AC_ARG_WITH(libs,
597 [ --with-libs Specify additional libraries to link with],
598 [
6cf0200f 599 if test -n "$withval" && test "x$withval" != "xno" && \
600 test "x${withval}" != "xyes"; then
8e7b16f8 601 LIBS="$LIBS $withval"
602 fi
82f4e93d 603 ]
8e7b16f8 604)
ed89c848 605AC_ARG_WITH(Werror,
606 [ --with-Werror Build main code with -Werror],
607 [
608 if test -n "$withval" && test "x$withval" != "xno"; then
609 werror_flags="-Werror"
1012885d 610 if test "x${withval}" != "xyes"; then
ed89c848 611 werror_flags="$withval"
612 fi
613 fi
614 ]
615)
8e7b16f8 616
c5829391 617AC_MSG_CHECKING(compiler and flags for sanity)
479cece8 618AC_RUN_IFELSE(
619 [AC_LANG_SOURCE([
c5829391 620#include <stdio.h>
621int main(){exit(0);}
479cece8 622 ])],
c5829391 623 [ AC_MSG_RESULT(yes) ],
624 [
625 AC_MSG_RESULT(no)
626 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
1a01a50c 627 ],
628 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
c5829391 629)
630
b04a9f8c 631dnl Checks for header files.
632AC_CHECK_HEADERS( \
633 bstring.h \
634 crypt.h \
635 dirent.h \
636 endian.h \
637 features.h \
638 floatingpoint.h \
639 getopt.h \
640 glob.h \
641 ia.h \
4c653d8e 642 iaf.h \
b04a9f8c 643 lastlog.h \
644 limits.h \
645 login.h \
646 login_cap.h \
647 maillock.h \
648 ndir.h \
649 netdb.h \
650 netgroup.h \
651 netinet/in_systm.h \
652 pam/pam_appl.h \
653 paths.h \
654 pty.h \
655 readpassphrase.h \
656 rpc/types.h \
657 security/pam_appl.h \
658 shadow.h \
659 stddef.h \
660 stdint.h \
0957c2cf 661 string.h \
b04a9f8c 662 strings.h \
663 sys/audit.h \
664 sys/bitypes.h \
665 sys/bsdtty.h \
666 sys/cdefs.h \
667 sys/dir.h \
668 sys/mman.h \
669 sys/ndir.h \
670 sys/prctl.h \
671 sys/pstat.h \
672 sys/select.h \
673 sys/stat.h \
674 sys/stream.h \
675 sys/stropts.h \
676 sys/strtio.h \
677 sys/sysmacros.h \
678 sys/time.h \
679 sys/timers.h \
680 sys/un.h \
681 time.h \
682 tmpdir.h \
683 ttyent.h \
25dd2ce6 684 unistd.h \
b04a9f8c 685 usersec.h \
686 util.h \
687 utime.h \
688 utmp.h \
689 utmpx.h \
ea76f54c 690 vis.h \
b04a9f8c 691)
ddceb1c8 692
765a24cd 693# sys/ptms.h requires sys/stream.h to be included first on Solaris
694AC_CHECK_HEADERS(sys/ptms.h, [], [], [
695#ifdef HAVE_SYS_STREAM_H
696# include <sys/stream.h>
697#endif
698])
699
a0391976 700# Checks for libraries.
98a7c37b 701AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
702AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
2c523de9 703
446227d6 704dnl IRIX and Solaris 2.5.1 have dirname() in libgen
705AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
706 AC_CHECK_LIB(gen, dirname,[
707 AC_CACHE_CHECK([for broken dirname],
708 ac_cv_have_broken_dirname, [
709 save_LIBS="$LIBS"
710 LIBS="$LIBS -lgen"
b0e7249f 711 AC_RUN_IFELSE(
712 [AC_LANG_SOURCE([[
446227d6 713#include <libgen.h>
714#include <string.h>
715
716int main(int argc, char **argv) {
717 char *s, buf[32];
718
719 strncpy(buf,"/etc", 32);
720 s = dirname(buf);
721 if (!s || strncmp(s, "/", 32) != 0) {
722 exit(1);
723 } else {
724 exit(0);
725 }
726}
b0e7249f 727 ]])],
728 [ ac_cv_have_broken_dirname="no" ],
729 [ ac_cv_have_broken_dirname="yes" ],
446227d6 730 [ ac_cv_have_broken_dirname="no" ],
446227d6 731 )
732 LIBS="$save_LIBS"
733 ])
734 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
735 LIBS="$LIBS -lgen"
736 AC_DEFINE(HAVE_DIRNAME)
737 AC_CHECK_HEADERS(libgen.h)
738 fi
739 ])
740])
741
742AC_CHECK_FUNC(getspnam, ,
743 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
3466e002 744AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME, 1,
745 [Define if you have the basename function.]))
446227d6 746
98a7c37b 747dnl zlib is required
748AC_ARG_WITH(zlib,
749 [ --with-zlib=PATH Use zlib in PATH],
6dd05556 750 [ if test "x$withval" = "xno" ; then
751 AC_MSG_ERROR([*** zlib is required ***])
752 elif test "x$withval" != "xyes"; then
98a7c37b 753 if test -d "$withval/lib"; then
754 if test -n "${need_dash_r}"; then
5a162955 755 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 756 else
5a162955 757 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 758 fi
759 else
760 if test -n "${need_dash_r}"; then
5a162955 761 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 762 else
5a162955 763 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 764 fi
765 fi
766 if test -d "$withval/include"; then
5a162955 767 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 768 else
5a162955 769 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 770 fi
6dd05556 771 fi ]
98a7c37b 772)
773
0a15d73b 774AC_CHECK_LIB(z, deflate, ,
775 [
776 saved_CPPFLAGS="$CPPFLAGS"
777 saved_LDFLAGS="$LDFLAGS"
778 save_LIBS="$LIBS"
779 dnl Check default zlib install dir
780 if test -n "${need_dash_r}"; then
781 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
782 else
783 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
784 fi
785 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
786 LIBS="$LIBS -lz"
787 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
788 [
789 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
790 ]
791 )
792 ]
793)
4ad65809 794AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
8068d564 795
796AC_ARG_WITH(zlib-version-check,
797 [ --without-zlib-version-check Disable zlib version check],
798 [ if test "x$withval" = "xno" ; then
799 zlib_check_nonfatal=1
800 fi
801 ]
802)
803
5c7fc85d 804AC_MSG_CHECKING(for possibly buggy zlib)
479cece8 805AC_RUN_IFELSE([AC_LANG_SOURCE([[
5c7fc85d 806#include <stdio.h>
4ad65809 807#include <zlib.h>
808int main()
809{
5c7fc85d 810 int a=0, b=0, c=0, d=0, n, v;
811 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
812 if (n != 3 && n != 4)
4ad65809 813 exit(1);
5c7fc85d 814 v = a*1000000 + b*10000 + c*100 + d;
815 fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
816
817 /* 1.1.4 is OK */
818 if (a == 1 && b == 1 && c >= 4)
4ad65809 819 exit(0);
5c7fc85d 820
0072b59d 821 /* 1.2.3 and up are OK */
822 if (v >= 1020300)
5c7fc85d 823 exit(0);
824
4ad65809 825 exit(2);
826}
479cece8 827 ]])],
5c7fc85d 828 AC_MSG_RESULT(no),
829 [ AC_MSG_RESULT(yes)
8068d564 830 if test -z "$zlib_check_nonfatal" ; then
831 AC_MSG_ERROR([*** zlib too old - check config.log ***
832Your reported zlib version has known security problems. It's possible your
833vendor has fixed these problems without changing the version number. If you
834are sure this is the case, you can disable the check by running
835"./configure --without-zlib-version-check".
6090bcfe 836If you are in doubt, upgrade zlib to version 1.2.3 or greater.
5c7fc85d 837See http://www.gzip.org/zlib/ for details.])
8068d564 838 else
839 AC_MSG_WARN([zlib version may have security problems])
840 fi
1a01a50c 841 ],
842 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
4ad65809 843)
48e7916f 844
2c523de9 845dnl UnixWare 2.x
aff51935 846AC_CHECK_FUNC(strcasecmp,
2c523de9 847 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
848)
aff51935 849AC_CHECK_FUNC(utimes,
cda1ebcb 850 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
851 LIBS="$LIBS -lc89"]) ]
2c523de9 852)
4cca272e 853
7c6d759d 854dnl Checks for libutil functions
855AC_CHECK_HEADERS(libutil.h)
3466e002 856AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1,
857 [Define if your libraries define login()])])
7c6d759d 858AC_CHECK_FUNCS(logout updwtmp logwtmp)
859
a738c3b0 860AC_FUNC_STRFTIME
861
84ceda19 862# Check for ALTDIRFUNC glob() extension
863AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
864AC_EGREP_CPP(FOUNDIT,
865 [
866 #include <glob.h>
867 #ifdef GLOB_ALTDIRFUNC
868 FOUNDIT
869 #endif
aff51935 870 ],
84ceda19 871 [
3466e002 872 AC_DEFINE(GLOB_HAS_ALTDIRFUNC, 1,
873 [Define if your system glob() function has
874 the GLOB_ALTDIRFUNC extension])
84ceda19 875 AC_MSG_RESULT(yes)
876 ],
877 [
878 AC_MSG_RESULT(no)
879 ]
880)
4cca272e 881
40849fdb 882# Check for g.gl_matchc glob() extension
883AC_MSG_CHECKING(for gl_matchc field in glob_t)
884AC_EGREP_CPP(FOUNDIT,
aff51935 885 [
886 #include <glob.h>
40849fdb 887 int main(void){glob_t g; g.gl_matchc = 1;}
aff51935 888 ],
889 [
3466e002 890 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1,
891 [Define if your system glob() function has
892 gl_matchc options in glob_t])
aff51935 893 AC_MSG_RESULT(yes)
894 ],
895 [
896 AC_MSG_RESULT(no)
897 ]
40849fdb 898)
899
edbe6722 900AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
1a01a50c 901AC_RUN_IFELSE(
479cece8 902 [AC_LANG_SOURCE([[
edbe6722 903#include <sys/types.h>
904#include <dirent.h>
aec4cb4f 905int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
479cece8 906 ]])],
aff51935 907 [AC_MSG_RESULT(yes)],
edbe6722 908 [
909 AC_MSG_RESULT(no)
3466e002 910 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1,
911 [Define in your struct dirent expects you to
912 allocate extra space for d_name])
1a01a50c 913 ],
82f4e93d 914 [
1a01a50c 915 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
916 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
edbe6722 917 ]
918)
919
419e26e7 920AC_MSG_CHECKING([for /proc/pid/fd directory])
921if test -d "/proc/$$/fd" ; then
3466e002 922 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
419e26e7 923 AC_MSG_RESULT(yes)
924else
925 AC_MSG_RESULT(no)
926fi
927
278588d8 928# Check whether user wants S/Key support
aff51935 929SKEY_MSG="no"
278588d8 930AC_ARG_WITH(skey,
6ff3d0dc 931 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
278588d8 932 [
933 if test "x$withval" != "xno" ; then
934
935 if test "x$withval" != "xyes" ; then
936 CPPFLAGS="$CPPFLAGS -I${withval}/include"
937 LDFLAGS="$LDFLAGS -L${withval}/lib"
938 fi
939
3466e002 940 AC_DEFINE(SKEY, 1, [Define if you want S/Key support])
278588d8 941 LIBS="-lskey $LIBS"
aff51935 942 SKEY_MSG="yes"
82f4e93d 943
ddceb1c8 944 AC_MSG_CHECKING([for s/key support])
b0e7249f 945 AC_LINK_IFELSE(
946 [AC_LANG_SOURCE([[
ddceb1c8 947#include <stdio.h>
948#include <skey.h>
aec4cb4f 949int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
b0e7249f 950 ]])],
ddceb1c8 951 [AC_MSG_RESULT(yes)],
278588d8 952 [
ddceb1c8 953 AC_MSG_RESULT(no)
278588d8 954 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
955 ])
141fc639 956 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
957 AC_TRY_COMPILE(
958 [#include <stdio.h>
959 #include <skey.h>],
960 [(void)skeychallenge(NULL,"name","",0);],
961 [AC_MSG_RESULT(yes)
3466e002 962 AC_DEFINE(SKEYCHALLENGE_4ARG, 1,
963 [Define if your skeychallenge()
964 function takes 4 arguments (NetBSD)])],
141fc639 965 [AC_MSG_RESULT(no)]
966 )
278588d8 967 fi
968 ]
969)
970
971# Check whether user wants TCP wrappers support
98a7c37b 972TCPW_MSG="no"
278588d8 973AC_ARG_WITH(tcp-wrappers,
6ff3d0dc 974 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
278588d8 975 [
976 if test "x$withval" != "xno" ; then
977 saved_LIBS="$LIBS"
98a7c37b 978 saved_LDFLAGS="$LDFLAGS"
979 saved_CPPFLAGS="$CPPFLAGS"
4b492aab 980 if test -n "${withval}" && \
6cf0200f 981 test "x${withval}" != "xyes"; then
98a7c37b 982 if test -d "${withval}/lib"; then
983 if test -n "${need_dash_r}"; then
5a162955 984 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
98a7c37b 985 else
5a162955 986 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
98a7c37b 987 fi
988 else
989 if test -n "${need_dash_r}"; then
5a162955 990 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
98a7c37b 991 else
5a162955 992 LDFLAGS="-L${withval} ${LDFLAGS}"
98a7c37b 993 fi
994 fi
995 if test -d "${withval}/include"; then
5a162955 996 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
98a7c37b 997 else
5a162955 998 CPPFLAGS="-I${withval} ${CPPFLAGS}"
98a7c37b 999 fi
98a7c37b 1000 fi
ddceb1c8 1001 LIBWRAP="-lwrap"
1002 LIBS="$LIBWRAP $LIBS"
278588d8 1003 AC_MSG_CHECKING(for libwrap)
1004 AC_TRY_LINK(
1005 [
77f09220 1006#include <sys/types.h>
1007#include <sys/socket.h>
1008#include <netinet/in.h>
278588d8 1009#include <tcpd.h>
1010 int deny_severity = 0, allow_severity = 0;
1011 ],
1012 [hosts_access(0);],
1013 [
1014 AC_MSG_RESULT(yes)
3466e002 1015 AC_DEFINE(LIBWRAP, 1,
1016 [Define if you want
1017 TCP Wrappers support])
ddceb1c8 1018 AC_SUBST(LIBWRAP)
98a7c37b 1019 TCPW_MSG="yes"
278588d8 1020 ],
1021 [
1022 AC_MSG_ERROR([*** libwrap missing])
1023 ]
1024 )
ddceb1c8 1025 LIBS="$saved_LIBS"
278588d8 1026 fi
1027 ]
1028)
1029
59031773 1030# Check whether user wants libedit support
1031LIBEDIT_MSG="no"
1032AC_ARG_WITH(libedit,
6ff3d0dc 1033 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
59031773 1034 [ if test "x$withval" != "xno" ; then
737edf04 1035 if test "x$withval" != "xyes"; then
bb116c8e 1036 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1037 if test -n "${need_dash_r}"; then
1038 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1039 else
1040 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1041 fi
737edf04 1042 fi
59031773 1043 AC_CHECK_LIB(edit, el_init,
3466e002 1044 [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp])
59031773 1045 LIBEDIT="-ledit -lcurses"
1046 LIBEDIT_MSG="yes"
1047 AC_SUBST(LIBEDIT)
1048 ],
737edf04 1049 [ AC_MSG_ERROR(libedit not found) ],
1050 [ -lcurses ]
59031773 1051 )
f47ddccb 1052 AC_MSG_CHECKING(if libedit version is compatible)
d92622f9 1053 AC_COMPILE_IFELSE(
1054 [AC_LANG_SOURCE([[
1055#include <histedit.h>
f47ddccb 1056int main(void)
1057{
1058 int i = H_SETSIZE;
1059 el_init("", NULL, NULL, NULL);
1060 exit(0);
1061}
d92622f9 1062 ]])],
f47ddccb 1063 [ AC_MSG_RESULT(yes) ],
1064 [ AC_MSG_RESULT(no)
1065 AC_MSG_ERROR(libedit version is not compatible) ]
1066 )
59031773 1067 fi ]
1068)
1069
7b578f7d 1070AUDIT_MODULE=none
1071AC_ARG_WITH(audit,
1072 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
1073 [
1074 AC_MSG_CHECKING(for supported audit module)
1075 case "$withval" in
1076 bsm)
1077 AC_MSG_RESULT(bsm)
1078 AUDIT_MODULE=bsm
1079 dnl Checks for headers, libs and functions
1080 AC_CHECK_HEADERS(bsm/audit.h, [],
1081 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
1082 AC_CHECK_LIB(bsm, getaudit, [],
1083 [AC_MSG_ERROR(BSM enabled and required library not found)])
1084 AC_CHECK_FUNCS(getaudit, [],
1085 [AC_MSG_ERROR(BSM enabled and required function not found)])
1086 # These are optional
7939c496 1087 AC_CHECK_FUNCS(getaudit_addr)
3466e002 1088 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
7b578f7d 1089 ;;
1090 debug)
1091 AUDIT_MODULE=debug
1092 AC_MSG_RESULT(debug)
3466e002 1093 AC_DEFINE(SSH_AUDIT_EVENTS, 1, Use audit debugging module)
7b578f7d 1094 ;;
a2b3321d 1095 no)
d92622f9 1096 AC_MSG_RESULT(no)
a2b3321d 1097 ;;
7b578f7d 1098 *)
1099 AC_MSG_ERROR([Unknown audit module $withval])
1100 ;;
1101 esac ]
1102)
1103
19160674 1104dnl Checks for library functions. Please keep in alphabetical order
b04a9f8c 1105AC_CHECK_FUNCS( \
1106 arc4random \
1107 b64_ntop \
1108 __b64_ntop \
1109 b64_pton \
1110 __b64_pton \
1111 bcopy \
1112 bindresvport_sa \
1113 clock \
1114 closefrom \
1115 dirfd \
b04a9f8c 1116 fchmod \
1117 fchown \
1118 freeaddrinfo \
1119 futimes \
1120 getaddrinfo \
1121 getcwd \
1122 getgrouplist \
1123 getnameinfo \
1124 getopt \
1125 getpeereid \
1126 _getpty \
1127 getrlimit \
1128 getttyent \
1129 glob \
1130 inet_aton \
1131 inet_ntoa \
1132 inet_ntop \
1133 innetgr \
1134 login_getcapbool \
1135 md5_crypt \
1136 memmove \
1137 mkdtemp \
1138 mmap \
1139 ngetaddrinfo \
1140 nsleep \
1141 ogetaddrinfo \
1142 openlog_r \
1143 openpty \
1144 prctl \
1145 pstat \
1146 readpassphrase \
1147 realpath \
1148 recvmsg \
1149 rresvport_af \
1150 sendmsg \
1151 setdtablesize \
1152 setegid \
1153 setenv \
1154 seteuid \
1155 setgroups \
1156 setlogin \
1157 setpcred \
1158 setproctitle \
1159 setregid \
1160 setreuid \
1161 setrlimit \
1162 setsid \
1163 setvbuf \
1164 sigaction \
1165 sigvec \
1166 snprintf \
1167 socketpair \
1168 strdup \
1169 strerror \
1170 strlcat \
1171 strlcpy \
1172 strmode \
1173 strnvis \
1174 strtonum \
1e29a0c8 1175 strtoll \
b04a9f8c 1176 strtoul \
1177 sysconf \
1178 tcgetpgrp \
1179 truncate \
1180 unsetenv \
1181 updwtmpx \
1182 utimes \
1183 vhangup \
1184 vsnprintf \
1185 waitpid \
19160674 1186)
98a7c37b 1187
1a086f97 1188# IRIX has a const char return value for gai_strerror()
1189AC_CHECK_FUNCS(gai_strerror,[
1190 AC_DEFINE(HAVE_GAI_STRERROR)
1191 AC_TRY_COMPILE([
1192#include <sys/types.h>
1193#include <sys/socket.h>
1194#include <netdb.h>
1195
1196const char *gai_strerror(int);],[
1197char *str;
1198
1199str = gai_strerror(0);],[
1200 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
1201 [Define if gai_strerror() returns const char *])])])
1202
3466e002 1203AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1,
1204 [Some systems put nanosleep outside of libc]))
92b1decf 1205
309709db 1206dnl Make sure prototypes are defined for these before using them.
309709db 1207AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
0957c2cf 1208AC_CHECK_DECL(strsep,
1209 [AC_CHECK_FUNCS(strsep)],
1210 [],
1211 [
1212#ifdef HAVE_STRING_H
1213# include <string.h>
1214#endif
1215 ])
08412d26 1216
3490699c 1217dnl tcsendbreak might be a macro
1218AC_CHECK_DECL(tcsendbreak,
1219 [AC_DEFINE(HAVE_TCSENDBREAK)],
aff51935 1220 [AC_CHECK_FUNCS(tcsendbreak)],
3490699c 1221 [#include <termios.h>]
1222)
1223
41e0e158 1224AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
1225
3f176010 1226AC_CHECK_FUNCS(setresuid, [
1227 dnl Some platorms have setresuid that isn't implemented, test for this
1228 AC_MSG_CHECKING(if setresuid seems to work)
479cece8 1229 AC_RUN_IFELSE(
1230 [AC_LANG_SOURCE([[
9a3fe0e2 1231#include <stdlib.h>
1232#include <errno.h>
1233int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
479cece8 1234 ]])],
3f176010 1235 [AC_MSG_RESULT(yes)],
3466e002 1236 [AC_DEFINE(BROKEN_SETRESUID, 1,
1237 [Define if your setresuid() is broken])
1a01a50c 1238 AC_MSG_RESULT(not implemented)],
1239 [AC_MSG_WARN([cross compiling: not checking setresuid])]
3f176010 1240 )
1241])
9a3fe0e2 1242
3f176010 1243AC_CHECK_FUNCS(setresgid, [
1244 dnl Some platorms have setresgid that isn't implemented, test for this
1245 AC_MSG_CHECKING(if setresgid seems to work)
479cece8 1246 AC_RUN_IFELSE(
1247 [AC_LANG_SOURCE([[
9a3fe0e2 1248#include <stdlib.h>
1249#include <errno.h>
1250int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
479cece8 1251 ]])],
3f176010 1252 [AC_MSG_RESULT(yes)],
3466e002 1253 [AC_DEFINE(BROKEN_SETRESGID, 1,
1254 [Define if your setresgid() is broken])
1a01a50c 1255 AC_MSG_RESULT(not implemented)],
1256 [AC_MSG_WARN([cross compiling: not checking setresuid])]
3f176010 1257 )
1258])
9a3fe0e2 1259
2e73a022 1260dnl Checks for time functions
1d7b9b20 1261AC_CHECK_FUNCS(gettimeofday time)
2e73a022 1262dnl Checks for utmp functions
b03bd394 1263AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1d7b9b20 1264AC_CHECK_FUNCS(utmpname)
2e73a022 1265dnl Checks for utmpx functions
b03bd394 1266AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1d7b9b20 1267AC_CHECK_FUNCS(setutxent utmpxname)
76cd7316 1268
aff51935 1269AC_CHECK_FUNC(daemon,
3466e002 1270 [AC_DEFINE(HAVE_DAEMON, 1, [Define if your libraries define daemon()])],
1271 [AC_CHECK_LIB(bsd, daemon,
1272 [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
beb43d31 1273)
1274
aff51935 1275AC_CHECK_FUNC(getpagesize,
3466e002 1276 [AC_DEFINE(HAVE_GETPAGESIZE, 1,
1277 [Define if your libraries define getpagesize()])],
1278 [AC_CHECK_LIB(ucb, getpagesize,
1279 [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
aa6bd60a 1280)
1281
2647ae26 1282# Check for broken snprintf
1283if test "x$ac_cv_func_snprintf" = "xyes" ; then
1284 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
1a01a50c 1285 AC_RUN_IFELSE(
479cece8 1286 [AC_LANG_SOURCE([[
2647ae26 1287#include <stdio.h>
aec4cb4f 1288int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
479cece8 1289 ]])],
aff51935 1290 [AC_MSG_RESULT(yes)],
2647ae26 1291 [
1292 AC_MSG_RESULT(no)
3466e002 1293 AC_DEFINE(BROKEN_SNPRINTF, 1,
1294 [Define if your snprintf is busted])
2647ae26 1295 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
1a01a50c 1296 ],
1297 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
2647ae26 1298 )
1299fi
1300
2f6f9cff 1301# Check for missing getpeereid (or equiv) support
1302NO_PEERCHECK=""
1303if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1304 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1305 AC_TRY_COMPILE(
1306 [#include <sys/types.h>
1307 #include <sys/socket.h>],
1308 [int i = SO_PEERCRED;],
62eb7db4 1309 [ AC_MSG_RESULT(yes)
3466e002 1310 AC_DEFINE(HAVE_SO_PEERCRED, 1, [Have PEERCRED socket option])
62eb7db4 1311 ],
2f6f9cff 1312 [AC_MSG_RESULT(no)
1313 NO_PEERCHECK=1]
1314 )
1315fi
1316
70e7d0b0 1317dnl see whether mkstemp() requires XXXXXX
1318if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1319AC_MSG_CHECKING([for (overly) strict mkstemp])
b0e7249f 1320AC_RUN_IFELSE(
1321 [AC_LANG_SOURCE([[
70e7d0b0 1322#include <stdlib.h>
1323main() { char template[]="conftest.mkstemp-test";
1324if (mkstemp(template) == -1)
1325 exit(1);
1326unlink(template); exit(0);
1327}
b0e7249f 1328 ]])],
70e7d0b0 1329 [
1330 AC_MSG_RESULT(no)
1331 ],
aff51935 1332 [
70e7d0b0 1333 AC_MSG_RESULT(yes)
3466e002 1334 AC_DEFINE(HAVE_STRICT_MKSTEMP, 1, [Silly mkstemp()])
70e7d0b0 1335 ],
1336 [
1337 AC_MSG_RESULT(yes)
1338 AC_DEFINE(HAVE_STRICT_MKSTEMP)
aff51935 1339 ]
70e7d0b0 1340)
1341fi
1342
eacb954e 1343dnl make sure that openpty does not reacquire controlling terminal
1344if test ! -z "$check_for_openpty_ctty_bug"; then
1345 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
b0e7249f 1346 AC_RUN_IFELSE(
1347 [AC_LANG_SOURCE([[
eacb954e 1348#include <stdio.h>
1349#include <sys/fcntl.h>
1350#include <sys/types.h>
1351#include <sys/wait.h>
1352
1353int
1354main()
1355{
1356 pid_t pid;
1357 int fd, ptyfd, ttyfd, status;
1358
1359 pid = fork();
1360 if (pid < 0) { /* failed */
1361 exit(1);
1362 } else if (pid > 0) { /* parent */
1363 waitpid(pid, &status, 0);
aff51935 1364 if (WIFEXITED(status))
eacb954e 1365 exit(WEXITSTATUS(status));
1366 else
1367 exit(2);
1368 } else { /* child */
1369 close(0); close(1); close(2);
1370 setsid();
1371 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1372 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1373 if (fd >= 0)
1374 exit(3); /* Acquired ctty: broken */
1375 else
1376 exit(0); /* Did not acquire ctty: OK */
1377 }
1378}
b0e7249f 1379 ]])],
eacb954e 1380 [
1381 AC_MSG_RESULT(yes)
1382 ],
1383 [
1384 AC_MSG_RESULT(no)
1385 AC_DEFINE(SSHD_ACQUIRES_CTTY)
b0e7249f 1386 ],
1387 [
1388 AC_MSG_RESULT(cross-compiling, assuming yes)
eacb954e 1389 ]
1390 )
1391fi
1392
4b492aab 1393if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1394 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
2fe51906 1395 AC_MSG_CHECKING(if getaddrinfo seems to work)
b0e7249f 1396 AC_RUN_IFELSE(
1397 [AC_LANG_SOURCE([[
2fe51906 1398#include <stdio.h>
1399#include <sys/socket.h>
1400#include <netdb.h>
1401#include <errno.h>
1402#include <netinet/in.h>
1403
1404#define TEST_PORT "2222"
1405
1406int
1407main(void)
1408{
1409 int err, sock;
1410 struct addrinfo *gai_ai, *ai, hints;
1411 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1412
1413 memset(&hints, 0, sizeof(hints));
1414 hints.ai_family = PF_UNSPEC;
1415 hints.ai_socktype = SOCK_STREAM;
1416 hints.ai_flags = AI_PASSIVE;
1417
1418 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1419 if (err != 0) {
1420 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1421 exit(1);
1422 }
1423
1424 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1425 if (ai->ai_family != AF_INET6)
1426 continue;
1427
1428 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1429 sizeof(ntop), strport, sizeof(strport),
1430 NI_NUMERICHOST|NI_NUMERICSERV);
1431
1432 if (err != 0) {
1433 if (err == EAI_SYSTEM)
1434 perror("getnameinfo EAI_SYSTEM");
1435 else
1436 fprintf(stderr, "getnameinfo failed: %s\n",
1437 gai_strerror(err));
1438 exit(2);
1439 }
1440
1441 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1442 if (sock < 0)
1443 perror("socket");
1444 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1445 if (errno == EBADF)
1446 exit(3);
1447 }
1448 }
1449 exit(0);
1450}
b0e7249f 1451 ]])],
2fe51906 1452 [
1453 AC_MSG_RESULT(yes)
1454 ],
1455 [
1456 AC_MSG_RESULT(no)
1457 AC_DEFINE(BROKEN_GETADDRINFO)
b0e7249f 1458 ],
1459 [
1460 AC_MSG_RESULT(cross-compiling, assuming yes)
2fe51906 1461 ]
1462 )
1463fi
1464
4b492aab 1465if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1466 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
5ccf88cb 1467 AC_MSG_CHECKING(if getaddrinfo seems to work)
b0e7249f 1468 AC_RUN_IFELSE(
1469 [AC_LANG_SOURCE([[
5ccf88cb 1470#include <stdio.h>
1471#include <sys/socket.h>
1472#include <netdb.h>
1473#include <errno.h>
1474#include <netinet/in.h>
1475
1476#define TEST_PORT "2222"
1477
1478int
1479main(void)
1480{
1481 int err, sock;
1482 struct addrinfo *gai_ai, *ai, hints;
1483 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1484
1485 memset(&hints, 0, sizeof(hints));
1486 hints.ai_family = PF_UNSPEC;
1487 hints.ai_socktype = SOCK_STREAM;
1488 hints.ai_flags = AI_PASSIVE;
1489
1490 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1491 if (err != 0) {
1492 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1493 exit(1);
1494 }
1495
1496 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1497 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1498 continue;
1499
1500 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1501 sizeof(ntop), strport, sizeof(strport),
1502 NI_NUMERICHOST|NI_NUMERICSERV);
1503
1504 if (ai->ai_family == AF_INET && err != 0) {
1505 perror("getnameinfo");
1506 exit(2);
1507 }
1508 }
1509 exit(0);
1510}
b0e7249f 1511 ]])],
5ccf88cb 1512 [
1513 AC_MSG_RESULT(yes)
3466e002 1514 AC_DEFINE(AIX_GETNAMEINFO_HACK, 1,
1515 [Define if you have a getaddrinfo that fails
1516 for the all-zeros IPv6 address])
5ccf88cb 1517 ],
1518 [
1519 AC_MSG_RESULT(no)
1520 AC_DEFINE(BROKEN_GETADDRINFO)
b0e7249f 1521 ],
1522 AC_MSG_RESULT(cross-compiling, assuming no)
5ccf88cb 1523 ]
1524 )
1525fi
1526
b29fd59f 1527if test "x$check_for_conflicting_getspnam" = "x1"; then
1528 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1529 AC_COMPILE_IFELSE(
1530 [
1531#include <shadow.h>
1532int main(void) {exit(0);}
1533 ],
1534 [
1535 AC_MSG_RESULT(no)
1536 ],
1537 [
1538 AC_MSG_RESULT(yes)
1539 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1540 [Conflicting defs for getspnam])
1541 ]
1542 )
1543fi
1544
7f8f5e00 1545AC_FUNC_GETPGRP
1546
717057b6 1547# Check for PAM libs
cbd7492e 1548PAM_MSG="no"
a0391976 1549AC_ARG_WITH(pam,
717057b6 1550 [ --with-pam Enable PAM support ],
a0391976 1551 [
717057b6 1552 if test "x$withval" != "xno" ; then
2511d104 1553 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1554 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
717057b6 1555 AC_MSG_ERROR([PAM headers not found])
1556 fi
a0391976 1557
717057b6 1558 AC_CHECK_LIB(dl, dlopen, , )
1559 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1560 AC_CHECK_FUNCS(pam_getenvlist)
749560dd 1561 AC_CHECK_FUNCS(pam_putenv)
2b763e31 1562
717057b6 1563 PAM_MSG="yes"
4cb5ffa0 1564
3466e002 1565 AC_DEFINE(USE_PAM, 1,
1566 [Define if you want to enable PAM support])
98f2d9d5 1567 if test $ac_cv_lib_dl_dlopen = yes; then
1568 LIBPAM="-lpam -ldl"
1569 else
1570 LIBPAM="-lpam"
1571 fi
1572 AC_SUBST(LIBPAM)
717057b6 1573 fi
1574 ]
1575)
cbd7492e 1576
717057b6 1577# Check for older PAM
1578if test "x$PAM_MSG" = "xyes" ; then
a0391976 1579 # Check PAM strerror arguments (old PAM)
1580 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1581 AC_TRY_COMPILE(
1582 [
18ba2aab 1583#include <stdlib.h>
2511d104 1584#if defined(HAVE_SECURITY_PAM_APPL_H)
18ba2aab 1585#include <security/pam_appl.h>
2511d104 1586#elif defined (HAVE_PAM_PAM_APPL_H)
1587#include <pam/pam_appl.h>
1588#endif
aff51935 1589 ],
1590 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
a0391976 1591 [AC_MSG_RESULT(no)],
1592 [
3466e002 1593 AC_DEFINE(HAVE_OLD_PAM, 1,
1594 [Define if you have an old version of PAM
1595 which takes only one argument to pam_strerror])
a0391976 1596 AC_MSG_RESULT(yes)
cbd7492e 1597 PAM_MSG="yes (old library)"
a0391976 1598 ]
717057b6 1599 )
a0391976 1600fi
1601
5b991353 1602# Search for OpenSSL
1603saved_CPPFLAGS="$CPPFLAGS"
1604saved_LDFLAGS="$LDFLAGS"
a0391976 1605AC_ARG_WITH(ssl-dir,
1606 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1607 [
e9e4a1c7 1608 if test "x$withval" != "xno" ; then
99eb0f64 1609 case "$withval" in
1610 # Relative paths
1611 ./*|../*) withval="`pwd`/$withval"
1612 esac
5b991353 1613 if test -d "$withval/lib"; then
1614 if test -n "${need_dash_r}"; then
1615 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1616 else
1617 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
d6f13fbb 1618 fi
1619 else
5b991353 1620 if test -n "${need_dash_r}"; then
1621 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1622 else
1623 LDFLAGS="-L${withval} ${LDFLAGS}"
d6f13fbb 1624 fi
1625 fi
5b991353 1626 if test -d "$withval/include"; then
1627 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
d6f13fbb 1628 else
5b991353 1629 CPPFLAGS="-I${withval} ${CPPFLAGS}"
58d100bf 1630 fi
a0391976 1631 fi
5b991353 1632 ]
1633)
5486a457 1634LIBS="-lcrypto $LIBS"
3466e002 1635AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
1636 [Define if your ssl headers are included
1637 with #include <openssl/header.h>]),
d45e3d76 1638 [
5b991353 1639 dnl Check default openssl install dir
1640 if test -n "${need_dash_r}"; then
1641 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1642 else
5b991353 1643 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
d45e3d76 1644 fi
5b991353 1645 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1646 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1647 [
1648 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1649 ]
1650 )
1651 ]
1652)
1653
cd018561 1654# Determine OpenSSL header version
1655AC_MSG_CHECKING([OpenSSL header version])
1a01a50c 1656AC_RUN_IFELSE(
479cece8 1657 [AC_LANG_SOURCE([[
cd018561 1658#include <stdio.h>
1659#include <string.h>
1660#include <openssl/opensslv.h>
1661#define DATA "conftest.sslincver"
1662int main(void) {
aff51935 1663 FILE *fd;
1664 int rc;
cd018561 1665
aff51935 1666 fd = fopen(DATA,"w");
1667 if(fd == NULL)
1668 exit(1);
cd018561 1669
1670 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1671 exit(1);
1672
1673 exit(0);
1674}
479cece8 1675 ]])],
cd018561 1676 [
1677 ssl_header_ver=`cat conftest.sslincver`
1678 AC_MSG_RESULT($ssl_header_ver)
1679 ],
1680 [
1681 AC_MSG_RESULT(not found)
1682 AC_MSG_ERROR(OpenSSL version header not found.)
1a01a50c 1683 ],
1684 [
1685 AC_MSG_WARN([cross compiling: not checking])
cd018561 1686 ]
1687)
1688
1689# Determine OpenSSL library version
1690AC_MSG_CHECKING([OpenSSL library version])
1a01a50c 1691AC_RUN_IFELSE(
479cece8 1692 [AC_LANG_SOURCE([[
cd018561 1693#include <stdio.h>
1694#include <string.h>
1695#include <openssl/opensslv.h>
1696#include <openssl/crypto.h>
1697#define DATA "conftest.ssllibver"
1698int main(void) {
aff51935 1699 FILE *fd;
1700 int rc;
cd018561 1701
aff51935 1702 fd = fopen(DATA,"w");
1703 if(fd == NULL)
1704 exit(1);
cd018561 1705
1706 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1707 exit(1);
1708
1709 exit(0);
1710}
479cece8 1711 ]])],
cd018561 1712 [
1713 ssl_library_ver=`cat conftest.ssllibver`
1714 AC_MSG_RESULT($ssl_library_ver)
1715 ],
1716 [
1717 AC_MSG_RESULT(not found)
1718 AC_MSG_ERROR(OpenSSL library not found.)
1a01a50c 1719 ],
1720 [
1721 AC_MSG_WARN([cross compiling: not checking])
cd018561 1722 ]
1723)
58d100bf 1724
9780116c 1725# Sanity check OpenSSL headers
1726AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1a01a50c 1727AC_RUN_IFELSE(
479cece8 1728 [AC_LANG_SOURCE([[
9780116c 1729#include <string.h>
1730#include <openssl/opensslv.h>
aec4cb4f 1731int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
479cece8 1732 ]])],
9780116c 1733 [
1734 AC_MSG_RESULT(yes)
1735 ],
1736 [
1737 AC_MSG_RESULT(no)
e15ba28b 1738 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1739Check config.log for details.
1740Also see contrib/findssl.sh for help identifying header/library mismatches.])
1a01a50c 1741 ],
1742 [
1743 AC_MSG_WARN([cross compiling: not checking])
9780116c 1744 ]
1745)
1746
5486a457 1747# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1748# because the system crypt() is more featureful.
1749if test "x$check_for_libcrypt_before" = "x1"; then
1750 AC_CHECK_LIB(crypt, crypt)
1751fi
1752
aff51935 1753# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
8087c5ee 1754# version in OpenSSL.
05114c74 1755if test "x$check_for_libcrypt_later" = "x1"; then
20cad736 1756 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
717057b6 1757fi
1758
4c653d8e 1759AC_CHECK_LIB(iaf, ia_openinfo)
f1b0ecc3 1760
1761### Configure cryptographic random number support
1762
1763# Check wheter OpenSSL seeds itself
1764AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1a01a50c 1765AC_RUN_IFELSE(
479cece8 1766 [AC_LANG_SOURCE([[
f1b0ecc3 1767#include <string.h>
1768#include <openssl/rand.h>
aec4cb4f 1769int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
479cece8 1770 ]])],
f1b0ecc3 1771 [
1772 OPENSSL_SEEDS_ITSELF=yes
1773 AC_MSG_RESULT(yes)
1774 ],
1775 [
1776 AC_MSG_RESULT(no)
1777 # Default to use of the rand helper if OpenSSL doesn't
1778 # seed itself
1779 USE_RAND_HELPER=yes
1a01a50c 1780 ],
1781 [
1782 AC_MSG_WARN([cross compiling: assuming yes])
1783 # This is safe, since all recent OpenSSL versions will
82f4e93d 1784 # complain at runtime if not seeded correctly.
1a01a50c 1785 OPENSSL_SEEDS_ITSELF=yes
f1b0ecc3 1786 ]
1787)
1788
1789
1790# Do we want to force the use of the rand helper?
1791AC_ARG_WITH(rand-helper,
1792 [ --with-rand-helper Use subprocess to gather strong randomness ],
1793 [
1794 if test "x$withval" = "xno" ; then
aff51935 1795 # Force use of OpenSSL's internal RNG, even if
f1b0ecc3 1796 # the previous test showed it to be unseeded.
1797 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1798 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1799 OPENSSL_SEEDS_ITSELF=yes
1800 USE_RAND_HELPER=""
1801 fi
1802 else
1803 USE_RAND_HELPER=yes
1804 fi
1805 ],
82f4e93d 1806)
f1b0ecc3 1807
1808# Which randomness source do we use?
4b492aab 1809if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
f1b0ecc3 1810 # OpenSSL only
3466e002 1811 AC_DEFINE(OPENSSL_PRNG_ONLY, 1,
1812 [Define if you want OpenSSL's internally seeded PRNG only])
f1b0ecc3 1813 RAND_MSG="OpenSSL internal ONLY"
1814 INSTALL_SSH_RAND_HELPER=""
70e2f2f3 1815elif test ! -z "$USE_RAND_HELPER" ; then
1816 # install rand helper
f1b0ecc3 1817 RAND_MSG="ssh-rand-helper"
1818 INSTALL_SSH_RAND_HELPER="yes"
1819fi
1820AC_SUBST(INSTALL_SSH_RAND_HELPER)
1821
1822### Configuration of ssh-rand-helper
1823
1824# PRNGD TCP socket
1825AC_ARG_WITH(prngd-port,
1826 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1827 [
eb5d7ff6 1828 case "$withval" in
1829 no)
1830 withval=""
1831 ;;
1832 [[0-9]]*)
1833 ;;
1834 *)
1835 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1836 ;;
1837 esac
1838 if test ! -z "$withval" ; then
f1b0ecc3 1839 PRNGD_PORT="$withval"
3466e002 1840 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT,
1841 [Port number of PRNGD/EGD random number socket])
f1b0ecc3 1842 fi
1843 ]
1844)
1845
1846# PRNGD Unix domain socket
1847AC_ARG_WITH(prngd-socket,
1848 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1849 [
eb5d7ff6 1850 case "$withval" in
1851 yes)
f1b0ecc3 1852 withval="/var/run/egd-pool"
eb5d7ff6 1853 ;;
1854 no)
1855 withval=""
1856 ;;
1857 /*)
1858 ;;
1859 *)
1860 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1861 ;;
1862 esac
1863
1864 if test ! -z "$withval" ; then
f1b0ecc3 1865 if test ! -z "$PRNGD_PORT" ; then
1866 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1867 fi
906e811b 1868 if test ! -r "$withval" ; then
f1b0ecc3 1869 AC_MSG_WARN(Entropy socket is not readable)
1870 fi
1871 PRNGD_SOCKET="$withval"
3466e002 1872 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET",
1873 [Location of PRNGD/EGD random number socket])
f1b0ecc3 1874 fi
ddceb1c8 1875 ],
1876 [
1877 # Check for existing socket only if we don't have a random device already
1878 if test "$USE_RAND_HELPER" = yes ; then
1879 AC_MSG_CHECKING(for PRNGD/EGD socket)
1880 # Insert other locations here
1881 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1882 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1883 PRNGD_SOCKET="$sock"
1884 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1885 break;
1886 fi
1887 done
1888 if test ! -z "$PRNGD_SOCKET" ; then
1889 AC_MSG_RESULT($PRNGD_SOCKET)
1890 else
1891 AC_MSG_RESULT(not found)
1892 fi
1893 fi
f1b0ecc3 1894 ]
1895)
1896
1897# Change default command timeout for hashing entropy source
1898entropy_timeout=200
1899AC_ARG_WITH(entropy-timeout,
1900 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1901 [
6cf0200f 1902 if test -n "$withval" && test "x$withval" != "xno" && \
1903 test "x${withval}" != "xyes"; then
f1b0ecc3 1904 entropy_timeout=$withval
1905 fi
82f4e93d 1906 ]
f1b0ecc3 1907)
3466e002 1908AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout,
1909 [Builtin PRNG command timeout])
f1b0ecc3 1910
fd3cbf67 1911SSH_PRIVSEP_USER=sshd
9a0fbcb3 1912AC_ARG_WITH(privsep-user,
5222e7ef 1913 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
9a0fbcb3 1914 [
6cf0200f 1915 if test -n "$withval" && test "x$withval" != "xno" && \
1916 test "x${withval}" != "xyes"; then
fd3cbf67 1917 SSH_PRIVSEP_USER=$withval
9a0fbcb3 1918 fi
82f4e93d 1919 ]
9a0fbcb3 1920)
3466e002 1921AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER",
1922 [non-privileged user for privilege separation])
fd3cbf67 1923AC_SUBST(SSH_PRIVSEP_USER)
9a0fbcb3 1924
81dadca3 1925# We do this little dance with the search path to insure
1926# that programs that we select for use by installed programs
1927# (which may be run by the super-user) come from trusted
1928# locations before they come from the user's private area.
1929# This should help avoid accidentally configuring some
1930# random version of a program in someone's personal bin.
1931
1932OPATH=$PATH
1933PATH=/bin:/usr/bin
f95c8ce8 1934test -h /bin 2> /dev/null && PATH=/usr/bin
81dadca3 1935test -d /sbin && PATH=$PATH:/sbin
1936test -d /usr/sbin && PATH=$PATH:/usr/sbin
1937PATH=$PATH:/etc:$OPATH
1938
aff51935 1939# These programs are used by the command hashing source to gather entropy
f1b0ecc3 1940OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1941OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1942OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1943OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1944OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1945OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1946OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1947OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1948OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1949OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1950OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1951OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1952OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1953OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1954OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1955OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
81dadca3 1956# restore PATH
1957PATH=$OPATH
f1b0ecc3 1958
1959# Where does ssh-rand-helper get its randomness from?
1960INSTALL_SSH_PRNG_CMDS=""
1961if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1962 if test ! -z "$PRNGD_PORT" ; then
1963 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1964 elif test ! -z "$PRNGD_SOCKET" ; then
1965 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1966 else
1967 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1968 RAND_HELPER_CMDHASH=yes
1969 INSTALL_SSH_PRNG_CMDS="yes"
1970 fi
1971fi
1972AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1973
1974
66d6c27e 1975# Cheap hack to ensure NEWS-OS libraries are arranged right.
1976if test ! -z "$SONY" ; then
1977 LIBS="$LIBS -liberty";
1978fi
1979
a0391976 1980# Checks for data types
976f7e19 1981AC_CHECK_SIZEOF(char, 1)
2b942fe0 1982AC_CHECK_SIZEOF(short int, 2)
1983AC_CHECK_SIZEOF(int, 4)
1984AC_CHECK_SIZEOF(long int, 4)
1985AC_CHECK_SIZEOF(long long int, 8)
1986
52f1ccb2 1987# Sanity check long long for some platforms (AIX)
1988if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1989 ac_cv_sizeof_long_long_int=0
1990fi
1991
90f15776 1992# compute LLONG_MIN and LLONG_MAX if we don't know them.
1993if test -z "$have_llong_max"; then
1994 AC_MSG_CHECKING([for max value of long long])
1995 AC_RUN_IFELSE(
1996 [AC_LANG_SOURCE([[
1997#include <stdio.h>
1998/* Why is this so damn hard? */
1999#ifdef __GNUC__
2000# undef __GNUC__
2001#endif
2002#define __USE_ISOC99
2003#include <limits.h>
2004#define DATA "conftest.llminmax"
2005int main(void) {
2006 FILE *f;
2007 long long i, llmin, llmax = 0;
2008
2009 if((f = fopen(DATA,"w")) == NULL)
2010 exit(1);
2011
2012#if defined(LLONG_MIN) && defined(LLONG_MAX)
2013 fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
2014 llmin = LLONG_MIN;
2015 llmax = LLONG_MAX;
2016#else
2017 fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
2018 /* This will work on one's complement and two's complement */
2019 for (i = 1; i > llmax; i <<= 1, i++)
2020 llmax = i;
2021 llmin = llmax + 1LL; /* wrap */
2022#endif
2023
2024 /* Sanity check */
2025 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2026 || llmax - 1 > llmax) {
2027 fprintf(f, "unknown unknown\n");
2028 exit(2);
2029 }
2030
2031 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
2032 exit(3);
2033
2034 exit(0);
2035}
2036 ]])],
2037 [
2038 llong_min=`$AWK '{print $1}' conftest.llminmax`
2039 llong_max=`$AWK '{print $2}' conftest.llminmax`
2040
2041 # snprintf on some Tru64s doesn't understand "%lld"
2042 case "$host" in
2043 alpha-dec-osf*)
2044 if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
2045 test "x$llong_max" = "xld"; then
2046 llong_min="-9223372036854775808"
2047 llong_max="9223372036854775807"
2048 fi
2049 ;;
2050 esac
2051
2052 AC_MSG_RESULT($llong_max)
2053 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
2054 [max value of long long calculated by configure])
2055 AC_MSG_CHECKING([for min value of long long])
2056 AC_MSG_RESULT($llong_min)
2057 AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
2058 [min value of long long calculated by configure])
2059 ],
2060 [
2061 AC_MSG_RESULT(not found)
2062 ],
2063 [
2064 AC_MSG_WARN([cross compiling: not checking])
2065 ]
2066 )
2067fi
2068
2069
a0391976 2070# More checks for data types
14a9a859 2071AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
2072 AC_TRY_COMPILE(
aff51935 2073 [ #include <sys/types.h> ],
2074 [ u_int a; a = 1;],
14a9a859 2075 [ ac_cv_have_u_int="yes" ],
2076 [ ac_cv_have_u_int="no" ]
2077 )
2078])
2079if test "x$ac_cv_have_u_int" = "xyes" ; then
3466e002 2080 AC_DEFINE(HAVE_U_INT, 1, [define if you have u_int data type])
14a9a859 2081 have_u_int=1
2082fi
2083
58d100bf 2084AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
2085 AC_TRY_COMPILE(
aff51935 2086 [ #include <sys/types.h> ],
2087 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
58d100bf 2088 [ ac_cv_have_intxx_t="yes" ],
2089 [ ac_cv_have_intxx_t="no" ]
2090 )
2091])
2092if test "x$ac_cv_have_intxx_t" = "xyes" ; then
3466e002 2093 AC_DEFINE(HAVE_INTXX_T, 1, [define if you have intxx_t data type])
58d100bf 2094 have_intxx_t=1
2095fi
41cb4569 2096
2097if (test -z "$have_intxx_t" && \
aff51935 2098 test "x$ac_cv_header_stdint_h" = "xyes")
41cb4569 2099then
2100 AC_MSG_CHECKING([for intXX_t types in stdint.h])
2101 AC_TRY_COMPILE(
aff51935 2102 [ #include <stdint.h> ],
2103 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
41cb4569 2104 [
2105 AC_DEFINE(HAVE_INTXX_T)
2106 AC_MSG_RESULT(yes)
2107 ],
2108 [ AC_MSG_RESULT(no) ]
2109 )
2110fi
2111
bd590612 2112AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2113 AC_TRY_COMPILE(
1cbbe6c8 2114 [
2115#include <sys/types.h>
2116#ifdef HAVE_STDINT_H
2117# include <stdint.h>
2118#endif
2119#include <sys/socket.h>
2120#ifdef HAVE_SYS_BITYPES_H
2121# include <sys/bitypes.h>
2122#endif
aff51935 2123 ],
2124 [ int64_t a; a = 1;],
bd590612 2125 [ ac_cv_have_int64_t="yes" ],
2126 [ ac_cv_have_int64_t="no" ]
2127 )
2128])
2129if test "x$ac_cv_have_int64_t" = "xyes" ; then
3466e002 2130 AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type])
ddceb1c8 2131fi
2132
58d100bf 2133AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
2134 AC_TRY_COMPILE(
aff51935 2135 [ #include <sys/types.h> ],
2136 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
58d100bf 2137 [ ac_cv_have_u_intxx_t="yes" ],
2138 [ ac_cv_have_u_intxx_t="no" ]
2139 )
2140])
2141if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
3466e002 2142 AC_DEFINE(HAVE_U_INTXX_T, 1, [define if you have u_intxx_t data type])
58d100bf 2143 have_u_intxx_t=1
2144fi
2b942fe0 2145
41cb4569 2146if test -z "$have_u_intxx_t" ; then
2147 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
2148 AC_TRY_COMPILE(
aff51935 2149 [ #include <sys/socket.h> ],
2150 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
41cb4569 2151 [
2152 AC_DEFINE(HAVE_U_INTXX_T)
2153 AC_MSG_RESULT(yes)
2154 ],
2155 [ AC_MSG_RESULT(no) ]
2156 )
2157fi
2158
bd590612 2159AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
2160 AC_TRY_COMPILE(
aff51935 2161 [ #include <sys/types.h> ],
2162 [ u_int64_t a; a = 1;],
bd590612 2163 [ ac_cv_have_u_int64_t="yes" ],
2164 [ ac_cv_have_u_int64_t="no" ]
2165 )
2166])
2167if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
3466e002 2168 AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type])
bd590612 2169 have_u_int64_t=1
2170fi
2171
ddceb1c8 2172if test -z "$have_u_int64_t" ; then
2173 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
2174 AC_TRY_COMPILE(
aff51935 2175 [ #include <sys/bitypes.h> ],
ddceb1c8 2176 [ u_int64_t a; a = 1],
2177 [
2178 AC_DEFINE(HAVE_U_INT64_T)
2179 AC_MSG_RESULT(yes)
2180 ],
2181 [ AC_MSG_RESULT(no) ]
2182 )
2183fi
2184
41cb4569 2185if test -z "$have_u_intxx_t" ; then
2186 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
2187 AC_TRY_COMPILE(
2188 [
2189#include <sys/types.h>
aff51935 2190 ],
2191 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
41cb4569 2192 [ ac_cv_have_uintxx_t="yes" ],
2193 [ ac_cv_have_uintxx_t="no" ]
2194 )
2195 ])
2196 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
3466e002 2197 AC_DEFINE(HAVE_UINTXX_T, 1,
2198 [define if you have uintxx_t data type])
41cb4569 2199 fi
2200fi
2201
2202if test -z "$have_uintxx_t" ; then
2203 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
2204 AC_TRY_COMPILE(
aff51935 2205 [ #include <stdint.h> ],
2206 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
41cb4569 2207 [
2208 AC_DEFINE(HAVE_UINTXX_T)
2209 AC_MSG_RESULT(yes)
2210 ],
2211 [ AC_MSG_RESULT(no) ]
2212 )
2213fi
2214
e5fe9a1f 2215if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
aff51935 2216 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
5cdfe03f 2217then
2218 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2219 AC_TRY_COMPILE(
58d100bf 2220 [
2221#include <sys/bitypes.h>
aff51935 2222 ],
5cdfe03f 2223 [
837c30b8 2224 int8_t a; int16_t b; int32_t c;
2225 u_int8_t e; u_int16_t f; u_int32_t g;
2226 a = b = c = e = f = g = 1;
aff51935 2227 ],
5cdfe03f 2228 [
2229 AC_DEFINE(HAVE_U_INTXX_T)
2230 AC_DEFINE(HAVE_INTXX_T)
2231 AC_MSG_RESULT(yes)
2232 ],
2233 [AC_MSG_RESULT(no)]
aff51935 2234 )
5cdfe03f 2235fi
2236
0362750e 2237
2238AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
2239 AC_TRY_COMPILE(
2240 [
2241#include <sys/types.h>
2242 ],
2243 [ u_char foo; foo = 125; ],
2244 [ ac_cv_have_u_char="yes" ],
2245 [ ac_cv_have_u_char="no" ]
2246 )
2247])
2248if test "x$ac_cv_have_u_char" = "xyes" ; then
3466e002 2249 AC_DEFINE(HAVE_U_CHAR, 1, [define if you have u_char data type])
0362750e 2250fi
2251
98a7c37b 2252TYPE_SOCKLEN_T
2b942fe0 2253
2d16d9a3 2254AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
ddceb1c8 2255
777ece68 2256AC_CHECK_TYPES(in_addr_t,,,
2257[#include <sys/types.h>
2258#include <netinet/in.h>])
7b578f7d 2259
58d100bf 2260AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
2261 AC_TRY_COMPILE(
2262 [
18ba2aab 2263#include <sys/types.h>
58d100bf 2264 ],
2265 [ size_t foo; foo = 1235; ],
2266 [ ac_cv_have_size_t="yes" ],
2267 [ ac_cv_have_size_t="no" ]
2268 )
2269])
2270if test "x$ac_cv_have_size_t" = "xyes" ; then
3466e002 2271 AC_DEFINE(HAVE_SIZE_T, 1, [define if you have size_t data type])
58d100bf 2272fi
ea1970a3 2273
c04f75f1 2274AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
2275 AC_TRY_COMPILE(
2276 [
2277#include <sys/types.h>
2278 ],
2279 [ ssize_t foo; foo = 1235; ],
2280 [ ac_cv_have_ssize_t="yes" ],
2281 [ ac_cv_have_ssize_t="no" ]
2282 )
2283])
2284if test "x$ac_cv_have_ssize_t" = "xyes" ; then
3466e002 2285 AC_DEFINE(HAVE_SSIZE_T, 1, [define if you have ssize_t data type])
c04f75f1 2286fi
2287
f1c4659d 2288AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
2289 AC_TRY_COMPILE(
2290 [
2291#include <time.h>
2292 ],
2293 [ clock_t foo; foo = 1235; ],
2294 [ ac_cv_have_clock_t="yes" ],
2295 [ ac_cv_have_clock_t="no" ]
2296 )
2297])
2298if test "x$ac_cv_have_clock_t" = "xyes" ; then
3466e002 2299 AC_DEFINE(HAVE_CLOCK_T, 1, [define if you have clock_t data type])
f1c4659d 2300fi
2301
1c04b088 2302AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
2303 AC_TRY_COMPILE(
2304 [
2305#include <sys/types.h>
2306#include <sys/socket.h>
2307 ],
2308 [ sa_family_t foo; foo = 1235; ],
2309 [ ac_cv_have_sa_family_t="yes" ],
77bb0bca 2310 [ AC_TRY_COMPILE(
2311 [
2312#include <sys/types.h>
2313#include <sys/socket.h>
2314#include <netinet/in.h>
2315 ],
2316 [ sa_family_t foo; foo = 1235; ],
2317 [ ac_cv_have_sa_family_t="yes" ],
2318
1c04b088 2319 [ ac_cv_have_sa_family_t="no" ]
77bb0bca 2320 )]
1c04b088 2321 )
2322])
2323if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
3466e002 2324 AC_DEFINE(HAVE_SA_FAMILY_T, 1,
2325 [define if you have sa_family_t data type])
1c04b088 2326fi
2327
729bfe59 2328AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
2329 AC_TRY_COMPILE(
2330 [
2331#include <sys/types.h>
2332 ],
2333 [ pid_t foo; foo = 1235; ],
2334 [ ac_cv_have_pid_t="yes" ],
2335 [ ac_cv_have_pid_t="no" ]
2336 )
2337])
2338if test "x$ac_cv_have_pid_t" = "xyes" ; then
3466e002 2339 AC_DEFINE(HAVE_PID_T, 1, [define if you have pid_t data type])
729bfe59 2340fi
2341
2342AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
2343 AC_TRY_COMPILE(
2344 [
2345#include <sys/types.h>
2346 ],
2347 [ mode_t foo; foo = 1235; ],
2348 [ ac_cv_have_mode_t="yes" ],
2349 [ ac_cv_have_mode_t="no" ]
2350 )
2351])
2352if test "x$ac_cv_have_mode_t" = "xyes" ; then
3466e002 2353 AC_DEFINE(HAVE_MODE_T, 1, [define if you have mode_t data type])
729bfe59 2354fi
2355
e3a93db0 2356
58d100bf 2357AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
2358 AC_TRY_COMPILE(
2359 [
18ba2aab 2360#include <sys/types.h>
2361#include <sys/socket.h>
58d100bf 2362 ],
2363 [ struct sockaddr_storage s; ],
2364 [ ac_cv_have_struct_sockaddr_storage="yes" ],
2365 [ ac_cv_have_struct_sockaddr_storage="no" ]
2366 )
2367])
2368if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
3466e002 2369 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
2370 [define if you have struct sockaddr_storage data type])
58d100bf 2371fi
48e671d5 2372
58d100bf 2373AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
2374 AC_TRY_COMPILE(
2375 [
cbd7492e 2376#include <sys/types.h>
58d100bf 2377#include <netinet/in.h>
2378 ],
2379 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
2380 [ ac_cv_have_struct_sockaddr_in6="yes" ],
2381 [ ac_cv_have_struct_sockaddr_in6="no" ]
2382 )
2383])
2384if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
3466e002 2385 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1,
2386 [define if you have struct sockaddr_in6 data type])
58d100bf 2387fi
48e671d5 2388
58d100bf 2389AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
2390 AC_TRY_COMPILE(
2391 [
cbd7492e 2392#include <sys/types.h>
58d100bf 2393#include <netinet/in.h>
2394 ],
2395 [ struct in6_addr s; s.s6_addr[0] = 0; ],
2396 [ ac_cv_have_struct_in6_addr="yes" ],
2397 [ ac_cv_have_struct_in6_addr="no" ]
2398 )
2399])
2400if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
3466e002 2401 AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1,
2402 [define if you have struct in6_addr data type])
58d100bf 2403fi
48e671d5 2404
58d100bf 2405AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2406 AC_TRY_COMPILE(
2407 [
18ba2aab 2408#include <sys/types.h>
2409#include <sys/socket.h>
2410#include <netdb.h>
58d100bf 2411 ],
2412 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2413 [ ac_cv_have_struct_addrinfo="yes" ],
2414 [ ac_cv_have_struct_addrinfo="no" ]
2415 )
2416])
2417if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
3466e002 2418 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
2419 [define if you have struct addrinfo data type])
58d100bf 2420fi
2421
89c7e31c 2422AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2423 AC_TRY_COMPILE(
aff51935 2424 [ #include <sys/time.h> ],
2425 [ struct timeval tv; tv.tv_sec = 1;],
89c7e31c 2426 [ ac_cv_have_struct_timeval="yes" ],
2427 [ ac_cv_have_struct_timeval="no" ]
2428 )
2429])
2430if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
3466e002 2431 AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if you have struct timeval])
89c7e31c 2432 have_struct_timeval=1
2433fi
2434
5271b55c 2435AC_CHECK_TYPES(struct timespec)
2436
85abc74b 2437# We need int64_t or else certian parts of the compile will fail.
4b492aab 2438if test "x$ac_cv_have_int64_t" = "xno" && \
2439 test "x$ac_cv_sizeof_long_int" != "x8" && \
2440 test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
85abc74b 2441 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2442 echo "an alternative compiler (I.E., GCC) before continuing."
2443 echo ""
2444 exit 1;
733cf7f4 2445else
2446dnl test snprintf (broken on SCO w/gcc)
1a01a50c 2447 AC_RUN_IFELSE(
479cece8 2448 [AC_LANG_SOURCE([[
733cf7f4 2449#include <stdio.h>
2450#include <string.h>
2451#ifdef HAVE_SNPRINTF
2452main()
2453{
2454 char buf[50];
2455 char expected_out[50];
2456 int mazsize = 50 ;
2457#if (SIZEOF_LONG_INT == 8)
2458 long int num = 0x7fffffffffffffff;
2459#else
763a1a18 2460 long long num = 0x7fffffffffffffffll;
733cf7f4 2461#endif
2462 strcpy(expected_out, "9223372036854775807");
2463 snprintf(buf, mazsize, "%lld", num);
2464 if(strcmp(buf, expected_out) != 0)
aff51935 2465 exit(1);
733cf7f4 2466 exit(0);
2467}
2468#else
2469main() { exit(0); }
2470#endif
479cece8 2471 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
1a01a50c 2472 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
733cf7f4 2473 )
2c523de9 2474fi
2475
77bb0bca 2476dnl Checks for structure members
58d100bf 2477OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2478OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2479OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2480OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2481OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
25422c70 2482OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
58d100bf 2483OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2484OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
daaff4d5 2485OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
58d100bf 2486OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2487OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2488OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2489OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1d7b9b20 2490OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2491OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2492OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2493OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
98a7c37b 2494
2495AC_CHECK_MEMBERS([struct stat.st_blksize])
1d7b9b20 2496
58d100bf 2497AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2498 ac_cv_have_ss_family_in_struct_ss, [
2499 AC_TRY_COMPILE(
2500 [
18ba2aab 2501#include <sys/types.h>
2502#include <sys/socket.h>
58d100bf 2503 ],
2504 [ struct sockaddr_storage s; s.ss_family = 1; ],
2505 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2506 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2507 )
2508])
2509if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
3466e002 2510 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Fields in struct sockaddr_storage])
58d100bf 2511fi
2512
58d100bf 2513AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2514 ac_cv_have___ss_family_in_struct_ss, [
2515 AC_TRY_COMPILE(
2516 [
18ba2aab 2517#include <sys/types.h>
2518#include <sys/socket.h>
58d100bf 2519 ],
2520 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2521 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2522 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2523 )
2524])
2525if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3466e002 2526 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1,
2527 [Fields in struct sockaddr_storage])
58d100bf 2528fi
2529
2e73a022 2530AC_CACHE_CHECK([for pw_class field in struct passwd],
2531 ac_cv_have_pw_class_in_struct_passwd, [
2532 AC_TRY_COMPILE(
2533 [
2e73a022 2534#include <pwd.h>
2535 ],
97994d32 2536 [ struct passwd p; p.pw_class = 0; ],
2e73a022 2537 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2538 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2539 )
2540])
2541if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
3466e002 2542 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD, 1,
2543 [Define if your password has a pw_class field])
2e73a022 2544fi
2545
7751d4eb 2546AC_CACHE_CHECK([for pw_expire field in struct passwd],
2547 ac_cv_have_pw_expire_in_struct_passwd, [
2548 AC_TRY_COMPILE(
2549 [
2550#include <pwd.h>
2551 ],
2552 [ struct passwd p; p.pw_expire = 0; ],
2553 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2554 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2555 )
2556])
2557if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
3466e002 2558 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD, 1,
2559 [Define if your password has a pw_expire field])
7751d4eb 2560fi
2561
2562AC_CACHE_CHECK([for pw_change field in struct passwd],
2563 ac_cv_have_pw_change_in_struct_passwd, [
2564 AC_TRY_COMPILE(
2565 [
2566#include <pwd.h>
2567 ],
2568 [ struct passwd p; p.pw_change = 0; ],
2569 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2570 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2571 )
2572])
2573if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
3466e002 2574 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD, 1,
2575 [Define if your password has a pw_change field])
7751d4eb 2576fi
58d100bf 2577
637f9177 2578dnl make sure we're using the real structure members and not defines
6f34652e 2579AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2580 ac_cv_have_accrights_in_msghdr, [
1a01a50c 2581 AC_COMPILE_IFELSE(
6f34652e 2582 [
f95c8ce8 2583#include <sys/types.h>
6f34652e 2584#include <sys/socket.h>
2585#include <sys/uio.h>
637f9177 2586int main() {
2587#ifdef msg_accrights
1a01a50c 2588#error "msg_accrights is a macro"
637f9177 2589exit(1);
2590#endif
2591struct msghdr m;
2592m.msg_accrights = 0;
2593exit(0);
2594}
6f34652e 2595 ],
6f34652e 2596 [ ac_cv_have_accrights_in_msghdr="yes" ],
2597 [ ac_cv_have_accrights_in_msghdr="no" ]
2598 )
2599])
2600if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
3466e002 2601 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR, 1,
2602 [Define if your system uses access rights style
2603 file descriptor passing])
6f34652e 2604fi
2605
7176df4f 2606AC_CACHE_CHECK([for msg_control field in struct msghdr],
2607 ac_cv_have_control_in_msghdr, [
1a01a50c 2608 AC_COMPILE_IFELSE(
7176df4f 2609 [
f95c8ce8 2610#include <sys/types.h>
7176df4f 2611#include <sys/socket.h>
2612#include <sys/uio.h>
637f9177 2613int main() {
2614#ifdef msg_control
1a01a50c 2615#error "msg_control is a macro"
637f9177 2616exit(1);
2617#endif
2618struct msghdr m;
2619m.msg_control = 0;
2620exit(0);
2621}
7176df4f 2622 ],
7176df4f 2623 [ ac_cv_have_control_in_msghdr="yes" ],
2624 [ ac_cv_have_control_in_msghdr="no" ]
2625 )
2626])
2627if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
3466e002 2628 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR, 1,
2629 [Define if your system uses ancillary data style
2630 file descriptor passing])
7176df4f 2631fi
2632
58d100bf 2633AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
aff51935 2634 AC_TRY_LINK([],
2635 [ extern char *__progname; printf("%s", __progname); ],
58d100bf 2636 [ ac_cv_libc_defines___progname="yes" ],
2637 [ ac_cv_libc_defines___progname="no" ]
2638 )
2639])
2640if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
3466e002 2641 AC_DEFINE(HAVE___PROGNAME, 1, [Define if libc defines __progname])
58d100bf 2642fi
8946db53 2643
c921ee00 2644AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2645 AC_TRY_LINK([
2646#include <stdio.h>
aff51935 2647],
2648 [ printf("%s", __FUNCTION__); ],
c921ee00 2649 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2650 [ ac_cv_cc_implements___FUNCTION__="no" ]
2651 )
2652])
2653if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
3466e002 2654 AC_DEFINE(HAVE___FUNCTION__, 1,
2655 [Define if compiler implements __FUNCTION__])
c921ee00 2656fi
2657
2658AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2659 AC_TRY_LINK([
2660#include <stdio.h>
aff51935 2661],
2662 [ printf("%s", __func__); ],
c921ee00 2663 [ ac_cv_cc_implements___func__="yes" ],
2664 [ ac_cv_cc_implements___func__="no" ]
2665 )
2666])
2667if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
3466e002 2668 AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__])
c921ee00 2669fi
2670
1812a662 2671AC_CACHE_CHECK([whether getopt has optreset support],
2672 ac_cv_have_getopt_optreset, [
2673 AC_TRY_LINK(
2674 [
2675#include <getopt.h>
2676 ],
2677 [ extern int optreset; optreset = 0; ],
2678 [ ac_cv_have_getopt_optreset="yes" ],
2679 [ ac_cv_have_getopt_optreset="no" ]
2680 )
2681])
2682if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
3466e002 2683 AC_DEFINE(HAVE_GETOPT_OPTRESET, 1,
2684 [Define if your getopt(3) defines and uses optreset])
1812a662 2685fi
a0391976 2686
819b676f 2687AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
aff51935 2688 AC_TRY_LINK([],
2689 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
819b676f 2690 [ ac_cv_libc_defines_sys_errlist="yes" ],
2691 [ ac_cv_libc_defines_sys_errlist="no" ]
2692 )
2693])
2694if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
3466e002 2695 AC_DEFINE(HAVE_SYS_ERRLIST, 1,
2696 [Define if your system defines sys_errlist[]])
819b676f 2697fi
2698
2699
416ed5a7 2700AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
aff51935 2701 AC_TRY_LINK([],
2702 [ extern int sys_nerr; printf("%i", sys_nerr);],
416ed5a7 2703 [ ac_cv_libc_defines_sys_nerr="yes" ],
2704 [ ac_cv_libc_defines_sys_nerr="no" ]
2705 )
2706])
2707if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
3466e002 2708 AC_DEFINE(HAVE_SYS_NERR, 1, [Define if your system defines sys_nerr])
416ed5a7 2709fi
2710
aff51935 2711SCARD_MSG="no"
295c8801 2712# Check whether user wants sectok support
2713AC_ARG_WITH(sectok,
2714 [ --with-sectok Enable smartcard support using libsectok],
d0b19c95 2715 [
2716 if test "x$withval" != "xno" ; then
2717 if test "x$withval" != "xyes" ; then
2718 CPPFLAGS="$CPPFLAGS -I${withval}"
2719 LDFLAGS="$LDFLAGS -L${withval}"
2720 if test ! -z "$need_dash_r" ; then
2721 LDFLAGS="$LDFLAGS -R${withval}"
2722 fi
2723 if test ! -z "$blibpath" ; then
2724 blibpath="$blibpath:${withval}"
2725 fi
2726 fi
2727 AC_CHECK_HEADERS(sectok.h)
2728 if test "$ac_cv_header_sectok_h" != yes; then
2729 AC_MSG_ERROR(Can't find sectok.h)
2730 fi
2731 AC_CHECK_LIB(sectok, sectok_open)
2732 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2733 AC_MSG_ERROR(Can't find libsectok)
2734 fi
3466e002 2735 AC_DEFINE(SMARTCARD, 1,
2736 [Define if you want smartcard support])
2737 AC_DEFINE(USE_SECTOK, 1,
2738 [Define if you want smartcard support
2739 using sectok])
aff51935 2740 SCARD_MSG="yes, using sectok"
295c8801 2741 fi
2742 ]
2743)
2744
2745# Check whether user wants OpenSC support
987b458f 2746OPENSC_CONFIG="no"
295c8801 2747AC_ARG_WITH(opensc,
e47fb473 2748 [ --with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)],
987b458f 2749 [
2750 if test "x$withval" != "xno" ; then
2751 if test "x$withval" != "xyes" ; then
2752 OPENSC_CONFIG=$withval/bin/opensc-config
2753 else
2754 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2755 fi
2756 if test "$OPENSC_CONFIG" != "no"; then
2757 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2758 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2759 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2760 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2761 AC_DEFINE(SMARTCARD)
3466e002 2762 AC_DEFINE(USE_OPENSC, 1,
2763 [Define if you want smartcard support
2764 using OpenSC])
987b458f 2765 SCARD_MSG="yes, using OpenSC"
2766 fi
2767 fi
2768 ]
2769)
d0b19c95 2770
c31dc31c 2771# Check libraries needed by DNS fingerprint support
aff51935 2772AC_SEARCH_LIBS(getrrsetbyname, resolv,
3466e002 2773 [AC_DEFINE(HAVE_GETRRSETBYNAME, 1,
2774 [Define if getrrsetbyname() exists])],
3e05e934 2775 [
c31dc31c 2776 # Needed by our getrrsetbyname()
2777 AC_SEARCH_LIBS(res_query, resolv)
2778 AC_SEARCH_LIBS(dn_expand, resolv)
dabb524a 2779 AC_MSG_CHECKING(if res_query will link)
2780 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2781 [AC_MSG_RESULT(no)
2782 saved_LIBS="$LIBS"
2783 LIBS="$LIBS -lresolv"
2784 AC_MSG_CHECKING(for res_query in -lresolv)
2785 AC_LINK_IFELSE([
2786#include <resolv.h>
2787int main()
2788{
2789 res_query (0, 0, 0, 0, 0);
2790 return 0;
2791}
2792 ],
2793 [LIBS="$LIBS -lresolv"
2794 AC_MSG_RESULT(yes)],
2795 [LIBS="$saved_LIBS"
2796 AC_MSG_RESULT(no)])
2797 ])
c31dc31c 2798 AC_CHECK_FUNCS(_getshort _getlong)
1c829da5 2799 AC_CHECK_DECLS([_getshort, _getlong], , ,
b5765e1d 2800 [#include <sys/types.h>
2801 #include <arpa/nameser.h>])
c31dc31c 2802 AC_CHECK_MEMBER(HEADER.ad,
3466e002 2803 [AC_DEFINE(HAVE_HEADER_AD, 1,
2804 [Define if HEADER.ad exists in arpa/nameser.h])],,
c31dc31c 2805 [#include <arpa/nameser.h>])
2806 ])
3e05e934 2807
12928e80 2808# Check whether user wants Kerberos 5 support
aff51935 2809KRB5_MSG="no"
12928e80 2810AC_ARG_WITH(kerberos5,
aff51935 2811 [ --with-kerberos5=PATH Enable Kerberos 5 support],
5585c441 2812 [ if test "x$withval" != "xno" ; then
2813 if test "x$withval" = "xyes" ; then
2814 KRB5ROOT="/usr/local"
2815 else
2816 KRB5ROOT=${withval}
2817 fi
2818
3466e002 2819 AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support])
5585c441 2820 KRB5_MSG="yes"
2821
2822 AC_MSG_CHECKING(for krb5-config)
2823 if test -x $KRB5ROOT/bin/krb5-config ; then
2824 KRB5CONF=$KRB5ROOT/bin/krb5-config
2825 AC_MSG_RESULT($KRB5CONF)
2826
2827 AC_MSG_CHECKING(for gssapi support)
2828 if $KRB5CONF | grep gssapi >/dev/null ; then
2829 AC_MSG_RESULT(yes)
3466e002 2830 AC_DEFINE(GSSAPI, 1,
2831 [Define this if you want GSSAPI
2832 support in the version 2 protocol])
071970fb 2833 k5confopts=gssapi
aff51935 2834 else
5585c441 2835 AC_MSG_RESULT(no)
071970fb 2836 k5confopts=""
aff51935 2837 fi
071970fb 2838 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2839 K5LIBS="`$KRB5CONF --libs $k5confopts`"
5585c441 2840 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
5585c441 2841 AC_MSG_CHECKING(whether we are using Heimdal)
2842 AC_TRY_COMPILE([ #include <krb5.h> ],
2843 [ char *tmp = heimdal_version; ],
2844 [ AC_MSG_RESULT(yes)
3466e002 2845 AC_DEFINE(HEIMDAL, 1,
2846 [Define this if you are using the
2847 Heimdal version of Kerberos V5]) ],
5585c441 2848 AC_MSG_RESULT(no)
2849 )
2850 else
2851 AC_MSG_RESULT(no)
12928e80 2852 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
aff51935 2853 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
aff51935 2854 AC_MSG_CHECKING(whether we are using Heimdal)
2855 AC_TRY_COMPILE([ #include <krb5.h> ],
2856 [ char *tmp = heimdal_version; ],
2857 [ AC_MSG_RESULT(yes)
2858 AC_DEFINE(HEIMDAL)
41707f74 2859 K5LIBS="-lkrb5 -ldes"
2860 K5LIBS="$K5LIBS -lcom_err -lasn1"
82f4e93d 2861 AC_CHECK_LIB(roken, net_write,
41707f74 2862 [K5LIBS="$K5LIBS -lroken"])
aff51935 2863 ],
2864 [ AC_MSG_RESULT(no)
2865 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2866 ]
2867 )
4e00038c 2868 AC_SEARCH_LIBS(dn_expand, resolv)
12928e80 2869
749560dd 2870 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2871 [ AC_DEFINE(GSSAPI)
2872 K5LIBS="-lgssapi $K5LIBS" ],
2873 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2874 [ AC_DEFINE(GSSAPI)
aff51935 2875 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
749560dd 2876 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2877 $K5LIBS)
2878 ],
2879 $K5LIBS)
82f4e93d 2880
749560dd 2881 AC_CHECK_HEADER(gssapi.h, ,
2882 [ unset ac_cv_header_gssapi_h
aff51935 2883 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
749560dd 2884 AC_CHECK_HEADERS(gssapi.h, ,
2885 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
aff51935 2886 )
749560dd 2887 ]
2888 )
2889
2890 oldCPP="$CPPFLAGS"
2891 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2892 AC_CHECK_HEADER(gssapi_krb5.h, ,
2893 [ CPPFLAGS="$oldCPP" ])
2894
aff51935 2895 fi
5585c441 2896 if test ! -z "$need_dash_r" ; then
2897 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2898 fi
2899 if test ! -z "$blibpath" ; then
2900 blibpath="$blibpath:${KRB5ROOT}/lib"
2901 fi
071970fb 2902
f5555364 2903 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2904 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2905 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
071970fb 2906
f5555364 2907 LIBS="$LIBS $K5LIBS"
3466e002 2908 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS, 1,
2909 [Define this if you want to use libkafs' AFS support]))
f5555364 2910 fi
071970fb 2911 ]
12928e80 2912)
b5b68128 2913
a0391976 2914# Looking for programs, paths and files
a0391976 2915
ecac8ee5 2916PRIVSEP_PATH=/var/empty
2917AC_ARG_WITH(privsep-path,
cda1ebcb 2918 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
ecac8ee5 2919 [
6cf0200f 2920 if test -n "$withval" && test "x$withval" != "xno" && \
2921 test "x${withval}" != "xyes"; then
ecac8ee5 2922 PRIVSEP_PATH=$withval
2923 fi
2924 ]
2925)
2926AC_SUBST(PRIVSEP_PATH)
2927
a0391976 2928AC_ARG_WITH(xauth,
2929 [ --with-xauth=PATH Specify path to xauth program ],
2930 [
6cf0200f 2931 if test -n "$withval" && test "x$withval" != "xno" && \
2932 test "x${withval}" != "xyes"; then
cbd7492e 2933 xauth_path=$withval
a0391976 2934 fi
2935 ],
2936 [
2bf42e4a 2937 TestPath="$PATH"
2938 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2939 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2940 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2941 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2942 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
e5fe9a1f 2943 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
a0391976 2944 xauth_path="/usr/openwin/bin/xauth"
2945 fi
2946 ]
2947)
2948
65a4b4af 2949STRIP_OPT=-s
2950AC_ARG_ENABLE(strip,
2951 [ --disable-strip Disable calling strip(1) on install],
2952 [
2953 if test "x$enableval" = "xno" ; then
2954 STRIP_OPT=
2955 fi
2956 ]
2957)
2958AC_SUBST(STRIP_OPT)
2959
b3ec54b4 2960if test -z "$xauth_path" ; then
2961 XAUTH_PATH="undefined"
2962 AC_SUBST(XAUTH_PATH)
2963else
3466e002 2964 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path",
2965 [Define if xauth is found in your path])
b3ec54b4 2966 XAUTH_PATH=$xauth_path
2967 AC_SUBST(XAUTH_PATH)
a0391976 2968fi
a0391976 2969
2970# Check for mail directory (last resort if we cannot get it from headers)
2971if test ! -z "$MAIL" ; then
2972 maildir=`dirname $MAIL`
3466e002 2973 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir",
2974 [Set this to your mail directory if you don't have maillock.h])
a0391976 2975fi
2976
479cece8 2977if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
1a01a50c 2978 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2979 disable_ptmx_check=yes
2980fi
a0391976 2981if test -z "$no_dev_ptmx" ; then
6e879cb4 2982 if test "x$disable_ptmx_check" != "xyes" ; then
aff51935 2983 AC_CHECK_FILE("/dev/ptmx",
6e879cb4 2984 [
3466e002 2985 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1,
2986 [Define if you have /dev/ptmx])
6e879cb4 2987 have_dev_ptmx=1
2988 ]
2989 )
2990 fi
3276571c 2991fi
1a01a50c 2992
479cece8 2993if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
1a01a50c 2994 AC_CHECK_FILE("/dev/ptc",
2995 [
3466e002 2996 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1,
2997 [Define if you have /dev/ptc])
1a01a50c 2998 have_dev_ptc=1
2999 ]
3000 )
3001else
3002 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
3003fi
3276571c 3004
a0391976 3005# Options from here on. Some of these are preset by platform above
fdf6b7aa 3006AC_ARG_WITH(mantype,
5d97cfbf 3007 [ --with-mantype=man|cat|doc Set man page type],
c54a6257 3008 [
5d97cfbf 3009 case "$withval" in
3010 man|cat|doc)
3011 MANTYPE=$withval
3012 ;;
3013 *)
3014 AC_MSG_ERROR(invalid man type: $withval)
3015 ;;
3016 esac
c54a6257 3017 ]
3018)
e0c4d3ac 3019if test -z "$MANTYPE"; then
2bf42e4a 3020 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
3021 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
e0c4d3ac 3022 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
3023 MANTYPE=doc
3024 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
3025 MANTYPE=man
3026 else
3027 MANTYPE=cat
3028 fi
3029fi
c54a6257 3030AC_SUBST(MANTYPE)
e0c4d3ac 3031if test "$MANTYPE" = "doc"; then
3032 mansubdir=man;
3033else
3034 mansubdir=$MANTYPE;
3035fi
3036AC_SUBST(mansubdir)
0bc5b6fb 3037
a0391976 3038# Check whether to enable MD5 passwords
aff51935 3039MD5_MSG="no"
2ddcfdf3 3040AC_ARG_WITH(md5-passwords,
caf3bc51 3041 [ --with-md5-passwords Enable use of MD5 passwords],
0bc5b6fb 3042 [
bcf36c78 3043 if test "x$withval" != "xno" ; then
3466e002 3044 AC_DEFINE(HAVE_MD5_PASSWORDS, 1,
3045 [Define if you want to allow MD5 passwords])
aff51935 3046 MD5_MSG="yes"
0bc5b6fb 3047 fi
3048 ]
caf3bc51 3049)
3050
a0391976 3051# Whether to disable shadow password support
a7effaac 3052AC_ARG_WITH(shadow,
3053 [ --without-shadow Disable shadow password support],
3054 [
82f4e93d 3055 if test "x$withval" = "xno" ; then
a7effaac 3056 AC_DEFINE(DISABLE_SHADOW)
4cb5ffa0 3057 disable_shadow=yes
a7effaac 3058 fi
3059 ]
3060)
3061
4cb5ffa0 3062if test -z "$disable_shadow" ; then
3063 AC_MSG_CHECKING([if the systems has expire shadow information])
3064 AC_TRY_COMPILE(
3065 [
3066#include <sys/types.h>
3067#include <shadow.h>
3068 struct spwd sp;
3069 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
3070 [ sp_expire_available=yes ], []
3071 )
3072
3073 if test "x$sp_expire_available" = "xyes" ; then
3074 AC_MSG_RESULT(yes)
3466e002 3075 AC_DEFINE(HAS_SHADOW_EXPIRE, 1,
3076 [Define if you want to use shadow password expire field])
4cb5ffa0 3077 else
3078 AC_MSG_RESULT(no)
3079 fi
3080fi
3081
a0391976 3082# Use ip address instead of hostname in $DISPLAY
44839801 3083if test ! -z "$IPADDR_IN_DISPLAY" ; then
3084 DISPLAY_HACK_MSG="yes"
3466e002 3085 AC_DEFINE(IPADDR_IN_DISPLAY, 1,
3086 [Define if you need to use IP address
3087 instead of hostname in $DISPLAY])
44839801 3088else
aff51935 3089 DISPLAY_HACK_MSG="no"
44839801 3090 AC_ARG_WITH(ipaddr-display,
3091 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
3092 [
82f4e93d 3093 if test "x$withval" != "xno" ; then
44839801 3094 AC_DEFINE(IPADDR_IN_DISPLAY)
aff51935 3095 DISPLAY_HACK_MSG="yes"
44839801 3096 fi
3097 ]
3098 )
3099fi
a7effaac 3100
95b99395 3101# check for /etc/default/login and use it if present.
daa41e62 3102AC_ARG_ENABLE(etc-default-login,
6ff3d0dc 3103 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
694d0cef 3104 [ if test "x$enableval" = "xno"; then
3105 AC_MSG_NOTICE([/etc/default/login handling disabled])
3106 etc_default_login=no
3107 else
3108 etc_default_login=yes
3109 fi ],
b0e7249f 3110 [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
3111 then
3112 AC_MSG_WARN([cross compiling: not checking /etc/default/login])
3113 etc_default_login=no
3114 else
3115 etc_default_login=yes
3116 fi ]
694d0cef 3117)
95b99395 3118
694d0cef 3119if test "x$etc_default_login" != "xno"; then
3120 AC_CHECK_FILE("/etc/default/login",
3121 [ external_path_file=/etc/default/login ])
b0e7249f 3122 if test "x$external_path_file" = "x/etc/default/login"; then
3466e002 3123 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1,
3124 [Define if your system has /etc/default/login])
1a01a50c 3125 fi
694d0cef 3126fi
95b99395 3127
8d184c09 3128dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
4b492aab 3129if test $ac_cv_func_login_getcapbool = "yes" && \
3130 test $ac_cv_header_login_cap_h = "yes" ; then
95b99395 3131 external_path_file=/etc/login.conf
8d184c09 3132fi
95b99395 3133
a0391976 3134# Whether to mess with the default path
aff51935 3135SERVER_PATH_MSG="(default)"
c43d69a9 3136AC_ARG_WITH(default-path,
75817f90 3137 [ --with-default-path= Specify default \$PATH environment for server],
cb807f40 3138 [
95b99395 3139 if test "x$external_path_file" = "x/etc/login.conf" ; then
8d184c09 3140 AC_MSG_WARN([
3141--with-default-path=PATH has no effect on this system.
3142Edit /etc/login.conf instead.])
82f4e93d 3143 elif test "x$withval" != "xno" ; then
89bbd457 3144 if test ! -z "$external_path_file" ; then
95b99395 3145 AC_MSG_WARN([
3146--with-default-path=PATH will only be used if PATH is not defined in
3147$external_path_file .])
3148 fi
b2d818e6 3149 user_path="$withval"
aff51935 3150 SERVER_PATH_MSG="$withval"
cb807f40 3151 fi
b2d818e6 3152 ],
95b99395 3153 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
3154 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
8d184c09 3155 else
89bbd457 3156 if test ! -z "$external_path_file" ; then
95b99395 3157 AC_MSG_WARN([
3158If PATH is defined in $external_path_file, ensure the path to scp is included,
3159otherwise scp will not work.])
3160 fi
b0e7249f 3161 AC_RUN_IFELSE(
3162 [AC_LANG_SOURCE([[
b2d818e6 3163/* find out what STDPATH is */
3164#include <stdio.h>
b2d818e6 3165#ifdef HAVE_PATHS_H
3166# include <paths.h>
3167#endif
3168#ifndef _PATH_STDPATH
d9a4e55b 3169# ifdef _PATH_USERPATH /* Irix */
3170# define _PATH_STDPATH _PATH_USERPATH
3171# else
3172# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
3173# endif
b2d818e6 3174#endif
3175#include <sys/types.h>
3176#include <sys/stat.h>
3177#include <fcntl.h>
3178#define DATA "conftest.stdpath"
3179
3180main()
3181{
3182 FILE *fd;
3183 int rc;
82f4e93d 3184
b2d818e6 3185 fd = fopen(DATA,"w");
3186 if(fd == NULL)
3187 exit(1);
82f4e93d 3188
b2d818e6 3189 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
3190 exit(1);
3191
3192 exit(0);
3193}
b0e7249f 3194 ]])],
3195 [ user_path=`cat conftest.stdpath` ],
b2d818e6 3196 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
3197 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
3198 )
3199# make sure $bindir is in USER_PATH so scp will work
3200 t_bindir=`eval echo ${bindir}`
3201 case $t_bindir in
3202 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
3203 esac
3204 case $t_bindir in
3205 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
3206 esac
3207 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
3208 if test $? -ne 0 ; then
3209 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
3210 if test $? -ne 0 ; then
3211 user_path=$user_path:$t_bindir
3212 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
3213 fi
3214 fi
8d184c09 3215 fi ]
cb807f40 3216)
95b99395 3217if test "x$external_path_file" != "x/etc/login.conf" ; then
3466e002 3218 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path", [Specify default $PATH])
8d184c09 3219 AC_SUBST(user_path)
3220fi
cb807f40 3221
06617857 3222# Set superuser path separately to user path
06617857 3223AC_ARG_WITH(superuser-path,
3224 [ --with-superuser-path= Specify different path for super-user],
3225 [
6cf0200f 3226 if test -n "$withval" && test "x$withval" != "xno" && \
3227 test "x${withval}" != "xyes"; then
3466e002 3228 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval",
3229 [Define if you want a different $PATH
3230 for the superuser])
06617857 3231 superuser_path=$withval
3232 fi
3233 ]
3234)
3235
3236
58d100bf 3237AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
aff51935 3238IPV4_IN6_HACK_MSG="no"
80faa19f 3239AC_ARG_WITH(4in6,
3240 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
3241 [
3242 if test "x$withval" != "xno" ; then
3243 AC_MSG_RESULT(yes)
3466e002 3244 AC_DEFINE(IPV4_IN_IPV6, 1,
3245 [Detect IPv4 in IPv6 mapped addresses
3246 and treat as IPv4])
aff51935 3247 IPV4_IN6_HACK_MSG="yes"
80faa19f 3248 else
3249 AC_MSG_RESULT(no)
3250 fi
3251 ],[
3252 if test "x$inet6_default_4in6" = "xyes"; then
3253 AC_MSG_RESULT([yes (default)])
3254 AC_DEFINE(IPV4_IN_IPV6)
aff51935 3255 IPV4_IN6_HACK_MSG="yes"
80faa19f 3256 else
3257 AC_MSG_RESULT([no (default)])
3258 fi
3259 ]
3260)
3261
af774732 3262# Whether to enable BSD auth support
f1b0ecc3 3263BSD_AUTH_MSG=no
af774732 3264AC_ARG_WITH(bsd-auth,
3265 [ --with-bsd-auth Enable BSD auth support],
3266 [
82f4e93d 3267 if test "x$withval" != "xno" ; then
3466e002 3268 AC_DEFINE(BSD_AUTH, 1,
3269 [Define if you have BSD auth support])
f1b0ecc3 3270 BSD_AUTH_MSG=yes
af774732 3271 fi
3272 ]
3273)
3274
a0391976 3275# Where to place sshd.pid
19d9ac2a 3276piddir=/var/run
81dadca3 3277# make sure the directory exists
82f4e93d 3278if test ! -d $piddir ; then
81dadca3 3279 piddir=`eval echo ${sysconfdir}`
3280 case $piddir in
aff51935 3281 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
81dadca3 3282 esac
3283fi
3284
47e45e44 3285AC_ARG_WITH(pid-dir,
3286 [ --with-pid-dir=PATH Specify location of ssh.pid file],
3287 [
6cf0200f 3288 if test -n "$withval" && test "x$withval" != "xno" && \
3289 test "x${withval}" != "xyes"; then
19d9ac2a 3290 piddir=$withval
82f4e93d 3291 if test ! -d $piddir ; then
81dadca3 3292 AC_MSG_WARN([** no $piddir directory on this system **])
3293 fi
47e45e44 3294 fi
3295 ]
3296)
b7a87eea 3297
3466e002 3298AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir", [Specify location of ssh.pid])
19d9ac2a 3299AC_SUBST(piddir)
47e45e44 3300
1d7b9b20 3301dnl allow user to disable some login recording features
3302AC_ARG_ENABLE(lastlog,
bfd550a2 3303 [ --disable-lastlog disable use of lastlog even if detected [no]],
ddb154b3 3304 [
3305 if test "x$enableval" = "xno" ; then
3306 AC_DEFINE(DISABLE_LASTLOG)
3307 fi
3308 ]
1d7b9b20 3309)
3310AC_ARG_ENABLE(utmp,
bfd550a2 3311 [ --disable-utmp disable use of utmp even if detected [no]],
ddb154b3 3312 [
3313 if test "x$enableval" = "xno" ; then
3314 AC_DEFINE(DISABLE_UTMP)
3315 fi
3316 ]
1d7b9b20 3317)
3318AC_ARG_ENABLE(utmpx,
bfd550a2 3319 [ --disable-utmpx disable use of utmpx even if detected [no]],
ddb154b3 3320 [
3321 if test "x$enableval" = "xno" ; then
3466e002 3322 AC_DEFINE(DISABLE_UTMPX, 1,
3323 [Define if you don't want to use utmpx])
ddb154b3 3324 fi
3325 ]
1d7b9b20 3326)
3327AC_ARG_ENABLE(wtmp,
bfd550a2 3328 [ --disable-wtmp disable use of wtmp even if detected [no]],
ddb154b3 3329 [
3330 if test "x$enableval" = "xno" ; then
3331 AC_DEFINE(DISABLE_WTMP)
3332 fi
3333 ]
1d7b9b20 3334)
3335AC_ARG_ENABLE(wtmpx,
bfd550a2 3336 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
ddb154b3 3337 [
3338 if test "x$enableval" = "xno" ; then
3466e002 3339 AC_DEFINE(DISABLE_WTMPX, 1,
3340 [Define if you don't want to use wtmpx])
ddb154b3 3341 fi
3342 ]
1d7b9b20 3343)
3344AC_ARG_ENABLE(libutil,
bfd550a2 3345 [ --disable-libutil disable use of libutil (login() etc.) [no]],
ddb154b3 3346 [
3347 if test "x$enableval" = "xno" ; then
3348 AC_DEFINE(DISABLE_LOGIN)
3349 fi
3350 ]
1d7b9b20 3351)
3352AC_ARG_ENABLE(pututline,
bfd550a2 3353 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
ddb154b3 3354 [
3355 if test "x$enableval" = "xno" ; then
3466e002 3356 AC_DEFINE(DISABLE_PUTUTLINE, 1,
3357 [Define if you don't want to use pututline()
3358 etc. to write [uw]tmp])
ddb154b3 3359 fi
3360 ]
1d7b9b20 3361)
3362AC_ARG_ENABLE(pututxline,
bfd550a2 3363 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
ddb154b3 3364 [
3365 if test "x$enableval" = "xno" ; then
3466e002 3366 AC_DEFINE(DISABLE_PUTUTXLINE, 1,
3367 [Define if you don't want to use pututxline()
3368 etc. to write [uw]tmpx])
ddb154b3 3369 fi
3370 ]
1d7b9b20 3371)
3372AC_ARG_WITH(lastlog,
bfd550a2 3373 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
8c89dd2b 3374 [
82f4e93d 3375 if test "x$withval" = "xno" ; then
8c89dd2b 3376 AC_DEFINE(DISABLE_LASTLOG)
6cf0200f 3377 elif test -n "$withval" && test "x${withval}" != "xyes"; then
8c89dd2b 3378 conf_lastlog_location=$withval
3379 fi
3380 ]
3381)
1d7b9b20 3382
3383dnl lastlog, [uw]tmpx? detection
3384dnl NOTE: set the paths in the platform section to avoid the
3385dnl need for command-line parameters
3386dnl lastlog and [uw]tmp are subject to a file search if all else fails
3387
3388dnl lastlog detection
3389dnl NOTE: the code itself will detect if lastlog is a directory
3390AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
3391AC_TRY_COMPILE([
3392#include <sys/types.h>
3393#include <utmp.h>
3394#ifdef HAVE_LASTLOG_H
3395# include <lastlog.h>
3396#endif
d7c0f3d5 3397#ifdef HAVE_PATHS_H
1d7b9b20 3398# include <paths.h>
41cb4569 3399#endif
3400#ifdef HAVE_LOGIN_H
3401# include <login.h>
1d7b9b20 3402#endif
3403 ],
3404 [ char *lastlog = LASTLOG_FILE; ],
3405 [ AC_MSG_RESULT(yes) ],
d7c0f3d5 3406 [
3407 AC_MSG_RESULT(no)
3408 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
3409 AC_TRY_COMPILE([
3410#include <sys/types.h>
3411#include <utmp.h>
3412#ifdef HAVE_LASTLOG_H
3413# include <lastlog.h>
3414#endif
3415#ifdef HAVE_PATHS_H
3416# include <paths.h>
3417#endif
3418 ],
3419 [ char *lastlog = _PATH_LASTLOG; ],
3420 [ AC_MSG_RESULT(yes) ],
3421 [
f282b668 3422 AC_MSG_RESULT(no)
d7c0f3d5 3423 system_lastlog_path=no
3424 ])
3425 ]
1d7b9b20 3426)
d7c0f3d5 3427
1d7b9b20 3428if test -z "$conf_lastlog_location"; then
3429 if test x"$system_lastlog_path" = x"no" ; then
3430 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
e5fe9a1f 3431 if (test -d "$f" || test -f "$f") ; then
1d7b9b20 3432 conf_lastlog_location=$f
3433 fi
3434 done
3435 if test -z "$conf_lastlog_location"; then
f8119cef 3436 AC_MSG_WARN([** Cannot find lastlog **])
3437 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1d7b9b20 3438 fi
3439 fi
3440fi
3441
3442if test -n "$conf_lastlog_location"; then
3466e002 3443 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location",
3444 [Define if you want to specify the path to your lastlog file])
82f4e93d 3445fi
1d7b9b20 3446
3447dnl utmp detection
3448AC_MSG_CHECKING([if your system defines UTMP_FILE])
3449AC_TRY_COMPILE([
3450#include <sys/types.h>
3451#include <utmp.h>
d7c0f3d5 3452#ifdef HAVE_PATHS_H
1d7b9b20 3453# include <paths.h>
3454#endif
3455 ],
3456 [ char *utmp = UTMP_FILE; ],
3457 [ AC_MSG_RESULT(yes) ],
3458 [ AC_MSG_RESULT(no)
3459 system_utmp_path=no ]
3460)
3461if test -z "$conf_utmp_location"; then
3462 if test x"$system_utmp_path" = x"no" ; then
3463 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3464 if test -f $f ; then
3465 conf_utmp_location=$f
3466 fi
3467 done
3468 if test -z "$conf_utmp_location"; then
3469 AC_DEFINE(DISABLE_UTMP)
3470 fi
3471 fi
3472fi
3473if test -n "$conf_utmp_location"; then
3466e002 3474 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location",
3475 [Define if you want to specify the path to your utmp file])
82f4e93d 3476fi
1d7b9b20 3477
3478dnl wtmp detection
3479AC_MSG_CHECKING([if your system defines WTMP_FILE])
3480AC_TRY_COMPILE([
3481#include <sys/types.h>
3482#include <utmp.h>
d7c0f3d5 3483#ifdef HAVE_PATHS_H
1d7b9b20 3484# include <paths.h>
3485#endif
3486 ],
3487 [ char *wtmp = WTMP_FILE; ],
3488 [ AC_MSG_RESULT(yes) ],
3489 [ AC_MSG_RESULT(no)
3490 system_wtmp_path=no ]
3491)
3492if test -z "$conf_wtmp_location"; then
3493 if test x"$system_wtmp_path" = x"no" ; then
3494 for f in /usr/adm/wtmp /var/log/wtmp; do
3495 if test -f $f ; then
3496 conf_wtmp_location=$f
3497 fi
3498 done
3499 if test -z "$conf_wtmp_location"; then
3500 AC_DEFINE(DISABLE_WTMP)
3501 fi
3502 fi
3503fi
3504if test -n "$conf_wtmp_location"; then
3466e002 3505 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location",
3506 [Define if you want to specify the path to your wtmp file])
82f4e93d 3507fi
1d7b9b20 3508
3509
3510dnl utmpx detection - I don't know any system so perverse as to require
3511dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3512dnl there, though.
3513AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3514AC_TRY_COMPILE([
3515#include <sys/types.h>
3516#include <utmp.h>
3517#ifdef HAVE_UTMPX_H
3518#include <utmpx.h>
3519#endif
d7c0f3d5 3520#ifdef HAVE_PATHS_H
1d7b9b20 3521# include <paths.h>
3522#endif
3523 ],
3524 [ char *utmpx = UTMPX_FILE; ],
3525 [ AC_MSG_RESULT(yes) ],
3526 [ AC_MSG_RESULT(no)
3527 system_utmpx_path=no ]
3528)
3529if test -z "$conf_utmpx_location"; then
3530 if test x"$system_utmpx_path" = x"no" ; then
3531 AC_DEFINE(DISABLE_UTMPX)
3532 fi
3533else
3466e002 3534 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location",
3535 [Define if you want to specify the path to your utmpx file])
82f4e93d 3536fi
1d7b9b20 3537
3538dnl wtmpx detection
3539AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3540AC_TRY_COMPILE([
3541#include <sys/types.h>
3542#include <utmp.h>
3543#ifdef HAVE_UTMPX_H
3544#include <utmpx.h>
3545#endif
d7c0f3d5 3546#ifdef HAVE_PATHS_H
1d7b9b20 3547# include <paths.h>
3548#endif
3549 ],
3550 [ char *wtmpx = WTMPX_FILE; ],
3551 [ AC_MSG_RESULT(yes) ],
3552 [ AC_MSG_RESULT(no)
3553 system_wtmpx_path=no ]
3554)
3555if test -z "$conf_wtmpx_location"; then
3556 if test x"$system_wtmpx_path" = x"no" ; then
3557 AC_DEFINE(DISABLE_WTMPX)
3558 fi
3559else
3466e002 3560 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location",
3561 [Define if you want to specify the path to your wtmpx file])
82f4e93d 3562fi
1d7b9b20 3563
b7a87eea 3564
bd499f9e 3565if test ! -z "$blibpath" ; then
68ece370 3566 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3567 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
bd499f9e 3568fi
3569
ddceb1c8 3570dnl remove pam and dl because they are in $LIBPAM
3571if test "$PAM_MSG" = yes ; then
98f2d9d5 3572 LIBS=`echo $LIBS | sed 's/-lpam //'`
3573fi
3574if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3575 LIBS=`echo $LIBS | sed 's/-ldl //'`
ddceb1c8 3576fi
3577
ed89c848 3578dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3579dnl Add now.
3580CFLAGS="$CFLAGS $werror_flags"
3581
3c62e7eb 3582AC_EXEEXT
d7cfdd7c 3583AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3584 scard/Makefile ssh_prng_cmds survey.sh])
98a7c37b 3585AC_OUTPUT
d3083fbd 3586
cbd7492e 3587# Print summary of options
3588
cbd7492e 3589# Someone please show me a better way :)
3590A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3591B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3592C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3593D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
f5665f6f 3594E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
e0c4d3ac 3595F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
cbd7492e 3596G=`eval echo ${piddir}` ; G=`eval echo ${G}`
ecac8ee5 3597H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3598I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3599J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
cbd7492e 3600
3601echo ""
26de7942 3602echo "OpenSSH has been configured with the following options:"
ecac8ee5 3603echo " User binaries: $B"
3604echo " System binaries: $C"
3605echo " Configuration files: $D"
3606echo " Askpass program: $E"
3607echo " Manual pages: $F"
3608echo " PID file: $G"
3609echo " Privilege separation chroot path: $H"
95b99395 3610if test "x$external_path_file" = "x/etc/login.conf" ; then
3611echo " At runtime, sshd will use the path defined in $external_path_file"
3612echo " Make sure the path to scp is present, otherwise scp will not work"
8d184c09 3613else
ecac8ee5 3614echo " sshd default user PATH: $I"
89bbd457 3615 if test ! -z "$external_path_file"; then
95b99395 3616echo " (If PATH is set in $external_path_file it will be used instead. If"
3617echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3618 fi
8d184c09 3619fi
06617857 3620if test ! -z "$superuser_path" ; then
ecac8ee5 3621echo " sshd superuser user PATH: $J"
3622fi
3623echo " Manpage format: $MANTYPE"
3e05e934 3624echo " PAM support: $PAM_MSG"
ecac8ee5 3625echo " KerberosV support: $KRB5_MSG"
3626echo " Smartcard support: $SCARD_MSG"
ecac8ee5 3627echo " S/KEY support: $SKEY_MSG"
3628echo " TCP Wrappers support: $TCPW_MSG"
3629echo " MD5 password support: $MD5_MSG"
59031773 3630echo " libedit support: $LIBEDIT_MSG"
3deb1408 3631echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
ecac8ee5 3632echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3633echo " BSD Auth support: $BSD_AUTH_MSG"
3634echo " Random number source: $RAND_MSG"
f1b0ecc3 3635if test ! -z "$USE_RAND_HELPER" ; then
ecac8ee5 3636echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
af774732 3637fi
3638
cbd7492e 3639echo ""
3640
0c2fb82f 3641echo " Host: ${host}"
3642echo " Compiler: ${CC}"
3643echo " Compiler flags: ${CFLAGS}"
3644echo "Preprocessor flags: ${CPPFLAGS}"
3645echo " Linker flags: ${LDFLAGS}"
ddceb1c8 3646echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
cbd7492e 3647
3648echo ""
3649
9cefe228 3650if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
b3146b5f 3651 echo "SVR4 style packages are supported with \"make package\""
3652 echo ""
9cefe228 3653fi
3654
adeebd37 3655if test "x$PAM_MSG" = "xyes" ; then
f1b0ecc3 3656 echo "PAM is enabled. You may need to install a PAM control file "
3657 echo "for sshd, otherwise password authentication may fail. "
aff51935 3658 echo "Example PAM control files can be found in the contrib/ "
f1b0ecc3 3659 echo "subdirectory"
adeebd37 3660 echo ""
3661fi
3662
f1b0ecc3 3663if test ! -z "$RAND_HELPER_CMDHASH" ; then
3664 echo "WARNING: you are using the builtin random number collection "
3665 echo "service. Please read WARNING.RNG and request that your OS "
3666 echo "vendor includes kernel-based random number collection in "
3667 echo "future versions of your OS."
2c523de9 3668 echo ""
3669fi
af774732 3670
2f6f9cff 3671if test ! -z "$NO_PEERCHECK" ; then
3672 echo "WARNING: the operating system that you are using does not "
3673 echo "appear to support either the getpeereid() API nor the "
3674 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3675 echo "enforce security checks to prevent unauthorised connections to "
3676 echo "ssh-agent. Their absence increases the risk that a malicious "
3677 echo "user can connect to your agent. "
3678 echo ""
3679fi
3680
7b578f7d 3681if test "$AUDIT_MODULE" = "bsm" ; then
3682 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3683 echo "See the Solaris section in README.platform for details."
3684fi
This page took 0.952486 seconds and 5 git commands to generate.