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