1 # $Id: configure.ac,v 1.471 2011/01/26 20:38:58 tim Exp $
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: 1.471 $)
19 AC_CONFIG_SRCDIR([ssh.c])
23 AC_DEFUN([OPENSSH_CHECK_CFLAG_COMPILE], [{
24 AC_MSG_CHECKING([if $CC supports $1])
25 saved_CFLAGS="$CFLAGS"
27 AC_COMPILE_IFELSE([void main(void) { return 0; }],
28 [ AC_MSG_RESULT([yes]) ],
30 CFLAGS="$saved_CFLAGS" ]
34 AC_CONFIG_HEADER([config.h])
39 # Checks for programs.
45 AC_PATH_PROG([AR], [ar])
46 AC_PATH_PROG([CAT], [cat])
47 AC_PATH_PROG([KILL], [kill])
48 AC_PATH_PROGS([PERL], [perl5 perl])
49 AC_PATH_PROG([SED], [sed])
51 AC_PATH_PROG([ENT], [ent])
53 AC_PATH_PROG([TEST_MINUS_S_SH], [bash])
54 AC_PATH_PROG([TEST_MINUS_S_SH], [ksh])
55 AC_PATH_PROG([TEST_MINUS_S_SH], [sh])
56 AC_PATH_PROG([SH], [sh])
57 AC_PATH_PROG([GROFF], [groff])
58 AC_PATH_PROG([NROFF], [nroff])
59 AC_PATH_PROG([MANDOC], [mandoc])
60 AC_SUBST([TEST_SHELL], [sh])
62 dnl select manpage formatter
63 if test "x$MANDOC" != "x" ; then
65 elif test "x$NROFF" != "x" ; then
66 MANFMT="$NROFF -mandoc"
67 elif test "x$GROFF" != "x" ; then
68 MANFMT="$GROFF -mandoc -Tascii"
70 AC_MSG_WARN([no manpage formatted found])
76 AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd],
77 [/usr/sbin${PATH_SEPARATOR}/etc])
78 AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd],
79 [/usr/sbin${PATH_SEPARATOR}/etc])
80 AC_CHECK_PROG([MAKE_PACKAGE_SUPPORTED], [pkgmk], [yes], [no])
81 if test -x /sbin/sh; then
82 AC_SUBST([STARTUP_SCRIPT_SHELL], [/sbin/sh])
84 AC_SUBST([STARTUP_SCRIPT_SHELL], [/bin/sh])
90 if test -z "$AR" ; then
91 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
94 # Use LOGIN_PROGRAM from environment if possible
95 if test ! -z "$LOGIN_PROGRAM" ; then
96 AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM"],
97 [If your header files don't define LOGIN_PROGRAM,
98 then use this (detected) from environment and PATH])
101 AC_PATH_PROG([LOGIN_PROGRAM_FALLBACK], [login])
102 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
103 AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM_FALLBACK"])
107 AC_PATH_PROG([PATH_PASSWD_PROG], [passwd])
108 if test ! -z "$PATH_PASSWD_PROG" ; then
109 AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"],
110 [Full path of your "passwd" program])
113 if test -z "$LD" ; then
120 AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>])
122 use_stack_protector=1
123 AC_ARG_WITH([stackprotect],
124 [ --without-stackprotect Don't use compiler's stack protection], [
125 if test "x$withval" = "xno"; then
126 use_stack_protector=0
130 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
131 OPENSSH_CHECK_CFLAG_COMPILE([-Wall])
132 OPENSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith])
133 OPENSSH_CHECK_CFLAG_COMPILE([-Wuninitialized])
134 OPENSSH_CHECK_CFLAG_COMPILE([-Wsign-compare])
135 OPENSSH_CHECK_CFLAG_COMPILE([-Wformat-security])
136 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-pointer-sign])
137 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-unused-result])
138 OPENSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing])
139 AC_MSG_CHECKING([gcc version])
140 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
142 1.*) no_attrib_nonnull=1 ;;
146 2.*) no_attrib_nonnull=1 ;;
149 AC_MSG_RESULT([$GCC_VER])
151 AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset])
152 saved_CFLAGS="$CFLAGS"
153 CFLAGS="$CFLAGS -fno-builtin-memset"
154 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]],
155 [[ char b[10]; memset(b, 0, sizeof(b)); ]])],
156 [ AC_MSG_RESULT([yes]) ],
157 [ AC_MSG_RESULT([no])
158 CFLAGS="$saved_CFLAGS" ]
161 # -fstack-protector-all doesn't always work for some GCC versions
162 # and/or platforms, so we test if we can. If it's not supported
163 # on a given platform gcc will emit a warning so we use -Werror.
164 if test "x$use_stack_protector" = "x1"; then
165 for t in -fstack-protector-all -fstack-protector; do
166 AC_MSG_CHECKING([if $CC supports $t])
167 saved_CFLAGS="$CFLAGS"
168 saved_LDFLAGS="$LDFLAGS"
169 CFLAGS="$CFLAGS $t -Werror"
170 LDFLAGS="$LDFLAGS $t -Werror"
172 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
175 snprintf(x, sizeof(x), "XXX");
177 [ AC_MSG_RESULT([yes])
178 CFLAGS="$saved_CFLAGS $t"
179 LDFLAGS="$saved_LDFLAGS $t"
180 AC_MSG_CHECKING([if $t works])
182 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
185 snprintf(x, sizeof(x), "XXX");
187 [ AC_MSG_RESULT([yes])
189 [ AC_MSG_RESULT([no]) ],
190 [ AC_MSG_WARN([cross compiling: cannot test])
194 [ AC_MSG_RESULT([no]) ]
196 CFLAGS="$saved_CFLAGS"
197 LDFLAGS="$saved_LDFLAGS"
201 if test -z "$have_llong_max"; then
202 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
203 unset ac_cv_have_decl_LLONG_MAX
204 saved_CFLAGS="$CFLAGS"
205 CFLAGS="$CFLAGS -std=gnu99"
206 AC_CHECK_DECL([LLONG_MAX],
208 [CFLAGS="$saved_CFLAGS"],
209 [#include <limits.h>]
214 if test "x$no_attrib_nonnull" != "x1" ; then
215 AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull])
219 [ --without-rpath Disable auto-added -R linker paths],
221 if test "x$withval" = "xno" ; then
224 if test "x$withval" = "xyes" ; then
230 # Allow user to specify flags
231 AC_ARG_WITH([cflags],
232 [ --with-cflags Specify additional flags to pass to compiler],
234 if test -n "$withval" && test "x$withval" != "xno" && \
235 test "x${withval}" != "xyes"; then
236 CFLAGS="$CFLAGS $withval"
240 AC_ARG_WITH([cppflags],
241 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
243 if test -n "$withval" && test "x$withval" != "xno" && \
244 test "x${withval}" != "xyes"; then
245 CPPFLAGS="$CPPFLAGS $withval"
249 AC_ARG_WITH([ldflags],
250 [ --with-ldflags Specify additional flags to pass to linker],
252 if test -n "$withval" && test "x$withval" != "xno" && \
253 test "x${withval}" != "xyes"; then
254 LDFLAGS="$LDFLAGS $withval"
259 [ --with-libs Specify additional libraries to link with],
261 if test -n "$withval" && test "x$withval" != "xno" && \
262 test "x${withval}" != "xyes"; then
263 LIBS="$LIBS $withval"
267 AC_ARG_WITH([Werror],
268 [ --with-Werror Build main code with -Werror],
270 if test -n "$withval" && test "x$withval" != "xno"; then
271 werror_flags="-Werror"
272 if test "x${withval}" != "xyes"; then
273 werror_flags="$withval"
305 security/pam_appl.h \
345 # lastlog.h requires sys/time.h to be included first on Solaris
346 AC_CHECK_HEADERS([lastlog.h], [], [], [
347 #ifdef HAVE_SYS_TIME_H
348 # include <sys/time.h>
352 # sys/ptms.h requires sys/stream.h to be included first on Solaris
353 AC_CHECK_HEADERS([sys/ptms.h], [], [], [
354 #ifdef HAVE_SYS_STREAM_H
355 # include <sys/stream.h>
359 # login_cap.h requires sys/types.h on NetBSD
360 AC_CHECK_HEADERS([login_cap.h], [], [], [
361 #include <sys/types.h>
364 # older BSDs need sys/param.h before sys/mount.h
365 AC_CHECK_HEADERS([sys/mount.h], [], [], [
366 #include <sys/param.h>
369 # Messages for features tested for in target-specific section
374 # Check for some target-specific stuff
377 # Some versions of VAC won't allow macro redefinitions at
378 # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that
379 # particularly with older versions of vac or xlc.
380 # It also throws errors about null macro argments, but these are
382 AC_MSG_CHECKING([if compiler allows macro redefinitions])
385 #define testmacro foo
386 #define testmacro bar]],
388 [ AC_MSG_RESULT([yes]) ],
389 [ AC_MSG_RESULT([no])
390 CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
391 LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`"
392 CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`"
393 CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`"
397 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
398 if (test -z "$blibpath"); then
399 blibpath="/usr/lib:/lib"
401 saved_LDFLAGS="$LDFLAGS"
402 if test "$GCC" = "yes"; then
403 flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:"
405 flags="-blibpath: -Wl,-blibpath: -Wl,-rpath,"
407 for tryflags in $flags ;do
408 if (test -z "$blibflags"); then
409 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
410 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
411 [blibflags=$tryflags], [])
414 if (test -z "$blibflags"); then
415 AC_MSG_RESULT([not found])
416 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
418 AC_MSG_RESULT([$blibflags])
420 LDFLAGS="$saved_LDFLAGS"
421 dnl Check for authenticate. Might be in libs.a on older AIXes
422 AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1],
423 [Define if you want to enable AIX4's authenticate function])],
424 [AC_CHECK_LIB([s], [authenticate],
425 [ AC_DEFINE([WITH_AIXAUTHENTICATE])
429 dnl Check for various auth function declarations in headers.
430 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
431 passwdexpired, setauthdb], , , [#include <usersec.h>])
432 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
433 AC_CHECK_DECLS([loginfailed],
434 [AC_MSG_CHECKING([if loginfailed takes 4 arguments])
435 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]],
436 [[ (void)loginfailed("user","host","tty",0); ]])],
437 [AC_MSG_RESULT([yes])
438 AC_DEFINE([AIX_LOGINFAILED_4ARG], [1],
439 [Define if your AIX loginfailed() function
440 takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no])
443 [#include <usersec.h>]
445 AC_CHECK_FUNCS([getgrset setauthdb])
446 AC_CHECK_DECL([F_CLOSEM],
447 AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]),
449 [ #include <limits.h>
452 check_for_aix_broken_getaddrinfo=1
453 AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.])
454 AC_DEFINE([SETEUID_BREAKS_SETUID], [1],
455 [Define if your platform breaks doing a seteuid before a setuid])
456 AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken])
457 AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken])
458 dnl AIX handles lastlog as part of its login message
459 AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog])
460 AC_DEFINE([LOGIN_NEEDS_UTMPX], [1],
461 [Some systems need a utmpx entry for /bin/login to work])
462 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV],
463 [Define to a Set Process Title type if your system is
464 supported by bsd-setproctitle.c])
465 AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1],
466 [AIX 5.2 and 5.3 (and presumably newer) require this])
467 AC_DEFINE([PTY_ZEROREAD], [1], [read(1) can return 0 for a non-closed fd])
470 check_for_libcrypt_later=1
471 LIBS="$LIBS /usr/lib/textreadmode.o"
472 AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin])
473 AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()])
474 AC_DEFINE([DISABLE_SHADOW], [1],
475 [Define if you want to disable shadow passwords])
476 AC_DEFINE([NO_X11_UNIX_SOCKETS], [1],
477 [Define if X11 doesn't support AF_UNIX sockets on that system])
478 AC_DEFINE([NO_IPPORT_RESERVED_CONCEPT], [1],
479 [Define if the concept of ports only accessible to
480 superusers isn't known])
481 AC_DEFINE([DISABLE_FD_PASSING], [1],
482 [Define if your platform needs to skip post auth
483 file descriptor passing])
484 AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size])
485 AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters])
488 AC_DEFINE([IP_TOS_IS_BROKEN], [1],
489 [Define if your system choked on IP TOS setting])
490 AC_DEFINE([SETEUID_BREAKS_SETUID])
491 AC_DEFINE([BROKEN_SETREUID])
492 AC_DEFINE([BROKEN_SETREGID])
495 AC_MSG_CHECKING([if we have working getaddrinfo])
496 AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h>
497 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
503 [AC_MSG_RESULT([working])],
504 [AC_MSG_RESULT([buggy])
505 AC_DEFINE([BROKEN_GETADDRINFO], [1],
506 [getaddrinfo is broken (if present)])
508 [AC_MSG_RESULT([assume it is working])])
509 AC_DEFINE([SETEUID_BREAKS_SETUID])
510 AC_DEFINE([BROKEN_SETREUID])
511 AC_DEFINE([BROKEN_SETREGID])
512 AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect])
513 AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1],
514 [Define if your resolver libs need this for getrrsetbyname])
515 AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
516 AC_DEFINE([SSH_TUN_COMPAT_AF], [1],
517 [Use tunnel device compatibility to OpenBSD])
518 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
519 [Prepend the address family to IP tunnel traffic])
520 m4_pattern_allow([AU_IPv])
521 AC_CHECK_DECL([AU_IPv4], [],
522 AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records])
523 [#include <bsm/audit.h>]
524 AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1],
525 [Define if pututxline updates lastlog too])
529 SSHDLIBS="$SSHDLIBS -lcrypt"
533 AC_CHECK_LIB([network], [socket])
534 AC_DEFINE([HAVE_U_INT64_T])
538 # first we define all of the options common to all HP-UX releases
539 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
540 IPADDR_IN_DISPLAY=yes
541 AC_DEFINE([USE_PIPES])
542 AC_DEFINE([LOGIN_NO_ENDOPT], [1],
543 [Define if your login program cannot handle end of options ("--")])
544 AC_DEFINE([LOGIN_NEEDS_UTMPX])
545 AC_DEFINE([LOCKED_PASSWD_STRING], ["*"],
546 [String used in /etc/passwd to denote locked account])
547 AC_DEFINE([SPT_TYPE], [SPT_PSTAT])
548 MAIL="/var/mail/username"
550 AC_CHECK_LIB([xnet], [t_error], ,
551 [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])])
553 # next, we define all of the options specific to major releases
556 if test -z "$GCC"; then
561 AC_DEFINE([PAM_SUN_CODEBASE], [1],
562 [Define if you are using Solaris-derived PAM which
563 passes pam_messages to the conversation function
564 with an extra level of indirection])
565 AC_DEFINE([DISABLE_UTMP], [1],
566 [Define if you don't want to use utmp])
567 AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins])
568 check_for_hpux_broken_getaddrinfo=1
569 check_for_conflicting_getspnam=1
573 # lastly, we define options specific to minor releases
576 AC_DEFINE([HAVE_SECUREWARE], [1],
577 [Define if you have SecureWare-based
578 protected password database])
579 disable_ptmx_check=yes
585 PATH="$PATH:/usr/etc"
586 AC_DEFINE([BROKEN_INET_NTOA], [1],
587 [Define if you system's inet_ntoa is busted
588 (e.g. Irix gcc issue)])
589 AC_DEFINE([SETEUID_BREAKS_SETUID])
590 AC_DEFINE([BROKEN_SETREUID])
591 AC_DEFINE([BROKEN_SETREGID])
592 AC_DEFINE([WITH_ABBREV_NO_TTY], [1],
593 [Define if you shouldn't strip 'tty' from your
595 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
598 PATH="$PATH:/usr/etc"
599 AC_DEFINE([WITH_IRIX_ARRAY], [1],
600 [Define if you have/want arrays
601 (cluster-wide session managment, not C arrays)])
602 AC_DEFINE([WITH_IRIX_PROJECT], [1],
603 [Define if you want IRIX project management])
604 AC_DEFINE([WITH_IRIX_AUDIT], [1],
605 [Define if you want IRIX audit trails])
606 AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1],
607 [Define if you want IRIX kernel jobs])])
608 AC_DEFINE([BROKEN_INET_NTOA])
609 AC_DEFINE([SETEUID_BREAKS_SETUID])
610 AC_DEFINE([BROKEN_SETREUID])
611 AC_DEFINE([BROKEN_SETREGID])
612 AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)])
613 AC_DEFINE([WITH_ABBREV_NO_TTY])
614 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
616 *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
617 check_for_libcrypt_later=1
618 AC_DEFINE([PAM_TTY_KLUDGE])
619 AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"])
620 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
621 AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts])
622 AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins])
626 check_for_libcrypt_later=1
627 check_for_openpty_ctty_bug=1
628 AC_DEFINE([PAM_TTY_KLUDGE], [1],
629 [Work around problematic Linux PAM modules handling of PAM_TTY])
630 AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"],
631 [String used in /etc/passwd to denote locked account])
632 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
633 AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM],
634 [Define to whatever link() returns for "not supported"
635 if it doesn't return EOPNOTSUPP.])
636 AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts])
637 AC_DEFINE([USE_BTMP])
638 AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer])
639 inet6_default_4in6=yes
642 AC_DEFINE([BROKEN_CMSG_TYPE], [1],
643 [Define if cmsg_type is not passed correctly])
646 # tun(4) forwarding compat code
647 AC_CHECK_HEADERS([linux/if_tun.h])
648 if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then
649 AC_DEFINE([SSH_TUN_LINUX], [1],
650 [Open tunnel devices the Linux tun/tap way])
651 AC_DEFINE([SSH_TUN_COMPAT_AF], [1],
652 [Use tunnel device compatibility to OpenBSD])
653 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
654 [Prepend the address family to IP tunnel traffic])
657 mips-sony-bsd|mips-sony-newsos4)
658 AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty])
662 check_for_libcrypt_before=1
663 if test "x$withval" != "xno" ; then
666 AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
667 AC_CHECK_HEADER([net/if_tap.h], ,
668 AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support]))
669 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
670 [Prepend the address family to IP tunnel traffic])
673 check_for_libcrypt_later=1
674 AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)])
675 AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
676 AC_CHECK_HEADER([net/if_tap.h], ,
677 AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support]))
678 AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need])
681 AC_DEFINE([SETEUID_BREAKS_SETUID])
682 AC_DEFINE([BROKEN_SETREUID])
683 AC_DEFINE([BROKEN_SETREGID])
686 conf_lastlog_location="/usr/adm/lastlog"
687 conf_utmp_location=/etc/utmp
688 conf_wtmp_location=/usr/adm/wtmp
690 AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT])
691 AC_DEFINE([BROKEN_REALPATH])
692 AC_DEFINE([USE_PIPES])
693 AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT])
696 AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel])
697 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded])
698 AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way])
699 AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1],
700 [syslog_r function is safe to use in in a signal handler])
703 if test "x$withval" != "xno" ; then
706 AC_DEFINE([PAM_SUN_CODEBASE])
707 AC_DEFINE([LOGIN_NEEDS_UTMPX])
708 AC_DEFINE([LOGIN_NEEDS_TERM], [1],
709 [Some versions of /bin/login need the TERM supplied
711 AC_DEFINE([PAM_TTY_KLUDGE])
712 AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1],
713 [Define if pam_chauthtok wants real uid set
714 to the unpriv'ed user])
715 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
716 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
717 AC_DEFINE([SSHD_ACQUIRES_CTTY], [1],
718 [Define if sshd somehow reacquires a controlling TTY
720 AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd
721 in case the name is longer than 8 chars])
722 AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang])
723 external_path_file=/etc/default/login
724 # hardwire lastlog location (can't detect it on some versions)
725 conf_lastlog_location="/var/adm/lastlog"
726 AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x])
727 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
728 if test "$sol2ver" -ge 8; then
730 AC_DEFINE([DISABLE_UTMP])
731 AC_DEFINE([DISABLE_WTMP], [1],
732 [Define if you don't want to use wtmp])
736 AC_ARG_WITH([solaris-contracts],
737 [ --with-solaris-contracts Enable Solaris process contracts (experimental)],
739 AC_CHECK_LIB([contract], [ct_tmpl_activate],
740 [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1],
741 [Define if you have Solaris process contracts])
742 SSHDLIBS="$SSHDLIBS -lcontract"
746 AC_ARG_WITH([solaris-projects],
747 [ --with-solaris-projects Enable Solaris projects (experimental)],
749 AC_CHECK_LIB([project], [setproject],
750 [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1],
751 [Define if you have Solaris projects])
752 SSHDLIBS="$SSHDLIBS -lproject"
758 CPPFLAGS="$CPPFLAGS -DSUNOS4"
759 AC_CHECK_FUNCS([getpwanam])
760 AC_DEFINE([PAM_SUN_CODEBASE])
761 conf_utmp_location=/etc/utmp
762 conf_wtmp_location=/var/adm/wtmp
763 conf_lastlog_location=/var/adm/lastlog
764 AC_DEFINE([USE_PIPES])
768 AC_DEFINE([USE_PIPES])
769 AC_DEFINE([SSHD_ACQUIRES_CTTY])
770 AC_DEFINE([SETEUID_BREAKS_SETUID])
771 AC_DEFINE([BROKEN_SETREUID])
772 AC_DEFINE([BROKEN_SETREGID])
775 # /usr/ucblib MUST NOT be searched on ReliantUNIX
776 AC_CHECK_LIB([dl], [dlsym], ,)
777 # -lresolv needs to be at the end of LIBS or DNS lookups break
778 AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ])
779 IPADDR_IN_DISPLAY=yes
780 AC_DEFINE([USE_PIPES])
781 AC_DEFINE([IP_TOS_IS_BROKEN])
782 AC_DEFINE([SETEUID_BREAKS_SETUID])
783 AC_DEFINE([BROKEN_SETREUID])
784 AC_DEFINE([BROKEN_SETREGID])
785 AC_DEFINE([SSHD_ACQUIRES_CTTY])
786 external_path_file=/etc/default/login
787 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
788 # Attention: always take care to bind libsocket and libnsl before libc,
789 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
791 # UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
793 AC_DEFINE([USE_PIPES])
794 AC_DEFINE([SETEUID_BREAKS_SETUID])
795 AC_DEFINE([BROKEN_SETREUID])
796 AC_DEFINE([BROKEN_SETREGID])
797 AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd])
798 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
800 # UnixWare 7.x, OpenUNIX 8
802 CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf"
803 AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars])
804 AC_DEFINE([USE_PIPES])
805 AC_DEFINE([SETEUID_BREAKS_SETUID])
806 AC_DEFINE([BROKEN_GETADDRINFO])
807 AC_DEFINE([BROKEN_SETREUID])
808 AC_DEFINE([BROKEN_SETREGID])
809 AC_DEFINE([PASSWD_NEEDS_USERNAME])
811 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
812 TEST_SHELL=/u95/bin/sh
813 AC_DEFINE([BROKEN_LIBIAF], [1],
814 [ia_uinfo routines not supported by OS yet])
815 AC_DEFINE([BROKEN_UPDWTMPX])
816 AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot"
817 AC_CHECK_FUNCS([getluid setluid], , , [-lprot])
818 AC_DEFINE([HAVE_SECUREWARE])
819 AC_DEFINE([DISABLE_SHADOW])
822 *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
823 check_for_libcrypt_later=1
829 # SCO UNIX and OEM versions of SCO UNIX
831 AC_MSG_ERROR("This Platform is no longer supported.")
835 if test -z "$GCC"; then
836 CFLAGS="$CFLAGS -belf"
838 LIBS="$LIBS -lprot -lx -ltinfo -lm"
840 AC_DEFINE([USE_PIPES])
841 AC_DEFINE([HAVE_SECUREWARE])
842 AC_DEFINE([DISABLE_SHADOW])
843 AC_DEFINE([DISABLE_FD_PASSING])
844 AC_DEFINE([SETEUID_BREAKS_SETUID])
845 AC_DEFINE([BROKEN_GETADDRINFO])
846 AC_DEFINE([BROKEN_SETREUID])
847 AC_DEFINE([BROKEN_SETREGID])
848 AC_DEFINE([WITH_ABBREV_NO_TTY])
849 AC_DEFINE([BROKEN_UPDWTMPX])
850 AC_DEFINE([PASSWD_NEEDS_USERNAME])
851 AC_CHECK_FUNCS([getluid setluid])
856 AC_DEFINE([NO_SSH_LASTLOG], [1],
857 [Define if you don't want to use lastlog in session.c])
858 AC_DEFINE([SETEUID_BREAKS_SETUID])
859 AC_DEFINE([BROKEN_SETREUID])
860 AC_DEFINE([BROKEN_SETREGID])
861 AC_DEFINE([USE_PIPES])
862 AC_DEFINE([DISABLE_FD_PASSING])
864 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
868 AC_DEFINE([SETEUID_BREAKS_SETUID])
869 AC_DEFINE([BROKEN_SETREUID])
870 AC_DEFINE([BROKEN_SETREGID])
871 AC_DEFINE([WITH_ABBREV_NO_TTY])
872 AC_DEFINE([USE_PIPES])
873 AC_DEFINE([DISABLE_FD_PASSING])
875 LIBS="$LIBS -lgen -lacid -ldb"
879 AC_DEFINE([SETEUID_BREAKS_SETUID])
880 AC_DEFINE([BROKEN_SETREUID])
881 AC_DEFINE([BROKEN_SETREGID])
882 AC_DEFINE([USE_PIPES])
883 AC_DEFINE([DISABLE_FD_PASSING])
884 AC_DEFINE([NO_SSH_LASTLOG])
885 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
886 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
890 AC_MSG_CHECKING([for Digital Unix SIA])
892 AC_ARG_WITH([osfsia],
893 [ --with-osfsia Enable Digital Unix SIA],
895 if test "x$withval" = "xno" ; then
896 AC_MSG_RESULT([disabled])
901 if test -z "$no_osfsia" ; then
902 if test -f /etc/sia/matrix.conf; then
904 AC_DEFINE([HAVE_OSF_SIA], [1],
905 [Define if you have Digital Unix Security
906 Integration Architecture])
907 AC_DEFINE([DISABLE_LOGIN], [1],
908 [Define if you don't want to use your
909 system's login() call])
910 AC_DEFINE([DISABLE_FD_PASSING])
911 LIBS="$LIBS -lsecurity -ldb -lm -laud"
915 AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"],
916 [String used in /etc/passwd to denote locked account])
919 AC_DEFINE([BROKEN_GETADDRINFO])
920 AC_DEFINE([SETEUID_BREAKS_SETUID])
921 AC_DEFINE([BROKEN_SETREUID])
922 AC_DEFINE([BROKEN_SETREGID])
923 AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv])
927 AC_DEFINE([USE_PIPES])
928 AC_DEFINE([NO_X11_UNIX_SOCKETS])
929 AC_DEFINE([MISSING_NFDBITS], [1], [Define on *nto-qnx systems])
930 AC_DEFINE([MISSING_HOWMANY], [1], [Define on *nto-qnx systems])
931 AC_DEFINE([MISSING_FD_MASK], [1], [Define on *nto-qnx systems])
932 AC_DEFINE([DISABLE_LASTLOG])
933 AC_DEFINE([SSHD_ACQUIRES_CTTY])
934 AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken])
935 enable_etc_default_login=no # has incompatible /etc/default/login
938 AC_DEFINE([DISABLE_FD_PASSING])
944 AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1])
945 AC_DEFINE([BROKEN_MMAP], [1], [Ultrix mmap can't map files])
946 AC_DEFINE([NEED_SETPGRP])
947 AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix])
951 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
952 AC_DEFINE([MISSING_HOWMANY])
953 AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation])
957 AC_MSG_CHECKING([compiler and flags for sanity])
958 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])],
959 [ AC_MSG_RESULT([yes]) ],
962 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
964 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
967 dnl Checks for header files.
968 # Checks for libraries.
969 AC_CHECK_FUNC([yp_match], , [AC_CHECK_LIB([nsl], [yp_match])])
970 AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])])
972 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
973 AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [
974 AC_CHECK_LIB([gen], [dirname], [
975 AC_CACHE_CHECK([for broken dirname],
976 ac_cv_have_broken_dirname, [
984 int main(int argc, char **argv) {
987 strncpy(buf,"/etc", 32);
989 if (!s || strncmp(s, "/", 32) != 0) {
996 [ ac_cv_have_broken_dirname="no" ],
997 [ ac_cv_have_broken_dirname="yes" ],
998 [ ac_cv_have_broken_dirname="no" ],
1002 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
1004 AC_DEFINE([HAVE_DIRNAME])
1005 AC_CHECK_HEADERS([libgen.h])
1010 AC_CHECK_FUNC([getspnam], ,
1011 [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])])
1012 AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1],
1013 [Define if you have the basename function.])])
1015 dnl zlib is required
1017 [ --with-zlib=PATH Use zlib in PATH],
1018 [ if test "x$withval" = "xno" ; then
1019 AC_MSG_ERROR([*** zlib is required ***])
1020 elif test "x$withval" != "xyes"; then
1021 if test -d "$withval/lib"; then
1022 if test -n "${need_dash_r}"; then
1023 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1025 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1028 if test -n "${need_dash_r}"; then
1029 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1031 LDFLAGS="-L${withval} ${LDFLAGS}"
1034 if test -d "$withval/include"; then
1035 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1037 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1042 AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])])
1043 AC_CHECK_LIB([z], [deflate], ,
1045 saved_CPPFLAGS="$CPPFLAGS"
1046 saved_LDFLAGS="$LDFLAGS"
1048 dnl Check default zlib install dir
1049 if test -n "${need_dash_r}"; then
1050 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
1052 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
1054 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
1056 AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])],
1058 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
1064 AC_ARG_WITH([zlib-version-check],
1065 [ --without-zlib-version-check Disable zlib version check],
1066 [ if test "x$withval" = "xno" ; then
1067 zlib_check_nonfatal=1
1072 AC_MSG_CHECKING([for possibly buggy zlib])
1073 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1078 int a=0, b=0, c=0, d=0, n, v;
1079 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
1080 if (n != 3 && n != 4)
1082 v = a*1000000 + b*10000 + c*100 + d;
1083 fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
1086 if (a == 1 && b == 1 && c >= 4)
1089 /* 1.2.3 and up are OK */
1095 AC_MSG_RESULT([no]),
1096 [ AC_MSG_RESULT([yes])
1097 if test -z "$zlib_check_nonfatal" ; then
1098 AC_MSG_ERROR([*** zlib too old - check config.log ***
1099 Your reported zlib version has known security problems. It's possible your
1100 vendor has fixed these problems without changing the version number. If you
1101 are sure this is the case, you can disable the check by running
1102 "./configure --without-zlib-version-check".
1103 If you are in doubt, upgrade zlib to version 1.2.3 or greater.
1104 See http://www.gzip.org/zlib/ for details.])
1106 AC_MSG_WARN([zlib version may have security problems])
1109 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
1113 AC_CHECK_FUNC([strcasecmp],
1114 [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ]
1116 AC_CHECK_FUNCS([utimes],
1117 [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES])
1118 LIBS="$LIBS -lc89"]) ]
1121 dnl Checks for libutil functions
1122 AC_CHECK_HEADERS([libutil.h])
1123 AC_SEARCH_LIBS([login], [util bsd], [AC_DEFINE([HAVE_LOGIN], [1],
1124 [Define if your libraries define login()])])
1125 AC_CHECK_FUNCS([fmt_scaled logout updwtmp logwtmp])
1129 # Check for ALTDIRFUNC glob() extension
1130 AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support])
1131 AC_EGREP_CPP([FOUNDIT],
1134 #ifdef GLOB_ALTDIRFUNC
1139 AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1],
1140 [Define if your system glob() function has
1141 the GLOB_ALTDIRFUNC extension])
1142 AC_MSG_RESULT([yes])
1149 # Check for g.gl_matchc glob() extension
1150 AC_MSG_CHECKING([for gl_matchc field in glob_t])
1151 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]],
1152 [[ glob_t g; g.gl_matchc = 1; ]])],
1154 AC_DEFINE([GLOB_HAS_GL_MATCHC], [1],
1155 [Define if your system glob() function has
1156 gl_matchc options in glob_t])
1157 AC_MSG_RESULT([yes])
1162 # Check for g.gl_statv glob() extension
1163 AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob])
1164 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[
1165 #ifndef GLOB_KEEPSTAT
1166 #error "glob does not support GLOB_KEEPSTAT extension"
1172 AC_DEFINE([GLOB_HAS_GL_STATV], [1],
1173 [Define if your system glob() function has
1174 gl_statv options in glob_t])
1175 AC_MSG_RESULT([yes])
1181 AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>])
1183 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
1186 #include <sys/types.h>
1187 #include <dirent.h>]],
1190 exit(sizeof(d.d_name)<=sizeof(char));
1192 [AC_MSG_RESULT([yes])],
1195 AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1],
1196 [Define if your struct dirent expects you to
1197 allocate extra space for d_name])
1200 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
1201 AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME])
1205 AC_MSG_CHECKING([for /proc/pid/fd directory])
1206 if test -d "/proc/$$/fd" ; then
1207 AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd])
1208 AC_MSG_RESULT([yes])
1213 # Check whether user wants S/Key support
1216 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
1218 if test "x$withval" != "xno" ; then
1220 if test "x$withval" != "xyes" ; then
1221 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1222 LDFLAGS="$LDFLAGS -L${withval}/lib"
1225 AC_DEFINE([SKEY], [1], [Define if you want S/Key support])
1229 AC_MSG_CHECKING([for s/key support])
1235 char *ff = skey_keyinfo(""); ff="";
1238 [AC_MSG_RESULT([yes])],
1241 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1243 AC_MSG_CHECKING([if skeychallenge takes 4 arguments])
1244 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1248 (void)skeychallenge(NULL,"name","",0);
1251 AC_MSG_RESULT([yes])
1252 AC_DEFINE([SKEYCHALLENGE_4ARG], [1],
1253 [Define if your skeychallenge()
1254 function takes 4 arguments (NetBSD)])],
1262 # Check whether user wants TCP wrappers support
1264 AC_ARG_WITH([tcp-wrappers],
1265 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
1267 if test "x$withval" != "xno" ; then
1269 saved_LDFLAGS="$LDFLAGS"
1270 saved_CPPFLAGS="$CPPFLAGS"
1271 if test -n "${withval}" && \
1272 test "x${withval}" != "xyes"; then
1273 if test -d "${withval}/lib"; then
1274 if test -n "${need_dash_r}"; then
1275 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1277 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1280 if test -n "${need_dash_r}"; then
1281 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1283 LDFLAGS="-L${withval} ${LDFLAGS}"
1286 if test -d "${withval}/include"; then
1287 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1289 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1293 AC_MSG_CHECKING([for libwrap])
1294 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1295 #include <sys/types.h>
1296 #include <sys/socket.h>
1297 #include <netinet/in.h>
1299 int deny_severity = 0, allow_severity = 0;
1303 AC_MSG_RESULT([yes])
1304 AC_DEFINE([LIBWRAP], [1],
1306 TCP Wrappers support])
1307 SSHDLIBS="$SSHDLIBS -lwrap"
1310 AC_MSG_ERROR([*** libwrap missing])
1318 # Check whether user wants libedit support
1320 AC_ARG_WITH([libedit],
1321 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
1322 [ if test "x$withval" != "xno" ; then
1323 if test "x$withval" = "xyes" ; then
1324 AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
1325 if test "x$PKGCONFIG" != "xno"; then
1326 AC_MSG_CHECKING([if $PKGCONFIG knows about libedit])
1327 if "$PKGCONFIG" libedit; then
1328 AC_MSG_RESULT([yes])
1329 use_pkgconfig_for_libedit=yes
1335 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1336 if test -n "${need_dash_r}"; then
1337 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1339 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1342 if test "x$use_pkgconfig_for_libedit" = "xyes"; then
1343 LIBEDIT=`$PKGCONFIG --libs-only-l libedit`
1344 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`"
1346 LIBEDIT="-ledit -lcurses"
1348 OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'`
1349 AC_CHECK_LIB([edit], [el_init],
1350 [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp])
1354 [ AC_MSG_ERROR([libedit not found]) ],
1357 AC_MSG_CHECKING([if libedit version is compatible])
1359 [AC_LANG_PROGRAM([[ #include <histedit.h> ]],
1362 el_init("", NULL, NULL, NULL);
1365 [ AC_MSG_RESULT([yes]) ],
1366 [ AC_MSG_RESULT([no])
1367 AC_MSG_ERROR([libedit version is not compatible]) ]
1373 AC_ARG_WITH([audit],
1374 [ --with-audit=module Enable audit support (modules=debug,bsm,linux)],
1376 AC_MSG_CHECKING([for supported audit module])
1379 AC_MSG_RESULT([bsm])
1381 dnl Checks for headers, libs and functions
1382 AC_CHECK_HEADERS([bsm/audit.h], [],
1383 [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])],
1390 AC_CHECK_LIB([bsm], [getaudit], [],
1391 [AC_MSG_ERROR([BSM enabled and required library not found])])
1392 AC_CHECK_FUNCS([getaudit], [],
1393 [AC_MSG_ERROR([BSM enabled and required function not found])])
1394 # These are optional
1395 AC_CHECK_FUNCS([getaudit_addr aug_get_machine])
1396 AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module])
1399 AC_MSG_RESULT([linux])
1401 dnl Checks for headers, libs and functions
1402 AC_CHECK_HEADERS([libaudit.h])
1403 SSHDLIBS="$SSHDLIBS -laudit"
1404 AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module])
1408 AC_MSG_RESULT([debug])
1409 AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module])
1415 AC_MSG_ERROR([Unknown audit module $withval])
1420 dnl Checks for library functions. Please keep in alphabetical order
1424 arc4random_uniform \
1521 [[ #include <ctype.h> ]],
1522 [[ return (isblank('a')); ]])],
1523 [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).])
1526 # PKCS#11 support requires dlopen() and co
1527 AC_SEARCH_LIBS([dlopen], [dl],
1528 [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])]
1531 # IRIX has a const char return value for gai_strerror()
1532 AC_CHECK_FUNCS([gai_strerror], [
1533 AC_DEFINE([HAVE_GAI_STRERROR])
1534 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1535 #include <sys/types.h>
1536 #include <sys/socket.h>
1539 const char *gai_strerror(int);
1542 str = gai_strerror(0);
1544 AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1],
1545 [Define if gai_strerror() returns const char *])], [])])
1547 AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1],
1548 [Some systems put nanosleep outside of libc])])
1550 dnl Make sure prototypes are defined for these before using them.
1551 AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])])
1552 AC_CHECK_DECL([strsep],
1553 [AC_CHECK_FUNCS([strsep])],
1556 #ifdef HAVE_STRING_H
1557 # include <string.h>
1561 dnl tcsendbreak might be a macro
1562 AC_CHECK_DECL([tcsendbreak],
1563 [AC_DEFINE([HAVE_TCSENDBREAK])],
1564 [AC_CHECK_FUNCS([tcsendbreak])],
1565 [#include <termios.h>]
1568 AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>])
1570 AC_CHECK_DECLS([SHUT_RD], , ,
1572 #include <sys/types.h>
1573 #include <sys/socket.h>
1576 AC_CHECK_DECLS([O_NONBLOCK], , ,
1578 #include <sys/types.h>
1579 #ifdef HAVE_SYS_STAT_H
1580 # include <sys/stat.h>
1587 AC_CHECK_DECLS([writev], , , [
1588 #include <sys/types.h>
1589 #include <sys/uio.h>
1593 AC_CHECK_DECLS([MAXSYMLINKS], , , [
1594 #include <sys/param.h>
1597 AC_CHECK_DECLS([offsetof], , , [
1601 AC_CHECK_FUNCS([setresuid], [
1602 dnl Some platorms have setresuid that isn't implemented, test for this
1603 AC_MSG_CHECKING([if setresuid seems to work])
1616 [AC_MSG_RESULT([yes])],
1617 [AC_DEFINE([BROKEN_SETRESUID], [1],
1618 [Define if your setresuid() is broken])
1619 AC_MSG_RESULT([not implemented])],
1620 [AC_MSG_WARN([cross compiling: not checking setresuid])]
1624 AC_CHECK_FUNCS([setresgid], [
1625 dnl Some platorms have setresgid that isn't implemented, test for this
1626 AC_MSG_CHECKING([if setresgid seems to work])
1639 [AC_MSG_RESULT([yes])],
1640 [AC_DEFINE([BROKEN_SETRESGID], [1],
1641 [Define if your setresgid() is broken])
1642 AC_MSG_RESULT([not implemented])],
1643 [AC_MSG_WARN([cross compiling: not checking setresuid])]
1647 dnl Checks for time functions
1648 AC_CHECK_FUNCS([gettimeofday time])
1649 dnl Checks for utmp functions
1650 AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent])
1651 AC_CHECK_FUNCS([utmpname])
1652 dnl Checks for utmpx functions
1653 AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline])
1654 AC_CHECK_FUNCS([setutxdb setutxent utmpxname])
1655 dnl Checks for lastlog functions
1656 AC_CHECK_FUNCS([getlastlogxbyname])
1658 AC_CHECK_FUNC([daemon],
1659 [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])],
1660 [AC_CHECK_LIB([bsd], [daemon],
1661 [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])]
1664 AC_CHECK_FUNC([getpagesize],
1665 [AC_DEFINE([HAVE_GETPAGESIZE], [1],
1666 [Define if your libraries define getpagesize()])],
1667 [AC_CHECK_LIB([ucb], [getpagesize],
1668 [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])]
1671 # Check for broken snprintf
1672 if test "x$ac_cv_func_snprintf" = "xyes" ; then
1673 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
1675 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
1678 snprintf(b,5,"123456789");
1681 [AC_MSG_RESULT([yes])],
1684 AC_DEFINE([BROKEN_SNPRINTF], [1],
1685 [Define if your snprintf is busted])
1686 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
1688 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
1692 # If we don't have a working asprintf, then we strongly depend on vsnprintf
1693 # returning the right thing on overflow: the number of characters it tried to
1694 # create (as per SUSv3)
1695 if test "x$ac_cv_func_asprintf" != "xyes" && \
1696 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1697 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1700 #include <sys/types.h>
1704 int x_snprintf(char *str,size_t count,const char *fmt,...)
1706 size_t ret; va_list ap;
1707 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
1712 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
1714 [AC_MSG_RESULT([yes])],
1717 AC_DEFINE([BROKEN_SNPRINTF], [1],
1718 [Define if your snprintf is busted])
1719 AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor])
1721 [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ]
1725 # On systems where [v]snprintf is broken, but is declared in stdio,
1726 # check that the fmt argument is const char * or just char *.
1727 # This is only useful for when BROKEN_SNPRINTF
1728 AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
1729 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1731 int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
1735 [AC_MSG_RESULT([yes])
1736 AC_DEFINE([SNPRINTF_CONST], [const],
1737 [Define as const if snprintf() can declare const char *fmt])],
1738 [AC_MSG_RESULT([no])
1739 AC_DEFINE([SNPRINTF_CONST], [/* not const */])])
1741 # Check for missing getpeereid (or equiv) support
1743 if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "xyes"; then
1744 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1745 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1746 #include <sys/types.h>
1747 #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])],
1748 [ AC_MSG_RESULT([yes])
1749 AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option])
1750 ], [AC_MSG_RESULT([no])
1755 dnl see whether mkstemp() requires XXXXXX
1756 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1757 AC_MSG_CHECKING([for (overly) strict mkstemp])
1762 char template[]="conftest.mkstemp-test";
1763 if (mkstemp(template) == -1)
1772 AC_MSG_RESULT([yes])
1773 AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()])
1776 AC_MSG_RESULT([yes])
1777 AC_DEFINE([HAVE_STRICT_MKSTEMP])
1782 dnl make sure that openpty does not reacquire controlling terminal
1783 if test ! -z "$check_for_openpty_ctty_bug"; then
1784 AC_MSG_CHECKING([if openpty correctly handles controlling tty])
1788 #include <sys/fcntl.h>
1789 #include <sys/types.h>
1790 #include <sys/wait.h>
1793 int fd, ptyfd, ttyfd, status;
1796 if (pid < 0) { /* failed */
1798 } else if (pid > 0) { /* parent */
1799 waitpid(pid, &status, 0);
1800 if (WIFEXITED(status))
1801 exit(WEXITSTATUS(status));
1804 } else { /* child */
1805 close(0); close(1); close(2);
1807 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1808 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1810 exit(3); /* Acquired ctty: broken */
1812 exit(0); /* Did not acquire ctty: OK */
1816 AC_MSG_RESULT([yes])
1820 AC_DEFINE([SSHD_ACQUIRES_CTTY])
1823 AC_MSG_RESULT([cross-compiling, assuming yes])
1828 if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1829 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1830 AC_MSG_CHECKING([if getaddrinfo seems to work])
1834 #include <sys/socket.h>
1837 #include <netinet/in.h>
1839 #define TEST_PORT "2222"
1842 struct addrinfo *gai_ai, *ai, hints;
1843 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1845 memset(&hints, 0, sizeof(hints));
1846 hints.ai_family = PF_UNSPEC;
1847 hints.ai_socktype = SOCK_STREAM;
1848 hints.ai_flags = AI_PASSIVE;
1850 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1852 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1856 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1857 if (ai->ai_family != AF_INET6)
1860 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1861 sizeof(ntop), strport, sizeof(strport),
1862 NI_NUMERICHOST|NI_NUMERICSERV);
1865 if (err == EAI_SYSTEM)
1866 perror("getnameinfo EAI_SYSTEM");
1868 fprintf(stderr, "getnameinfo failed: %s\n",
1873 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1876 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1884 AC_MSG_RESULT([yes])
1888 AC_DEFINE([BROKEN_GETADDRINFO])
1891 AC_MSG_RESULT([cross-compiling, assuming yes])
1896 if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1897 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1898 AC_MSG_CHECKING([if getaddrinfo seems to work])
1902 #include <sys/socket.h>
1905 #include <netinet/in.h>
1907 #define TEST_PORT "2222"
1910 struct addrinfo *gai_ai, *ai, hints;
1911 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1913 memset(&hints, 0, sizeof(hints));
1914 hints.ai_family = PF_UNSPEC;
1915 hints.ai_socktype = SOCK_STREAM;
1916 hints.ai_flags = AI_PASSIVE;
1918 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1920 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1924 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1925 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1928 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1929 sizeof(ntop), strport, sizeof(strport),
1930 NI_NUMERICHOST|NI_NUMERICSERV);
1932 if (ai->ai_family == AF_INET && err != 0) {
1933 perror("getnameinfo");
1940 AC_MSG_RESULT([yes])
1941 AC_DEFINE([AIX_GETNAMEINFO_HACK], [1],
1942 [Define if you have a getaddrinfo that fails
1943 for the all-zeros IPv6 address])
1947 AC_DEFINE([BROKEN_GETADDRINFO])
1950 AC_MSG_RESULT([cross-compiling, assuming no])
1955 if test "x$check_for_conflicting_getspnam" = "x1"; then
1956 AC_MSG_CHECKING([for conflicting getspnam in shadow.h])
1957 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]],
1963 AC_MSG_RESULT([yes])
1964 AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1],
1965 [Conflicting defs for getspnam])
1972 # Search for OpenSSL
1973 saved_CPPFLAGS="$CPPFLAGS"
1974 saved_LDFLAGS="$LDFLAGS"
1975 AC_ARG_WITH([ssl-dir],
1976 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1978 if test "x$withval" != "xno" ; then
1981 ./*|../*) withval="`pwd`/$withval"
1983 if test -d "$withval/lib"; then
1984 if test -n "${need_dash_r}"; then
1985 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1987 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1989 elif test -d "$withval/lib64"; then
1990 if test -n "${need_dash_r}"; then
1991 LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}"
1993 LDFLAGS="-L${withval}/lib64 ${LDFLAGS}"
1996 if test -n "${need_dash_r}"; then
1997 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1999 LDFLAGS="-L${withval} ${LDFLAGS}"
2002 if test -d "$withval/include"; then
2003 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
2005 CPPFLAGS="-I${withval} ${CPPFLAGS}"
2010 LIBS="-lcrypto $LIBS"
2011 AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1],
2012 [Define if your ssl headers are included
2013 with #include <openssl/header.h>])],
2015 dnl Check default openssl install dir
2016 if test -n "${need_dash_r}"; then
2017 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
2019 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
2021 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
2022 AC_CHECK_HEADER([openssl/opensslv.h], ,
2023 [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])])
2024 AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])],
2026 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
2032 # Determine OpenSSL header version
2033 AC_MSG_CHECKING([OpenSSL header version])
2038 #include <openssl/opensslv.h>
2039 #define DATA "conftest.sslincver"
2044 fd = fopen(DATA,"w");
2048 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
2054 ssl_header_ver=`cat conftest.sslincver`
2055 AC_MSG_RESULT([$ssl_header_ver])
2058 AC_MSG_RESULT([not found])
2059 AC_MSG_ERROR([OpenSSL version header not found.])
2062 AC_MSG_WARN([cross compiling: not checking])
2066 # Determine OpenSSL library version
2067 AC_MSG_CHECKING([OpenSSL library version])
2072 #include <openssl/opensslv.h>
2073 #include <openssl/crypto.h>
2074 #define DATA "conftest.ssllibver"
2079 fd = fopen(DATA,"w");
2083 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
2089 ssl_library_ver=`cat conftest.ssllibver`
2090 AC_MSG_RESULT([$ssl_library_ver])
2093 AC_MSG_RESULT([not found])
2094 AC_MSG_ERROR([OpenSSL library not found.])
2097 AC_MSG_WARN([cross compiling: not checking])
2101 AC_ARG_WITH([openssl-header-check],
2102 [ --without-openssl-header-check Disable OpenSSL version consistency check],
2103 [ if test "x$withval" = "xno" ; then
2104 openssl_check_nonfatal=1
2109 # Sanity check OpenSSL headers
2110 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
2114 #include <openssl/opensslv.h>
2116 exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
2119 AC_MSG_RESULT([yes])
2123 if test "x$openssl_check_nonfatal" = "x"; then
2124 AC_MSG_ERROR([Your OpenSSL headers do not match your
2125 library. Check config.log for details.
2126 If you are sure your installation is consistent, you can disable the check
2127 by running "./configure --without-openssl-header-check".
2128 Also see contrib/findssl.sh for help identifying header/library mismatches.
2131 AC_MSG_WARN([Your OpenSSL headers do not match your
2132 library. Check config.log for details.
2133 Also see contrib/findssl.sh for help identifying header/library mismatches.])
2137 AC_MSG_WARN([cross compiling: not checking])
2141 AC_MSG_CHECKING([if programs using OpenSSL functions will link])
2143 [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]],
2144 [[ SSLeay_add_all_algorithms(); ]])],
2146 AC_MSG_RESULT([yes])
2152 AC_MSG_CHECKING([if programs using OpenSSL need -ldl])
2154 [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]],
2155 [[ SSLeay_add_all_algorithms(); ]])],
2157 AC_MSG_RESULT([yes])
2167 AC_CHECK_FUNCS([RSA_generate_key_ex DSA_generate_parameters_ex BN_is_prime_ex RSA_get_default_method])
2169 AC_ARG_WITH([ssl-engine],
2170 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ],
2171 [ if test "x$withval" != "xno" ; then
2172 AC_MSG_CHECKING([for OpenSSL ENGINE support])
2173 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2174 #include <openssl/engine.h>
2176 ENGINE_load_builtin_engines();
2177 ENGINE_register_all_complete();
2179 [ AC_MSG_RESULT([yes])
2180 AC_DEFINE([USE_OPENSSL_ENGINE], [1],
2181 [Enable OpenSSL engine support])
2182 ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found])
2187 # Check for OpenSSL without EVP_aes_{192,256}_cbc
2188 AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
2192 #include <openssl/evp.h>
2194 exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
2200 AC_MSG_RESULT([yes])
2201 AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1],
2202 [libcrypto is missing AES 192 and 256 bit functions])
2206 AC_MSG_CHECKING([if EVP_DigestUpdate returns an int])
2210 #include <openssl/evp.h>
2212 if(EVP_DigestUpdate(NULL, NULL,0))
2216 AC_MSG_RESULT([yes])
2220 AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1],
2221 [Define if EVP_DigestUpdate returns void])
2225 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
2226 # because the system crypt() is more featureful.
2227 if test "x$check_for_libcrypt_before" = "x1"; then
2228 AC_CHECK_LIB([crypt], [crypt])
2231 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
2232 # version in OpenSSL.
2233 if test "x$check_for_libcrypt_later" = "x1"; then
2234 AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"])
2237 # Search for SHA256 support in libc and/or OpenSSL
2238 AC_CHECK_FUNCS([SHA256_Update EVP_sha256], [TEST_SSH_SHA256=yes],
2239 [TEST_SSH_SHA256=no])
2240 AC_SUBST([TEST_SSH_SHA256])
2242 # Check complete ECC support in OpenSSL
2243 AC_MSG_CHECKING([whether OpenSSL has complete ECC support])
2246 #include <openssl/ec.h>
2247 #include <openssl/ecdh.h>
2248 #include <openssl/ecdsa.h>
2249 #include <openssl/evp.h>
2250 #include <openssl/objects.h>
2251 #include <openssl/opensslv.h>
2252 #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
2253 # error "OpenSSL < 0.9.8g has unreliable ECC code"
2256 EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
2257 const EVP_MD *m = EVP_sha512(); /* We need this too */
2260 AC_MSG_RESULT([yes])
2261 AC_DEFINE([OPENSSL_HAS_ECC], [1],
2262 [libcrypto includes complete ECC support])
2269 COMMENT_OUT_ECC="#no ecc#"
2272 AC_SUBST([TEST_SSH_ECC])
2273 AC_SUBST([COMMENT_OUT_ECC])
2276 AC_CHECK_LIB([iaf], [ia_openinfo], [
2278 AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf"
2279 AC_DEFINE([HAVE_LIBIAF], [1],
2280 [Define if system has libiaf that supports set_id])
2285 ### Configure cryptographic random number support
2287 # Check wheter OpenSSL seeds itself
2288 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
2292 #include <openssl/rand.h>
2294 exit(RAND_status() == 1 ? 0 : 1);
2297 OPENSSL_SEEDS_ITSELF=yes
2298 AC_MSG_RESULT([yes])
2302 # Default to use of the rand helper if OpenSSL doesn't
2307 AC_MSG_WARN([cross compiling: assuming yes])
2308 # This is safe, since all recent OpenSSL versions will
2309 # complain at runtime if not seeded correctly.
2310 OPENSSL_SEEDS_ITSELF=yes
2314 # Check for PAM libs
2317 [ --with-pam Enable PAM support ],
2319 if test "x$withval" != "xno" ; then
2320 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
2321 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
2322 AC_MSG_ERROR([PAM headers not found])
2326 AC_CHECK_LIB([dl], [dlopen], , )
2327 AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])])
2328 AC_CHECK_FUNCS([pam_getenvlist])
2329 AC_CHECK_FUNCS([pam_putenv])
2334 SSHDLIBS="$SSHDLIBS -lpam"
2335 AC_DEFINE([USE_PAM], [1],
2336 [Define if you want to enable PAM support])
2338 if test $ac_cv_lib_dl_dlopen = yes; then
2341 # libdl already in LIBS
2344 SSHDLIBS="$SSHDLIBS -ldl"
2352 # Check for older PAM
2353 if test "x$PAM_MSG" = "xyes" ; then
2354 # Check PAM strerror arguments (old PAM)
2355 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
2356 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2358 #if defined(HAVE_SECURITY_PAM_APPL_H)
2359 #include <security/pam_appl.h>
2360 #elif defined (HAVE_PAM_PAM_APPL_H)
2361 #include <pam/pam_appl.h>
2364 (void)pam_strerror((pam_handle_t *)NULL, -1);
2365 ]])], [AC_MSG_RESULT([no])], [
2366 AC_DEFINE([HAVE_OLD_PAM], [1],
2367 [Define if you have an old version of PAM
2368 which takes only one argument to pam_strerror])
2369 AC_MSG_RESULT([yes])
2370 PAM_MSG="yes (old library)"
2375 # Do we want to force the use of the rand helper?
2376 AC_ARG_WITH([rand-helper],
2377 [ --with-rand-helper Use subprocess to gather strong randomness ],
2379 if test "x$withval" = "xno" ; then
2380 # Force use of OpenSSL's internal RNG, even if
2381 # the previous test showed it to be unseeded.
2382 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
2383 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
2384 OPENSSL_SEEDS_ITSELF=yes
2393 # Which randomness source do we use?
2394 if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
2396 AC_DEFINE([OPENSSL_PRNG_ONLY], [1],
2397 [Define if you want OpenSSL's internally seeded PRNG only])
2398 RAND_MSG="OpenSSL internal ONLY"
2399 INSTALL_SSH_RAND_HELPER=""
2400 elif test ! -z "$USE_RAND_HELPER" ; then
2401 # install rand helper
2402 RAND_MSG="ssh-rand-helper"
2403 INSTALL_SSH_RAND_HELPER="yes"
2405 AC_SUBST([INSTALL_SSH_RAND_HELPER])
2407 ### Configuration of ssh-rand-helper
2410 AC_ARG_WITH([prngd-port],
2411 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
2420 AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port])
2423 if test ! -z "$withval" ; then
2424 PRNGD_PORT="$withval"
2425 AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT],
2426 [Port number of PRNGD/EGD random number socket])
2431 # PRNGD Unix domain socket
2432 AC_ARG_WITH([prngd-socket],
2433 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
2437 withval="/var/run/egd-pool"
2445 AC_MSG_ERROR([You must specify an absolute path to the entropy socket])
2449 if test ! -z "$withval" ; then
2450 if test ! -z "$PRNGD_PORT" ; then
2451 AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket])
2453 if test ! -r "$withval" ; then
2454 AC_MSG_WARN([Entropy socket is not readable])
2456 PRNGD_SOCKET="$withval"
2457 AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"],
2458 [Location of PRNGD/EGD random number socket])
2462 # Check for existing socket only if we don't have a random device already
2463 if test "$USE_RAND_HELPER" = yes ; then
2464 AC_MSG_CHECKING([for PRNGD/EGD socket])
2465 # Insert other locations here
2466 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
2467 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
2468 PRNGD_SOCKET="$sock"
2469 AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"])
2473 if test ! -z "$PRNGD_SOCKET" ; then
2474 AC_MSG_RESULT([$PRNGD_SOCKET])
2476 AC_MSG_RESULT([not found])
2482 # Change default command timeout for hashing entropy source
2484 AC_ARG_WITH([entropy-timeout],
2485 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2487 if test -n "$withval" && test "x$withval" != "xno" && \
2488 test "x${withval}" != "xyes"; then
2489 entropy_timeout=$withval
2493 AC_DEFINE_UNQUOTED([ENTROPY_TIMEOUT_MSEC], [$entropy_timeout],
2494 [Builtin PRNG command timeout])
2496 SSH_PRIVSEP_USER=sshd
2497 AC_ARG_WITH([privsep-user],
2498 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
2500 if test -n "$withval" && test "x$withval" != "xno" && \
2501 test "x${withval}" != "xyes"; then
2502 SSH_PRIVSEP_USER=$withval
2506 AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"],
2507 [non-privileged user for privilege separation])
2508 AC_SUBST([SSH_PRIVSEP_USER])
2510 # We do this little dance with the search path to insure
2511 # that programs that we select for use by installed programs
2512 # (which may be run by the super-user) come from trusted
2513 # locations before they come from the user's private area.
2514 # This should help avoid accidentally configuring some
2515 # random version of a program in someone's personal bin.
2519 test -h /bin 2> /dev/null && PATH=/usr/bin
2520 test -d /sbin && PATH=$PATH:/sbin
2521 test -d /usr/sbin && PATH=$PATH:/usr/sbin
2522 PATH=$PATH:/etc:$OPATH
2524 # These programs are used by the command hashing source to gather entropy
2525 OSSH_PATH_ENTROPY_PROG([PROG_LS], [ls])
2526 OSSH_PATH_ENTROPY_PROG([PROG_NETSTAT], [netstat])
2527 OSSH_PATH_ENTROPY_PROG([PROG_ARP], [arp])
2528 OSSH_PATH_ENTROPY_PROG([PROG_IFCONFIG], [ifconfig])
2529 OSSH_PATH_ENTROPY_PROG([PROG_JSTAT], [jstat])
2530 OSSH_PATH_ENTROPY_PROG([PROG_PS], [ps])
2531 OSSH_PATH_ENTROPY_PROG([PROG_SAR], [sar])
2532 OSSH_PATH_ENTROPY_PROG([PROG_W], [w])
2533 OSSH_PATH_ENTROPY_PROG([PROG_WHO], [who])
2534 OSSH_PATH_ENTROPY_PROG([PROG_LAST], [last])
2535 OSSH_PATH_ENTROPY_PROG([PROG_LASTLOG], [lastlog])
2536 OSSH_PATH_ENTROPY_PROG([PROG_DF], [df])
2537 OSSH_PATH_ENTROPY_PROG([PROG_VMSTAT], [vmstat])
2538 OSSH_PATH_ENTROPY_PROG([PROG_UPTIME], [uptime])
2539 OSSH_PATH_ENTROPY_PROG([PROG_IPCS], [ipcs])
2540 OSSH_PATH_ENTROPY_PROG([PROG_TAIL], [tail])
2544 # Where does ssh-rand-helper get its randomness from?
2545 INSTALL_SSH_PRNG_CMDS=""
2546 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
2547 if test ! -z "$PRNGD_PORT" ; then
2548 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
2549 elif test ! -z "$PRNGD_SOCKET" ; then
2550 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
2552 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
2553 RAND_HELPER_CMDHASH=yes
2554 INSTALL_SSH_PRNG_CMDS="yes"
2557 AC_SUBST([INSTALL_SSH_PRNG_CMDS])
2560 # Cheap hack to ensure NEWS-OS libraries are arranged right.
2561 if test ! -z "$SONY" ; then
2562 LIBS="$LIBS -liberty";
2565 # Check for long long datatypes
2566 AC_CHECK_TYPES([long long, unsigned long long, long double])
2568 # Check datatype sizes
2569 AC_CHECK_SIZEOF([char], [1])
2570 AC_CHECK_SIZEOF([short int], [2])
2571 AC_CHECK_SIZEOF([int], [4])
2572 AC_CHECK_SIZEOF([long int], [4])
2573 AC_CHECK_SIZEOF([long long int], [8])
2575 # Sanity check long long for some platforms (AIX)
2576 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
2577 ac_cv_sizeof_long_long_int=0
2580 # compute LLONG_MIN and LLONG_MAX if we don't know them.
2581 if test -z "$have_llong_max"; then
2582 AC_MSG_CHECKING([for max value of long long])
2586 /* Why is this so damn hard? */
2590 #define __USE_ISOC99
2592 #define DATA "conftest.llminmax"
2593 #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a))
2596 * printf in libc on some platforms (eg old Tru64) does not understand %lld so
2597 * we do this the hard way.
2600 fprint_ll(FILE *f, long long n)
2603 int l[sizeof(long long) * 8];
2606 if (fprintf(f, "-") < 0)
2608 for (i = 0; n != 0; i++) {
2609 l[i] = my_abs(n % 10);
2613 if (fprintf(f, "%d", l[--i]) < 0)
2616 if (fprintf(f, " ") < 0)
2622 long long i, llmin, llmax = 0;
2624 if((f = fopen(DATA,"w")) == NULL)
2627 #if defined(LLONG_MIN) && defined(LLONG_MAX)
2628 fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
2632 fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
2633 /* This will work on one's complement and two's complement */
2634 for (i = 1; i > llmax; i <<= 1, i++)
2636 llmin = llmax + 1LL; /* wrap */
2640 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2641 || llmax - 1 > llmax || llmin == llmax || llmin == 0
2642 || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
2643 fprintf(f, "unknown unknown\n");
2647 if (fprint_ll(f, llmin) < 0)
2649 if (fprint_ll(f, llmax) < 0)
2656 llong_min=`$AWK '{print $1}' conftest.llminmax`
2657 llong_max=`$AWK '{print $2}' conftest.llminmax`
2659 AC_MSG_RESULT([$llong_max])
2660 AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL],
2661 [max value of long long calculated by configure])
2662 AC_MSG_CHECKING([for min value of long long])
2663 AC_MSG_RESULT([$llong_min])
2664 AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL],
2665 [min value of long long calculated by configure])
2668 AC_MSG_RESULT([not found])
2671 AC_MSG_WARN([cross compiling: not checking])
2677 # More checks for data types
2678 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
2679 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2680 [[ u_int a; a = 1;]])],
2681 [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no"
2684 if test "x$ac_cv_have_u_int" = "xyes" ; then
2685 AC_DEFINE([HAVE_U_INT], [1], [define if you have u_int data type])
2689 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
2690 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2691 [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],
2692 [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no"
2695 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2696 AC_DEFINE([HAVE_INTXX_T], [1], [define if you have intxx_t data type])
2700 if (test -z "$have_intxx_t" && \
2701 test "x$ac_cv_header_stdint_h" = "xyes")
2703 AC_MSG_CHECKING([for intXX_t types in stdint.h])
2704 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]],
2705 [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],
2707 AC_DEFINE([HAVE_INTXX_T])
2708 AC_MSG_RESULT([yes])
2709 ], [ AC_MSG_RESULT([no])
2713 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2714 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2715 #include <sys/types.h>
2716 #ifdef HAVE_STDINT_H
2717 # include <stdint.h>
2719 #include <sys/socket.h>
2720 #ifdef HAVE_SYS_BITYPES_H
2721 # include <sys/bitypes.h>
2726 [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no"
2729 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2730 AC_DEFINE([HAVE_INT64_T], [1], [define if you have int64_t data type])
2733 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
2734 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2735 [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],
2736 [ ac_cv_have_u_intxx_t="yes" ], [ ac_cv_have_u_intxx_t="no"
2739 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2740 AC_DEFINE([HAVE_U_INTXX_T], [1], [define if you have u_intxx_t data type])
2744 if test -z "$have_u_intxx_t" ; then
2745 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
2746 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]],
2747 [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],
2749 AC_DEFINE([HAVE_U_INTXX_T])
2750 AC_MSG_RESULT([yes])
2751 ], [ AC_MSG_RESULT([no])
2755 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
2756 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2757 [[ u_int64_t a; a = 1;]])],
2758 [ ac_cv_have_u_int64_t="yes" ], [ ac_cv_have_u_int64_t="no"
2761 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2762 AC_DEFINE([HAVE_U_INT64_T], [1], [define if you have u_int64_t data type])
2766 if test -z "$have_u_int64_t" ; then
2767 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
2768 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]],
2769 [[ u_int64_t a; a = 1]])],
2771 AC_DEFINE([HAVE_U_INT64_T])
2772 AC_MSG_RESULT([yes])
2773 ], [ AC_MSG_RESULT([no])
2777 if test -z "$have_u_intxx_t" ; then
2778 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
2779 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2780 #include <sys/types.h>
2787 [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no"
2790 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2791 AC_DEFINE([HAVE_UINTXX_T], [1],
2792 [define if you have uintxx_t data type])
2796 if test -z "$have_uintxx_t" ; then
2797 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
2798 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]],
2799 [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])],
2801 AC_DEFINE([HAVE_UINTXX_T])
2802 AC_MSG_RESULT([yes])
2803 ], [ AC_MSG_RESULT([no])
2807 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2808 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2810 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2811 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2812 #include <sys/bitypes.h>
2814 int8_t a; int16_t b; int32_t c;
2815 u_int8_t e; u_int16_t f; u_int32_t g;
2816 a = b = c = e = f = g = 1;
2819 AC_DEFINE([HAVE_U_INTXX_T])
2820 AC_DEFINE([HAVE_INTXX_T])
2821 AC_MSG_RESULT([yes])
2822 ], [AC_MSG_RESULT([no])
2827 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
2828 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2829 [[ u_char foo; foo = 125; ]])],
2830 [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no"
2833 if test "x$ac_cv_have_u_char" = "xyes" ; then
2834 AC_DEFINE([HAVE_U_CHAR], [1], [define if you have u_char data type])
2839 AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>])
2840 AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [
2841 #include <sys/types.h>
2842 #ifdef HAVE_SYS_BITYPES_H
2843 #include <sys/bitypes.h>
2845 #ifdef HAVE_SYS_STATFS_H
2846 #include <sys/statfs.h>
2848 #ifdef HAVE_SYS_STATVFS_H
2849 #include <sys/statvfs.h>
2853 AC_CHECK_TYPES([in_addr_t, in_port_t], , ,
2854 [#include <sys/types.h>
2855 #include <netinet/in.h>])
2857 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
2858 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2859 [[ size_t foo; foo = 1235; ]])],
2860 [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no"
2863 if test "x$ac_cv_have_size_t" = "xyes" ; then
2864 AC_DEFINE([HAVE_SIZE_T], [1], [define if you have size_t data type])
2867 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
2868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2869 [[ ssize_t foo; foo = 1235; ]])],
2870 [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no"
2873 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
2874 AC_DEFINE([HAVE_SSIZE_T], [1], [define if you have ssize_t data type])
2877 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
2878 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]],
2879 [[ clock_t foo; foo = 1235; ]])],
2880 [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no"
2883 if test "x$ac_cv_have_clock_t" = "xyes" ; then
2884 AC_DEFINE([HAVE_CLOCK_T], [1], [define if you have clock_t data type])
2887 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
2888 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2889 #include <sys/types.h>
2890 #include <sys/socket.h>
2891 ]], [[ sa_family_t foo; foo = 1235; ]])],
2892 [ ac_cv_have_sa_family_t="yes" ],
2893 [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2894 #include <sys/types.h>
2895 #include <sys/socket.h>
2896 #include <netinet/in.h>
2897 ]], [[ sa_family_t foo; foo = 1235; ]])],
2898 [ ac_cv_have_sa_family_t="yes" ],
2899 [ ac_cv_have_sa_family_t="no" ]
2903 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
2904 AC_DEFINE([HAVE_SA_FAMILY_T], [1],
2905 [define if you have sa_family_t data type])
2908 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
2909 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2910 [[ pid_t foo; foo = 1235; ]])],
2911 [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no"
2914 if test "x$ac_cv_have_pid_t" = "xyes" ; then
2915 AC_DEFINE([HAVE_PID_T], [1], [define if you have pid_t data type])
2918 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
2919 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2920 [[ mode_t foo; foo = 1235; ]])],
2921 [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no"
2924 if test "x$ac_cv_have_mode_t" = "xyes" ; then
2925 AC_DEFINE([HAVE_MODE_T], [1], [define if you have mode_t data type])
2929 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
2930 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2931 #include <sys/types.h>
2932 #include <sys/socket.h>
2933 ]], [[ struct sockaddr_storage s; ]])],
2934 [ ac_cv_have_struct_sockaddr_storage="yes" ],
2935 [ ac_cv_have_struct_sockaddr_storage="no"
2938 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
2939 AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1],
2940 [define if you have struct sockaddr_storage data type])
2943 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
2944 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2945 #include <sys/types.h>
2946 #include <netinet/in.h>
2947 ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])],
2948 [ ac_cv_have_struct_sockaddr_in6="yes" ],
2949 [ ac_cv_have_struct_sockaddr_in6="no"
2952 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
2953 AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1],
2954 [define if you have struct sockaddr_in6 data type])
2957 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
2958 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2959 #include <sys/types.h>
2960 #include <netinet/in.h>
2961 ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])],
2962 [ ac_cv_have_struct_in6_addr="yes" ],
2963 [ ac_cv_have_struct_in6_addr="no"
2966 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
2967 AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1],
2968 [define if you have struct in6_addr data type])
2970 dnl Now check for sin6_scope_id
2971 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , ,
2973 #ifdef HAVE_SYS_TYPES_H
2974 #include <sys/types.h>
2976 #include <netinet/in.h>
2980 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2982 #include <sys/types.h>
2983 #include <sys/socket.h>
2985 ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])],
2986 [ ac_cv_have_struct_addrinfo="yes" ],
2987 [ ac_cv_have_struct_addrinfo="no"
2990 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2991 AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1],
2992 [define if you have struct addrinfo data type])
2995 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2996 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]],
2997 [[ struct timeval tv; tv.tv_sec = 1;]])],
2998 [ ac_cv_have_struct_timeval="yes" ],
2999 [ ac_cv_have_struct_timeval="no"
3002 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
3003 AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval])
3004 have_struct_timeval=1
3007 AC_CHECK_TYPES([struct timespec])
3009 # We need int64_t or else certian parts of the compile will fail.
3010 if test "x$ac_cv_have_int64_t" = "xno" && \
3011 test "x$ac_cv_sizeof_long_int" != "x8" && \
3012 test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
3013 echo "OpenSSH requires int64_t support. Contact your vendor or install"
3014 echo "an alternative compiler (I.E., GCC) before continuing."
3018 dnl test snprintf (broken on SCO w/gcc)
3023 #ifdef HAVE_SNPRINTF
3027 char expected_out[50];
3029 #if (SIZEOF_LONG_INT == 8)
3030 long int num = 0x7fffffffffffffff;
3032 long long num = 0x7fffffffffffffffll;
3034 strcpy(expected_out, "9223372036854775807");
3035 snprintf(buf, mazsize, "%lld", num);
3036 if(strcmp(buf, expected_out) != 0)
3043 ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ],
3044 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
3048 dnl Checks for structure members
3049 OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP])
3050 OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX])
3051 OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX])
3052 OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP])
3053 OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP])
3054 OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX])
3055 OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP])
3056 OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP])
3057 OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX])
3058 OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP])
3059 OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX])
3060 OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP])
3061 OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX])
3062 OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP])
3063 OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP])
3064 OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX])
3065 OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX])
3067 AC_CHECK_MEMBERS([struct stat.st_blksize])
3068 AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state],
3069 [Define if we don't have struct __res_state in resolv.h])],
3072 #if HAVE_SYS_TYPES_H
3073 # include <sys/types.h>
3075 #include <netinet/in.h>
3076 #include <arpa/nameser.h>
3080 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
3081 ac_cv_have_ss_family_in_struct_ss, [
3082 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3083 #include <sys/types.h>
3084 #include <sys/socket.h>
3085 ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])],
3086 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
3087 [ ac_cv_have_ss_family_in_struct_ss="no" ])
3089 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
3090 AC_DEFINE([HAVE_SS_FAMILY_IN_SS], [1], [Fields in struct sockaddr_storage])
3093 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
3094 ac_cv_have___ss_family_in_struct_ss, [
3095 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3096 #include <sys/types.h>
3097 #include <sys/socket.h>
3098 ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])],
3099 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
3100 [ ac_cv_have___ss_family_in_struct_ss="no"
3103 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3104 AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1],
3105 [Fields in struct sockaddr_storage])
3108 AC_CACHE_CHECK([for pw_class field in struct passwd],
3109 ac_cv_have_pw_class_in_struct_passwd, [
3110 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3111 [[ struct passwd p; p.pw_class = 0; ]])],
3112 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
3113 [ ac_cv_have_pw_class_in_struct_passwd="no"
3116 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
3117 AC_DEFINE([HAVE_PW_CLASS_IN_PASSWD], [1],
3118 [Define if your password has a pw_class field])
3121 AC_CACHE_CHECK([for pw_expire field in struct passwd],
3122 ac_cv_have_pw_expire_in_struct_passwd, [
3123 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3124 [[ struct passwd p; p.pw_expire = 0; ]])],
3125 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
3126 [ ac_cv_have_pw_expire_in_struct_passwd="no"
3129 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
3130 AC_DEFINE([HAVE_PW_EXPIRE_IN_PASSWD], [1],
3131 [Define if your password has a pw_expire field])
3134 AC_CACHE_CHECK([for pw_change field in struct passwd],
3135 ac_cv_have_pw_change_in_struct_passwd, [
3136 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3137 [[ struct passwd p; p.pw_change = 0; ]])],
3138 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
3139 [ ac_cv_have_pw_change_in_struct_passwd="no"
3142 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
3143 AC_DEFINE([HAVE_PW_CHANGE_IN_PASSWD], [1],
3144 [Define if your password has a pw_change field])
3147 dnl make sure we're using the real structure members and not defines
3148 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
3149 ac_cv_have_accrights_in_msghdr, [
3150 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3151 #include <sys/types.h>
3152 #include <sys/socket.h>
3153 #include <sys/uio.h>
3155 #ifdef msg_accrights
3156 #error "msg_accrights is a macro"
3160 m.msg_accrights = 0;
3163 [ ac_cv_have_accrights_in_msghdr="yes" ],
3164 [ ac_cv_have_accrights_in_msghdr="no" ]
3167 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
3168 AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1],
3169 [Define if your system uses access rights style
3170 file descriptor passing])
3173 AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type])
3174 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3175 #include <sys/types.h>
3176 #include <sys/stat.h>
3177 #ifdef HAVE_SYS_TIME_H
3178 # include <sys/time.h>
3180 #ifdef HAVE_SYS_MOUNT_H
3181 #include <sys/mount.h>
3183 #ifdef HAVE_SYS_STATVFS_H
3184 #include <sys/statvfs.h>
3186 ]], [[ struct statvfs s; s.f_fsid = 0; ]])],
3187 [ AC_MSG_RESULT([yes]) ],
3188 [ AC_MSG_RESULT([no])
3190 AC_MSG_CHECKING([if fsid_t has member val])
3191 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3192 #include <sys/types.h>
3193 #include <sys/statvfs.h>
3194 ]], [[ fsid_t t; t.val[0] = 0; ]])],
3195 [ AC_MSG_RESULT([yes])
3196 AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ],
3197 [ AC_MSG_RESULT([no]) ])
3199 AC_MSG_CHECKING([if f_fsid has member __val])
3200 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3201 #include <sys/types.h>
3202 #include <sys/statvfs.h>
3203 ]], [[ fsid_t t; t.__val[0] = 0; ]])],
3204 [ AC_MSG_RESULT([yes])
3205 AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ],
3206 [ AC_MSG_RESULT([no]) ])
3209 AC_CACHE_CHECK([for msg_control field in struct msghdr],
3210 ac_cv_have_control_in_msghdr, [
3211 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3212 #include <sys/types.h>
3213 #include <sys/socket.h>
3214 #include <sys/uio.h>
3217 #error "msg_control is a macro"
3224 [ ac_cv_have_control_in_msghdr="yes" ],
3225 [ ac_cv_have_control_in_msghdr="no" ]
3228 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
3229 AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1],
3230 [Define if your system uses ancillary data style
3231 file descriptor passing])
3234 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
3235 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
3236 [[ extern char *__progname; printf("%s", __progname); ]])],
3237 [ ac_cv_libc_defines___progname="yes" ],
3238 [ ac_cv_libc_defines___progname="no"
3241 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
3242 AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname])
3245 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
3246 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]],
3247 [[ printf("%s", __FUNCTION__); ]])],
3248 [ ac_cv_cc_implements___FUNCTION__="yes" ],
3249 [ ac_cv_cc_implements___FUNCTION__="no"
3252 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
3253 AC_DEFINE([HAVE___FUNCTION__], [1],
3254 [Define if compiler implements __FUNCTION__])
3257 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
3258 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]],
3259 [[ printf("%s", __func__); ]])],
3260 [ ac_cv_cc_implements___func__="yes" ],
3261 [ ac_cv_cc_implements___func__="no"
3264 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
3265 AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__])
3268 AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
3269 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3272 ]], [[ va_copy(x,y); ]])],
3273 [ ac_cv_have_va_copy="yes" ],
3274 [ ac_cv_have_va_copy="no"
3277 if test "x$ac_cv_have_va_copy" = "xyes" ; then
3278 AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists])
3281 AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
3282 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3285 ]], [[ __va_copy(x,y); ]])],
3286 [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no"
3289 if test "x$ac_cv_have___va_copy" = "xyes" ; then
3290 AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists])
3293 AC_CACHE_CHECK([whether getopt has optreset support],
3294 ac_cv_have_getopt_optreset, [
3295 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]],
3296 [[ extern int optreset; optreset = 0; ]])],
3297 [ ac_cv_have_getopt_optreset="yes" ],
3298 [ ac_cv_have_getopt_optreset="no"
3301 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
3302 AC_DEFINE([HAVE_GETOPT_OPTRESET], [1],
3303 [Define if your getopt(3) defines and uses optreset])
3306 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
3307 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
3308 [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])],
3309 [ ac_cv_libc_defines_sys_errlist="yes" ],
3310 [ ac_cv_libc_defines_sys_errlist="no"
3313 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
3314 AC_DEFINE([HAVE_SYS_ERRLIST], [1],
3315 [Define if your system defines sys_errlist[]])
3319 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
3320 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
3321 [[ extern int sys_nerr; printf("%i", sys_nerr);]])],
3322 [ ac_cv_libc_defines_sys_nerr="yes" ],
3323 [ ac_cv_libc_defines_sys_nerr="no"
3326 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
3327 AC_DEFINE([HAVE_SYS_NERR], [1], [Define if your system defines sys_nerr])
3330 # Check libraries needed by DNS fingerprint support
3331 AC_SEARCH_LIBS([getrrsetbyname], [resolv],
3332 [AC_DEFINE([HAVE_GETRRSETBYNAME], [1],
3333 [Define if getrrsetbyname() exists])],
3335 # Needed by our getrrsetbyname()
3336 AC_SEARCH_LIBS([res_query], [resolv])
3337 AC_SEARCH_LIBS([dn_expand], [resolv])
3338 AC_MSG_CHECKING([if res_query will link])
3339 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3340 #include <sys/types.h>
3341 #include <netinet/in.h>
3342 #include <arpa/nameser.h>
3346 res_query (0, 0, 0, 0, 0);
3348 AC_MSG_RESULT([yes]),
3349 [AC_MSG_RESULT([no])
3351 LIBS="$LIBS -lresolv"
3352 AC_MSG_CHECKING([for res_query in -lresolv])
3353 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3354 #include <sys/types.h>
3355 #include <netinet/in.h>
3356 #include <arpa/nameser.h>
3360 res_query (0, 0, 0, 0, 0);
3362 [AC_MSG_RESULT([yes])],
3364 AC_MSG_RESULT([no])])
3366 AC_CHECK_FUNCS([_getshort _getlong])
3367 AC_CHECK_DECLS([_getshort, _getlong], , ,
3368 [#include <sys/types.h>
3369 #include <arpa/nameser.h>])
3370 AC_CHECK_MEMBER([HEADER.ad],
3371 [AC_DEFINE([HAVE_HEADER_AD], [1],
3372 [Define if HEADER.ad exists in arpa/nameser.h])], ,
3373 [#include <arpa/nameser.h>])
3376 AC_MSG_CHECKING([if struct __res_state _res is an extern])
3377 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3379 #if HAVE_SYS_TYPES_H
3380 # include <sys/types.h>
3382 #include <netinet/in.h>
3383 #include <arpa/nameser.h>
3385 extern struct __res_state _res;
3387 [AC_MSG_RESULT([yes])
3388 AC_DEFINE([HAVE__RES_EXTERN], [1],
3389 [Define if you have struct __res_state _res as an extern])
3391 [ AC_MSG_RESULT([no]) ]
3394 # Check whether user wants SELinux support
3397 AC_ARG_WITH([selinux],
3398 [ --with-selinux Enable SELinux support],
3399 [ if test "x$withval" != "xno" ; then
3401 AC_DEFINE([WITH_SELINUX], [1],
3402 [Define if you want SELinux support.])
3404 AC_CHECK_HEADER([selinux/selinux.h], ,
3405 AC_MSG_ERROR([SELinux support requires selinux.h header]))
3406 AC_CHECK_LIB([selinux], [setexeccon],
3407 [ LIBSELINUX="-lselinux"
3408 LIBS="$LIBS -lselinux"
3410 AC_MSG_ERROR([SELinux support requires libselinux library]))
3411 SSHLIBS="$SSHLIBS $LIBSELINUX"
3412 SSHDLIBS="$SSHDLIBS $LIBSELINUX"
3413 AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level])
3418 AC_SUBST([SSHDLIBS])
3420 # Check whether user wants Kerberos 5 support
3422 AC_ARG_WITH([kerberos5],
3423 [ --with-kerberos5=PATH Enable Kerberos 5 support],
3424 [ if test "x$withval" != "xno" ; then
3425 if test "x$withval" = "xyes" ; then
3426 KRB5ROOT="/usr/local"
3431 AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support])
3434 AC_PATH_PROG([KRB5CONF], [krb5-config],
3435 [$KRB5ROOT/bin/krb5-config],
3436 [$KRB5ROOT/bin:$PATH])
3437 if test -x $KRB5CONF ; then
3439 AC_MSG_CHECKING([for gssapi support])
3440 if $KRB5CONF | grep gssapi >/dev/null ; then
3441 AC_MSG_RESULT([yes])
3442 AC_DEFINE([GSSAPI], [1],
3443 [Define this if you want GSSAPI
3444 support in the version 2 protocol])
3450 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
3451 K5LIBS="`$KRB5CONF --libs $k5confopts`"
3452 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
3453 AC_MSG_CHECKING([whether we are using Heimdal])
3454 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h>
3455 ]], [[ char *tmp = heimdal_version; ]])],
3456 [ AC_MSG_RESULT([yes])
3457 AC_DEFINE([HEIMDAL], [1],
3458 [Define this if you are using the Heimdal
3459 version of Kerberos V5]) ],
3460 [AC_MSG_RESULT([no])
3463 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
3464 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
3465 AC_MSG_CHECKING([whether we are using Heimdal])
3466 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h>
3467 ]], [[ char *tmp = heimdal_version; ]])],
3468 [ AC_MSG_RESULT([yes])
3469 AC_DEFINE([HEIMDAL])
3471 K5LIBS="$K5LIBS -lcom_err -lasn1"
3472 AC_CHECK_LIB([roken], [net_write],
3473 [K5LIBS="$K5LIBS -lroken"])
3474 AC_CHECK_LIB([des], [des_cbc_encrypt],
3475 [K5LIBS="$K5LIBS -ldes"])
3476 ], [ AC_MSG_RESULT([no])
3477 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
3480 AC_SEARCH_LIBS([dn_expand], [resolv])
3482 AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context],
3483 [ AC_DEFINE([GSSAPI])
3484 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
3485 [ AC_CHECK_LIB([gssapi], [gss_init_sec_context],
3486 [ AC_DEFINE([GSSAPI])
3487 K5LIBS="-lgssapi $K5LIBS" ],
3488 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
3493 AC_CHECK_HEADER([gssapi.h], ,
3494 [ unset ac_cv_header_gssapi_h
3495 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3496 AC_CHECK_HEADERS([gssapi.h], ,
3497 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
3503 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3504 AC_CHECK_HEADER([gssapi_krb5.h], ,
3505 [ CPPFLAGS="$oldCPP" ])
3508 if test ! -z "$need_dash_r" ; then
3509 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
3511 if test ! -z "$blibpath" ; then
3512 blibpath="$blibpath:${KRB5ROOT}/lib"
3515 AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
3516 AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h])
3517 AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h])
3519 LIBS="$LIBS $K5LIBS"
3520 AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1],
3521 [Define this if you want to use libkafs' AFS support])])
3526 # Looking for programs, paths and files
3528 PRIVSEP_PATH=/var/empty
3529 AC_ARG_WITH([privsep-path],
3530 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
3532 if test -n "$withval" && test "x$withval" != "xno" && \
3533 test "x${withval}" != "xyes"; then
3534 PRIVSEP_PATH=$withval
3538 AC_SUBST([PRIVSEP_PATH])
3540 AC_ARG_WITH([xauth],
3541 [ --with-xauth=PATH Specify path to xauth program ],
3543 if test -n "$withval" && test "x$withval" != "xno" && \
3544 test "x${withval}" != "xyes"; then
3550 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
3551 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
3552 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
3553 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
3554 AC_PATH_PROG([xauth_path], [xauth], , [$TestPath])
3555 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
3556 xauth_path="/usr/openwin/bin/xauth"
3562 AC_ARG_ENABLE([strip],
3563 [ --disable-strip Disable calling strip(1) on install],
3565 if test "x$enableval" = "xno" ; then
3570 AC_SUBST([STRIP_OPT])
3572 if test -z "$xauth_path" ; then
3573 XAUTH_PATH="undefined"
3574 AC_SUBST([XAUTH_PATH])
3576 AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"],
3577 [Define if xauth is found in your path])
3578 XAUTH_PATH=$xauth_path
3579 AC_SUBST([XAUTH_PATH])
3582 # Check for mail directory (last resort if we cannot get it from headers)
3583 if test ! -z "$MAIL" ; then
3584 maildir=`dirname $MAIL`
3585 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"],
3586 [Set this to your mail directory if you don't have maillock.h])
3589 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
3590 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
3591 disable_ptmx_check=yes
3593 if test -z "$no_dev_ptmx" ; then
3594 if test "x$disable_ptmx_check" != "xyes" ; then
3595 AC_CHECK_FILE(["/dev/ptmx"],
3597 AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1],
3598 [Define if you have /dev/ptmx])
3605 if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
3606 AC_CHECK_FILE(["/dev/ptc"],
3608 AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1],
3609 [Define if you have /dev/ptc])
3614 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
3617 # Options from here on. Some of these are preset by platform above
3618 AC_ARG_WITH([mantype],
3619 [ --with-mantype=man|cat|doc Set man page type],
3626 AC_MSG_ERROR([invalid man type: $withval])
3631 if test -z "$MANTYPE"; then
3632 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
3633 AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath])
3634 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
3636 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
3643 if test "$MANTYPE" = "doc"; then
3648 AC_SUBST([mansubdir])
3650 # Check whether to enable MD5 passwords
3652 AC_ARG_WITH([md5-passwords],
3653 [ --with-md5-passwords Enable use of MD5 passwords],
3655 if test "x$withval" != "xno" ; then
3656 AC_DEFINE([HAVE_MD5_PASSWORDS], [1],
3657 [Define if you want to allow MD5 passwords])
3663 # Whether to disable shadow password support
3664 AC_ARG_WITH([shadow],
3665 [ --without-shadow Disable shadow password support],
3667 if test "x$withval" = "xno" ; then
3668 AC_DEFINE([DISABLE_SHADOW])
3674 if test -z "$disable_shadow" ; then
3675 AC_MSG_CHECKING([if the systems has expire shadow information])
3676 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3677 #include <sys/types.h>
3680 ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])],
3681 [ sp_expire_available=yes ], [
3684 if test "x$sp_expire_available" = "xyes" ; then
3685 AC_MSG_RESULT([yes])
3686 AC_DEFINE([HAS_SHADOW_EXPIRE], [1],
3687 [Define if you want to use shadow password expire field])
3693 # Use ip address instead of hostname in $DISPLAY
3694 if test ! -z "$IPADDR_IN_DISPLAY" ; then
3695 DISPLAY_HACK_MSG="yes"
3696 AC_DEFINE([IPADDR_IN_DISPLAY], [1],
3697 [Define if you need to use IP address
3698 instead of hostname in $DISPLAY])
3700 DISPLAY_HACK_MSG="no"
3701 AC_ARG_WITH([ipaddr-display],
3702 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
3704 if test "x$withval" != "xno" ; then
3705 AC_DEFINE([IPADDR_IN_DISPLAY])
3706 DISPLAY_HACK_MSG="yes"
3712 # check for /etc/default/login and use it if present.
3713 AC_ARG_ENABLE([etc-default-login],
3714 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
3715 [ if test "x$enableval" = "xno"; then
3716 AC_MSG_NOTICE([/etc/default/login handling disabled])
3717 etc_default_login=no
3719 etc_default_login=yes
3721 [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
3723 AC_MSG_WARN([cross compiling: not checking /etc/default/login])
3724 etc_default_login=no
3726 etc_default_login=yes
3730 if test "x$etc_default_login" != "xno"; then
3731 AC_CHECK_FILE(["/etc/default/login"],
3732 [ external_path_file=/etc/default/login ])
3733 if test "x$external_path_file" = "x/etc/default/login"; then
3734 AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1],
3735 [Define if your system has /etc/default/login])
3739 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
3740 if test $ac_cv_func_login_getcapbool = "yes" && \
3741 test $ac_cv_header_login_cap_h = "yes" ; then
3742 external_path_file=/etc/login.conf
3745 # Whether to mess with the default path
3746 SERVER_PATH_MSG="(default)"
3747 AC_ARG_WITH([default-path],
3748 [ --with-default-path= Specify default \$PATH environment for server],
3750 if test "x$external_path_file" = "x/etc/login.conf" ; then
3752 --with-default-path=PATH has no effect on this system.
3753 Edit /etc/login.conf instead.])
3754 elif test "x$withval" != "xno" ; then
3755 if test ! -z "$external_path_file" ; then
3757 --with-default-path=PATH will only be used if PATH is not defined in
3758 $external_path_file .])
3760 user_path="$withval"
3761 SERVER_PATH_MSG="$withval"
3764 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
3765 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
3767 if test ! -z "$external_path_file" ; then
3769 If PATH is defined in $external_path_file, ensure the path to scp is included,
3770 otherwise scp will not work.])
3774 /* find out what STDPATH is */
3779 #ifndef _PATH_STDPATH
3780 # ifdef _PATH_USERPATH /* Irix */
3781 # define _PATH_STDPATH _PATH_USERPATH
3783 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
3786 #include <sys/types.h>
3787 #include <sys/stat.h>
3789 #define DATA "conftest.stdpath"
3794 fd = fopen(DATA,"w");
3798 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
3803 [ user_path=`cat conftest.stdpath` ],
3804 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
3805 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
3807 # make sure $bindir is in USER_PATH so scp will work
3808 t_bindir=`eval echo ${bindir}`
3810 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
3813 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
3815 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
3816 if test $? -ne 0 ; then
3817 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
3818 if test $? -ne 0 ; then
3819 user_path=$user_path:$t_bindir
3820 AC_MSG_RESULT([Adding $t_bindir to USER_PATH so scp will work])
3825 if test "x$external_path_file" != "x/etc/login.conf" ; then
3826 AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH])
3827 AC_SUBST([user_path])
3830 # Set superuser path separately to user path
3831 AC_ARG_WITH([superuser-path],
3832 [ --with-superuser-path= Specify different path for super-user],
3834 if test -n "$withval" && test "x$withval" != "xno" && \
3835 test "x${withval}" != "xyes"; then
3836 AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"],
3837 [Define if you want a different $PATH
3839 superuser_path=$withval
3845 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
3846 IPV4_IN6_HACK_MSG="no"
3848 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
3850 if test "x$withval" != "xno" ; then
3851 AC_MSG_RESULT([yes])
3852 AC_DEFINE([IPV4_IN_IPV6], [1],
3853 [Detect IPv4 in IPv6 mapped addresses
3855 IPV4_IN6_HACK_MSG="yes"
3860 if test "x$inet6_default_4in6" = "xyes"; then
3861 AC_MSG_RESULT([yes (default)])
3862 AC_DEFINE([IPV4_IN_IPV6])
3863 IPV4_IN6_HACK_MSG="yes"
3865 AC_MSG_RESULT([no (default)])
3870 # Whether to enable BSD auth support
3872 AC_ARG_WITH([bsd-auth],
3873 [ --with-bsd-auth Enable BSD auth support],
3875 if test "x$withval" != "xno" ; then
3876 AC_DEFINE([BSD_AUTH], [1],
3877 [Define if you have BSD auth support])
3883 # Where to place sshd.pid
3885 # make sure the directory exists
3886 if test ! -d $piddir ; then
3887 piddir=`eval echo ${sysconfdir}`
3889 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
3893 AC_ARG_WITH([pid-dir],
3894 [ --with-pid-dir=PATH Specify location of ssh.pid file],
3896 if test -n "$withval" && test "x$withval" != "xno" && \
3897 test "x${withval}" != "xyes"; then
3899 if test ! -d $piddir ; then
3900 AC_MSG_WARN([** no $piddir directory on this system **])
3906 AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"],
3907 [Specify location of ssh.pid])
3910 dnl allow user to disable some login recording features
3911 AC_ARG_ENABLE([lastlog],
3912 [ --disable-lastlog disable use of lastlog even if detected [no]],
3914 if test "x$enableval" = "xno" ; then
3915 AC_DEFINE([DISABLE_LASTLOG])
3919 AC_ARG_ENABLE([utmp],
3920 [ --disable-utmp disable use of utmp even if detected [no]],
3922 if test "x$enableval" = "xno" ; then
3923 AC_DEFINE([DISABLE_UTMP])
3927 AC_ARG_ENABLE([utmpx],
3928 [ --disable-utmpx disable use of utmpx even if detected [no]],
3930 if test "x$enableval" = "xno" ; then
3931 AC_DEFINE([DISABLE_UTMPX], [1],
3932 [Define if you don't want to use utmpx])
3936 AC_ARG_ENABLE([wtmp],
3937 [ --disable-wtmp disable use of wtmp even if detected [no]],
3939 if test "x$enableval" = "xno" ; then
3940 AC_DEFINE([DISABLE_WTMP])
3944 AC_ARG_ENABLE([wtmpx],
3945 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
3947 if test "x$enableval" = "xno" ; then
3948 AC_DEFINE([DISABLE_WTMPX], [1],
3949 [Define if you don't want to use wtmpx])
3953 AC_ARG_ENABLE([libutil],
3954 [ --disable-libutil disable use of libutil (login() etc.) [no]],
3956 if test "x$enableval" = "xno" ; then
3957 AC_DEFINE([DISABLE_LOGIN])
3961 AC_ARG_ENABLE([pututline],
3962 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
3964 if test "x$enableval" = "xno" ; then
3965 AC_DEFINE([DISABLE_PUTUTLINE], [1],
3966 [Define if you don't want to use pututline()
3967 etc. to write [uw]tmp])
3971 AC_ARG_ENABLE([pututxline],
3972 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
3974 if test "x$enableval" = "xno" ; then
3975 AC_DEFINE([DISABLE_PUTUTXLINE], [1],
3976 [Define if you don't want to use pututxline()
3977 etc. to write [uw]tmpx])
3981 AC_ARG_WITH([lastlog],
3982 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
3984 if test "x$withval" = "xno" ; then
3985 AC_DEFINE([DISABLE_LASTLOG])
3986 elif test -n "$withval" && test "x${withval}" != "xyes"; then
3987 conf_lastlog_location=$withval
3992 dnl lastlog, [uw]tmpx? detection
3993 dnl NOTE: set the paths in the platform section to avoid the
3994 dnl need for command-line parameters
3995 dnl lastlog and [uw]tmp are subject to a file search if all else fails
3997 dnl lastlog detection
3998 dnl NOTE: the code itself will detect if lastlog is a directory
3999 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
4000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4001 #include <sys/types.h>
4003 #ifdef HAVE_LASTLOG_H
4004 # include <lastlog.h>
4012 ]], [[ char *lastlog = LASTLOG_FILE; ]])],
4013 [ AC_MSG_RESULT([yes]) ],
4016 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
4017 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4018 #include <sys/types.h>
4020 #ifdef HAVE_LASTLOG_H
4021 # include <lastlog.h>
4026 ]], [[ char *lastlog = _PATH_LASTLOG; ]])],
4027 [ AC_MSG_RESULT([yes]) ],
4030 system_lastlog_path=no
4034 if test -z "$conf_lastlog_location"; then
4035 if test x"$system_lastlog_path" = x"no" ; then
4036 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
4037 if (test -d "$f" || test -f "$f") ; then
4038 conf_lastlog_location=$f
4041 if test -z "$conf_lastlog_location"; then
4042 AC_MSG_WARN([** Cannot find lastlog **])
4043 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
4048 if test -n "$conf_lastlog_location"; then
4049 AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"],
4050 [Define if you want to specify the path to your lastlog file])
4054 AC_MSG_CHECKING([if your system defines UTMP_FILE])
4055 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4056 #include <sys/types.h>
4061 ]], [[ char *utmp = UTMP_FILE; ]])],
4062 [ AC_MSG_RESULT([yes]) ],
4063 [ AC_MSG_RESULT([no])
4066 if test -z "$conf_utmp_location"; then
4067 if test x"$system_utmp_path" = x"no" ; then
4068 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
4069 if test -f $f ; then
4070 conf_utmp_location=$f
4073 if test -z "$conf_utmp_location"; then
4074 AC_DEFINE([DISABLE_UTMP])
4078 if test -n "$conf_utmp_location"; then
4079 AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"],
4080 [Define if you want to specify the path to your utmp file])
4084 AC_MSG_CHECKING([if your system defines WTMP_FILE])
4085 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4086 #include <sys/types.h>
4091 ]], [[ char *wtmp = WTMP_FILE; ]])],
4092 [ AC_MSG_RESULT([yes]) ],
4093 [ AC_MSG_RESULT([no])
4096 if test -z "$conf_wtmp_location"; then
4097 if test x"$system_wtmp_path" = x"no" ; then
4098 for f in /usr/adm/wtmp /var/log/wtmp; do
4099 if test -f $f ; then
4100 conf_wtmp_location=$f
4103 if test -z "$conf_wtmp_location"; then
4104 AC_DEFINE([DISABLE_WTMP])
4108 if test -n "$conf_wtmp_location"; then
4109 AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"],
4110 [Define if you want to specify the path to your wtmp file])
4115 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
4116 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4117 #include <sys/types.h>
4125 ]], [[ char *wtmpx = WTMPX_FILE; ]])],
4126 [ AC_MSG_RESULT([yes]) ],
4127 [ AC_MSG_RESULT([no])
4128 system_wtmpx_path=no
4130 if test -z "$conf_wtmpx_location"; then
4131 if test x"$system_wtmpx_path" = x"no" ; then
4132 AC_DEFINE([DISABLE_WTMPX])
4135 AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"],
4136 [Define if you want to specify the path to your wtmpx file])
4140 if test ! -z "$blibpath" ; then
4141 LDFLAGS="$LDFLAGS $blibflags$blibpath"
4142 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
4145 dnl Adding -Werror to CFLAGS early prevents configure tests from running.
4147 CFLAGS="$CFLAGS $werror_flags"
4149 if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
4154 AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no])
4155 AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6])
4158 AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
4159 openbsd-compat/Makefile openbsd-compat/regress/Makefile \
4160 ssh_prng_cmds survey.sh])
4163 # Print summary of options
4165 # Someone please show me a better way :)
4166 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
4167 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
4168 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
4169 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
4170 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
4171 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
4172 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
4173 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
4174 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
4175 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
4178 echo "OpenSSH has been configured with the following options:"
4179 echo " User binaries: $B"
4180 echo " System binaries: $C"
4181 echo " Configuration files: $D"
4182 echo " Askpass program: $E"
4183 echo " Manual pages: $F"
4184 echo " PID file: $G"
4185 echo " Privilege separation chroot path: $H"
4186 if test "x$external_path_file" = "x/etc/login.conf" ; then
4187 echo " At runtime, sshd will use the path defined in $external_path_file"
4188 echo " Make sure the path to scp is present, otherwise scp will not work"
4190 echo " sshd default user PATH: $I"
4191 if test ! -z "$external_path_file"; then
4192 echo " (If PATH is set in $external_path_file it will be used instead. If"
4193 echo " used, ensure the path to scp is present, otherwise scp will not work.)"
4196 if test ! -z "$superuser_path" ; then
4197 echo " sshd superuser user PATH: $J"
4199 echo " Manpage format: $MANTYPE"
4200 echo " PAM support: $PAM_MSG"
4201 echo " OSF SIA support: $SIA_MSG"
4202 echo " KerberosV support: $KRB5_MSG"
4203 echo " SELinux support: $SELINUX_MSG"
4204 echo " Smartcard support: $SCARD_MSG"
4205 echo " S/KEY support: $SKEY_MSG"
4206 echo " TCP Wrappers support: $TCPW_MSG"
4207 echo " MD5 password support: $MD5_MSG"
4208 echo " libedit support: $LIBEDIT_MSG"
4209 echo " Solaris process contract support: $SPC_MSG"
4210 echo " Solaris project support: $SP_MSG"
4211 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
4212 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
4213 echo " BSD Auth support: $BSD_AUTH_MSG"
4214 echo " Random number source: $RAND_MSG"
4215 if test ! -z "$USE_RAND_HELPER" ; then
4216 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
4221 echo " Host: ${host}"
4222 echo " Compiler: ${CC}"
4223 echo " Compiler flags: ${CFLAGS}"
4224 echo "Preprocessor flags: ${CPPFLAGS}"
4225 echo " Linker flags: ${LDFLAGS}"
4226 echo " Libraries: ${LIBS}"
4227 if test ! -z "${SSHDLIBS}"; then
4228 echo " +for sshd: ${SSHDLIBS}"
4230 if test ! -z "${SSHLIBS}"; then
4231 echo " +for ssh: ${SSHLIBS}"
4236 if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
4237 echo "SVR4 style packages are supported with \"make package\""
4241 if test "x$PAM_MSG" = "xyes" ; then
4242 echo "PAM is enabled. You may need to install a PAM control file "
4243 echo "for sshd, otherwise password authentication may fail. "
4244 echo "Example PAM control files can be found in the contrib/ "
4249 if test ! -z "$RAND_HELPER_CMDHASH" ; then
4250 echo "WARNING: you are using the builtin random number collection "
4251 echo "service. Please read WARNING.RNG and request that your OS "
4252 echo "vendor includes kernel-based random number collection in "
4253 echo "future versions of your OS."
4257 if test ! -z "$NO_PEERCHECK" ; then
4258 echo "WARNING: the operating system that you are using does not"
4259 echo "appear to support getpeereid(), getpeerucred() or the"
4260 echo "SO_PEERCRED getsockopt() option. These facilities are used to"
4261 echo "enforce security checks to prevent unauthorised connections to"
4262 echo "ssh-agent. Their absence increases the risk that a malicious"
4263 echo "user can connect to your agent."
4267 if test "$AUDIT_MODULE" = "bsm" ; then
4268 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
4269 echo "See the Solaris section in README.platform for details."