4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(ENT, ent)
20 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
21 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
75 AC_DEFINE(BROKEN_GETADDRINFO)
76 AC_DEFINE(BROKEN_REALPATH)
77 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
81 LIBS="$LIBS /usr/lib/textmode.o"
82 AC_DEFINE(HAVE_CYGWIN)
84 AC_DEFINE(DISABLE_SHADOW)
85 AC_DEFINE(IPV4_DEFAULT)
86 AC_DEFINE(IP_TOS_IS_BROKEN)
87 AC_DEFINE(NO_X11_UNIX_SOCKETS)
90 AC_DEFINE(IP_TOS_IS_BROKEN)
93 AC_DEFINE(BROKEN_GETADDRINFO)
96 if test -z "$GCC"; then
99 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
100 IPADDR_IN_DISPLAY=yes
101 AC_DEFINE(HAVE_SECUREWARE)
103 AC_DEFINE(LOGIN_NO_ENDOPT)
104 AC_DEFINE(LOGIN_NEEDS_UTMPX)
105 AC_DEFINE(DISABLE_SHADOW)
106 AC_DEFINE(DISABLE_UTMP)
107 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
108 LIBS="$LIBS -lxnet -lsec -lsecpw"
109 disable_ptmx_check=yes
112 if test -z "$GCC"; then
115 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
116 IPADDR_IN_DISPLAY=yes
118 AC_DEFINE(LOGIN_NO_ENDOPT)
119 AC_DEFINE(LOGIN_NEEDS_UTMPX)
120 AC_DEFINE(DISABLE_SHADOW)
121 AC_DEFINE(DISABLE_UTMP)
122 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
123 LIBS="$LIBS -lxnet -lsec"
126 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
127 IPADDR_IN_DISPLAY=yes
128 AC_DEFINE(PAM_SUN_CODEBASE)
130 AC_DEFINE(LOGIN_NO_ENDOPT)
131 AC_DEFINE(LOGIN_NEEDS_UTMPX)
132 AC_DEFINE(DISABLE_SHADOW)
133 AC_DEFINE(DISABLE_UTMP)
134 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
135 LIBS="$LIBS -lxnet -lsec"
138 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
140 PATH="$PATH:/usr/etc"
141 AC_DEFINE(BROKEN_INET_NTOA)
142 AC_DEFINE(WITH_ABBREV_NO_TTY)
145 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
147 PATH="$PATH:/usr/etc"
148 AC_DEFINE(WITH_IRIX_ARRAY)
149 AC_DEFINE(WITH_IRIX_PROJECT)
150 AC_DEFINE(WITH_IRIX_AUDIT)
151 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
152 AC_DEFINE(BROKEN_INET_NTOA)
153 AC_DEFINE(WITH_ABBREV_NO_TTY)
157 check_for_libcrypt_later=1
158 AC_DEFINE(DONT_TRY_OTHER_AF)
159 AC_DEFINE(PAM_TTY_KLUDGE)
160 inet6_default_4in6=yes
162 mips-sony-bsd|mips-sony-newsos4)
163 AC_DEFINE(HAVE_NEWS4)
170 check_for_libcrypt_later=1
173 conf_lastlog_location="/usr/adm/lastlog"
174 conf_utmp_location=/etc/utmp
175 conf_wtmp_location=/usr/adm/wtmp
178 AC_DEFINE(BROKEN_REALPATH)
180 AC_DEFINE(BROKEN_SAVED_UIDS)
181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
186 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
188 AC_DEFINE(PAM_SUN_CODEBASE)
189 AC_DEFINE(LOGIN_NEEDS_UTMPX)
190 AC_DEFINE(LOGIN_NEEDS_TERM)
191 AC_DEFINE(PAM_TTY_KLUDGE)
192 # hardwire lastlog location (can't detect it on some versions)
193 conf_lastlog_location="/var/adm/lastlog"
194 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
195 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
196 if test "$sol2ver" -ge 8; then
198 AC_DEFINE(DISABLE_UTMP)
199 AC_DEFINE(DISABLE_WTMP)
205 CPPFLAGS="$CPPFLAGS -DSUNOS4"
206 AC_CHECK_FUNCS(getpwanam)
207 AC_DEFINE(PAM_SUN_CODEBASE)
208 conf_utmp_location=/etc/utmp
209 conf_wtmp_location=/var/adm/wtmp
210 conf_lastlog_location=/var/adm/lastlog
214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
220 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
221 # /usr/ucblib MUST NOT be searched on ReliantUNIX
222 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 IPADDR_IN_DISPLAY=yes
225 AC_DEFINE(IP_TOS_IS_BROKEN)
226 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
227 # Attention: always take care to bind libsocket and libnsl before libc,
228 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
231 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
232 LDFLAGS="$LDFLAGS -L/usr/local/lib"
237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
244 LDFLAGS="$LDFLAGS -L/usr/local/lib"
247 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
248 LDFLAGS="$LDFLAGS -L/usr/local/lib"
249 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
250 rsh_path="/usr/bin/rcmd"
253 AC_DEFINE(BROKEN_SYS_TERMIO_H)
255 AC_DEFINE(HAVE_SECUREWARE)
256 AC_DEFINE(DISABLE_SHADOW)
257 AC_DEFINE(BROKEN_SAVED_UIDS)
258 AC_CHECK_FUNCS(getluid setluid)
260 do_sco3_extra_lib_check=yes
263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
265 LIBS="$LIBS -lprot -lx -ltinfo -lm"
267 rsh_path="/usr/bin/rcmd"
269 AC_DEFINE(HAVE_SECUREWARE)
270 AC_DEFINE(DISABLE_SHADOW)
271 AC_CHECK_FUNCS(getluid setluid)
278 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
279 LIBS="$LIBS -lgen -lrsc"
282 AC_MSG_CHECKING(for Digital Unix SIA)
285 [ --with-osfsia Enable Digital Unix SIA],
287 if test "x$withval" = "xno" ; then
288 AC_MSG_RESULT(disabled)
293 if test -z "$no_osfsia" ; then
294 if test -f /etc/sia/matrix.conf; then
296 AC_DEFINE(HAVE_OSF_SIA)
297 AC_DEFINE(DISABLE_LOGIN)
298 LIBS="$LIBS -lsecurity -ldb -lm -laud"
307 AC_DEFINE(NO_X11_UNIX_SOCKETS)
308 AC_DEFINE(MISSING_NFDBITS)
309 AC_DEFINE(MISSING_HOWMANY)
310 AC_DEFINE(MISSING_FD_MASK)
314 # Allow user to specify flags
316 [ --with-cflags Specify additional flags to pass to compiler],
318 if test "x$withval" != "xno" ; then
319 CFLAGS="$CFLAGS $withval"
323 AC_ARG_WITH(cppflags,
324 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
326 if test "x$withval" != "xno"; then
327 CPPFLAGS="$CPPFLAGS $withval"
332 [ --with-ldflags Specify additional flags to pass to linker],
334 if test "x$withval" != "xno" ; then
335 LDFLAGS="$LDFLAGS $withval"
340 [ --with-libs Specify additional libraries to link with],
342 if test "x$withval" != "xno" ; then
343 LIBS="$LIBS $withval"
348 # Checks for header files.
349 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
350 getopt.h glob.h lastlog.h limits.h login.h \
351 login_cap.h maillock.h netdb.h netgroup.h \
352 netinet/in_systm.h paths.h pty.h readpassphrase.h \
353 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
354 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
355 sys/mman.h sys/select.h sys/stat.h \
356 sys/stropts.h sys/sysmacros.h sys/time.h \
357 sys/un.h time.h ttyent.h usersec.h \
358 util.h utime.h utmp.h utmpx.h)
360 # Checks for libraries.
361 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
362 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
364 dnl SCO OS3 needs this for libwrap
365 if test "x$with_tcp_wrappers" != "xno" ; then
366 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
367 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
371 AC_CHECK_FUNC(getspnam, ,
372 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
375 [ --without-rpath Disable auto-added -R linker paths],
377 if test "x$withval" = "xno" ; then
380 if test "x$withval" = "xyes" ; then
388 [ --with-zlib=PATH Use zlib in PATH],
390 if test "x$withval" = "xno" ; then
391 AC_MSG_ERROR([*** zlib is required ***])
393 if test -d "$withval/lib"; then
394 if test -n "${need_dash_r}"; then
395 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
397 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
400 if test -n "${need_dash_r}"; then
401 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
403 LDFLAGS="-L${withval} ${LDFLAGS}"
406 if test -d "$withval/include"; then
407 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
409 CPPFLAGS="-I${withval} ${CPPFLAGS}"
414 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
417 AC_CHECK_FUNC(strcasecmp,
418 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
420 AC_CHECK_FUNC(utimes,
421 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
424 dnl Checks for libutil functions
425 AC_CHECK_HEADERS(libutil.h)
426 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
427 AC_CHECK_FUNCS(logout updwtmp logwtmp)
431 # Check for ALTDIRFUNC glob() extension
432 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
433 AC_EGREP_CPP(FOUNDIT,
436 #ifdef GLOB_ALTDIRFUNC
441 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
449 # Check for g.gl_matchc glob() extension
450 AC_MSG_CHECKING(for gl_matchc field in glob_t)
451 AC_EGREP_CPP(FOUNDIT,
454 int main(void){glob_t g; g.gl_matchc = 1;}
457 AC_DEFINE(GLOB_HAS_GL_MATCHC)
465 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
468 #include <sys/types.h>
470 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
472 [AC_MSG_RESULT(yes)],
475 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
479 # Check whether user wants S/Key support
482 [ --with-skey[[=PATH]] Enable S/Key support
483 (optionally in PATH)],
485 if test "x$withval" != "xno" ; then
487 if test "x$withval" != "xyes" ; then
488 CPPFLAGS="$CPPFLAGS -I${withval}/include"
489 LDFLAGS="$LDFLAGS -L${withval}/lib"
496 AC_MSG_CHECKING([for s/key support])
501 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
503 [AC_MSG_RESULT(yes)],
506 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
512 # Check whether user wants TCP wrappers support
514 AC_ARG_WITH(tcp-wrappers,
515 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
516 (optionally in PATH)],
518 if test "x$withval" != "xno" ; then
520 saved_LDFLAGS="$LDFLAGS"
521 saved_CPPFLAGS="$CPPFLAGS"
522 if test -n "${withval}" -a "${withval}" != "yes"; then
523 if test -d "${withval}/lib"; then
524 if test -n "${need_dash_r}"; then
525 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
527 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
530 if test -n "${need_dash_r}"; then
531 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
533 LDFLAGS="-L${withval} ${LDFLAGS}"
536 if test -d "${withval}/include"; then
537 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
539 CPPFLAGS="-I${withval} ${CPPFLAGS}"
543 LIBS="$LIBWRAP $LIBS"
544 AC_MSG_CHECKING(for libwrap)
548 int deny_severity = 0, allow_severity = 0;
558 AC_MSG_ERROR([*** libwrap missing])
566 dnl Checks for library functions.
567 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
568 clock fchmod fchown freeaddrinfo futimes gai_strerror \
569 getaddrinfo getcwd getgrouplist getnameinfo getopt \
570 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
571 inet_ntop innetgr login_getcapbool md5_crypt memmove \
572 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
573 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
574 setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \
575 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
576 strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \
577 vhangup vsnprintf waitpid __b64_ntop _getpty)
579 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
580 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
581 AC_CHECK_LIB(gen, dirname,[
582 AC_CACHE_CHECK([for broken dirname],
583 ac_cv_have_broken_dirname, [
591 int main(int argc, char **argv) {
594 strncpy(buf,"/etc", 32);
596 if (!s || strncmp(s, "/", 32) != 0) {
603 [ ac_cv_have_broken_dirname="no" ],
604 [ ac_cv_have_broken_dirname="yes" ]
608 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
610 AC_DEFINE(HAVE_DIRNAME)
611 AC_CHECK_HEADERS(libgen.h)
616 dnl Checks for time functions
617 AC_CHECK_FUNCS(gettimeofday time)
618 dnl Checks for utmp functions
619 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
620 AC_CHECK_FUNCS(utmpname)
621 dnl Checks for utmpx functions
622 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
623 AC_CHECK_FUNCS(setutxent utmpxname)
625 AC_CHECK_FUNC(getuserattr,
626 [AC_DEFINE(HAVE_GETUSERATTR)],
627 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
630 AC_CHECK_FUNC(daemon,
631 [AC_DEFINE(HAVE_DAEMON)],
632 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
635 AC_CHECK_FUNC(getpagesize,
636 [AC_DEFINE(HAVE_GETPAGESIZE)],
637 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
640 # Check for broken snprintf
641 if test "x$ac_cv_func_snprintf" = "xyes" ; then
642 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
646 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
648 [AC_MSG_RESULT(yes)],
651 AC_DEFINE(BROKEN_SNPRINTF)
652 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
662 [ --with-pam Enable PAM support ],
664 if test "x$withval" != "xno" ; then
665 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
666 AC_MSG_ERROR([PAM headers not found])
669 AC_CHECK_LIB(dl, dlopen, , )
670 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
671 AC_CHECK_FUNCS(pam_getenvlist)
677 if test $ac_cv_lib_dl_dlopen = yes; then
687 # Check for older PAM
688 if test "x$PAM_MSG" = "xyes" ; then
689 # Check PAM strerror arguments (old PAM)
690 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
694 #include <security/pam_appl.h>
696 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
699 AC_DEFINE(HAVE_OLD_PAM)
701 PAM_MSG="yes (old library)"
707 saved_CPPFLAGS="$CPPFLAGS"
708 saved_LDFLAGS="$LDFLAGS"
710 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
712 if test "x$withval" != "xno" ; then
713 if test -d "$withval/lib"; then
714 if test -n "${need_dash_r}"; then
715 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
717 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
720 if test -n "${need_dash_r}"; then
721 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
723 LDFLAGS="-L${withval} ${LDFLAGS}"
726 if test -d "$withval/include"; then
727 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
729 CPPFLAGS="-I${withval} ${CPPFLAGS}"
734 LIBS="$LIBS -lcrypto"
735 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
737 dnl Check default openssl install dir
738 if test -n "${need_dash_r}"; then
739 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
741 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
743 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
744 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
746 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
753 # Sanity check OpenSSL headers
754 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
758 #include <openssl/opensslv.h>
759 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
766 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
770 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
771 # version in OpenSSL. Skip this for PAM
772 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
773 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
777 ### Configure cryptographic random number support
779 # Check wheter OpenSSL seeds itself
780 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
784 #include <openssl/rand.h>
785 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
788 OPENSSL_SEEDS_ITSELF=yes
793 # Default to use of the rand helper if OpenSSL doesn't
800 # Do we want to force the use of the rand helper?
801 AC_ARG_WITH(rand-helper,
802 [ --with-rand-helper Use subprocess to gather strong randomness ],
804 if test "x$withval" = "xno" ; then
805 # Force use of OpenSSL's internal RNG, even if
806 # the previous test showed it to be unseeded.
807 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
808 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
809 OPENSSL_SEEDS_ITSELF=yes
818 # Which randomness source do we use?
819 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
821 AC_DEFINE(OPENSSL_PRNG_ONLY)
822 RAND_MSG="OpenSSL internal ONLY"
823 INSTALL_SSH_RAND_HELPER=""
824 elif test ! -z "$USE_RAND_HELPER" ; then
825 # install rand helper
826 RAND_MSG="ssh-rand-helper"
827 INSTALL_SSH_RAND_HELPER="yes"
829 AC_SUBST(INSTALL_SSH_RAND_HELPER)
831 ### Configuration of ssh-rand-helper
834 AC_ARG_WITH(prngd-port,
835 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
844 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
847 if test ! -z "$withval" ; then
848 PRNGD_PORT="$withval"
849 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
854 # PRNGD Unix domain socket
855 AC_ARG_WITH(prngd-socket,
856 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
860 withval="/var/run/egd-pool"
868 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
872 if test ! -z "$withval" ; then
873 if test ! -z "$PRNGD_PORT" ; then
874 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
876 if test ! -r "$withval" ; then
877 AC_MSG_WARN(Entropy socket is not readable)
879 PRNGD_SOCKET="$withval"
880 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
884 # Check for existing socket only if we don't have a random device already
885 if test "$USE_RAND_HELPER" = yes ; then
886 AC_MSG_CHECKING(for PRNGD/EGD socket)
887 # Insert other locations here
888 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
889 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
891 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
895 if test ! -z "$PRNGD_SOCKET" ; then
896 AC_MSG_RESULT($PRNGD_SOCKET)
898 AC_MSG_RESULT(not found)
904 # Change default command timeout for hashing entropy source
906 AC_ARG_WITH(entropy-timeout,
907 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
909 if test "x$withval" != "xno" ; then
910 entropy_timeout=$withval
914 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
916 ssh_privsep_user=sshd
917 AC_ARG_WITH(privsep-user,
918 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
920 if test -n "$withval"; then
921 ssh_privsep_user=$withval
925 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
927 # We do this little dance with the search path to insure
928 # that programs that we select for use by installed programs
929 # (which may be run by the super-user) come from trusted
930 # locations before they come from the user's private area.
931 # This should help avoid accidentally configuring some
932 # random version of a program in someone's personal bin.
936 test -h /bin 2> /dev/null && PATH=/usr/bin
937 test -d /sbin && PATH=$PATH:/sbin
938 test -d /usr/sbin && PATH=$PATH:/usr/sbin
939 PATH=$PATH:/etc:$OPATH
941 # These programs are used by the command hashing source to gather entropy
942 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
943 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
944 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
945 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
946 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
947 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
948 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
949 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
950 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
951 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
952 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
953 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
954 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
955 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
956 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
957 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
961 # Where does ssh-rand-helper get its randomness from?
962 INSTALL_SSH_PRNG_CMDS=""
963 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
964 if test ! -z "$PRNGD_PORT" ; then
965 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
966 elif test ! -z "$PRNGD_SOCKET" ; then
967 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
969 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
970 RAND_HELPER_CMDHASH=yes
971 INSTALL_SSH_PRNG_CMDS="yes"
974 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
977 # Cheap hack to ensure NEWS-OS libraries are arranged right.
978 if test ! -z "$SONY" ; then
979 LIBS="$LIBS -liberty";
982 # Checks for data types
983 AC_CHECK_SIZEOF(char, 1)
984 AC_CHECK_SIZEOF(short int, 2)
985 AC_CHECK_SIZEOF(int, 4)
986 AC_CHECK_SIZEOF(long int, 4)
987 AC_CHECK_SIZEOF(long long int, 8)
989 # Sanity check long long for some platforms (AIX)
990 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
991 ac_cv_sizeof_long_long_int=0
994 # More checks for data types
995 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
997 [ #include <sys/types.h> ],
999 [ ac_cv_have_u_int="yes" ],
1000 [ ac_cv_have_u_int="no" ]
1003 if test "x$ac_cv_have_u_int" = "xyes" ; then
1004 AC_DEFINE(HAVE_U_INT)
1008 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1010 [ #include <sys/types.h> ],
1011 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1012 [ ac_cv_have_intxx_t="yes" ],
1013 [ ac_cv_have_intxx_t="no" ]
1016 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1017 AC_DEFINE(HAVE_INTXX_T)
1021 if (test -z "$have_intxx_t" && \
1022 test "x$ac_cv_header_stdint_h" = "xyes")
1024 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1026 [ #include <stdint.h> ],
1027 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1029 AC_DEFINE(HAVE_INTXX_T)
1032 [ AC_MSG_RESULT(no) ]
1036 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1038 [ #include <sys/types.h> ],
1039 [ int64_t a; a = 1;],
1040 [ ac_cv_have_int64_t="yes" ],
1041 [ ac_cv_have_int64_t="no" ]
1044 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1045 AC_DEFINE(HAVE_INT64_T)
1049 if test -z "$have_int64_t" ; then
1050 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1052 [ #include <sys/socket.h> ],
1053 [ int64_t a; a = 1],
1055 AC_DEFINE(HAVE_INT64_T)
1058 [ AC_MSG_RESULT(no) ]
1062 if test -z "$have_int64_t" ; then
1063 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1065 [ #include <sys/bitypes.h> ],
1066 [ int64_t a; a = 1],
1068 AC_DEFINE(HAVE_INT64_T)
1071 [ AC_MSG_RESULT(no) ]
1075 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1077 [ #include <sys/types.h> ],
1078 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1079 [ ac_cv_have_u_intxx_t="yes" ],
1080 [ ac_cv_have_u_intxx_t="no" ]
1083 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1084 AC_DEFINE(HAVE_U_INTXX_T)
1088 if test -z "$have_u_intxx_t" ; then
1089 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1091 [ #include <sys/socket.h> ],
1092 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1094 AC_DEFINE(HAVE_U_INTXX_T)
1097 [ AC_MSG_RESULT(no) ]
1101 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1103 [ #include <sys/types.h> ],
1104 [ u_int64_t a; a = 1;],
1105 [ ac_cv_have_u_int64_t="yes" ],
1106 [ ac_cv_have_u_int64_t="no" ]
1109 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1110 AC_DEFINE(HAVE_U_INT64_T)
1114 if test -z "$have_u_int64_t" ; then
1115 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1117 [ #include <sys/bitypes.h> ],
1118 [ u_int64_t a; a = 1],
1120 AC_DEFINE(HAVE_U_INT64_T)
1123 [ AC_MSG_RESULT(no) ]
1127 if test -z "$have_u_intxx_t" ; then
1128 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1131 #include <sys/types.h>
1133 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1134 [ ac_cv_have_uintxx_t="yes" ],
1135 [ ac_cv_have_uintxx_t="no" ]
1138 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1139 AC_DEFINE(HAVE_UINTXX_T)
1143 if test -z "$have_uintxx_t" ; then
1144 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1146 [ #include <stdint.h> ],
1147 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1149 AC_DEFINE(HAVE_UINTXX_T)
1152 [ AC_MSG_RESULT(no) ]
1156 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1157 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1159 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1162 #include <sys/bitypes.h>
1165 int8_t a; int16_t b; int32_t c;
1166 u_int8_t e; u_int16_t f; u_int32_t g;
1167 a = b = c = e = f = g = 1;
1170 AC_DEFINE(HAVE_U_INTXX_T)
1171 AC_DEFINE(HAVE_INTXX_T)
1179 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1182 #include <sys/types.h>
1184 [ u_char foo; foo = 125; ],
1185 [ ac_cv_have_u_char="yes" ],
1186 [ ac_cv_have_u_char="no" ]
1189 if test "x$ac_cv_have_u_char" = "xyes" ; then
1190 AC_DEFINE(HAVE_U_CHAR)
1195 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1197 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1200 #include <sys/types.h>
1202 [ size_t foo; foo = 1235; ],
1203 [ ac_cv_have_size_t="yes" ],
1204 [ ac_cv_have_size_t="no" ]
1207 if test "x$ac_cv_have_size_t" = "xyes" ; then
1208 AC_DEFINE(HAVE_SIZE_T)
1211 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1214 #include <sys/types.h>
1216 [ ssize_t foo; foo = 1235; ],
1217 [ ac_cv_have_ssize_t="yes" ],
1218 [ ac_cv_have_ssize_t="no" ]
1221 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1222 AC_DEFINE(HAVE_SSIZE_T)
1225 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1230 [ clock_t foo; foo = 1235; ],
1231 [ ac_cv_have_clock_t="yes" ],
1232 [ ac_cv_have_clock_t="no" ]
1235 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1236 AC_DEFINE(HAVE_CLOCK_T)
1239 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1242 #include <sys/types.h>
1243 #include <sys/socket.h>
1245 [ sa_family_t foo; foo = 1235; ],
1246 [ ac_cv_have_sa_family_t="yes" ],
1249 #include <sys/types.h>
1250 #include <sys/socket.h>
1251 #include <netinet/in.h>
1253 [ sa_family_t foo; foo = 1235; ],
1254 [ ac_cv_have_sa_family_t="yes" ],
1256 [ ac_cv_have_sa_family_t="no" ]
1260 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1261 AC_DEFINE(HAVE_SA_FAMILY_T)
1264 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1267 #include <sys/types.h>
1269 [ pid_t foo; foo = 1235; ],
1270 [ ac_cv_have_pid_t="yes" ],
1271 [ ac_cv_have_pid_t="no" ]
1274 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1275 AC_DEFINE(HAVE_PID_T)
1278 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1281 #include <sys/types.h>
1283 [ mode_t foo; foo = 1235; ],
1284 [ ac_cv_have_mode_t="yes" ],
1285 [ ac_cv_have_mode_t="no" ]
1288 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1289 AC_DEFINE(HAVE_MODE_T)
1293 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1296 #include <sys/types.h>
1297 #include <sys/socket.h>
1299 [ struct sockaddr_storage s; ],
1300 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1301 [ ac_cv_have_struct_sockaddr_storage="no" ]
1304 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1305 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1308 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1311 #include <sys/types.h>
1312 #include <netinet/in.h>
1314 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1315 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1316 [ ac_cv_have_struct_sockaddr_in6="no" ]
1319 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1320 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1323 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1326 #include <sys/types.h>
1327 #include <netinet/in.h>
1329 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1330 [ ac_cv_have_struct_in6_addr="yes" ],
1331 [ ac_cv_have_struct_in6_addr="no" ]
1334 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1335 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1338 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1341 #include <sys/types.h>
1342 #include <sys/socket.h>
1345 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1346 [ ac_cv_have_struct_addrinfo="yes" ],
1347 [ ac_cv_have_struct_addrinfo="no" ]
1350 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1351 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1354 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1356 [ #include <sys/time.h> ],
1357 [ struct timeval tv; tv.tv_sec = 1;],
1358 [ ac_cv_have_struct_timeval="yes" ],
1359 [ ac_cv_have_struct_timeval="no" ]
1362 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1363 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1364 have_struct_timeval=1
1367 # If we don't have int64_t then we can't compile sftp-server. So don't
1368 # even attempt to do it.
1369 if test "x$ac_cv_have_int64_t" = "xno" -a \
1370 "x$ac_cv_sizeof_long_int" != "x8" -a \
1371 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1374 dnl test snprintf (broken on SCO w/gcc)
1379 #ifdef HAVE_SNPRINTF
1383 char expected_out[50];
1385 #if (SIZEOF_LONG_INT == 8)
1386 long int num = 0x7fffffffffffffff;
1388 long long num = 0x7fffffffffffffffll;
1390 strcpy(expected_out, "9223372036854775807");
1391 snprintf(buf, mazsize, "%lld", num);
1392 if(strcmp(buf, expected_out) != 0)
1399 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1404 dnl Checks for structure members
1405 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1406 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1407 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1408 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1409 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1410 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1411 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1412 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1413 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1414 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1415 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1416 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1417 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1418 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1419 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1420 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1421 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1423 AC_CHECK_MEMBERS([struct stat.st_blksize])
1425 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1426 ac_cv_have_ss_family_in_struct_ss, [
1429 #include <sys/types.h>
1430 #include <sys/socket.h>
1432 [ struct sockaddr_storage s; s.ss_family = 1; ],
1433 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1434 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1437 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1438 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1441 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1442 ac_cv_have___ss_family_in_struct_ss, [
1445 #include <sys/types.h>
1446 #include <sys/socket.h>
1448 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1449 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1450 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1453 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1454 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1457 AC_CACHE_CHECK([for pw_class field in struct passwd],
1458 ac_cv_have_pw_class_in_struct_passwd, [
1463 [ struct passwd p; p.pw_class = 0; ],
1464 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1465 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1468 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1469 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1472 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1473 ac_cv_have_pw_expire_in_struct_passwd, [
1478 [ struct passwd p; p.pw_expire = 0; ],
1479 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1480 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1483 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1484 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1487 AC_CACHE_CHECK([for pw_change field in struct passwd],
1488 ac_cv_have_pw_change_in_struct_passwd, [
1493 [ struct passwd p; p.pw_change = 0; ],
1494 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1495 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1498 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1499 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1502 dnl make sure we're using the real structure members and not defines
1503 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1504 ac_cv_have_accrights_in_msghdr, [
1507 #include <sys/types.h>
1508 #include <sys/socket.h>
1509 #include <sys/uio.h>
1511 #ifdef msg_accrights
1515 m.msg_accrights = 0;
1519 [ ac_cv_have_accrights_in_msghdr="yes" ],
1520 [ ac_cv_have_accrights_in_msghdr="no" ]
1523 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1524 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1527 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1528 ac_cv_have_control_in_msghdr, [
1531 #include <sys/types.h>
1532 #include <sys/socket.h>
1533 #include <sys/uio.h>
1543 [ ac_cv_have_control_in_msghdr="yes" ],
1544 [ ac_cv_have_control_in_msghdr="no" ]
1547 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1548 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1551 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1553 [ extern char *__progname; printf("%s", __progname); ],
1554 [ ac_cv_libc_defines___progname="yes" ],
1555 [ ac_cv_libc_defines___progname="no" ]
1558 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1559 AC_DEFINE(HAVE___PROGNAME)
1562 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1566 [ printf("%s", __FUNCTION__); ],
1567 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1568 [ ac_cv_cc_implements___FUNCTION__="no" ]
1571 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1572 AC_DEFINE(HAVE___FUNCTION__)
1575 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1579 [ printf("%s", __func__); ],
1580 [ ac_cv_cc_implements___func__="yes" ],
1581 [ ac_cv_cc_implements___func__="no" ]
1584 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1585 AC_DEFINE(HAVE___func__)
1588 AC_CACHE_CHECK([whether getopt has optreset support],
1589 ac_cv_have_getopt_optreset, [
1594 [ extern int optreset; optreset = 0; ],
1595 [ ac_cv_have_getopt_optreset="yes" ],
1596 [ ac_cv_have_getopt_optreset="no" ]
1599 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1600 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1603 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1605 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1606 [ ac_cv_libc_defines_sys_errlist="yes" ],
1607 [ ac_cv_libc_defines_sys_errlist="no" ]
1610 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1611 AC_DEFINE(HAVE_SYS_ERRLIST)
1615 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1617 [ extern int sys_nerr; printf("%i", sys_nerr);],
1618 [ ac_cv_libc_defines_sys_nerr="yes" ],
1619 [ ac_cv_libc_defines_sys_nerr="no" ]
1622 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1623 AC_DEFINE(HAVE_SYS_NERR)
1628 # Check whether user wants sectok support
1630 [ --with-sectok Enable smartcard support using libsectok],
1632 if test "x$withval" != "xno" ; then
1633 if test "x$withval" != "xyes" ; then
1634 CPPFLAGS="$CPPFLAGS -I${withval}"
1635 LDFLAGS="$LDFLAGS -L${withval}"
1636 if test ! -z "$need_dash_r" ; then
1637 LDFLAGS="$LDFLAGS -R${withval}"
1639 if test ! -z "$blibpath" ; then
1640 blibpath="$blibpath:${withval}"
1643 AC_CHECK_HEADERS(sectok.h)
1644 if test "$ac_cv_header_sectok_h" != yes; then
1645 AC_MSG_ERROR(Can't find sectok.h)
1647 AC_CHECK_LIB(sectok, sectok_open)
1648 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1649 AC_MSG_ERROR(Can't find libsectok)
1651 AC_DEFINE(SMARTCARD)
1652 AC_DEFINE(USE_SECTOK)
1653 SCARD_MSG="yes, using sectok"
1658 # Check whether user wants OpenSC support
1660 AC_HELP_STRING([--with-opensc=PFX],
1661 [Enable smartcard support using OpenSC]),
1662 opensc_config_prefix="$withval", opensc_config_prefix="")
1663 if test x$opensc_config_prefix != x ; then
1664 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1665 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1666 if test "$OPENSC_CONFIG" != "no"; then
1667 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1668 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1669 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1670 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1671 AC_DEFINE(SMARTCARD)
1672 AC_DEFINE(USE_OPENSC)
1673 SCARD_MSG="yes, using OpenSC"
1677 # Check whether user wants Kerberos 5 support
1679 AC_ARG_WITH(kerberos5,
1680 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1682 if test "x$withval" != "xno" ; then
1683 if test "x$withval" = "xyes" ; then
1684 KRB5ROOT="/usr/local"
1688 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1689 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1692 AC_MSG_CHECKING(whether we are using Heimdal)
1693 AC_TRY_COMPILE([ #include <krb5.h> ],
1694 [ char *tmp = heimdal_version; ],
1695 [ AC_MSG_RESULT(yes)
1697 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1700 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1703 if test ! -z "$need_dash_r" ; then
1704 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1706 if test ! -z "$blibpath" ; then
1707 blibpath="$blibpath:${KRB5ROOT}/lib"
1709 AC_CHECK_LIB(resolv, dn_expand, , )
1715 # Check whether user wants Kerberos 4 support
1717 AC_ARG_WITH(kerberos4,
1718 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1720 if test "x$withval" != "xno" ; then
1721 if test "x$withval" != "xyes" ; then
1722 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1723 LDFLAGS="$LDFLAGS -L${withval}/lib"
1724 if test ! -z "$need_dash_r" ; then
1725 LDFLAGS="$LDFLAGS -R${withval}/lib"
1727 if test ! -z "$blibpath" ; then
1728 blibpath="$blibpath:${withval}/lib"
1731 if test -d /usr/include/kerberosIV ; then
1732 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1736 AC_CHECK_HEADERS(krb.h)
1737 if test "$ac_cv_header_krb_h" != yes; then
1738 AC_MSG_WARN([Cannot find krb.h, build may fail])
1740 AC_CHECK_LIB(krb, main)
1741 if test "$ac_cv_lib_krb_main" != yes; then
1742 AC_CHECK_LIB(krb4, main)
1743 if test "$ac_cv_lib_krb4_main" != yes; then
1744 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1751 AC_CHECK_LIB(des, des_cbc_encrypt)
1752 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1753 AC_CHECK_LIB(des425, des_cbc_encrypt)
1754 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1755 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1762 AC_CHECK_LIB(resolv, dn_expand, , )
1770 # Check whether user wants AFS support
1773 [ --with-afs=PATH Enable AFS support],
1775 if test "x$withval" != "xno" ; then
1777 if test "x$withval" != "xyes" ; then
1778 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1779 LDFLAGS="$LDFLAGS -L${withval}/lib"
1782 if test -z "$KRB4" ; then
1783 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1787 if test ! -z "$AFS_LIBS" ; then
1788 LIBS="$LIBS $AFS_LIBS"
1795 LIBS="$LIBS $KLIBS $K5LIBS"
1797 # Looking for programs, paths and files
1799 [ --with-rsh=PATH Specify path to remote shell program ],
1801 if test "x$withval" != "$no" ; then
1806 AC_PATH_PROG(rsh_path, rsh)
1810 PRIVSEP_PATH=/var/empty
1811 AC_ARG_WITH(privsep-path,
1812 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1814 if test "x$withval" != "$no" ; then
1815 PRIVSEP_PATH=$withval
1819 AC_SUBST(PRIVSEP_PATH)
1822 [ --with-xauth=PATH Specify path to xauth program ],
1824 if test "x$withval" != "xno" ; then
1829 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1830 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1831 xauth_path="/usr/openwin/bin/xauth"
1836 if test -z "$xauth_path" ; then
1837 XAUTH_PATH="undefined"
1838 AC_SUBST(XAUTH_PATH)
1840 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1841 XAUTH_PATH=$xauth_path
1842 AC_SUBST(XAUTH_PATH)
1844 if test ! -z "$rsh_path" ; then
1845 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1848 # Check for mail directory (last resort if we cannot get it from headers)
1849 if test ! -z "$MAIL" ; then
1850 maildir=`dirname $MAIL`
1851 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1854 if test -z "$no_dev_ptmx" ; then
1855 if test "x$disable_ptmx_check" != "xyes" ; then
1856 AC_CHECK_FILE("/dev/ptmx",
1858 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1864 AC_CHECK_FILE("/dev/ptc",
1866 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1871 # Options from here on. Some of these are preset by platform above
1872 AC_ARG_WITH(mantype,
1873 [ --with-mantype=man|cat|doc Set man page type],
1880 AC_MSG_ERROR(invalid man type: $withval)
1885 if test -z "$MANTYPE"; then
1886 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1887 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1889 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1896 if test "$MANTYPE" = "doc"; then
1903 # Check whether to enable MD5 passwords
1905 AC_ARG_WITH(md5-passwords,
1906 [ --with-md5-passwords Enable use of MD5 passwords],
1908 if test "x$withval" != "xno" ; then
1909 AC_DEFINE(HAVE_MD5_PASSWORDS)
1915 # Whether to disable shadow password support
1917 [ --without-shadow Disable shadow password support],
1919 if test "x$withval" = "xno" ; then
1920 AC_DEFINE(DISABLE_SHADOW)
1926 if test -z "$disable_shadow" ; then
1927 AC_MSG_CHECKING([if the systems has expire shadow information])
1930 #include <sys/types.h>
1933 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1934 [ sp_expire_available=yes ], []
1937 if test "x$sp_expire_available" = "xyes" ; then
1939 AC_DEFINE(HAS_SHADOW_EXPIRE)
1945 # Use ip address instead of hostname in $DISPLAY
1946 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1947 DISPLAY_HACK_MSG="yes"
1948 AC_DEFINE(IPADDR_IN_DISPLAY)
1950 DISPLAY_HACK_MSG="no"
1951 AC_ARG_WITH(ipaddr-display,
1952 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1954 if test "x$withval" != "xno" ; then
1955 AC_DEFINE(IPADDR_IN_DISPLAY)
1956 DISPLAY_HACK_MSG="yes"
1962 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1963 if test $ac_cv_func_login_getcapbool = "yes" -a \
1964 $ac_cv_header_login_cap_h = "yes" ; then
1967 # Whether to mess with the default path
1968 SERVER_PATH_MSG="(default)"
1969 AC_ARG_WITH(default-path,
1970 [ --with-default-path= Specify default \$PATH environment for server],
1972 if test "$USES_LOGIN_CONF" = "yes" ; then
1974 --with-default-path=PATH has no effect on this system.
1975 Edit /etc/login.conf instead.])
1976 elif test "x$withval" != "xno" ; then
1977 user_path="$withval"
1978 SERVER_PATH_MSG="$withval"
1981 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1982 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
1986 /* find out what STDPATH is */
1991 #ifndef _PATH_STDPATH
1992 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1994 #include <sys/types.h>
1995 #include <sys/stat.h>
1997 #define DATA "conftest.stdpath"
2004 fd = fopen(DATA,"w");
2008 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2013 ], [ user_path=`cat conftest.stdpath` ],
2014 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2015 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2017 # make sure $bindir is in USER_PATH so scp will work
2018 t_bindir=`eval echo ${bindir}`
2020 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2023 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2025 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2026 if test $? -ne 0 ; then
2027 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2028 if test $? -ne 0 ; then
2029 user_path=$user_path:$t_bindir
2030 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2035 if test "$USES_LOGIN_CONF" != "yes" ; then
2036 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2040 # Set superuser path separately to user path
2041 AC_ARG_WITH(superuser-path,
2042 [ --with-superuser-path= Specify different path for super-user],
2044 if test "x$withval" != "xno" ; then
2045 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2046 superuser_path=$withval
2052 # Whether to force IPv4 by default (needed on broken glibc Linux)
2054 AC_ARG_WITH(ipv4-default,
2055 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2057 if test "x$withval" != "xno" ; then
2058 AC_DEFINE(IPV4_DEFAULT)
2064 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2065 IPV4_IN6_HACK_MSG="no"
2067 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2069 if test "x$withval" != "xno" ; then
2071 AC_DEFINE(IPV4_IN_IPV6)
2072 IPV4_IN6_HACK_MSG="yes"
2077 if test "x$inet6_default_4in6" = "xyes"; then
2078 AC_MSG_RESULT([yes (default)])
2079 AC_DEFINE(IPV4_IN_IPV6)
2080 IPV4_IN6_HACK_MSG="yes"
2082 AC_MSG_RESULT([no (default)])
2087 # Whether to enable BSD auth support
2089 AC_ARG_WITH(bsd-auth,
2090 [ --with-bsd-auth Enable BSD auth support],
2092 if test "x$withval" != "xno" ; then
2099 AC_MSG_CHECKING(whether to install ssh as suid root)
2100 AC_ARG_ENABLE(suid-ssh,
2101 [ --enable-suid-ssh Install ssh as suid root (default)
2102 --disable-suid-ssh Install ssh without suid bit],
2103 [ case "$enableval" in
2108 *) AC_MSG_RESULT(yes)
2118 # Where to place sshd.pid
2120 # make sure the directory exists
2121 if test ! -d $piddir ; then
2122 piddir=`eval echo ${sysconfdir}`
2124 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2128 AC_ARG_WITH(pid-dir,
2129 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2131 if test "x$withval" != "xno" ; then
2133 if test ! -d $piddir ; then
2134 AC_MSG_WARN([** no $piddir directory on this system **])
2140 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2143 dnl allow user to disable some login recording features
2144 AC_ARG_ENABLE(lastlog,
2145 [ --disable-lastlog disable use of lastlog even if detected [no]],
2146 [ AC_DEFINE(DISABLE_LASTLOG) ]
2149 [ --disable-utmp disable use of utmp even if detected [no]],
2150 [ AC_DEFINE(DISABLE_UTMP) ]
2152 AC_ARG_ENABLE(utmpx,
2153 [ --disable-utmpx disable use of utmpx even if detected [no]],
2154 [ AC_DEFINE(DISABLE_UTMPX) ]
2157 [ --disable-wtmp disable use of wtmp even if detected [no]],
2158 [ AC_DEFINE(DISABLE_WTMP) ]
2160 AC_ARG_ENABLE(wtmpx,
2161 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2162 [ AC_DEFINE(DISABLE_WTMPX) ]
2164 AC_ARG_ENABLE(libutil,
2165 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2166 [ AC_DEFINE(DISABLE_LOGIN) ]
2168 AC_ARG_ENABLE(pututline,
2169 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2170 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2172 AC_ARG_ENABLE(pututxline,
2173 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2174 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2176 AC_ARG_WITH(lastlog,
2177 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2179 if test "x$withval" = "xno" ; then
2180 AC_DEFINE(DISABLE_LASTLOG)
2182 conf_lastlog_location=$withval
2187 dnl lastlog, [uw]tmpx? detection
2188 dnl NOTE: set the paths in the platform section to avoid the
2189 dnl need for command-line parameters
2190 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2192 dnl lastlog detection
2193 dnl NOTE: the code itself will detect if lastlog is a directory
2194 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2196 #include <sys/types.h>
2198 #ifdef HAVE_LASTLOG_H
2199 # include <lastlog.h>
2208 [ char *lastlog = LASTLOG_FILE; ],
2209 [ AC_MSG_RESULT(yes) ],
2212 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2214 #include <sys/types.h>
2216 #ifdef HAVE_LASTLOG_H
2217 # include <lastlog.h>
2223 [ char *lastlog = _PATH_LASTLOG; ],
2224 [ AC_MSG_RESULT(yes) ],
2227 system_lastlog_path=no
2232 if test -z "$conf_lastlog_location"; then
2233 if test x"$system_lastlog_path" = x"no" ; then
2234 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2235 if (test -d "$f" || test -f "$f") ; then
2236 conf_lastlog_location=$f
2239 if test -z "$conf_lastlog_location"; then
2240 AC_MSG_WARN([** Cannot find lastlog **])
2241 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2246 if test -n "$conf_lastlog_location"; then
2247 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2251 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2253 #include <sys/types.h>
2259 [ char *utmp = UTMP_FILE; ],
2260 [ AC_MSG_RESULT(yes) ],
2262 system_utmp_path=no ]
2264 if test -z "$conf_utmp_location"; then
2265 if test x"$system_utmp_path" = x"no" ; then
2266 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2267 if test -f $f ; then
2268 conf_utmp_location=$f
2271 if test -z "$conf_utmp_location"; then
2272 AC_DEFINE(DISABLE_UTMP)
2276 if test -n "$conf_utmp_location"; then
2277 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2281 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2283 #include <sys/types.h>
2289 [ char *wtmp = WTMP_FILE; ],
2290 [ AC_MSG_RESULT(yes) ],
2292 system_wtmp_path=no ]
2294 if test -z "$conf_wtmp_location"; then
2295 if test x"$system_wtmp_path" = x"no" ; then
2296 for f in /usr/adm/wtmp /var/log/wtmp; do
2297 if test -f $f ; then
2298 conf_wtmp_location=$f
2301 if test -z "$conf_wtmp_location"; then
2302 AC_DEFINE(DISABLE_WTMP)
2306 if test -n "$conf_wtmp_location"; then
2307 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2311 dnl utmpx detection - I don't know any system so perverse as to require
2312 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2314 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2316 #include <sys/types.h>
2325 [ char *utmpx = UTMPX_FILE; ],
2326 [ AC_MSG_RESULT(yes) ],
2328 system_utmpx_path=no ]
2330 if test -z "$conf_utmpx_location"; then
2331 if test x"$system_utmpx_path" = x"no" ; then
2332 AC_DEFINE(DISABLE_UTMPX)
2335 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2339 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2341 #include <sys/types.h>
2350 [ char *wtmpx = WTMPX_FILE; ],
2351 [ AC_MSG_RESULT(yes) ],
2353 system_wtmpx_path=no ]
2355 if test -z "$conf_wtmpx_location"; then
2356 if test x"$system_wtmpx_path" = x"no" ; then
2357 AC_DEFINE(DISABLE_WTMPX)
2360 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2364 if test ! -z "$blibpath" ; then
2365 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2366 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2369 dnl remove pam and dl because they are in $LIBPAM
2370 if test "$PAM_MSG" = yes ; then
2371 LIBS=`echo $LIBS | sed 's/-lpam //'`
2373 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2374 LIBS=`echo $LIBS | sed 's/-ldl //'`
2378 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2381 # Print summary of options
2383 # Someone please show me a better way :)
2384 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2385 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2386 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2387 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2388 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2389 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2390 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2391 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2392 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2393 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2396 echo "OpenSSH has been configured with the following options:"
2397 echo " User binaries: $B"
2398 echo " System binaries: $C"
2399 echo " Configuration files: $D"
2400 echo " Askpass program: $E"
2401 echo " Manual pages: $F"
2402 echo " PID file: $G"
2403 echo " Privilege separation chroot path: $H"
2404 if test "$USES_LOGIN_CONF" = "yes" ; then
2405 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2407 echo " sshd default user PATH: $I"
2409 if test ! -z "$superuser_path" ; then
2410 echo " sshd superuser user PATH: $J"
2412 echo " Manpage format: $MANTYPE"
2413 echo " PAM support: ${PAM_MSG}"
2414 echo " KerberosIV support: $KRB4_MSG"
2415 echo " KerberosV support: $KRB5_MSG"
2416 echo " Smartcard support: $SCARD_MSG"
2417 echo " AFS support: $AFS_MSG"
2418 echo " S/KEY support: $SKEY_MSG"
2419 echo " TCP Wrappers support: $TCPW_MSG"
2420 echo " MD5 password support: $MD5_MSG"
2421 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2422 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2423 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2424 echo " BSD Auth support: $BSD_AUTH_MSG"
2425 echo " Random number source: $RAND_MSG"
2426 if test ! -z "$USE_RAND_HELPER" ; then
2427 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2432 echo " Host: ${host}"
2433 echo " Compiler: ${CC}"
2434 echo " Compiler flags: ${CFLAGS}"
2435 echo "Preprocessor flags: ${CPPFLAGS}"
2436 echo " Linker flags: ${LDFLAGS}"
2437 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2441 if test "x$PAM_MSG" = "xyes" ; then
2442 echo "PAM is enabled. You may need to install a PAM control file "
2443 echo "for sshd, otherwise password authentication may fail. "
2444 echo "Example PAM control files can be found in the contrib/ "
2449 if test ! -z "$NO_SFTP"; then
2450 echo "sftp-server will be disabled. Your compiler does not "
2451 echo "support 64bit integers."
2455 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2456 echo "WARNING: you are using the builtin random number collection "
2457 echo "service. Please read WARNING.RNG and request that your OS "
2458 echo "vendor includes kernel-based random number collection in "
2459 echo "future versions of your OS."