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