3 # Copyright (c) 1999-2004 Damien Miller
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.
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.
17 AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
18 AC_REVISION($Revision$)
19 AC_CONFIG_SRCDIR([ssh.c])
21 AC_CONFIG_HEADER(config.h)
26 # Checks for programs.
33 AC_PATH_PROG(CAT, cat)
34 AC_PATH_PROG(KILL, kill)
35 AC_PATH_PROGS(PERL, perl5 perl)
36 AC_PATH_PROG(SED, sed)
38 AC_PATH_PROG(ENT, ent)
40 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
41 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
42 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
44 AC_SUBST(TEST_SHELL,sh)
47 AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49 AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
50 [/usr/sbin${PATH_SEPARATOR}/etc])
51 AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
52 if test -x /sbin/sh; then
53 AC_SUBST(STARTUP_SCRIPT_SHELL,/sbin/sh)
55 AC_SUBST(STARTUP_SCRIPT_SHELL,/bin/sh)
61 if test -z "$AR" ; then
62 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
65 # Use LOGIN_PROGRAM from environment if possible
66 if test ! -z "$LOGIN_PROGRAM" ; then
67 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM",
68 [If your header files don't define LOGIN_PROGRAM,
69 then use this (detected) from environment and PATH])
72 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
73 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
74 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
78 AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
79 if test ! -z "$PATH_PASSWD_PROG" ; then
80 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG",
81 [Full path of your "passwd" program])
84 if test -z "$LD" ; then
91 AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
93 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
94 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
95 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
98 2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;;
100 3.*) CFLAGS="$CFLAGS -Wsign-compare" ;;
101 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign" ;;
105 if test -z "$have_llong_max"; then
106 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
107 unset ac_cv_have_decl_LLONG_MAX
108 saved_CFLAGS="$CFLAGS"
109 CFLAGS="$CFLAGS -std=gnu99"
110 AC_CHECK_DECL(LLONG_MAX,
112 [CFLAGS="$saved_CFLAGS"],
113 [#include <limits.h>]
119 [ --without-rpath Disable auto-added -R linker paths],
121 if test "x$withval" = "xno" ; then
124 if test "x$withval" = "xyes" ; then
130 # Check for some target-specific stuff
133 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
134 if (test -z "$blibpath"); then
135 blibpath="/usr/lib:/lib"
137 saved_LDFLAGS="$LDFLAGS"
138 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
139 if (test -z "$blibflags"); then
140 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
141 AC_TRY_LINK([], [], [blibflags=$tryflags])
144 if (test -z "$blibflags"); then
145 AC_MSG_RESULT(not found)
146 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
148 AC_MSG_RESULT($blibflags)
150 LDFLAGS="$saved_LDFLAGS"
151 dnl Check for authenticate. Might be in libs.a on older AIXes
152 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE, 1,
153 [Define if you want to enable AIX4's authenticate function])],
154 [AC_CHECK_LIB(s,authenticate,
155 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
159 dnl Check for various auth function declarations in headers.
160 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
161 passwdexpired, setauthdb], , , [#include <usersec.h>])
162 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
163 AC_CHECK_DECLS(loginfailed,
164 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
166 [#include <usersec.h>],
167 [(void)loginfailed("user","host","tty",0);],
169 AC_DEFINE(AIX_LOGINFAILED_4ARG, 1,
170 [Define if your AIX loginfailed() function
171 takes 4 arguments (AIX >= 5.2)])],
175 [#include <usersec.h>]
177 AC_CHECK_FUNCS(setauthdb)
178 check_for_aix_broken_getaddrinfo=1
179 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.])
180 AC_DEFINE(SETEUID_BREAKS_SETUID, 1,
181 [Define if your platform breaks doing a seteuid before a setuid])
182 AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken])
183 AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken])
184 dnl AIX handles lastlog as part of its login message
185 AC_DEFINE(DISABLE_LASTLOG, 1, [Define if you don't want to use lastlog])
186 AC_DEFINE(LOGIN_NEEDS_UTMPX, 1,
187 [Some systems need a utmpx entry for /bin/login to work])
188 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV,
189 [Define to a Set Process Title type if your system is
190 supported by bsd-setproctitle.c])
191 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
192 [AIX 5.2 and 5.3 (and presumably newer) require this])
195 check_for_libcrypt_later=1
196 LIBS="$LIBS /usr/lib/textmode.o"
197 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin])
198 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
199 AC_DEFINE(DISABLE_SHADOW, 1,
200 [Define if you want to disable shadow passwords])
201 AC_DEFINE(IP_TOS_IS_BROKEN, 1,
202 [Define if your system choked on IP TOS setting])
203 AC_DEFINE(NO_X11_UNIX_SOCKETS, 1,
204 [Define if X11 doesn't support AF_UNIX sockets on that system])
205 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT, 1,
206 [Define if the concept of ports only accessible to
207 superusers isn't known])
208 AC_DEFINE(DISABLE_FD_PASSING, 1,
209 [Define if your platform needs to skip post auth
210 file descriptor passing])
213 AC_DEFINE(IP_TOS_IS_BROKEN)
214 AC_DEFINE(SETEUID_BREAKS_SETUID)
215 AC_DEFINE(BROKEN_SETREUID)
216 AC_DEFINE(BROKEN_SETREGID)
219 AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])],
220 AC_DEFINE(SETEUID_BREAKS_SETUID)
221 AC_DEFINE(BROKEN_SETREUID)
222 AC_DEFINE(BROKEN_SETREGID)
223 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1,
224 [Define if your resolver libs need this for getrrsetbyname])
225 AC_MSG_CHECKING(if we have the Security Authorization Session API)
226 AC_TRY_COMPILE([#include <Security/AuthSession.h>],
227 [SessionCreate(0, 0);],
228 [ac_cv_use_security_session_api="yes"
229 AC_DEFINE(USE_SECURITY_SESSION_API, 1,
230 [platform has the Security Authorization Session API])
231 LIBS="$LIBS -framework Security"
233 [ac_cv_use_security_session_api="no"
235 AC_MSG_CHECKING(if we have an in-memory credentials cache)
237 [#include <Kerberos/Kerberos.h>],
239 (void) cc_initialize (&c, 0, NULL, NULL);],
240 [AC_DEFINE(USE_CCAPI, 1,
241 [platform uses an in-memory credentials cache])
242 LIBS="$LIBS -framework Security"
244 if test "x$ac_cv_use_security_session_api" = "xno"; then
245 AC_MSG_ERROR(*** Need a security framework to use the credentials cache API ***)
251 # first we define all of the options common to all HP-UX releases
252 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
253 IPADDR_IN_DISPLAY=yes
255 AC_DEFINE(LOGIN_NO_ENDOPT, 1,
256 [Define if your login program cannot handle end of options ("--")])
257 AC_DEFINE(LOGIN_NEEDS_UTMPX)
258 AC_DEFINE(LOCKED_PASSWD_STRING, "*",
259 [String used in /etc/passwd to denote locked account])
260 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
261 MAIL="/var/mail/username"
263 AC_CHECK_LIB(xnet, t_error, ,
264 AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
266 # next, we define all of the options specific to major releases
269 if test -z "$GCC"; then
274 AC_DEFINE(PAM_SUN_CODEBASE, 1,
275 [Define if you are using Solaris-derived PAM which
276 passes pam_messages to the conversation function
277 with an extra level of indirection])
278 AC_DEFINE(DISABLE_UTMP, 1,
279 [Define if you don't want to use utmp])
280 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
281 check_for_hpux_broken_getaddrinfo=1
282 check_for_conflicting_getspnam=1
286 # lastly, we define options specific to minor releases
289 AC_DEFINE(HAVE_SECUREWARE, 1,
290 [Define if you have SecureWare-based
291 protected password database])
292 disable_ptmx_check=yes
298 PATH="$PATH:/usr/etc"
299 AC_DEFINE(BROKEN_INET_NTOA, 1,
300 [Define if you system's inet_ntoa is busted
301 (e.g. Irix gcc issue)])
302 AC_DEFINE(SETEUID_BREAKS_SETUID)
303 AC_DEFINE(BROKEN_SETREUID)
304 AC_DEFINE(BROKEN_SETREGID)
305 AC_DEFINE(WITH_ABBREV_NO_TTY, 1,
306 [Define if you shouldn't strip 'tty' from your
308 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
311 PATH="$PATH:/usr/etc"
312 AC_DEFINE(WITH_IRIX_ARRAY, 1,
313 [Define if you have/want arrays
314 (cluster-wide session managment, not C arrays)])
315 AC_DEFINE(WITH_IRIX_PROJECT, 1,
316 [Define if you want IRIX project management])
317 AC_DEFINE(WITH_IRIX_AUDIT, 1,
318 [Define if you want IRIX audit trails])
319 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS, 1,
320 [Define if you want IRIX kernel jobs])])
321 AC_DEFINE(BROKEN_INET_NTOA)
322 AC_DEFINE(SETEUID_BREAKS_SETUID)
323 AC_DEFINE(BROKEN_SETREUID)
324 AC_DEFINE(BROKEN_SETREGID)
325 AC_DEFINE(BROKEN_UPDWTMPX, 1, [updwtmpx is broken (if present)])
326 AC_DEFINE(WITH_ABBREV_NO_TTY)
327 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
331 check_for_libcrypt_later=1
332 check_for_openpty_ctty_bug=1
333 AC_DEFINE(DONT_TRY_OTHER_AF, 1, [Workaround more Linux IPv6 quirks])
334 AC_DEFINE(PAM_TTY_KLUDGE, 1,
335 [Work around problematic Linux PAM modules handling of PAM_TTY])
336 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!",
337 [String used in /etc/passwd to denote locked account])
338 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
339 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM,
340 [Define to whatever link() returns for "not supported"
341 if it doesn't return EOPNOTSUPP.])
342 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
344 inet6_default_4in6=yes
347 AC_DEFINE(BROKEN_CMSG_TYPE, 1,
348 [Define if cmsg_type is not passed correctly])
351 # tun(4) forwarding compat code
352 AC_CHECK_HEADERS(linux/if_tun.h)
353 if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then
354 AC_DEFINE(SSH_TUN_LINUX, 1,
355 [Open tunnel devices the Linux tun/tap way])
356 AC_DEFINE(SSH_TUN_COMPAT_AF, 1,
357 [Use tunnel device compatibility to OpenBSD])
358 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
359 [Prepend the address family to IP tunnel traffic])
362 mips-sony-bsd|mips-sony-newsos4)
363 AC_DEFINE(NEED_SETPGRP, 1, [Need setpgrp to acquire controlling tty])
367 check_for_libcrypt_before=1
368 if test "x$withval" != "xno" ; then
371 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
372 AC_CHECK_HEADER([net/if_tap.h], ,
373 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
374 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
375 [Prepend the address family to IP tunnel traffic])
378 check_for_libcrypt_later=1
379 AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)])
380 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
381 AC_CHECK_HEADER([net/if_tap.h], ,
382 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
385 AC_DEFINE(SETEUID_BREAKS_SETUID)
386 AC_DEFINE(BROKEN_SETREUID)
387 AC_DEFINE(BROKEN_SETREGID)
390 conf_lastlog_location="/usr/adm/lastlog"
391 conf_utmp_location=/etc/utmp
392 conf_wtmp_location=/usr/adm/wtmp
394 AC_DEFINE(HAVE_NEXT, 1, [Define if you are on NeXT])
395 AC_DEFINE(BROKEN_REALPATH)
397 AC_DEFINE(BROKEN_SAVED_UIDS, 1, [Needed for NeXT])
400 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
401 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
402 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way])
405 if test "x$withval" != "xno" ; then
408 AC_DEFINE(PAM_SUN_CODEBASE)
409 AC_DEFINE(LOGIN_NEEDS_UTMPX)
410 AC_DEFINE(LOGIN_NEEDS_TERM, 1,
411 [Some versions of /bin/login need the TERM supplied
413 AC_DEFINE(PAM_TTY_KLUDGE)
414 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
415 [Define if pam_chauthtok wants real uid set
416 to the unpriv'ed user])
417 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
418 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
419 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1,
420 [Define if sshd somehow reacquires a controlling TTY
422 external_path_file=/etc/default/login
423 # hardwire lastlog location (can't detect it on some versions)
424 conf_lastlog_location="/var/adm/lastlog"
425 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
426 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
427 if test "$sol2ver" -ge 8; then
429 AC_DEFINE(DISABLE_UTMP)
430 AC_DEFINE(DISABLE_WTMP, 1,
431 [Define if you don't want to use wtmp])
437 CPPFLAGS="$CPPFLAGS -DSUNOS4"
438 AC_CHECK_FUNCS(getpwanam)
439 AC_DEFINE(PAM_SUN_CODEBASE)
440 conf_utmp_location=/etc/utmp
441 conf_wtmp_location=/var/adm/wtmp
442 conf_lastlog_location=/var/adm/lastlog
448 AC_DEFINE(SSHD_ACQUIRES_CTTY)
449 AC_DEFINE(SETEUID_BREAKS_SETUID)
450 AC_DEFINE(BROKEN_SETREUID)
451 AC_DEFINE(BROKEN_SETREGID)
454 # /usr/ucblib MUST NOT be searched on ReliantUNIX
455 AC_CHECK_LIB(dl, dlsym, ,)
456 # -lresolv needs to be at the end of LIBS or DNS lookups break
457 AC_CHECK_LIB(resolv, res_query, [ LIBS="$LIBS -lresolv" ])
458 IPADDR_IN_DISPLAY=yes
460 AC_DEFINE(IP_TOS_IS_BROKEN)
461 AC_DEFINE(SETEUID_BREAKS_SETUID)
462 AC_DEFINE(BROKEN_SETREUID)
463 AC_DEFINE(BROKEN_SETREGID)
464 AC_DEFINE(SSHD_ACQUIRES_CTTY)
465 external_path_file=/etc/default/login
466 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
467 # Attention: always take care to bind libsocket and libnsl before libc,
468 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
470 # UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
472 CFLAGS="$CFLAGS -Dva_list=_VA_LIST"
474 AC_DEFINE(SETEUID_BREAKS_SETUID)
475 AC_DEFINE(BROKEN_SETREUID)
476 AC_DEFINE(BROKEN_SETREGID)
477 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
478 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
480 # UnixWare 7.x, OpenUNIX 8
482 check_for_libcrypt_later=1
483 AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars])
485 AC_DEFINE(SETEUID_BREAKS_SETUID)
486 AC_DEFINE(BROKEN_SETREUID)
487 AC_DEFINE(BROKEN_SETREGID)
488 AC_DEFINE(PASSWD_NEEDS_USERNAME)
490 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
491 TEST_SHELL=/u95/bin/sh
492 AC_DEFINE(BROKEN_LIBIAF, 1,
493 [ia_uinfo routines not supported by OS yet])
495 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
501 # SCO UNIX and OEM versions of SCO UNIX
503 AC_MSG_ERROR("This Platform is no longer supported.")
507 if test -z "$GCC"; then
508 CFLAGS="$CFLAGS -belf"
510 LIBS="$LIBS -lprot -lx -ltinfo -lm"
513 AC_DEFINE(HAVE_SECUREWARE)
514 AC_DEFINE(DISABLE_SHADOW)
515 AC_DEFINE(DISABLE_FD_PASSING)
516 AC_DEFINE(SETEUID_BREAKS_SETUID)
517 AC_DEFINE(BROKEN_SETREUID)
518 AC_DEFINE(BROKEN_SETREGID)
519 AC_DEFINE(WITH_ABBREV_NO_TTY)
520 AC_DEFINE(BROKEN_UPDWTMPX)
521 AC_DEFINE(PASSWD_NEEDS_USERNAME)
522 AC_CHECK_FUNCS(getluid setluid)
527 AC_DEFINE(NO_SSH_LASTLOG, 1,
528 [Define if you don't want to use lastlog in session.c])
529 AC_DEFINE(SETEUID_BREAKS_SETUID)
530 AC_DEFINE(BROKEN_SETREUID)
531 AC_DEFINE(BROKEN_SETREGID)
533 AC_DEFINE(DISABLE_FD_PASSING)
535 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
539 AC_DEFINE(SETEUID_BREAKS_SETUID)
540 AC_DEFINE(BROKEN_SETREUID)
541 AC_DEFINE(BROKEN_SETREGID)
542 AC_DEFINE(WITH_ABBREV_NO_TTY)
544 AC_DEFINE(DISABLE_FD_PASSING)
546 LIBS="$LIBS -lgen -lacid -ldb"
550 AC_DEFINE(SETEUID_BREAKS_SETUID)
551 AC_DEFINE(BROKEN_SETREUID)
552 AC_DEFINE(BROKEN_SETREGID)
554 AC_DEFINE(DISABLE_FD_PASSING)
555 AC_DEFINE(NO_SSH_LASTLOG)
556 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
557 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
561 AC_MSG_CHECKING(for Digital Unix SIA)
564 [ --with-osfsia Enable Digital Unix SIA],
566 if test "x$withval" = "xno" ; then
567 AC_MSG_RESULT(disabled)
572 if test -z "$no_osfsia" ; then
573 if test -f /etc/sia/matrix.conf; then
575 AC_DEFINE(HAVE_OSF_SIA, 1,
576 [Define if you have Digital Unix Security
577 Integration Architecture])
578 AC_DEFINE(DISABLE_LOGIN, 1,
579 [Define if you don't want to use your
580 system's login() call])
581 AC_DEFINE(DISABLE_FD_PASSING)
582 LIBS="$LIBS -lsecurity -ldb -lm -laud"
585 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin",
586 [String used in /etc/passwd to denote locked account])
589 AC_DEFINE(BROKEN_GETADDRINFO)
590 AC_DEFINE(SETEUID_BREAKS_SETUID)
591 AC_DEFINE(BROKEN_SETREUID)
592 AC_DEFINE(BROKEN_SETREGID)
597 AC_DEFINE(NO_X11_UNIX_SOCKETS)
598 AC_DEFINE(MISSING_NFDBITS, 1, [Define on *nto-qnx systems])
599 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems])
600 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
601 AC_DEFINE(DISABLE_LASTLOG)
605 AC_DEFINE(BROKEN_GETGROUPS, 1, [getgroups(0,NULL) will return -1])
606 AC_DEFINE(BROKEN_MMAP, 1, [Ultrix mmap can't map files])
607 AC_DEFINE(NEED_SETPGRP)
608 AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix])
612 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
613 AC_DEFINE(MISSING_HOWMANY)
614 AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation])
618 # Allow user to specify flags
620 [ --with-cflags Specify additional flags to pass to compiler],
622 if test -n "$withval" && test "x$withval" != "xno" && \
623 test "x${withval}" != "xyes"; then
624 CFLAGS="$CFLAGS $withval"
628 AC_ARG_WITH(cppflags,
629 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
631 if test -n "$withval" && test "x$withval" != "xno" && \
632 test "x${withval}" != "xyes"; then
633 CPPFLAGS="$CPPFLAGS $withval"
638 [ --with-ldflags Specify additional flags to pass to linker],
640 if test -n "$withval" && test "x$withval" != "xno" && \
641 test "x${withval}" != "xyes"; then
642 LDFLAGS="$LDFLAGS $withval"
647 [ --with-libs Specify additional libraries to link with],
649 if test -n "$withval" && test "x$withval" != "xno" && \
650 test "x${withval}" != "xyes"; then
651 LIBS="$LIBS $withval"
656 [ --with-Werror Build main code with -Werror],
658 if test -n "$withval" && test "x$withval" != "xno"; then
659 werror_flags="-Werror"
660 if test "x${withval}" != "xyes"; then
661 werror_flags="$withval"
667 AC_MSG_CHECKING(compiler and flags for sanity)
673 [ AC_MSG_RESULT(yes) ],
676 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
678 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
681 dnl Checks for header files.
705 security/pam_appl.h \
741 # lastlog.h requires sys/time.h to be included first on Solaris
742 AC_CHECK_HEADERS(lastlog.h, [], [], [
743 #ifdef HAVE_SYS_TIME_H
744 # include <sys/time.h>
748 # sys/ptms.h requires sys/stream.h to be included first on Solaris
749 AC_CHECK_HEADERS(sys/ptms.h, [], [], [
750 #ifdef HAVE_SYS_STREAM_H
751 # include <sys/stream.h>
755 # Checks for libraries.
756 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
757 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
759 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
760 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
761 AC_CHECK_LIB(gen, dirname,[
762 AC_CACHE_CHECK([for broken dirname],
763 ac_cv_have_broken_dirname, [
771 int main(int argc, char **argv) {
774 strncpy(buf,"/etc", 32);
776 if (!s || strncmp(s, "/", 32) != 0) {
783 [ ac_cv_have_broken_dirname="no" ],
784 [ ac_cv_have_broken_dirname="yes" ],
785 [ ac_cv_have_broken_dirname="no" ],
789 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
791 AC_DEFINE(HAVE_DIRNAME)
792 AC_CHECK_HEADERS(libgen.h)
797 AC_CHECK_FUNC(getspnam, ,
798 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
799 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME, 1,
800 [Define if you have the basename function.]))
804 [ --with-zlib=PATH Use zlib in PATH],
805 [ if test "x$withval" = "xno" ; then
806 AC_MSG_ERROR([*** zlib is required ***])
807 elif test "x$withval" != "xyes"; then
808 if test -d "$withval/lib"; then
809 if test -n "${need_dash_r}"; then
810 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
812 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
815 if test -n "${need_dash_r}"; then
816 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
818 LDFLAGS="-L${withval} ${LDFLAGS}"
821 if test -d "$withval/include"; then
822 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
824 CPPFLAGS="-I${withval} ${CPPFLAGS}"
829 AC_CHECK_LIB(z, deflate, ,
831 saved_CPPFLAGS="$CPPFLAGS"
832 saved_LDFLAGS="$LDFLAGS"
834 dnl Check default zlib install dir
835 if test -n "${need_dash_r}"; then
836 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
838 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
840 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
842 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
844 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
849 AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
851 AC_ARG_WITH(zlib-version-check,
852 [ --without-zlib-version-check Disable zlib version check],
853 [ if test "x$withval" = "xno" ; then
854 zlib_check_nonfatal=1
859 AC_MSG_CHECKING(for possibly buggy zlib)
860 AC_RUN_IFELSE([AC_LANG_SOURCE([[
865 int a=0, b=0, c=0, d=0, n, v;
866 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
867 if (n != 3 && n != 4)
869 v = a*1000000 + b*10000 + c*100 + d;
870 fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
873 if (a == 1 && b == 1 && c >= 4)
876 /* 1.2.3 and up are OK */
885 if test -z "$zlib_check_nonfatal" ; then
886 AC_MSG_ERROR([*** zlib too old - check config.log ***
887 Your reported zlib version has known security problems. It's possible your
888 vendor has fixed these problems without changing the version number. If you
889 are sure this is the case, you can disable the check by running
890 "./configure --without-zlib-version-check".
891 If you are in doubt, upgrade zlib to version 1.2.3 or greater.
892 See http://www.gzip.org/zlib/ for details.])
894 AC_MSG_WARN([zlib version may have security problems])
897 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
901 AC_CHECK_FUNC(strcasecmp,
902 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
904 AC_CHECK_FUNCS(utimes,
905 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
906 LIBS="$LIBS -lc89"]) ]
909 dnl Checks for libutil functions
910 AC_CHECK_HEADERS(libutil.h)
911 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1,
912 [Define if your libraries define login()])])
913 AC_CHECK_FUNCS(logout updwtmp logwtmp)
917 # Check for ALTDIRFUNC glob() extension
918 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
919 AC_EGREP_CPP(FOUNDIT,
922 #ifdef GLOB_ALTDIRFUNC
927 AC_DEFINE(GLOB_HAS_ALTDIRFUNC, 1,
928 [Define if your system glob() function has
929 the GLOB_ALTDIRFUNC extension])
937 # Check for g.gl_matchc glob() extension
938 AC_MSG_CHECKING(for gl_matchc field in glob_t)
939 AC_EGREP_CPP(FOUNDIT,
942 int main(void){glob_t g; g.gl_matchc = 1;}
945 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1,
946 [Define if your system glob() function has
947 gl_matchc options in glob_t])
955 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
958 #include <sys/types.h>
960 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
962 [AC_MSG_RESULT(yes)],
965 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1,
966 [Define if your struct dirent expects you to
967 allocate extra space for d_name])
970 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
971 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
975 # Check whether the user wants GSSAPI mechglue support
976 AC_ARG_WITH(mechglue,
977 [ --with-mechglue=PATH Build with GSSAPI mechglue library],
979 AC_MSG_CHECKING(for mechglue library)
981 if test -e ${withval}/libgssapi.a ; then
982 mechglue_lib=${withval}/libgssapi.a
983 elif test -e ${withval}/lib/libgssapi.a ; then
984 mechglue_lib=${withval}/lib/libgssapi.a
986 AC_MSG_ERROR("Can't find libgssapi in ${withval}");
988 LIBS="$LIBS ${mechglue_lib}"
989 AC_MSG_RESULT(${mechglue_lib})
991 AC_CHECK_LIB(dl, dlopen, , )
992 if test $ac_cv_lib_dl_dlopen = yes; then
993 LDFLAGS="$LDFLAGS -ldl -Wl,-Bsymbolic"
997 AC_DEFINE(MECHGLUE, 1, [Define this if you're building with GSSAPI MechGlue.])
1004 # Check whether the user wants GSI (Globus) support
1007 [ --with-gsi Enable Globus GSI authentication support],
1014 [ --with-globus Enable Globus GSI authentication support],
1020 AC_ARG_WITH(globus-static,
1021 [ --with-globus-static Link statically with Globus GSI libraries],
1023 gsi_static="-static"
1024 if test "x$gsi_path" = "xno" ; then
1030 # Check whether the user has a Globus flavor type
1031 globus_flavor_type="no"
1032 AC_ARG_WITH(globus-flavor,
1033 [ --with-globus-flavor=TYPE Specify Globus flavor type (ex: gcc32dbg)],
1035 globus_flavor_type="$withval"
1036 if test "x$gsi_path" = "xno" ; then
1042 if test "x$gsi_path" != "xno" ; then
1043 # Globus GSSAPI configuration
1044 AC_MSG_CHECKING(for Globus GSI)
1045 AC_DEFINE(GSI, 1, [Define if you want GSI/Globus authentication support.])
1047 if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
1048 AC_MSG_ERROR([Previously configured GSSAPI library conflicts with Globus GSI.])
1050 if test -z "$GSSAPI"; then
1055 if test "x$gsi_path" = "xyes" ; then
1056 if test -z "$GLOBUS_LOCATION" ; then
1057 AC_MSG_ERROR(GLOBUS_LOCATION environment variable must be set.)
1059 gsi_path="$GLOBUS_LOCATION"
1062 GLOBUS_LOCATION="$gsi_path"
1063 export GLOBUS_LOCATION
1064 if test ! -d "$GLOBUS_LOCATION" ; then
1065 AC_MSG_ERROR(Cannot find Globus installation. Set GLOBUS_LOCATION environment variable.)
1068 if test "x$globus_flavor_type" = "xno" ; then
1069 AC_MSG_ERROR(--with-globus-flavor=TYPE must be specified)
1071 if test "x$globus_flavor_type" = "xyes" ; then
1072 AC_MSG_ERROR(--with-globus-flavor=TYPE must specify a flavor type)
1075 GLOBUS_INCLUDE="${gsi_path}/include/${globus_flavor_type}"
1076 if test ! -d "$GLOBUS_INCLUDE" ; then
1077 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_INCLUDE})
1079 GSI_CPPFLAGS="-I${GLOBUS_INCLUDE}"
1081 if test -x ${gsi_path}/bin/globus-makefile-header ; then
1082 GSI_LIBS=`${gsi_path}/bin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
1083 elif test -x ${gsi_path}/sbin/globus-makefile-header ; then
1084 GSI_LIBS=`${gsi_path}/sbin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
1086 AC_MSG_ERROR(Cannot find globus-makefile-header: Globus installation is incomplete)
1088 if test -n "${need_dash_r}"; then
1089 GSI_LDFLAGS="-L${gsi_path}/lib -R{gsi_path}/lib"
1091 GSI_LDFLAGS="-L${gsi_path}/lib"
1093 if test -z "$GSI_LIBS" ; then
1094 AC_MSG_ERROR(globus-makefile-header failed)
1097 AC_DEFINE(HAVE_GSSAPI_H)
1099 LIBS="$LIBS $GSI_LIBS"
1100 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
1101 CPPFLAGS="$CPPFLAGS $GSI_CPPFLAGS"
1103 # test that we got the libraries OK
1111 AC_MSG_ERROR(link with Globus libraries failed)
1114 AC_CHECK_FUNCS(globus_gss_assist_map_and_authorize)
1115 INSTALL_GSISSH="yes"
1119 AC_SUBST(INSTALL_GSISSH)
1120 # End Globus/GSI section
1122 AC_MSG_CHECKING([for /proc/pid/fd directory])
1123 if test -d "/proc/$$/fd" ; then
1124 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
1130 # Check whether user wants S/Key support
1133 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
1135 if test "x$withval" != "xno" ; then
1137 if test "x$withval" != "xyes" ; then
1138 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1139 LDFLAGS="$LDFLAGS -L${withval}/lib"
1142 AC_DEFINE(SKEY, 1, [Define if you want S/Key support])
1146 AC_MSG_CHECKING([for s/key support])
1151 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
1153 [AC_MSG_RESULT(yes)],
1156 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1158 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
1162 [(void)skeychallenge(NULL,"name","",0);],
1164 AC_DEFINE(SKEYCHALLENGE_4ARG, 1,
1165 [Define if your skeychallenge()
1166 function takes 4 arguments (NetBSD)])],
1173 # Check whether user wants TCP wrappers support
1175 AC_ARG_WITH(tcp-wrappers,
1176 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
1178 if test "x$withval" != "xno" ; then
1180 saved_LDFLAGS="$LDFLAGS"
1181 saved_CPPFLAGS="$CPPFLAGS"
1182 if test -n "${withval}" && \
1183 test "x${withval}" != "xyes"; then
1184 if test -d "${withval}/lib"; then
1185 if test -n "${need_dash_r}"; then
1186 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1188 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1191 if test -n "${need_dash_r}"; then
1192 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1194 LDFLAGS="-L${withval} ${LDFLAGS}"
1197 if test -d "${withval}/include"; then
1198 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1200 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1204 LIBS="$LIBWRAP $LIBS"
1205 AC_MSG_CHECKING(for libwrap)
1208 #include <sys/types.h>
1209 #include <sys/socket.h>
1210 #include <netinet/in.h>
1212 int deny_severity = 0, allow_severity = 0;
1217 AC_DEFINE(LIBWRAP, 1,
1219 TCP Wrappers support])
1224 AC_MSG_ERROR([*** libwrap missing])
1232 # Check whether user wants libedit support
1234 AC_ARG_WITH(libedit,
1235 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
1236 [ if test "x$withval" != "xno" ; then
1237 if test "x$withval" != "xyes"; then
1238 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1239 if test -n "${need_dash_r}"; then
1240 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1242 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1245 AC_CHECK_LIB(edit, el_init,
1246 [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp])
1247 LIBEDIT="-ledit -lcurses"
1251 [ AC_MSG_ERROR(libedit not found) ],
1254 AC_MSG_CHECKING(if libedit version is compatible)
1257 #include <histedit.h>
1261 el_init("", NULL, NULL, NULL);
1265 [ AC_MSG_RESULT(yes) ],
1267 AC_MSG_ERROR(libedit version is not compatible) ]
1274 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
1276 AC_MSG_CHECKING(for supported audit module)
1281 dnl Checks for headers, libs and functions
1282 AC_CHECK_HEADERS(bsm/audit.h, [],
1283 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
1284 AC_CHECK_LIB(bsm, getaudit, [],
1285 [AC_MSG_ERROR(BSM enabled and required library not found)])
1286 AC_CHECK_FUNCS(getaudit, [],
1287 [AC_MSG_ERROR(BSM enabled and required function not found)])
1288 # These are optional
1289 AC_CHECK_FUNCS(getaudit_addr)
1290 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
1294 AC_MSG_RESULT(debug)
1295 AC_DEFINE(SSH_AUDIT_EVENTS, 1, Use audit debugging module)
1301 AC_MSG_ERROR([Unknown audit module $withval])
1306 dnl Checks for library functions. Please keep in alphabetical order
1391 # IRIX has a const char return value for gai_strerror()
1392 AC_CHECK_FUNCS(gai_strerror,[
1393 AC_DEFINE(HAVE_GAI_STRERROR)
1395 #include <sys/types.h>
1396 #include <sys/socket.h>
1399 const char *gai_strerror(int);],[
1402 str = gai_strerror(0);],[
1403 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
1404 [Define if gai_strerror() returns const char *])])])
1406 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1,
1407 [Some systems put nanosleep outside of libc]))
1409 dnl Make sure prototypes are defined for these before using them.
1410 AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
1411 AC_CHECK_DECL(strsep,
1412 [AC_CHECK_FUNCS(strsep)],
1415 #ifdef HAVE_STRING_H
1416 # include <string.h>
1420 dnl tcsendbreak might be a macro
1421 AC_CHECK_DECL(tcsendbreak,
1422 [AC_DEFINE(HAVE_TCSENDBREAK)],
1423 [AC_CHECK_FUNCS(tcsendbreak)],
1424 [#include <termios.h>]
1427 AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
1429 AC_CHECK_FUNCS(setresuid, [
1430 dnl Some platorms have setresuid that isn't implemented, test for this
1431 AC_MSG_CHECKING(if setresuid seems to work)
1436 int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
1438 [AC_MSG_RESULT(yes)],
1439 [AC_DEFINE(BROKEN_SETRESUID, 1,
1440 [Define if your setresuid() is broken])
1441 AC_MSG_RESULT(not implemented)],
1442 [AC_MSG_WARN([cross compiling: not checking setresuid])]
1446 AC_CHECK_FUNCS(setresgid, [
1447 dnl Some platorms have setresgid that isn't implemented, test for this
1448 AC_MSG_CHECKING(if setresgid seems to work)
1453 int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
1455 [AC_MSG_RESULT(yes)],
1456 [AC_DEFINE(BROKEN_SETRESGID, 1,
1457 [Define if your setresgid() is broken])
1458 AC_MSG_RESULT(not implemented)],
1459 [AC_MSG_WARN([cross compiling: not checking setresuid])]
1463 dnl Checks for time functions
1464 AC_CHECK_FUNCS(gettimeofday time)
1465 dnl Checks for utmp functions
1466 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
1467 AC_CHECK_FUNCS(utmpname)
1468 dnl Checks for utmpx functions
1469 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
1470 AC_CHECK_FUNCS(setutxent utmpxname)
1472 AC_CHECK_FUNC(daemon,
1473 [AC_DEFINE(HAVE_DAEMON, 1, [Define if your libraries define daemon()])],
1474 [AC_CHECK_LIB(bsd, daemon,
1475 [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
1478 AC_CHECK_FUNC(getpagesize,
1479 [AC_DEFINE(HAVE_GETPAGESIZE, 1,
1480 [Define if your libraries define getpagesize()])],
1481 [AC_CHECK_LIB(ucb, getpagesize,
1482 [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
1485 # Check for broken snprintf
1486 if test "x$ac_cv_func_snprintf" = "xyes" ; then
1487 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
1491 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
1493 [AC_MSG_RESULT(yes)],
1496 AC_DEFINE(BROKEN_SNPRINTF, 1,
1497 [Define if your snprintf is busted])
1498 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
1500 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
1504 # If we don't have a working asprintf, then we strongly depend on vsnprintf
1505 # returning the right thing on overflow: the number of characters it tried to
1506 # create (as per SUSv3)
1507 if test "x$ac_cv_func_asprintf" != "xyes" && \
1508 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1509 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1512 #include <sys/types.h>
1516 int x_snprintf(char *str,size_t count,const char *fmt,...)
1518 size_t ret; va_list ap;
1519 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
1525 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
1527 [AC_MSG_RESULT(yes)],
1530 AC_DEFINE(BROKEN_SNPRINTF, 1,
1531 [Define if your snprintf is busted])
1532 AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor])
1534 [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ]
1538 # On systems where [v]snprintf is broken, but is declared in stdio,
1539 # check that the fmt argument is const char * or just char *.
1540 # This is only useful for when BROKEN_SNPRINTF
1541 AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
1542 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
1543 int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
1544 int main(void) { snprintf(0, 0, 0); }
1547 AC_DEFINE(SNPRINTF_CONST, [const],
1548 [Define as const if snprintf() can declare const char *fmt])],
1550 AC_DEFINE(SNPRINTF_CONST, [/* not const */])])
1552 # Check for missing getpeereid (or equiv) support
1554 if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1555 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1557 [#include <sys/types.h>
1558 #include <sys/socket.h>],
1559 [int i = SO_PEERCRED;],
1560 [ AC_MSG_RESULT(yes)
1561 AC_DEFINE(HAVE_SO_PEERCRED, 1, [Have PEERCRED socket option])
1568 dnl see whether mkstemp() requires XXXXXX
1569 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1570 AC_MSG_CHECKING([for (overly) strict mkstemp])
1574 main() { char template[]="conftest.mkstemp-test";
1575 if (mkstemp(template) == -1)
1577 unlink(template); exit(0);
1585 AC_DEFINE(HAVE_STRICT_MKSTEMP, 1, [Silly mkstemp()])
1589 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1594 dnl make sure that openpty does not reacquire controlling terminal
1595 if test ! -z "$check_for_openpty_ctty_bug"; then
1596 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1600 #include <sys/fcntl.h>
1601 #include <sys/types.h>
1602 #include <sys/wait.h>
1608 int fd, ptyfd, ttyfd, status;
1611 if (pid < 0) { /* failed */
1613 } else if (pid > 0) { /* parent */
1614 waitpid(pid, &status, 0);
1615 if (WIFEXITED(status))
1616 exit(WEXITSTATUS(status));
1619 } else { /* child */
1620 close(0); close(1); close(2);
1622 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1623 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1625 exit(3); /* Acquired ctty: broken */
1627 exit(0); /* Did not acquire ctty: OK */
1636 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1639 AC_MSG_RESULT(cross-compiling, assuming yes)
1644 if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1645 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1646 AC_MSG_CHECKING(if getaddrinfo seems to work)
1650 #include <sys/socket.h>
1653 #include <netinet/in.h>
1655 #define TEST_PORT "2222"
1661 struct addrinfo *gai_ai, *ai, hints;
1662 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1664 memset(&hints, 0, sizeof(hints));
1665 hints.ai_family = PF_UNSPEC;
1666 hints.ai_socktype = SOCK_STREAM;
1667 hints.ai_flags = AI_PASSIVE;
1669 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1671 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1675 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1676 if (ai->ai_family != AF_INET6)
1679 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1680 sizeof(ntop), strport, sizeof(strport),
1681 NI_NUMERICHOST|NI_NUMERICSERV);
1684 if (err == EAI_SYSTEM)
1685 perror("getnameinfo EAI_SYSTEM");
1687 fprintf(stderr, "getnameinfo failed: %s\n",
1692 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1695 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1708 AC_DEFINE(BROKEN_GETADDRINFO)
1711 AC_MSG_RESULT(cross-compiling, assuming yes)
1716 if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1717 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1718 AC_MSG_CHECKING(if getaddrinfo seems to work)
1722 #include <sys/socket.h>
1725 #include <netinet/in.h>
1727 #define TEST_PORT "2222"
1733 struct addrinfo *gai_ai, *ai, hints;
1734 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1736 memset(&hints, 0, sizeof(hints));
1737 hints.ai_family = PF_UNSPEC;
1738 hints.ai_socktype = SOCK_STREAM;
1739 hints.ai_flags = AI_PASSIVE;
1741 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1743 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1747 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1748 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1751 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1752 sizeof(ntop), strport, sizeof(strport),
1753 NI_NUMERICHOST|NI_NUMERICSERV);
1755 if (ai->ai_family == AF_INET && err != 0) {
1756 perror("getnameinfo");
1765 AC_DEFINE(AIX_GETNAMEINFO_HACK, 1,
1766 [Define if you have a getaddrinfo that fails
1767 for the all-zeros IPv6 address])
1771 AC_DEFINE(BROKEN_GETADDRINFO)
1773 AC_MSG_RESULT(cross-compiling, assuming no)
1778 if test "x$check_for_conflicting_getspnam" = "x1"; then
1779 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1783 int main(void) {exit(0);}
1790 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1791 [Conflicting defs for getspnam])
1798 # Check for PAM libs
1801 [ --with-pam Enable PAM support ],
1803 if test "x$withval" != "xno" ; then
1804 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1805 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
1806 AC_MSG_ERROR([PAM headers not found])
1809 AC_CHECK_LIB(dl, dlopen, , )
1810 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1811 AC_CHECK_FUNCS(pam_getenvlist)
1812 AC_CHECK_FUNCS(pam_putenv)
1816 AC_DEFINE(USE_PAM, 1,
1817 [Define if you want to enable PAM support])
1818 if test $ac_cv_lib_dl_dlopen = yes; then
1828 # Check for older PAM
1829 if test "x$PAM_MSG" = "xyes" ; then
1830 # Check PAM strerror arguments (old PAM)
1831 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1835 #if defined(HAVE_SECURITY_PAM_APPL_H)
1836 #include <security/pam_appl.h>
1837 #elif defined (HAVE_PAM_PAM_APPL_H)
1838 #include <pam/pam_appl.h>
1841 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
1842 [AC_MSG_RESULT(no)],
1844 AC_DEFINE(HAVE_OLD_PAM, 1,
1845 [Define if you have an old version of PAM
1846 which takes only one argument to pam_strerror])
1848 PAM_MSG="yes (old library)"
1853 # Search for OpenSSL
1854 saved_CPPFLAGS="$CPPFLAGS"
1855 saved_LDFLAGS="$LDFLAGS"
1856 AC_ARG_WITH(ssl-dir,
1857 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1859 if test "x$withval" != "xno" ; then
1862 ./*|../*) withval="`pwd`/$withval"
1864 if test -d "$withval/lib"; then
1865 if test -n "${need_dash_r}"; then
1866 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1868 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1871 if test -n "${need_dash_r}"; then
1872 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1874 LDFLAGS="-L${withval} ${LDFLAGS}"
1877 if test -d "$withval/include"; then
1878 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1880 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1885 if test -z "$GSI_LIBS" ; then
1886 LIBS="-lcrypto $LIBS"
1888 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
1889 [Define if your ssl headers are included
1890 with #include <openssl/header.h>]),
1892 dnl Check default openssl install dir
1893 if test -n "${need_dash_r}"; then
1894 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
1896 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
1898 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1899 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1901 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1907 # Determine OpenSSL header version
1908 AC_MSG_CHECKING([OpenSSL header version])
1913 #include <openssl/opensslv.h>
1914 #define DATA "conftest.sslincver"
1919 fd = fopen(DATA,"w");
1923 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1930 ssl_header_ver=`cat conftest.sslincver`
1931 AC_MSG_RESULT($ssl_header_ver)
1934 AC_MSG_RESULT(not found)
1935 AC_MSG_ERROR(OpenSSL version header not found.)
1938 AC_MSG_WARN([cross compiling: not checking])
1942 # Determine OpenSSL library version
1943 AC_MSG_CHECKING([OpenSSL library version])
1948 #include <openssl/opensslv.h>
1949 #include <openssl/crypto.h>
1950 #define DATA "conftest.ssllibver"
1955 fd = fopen(DATA,"w");
1959 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1966 ssl_library_ver=`cat conftest.ssllibver`
1967 AC_MSG_RESULT($ssl_library_ver)
1970 AC_MSG_RESULT(not found)
1971 AC_MSG_ERROR(OpenSSL library not found.)
1974 AC_MSG_WARN([cross compiling: not checking])
1978 # Sanity check OpenSSL headers
1979 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1983 #include <openssl/opensslv.h>
1984 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1991 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1992 Check config.log for details.
1993 Also see contrib/findssl.sh for help identifying header/library mismatches.])
1996 AC_MSG_WARN([cross compiling: not checking])
2000 # Check for OpenSSL without EVP_aes_{192,256}_cbc
2001 AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
2005 #include <openssl/evp.h>
2006 int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);}
2013 AC_DEFINE(OPENSSL_LOBOTOMISED_AES, 1,
2014 [libcrypto is missing AES 192 and 256 bit functions])
2018 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
2019 # because the system crypt() is more featureful.
2020 if test "x$check_for_libcrypt_before" = "x1"; then
2021 AC_CHECK_LIB(crypt, crypt)
2024 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
2025 # version in OpenSSL.
2026 if test "x$check_for_libcrypt_later" = "x1"; then
2027 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
2030 AC_CHECK_LIB(iaf, ia_openinfo)
2032 ### Configure cryptographic random number support
2034 # Check wheter OpenSSL seeds itself
2035 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
2039 #include <openssl/rand.h>
2040 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
2043 OPENSSL_SEEDS_ITSELF=yes
2048 # Default to use of the rand helper if OpenSSL doesn't
2053 AC_MSG_WARN([cross compiling: assuming yes])
2054 # This is safe, since all recent OpenSSL versions will
2055 # complain at runtime if not seeded correctly.
2056 OPENSSL_SEEDS_ITSELF=yes
2061 # Do we want to force the use of the rand helper?
2062 AC_ARG_WITH(rand-helper,
2063 [ --with-rand-helper Use subprocess to gather strong randomness ],
2065 if test "x$withval" = "xno" ; then
2066 # Force use of OpenSSL's internal RNG, even if
2067 # the previous test showed it to be unseeded.
2068 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
2069 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
2070 OPENSSL_SEEDS_ITSELF=yes
2079 # Which randomness source do we use?
2080 if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
2082 AC_DEFINE(OPENSSL_PRNG_ONLY, 1,
2083 [Define if you want OpenSSL's internally seeded PRNG only])
2084 RAND_MSG="OpenSSL internal ONLY"
2085 INSTALL_SSH_RAND_HELPER=""
2086 elif test ! -z "$USE_RAND_HELPER" ; then
2087 # install rand helper
2088 RAND_MSG="ssh-rand-helper"
2089 INSTALL_SSH_RAND_HELPER="yes"
2091 AC_SUBST(INSTALL_SSH_RAND_HELPER)
2093 ### Configuration of ssh-rand-helper
2096 AC_ARG_WITH(prngd-port,
2097 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
2106 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
2109 if test ! -z "$withval" ; then
2110 PRNGD_PORT="$withval"
2111 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT,
2112 [Port number of PRNGD/EGD random number socket])
2117 # PRNGD Unix domain socket
2118 AC_ARG_WITH(prngd-socket,
2119 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
2123 withval="/var/run/egd-pool"
2131 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
2135 if test ! -z "$withval" ; then
2136 if test ! -z "$PRNGD_PORT" ; then
2137 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
2139 if test ! -r "$withval" ; then
2140 AC_MSG_WARN(Entropy socket is not readable)
2142 PRNGD_SOCKET="$withval"
2143 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET",
2144 [Location of PRNGD/EGD random number socket])
2148 # Check for existing socket only if we don't have a random device already
2149 if test "$USE_RAND_HELPER" = yes ; then
2150 AC_MSG_CHECKING(for PRNGD/EGD socket)
2151 # Insert other locations here
2152 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
2153 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
2154 PRNGD_SOCKET="$sock"
2155 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
2159 if test ! -z "$PRNGD_SOCKET" ; then
2160 AC_MSG_RESULT($PRNGD_SOCKET)
2162 AC_MSG_RESULT(not found)
2168 # Change default command timeout for hashing entropy source
2170 AC_ARG_WITH(entropy-timeout,
2171 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2173 if test -n "$withval" && test "x$withval" != "xno" && \
2174 test "x${withval}" != "xyes"; then
2175 entropy_timeout=$withval
2179 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout,
2180 [Builtin PRNG command timeout])
2182 SSH_PRIVSEP_USER=sshd
2183 AC_ARG_WITH(privsep-user,
2184 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
2186 if test -n "$withval" && test "x$withval" != "xno" && \
2187 test "x${withval}" != "xyes"; then
2188 SSH_PRIVSEP_USER=$withval
2192 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER",
2193 [non-privileged user for privilege separation])
2194 AC_SUBST(SSH_PRIVSEP_USER)
2196 # We do this little dance with the search path to insure
2197 # that programs that we select for use by installed programs
2198 # (which may be run by the super-user) come from trusted
2199 # locations before they come from the user's private area.
2200 # This should help avoid accidentally configuring some
2201 # random version of a program in someone's personal bin.
2205 test -h /bin 2> /dev/null && PATH=/usr/bin
2206 test -d /sbin && PATH=$PATH:/sbin
2207 test -d /usr/sbin && PATH=$PATH:/usr/sbin
2208 PATH=$PATH:/etc:$OPATH
2210 # These programs are used by the command hashing source to gather entropy
2211 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
2212 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
2213 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
2214 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
2215 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
2216 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
2217 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
2218 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
2219 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
2220 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
2221 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
2222 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
2223 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
2224 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
2225 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
2226 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
2230 # Where does ssh-rand-helper get its randomness from?
2231 INSTALL_SSH_PRNG_CMDS=""
2232 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
2233 if test ! -z "$PRNGD_PORT" ; then
2234 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
2235 elif test ! -z "$PRNGD_SOCKET" ; then
2236 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
2238 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
2239 RAND_HELPER_CMDHASH=yes
2240 INSTALL_SSH_PRNG_CMDS="yes"
2243 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
2246 # Cheap hack to ensure NEWS-OS libraries are arranged right.
2247 if test ! -z "$SONY" ; then
2248 LIBS="$LIBS -liberty";
2251 # Check for long long datatypes
2252 AC_CHECK_TYPES([long long, unsigned long long, long double])
2254 # Check datatype sizes
2255 AC_CHECK_SIZEOF(char, 1)
2256 AC_CHECK_SIZEOF(short int, 2)
2257 AC_CHECK_SIZEOF(int, 4)
2258 AC_CHECK_SIZEOF(long int, 4)
2259 AC_CHECK_SIZEOF(long long int, 8)
2261 # Sanity check long long for some platforms (AIX)
2262 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
2263 ac_cv_sizeof_long_long_int=0
2266 # compute LLONG_MIN and LLONG_MAX if we don't know them.
2267 if test -z "$have_llong_max"; then
2268 AC_MSG_CHECKING([for max value of long long])
2272 /* Why is this so damn hard? */
2276 #define __USE_ISOC99
2278 #define DATA "conftest.llminmax"
2281 long long i, llmin, llmax = 0;
2283 if((f = fopen(DATA,"w")) == NULL)
2286 #if defined(LLONG_MIN) && defined(LLONG_MAX)
2287 fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
2291 fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
2292 /* This will work on one's complement and two's complement */
2293 for (i = 1; i > llmax; i <<= 1, i++)
2295 llmin = llmax + 1LL; /* wrap */
2299 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2300 || llmax - 1 > llmax) {
2301 fprintf(f, "unknown unknown\n");
2305 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
2312 llong_min=`$AWK '{print $1}' conftest.llminmax`
2313 llong_max=`$AWK '{print $2}' conftest.llminmax`
2315 # snprintf on some Tru64s doesn't understand "%lld"
2318 if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
2319 test "x$llong_max" = "xld"; then
2320 llong_min="-9223372036854775808"
2321 llong_max="9223372036854775807"
2326 AC_MSG_RESULT($llong_max)
2327 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
2328 [max value of long long calculated by configure])
2329 AC_MSG_CHECKING([for min value of long long])
2330 AC_MSG_RESULT($llong_min)
2331 AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
2332 [min value of long long calculated by configure])
2335 AC_MSG_RESULT(not found)
2338 AC_MSG_WARN([cross compiling: not checking])
2344 # More checks for data types
2345 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
2347 [ #include <sys/types.h> ],
2349 [ ac_cv_have_u_int="yes" ],
2350 [ ac_cv_have_u_int="no" ]
2353 if test "x$ac_cv_have_u_int" = "xyes" ; then
2354 AC_DEFINE(HAVE_U_INT, 1, [define if you have u_int data type])
2358 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
2360 [ #include <sys/types.h> ],
2361 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
2362 [ ac_cv_have_intxx_t="yes" ],
2363 [ ac_cv_have_intxx_t="no" ]
2366 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2367 AC_DEFINE(HAVE_INTXX_T, 1, [define if you have intxx_t data type])
2371 if (test -z "$have_intxx_t" && \
2372 test "x$ac_cv_header_stdint_h" = "xyes")
2374 AC_MSG_CHECKING([for intXX_t types in stdint.h])
2376 [ #include <stdint.h> ],
2377 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
2379 AC_DEFINE(HAVE_INTXX_T)
2382 [ AC_MSG_RESULT(no) ]
2386 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2389 #include <sys/types.h>
2390 #ifdef HAVE_STDINT_H
2391 # include <stdint.h>
2393 #include <sys/socket.h>
2394 #ifdef HAVE_SYS_BITYPES_H
2395 # include <sys/bitypes.h>
2398 [ int64_t a; a = 1;],
2399 [ ac_cv_have_int64_t="yes" ],
2400 [ ac_cv_have_int64_t="no" ]
2403 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2404 AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type])
2407 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
2409 [ #include <sys/types.h> ],
2410 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
2411 [ ac_cv_have_u_intxx_t="yes" ],
2412 [ ac_cv_have_u_intxx_t="no" ]
2415 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2416 AC_DEFINE(HAVE_U_INTXX_T, 1, [define if you have u_intxx_t data type])
2420 if test -z "$have_u_intxx_t" ; then
2421 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
2423 [ #include <sys/socket.h> ],
2424 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
2426 AC_DEFINE(HAVE_U_INTXX_T)
2429 [ AC_MSG_RESULT(no) ]
2433 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
2435 [ #include <sys/types.h> ],
2436 [ u_int64_t a; a = 1;],
2437 [ ac_cv_have_u_int64_t="yes" ],
2438 [ ac_cv_have_u_int64_t="no" ]
2441 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2442 AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type])
2446 if test -z "$have_u_int64_t" ; then
2447 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
2449 [ #include <sys/bitypes.h> ],
2450 [ u_int64_t a; a = 1],
2452 AC_DEFINE(HAVE_U_INT64_T)
2455 [ AC_MSG_RESULT(no) ]
2459 if test -z "$have_u_intxx_t" ; then
2460 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
2463 #include <sys/types.h>
2465 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
2466 [ ac_cv_have_uintxx_t="yes" ],
2467 [ ac_cv_have_uintxx_t="no" ]
2470 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2471 AC_DEFINE(HAVE_UINTXX_T, 1,
2472 [define if you have uintxx_t data type])
2476 if test -z "$have_uintxx_t" ; then
2477 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
2479 [ #include <stdint.h> ],
2480 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
2482 AC_DEFINE(HAVE_UINTXX_T)
2485 [ AC_MSG_RESULT(no) ]
2489 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2490 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2492 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2495 #include <sys/bitypes.h>
2498 int8_t a; int16_t b; int32_t c;
2499 u_int8_t e; u_int16_t f; u_int32_t g;
2500 a = b = c = e = f = g = 1;
2503 AC_DEFINE(HAVE_U_INTXX_T)
2504 AC_DEFINE(HAVE_INTXX_T)
2512 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
2515 #include <sys/types.h>
2517 [ u_char foo; foo = 125; ],
2518 [ ac_cv_have_u_char="yes" ],
2519 [ ac_cv_have_u_char="no" ]
2522 if test "x$ac_cv_have_u_char" = "xyes" ; then
2523 AC_DEFINE(HAVE_U_CHAR, 1, [define if you have u_char data type])
2528 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
2530 AC_CHECK_TYPES(in_addr_t,,,
2531 [#include <sys/types.h>
2532 #include <netinet/in.h>])
2534 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
2537 #include <sys/types.h>
2539 [ size_t foo; foo = 1235; ],
2540 [ ac_cv_have_size_t="yes" ],
2541 [ ac_cv_have_size_t="no" ]
2544 if test "x$ac_cv_have_size_t" = "xyes" ; then
2545 AC_DEFINE(HAVE_SIZE_T, 1, [define if you have size_t data type])
2548 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
2551 #include <sys/types.h>
2553 [ ssize_t foo; foo = 1235; ],
2554 [ ac_cv_have_ssize_t="yes" ],
2555 [ ac_cv_have_ssize_t="no" ]
2558 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
2559 AC_DEFINE(HAVE_SSIZE_T, 1, [define if you have ssize_t data type])
2562 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
2567 [ clock_t foo; foo = 1235; ],
2568 [ ac_cv_have_clock_t="yes" ],
2569 [ ac_cv_have_clock_t="no" ]
2572 if test "x$ac_cv_have_clock_t" = "xyes" ; then
2573 AC_DEFINE(HAVE_CLOCK_T, 1, [define if you have clock_t data type])
2576 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
2579 #include <sys/types.h>
2580 #include <sys/socket.h>
2582 [ sa_family_t foo; foo = 1235; ],
2583 [ ac_cv_have_sa_family_t="yes" ],
2586 #include <sys/types.h>
2587 #include <sys/socket.h>
2588 #include <netinet/in.h>
2590 [ sa_family_t foo; foo = 1235; ],
2591 [ ac_cv_have_sa_family_t="yes" ],
2593 [ ac_cv_have_sa_family_t="no" ]
2597 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
2598 AC_DEFINE(HAVE_SA_FAMILY_T, 1,
2599 [define if you have sa_family_t data type])
2602 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
2605 #include <sys/types.h>
2607 [ pid_t foo; foo = 1235; ],
2608 [ ac_cv_have_pid_t="yes" ],
2609 [ ac_cv_have_pid_t="no" ]
2612 if test "x$ac_cv_have_pid_t" = "xyes" ; then
2613 AC_DEFINE(HAVE_PID_T, 1, [define if you have pid_t data type])
2616 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
2619 #include <sys/types.h>
2621 [ mode_t foo; foo = 1235; ],
2622 [ ac_cv_have_mode_t="yes" ],
2623 [ ac_cv_have_mode_t="no" ]
2626 if test "x$ac_cv_have_mode_t" = "xyes" ; then
2627 AC_DEFINE(HAVE_MODE_T, 1, [define if you have mode_t data type])
2631 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
2634 #include <sys/types.h>
2635 #include <sys/socket.h>
2637 [ struct sockaddr_storage s; ],
2638 [ ac_cv_have_struct_sockaddr_storage="yes" ],
2639 [ ac_cv_have_struct_sockaddr_storage="no" ]
2642 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
2643 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
2644 [define if you have struct sockaddr_storage data type])
2647 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
2650 #include <sys/types.h>
2651 #include <netinet/in.h>
2653 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
2654 [ ac_cv_have_struct_sockaddr_in6="yes" ],
2655 [ ac_cv_have_struct_sockaddr_in6="no" ]
2658 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
2659 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1,
2660 [define if you have struct sockaddr_in6 data type])
2663 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
2666 #include <sys/types.h>
2667 #include <netinet/in.h>
2669 [ struct in6_addr s; s.s6_addr[0] = 0; ],
2670 [ ac_cv_have_struct_in6_addr="yes" ],
2671 [ ac_cv_have_struct_in6_addr="no" ]
2674 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
2675 AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1,
2676 [define if you have struct in6_addr data type])
2679 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2682 #include <sys/types.h>
2683 #include <sys/socket.h>
2686 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2687 [ ac_cv_have_struct_addrinfo="yes" ],
2688 [ ac_cv_have_struct_addrinfo="no" ]
2691 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2692 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
2693 [define if you have struct addrinfo data type])
2696 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2698 [ #include <sys/time.h> ],
2699 [ struct timeval tv; tv.tv_sec = 1;],
2700 [ ac_cv_have_struct_timeval="yes" ],
2701 [ ac_cv_have_struct_timeval="no" ]
2704 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2705 AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if you have struct timeval])
2706 have_struct_timeval=1
2709 AC_CHECK_TYPES(struct timespec)
2711 # We need int64_t or else certian parts of the compile will fail.
2712 if test "x$ac_cv_have_int64_t" = "xno" && \
2713 test "x$ac_cv_sizeof_long_int" != "x8" && \
2714 test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
2715 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2716 echo "an alternative compiler (I.E., GCC) before continuing."
2720 dnl test snprintf (broken on SCO w/gcc)
2725 #ifdef HAVE_SNPRINTF
2729 char expected_out[50];
2731 #if (SIZEOF_LONG_INT == 8)
2732 long int num = 0x7fffffffffffffff;
2734 long long num = 0x7fffffffffffffffll;
2736 strcpy(expected_out, "9223372036854775807");
2737 snprintf(buf, mazsize, "%lld", num);
2738 if(strcmp(buf, expected_out) != 0)
2745 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
2746 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
2750 dnl Checks for structure members
2751 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2752 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2753 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2754 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2755 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
2756 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
2757 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2758 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
2759 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
2760 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2761 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2762 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2763 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
2764 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2765 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2766 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2767 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
2769 AC_CHECK_MEMBERS([struct stat.st_blksize])
2770 AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state,
2771 [Define if we don't have struct __res_state in resolv.h])],
2774 #if HAVE_SYS_TYPES_H
2775 # include <sys/types.h>
2777 #include <netinet/in.h>
2778 #include <arpa/nameser.h>
2782 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2783 ac_cv_have_ss_family_in_struct_ss, [
2786 #include <sys/types.h>
2787 #include <sys/socket.h>
2789 [ struct sockaddr_storage s; s.ss_family = 1; ],
2790 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2791 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2794 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2795 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Fields in struct sockaddr_storage])
2798 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2799 ac_cv_have___ss_family_in_struct_ss, [
2802 #include <sys/types.h>
2803 #include <sys/socket.h>
2805 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2806 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2807 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2810 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2811 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1,
2812 [Fields in struct sockaddr_storage])
2815 AC_CACHE_CHECK([for pw_class field in struct passwd],
2816 ac_cv_have_pw_class_in_struct_passwd, [
2821 [ struct passwd p; p.pw_class = 0; ],
2822 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2823 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2826 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2827 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD, 1,
2828 [Define if your password has a pw_class field])
2831 AC_CACHE_CHECK([for pw_expire field in struct passwd],
2832 ac_cv_have_pw_expire_in_struct_passwd, [
2837 [ struct passwd p; p.pw_expire = 0; ],
2838 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2839 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2842 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2843 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD, 1,
2844 [Define if your password has a pw_expire field])
2847 AC_CACHE_CHECK([for pw_change field in struct passwd],
2848 ac_cv_have_pw_change_in_struct_passwd, [
2853 [ struct passwd p; p.pw_change = 0; ],
2854 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2855 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2858 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2859 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD, 1,
2860 [Define if your password has a pw_change field])
2863 dnl make sure we're using the real structure members and not defines
2864 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2865 ac_cv_have_accrights_in_msghdr, [
2868 #include <sys/types.h>
2869 #include <sys/socket.h>
2870 #include <sys/uio.h>
2872 #ifdef msg_accrights
2873 #error "msg_accrights is a macro"
2877 m.msg_accrights = 0;
2881 [ ac_cv_have_accrights_in_msghdr="yes" ],
2882 [ ac_cv_have_accrights_in_msghdr="no" ]
2885 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2886 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR, 1,
2887 [Define if your system uses access rights style
2888 file descriptor passing])
2891 AC_CACHE_CHECK([for msg_control field in struct msghdr],
2892 ac_cv_have_control_in_msghdr, [
2895 #include <sys/types.h>
2896 #include <sys/socket.h>
2897 #include <sys/uio.h>
2900 #error "msg_control is a macro"
2908 [ ac_cv_have_control_in_msghdr="yes" ],
2909 [ ac_cv_have_control_in_msghdr="no" ]
2912 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2913 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR, 1,
2914 [Define if your system uses ancillary data style
2915 file descriptor passing])
2918 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
2920 [ extern char *__progname; printf("%s", __progname); ],
2921 [ ac_cv_libc_defines___progname="yes" ],
2922 [ ac_cv_libc_defines___progname="no" ]
2925 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2926 AC_DEFINE(HAVE___PROGNAME, 1, [Define if libc defines __progname])
2929 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2933 [ printf("%s", __FUNCTION__); ],
2934 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2935 [ ac_cv_cc_implements___FUNCTION__="no" ]
2938 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2939 AC_DEFINE(HAVE___FUNCTION__, 1,
2940 [Define if compiler implements __FUNCTION__])
2943 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2947 [ printf("%s", __func__); ],
2948 [ ac_cv_cc_implements___func__="yes" ],
2949 [ ac_cv_cc_implements___func__="no" ]
2952 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2953 AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__])
2956 AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
2958 [#include <stdarg.h>
2961 [ ac_cv_have_va_copy="yes" ],
2962 [ ac_cv_have_va_copy="no" ]
2965 if test "x$ac_cv_have_va_copy" = "xyes" ; then
2966 AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists])
2969 AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
2971 [#include <stdarg.h>
2974 [ ac_cv_have___va_copy="yes" ],
2975 [ ac_cv_have___va_copy="no" ]
2978 if test "x$ac_cv_have___va_copy" = "xyes" ; then
2979 AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists])
2982 AC_CACHE_CHECK([whether getopt has optreset support],
2983 ac_cv_have_getopt_optreset, [
2988 [ extern int optreset; optreset = 0; ],
2989 [ ac_cv_have_getopt_optreset="yes" ],
2990 [ ac_cv_have_getopt_optreset="no" ]
2993 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2994 AC_DEFINE(HAVE_GETOPT_OPTRESET, 1,
2995 [Define if your getopt(3) defines and uses optreset])
2998 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
3000 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
3001 [ ac_cv_libc_defines_sys_errlist="yes" ],
3002 [ ac_cv_libc_defines_sys_errlist="no" ]
3005 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
3006 AC_DEFINE(HAVE_SYS_ERRLIST, 1,
3007 [Define if your system defines sys_errlist[]])
3011 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
3013 [ extern int sys_nerr; printf("%i", sys_nerr);],
3014 [ ac_cv_libc_defines_sys_nerr="yes" ],
3015 [ ac_cv_libc_defines_sys_nerr="no" ]
3018 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
3019 AC_DEFINE(HAVE_SYS_NERR, 1, [Define if your system defines sys_nerr])
3023 # Check whether user wants sectok support
3025 [ --with-sectok Enable smartcard support using libsectok],
3027 if test "x$withval" != "xno" ; then
3028 if test "x$withval" != "xyes" ; then
3029 CPPFLAGS="$CPPFLAGS -I${withval}"
3030 LDFLAGS="$LDFLAGS -L${withval}"
3031 if test ! -z "$need_dash_r" ; then
3032 LDFLAGS="$LDFLAGS -R${withval}"
3034 if test ! -z "$blibpath" ; then
3035 blibpath="$blibpath:${withval}"
3038 AC_CHECK_HEADERS(sectok.h)
3039 if test "$ac_cv_header_sectok_h" != yes; then
3040 AC_MSG_ERROR(Can't find sectok.h)
3042 AC_CHECK_LIB(sectok, sectok_open)
3043 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
3044 AC_MSG_ERROR(Can't find libsectok)
3046 AC_DEFINE(SMARTCARD, 1,
3047 [Define if you want smartcard support])
3048 AC_DEFINE(USE_SECTOK, 1,
3049 [Define if you want smartcard support
3051 SCARD_MSG="yes, using sectok"
3056 # Check whether user wants OpenSC support
3059 [ --with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)],
3061 if test "x$withval" != "xno" ; then
3062 if test "x$withval" != "xyes" ; then
3063 OPENSC_CONFIG=$withval/bin/opensc-config
3065 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
3067 if test "$OPENSC_CONFIG" != "no"; then
3068 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
3069 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
3070 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
3071 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
3072 AC_DEFINE(SMARTCARD)
3073 AC_DEFINE(USE_OPENSC, 1,
3074 [Define if you want smartcard support
3076 SCARD_MSG="yes, using OpenSC"
3082 # Check libraries needed by DNS fingerprint support
3083 AC_SEARCH_LIBS(getrrsetbyname, resolv,
3084 [AC_DEFINE(HAVE_GETRRSETBYNAME, 1,
3085 [Define if getrrsetbyname() exists])],
3087 # Needed by our getrrsetbyname()
3088 AC_SEARCH_LIBS(res_query, resolv)
3089 AC_SEARCH_LIBS(dn_expand, resolv)
3090 AC_MSG_CHECKING(if res_query will link)
3091 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
3094 LIBS="$LIBS -lresolv"
3095 AC_MSG_CHECKING(for res_query in -lresolv)
3100 res_query (0, 0, 0, 0, 0);
3104 [LIBS="$LIBS -lresolv"
3105 AC_MSG_RESULT(yes)],
3109 AC_CHECK_FUNCS(_getshort _getlong)
3110 AC_CHECK_DECLS([_getshort, _getlong], , ,
3111 [#include <sys/types.h>
3112 #include <arpa/nameser.h>])
3113 AC_CHECK_MEMBER(HEADER.ad,
3114 [AC_DEFINE(HAVE_HEADER_AD, 1,
3115 [Define if HEADER.ad exists in arpa/nameser.h])],,
3116 [#include <arpa/nameser.h>])
3119 # Check whether user wants Kerberos 5 support
3121 AC_ARG_WITH(kerberos5,
3122 [ --with-kerberos5=PATH Enable Kerberos 5 support],
3123 [ if test "x$withval" != "xno" ; then
3124 if test "x$withval" = "xyes" ; then
3125 KRB5ROOT="/usr/local"
3130 AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support])
3133 AC_MSG_CHECKING(for krb5-config)
3134 if test -x $KRB5ROOT/bin/krb5-config ; then
3135 KRB5CONF=$KRB5ROOT/bin/krb5-config
3136 AC_MSG_RESULT($KRB5CONF)
3138 AC_MSG_CHECKING(for gssapi support)
3139 if $KRB5CONF | grep gssapi >/dev/null ; then
3141 AC_DEFINE(GSSAPI, 1,
3142 [Define this if you want GSSAPI
3143 support in the version 2 protocol])
3149 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
3150 K5LIBS="`$KRB5CONF --libs $k5confopts`"
3151 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
3152 AC_MSG_CHECKING(whether we are using Heimdal)
3153 AC_TRY_COMPILE([ #include <krb5.h> ],
3154 [ char *tmp = heimdal_version; ],
3155 [ AC_MSG_RESULT(yes)
3156 AC_DEFINE(HEIMDAL, 1,
3157 [Define this if you are using the
3158 Heimdal version of Kerberos V5]) ],
3163 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
3164 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
3165 AC_MSG_CHECKING(whether we are using Heimdal)
3166 AC_TRY_COMPILE([ #include <krb5.h> ],
3167 [ char *tmp = heimdal_version; ],
3168 [ AC_MSG_RESULT(yes)
3170 K5LIBS="-lkrb5 -ldes"
3171 K5LIBS="$K5LIBS -lcom_err -lasn1"
3172 AC_CHECK_LIB(roken, net_write,
3173 [K5LIBS="$K5LIBS -lroken"])
3176 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
3179 AC_SEARCH_LIBS(dn_expand, resolv)
3181 AC_CHECK_LIB(gssapi,gss_init_sec_context,
3183 K5LIBS="-lgssapi $K5LIBS" ],
3184 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
3186 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
3187 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
3192 AC_CHECK_HEADER(gssapi.h, ,
3193 [ unset ac_cv_header_gssapi_h
3194 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3195 AC_CHECK_HEADERS(gssapi.h, ,
3196 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
3202 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3203 AC_CHECK_HEADER(gssapi_krb5.h, ,
3204 [ CPPFLAGS="$oldCPP" ])
3206 # If we're using some other GSSAPI
3207 if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
3208 AC_MSG_ERROR([$GSSAPI GSSAPI library conflicts with Kerberos support. Use mechglue instead.])
3211 if test -z "$GSSAPI"; then
3216 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3217 AC_CHECK_HEADER(gssapi_krb5.h, ,
3218 [ CPPFLAGS="$oldCPP" ])
3221 if test ! -z "$need_dash_r" ; then
3222 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
3224 if test ! -z "$blibpath" ; then
3225 blibpath="$blibpath:${KRB5ROOT}/lib"
3228 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
3229 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
3230 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
3232 LIBS="$LIBS $K5LIBS"
3233 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS, 1,
3234 [Define this if you want to use libkafs' AFS support]))
3239 # Check whether user wants AFS_KRB5 support
3241 AC_ARG_WITH(afs-krb5,
3242 [ --with-afs-krb5[[=AKLOG_PATH]] Enable aklog to get token (default=/usr/bin/aklog).],
3244 if test "x$withval" != "xno" ; then
3246 if test "x$withval" != "xyes" ; then
3247 AC_DEFINE_UNQUOTED(AKLOG_PATH, "$withval",
3248 [Define this if you want to use AFS/Kerberos 5 option, which runs aklog.])
3250 AC_DEFINE_UNQUOTED(AKLOG_PATH,
3252 [Define this if you want to use AFS/Kerberos 5 option, which runs aklog.])
3255 if test -z "$KRB5ROOT" ; then
3256 AC_MSG_WARN([AFS_KRB5 requires Kerberos 5 support, build may fail])
3259 LIBS="-lkrbafs -lkrb4 $LIBS"
3260 if test ! -z "$AFS_LIBS" ; then
3261 LIBS="$LIBS $AFS_LIBS"
3263 AC_DEFINE(AFS_KRB5, 1,
3264 [Define this if you want to use AFS/Kerberos 5 option, which runs aklog.])
3270 AC_ARG_WITH(session-hooks,
3271 [ --with-session-hooks Enable hooks for executing external commands before/after a session],
3272 [ AC_DEFINE(SESSION_HOOKS, 1, [Define this if you want support for startup/shutdown hooks]) ]
3275 # Looking for programs, paths and files
3277 PRIVSEP_PATH=/var/empty
3278 AC_ARG_WITH(privsep-path,
3279 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
3281 if test -n "$withval" && test "x$withval" != "xno" && \
3282 test "x${withval}" != "xyes"; then
3283 PRIVSEP_PATH=$withval
3287 AC_SUBST(PRIVSEP_PATH)
3290 [ --with-xauth=PATH Specify path to xauth program ],
3292 if test -n "$withval" && test "x$withval" != "xno" && \
3293 test "x${withval}" != "xyes"; then
3299 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
3300 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
3301 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
3302 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
3303 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
3304 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
3305 xauth_path="/usr/openwin/bin/xauth"
3311 AC_ARG_ENABLE(strip,
3312 [ --disable-strip Disable calling strip(1) on install],
3314 if test "x$enableval" = "xno" ; then
3321 if test -z "$xauth_path" ; then
3322 XAUTH_PATH="undefined"
3323 AC_SUBST(XAUTH_PATH)
3325 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path",
3326 [Define if xauth is found in your path])
3327 XAUTH_PATH=$xauth_path
3328 AC_SUBST(XAUTH_PATH)
3331 # Check for mail directory (last resort if we cannot get it from headers)
3332 if test ! -z "$MAIL" ; then
3333 maildir=`dirname $MAIL`
3334 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir",
3335 [Set this to your mail directory if you don't have maillock.h])
3338 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
3339 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
3340 disable_ptmx_check=yes
3342 if test -z "$no_dev_ptmx" ; then
3343 if test "x$disable_ptmx_check" != "xyes" ; then
3344 AC_CHECK_FILE("/dev/ptmx",
3346 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1,
3347 [Define if you have /dev/ptmx])
3354 if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
3355 AC_CHECK_FILE("/dev/ptc",
3357 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1,
3358 [Define if you have /dev/ptc])
3363 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
3366 # Options from here on. Some of these are preset by platform above
3367 AC_ARG_WITH(mantype,
3368 [ --with-mantype=man|cat|doc Set man page type],
3375 AC_MSG_ERROR(invalid man type: $withval)
3380 if test -z "$MANTYPE"; then
3381 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
3382 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
3383 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
3385 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
3392 if test "$MANTYPE" = "doc"; then
3399 # Check whether to enable MD5 passwords
3401 AC_ARG_WITH(md5-passwords,
3402 [ --with-md5-passwords Enable use of MD5 passwords],
3404 if test "x$withval" != "xno" ; then
3405 AC_DEFINE(HAVE_MD5_PASSWORDS, 1,
3406 [Define if you want to allow MD5 passwords])
3412 # Whether to disable shadow password support
3414 [ --without-shadow Disable shadow password support],
3416 if test "x$withval" = "xno" ; then
3417 AC_DEFINE(DISABLE_SHADOW)
3423 if test -z "$disable_shadow" ; then
3424 AC_MSG_CHECKING([if the systems has expire shadow information])
3427 #include <sys/types.h>
3430 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
3431 [ sp_expire_available=yes ], []
3434 if test "x$sp_expire_available" = "xyes" ; then
3436 AC_DEFINE(HAS_SHADOW_EXPIRE, 1,
3437 [Define if you want to use shadow password expire field])
3443 # Use ip address instead of hostname in $DISPLAY
3444 if test ! -z "$IPADDR_IN_DISPLAY" ; then
3445 DISPLAY_HACK_MSG="yes"
3446 AC_DEFINE(IPADDR_IN_DISPLAY, 1,
3447 [Define if you need to use IP address
3448 instead of hostname in $DISPLAY])
3450 DISPLAY_HACK_MSG="no"
3451 AC_ARG_WITH(ipaddr-display,
3452 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
3454 if test "x$withval" != "xno" ; then
3455 AC_DEFINE(IPADDR_IN_DISPLAY)
3456 DISPLAY_HACK_MSG="yes"
3462 # check for /etc/default/login and use it if present.
3463 AC_ARG_ENABLE(etc-default-login,
3464 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
3465 [ if test "x$enableval" = "xno"; then
3466 AC_MSG_NOTICE([/etc/default/login handling disabled])
3467 etc_default_login=no
3469 etc_default_login=yes
3471 [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
3473 AC_MSG_WARN([cross compiling: not checking /etc/default/login])
3474 etc_default_login=no
3476 etc_default_login=yes
3480 if test "x$etc_default_login" != "xno"; then
3481 AC_CHECK_FILE("/etc/default/login",
3482 [ external_path_file=/etc/default/login ])
3483 if test "x$external_path_file" = "x/etc/default/login"; then
3484 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1,
3485 [Define if your system has /etc/default/login])
3489 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
3490 if test $ac_cv_func_login_getcapbool = "yes" && \
3491 test $ac_cv_header_login_cap_h = "yes" ; then
3492 external_path_file=/etc/login.conf
3495 # Whether to mess with the default path
3496 SERVER_PATH_MSG="(default)"
3497 AC_ARG_WITH(default-path,
3498 [ --with-default-path= Specify default \$PATH environment for server],
3500 if test "x$external_path_file" = "x/etc/login.conf" ; then
3502 --with-default-path=PATH has no effect on this system.
3503 Edit /etc/login.conf instead.])
3504 elif test "x$withval" != "xno" ; then
3505 if test ! -z "$external_path_file" ; then
3507 --with-default-path=PATH will only be used if PATH is not defined in
3508 $external_path_file .])
3510 user_path="$withval"
3511 SERVER_PATH_MSG="$withval"
3514 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
3515 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
3517 if test ! -z "$external_path_file" ; then
3519 If PATH is defined in $external_path_file, ensure the path to scp is included,
3520 otherwise scp will not work.])
3524 /* find out what STDPATH is */
3529 #ifndef _PATH_STDPATH
3530 # ifdef _PATH_USERPATH /* Irix */
3531 # define _PATH_STDPATH _PATH_USERPATH
3533 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
3536 #include <sys/types.h>
3537 #include <sys/stat.h>
3539 #define DATA "conftest.stdpath"
3546 fd = fopen(DATA,"w");
3550 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
3556 [ user_path=`cat conftest.stdpath` ],
3557 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
3558 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
3560 # make sure $bindir is in USER_PATH so scp will work
3561 t_bindir=`eval echo ${bindir}`
3563 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
3566 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
3568 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
3569 if test $? -ne 0 ; then
3570 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
3571 if test $? -ne 0 ; then
3572 user_path=$user_path:$t_bindir
3573 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
3578 if test "x$external_path_file" != "x/etc/login.conf" ; then
3579 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path", [Specify default $PATH])
3583 # Set superuser path separately to user path
3584 AC_ARG_WITH(superuser-path,
3585 [ --with-superuser-path= Specify different path for super-user],
3587 if test -n "$withval" && test "x$withval" != "xno" && \
3588 test "x${withval}" != "xyes"; then
3589 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval",
3590 [Define if you want a different $PATH
3592 superuser_path=$withval
3598 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
3599 IPV4_IN6_HACK_MSG="no"
3601 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
3603 if test "x$withval" != "xno" ; then
3605 AC_DEFINE(IPV4_IN_IPV6, 1,
3606 [Detect IPv4 in IPv6 mapped addresses
3608 IPV4_IN6_HACK_MSG="yes"
3613 if test "x$inet6_default_4in6" = "xyes"; then
3614 AC_MSG_RESULT([yes (default)])
3615 AC_DEFINE(IPV4_IN_IPV6)
3616 IPV4_IN6_HACK_MSG="yes"
3618 AC_MSG_RESULT([no (default)])
3623 # Whether to enable BSD auth support
3625 AC_ARG_WITH(bsd-auth,
3626 [ --with-bsd-auth Enable BSD auth support],
3628 if test "x$withval" != "xno" ; then
3629 AC_DEFINE(BSD_AUTH, 1,
3630 [Define if you have BSD auth support])
3636 # Where to place sshd.pid
3638 # make sure the directory exists
3639 if test ! -d $piddir ; then
3640 piddir=`eval echo ${sysconfdir}`
3642 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
3646 AC_ARG_WITH(pid-dir,
3647 [ --with-pid-dir=PATH Specify location of ssh.pid file],
3649 if test -n "$withval" && test "x$withval" != "xno" && \
3650 test "x${withval}" != "xyes"; then
3652 if test ! -d $piddir ; then
3653 AC_MSG_WARN([** no $piddir directory on this system **])
3659 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir", [Specify location of ssh.pid])
3662 dnl allow user to disable some login recording features
3663 AC_ARG_ENABLE(lastlog,
3664 [ --disable-lastlog disable use of lastlog even if detected [no]],
3666 if test "x$enableval" = "xno" ; then
3667 AC_DEFINE(DISABLE_LASTLOG)
3672 [ --disable-utmp disable use of utmp even if detected [no]],
3674 if test "x$enableval" = "xno" ; then
3675 AC_DEFINE(DISABLE_UTMP)
3679 AC_ARG_ENABLE(utmpx,
3680 [ --disable-utmpx disable use of utmpx even if detected [no]],
3682 if test "x$enableval" = "xno" ; then
3683 AC_DEFINE(DISABLE_UTMPX, 1,
3684 [Define if you don't want to use utmpx])
3689 [ --disable-wtmp disable use of wtmp even if detected [no]],
3691 if test "x$enableval" = "xno" ; then
3692 AC_DEFINE(DISABLE_WTMP)
3696 AC_ARG_ENABLE(wtmpx,
3697 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
3699 if test "x$enableval" = "xno" ; then
3700 AC_DEFINE(DISABLE_WTMPX, 1,
3701 [Define if you don't want to use wtmpx])
3705 AC_ARG_ENABLE(libutil,
3706 [ --disable-libutil disable use of libutil (login() etc.) [no]],
3708 if test "x$enableval" = "xno" ; then
3709 AC_DEFINE(DISABLE_LOGIN)
3713 AC_ARG_ENABLE(pututline,
3714 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
3716 if test "x$enableval" = "xno" ; then
3717 AC_DEFINE(DISABLE_PUTUTLINE, 1,
3718 [Define if you don't want to use pututline()
3719 etc. to write [uw]tmp])
3723 AC_ARG_ENABLE(pututxline,
3724 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
3726 if test "x$enableval" = "xno" ; then
3727 AC_DEFINE(DISABLE_PUTUTXLINE, 1,
3728 [Define if you don't want to use pututxline()
3729 etc. to write [uw]tmpx])
3733 AC_ARG_WITH(lastlog,
3734 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
3736 if test "x$withval" = "xno" ; then
3737 AC_DEFINE(DISABLE_LASTLOG)
3738 elif test -n "$withval" && test "x${withval}" != "xyes"; then
3739 conf_lastlog_location=$withval
3744 dnl lastlog, [uw]tmpx? detection
3745 dnl NOTE: set the paths in the platform section to avoid the
3746 dnl need for command-line parameters
3747 dnl lastlog and [uw]tmp are subject to a file search if all else fails
3749 dnl lastlog detection
3750 dnl NOTE: the code itself will detect if lastlog is a directory
3751 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
3753 #include <sys/types.h>
3755 #ifdef HAVE_LASTLOG_H
3756 # include <lastlog.h>
3765 [ char *lastlog = LASTLOG_FILE; ],
3766 [ AC_MSG_RESULT(yes) ],
3769 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
3771 #include <sys/types.h>
3773 #ifdef HAVE_LASTLOG_H
3774 # include <lastlog.h>
3780 [ char *lastlog = _PATH_LASTLOG; ],
3781 [ AC_MSG_RESULT(yes) ],
3784 system_lastlog_path=no
3789 if test -z "$conf_lastlog_location"; then
3790 if test x"$system_lastlog_path" = x"no" ; then
3791 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
3792 if (test -d "$f" || test -f "$f") ; then
3793 conf_lastlog_location=$f
3796 if test -z "$conf_lastlog_location"; then
3797 AC_MSG_WARN([** Cannot find lastlog **])
3798 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
3803 if test -n "$conf_lastlog_location"; then
3804 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location",
3805 [Define if you want to specify the path to your lastlog file])
3809 AC_MSG_CHECKING([if your system defines UTMP_FILE])
3811 #include <sys/types.h>
3817 [ char *utmp = UTMP_FILE; ],
3818 [ AC_MSG_RESULT(yes) ],
3820 system_utmp_path=no ]
3822 if test -z "$conf_utmp_location"; then
3823 if test x"$system_utmp_path" = x"no" ; then
3824 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3825 if test -f $f ; then
3826 conf_utmp_location=$f
3829 if test -z "$conf_utmp_location"; then
3830 AC_DEFINE(DISABLE_UTMP)
3834 if test -n "$conf_utmp_location"; then
3835 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location",
3836 [Define if you want to specify the path to your utmp file])
3840 AC_MSG_CHECKING([if your system defines WTMP_FILE])
3842 #include <sys/types.h>
3848 [ char *wtmp = WTMP_FILE; ],
3849 [ AC_MSG_RESULT(yes) ],
3851 system_wtmp_path=no ]
3853 if test -z "$conf_wtmp_location"; then
3854 if test x"$system_wtmp_path" = x"no" ; then
3855 for f in /usr/adm/wtmp /var/log/wtmp; do
3856 if test -f $f ; then
3857 conf_wtmp_location=$f
3860 if test -z "$conf_wtmp_location"; then
3861 AC_DEFINE(DISABLE_WTMP)
3865 if test -n "$conf_wtmp_location"; then
3866 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location",
3867 [Define if you want to specify the path to your wtmp file])
3871 dnl utmpx detection - I don't know any system so perverse as to require
3872 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3874 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3876 #include <sys/types.h>
3885 [ char *utmpx = UTMPX_FILE; ],
3886 [ AC_MSG_RESULT(yes) ],
3888 system_utmpx_path=no ]
3890 if test -z "$conf_utmpx_location"; then
3891 if test x"$system_utmpx_path" = x"no" ; then
3892 AC_DEFINE(DISABLE_UTMPX)
3895 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location",
3896 [Define if you want to specify the path to your utmpx file])
3900 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3902 #include <sys/types.h>
3911 [ char *wtmpx = WTMPX_FILE; ],
3912 [ AC_MSG_RESULT(yes) ],
3914 system_wtmpx_path=no ]
3916 if test -z "$conf_wtmpx_location"; then
3917 if test x"$system_wtmpx_path" = x"no" ; then
3918 AC_DEFINE(DISABLE_WTMPX)
3921 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location",
3922 [Define if you want to specify the path to your wtmpx file])
3926 if test ! -z "$blibpath" ; then
3927 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3928 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3931 dnl remove pam and dl because they are in $LIBPAM
3932 if test "$PAM_MSG" = yes ; then
3933 LIBS=`echo $LIBS | sed 's/-lpam //'`
3935 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3936 LIBS=`echo $LIBS | sed 's/-ldl //'`
3939 dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3941 CFLAGS="$CFLAGS $werror_flags"
3944 AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3945 scard/Makefile ssh_prng_cmds survey.sh])
3948 # Print summary of options
3950 # Someone please show me a better way :)
3951 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3952 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3953 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3954 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
3955 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
3956 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
3957 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
3958 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3959 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3960 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
3963 echo "OpenSSH has been configured with the following options:"
3964 echo " User binaries: $B"
3965 echo " System binaries: $C"
3966 echo " Configuration files: $D"
3967 echo " Askpass program: $E"
3968 echo " Manual pages: $F"
3969 echo " PID file: $G"
3970 echo " Privilege separation chroot path: $H"
3971 if test "x$external_path_file" = "x/etc/login.conf" ; then
3972 echo " At runtime, sshd will use the path defined in $external_path_file"
3973 echo " Make sure the path to scp is present, otherwise scp will not work"
3975 echo " sshd default user PATH: $I"
3976 if test ! -z "$external_path_file"; then
3977 echo " (If PATH is set in $external_path_file it will be used instead. If"
3978 echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3981 if test ! -z "$superuser_path" ; then
3982 echo " sshd superuser user PATH: $J"
3984 echo " Manpage format: $MANTYPE"
3985 echo " PAM support: $PAM_MSG"
3986 echo " KerberosV support: $KRB5_MSG"
3987 echo " Smartcard support: $SCARD_MSG"
3988 echo " S/KEY support: $SKEY_MSG"
3989 echo " TCP Wrappers support: $TCPW_MSG"
3990 echo " MD5 password support: $MD5_MSG"
3991 echo " libedit support: $LIBEDIT_MSG"
3992 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
3993 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3994 echo " BSD Auth support: $BSD_AUTH_MSG"
3995 echo " Random number source: $RAND_MSG"
3996 if test ! -z "$USE_RAND_HELPER" ; then
3997 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
4002 echo " Host: ${host}"
4003 echo " Compiler: ${CC}"
4004 echo " Compiler flags: ${CFLAGS}"
4005 echo "Preprocessor flags: ${CPPFLAGS}"
4006 echo " Linker flags: ${LDFLAGS}"
4007 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
4011 if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
4012 echo "SVR4 style packages are supported with \"make package\""
4016 if test "x$PAM_MSG" = "xyes" ; then
4017 echo "PAM is enabled. You may need to install a PAM control file "
4018 echo "for sshd, otherwise password authentication may fail. "
4019 echo "Example PAM control files can be found in the contrib/ "
4024 if test ! -z "$RAND_HELPER_CMDHASH" ; then
4025 echo "WARNING: you are using the builtin random number collection "
4026 echo "service. Please read WARNING.RNG and request that your OS "
4027 echo "vendor includes kernel-based random number collection in "
4028 echo "future versions of your OS."
4032 if test ! -z "$NO_PEERCHECK" ; then
4033 echo "WARNING: the operating system that you are using does not "
4034 echo "appear to support either the getpeereid() API nor the "
4035 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
4036 echo "enforce security checks to prevent unauthorised connections to "
4037 echo "ssh-agent. Their absence increases the risk that a malicious "
4038 echo "user can connect to your agent. "
4042 if test "$AUDIT_MODULE" = "bsm" ; then
4043 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
4044 echo "See the Solaris section in README.platform for details."