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)
79 AC_DEFINE(LOGIN_NEEDS_UTMPX)
82 LIBS="$LIBS /usr/lib/textmode.o"
83 AC_DEFINE(HAVE_CYGWIN)
85 AC_DEFINE(DISABLE_SHADOW)
86 AC_DEFINE(IPV4_DEFAULT)
87 AC_DEFINE(IP_TOS_IS_BROKEN)
88 AC_DEFINE(NO_X11_UNIX_SOCKETS)
89 AC_DEFINE(SETGROUPS_NOOP)
92 AC_DEFINE(IP_TOS_IS_BROKEN)
95 AC_DEFINE(BROKEN_GETADDRINFO)
98 if test -z "$GCC"; then
101 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
102 IPADDR_IN_DISPLAY=yes
103 AC_DEFINE(HAVE_SECUREWARE)
105 AC_DEFINE(LOGIN_NO_ENDOPT)
106 AC_DEFINE(LOGIN_NEEDS_UTMPX)
107 AC_DEFINE(DISABLE_SHADOW)
108 AC_DEFINE(DISABLE_UTMP)
109 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
110 LIBS="$LIBS -lxnet -lsec -lsecpw"
111 disable_ptmx_check=yes
114 if test -z "$GCC"; then
117 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
118 IPADDR_IN_DISPLAY=yes
120 AC_DEFINE(LOGIN_NO_ENDOPT)
121 AC_DEFINE(LOGIN_NEEDS_UTMPX)
122 AC_DEFINE(DISABLE_SHADOW)
123 AC_DEFINE(DISABLE_UTMP)
124 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
125 LIBS="$LIBS -lxnet -lsec"
128 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
129 IPADDR_IN_DISPLAY=yes
130 AC_DEFINE(PAM_SUN_CODEBASE)
132 AC_DEFINE(LOGIN_NO_ENDOPT)
133 AC_DEFINE(LOGIN_NEEDS_UTMPX)
134 AC_DEFINE(DISABLE_SHADOW)
135 AC_DEFINE(DISABLE_UTMP)
136 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
137 LIBS="$LIBS -lxnet -lsec"
140 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
142 PATH="$PATH:/usr/etc"
143 AC_DEFINE(BROKEN_INET_NTOA)
144 AC_DEFINE(WITH_ABBREV_NO_TTY)
147 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
149 PATH="$PATH:/usr/etc"
150 AC_DEFINE(WITH_IRIX_ARRAY)
151 AC_DEFINE(WITH_IRIX_PROJECT)
152 AC_DEFINE(WITH_IRIX_AUDIT)
153 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
154 AC_DEFINE(BROKEN_INET_NTOA)
155 AC_DEFINE(WITH_ABBREV_NO_TTY)
159 check_for_libcrypt_later=1
160 AC_DEFINE(DONT_TRY_OTHER_AF)
161 AC_DEFINE(PAM_TTY_KLUDGE)
162 inet6_default_4in6=yes
164 mips-sony-bsd|mips-sony-newsos4)
165 AC_DEFINE(HAVE_NEWS4)
172 check_for_libcrypt_later=1
175 conf_lastlog_location="/usr/adm/lastlog"
176 conf_utmp_location=/etc/utmp
177 conf_wtmp_location=/usr/adm/wtmp
180 AC_DEFINE(BROKEN_REALPATH)
182 AC_DEFINE(BROKEN_SAVED_UIDS)
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
187 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
190 AC_DEFINE(PAM_SUN_CODEBASE)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
192 AC_DEFINE(LOGIN_NEEDS_TERM)
193 AC_DEFINE(PAM_TTY_KLUDGE)
194 # hardwire lastlog location (can't detect it on some versions)
195 conf_lastlog_location="/var/adm/lastlog"
196 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
197 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
198 if test "$sol2ver" -ge 8; then
200 AC_DEFINE(DISABLE_UTMP)
201 AC_DEFINE(DISABLE_WTMP)
207 CPPFLAGS="$CPPFLAGS -DSUNOS4"
208 AC_CHECK_FUNCS(getpwanam)
209 AC_DEFINE(PAM_SUN_CODEBASE)
210 conf_utmp_location=/etc/utmp
211 conf_wtmp_location=/var/adm/wtmp
212 conf_lastlog_location=/var/adm/lastlog
216 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
217 LDFLAGS="$LDFLAGS -L/usr/local/lib"
222 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
223 # /usr/ucblib MUST NOT be searched on ReliantUNIX
224 LDFLAGS="$LDFLAGS -L/usr/local/lib"
225 IPADDR_IN_DISPLAY=yes
227 AC_DEFINE(IP_TOS_IS_BROKEN)
228 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
229 # Attention: always take care to bind libsocket and libnsl before libc,
230 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
233 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
234 LDFLAGS="$LDFLAGS -L/usr/local/lib"
238 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
239 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 setgroups setlogin setproctitle setresgid setreuid \
575 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
576 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
577 truncate utimes 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(daemon,
626 [AC_DEFINE(HAVE_DAEMON)],
627 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
630 AC_CHECK_FUNC(getpagesize,
631 [AC_DEFINE(HAVE_GETPAGESIZE)],
632 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
635 # Check for broken snprintf
636 if test "x$ac_cv_func_snprintf" = "xyes" ; then
637 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
641 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
643 [AC_MSG_RESULT(yes)],
646 AC_DEFINE(BROKEN_SNPRINTF)
647 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
657 [ --with-pam Enable PAM support ],
659 if test "x$withval" != "xno" ; then
660 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
661 AC_MSG_ERROR([PAM headers not found])
664 AC_CHECK_LIB(dl, dlopen, , )
665 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
666 AC_CHECK_FUNCS(pam_getenvlist)
672 if test $ac_cv_lib_dl_dlopen = yes; then
682 # Check for older PAM
683 if test "x$PAM_MSG" = "xyes" ; then
684 # Check PAM strerror arguments (old PAM)
685 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
689 #include <security/pam_appl.h>
691 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
694 AC_DEFINE(HAVE_OLD_PAM)
696 PAM_MSG="yes (old library)"
702 saved_CPPFLAGS="$CPPFLAGS"
703 saved_LDFLAGS="$LDFLAGS"
705 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
707 if test "x$withval" != "xno" ; then
708 if test -d "$withval/lib"; then
709 if test -n "${need_dash_r}"; then
710 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
712 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
715 if test -n "${need_dash_r}"; then
716 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
718 LDFLAGS="-L${withval} ${LDFLAGS}"
721 if test -d "$withval/include"; then
722 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
724 CPPFLAGS="-I${withval} ${CPPFLAGS}"
729 LIBS="$LIBS -lcrypto"
730 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
732 dnl Check default openssl install dir
733 if test -n "${need_dash_r}"; then
734 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
736 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
738 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
739 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
741 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
748 # Sanity check OpenSSL headers
749 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
753 #include <openssl/opensslv.h>
754 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
761 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
765 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
766 # version in OpenSSL. Skip this for PAM
767 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
768 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
772 ### Configure cryptographic random number support
774 # Check wheter OpenSSL seeds itself
775 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
779 #include <openssl/rand.h>
780 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
783 OPENSSL_SEEDS_ITSELF=yes
788 # Default to use of the rand helper if OpenSSL doesn't
795 # Do we want to force the use of the rand helper?
796 AC_ARG_WITH(rand-helper,
797 [ --with-rand-helper Use subprocess to gather strong randomness ],
799 if test "x$withval" = "xno" ; then
800 # Force use of OpenSSL's internal RNG, even if
801 # the previous test showed it to be unseeded.
802 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
803 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
804 OPENSSL_SEEDS_ITSELF=yes
813 # Which randomness source do we use?
814 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
816 AC_DEFINE(OPENSSL_PRNG_ONLY)
817 RAND_MSG="OpenSSL internal ONLY"
818 INSTALL_SSH_RAND_HELPER=""
819 elif test ! -z "$USE_RAND_HELPER" ; then
820 # install rand helper
821 RAND_MSG="ssh-rand-helper"
822 INSTALL_SSH_RAND_HELPER="yes"
824 AC_SUBST(INSTALL_SSH_RAND_HELPER)
826 ### Configuration of ssh-rand-helper
829 AC_ARG_WITH(prngd-port,
830 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
839 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
842 if test ! -z "$withval" ; then
843 PRNGD_PORT="$withval"
844 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
849 # PRNGD Unix domain socket
850 AC_ARG_WITH(prngd-socket,
851 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
855 withval="/var/run/egd-pool"
863 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
867 if test ! -z "$withval" ; then
868 if test ! -z "$PRNGD_PORT" ; then
869 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
871 if test ! -r "$withval" ; then
872 AC_MSG_WARN(Entropy socket is not readable)
874 PRNGD_SOCKET="$withval"
875 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
879 # Check for existing socket only if we don't have a random device already
880 if test "$USE_RAND_HELPER" = yes ; then
881 AC_MSG_CHECKING(for PRNGD/EGD socket)
882 # Insert other locations here
883 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
884 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
886 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
890 if test ! -z "$PRNGD_SOCKET" ; then
891 AC_MSG_RESULT($PRNGD_SOCKET)
893 AC_MSG_RESULT(not found)
899 # Change default command timeout for hashing entropy source
901 AC_ARG_WITH(entropy-timeout,
902 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
904 if test "x$withval" != "xno" ; then
905 entropy_timeout=$withval
909 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
911 ssh_privsep_user=sshd
912 AC_ARG_WITH(privsep-user,
913 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
915 if test -n "$withval"; then
916 ssh_privsep_user=$withval
920 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
922 # We do this little dance with the search path to insure
923 # that programs that we select for use by installed programs
924 # (which may be run by the super-user) come from trusted
925 # locations before they come from the user's private area.
926 # This should help avoid accidentally configuring some
927 # random version of a program in someone's personal bin.
931 test -h /bin 2> /dev/null && PATH=/usr/bin
932 test -d /sbin && PATH=$PATH:/sbin
933 test -d /usr/sbin && PATH=$PATH:/usr/sbin
934 PATH=$PATH:/etc:$OPATH
936 # These programs are used by the command hashing source to gather entropy
937 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
938 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
939 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
940 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
941 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
942 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
943 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
944 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
945 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
946 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
947 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
948 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
949 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
950 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
951 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
952 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
956 # Where does ssh-rand-helper get its randomness from?
957 INSTALL_SSH_PRNG_CMDS=""
958 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
959 if test ! -z "$PRNGD_PORT" ; then
960 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
961 elif test ! -z "$PRNGD_SOCKET" ; then
962 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
964 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
965 RAND_HELPER_CMDHASH=yes
966 INSTALL_SSH_PRNG_CMDS="yes"
969 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
972 # Cheap hack to ensure NEWS-OS libraries are arranged right.
973 if test ! -z "$SONY" ; then
974 LIBS="$LIBS -liberty";
977 # Checks for data types
978 AC_CHECK_SIZEOF(char, 1)
979 AC_CHECK_SIZEOF(short int, 2)
980 AC_CHECK_SIZEOF(int, 4)
981 AC_CHECK_SIZEOF(long int, 4)
982 AC_CHECK_SIZEOF(long long int, 8)
984 # Sanity check long long for some platforms (AIX)
985 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
986 ac_cv_sizeof_long_long_int=0
989 # More checks for data types
990 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
992 [ #include <sys/types.h> ],
994 [ ac_cv_have_u_int="yes" ],
995 [ ac_cv_have_u_int="no" ]
998 if test "x$ac_cv_have_u_int" = "xyes" ; then
999 AC_DEFINE(HAVE_U_INT)
1003 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1005 [ #include <sys/types.h> ],
1006 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1007 [ ac_cv_have_intxx_t="yes" ],
1008 [ ac_cv_have_intxx_t="no" ]
1011 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1012 AC_DEFINE(HAVE_INTXX_T)
1016 if (test -z "$have_intxx_t" && \
1017 test "x$ac_cv_header_stdint_h" = "xyes")
1019 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1021 [ #include <stdint.h> ],
1022 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1024 AC_DEFINE(HAVE_INTXX_T)
1027 [ AC_MSG_RESULT(no) ]
1031 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1033 [ #include <sys/types.h> ],
1034 [ int64_t a; a = 1;],
1035 [ ac_cv_have_int64_t="yes" ],
1036 [ ac_cv_have_int64_t="no" ]
1039 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1040 AC_DEFINE(HAVE_INT64_T)
1044 if test -z "$have_int64_t" ; then
1045 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1047 [ #include <sys/socket.h> ],
1048 [ int64_t a; a = 1],
1050 AC_DEFINE(HAVE_INT64_T)
1053 [ AC_MSG_RESULT(no) ]
1057 if test -z "$have_int64_t" ; then
1058 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1060 [ #include <sys/bitypes.h> ],
1061 [ int64_t a; a = 1],
1063 AC_DEFINE(HAVE_INT64_T)
1066 [ AC_MSG_RESULT(no) ]
1070 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1072 [ #include <sys/types.h> ],
1073 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1074 [ ac_cv_have_u_intxx_t="yes" ],
1075 [ ac_cv_have_u_intxx_t="no" ]
1078 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1079 AC_DEFINE(HAVE_U_INTXX_T)
1083 if test -z "$have_u_intxx_t" ; then
1084 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1086 [ #include <sys/socket.h> ],
1087 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1089 AC_DEFINE(HAVE_U_INTXX_T)
1092 [ AC_MSG_RESULT(no) ]
1096 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1098 [ #include <sys/types.h> ],
1099 [ u_int64_t a; a = 1;],
1100 [ ac_cv_have_u_int64_t="yes" ],
1101 [ ac_cv_have_u_int64_t="no" ]
1104 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1105 AC_DEFINE(HAVE_U_INT64_T)
1109 if test -z "$have_u_int64_t" ; then
1110 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1112 [ #include <sys/bitypes.h> ],
1113 [ u_int64_t a; a = 1],
1115 AC_DEFINE(HAVE_U_INT64_T)
1118 [ AC_MSG_RESULT(no) ]
1122 if test -z "$have_u_intxx_t" ; then
1123 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1126 #include <sys/types.h>
1128 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1129 [ ac_cv_have_uintxx_t="yes" ],
1130 [ ac_cv_have_uintxx_t="no" ]
1133 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1134 AC_DEFINE(HAVE_UINTXX_T)
1138 if test -z "$have_uintxx_t" ; then
1139 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1141 [ #include <stdint.h> ],
1142 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1144 AC_DEFINE(HAVE_UINTXX_T)
1147 [ AC_MSG_RESULT(no) ]
1151 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1152 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1154 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1157 #include <sys/bitypes.h>
1160 int8_t a; int16_t b; int32_t c;
1161 u_int8_t e; u_int16_t f; u_int32_t g;
1162 a = b = c = e = f = g = 1;
1165 AC_DEFINE(HAVE_U_INTXX_T)
1166 AC_DEFINE(HAVE_INTXX_T)
1174 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1177 #include <sys/types.h>
1179 [ u_char foo; foo = 125; ],
1180 [ ac_cv_have_u_char="yes" ],
1181 [ ac_cv_have_u_char="no" ]
1184 if test "x$ac_cv_have_u_char" = "xyes" ; then
1185 AC_DEFINE(HAVE_U_CHAR)
1190 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1192 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1195 #include <sys/types.h>
1197 [ size_t foo; foo = 1235; ],
1198 [ ac_cv_have_size_t="yes" ],
1199 [ ac_cv_have_size_t="no" ]
1202 if test "x$ac_cv_have_size_t" = "xyes" ; then
1203 AC_DEFINE(HAVE_SIZE_T)
1206 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1209 #include <sys/types.h>
1211 [ ssize_t foo; foo = 1235; ],
1212 [ ac_cv_have_ssize_t="yes" ],
1213 [ ac_cv_have_ssize_t="no" ]
1216 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1217 AC_DEFINE(HAVE_SSIZE_T)
1220 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1225 [ clock_t foo; foo = 1235; ],
1226 [ ac_cv_have_clock_t="yes" ],
1227 [ ac_cv_have_clock_t="no" ]
1230 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1231 AC_DEFINE(HAVE_CLOCK_T)
1234 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1237 #include <sys/types.h>
1238 #include <sys/socket.h>
1240 [ sa_family_t foo; foo = 1235; ],
1241 [ ac_cv_have_sa_family_t="yes" ],
1244 #include <sys/types.h>
1245 #include <sys/socket.h>
1246 #include <netinet/in.h>
1248 [ sa_family_t foo; foo = 1235; ],
1249 [ ac_cv_have_sa_family_t="yes" ],
1251 [ ac_cv_have_sa_family_t="no" ]
1255 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1256 AC_DEFINE(HAVE_SA_FAMILY_T)
1259 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1262 #include <sys/types.h>
1264 [ pid_t foo; foo = 1235; ],
1265 [ ac_cv_have_pid_t="yes" ],
1266 [ ac_cv_have_pid_t="no" ]
1269 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1270 AC_DEFINE(HAVE_PID_T)
1273 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1276 #include <sys/types.h>
1278 [ mode_t foo; foo = 1235; ],
1279 [ ac_cv_have_mode_t="yes" ],
1280 [ ac_cv_have_mode_t="no" ]
1283 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1284 AC_DEFINE(HAVE_MODE_T)
1288 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1291 #include <sys/types.h>
1292 #include <sys/socket.h>
1294 [ struct sockaddr_storage s; ],
1295 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1296 [ ac_cv_have_struct_sockaddr_storage="no" ]
1299 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1300 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1303 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1306 #include <sys/types.h>
1307 #include <netinet/in.h>
1309 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1310 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1311 [ ac_cv_have_struct_sockaddr_in6="no" ]
1314 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1315 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1318 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1321 #include <sys/types.h>
1322 #include <netinet/in.h>
1324 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1325 [ ac_cv_have_struct_in6_addr="yes" ],
1326 [ ac_cv_have_struct_in6_addr="no" ]
1329 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1330 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1333 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1336 #include <sys/types.h>
1337 #include <sys/socket.h>
1340 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1341 [ ac_cv_have_struct_addrinfo="yes" ],
1342 [ ac_cv_have_struct_addrinfo="no" ]
1345 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1346 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1349 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1351 [ #include <sys/time.h> ],
1352 [ struct timeval tv; tv.tv_sec = 1;],
1353 [ ac_cv_have_struct_timeval="yes" ],
1354 [ ac_cv_have_struct_timeval="no" ]
1357 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1358 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1359 have_struct_timeval=1
1362 # If we don't have int64_t then we can't compile sftp-server. So don't
1363 # even attempt to do it.
1364 if test "x$ac_cv_have_int64_t" = "xno" -a \
1365 "x$ac_cv_sizeof_long_int" != "x8" -a \
1366 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1369 dnl test snprintf (broken on SCO w/gcc)
1374 #ifdef HAVE_SNPRINTF
1378 char expected_out[50];
1380 #if (SIZEOF_LONG_INT == 8)
1381 long int num = 0x7fffffffffffffff;
1383 long long num = 0x7fffffffffffffffll;
1385 strcpy(expected_out, "9223372036854775807");
1386 snprintf(buf, mazsize, "%lld", num);
1387 if(strcmp(buf, expected_out) != 0)
1394 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1399 dnl Checks for structure members
1400 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1401 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1402 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1403 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1404 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1405 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1406 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1407 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1408 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1409 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1410 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1411 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1412 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1413 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1414 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1415 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1416 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1418 AC_CHECK_MEMBERS([struct stat.st_blksize])
1420 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1421 ac_cv_have_ss_family_in_struct_ss, [
1424 #include <sys/types.h>
1425 #include <sys/socket.h>
1427 [ struct sockaddr_storage s; s.ss_family = 1; ],
1428 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1429 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1432 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1433 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1436 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1437 ac_cv_have___ss_family_in_struct_ss, [
1440 #include <sys/types.h>
1441 #include <sys/socket.h>
1443 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1444 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1445 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1448 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1449 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1452 AC_CACHE_CHECK([for pw_class field in struct passwd],
1453 ac_cv_have_pw_class_in_struct_passwd, [
1458 [ struct passwd p; p.pw_class = 0; ],
1459 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1460 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1463 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1464 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1467 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1468 ac_cv_have_pw_expire_in_struct_passwd, [
1473 [ struct passwd p; p.pw_expire = 0; ],
1474 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1475 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1478 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1479 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1482 AC_CACHE_CHECK([for pw_change field in struct passwd],
1483 ac_cv_have_pw_change_in_struct_passwd, [
1488 [ struct passwd p; p.pw_change = 0; ],
1489 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1490 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1493 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1494 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1497 dnl make sure we're using the real structure members and not defines
1498 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1499 ac_cv_have_accrights_in_msghdr, [
1502 #include <sys/types.h>
1503 #include <sys/socket.h>
1504 #include <sys/uio.h>
1506 #ifdef msg_accrights
1510 m.msg_accrights = 0;
1514 [ ac_cv_have_accrights_in_msghdr="yes" ],
1515 [ ac_cv_have_accrights_in_msghdr="no" ]
1518 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1519 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1522 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1523 ac_cv_have_control_in_msghdr, [
1526 #include <sys/types.h>
1527 #include <sys/socket.h>
1528 #include <sys/uio.h>
1538 [ ac_cv_have_control_in_msghdr="yes" ],
1539 [ ac_cv_have_control_in_msghdr="no" ]
1542 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1543 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1546 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1548 [ extern char *__progname; printf("%s", __progname); ],
1549 [ ac_cv_libc_defines___progname="yes" ],
1550 [ ac_cv_libc_defines___progname="no" ]
1553 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1554 AC_DEFINE(HAVE___PROGNAME)
1557 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1561 [ printf("%s", __FUNCTION__); ],
1562 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1563 [ ac_cv_cc_implements___FUNCTION__="no" ]
1566 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1567 AC_DEFINE(HAVE___FUNCTION__)
1570 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1574 [ printf("%s", __func__); ],
1575 [ ac_cv_cc_implements___func__="yes" ],
1576 [ ac_cv_cc_implements___func__="no" ]
1579 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1580 AC_DEFINE(HAVE___func__)
1583 AC_CACHE_CHECK([whether getopt has optreset support],
1584 ac_cv_have_getopt_optreset, [
1589 [ extern int optreset; optreset = 0; ],
1590 [ ac_cv_have_getopt_optreset="yes" ],
1591 [ ac_cv_have_getopt_optreset="no" ]
1594 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1595 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1598 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1600 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1601 [ ac_cv_libc_defines_sys_errlist="yes" ],
1602 [ ac_cv_libc_defines_sys_errlist="no" ]
1605 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1606 AC_DEFINE(HAVE_SYS_ERRLIST)
1610 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1612 [ extern int sys_nerr; printf("%i", sys_nerr);],
1613 [ ac_cv_libc_defines_sys_nerr="yes" ],
1614 [ ac_cv_libc_defines_sys_nerr="no" ]
1617 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1618 AC_DEFINE(HAVE_SYS_NERR)
1623 # Check whether user wants sectok support
1625 [ --with-sectok Enable smartcard support using libsectok],
1627 if test "x$withval" != "xno" ; then
1628 if test "x$withval" != "xyes" ; then
1629 CPPFLAGS="$CPPFLAGS -I${withval}"
1630 LDFLAGS="$LDFLAGS -L${withval}"
1631 if test ! -z "$need_dash_r" ; then
1632 LDFLAGS="$LDFLAGS -R${withval}"
1634 if test ! -z "$blibpath" ; then
1635 blibpath="$blibpath:${withval}"
1638 AC_CHECK_HEADERS(sectok.h)
1639 if test "$ac_cv_header_sectok_h" != yes; then
1640 AC_MSG_ERROR(Can't find sectok.h)
1642 AC_CHECK_LIB(sectok, sectok_open)
1643 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1644 AC_MSG_ERROR(Can't find libsectok)
1646 AC_DEFINE(SMARTCARD)
1647 AC_DEFINE(USE_SECTOK)
1648 SCARD_MSG="yes, using sectok"
1653 # Check whether user wants OpenSC support
1655 AC_HELP_STRING([--with-opensc=PFX],
1656 [Enable smartcard support using OpenSC]),
1657 opensc_config_prefix="$withval", opensc_config_prefix="")
1658 if test x$opensc_config_prefix != x ; then
1659 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1660 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1661 if test "$OPENSC_CONFIG" != "no"; then
1662 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1663 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1664 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1665 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1666 AC_DEFINE(SMARTCARD)
1667 AC_DEFINE(USE_OPENSC)
1668 SCARD_MSG="yes, using OpenSC"
1672 # Check whether user wants Kerberos 5 support
1674 AC_ARG_WITH(kerberos5,
1675 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1677 if test "x$withval" != "xno" ; then
1678 if test "x$withval" = "xyes" ; then
1679 KRB5ROOT="/usr/local"
1683 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1684 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1687 AC_MSG_CHECKING(whether we are using Heimdal)
1688 AC_TRY_COMPILE([ #include <krb5.h> ],
1689 [ char *tmp = heimdal_version; ],
1690 [ AC_MSG_RESULT(yes)
1692 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1695 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1698 if test ! -z "$need_dash_r" ; then
1699 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1701 if test ! -z "$blibpath" ; then
1702 blibpath="$blibpath:${KRB5ROOT}/lib"
1704 AC_CHECK_LIB(resolv, dn_expand, , )
1710 # Check whether user wants Kerberos 4 support
1712 AC_ARG_WITH(kerberos4,
1713 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1715 if test "x$withval" != "xno" ; then
1716 if test "x$withval" != "xyes" ; then
1717 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1718 LDFLAGS="$LDFLAGS -L${withval}/lib"
1719 if test ! -z "$need_dash_r" ; then
1720 LDFLAGS="$LDFLAGS -R${withval}/lib"
1722 if test ! -z "$blibpath" ; then
1723 blibpath="$blibpath:${withval}/lib"
1726 if test -d /usr/include/kerberosIV ; then
1727 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1731 AC_CHECK_HEADERS(krb.h)
1732 if test "$ac_cv_header_krb_h" != yes; then
1733 AC_MSG_WARN([Cannot find krb.h, build may fail])
1735 AC_CHECK_LIB(krb, main)
1736 if test "$ac_cv_lib_krb_main" != yes; then
1737 AC_CHECK_LIB(krb4, main)
1738 if test "$ac_cv_lib_krb4_main" != yes; then
1739 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1746 AC_CHECK_LIB(des, des_cbc_encrypt)
1747 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1748 AC_CHECK_LIB(des425, des_cbc_encrypt)
1749 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1750 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1757 AC_CHECK_LIB(resolv, dn_expand, , )
1765 # Check whether user wants AFS support
1768 [ --with-afs=PATH Enable AFS support],
1770 if test "x$withval" != "xno" ; then
1772 if test "x$withval" != "xyes" ; then
1773 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1774 LDFLAGS="$LDFLAGS -L${withval}/lib"
1777 if test -z "$KRB4" ; then
1778 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1782 if test ! -z "$AFS_LIBS" ; then
1783 LIBS="$LIBS $AFS_LIBS"
1790 LIBS="$LIBS $KLIBS $K5LIBS"
1792 # Looking for programs, paths and files
1794 [ --with-rsh=PATH Specify path to remote shell program ],
1796 if test "x$withval" != "$no" ; then
1801 AC_PATH_PROG(rsh_path, rsh)
1805 PRIVSEP_PATH=/var/empty
1806 AC_ARG_WITH(privsep-path,
1807 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1809 if test "x$withval" != "$no" ; then
1810 PRIVSEP_PATH=$withval
1814 AC_SUBST(PRIVSEP_PATH)
1817 [ --with-xauth=PATH Specify path to xauth program ],
1819 if test "x$withval" != "xno" ; then
1824 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1825 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1826 xauth_path="/usr/openwin/bin/xauth"
1831 if test -z "$xauth_path" ; then
1832 XAUTH_PATH="undefined"
1833 AC_SUBST(XAUTH_PATH)
1835 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1836 XAUTH_PATH=$xauth_path
1837 AC_SUBST(XAUTH_PATH)
1839 if test ! -z "$rsh_path" ; then
1840 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1843 # Check for mail directory (last resort if we cannot get it from headers)
1844 if test ! -z "$MAIL" ; then
1845 maildir=`dirname $MAIL`
1846 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1849 if test -z "$no_dev_ptmx" ; then
1850 if test "x$disable_ptmx_check" != "xyes" ; then
1851 AC_CHECK_FILE("/dev/ptmx",
1853 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1859 AC_CHECK_FILE("/dev/ptc",
1861 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1866 # Options from here on. Some of these are preset by platform above
1867 AC_ARG_WITH(mantype,
1868 [ --with-mantype=man|cat|doc Set man page type],
1875 AC_MSG_ERROR(invalid man type: $withval)
1880 if test -z "$MANTYPE"; then
1881 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1882 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1884 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1891 if test "$MANTYPE" = "doc"; then
1898 # Check whether to enable MD5 passwords
1900 AC_ARG_WITH(md5-passwords,
1901 [ --with-md5-passwords Enable use of MD5 passwords],
1903 if test "x$withval" != "xno" ; then
1904 AC_DEFINE(HAVE_MD5_PASSWORDS)
1910 # Whether to disable shadow password support
1912 [ --without-shadow Disable shadow password support],
1914 if test "x$withval" = "xno" ; then
1915 AC_DEFINE(DISABLE_SHADOW)
1921 if test -z "$disable_shadow" ; then
1922 AC_MSG_CHECKING([if the systems has expire shadow information])
1925 #include <sys/types.h>
1928 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1929 [ sp_expire_available=yes ], []
1932 if test "x$sp_expire_available" = "xyes" ; then
1934 AC_DEFINE(HAS_SHADOW_EXPIRE)
1940 # Use ip address instead of hostname in $DISPLAY
1941 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1942 DISPLAY_HACK_MSG="yes"
1943 AC_DEFINE(IPADDR_IN_DISPLAY)
1945 DISPLAY_HACK_MSG="no"
1946 AC_ARG_WITH(ipaddr-display,
1947 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1949 if test "x$withval" != "xno" ; then
1950 AC_DEFINE(IPADDR_IN_DISPLAY)
1951 DISPLAY_HACK_MSG="yes"
1957 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1958 if test $ac_cv_func_login_getcapbool = "yes" -a \
1959 $ac_cv_header_login_cap_h = "yes" ; then
1962 # Whether to mess with the default path
1963 SERVER_PATH_MSG="(default)"
1964 AC_ARG_WITH(default-path,
1965 [ --with-default-path= Specify default \$PATH environment for server],
1967 if test "$USES_LOGIN_CONF" = "yes" ; then
1969 --with-default-path=PATH has no effect on this system.
1970 Edit /etc/login.conf instead.])
1971 elif test "x$withval" != "xno" ; then
1972 user_path="$withval"
1973 SERVER_PATH_MSG="$withval"
1976 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1977 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
1981 /* find out what STDPATH is */
1986 #ifndef _PATH_STDPATH
1987 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1989 #include <sys/types.h>
1990 #include <sys/stat.h>
1992 #define DATA "conftest.stdpath"
1999 fd = fopen(DATA,"w");
2003 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2008 ], [ user_path=`cat conftest.stdpath` ],
2009 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2010 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2012 # make sure $bindir is in USER_PATH so scp will work
2013 t_bindir=`eval echo ${bindir}`
2015 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2018 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2020 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2021 if test $? -ne 0 ; then
2022 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2023 if test $? -ne 0 ; then
2024 user_path=$user_path:$t_bindir
2025 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2030 if test "$USES_LOGIN_CONF" != "yes" ; then
2031 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2035 # Set superuser path separately to user path
2036 AC_ARG_WITH(superuser-path,
2037 [ --with-superuser-path= Specify different path for super-user],
2039 if test "x$withval" != "xno" ; then
2040 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2041 superuser_path=$withval
2047 # Whether to force IPv4 by default (needed on broken glibc Linux)
2049 AC_ARG_WITH(ipv4-default,
2050 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2052 if test "x$withval" != "xno" ; then
2053 AC_DEFINE(IPV4_DEFAULT)
2059 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2060 IPV4_IN6_HACK_MSG="no"
2062 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2064 if test "x$withval" != "xno" ; then
2066 AC_DEFINE(IPV4_IN_IPV6)
2067 IPV4_IN6_HACK_MSG="yes"
2072 if test "x$inet6_default_4in6" = "xyes"; then
2073 AC_MSG_RESULT([yes (default)])
2074 AC_DEFINE(IPV4_IN_IPV6)
2075 IPV4_IN6_HACK_MSG="yes"
2077 AC_MSG_RESULT([no (default)])
2082 # Whether to enable BSD auth support
2084 AC_ARG_WITH(bsd-auth,
2085 [ --with-bsd-auth Enable BSD auth support],
2087 if test "x$withval" != "xno" ; then
2094 # Where to place sshd.pid
2096 # make sure the directory exists
2097 if test ! -d $piddir ; then
2098 piddir=`eval echo ${sysconfdir}`
2100 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2104 AC_ARG_WITH(pid-dir,
2105 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2107 if test "x$withval" != "xno" ; then
2109 if test ! -d $piddir ; then
2110 AC_MSG_WARN([** no $piddir directory on this system **])
2116 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2119 dnl allow user to disable some login recording features
2120 AC_ARG_ENABLE(lastlog,
2121 [ --disable-lastlog disable use of lastlog even if detected [no]],
2122 [ AC_DEFINE(DISABLE_LASTLOG) ]
2125 [ --disable-utmp disable use of utmp even if detected [no]],
2126 [ AC_DEFINE(DISABLE_UTMP) ]
2128 AC_ARG_ENABLE(utmpx,
2129 [ --disable-utmpx disable use of utmpx even if detected [no]],
2130 [ AC_DEFINE(DISABLE_UTMPX) ]
2133 [ --disable-wtmp disable use of wtmp even if detected [no]],
2134 [ AC_DEFINE(DISABLE_WTMP) ]
2136 AC_ARG_ENABLE(wtmpx,
2137 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2138 [ AC_DEFINE(DISABLE_WTMPX) ]
2140 AC_ARG_ENABLE(libutil,
2141 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2142 [ AC_DEFINE(DISABLE_LOGIN) ]
2144 AC_ARG_ENABLE(pututline,
2145 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2146 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2148 AC_ARG_ENABLE(pututxline,
2149 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2150 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2152 AC_ARG_WITH(lastlog,
2153 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2155 if test "x$withval" = "xno" ; then
2156 AC_DEFINE(DISABLE_LASTLOG)
2158 conf_lastlog_location=$withval
2163 dnl lastlog, [uw]tmpx? detection
2164 dnl NOTE: set the paths in the platform section to avoid the
2165 dnl need for command-line parameters
2166 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2168 dnl lastlog detection
2169 dnl NOTE: the code itself will detect if lastlog is a directory
2170 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2172 #include <sys/types.h>
2174 #ifdef HAVE_LASTLOG_H
2175 # include <lastlog.h>
2184 [ char *lastlog = LASTLOG_FILE; ],
2185 [ AC_MSG_RESULT(yes) ],
2188 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2190 #include <sys/types.h>
2192 #ifdef HAVE_LASTLOG_H
2193 # include <lastlog.h>
2199 [ char *lastlog = _PATH_LASTLOG; ],
2200 [ AC_MSG_RESULT(yes) ],
2203 system_lastlog_path=no
2208 if test -z "$conf_lastlog_location"; then
2209 if test x"$system_lastlog_path" = x"no" ; then
2210 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2211 if (test -d "$f" || test -f "$f") ; then
2212 conf_lastlog_location=$f
2215 if test -z "$conf_lastlog_location"; then
2216 AC_MSG_WARN([** Cannot find lastlog **])
2217 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2222 if test -n "$conf_lastlog_location"; then
2223 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2227 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2229 #include <sys/types.h>
2235 [ char *utmp = UTMP_FILE; ],
2236 [ AC_MSG_RESULT(yes) ],
2238 system_utmp_path=no ]
2240 if test -z "$conf_utmp_location"; then
2241 if test x"$system_utmp_path" = x"no" ; then
2242 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2243 if test -f $f ; then
2244 conf_utmp_location=$f
2247 if test -z "$conf_utmp_location"; then
2248 AC_DEFINE(DISABLE_UTMP)
2252 if test -n "$conf_utmp_location"; then
2253 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2257 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2259 #include <sys/types.h>
2265 [ char *wtmp = WTMP_FILE; ],
2266 [ AC_MSG_RESULT(yes) ],
2268 system_wtmp_path=no ]
2270 if test -z "$conf_wtmp_location"; then
2271 if test x"$system_wtmp_path" = x"no" ; then
2272 for f in /usr/adm/wtmp /var/log/wtmp; do
2273 if test -f $f ; then
2274 conf_wtmp_location=$f
2277 if test -z "$conf_wtmp_location"; then
2278 AC_DEFINE(DISABLE_WTMP)
2282 if test -n "$conf_wtmp_location"; then
2283 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2287 dnl utmpx detection - I don't know any system so perverse as to require
2288 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2290 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2292 #include <sys/types.h>
2301 [ char *utmpx = UTMPX_FILE; ],
2302 [ AC_MSG_RESULT(yes) ],
2304 system_utmpx_path=no ]
2306 if test -z "$conf_utmpx_location"; then
2307 if test x"$system_utmpx_path" = x"no" ; then
2308 AC_DEFINE(DISABLE_UTMPX)
2311 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2315 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2317 #include <sys/types.h>
2326 [ char *wtmpx = WTMPX_FILE; ],
2327 [ AC_MSG_RESULT(yes) ],
2329 system_wtmpx_path=no ]
2331 if test -z "$conf_wtmpx_location"; then
2332 if test x"$system_wtmpx_path" = x"no" ; then
2333 AC_DEFINE(DISABLE_WTMPX)
2336 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2340 if test ! -z "$blibpath" ; then
2341 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2342 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2345 dnl remove pam and dl because they are in $LIBPAM
2346 if test "$PAM_MSG" = yes ; then
2347 LIBS=`echo $LIBS | sed 's/-lpam //'`
2349 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2350 LIBS=`echo $LIBS | sed 's/-ldl //'`
2354 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2357 # Print summary of options
2359 # Someone please show me a better way :)
2360 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2361 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2362 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2363 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2364 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2365 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2366 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2367 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2368 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2369 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2372 echo "OpenSSH has been configured with the following options:"
2373 echo " User binaries: $B"
2374 echo " System binaries: $C"
2375 echo " Configuration files: $D"
2376 echo " Askpass program: $E"
2377 echo " Manual pages: $F"
2378 echo " PID file: $G"
2379 echo " Privilege separation chroot path: $H"
2380 if test "$USES_LOGIN_CONF" = "yes" ; then
2381 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2383 echo " sshd default user PATH: $I"
2385 if test ! -z "$superuser_path" ; then
2386 echo " sshd superuser user PATH: $J"
2388 echo " Manpage format: $MANTYPE"
2389 echo " PAM support: ${PAM_MSG}"
2390 echo " KerberosIV support: $KRB4_MSG"
2391 echo " KerberosV support: $KRB5_MSG"
2392 echo " Smartcard support: $SCARD_MSG"
2393 echo " AFS support: $AFS_MSG"
2394 echo " S/KEY support: $SKEY_MSG"
2395 echo " TCP Wrappers support: $TCPW_MSG"
2396 echo " MD5 password support: $MD5_MSG"
2397 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2398 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2399 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2400 echo " BSD Auth support: $BSD_AUTH_MSG"
2401 echo " Random number source: $RAND_MSG"
2402 if test ! -z "$USE_RAND_HELPER" ; then
2403 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2408 echo " Host: ${host}"
2409 echo " Compiler: ${CC}"
2410 echo " Compiler flags: ${CFLAGS}"
2411 echo "Preprocessor flags: ${CPPFLAGS}"
2412 echo " Linker flags: ${LDFLAGS}"
2413 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2417 if test "x$PAM_MSG" = "xyes" ; then
2418 echo "PAM is enabled. You may need to install a PAM control file "
2419 echo "for sshd, otherwise password authentication may fail. "
2420 echo "Example PAM control files can be found in the contrib/ "
2425 if test ! -z "$NO_SFTP"; then
2426 echo "sftp-server will be disabled. Your compiler does not "
2427 echo "support 64bit integers."
2431 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2432 echo "WARNING: you are using the builtin random number collection "
2433 echo "service. Please read WARNING.RNG and request that your OS "
2434 echo "vendor includes kernel-based random number collection in "
2435 echo "future versions of your OS."