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