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)
28 if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32 # Use LOGIN_PROGRAM from environment if possible
33 if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
43 if test -z "$LD" ; then
49 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
53 # Check for some target-specific stuff
57 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
58 LDFLAGS="$LDFLAGS -L/usr/local/lib"
59 if (test "$LD" != "gcc" && test -z "$blibpath"); then
60 blibpath="/usr/lib:/lib:/usr/local/lib"
62 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
63 AC_DEFINE(BROKEN_GETADDRINFO)
64 dnl AIX handles lastlog as part of its login message
65 AC_DEFINE(DISABLE_LASTLOG)
66 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
69 LIBS="$LIBS /usr/lib/textmode.o"
70 AC_DEFINE(HAVE_CYGWIN)
72 AC_DEFINE(DISABLE_SHADOW)
73 AC_DEFINE(IPV4_DEFAULT)
74 AC_DEFINE(IP_TOS_IS_BROKEN)
75 AC_DEFINE(NO_X11_UNIX_SOCKETS)
78 AC_DEFINE(IP_TOS_IS_BROKEN)
81 AC_DEFINE(BROKEN_GETADDRINFO)
84 if test -z "$GCC"; then
87 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
90 AC_DEFINE(DISABLE_SHADOW)
91 AC_DEFINE(DISABLE_UTMP)
92 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
93 LIBS="$LIBS -lxnet -lsec"
96 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
98 AC_DEFINE(PAM_SUN_CODEBASE)
100 AC_DEFINE(DISABLE_SHADOW)
101 AC_DEFINE(DISABLE_UTMP)
102 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
103 LIBS="$LIBS -lxnet -lsec"
106 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
108 PATH="$PATH:/usr/etc"
109 AC_DEFINE(BROKEN_INET_NTOA)
112 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
114 PATH="$PATH:/usr/etc"
115 AC_DEFINE(WITH_IRIX_ARRAY)
116 AC_DEFINE(WITH_IRIX_PROJECT)
117 AC_DEFINE(WITH_IRIX_AUDIT)
118 AC_DEFINE(WITH_IRIX_JOBS)
119 AC_DEFINE(BROKEN_INET_NTOA)
123 check_for_libcrypt_later=1
124 AC_DEFINE(DONT_TRY_OTHER_AF)
125 AC_DEFINE(PAM_TTY_KLUDGE)
126 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
127 inet6_default_4in6=yes
129 mips-sony-bsd|mips-sony-newsos4)
130 AC_DEFINE(HAVE_NEWS4)
132 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
133 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
140 check_for_libcrypt_later=1
143 conf_lastlog_location="/usr/adm/lastlog"
144 conf_utmp_location=/etc/utmp
145 conf_wtmp_location=/usr/adm/wtmp
148 AC_DEFINE(BROKEN_REALPATH)
150 AC_DEFINE(BROKEN_SAVED_UIDS)
151 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
156 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
158 AC_DEFINE(PAM_SUN_CODEBASE)
159 AC_DEFINE(LOGIN_NEEDS_UTMPX)
160 AC_DEFINE(LOGIN_NEEDS_TERM)
161 AC_DEFINE(PAM_TTY_KLUDGE)
162 # hardwire lastlog location (can't detect it on some versions)
163 conf_lastlog_location="/var/adm/lastlog"
164 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
165 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
166 if test "$sol2ver" -ge 8; then
168 AC_DEFINE(DISABLE_UTMP)
169 AC_DEFINE(DISABLE_WTMP)
175 CPPFLAGS="$CPPFLAGS -DSUNOS4"
176 AC_CHECK_FUNCS(getpwanam)
177 AC_DEFINE(PAM_SUN_CODEBASE)
178 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
179 conf_utmp_location=/etc/utmp
180 conf_wtmp_location=/var/adm/wtmp
181 conf_lastlog_location=/var/adm/lastlog
185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
186 LDFLAGS="$LDFLAGS -L/usr/local/lib"
188 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
192 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
193 # /usr/ucblib MUST NOT be searched on ReliantUNIX
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 IPADDR_IN_DISPLAY=yes
197 AC_DEFINE(IP_TOS_IS_BROKEN)
198 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
199 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
200 # Attention: always take care to bind libsocket and libnsl before libc,
201 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
204 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
205 LDFLAGS="$LDFLAGS -L/usr/local/lib"
210 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
216 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
217 LDFLAGS="$LDFLAGS -L/usr/local/lib"
220 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
221 LDFLAGS="$LDFLAGS -L/usr/local/lib"
222 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
223 rsh_path="/usr/bin/rcmd"
226 AC_DEFINE(BROKEN_SYS_TERMIO_H)
228 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
229 AC_DEFINE(DISABLE_SHADOW)
230 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
231 AC_DEFINE(BROKEN_SAVED_UIDS)
232 AC_CHECK_FUNCS(getluid setluid)
234 do_sco3_extra_lib_check=yes
237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
239 LIBS="$LIBS -lprot -lx -ltinfo -lm"
241 rsh_path="/usr/bin/rcmd"
243 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
244 AC_DEFINE(DISABLE_SHADOW)
245 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
246 AC_CHECK_FUNCS(getluid setluid)
253 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
254 LIBS="$LIBS -lgen -lrsc"
257 AC_MSG_CHECKING(for Digital Unix SIA)
260 [ --with-osfsia Enable Digital Unix SIA],
262 if test "x$withval" = "xno" ; then
263 AC_MSG_RESULT(disabled)
268 if test -z "$no_osfsia" ; then
269 if test -f /etc/sia/matrix.conf; then
271 AC_DEFINE(HAVE_OSF_SIA)
272 AC_DEFINE(DISABLE_LOGIN)
273 LIBS="$LIBS -lsecurity -ldb -lm -laud"
282 AC_DEFINE(NO_X11_UNIX_SOCKETS)
283 AC_DEFINE(MISSING_NFDBITS)
284 AC_DEFINE(MISSING_HOWMANY)
285 AC_DEFINE(MISSING_FD_MASK)
289 # Allow user to specify flags
291 [ --with-cflags Specify additional flags to pass to compiler],
293 if test "x$withval" != "xno" ; then
294 CFLAGS="$CFLAGS $withval"
298 AC_ARG_WITH(cppflags,
299 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
301 if test "x$withval" != "xno"; then
302 CPPFLAGS="$CPPFLAGS $withval"
307 [ --with-ldflags Specify additional flags to pass to linker],
309 if test "x$withval" != "xno" ; then
310 LDFLAGS="$LDFLAGS $withval"
315 [ --with-libs Specify additional libraries to link with],
317 if test "x$withval" != "xno" ; then
318 LIBS="$LIBS $withval"
323 # Checks for header files.
324 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
325 getopt.h glob.h lastlog.h limits.h login.h \
326 login_cap.h maillock.h netdb.h netgroup.h \
327 netinet/in_systm.h paths.h poll.h pty.h \
328 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
329 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
330 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
331 sys/stropts.h sys/sysmacros.h sys/time.h \
332 sys/un.h time.h ttyent.h usersec.h \
333 util.h utime.h utmp.h utmpx.h)
335 # Checks for libraries.
336 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
337 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
339 dnl SCO OS3 needs this for libwrap
340 if test "x$with_tcp_wrappers" != "xno" ; then
341 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
342 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
346 AC_CHECK_FUNC(getspnam, ,
347 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
350 [ --without-rpath Disable auto-added -R linker paths],
352 if test "x$withval" = "xno" ; then
355 if test "x$withval" = "xyes" ; then
363 [ --with-zlib=PATH Use zlib in PATH],
365 if test "x$withval" = "xno" ; then
366 AC_MSG_ERROR([*** zlib is required ***])
368 if test -d "$withval/lib"; then
369 if test -n "${need_dash_r}"; then
370 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
372 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
375 if test -n "${need_dash_r}"; then
376 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
378 LDFLAGS="-L${withval} ${LDFLAGS}"
381 if test -d "$withval/include"; then
382 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
384 CPPFLAGS="-I${withval} ${CPPFLAGS}"
389 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
392 AC_CHECK_FUNC(strcasecmp,
393 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
395 AC_CHECK_FUNC(utimes,
396 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
399 dnl Checks for libutil functions
400 AC_CHECK_HEADERS(libutil.h)
401 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
402 AC_CHECK_FUNCS(logout updwtmp logwtmp)
406 # Check for ALTDIRFUNC glob() extension
407 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
408 AC_EGREP_CPP(FOUNDIT,
411 #ifdef GLOB_ALTDIRFUNC
416 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
424 # Check for g.gl_matchc glob() extension
425 AC_MSG_CHECKING(for gl_matchc field in glob_t)
426 AC_EGREP_CPP(FOUNDIT,
429 int main(void){glob_t g; g.gl_matchc = 1;}
432 AC_DEFINE(GLOB_HAS_GL_MATCHC)
440 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
443 #include <sys/types.h>
445 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
447 [AC_MSG_RESULT(yes)],
450 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
454 # Check whether user wants S/Key support
457 [ --with-skey[[=PATH]] Enable S/Key support
458 (optionally in PATH)],
460 if test "x$withval" != "xno" ; then
462 if test "x$withval" != "xyes" ; then
463 CPPFLAGS="$CPPFLAGS -I${withval}/include"
464 LDFLAGS="$LDFLAGS -L${withval}/lib"
471 AC_MSG_CHECKING([for s/key support])
476 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
478 [AC_MSG_RESULT(yes)],
481 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
487 # Check whether user wants TCP wrappers support
489 AC_ARG_WITH(tcp-wrappers,
490 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
491 (optionally in PATH)],
493 if test "x$withval" != "xno" ; then
495 saved_LDFLAGS="$LDFLAGS"
496 saved_CPPFLAGS="$CPPFLAGS"
497 if test -n "${withval}" -a "${withval}" != "yes"; then
498 if test -d "${withval}/lib"; then
499 if test -n "${need_dash_r}"; then
500 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
502 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
505 if test -n "${need_dash_r}"; then
506 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
508 LDFLAGS="-L${withval} ${LDFLAGS}"
511 if test -d "${withval}/include"; then
512 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
514 CPPFLAGS="-I${withval} ${CPPFLAGS}"
518 LIBS="$LIBWRAP $LIBS"
519 AC_MSG_CHECKING(for libwrap)
523 int deny_severity = 0, allow_severity = 0;
533 AC_MSG_ERROR([*** libwrap missing])
541 dnl Checks for library functions.
542 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
543 clock fchmod fchown freeaddrinfo futimes gai_strerror \
544 getaddrinfo getcwd getgrouplist getnameinfo getopt \
545 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
546 inet_ntop innetgr login_getcapbool md5_crypt memmove \
547 mkdtemp on_exit openpty readpassphrase realpath \
548 rresvport_af setdtablesize setegid setenv seteuid \
549 setlogin setproctitle setresgid setreuid setrlimit \
550 setsid setvbuf sigaction sigvec snprintf strerror \
551 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
552 vhangup vsnprintf waitpid __b64_ntop _getpty)
554 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
555 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
556 AC_CHECK_LIB(gen, dirname,[
557 AC_CACHE_CHECK([for broken dirname],
558 ac_cv_have_broken_dirname, [
566 int main(int argc, char **argv) {
569 strncpy(buf,"/etc", 32);
571 if (!s || strncmp(s, "/", 32) != 0) {
578 [ ac_cv_have_broken_dirname="no" ],
579 [ ac_cv_have_broken_dirname="yes" ]
583 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
585 AC_DEFINE(HAVE_DIRNAME)
586 AC_CHECK_HEADERS(libgen.h)
591 dnl Checks for time functions
592 AC_CHECK_FUNCS(gettimeofday time)
593 dnl Checks for utmp functions
594 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
595 AC_CHECK_FUNCS(utmpname)
596 dnl Checks for utmpx functions
597 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
598 AC_CHECK_FUNCS(setutxent utmpxname)
600 AC_CHECK_FUNC(getuserattr,
601 [AC_DEFINE(HAVE_GETUSERATTR)],
602 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
605 AC_CHECK_FUNC(daemon,
606 [AC_DEFINE(HAVE_DAEMON)],
607 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
610 AC_CHECK_FUNC(getpagesize,
611 [AC_DEFINE(HAVE_GETPAGESIZE)],
612 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
615 # Check for broken snprintf
616 if test "x$ac_cv_func_snprintf" = "xyes" ; then
617 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
621 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
623 [AC_MSG_RESULT(yes)],
626 AC_DEFINE(BROKEN_SNPRINTF)
627 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
637 [ --with-pam Enable PAM support ],
639 if test "x$withval" != "xno" ; then
640 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
641 AC_MSG_ERROR([PAM headers not found])
644 AC_CHECK_LIB(dl, dlopen, , )
645 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
646 AC_CHECK_FUNCS(pam_getenvlist)
652 if test $ac_cv_lib_dl_dlopen = yes; then
662 # Check for older PAM
663 if test "x$PAM_MSG" = "xyes" ; then
664 # Check PAM strerror arguments (old PAM)
665 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
669 #include <security/pam_appl.h>
671 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
674 AC_DEFINE(HAVE_OLD_PAM)
676 PAM_MSG="yes (old library)"
681 # The big search for OpenSSL
683 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
685 if test "x$withval" != "xno" ; then
692 saved_LDFLAGS="$LDFLAGS"
693 saved_CPPFLAGS="$CPPFLAGS"
694 if test "x$prefix" != "xNONE" ; then
695 tryssldir="$tryssldir $prefix"
697 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
698 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
699 CPPFLAGS="$saved_CPPFLAGS"
700 LDFLAGS="$saved_LDFLAGS"
701 LIBS="$saved_LIBS -lcrypto"
703 # Skip directories if they don't exist
704 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
707 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
708 # Try to use $ssldir/lib if it exists, otherwise
710 if test -d "$ssldir/lib" ; then
711 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
712 if test ! -z "$need_dash_r" ; then
713 LDFLAGS="-R$ssldir/lib $LDFLAGS"
716 LDFLAGS="-L$ssldir $saved_LDFLAGS"
717 if test ! -z "$need_dash_r" ; then
718 LDFLAGS="-R$ssldir $LDFLAGS"
721 # Try to use $ssldir/include if it exists, otherwise
723 if test -d "$ssldir/include" ; then
724 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
726 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
730 # Basic test to check for compatible version and correct linking
731 # *does not* test for RSA - that comes later.
735 #include <openssl/rand.h>
739 memset(a, 0, sizeof(a));
740 RAND_add(a, sizeof(a), sizeof(a));
741 return(RAND_status() <= 0);
750 if test ! -z "$found_crypto" ; then
755 if test -z "$found_crypto" ; then
756 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
758 if test -z "$ssldir" ; then
762 ac_cv_openssldir=$ssldir
765 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
766 AC_DEFINE(HAVE_OPENSSL)
767 dnl Need to recover ssldir - test above runs in subshell
768 ssldir=$ac_cv_openssldir
769 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
770 # Try to use $ssldir/lib if it exists, otherwise
772 if test -d "$ssldir/lib" ; then
773 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
774 if test ! -z "$need_dash_r" ; then
775 LDFLAGS="-R$ssldir/lib $LDFLAGS"
778 LDFLAGS="-L$ssldir $saved_LDFLAGS"
779 if test ! -z "$need_dash_r" ; then
780 LDFLAGS="-R$ssldir $LDFLAGS"
783 # Try to use $ssldir/include if it exists, otherwise
785 if test -d "$ssldir/include" ; then
786 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
788 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
792 LIBS="$saved_LIBS -lcrypto"
794 # Now test RSA support
796 AC_MSG_CHECKING([for RSA support])
797 for WANTS_RSAREF in "" 1 ; do
798 if test -z "$WANTS_RSAREF" ; then
801 LIBS="$saved_LIBS -lRSAglue -lrsaref"
805 #include <openssl/rand.h>
806 #include <openssl/rsa.h>
807 #include <openssl/bn.h>
808 #include <openssl/sha.h>
811 int num; RSA *key; static unsigned char p_in[] = "blahblah";
812 unsigned char c[256], p[256];
813 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
814 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
815 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
816 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
826 if test ! -z "$no_rsa" ; then
827 AC_MSG_RESULT(disabled)
830 if test -z "$rsa_works" ; then
831 AC_MSG_WARN([*** No RSA support found *** ])
834 if test -z "$WANTS_RSAREF" ; then
838 RSA_MSG="yes (using RSAref)"
839 AC_MSG_RESULT(using RSAref)
840 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
845 # Sanity check OpenSSL headers
846 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
850 #include <openssl/opensslv.h>
851 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
858 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
862 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
863 # version in OpenSSL. Skip this for PAM
864 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
865 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
869 ### Configure cryptographic random number support
871 # Check wheter OpenSSL seeds itself
872 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
876 #include <openssl/rand.h>
877 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
880 OPENSSL_SEEDS_ITSELF=yes
885 # Default to use of the rand helper if OpenSSL doesn't
892 # Do we want to force the use of the rand helper?
893 AC_ARG_WITH(rand-helper,
894 [ --with-rand-helper Use subprocess to gather strong randomness ],
896 if test "x$withval" = "xno" ; then
897 # Force use of OpenSSL's internal RNG, even if
898 # the previous test showed it to be unseeded.
899 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
900 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
901 OPENSSL_SEEDS_ITSELF=yes
910 # Which randomness source do we use?
911 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
913 AC_DEFINE(OPENSSL_PRNG_ONLY)
914 RAND_MSG="OpenSSL internal ONLY"
915 INSTALL_SSH_RAND_HELPER=""
916 elif test ! -z "$USE_RAND_HELPER" ; then
917 # install rand helper
918 RAND_MSG="ssh-rand-helper"
919 INSTALL_SSH_RAND_HELPER="yes"
921 AC_SUBST(INSTALL_SSH_RAND_HELPER)
923 ### Configuration of ssh-rand-helper
926 AC_ARG_WITH(prngd-port,
927 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
936 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
939 if test ! -z "$withval" ; then
940 PRNGD_PORT="$withval"
941 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
946 # PRNGD Unix domain socket
947 AC_ARG_WITH(prngd-socket,
948 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
952 withval="/var/run/egd-pool"
960 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
964 if test ! -z "$withval" ; then
965 if test ! -z "$PRNGD_PORT" ; then
966 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
968 if test ! -r "$withval" ; then
969 AC_MSG_WARN(Entropy socket is not readable)
971 PRNGD_SOCKET="$withval"
972 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
976 # Check for existing socket only if we don't have a random device already
977 if test "$USE_RAND_HELPER" = yes ; then
978 AC_MSG_CHECKING(for PRNGD/EGD socket)
979 # Insert other locations here
980 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
981 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
983 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
987 if test ! -z "$PRNGD_SOCKET" ; then
988 AC_MSG_RESULT($PRNGD_SOCKET)
990 AC_MSG_RESULT(not found)
996 # Change default command timeout for hashing entropy source
998 AC_ARG_WITH(entropy-timeout,
999 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1001 if test "x$withval" != "xno" ; then
1002 entropy_timeout=$withval
1007 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1009 # We do this little dance with the search path to insure
1010 # that programs that we select for use by installed programs
1011 # (which may be run by the super-user) come from trusted
1012 # locations before they come from the user's private area.
1013 # This should help avoid accidentally configuring some
1014 # random version of a program in someone's personal bin.
1018 /bin/test -L /bin && PATH=/usr/bin
1019 test -d /sbin && PATH=$PATH:/sbin
1020 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1021 PATH=$PATH:/etc:$OPATH
1023 # These programs are used by the command hashing source to gather entropy
1024 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1025 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1026 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1027 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1028 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1029 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1030 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1031 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1032 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1033 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1034 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1035 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1036 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1037 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1038 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1039 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1043 # Where does ssh-rand-helper get its randomness from?
1044 INSTALL_SSH_PRNG_CMDS=""
1045 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1046 if test ! -z "$PRNGD_PORT" ; then
1047 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1048 elif test ! -z "$PRNGD_SOCKET" ; then
1049 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1051 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1052 RAND_HELPER_CMDHASH=yes
1053 INSTALL_SSH_PRNG_CMDS="yes"
1056 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1059 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1060 if test ! -z "$SONY" ; then
1061 LIBS="$LIBS -liberty";
1064 # Checks for data types
1065 AC_CHECK_SIZEOF(char, 1)
1066 AC_CHECK_SIZEOF(short int, 2)
1067 AC_CHECK_SIZEOF(int, 4)
1068 AC_CHECK_SIZEOF(long int, 4)
1069 AC_CHECK_SIZEOF(long long int, 8)
1071 # More checks for data types
1072 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1074 [ #include <sys/types.h> ],
1076 [ ac_cv_have_u_int="yes" ],
1077 [ ac_cv_have_u_int="no" ]
1080 if test "x$ac_cv_have_u_int" = "xyes" ; then
1081 AC_DEFINE(HAVE_U_INT)
1085 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1087 [ #include <sys/types.h> ],
1088 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1089 [ ac_cv_have_intxx_t="yes" ],
1090 [ ac_cv_have_intxx_t="no" ]
1093 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1094 AC_DEFINE(HAVE_INTXX_T)
1098 if (test -z "$have_intxx_t" && \
1099 test "x$ac_cv_header_stdint_h" = "xyes")
1101 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1103 [ #include <stdint.h> ],
1104 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1106 AC_DEFINE(HAVE_INTXX_T)
1109 [ AC_MSG_RESULT(no) ]
1113 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1115 [ #include <sys/types.h> ],
1116 [ int64_t a; a = 1;],
1117 [ ac_cv_have_int64_t="yes" ],
1118 [ ac_cv_have_int64_t="no" ]
1121 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1122 AC_DEFINE(HAVE_INT64_T)
1126 if test -z "$have_int64_t" ; then
1127 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1129 [ #include <sys/socket.h> ],
1130 [ int64_t a; a = 1],
1132 AC_DEFINE(HAVE_INT64_T)
1135 [ AC_MSG_RESULT(no) ]
1139 if test -z "$have_int64_t" ; then
1140 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1142 [ #include <sys/bitypes.h> ],
1143 [ int64_t a; a = 1],
1145 AC_DEFINE(HAVE_INT64_T)
1148 [ AC_MSG_RESULT(no) ]
1152 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1154 [ #include <sys/types.h> ],
1155 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1156 [ ac_cv_have_u_intxx_t="yes" ],
1157 [ ac_cv_have_u_intxx_t="no" ]
1160 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1161 AC_DEFINE(HAVE_U_INTXX_T)
1165 if test -z "$have_u_intxx_t" ; then
1166 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1168 [ #include <sys/socket.h> ],
1169 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1171 AC_DEFINE(HAVE_U_INTXX_T)
1174 [ AC_MSG_RESULT(no) ]
1178 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1180 [ #include <sys/types.h> ],
1181 [ u_int64_t a; a = 1;],
1182 [ ac_cv_have_u_int64_t="yes" ],
1183 [ ac_cv_have_u_int64_t="no" ]
1186 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1187 AC_DEFINE(HAVE_U_INT64_T)
1191 if test -z "$have_u_int64_t" ; then
1192 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1194 [ #include <sys/bitypes.h> ],
1195 [ u_int64_t a; a = 1],
1197 AC_DEFINE(HAVE_U_INT64_T)
1200 [ AC_MSG_RESULT(no) ]
1204 if test -z "$have_u_intxx_t" ; then
1205 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1208 #include <sys/types.h>
1210 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1211 [ ac_cv_have_uintxx_t="yes" ],
1212 [ ac_cv_have_uintxx_t="no" ]
1215 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1216 AC_DEFINE(HAVE_UINTXX_T)
1220 if test -z "$have_uintxx_t" ; then
1221 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1223 [ #include <stdint.h> ],
1224 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1226 AC_DEFINE(HAVE_UINTXX_T)
1229 [ AC_MSG_RESULT(no) ]
1233 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1234 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1236 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1239 #include <sys/bitypes.h>
1242 int8_t a; int16_t b; int32_t c;
1243 u_int8_t e; u_int16_t f; u_int32_t g;
1244 a = b = c = e = f = g = 1;
1247 AC_DEFINE(HAVE_U_INTXX_T)
1248 AC_DEFINE(HAVE_INTXX_T)
1256 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1259 #include <sys/types.h>
1261 [ u_char foo; foo = 125; ],
1262 [ ac_cv_have_u_char="yes" ],
1263 [ ac_cv_have_u_char="no" ]
1266 if test "x$ac_cv_have_u_char" = "xyes" ; then
1267 AC_DEFINE(HAVE_U_CHAR)
1272 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1274 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1277 #include <sys/types.h>
1279 [ size_t foo; foo = 1235; ],
1280 [ ac_cv_have_size_t="yes" ],
1281 [ ac_cv_have_size_t="no" ]
1284 if test "x$ac_cv_have_size_t" = "xyes" ; then
1285 AC_DEFINE(HAVE_SIZE_T)
1288 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1291 #include <sys/types.h>
1293 [ ssize_t foo; foo = 1235; ],
1294 [ ac_cv_have_ssize_t="yes" ],
1295 [ ac_cv_have_ssize_t="no" ]
1298 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1299 AC_DEFINE(HAVE_SSIZE_T)
1302 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1307 [ clock_t foo; foo = 1235; ],
1308 [ ac_cv_have_clock_t="yes" ],
1309 [ ac_cv_have_clock_t="no" ]
1312 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1313 AC_DEFINE(HAVE_CLOCK_T)
1316 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1319 #include <sys/types.h>
1320 #include <sys/socket.h>
1322 [ sa_family_t foo; foo = 1235; ],
1323 [ ac_cv_have_sa_family_t="yes" ],
1326 #include <sys/types.h>
1327 #include <sys/socket.h>
1328 #include <netinet/in.h>
1330 [ sa_family_t foo; foo = 1235; ],
1331 [ ac_cv_have_sa_family_t="yes" ],
1333 [ ac_cv_have_sa_family_t="no" ]
1337 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1338 AC_DEFINE(HAVE_SA_FAMILY_T)
1341 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1344 #include <sys/types.h>
1346 [ pid_t foo; foo = 1235; ],
1347 [ ac_cv_have_pid_t="yes" ],
1348 [ ac_cv_have_pid_t="no" ]
1351 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1352 AC_DEFINE(HAVE_PID_T)
1355 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1358 #include <sys/types.h>
1360 [ mode_t foo; foo = 1235; ],
1361 [ ac_cv_have_mode_t="yes" ],
1362 [ ac_cv_have_mode_t="no" ]
1365 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1366 AC_DEFINE(HAVE_MODE_T)
1370 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1373 #include <sys/types.h>
1374 #include <sys/socket.h>
1376 [ struct sockaddr_storage s; ],
1377 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1378 [ ac_cv_have_struct_sockaddr_storage="no" ]
1381 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1382 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1385 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1388 #include <sys/types.h>
1389 #include <netinet/in.h>
1391 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1392 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1393 [ ac_cv_have_struct_sockaddr_in6="no" ]
1396 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1397 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1400 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1403 #include <sys/types.h>
1404 #include <netinet/in.h>
1406 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1407 [ ac_cv_have_struct_in6_addr="yes" ],
1408 [ ac_cv_have_struct_in6_addr="no" ]
1411 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1412 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1415 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1418 #include <sys/types.h>
1419 #include <sys/socket.h>
1422 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1423 [ ac_cv_have_struct_addrinfo="yes" ],
1424 [ ac_cv_have_struct_addrinfo="no" ]
1427 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1428 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1431 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1433 [ #include <sys/time.h> ],
1434 [ struct timeval tv; tv.tv_sec = 1;],
1435 [ ac_cv_have_struct_timeval="yes" ],
1436 [ ac_cv_have_struct_timeval="no" ]
1439 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1440 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1441 have_struct_timeval=1
1444 # If we don't have int64_t then we can't compile sftp-server. So don't
1445 # even attempt to do it.
1446 if test "x$ac_cv_have_int64_t" = "xno" -a \
1447 "x$ac_cv_sizeof_long_int" != "x8" -a \
1448 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1451 dnl test snprintf (broken on SCO w/gcc)
1456 #ifdef HAVE_SNPRINTF
1460 char expected_out[50];
1462 #if (SIZEOF_LONG_INT == 8)
1463 long int num = 0x7fffffffffffffff;
1465 long long num = 0x7fffffffffffffffll;
1467 strcpy(expected_out, "9223372036854775807");
1468 snprintf(buf, mazsize, "%lld", num);
1469 if(strcmp(buf, expected_out) != 0)
1476 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1481 dnl Checks for structure members
1482 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1483 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1484 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1485 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1486 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1487 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1488 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1489 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1490 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1491 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1492 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1493 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1494 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1495 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1496 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1497 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1498 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1500 AC_CHECK_MEMBERS([struct stat.st_blksize])
1502 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1503 ac_cv_have_ss_family_in_struct_ss, [
1506 #include <sys/types.h>
1507 #include <sys/socket.h>
1509 [ struct sockaddr_storage s; s.ss_family = 1; ],
1510 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1511 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1514 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1515 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1518 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1519 ac_cv_have___ss_family_in_struct_ss, [
1522 #include <sys/types.h>
1523 #include <sys/socket.h>
1525 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1526 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1527 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1530 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1531 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1534 AC_CACHE_CHECK([for pw_class field in struct passwd],
1535 ac_cv_have_pw_class_in_struct_passwd, [
1540 [ struct passwd p; p.pw_class = 0; ],
1541 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1542 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1545 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1546 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1549 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1550 ac_cv_have_pw_expire_in_struct_passwd, [
1555 [ struct passwd p; p.pw_expire = 0; ],
1556 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1557 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1560 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1561 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1564 AC_CACHE_CHECK([for pw_change field in struct passwd],
1565 ac_cv_have_pw_change_in_struct_passwd, [
1570 [ struct passwd p; p.pw_change = 0; ],
1571 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1572 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1575 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1576 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1579 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1580 ac_cv_have_accrights_in_msghdr, [
1583 #include <sys/socket.h>
1584 #include <sys/uio.h>
1586 [ struct msghdr m; m.msg_accrights = 0; ],
1587 [ ac_cv_have_accrights_in_msghdr="yes" ],
1588 [ ac_cv_have_accrights_in_msghdr="no" ]
1591 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1592 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1595 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1597 [ extern char *__progname; printf("%s", __progname); ],
1598 [ ac_cv_libc_defines___progname="yes" ],
1599 [ ac_cv_libc_defines___progname="no" ]
1602 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1603 AC_DEFINE(HAVE___PROGNAME)
1606 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1610 [ printf("%s", __FUNCTION__); ],
1611 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1612 [ ac_cv_cc_implements___FUNCTION__="no" ]
1615 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1616 AC_DEFINE(HAVE___FUNCTION__)
1619 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1623 [ printf("%s", __func__); ],
1624 [ ac_cv_cc_implements___func__="yes" ],
1625 [ ac_cv_cc_implements___func__="no" ]
1628 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1629 AC_DEFINE(HAVE___func__)
1632 AC_CACHE_CHECK([whether getopt has optreset support],
1633 ac_cv_have_getopt_optreset, [
1638 [ extern int optreset; optreset = 0; ],
1639 [ ac_cv_have_getopt_optreset="yes" ],
1640 [ ac_cv_have_getopt_optreset="no" ]
1643 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1644 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1647 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1649 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1650 [ ac_cv_libc_defines_sys_errlist="yes" ],
1651 [ ac_cv_libc_defines_sys_errlist="no" ]
1654 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1655 AC_DEFINE(HAVE_SYS_ERRLIST)
1659 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1661 [ extern int sys_nerr; printf("%i", sys_nerr);],
1662 [ ac_cv_libc_defines_sys_nerr="yes" ],
1663 [ ac_cv_libc_defines_sys_nerr="no" ]
1666 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1667 AC_DEFINE(HAVE_SYS_NERR)
1671 # Check whether user wants Kerberos support
1673 AC_ARG_WITH(smartcard,
1674 [ --with-smartcard Enable smartcard support],
1676 if test "x$withval" != "xno" ; then
1677 if test "x$withval" != "xyes" ; then
1678 CPPFLAGS="$CPPFLAGS -I${withval}"
1679 LDFLAGS="$LDFLAGS -L${withval}"
1680 if test ! -z "$need_dash_r" ; then
1681 LDFLAGS="$LDFLAGS -R${withval}"
1683 if test ! -z "$blibpath" ; then
1684 blibpath="$blibpath:${withval}"
1687 AC_CHECK_HEADERS(sectok.h)
1688 if test "$ac_cv_header_sectok_h" != yes; then
1689 AC_MSG_ERROR(Can't find sectok.h)
1691 AC_CHECK_LIB(sectok, sectok_open)
1692 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1693 AC_MSG_ERROR(Can't find libsectok)
1695 AC_DEFINE(SMARTCARD)
1701 # Check whether user wants Kerberos support
1703 AC_ARG_WITH(kerberos4,
1704 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1706 if test "x$withval" != "xno" ; then
1707 if test "x$withval" != "xyes" ; then
1708 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1709 LDFLAGS="$LDFLAGS -L${withval}/lib"
1710 if test ! -z "$need_dash_r" ; then
1711 LDFLAGS="$LDFLAGS -R${withval}/lib"
1713 if test ! -z "$blibpath" ; then
1714 blibpath="$blibpath:${withval}/lib"
1717 if test -d /usr/include/kerberosIV ; then
1718 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1722 AC_CHECK_HEADERS(krb.h)
1723 if test "$ac_cv_header_krb_h" != yes; then
1724 AC_MSG_WARN([Cannot find krb.h, build may fail])
1726 AC_CHECK_LIB(krb, main)
1727 if test "$ac_cv_lib_krb_main" != yes; then
1728 AC_CHECK_LIB(krb4, main)
1729 if test "$ac_cv_lib_krb4_main" != yes; then
1730 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1737 AC_CHECK_LIB(des, des_cbc_encrypt)
1738 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1739 AC_CHECK_LIB(des425, des_cbc_encrypt)
1740 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1741 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1748 AC_CHECK_LIB(resolv, dn_expand, , )
1756 # Check whether user wants AFS support
1759 [ --with-afs=PATH Enable AFS support],
1761 if test "x$withval" != "xno" ; then
1763 if test "x$withval" != "xyes" ; then
1764 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1765 LDFLAGS="$LDFLAGS -L${withval}/lib"
1768 if test -z "$KRB4" ; then
1769 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1773 if test ! -z "$AFS_LIBS" ; then
1774 LIBS="$LIBS $AFS_LIBS"
1783 # Looking for programs, paths and files
1785 [ --with-rsh=PATH Specify path to remote shell program ],
1787 if test "x$withval" != "$no" ; then
1792 AC_PATH_PROG(rsh_path, rsh)
1797 [ --with-xauth=PATH Specify path to xauth program ],
1799 if test "x$withval" != "xno" ; then
1804 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1805 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1806 xauth_path="/usr/openwin/bin/xauth"
1811 if test -z "$xauth_path" ; then
1812 XAUTH_PATH="undefined"
1813 AC_SUBST(XAUTH_PATH)
1815 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1816 XAUTH_PATH=$xauth_path
1817 AC_SUBST(XAUTH_PATH)
1819 if test ! -z "$rsh_path" ; then
1820 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1823 # Check for mail directory (last resort if we cannot get it from headers)
1824 if test ! -z "$MAIL" ; then
1825 maildir=`dirname $MAIL`
1826 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1829 if test -z "$no_dev_ptmx" ; then
1830 AC_CHECK_FILE("/dev/ptmx",
1832 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1837 AC_CHECK_FILE("/dev/ptc",
1839 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1844 # Options from here on. Some of these are preset by platform above
1845 AC_ARG_WITH(mantype,
1846 [ --with-mantype=man|cat|doc Set man page type],
1853 AC_MSG_ERROR(invalid man type: $withval)
1858 if test -z "$MANTYPE"; then
1859 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1860 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1862 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1869 if test "$MANTYPE" = "doc"; then
1876 # Check whether to enable MD5 passwords
1878 AC_ARG_WITH(md5-passwords,
1879 [ --with-md5-passwords Enable use of MD5 passwords],
1881 if test "x$withval" != "xno" ; then
1882 AC_DEFINE(HAVE_MD5_PASSWORDS)
1888 # Whether to disable shadow password support
1890 [ --without-shadow Disable shadow password support],
1892 if test "x$withval" = "xno" ; then
1893 AC_DEFINE(DISABLE_SHADOW)
1899 if test -z "$disable_shadow" ; then
1900 AC_MSG_CHECKING([if the systems has expire shadow information])
1903 #include <sys/types.h>
1906 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1907 [ sp_expire_available=yes ], []
1910 if test "x$sp_expire_available" = "xyes" ; then
1912 AC_DEFINE(HAS_SHADOW_EXPIRE)
1918 # Use ip address instead of hostname in $DISPLAY
1919 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1920 DISPLAY_HACK_MSG="yes"
1921 AC_DEFINE(IPADDR_IN_DISPLAY)
1923 DISPLAY_HACK_MSG="no"
1924 AC_ARG_WITH(ipaddr-display,
1925 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1927 if test "x$withval" != "xno" ; then
1928 AC_DEFINE(IPADDR_IN_DISPLAY)
1929 DISPLAY_HACK_MSG="yes"
1935 # Whether to mess with the default path
1936 SERVER_PATH_MSG="(default)"
1937 AC_ARG_WITH(default-path,
1938 [ --with-default-path=PATH Specify default \$PATH environment for server],
1940 if test "x$withval" != "xno" ; then
1941 user_path="$withval"
1942 SERVER_PATH_MSG="$withval"
1948 /* find out what STDPATH is */
1953 #ifndef _PATH_STDPATH
1954 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1956 #include <sys/types.h>
1957 #include <sys/stat.h>
1959 #define DATA "conftest.stdpath"
1966 fd = fopen(DATA,"w");
1970 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1975 ], [ user_path=`cat conftest.stdpath` ],
1976 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1977 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1979 # make sure $bindir is in USER_PATH so scp will work
1980 t_bindir=`eval echo ${bindir}`
1982 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1985 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1987 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1988 if test $? -ne 0 ; then
1989 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1990 if test $? -ne 0 ; then
1991 user_path=$user_path:$t_bindir
1992 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1997 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2000 # Whether to force IPv4 by default (needed on broken glibc Linux)
2002 AC_ARG_WITH(ipv4-default,
2003 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2005 if test "x$withval" != "xno" ; then
2006 AC_DEFINE(IPV4_DEFAULT)
2012 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2013 IPV4_IN6_HACK_MSG="no"
2015 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2017 if test "x$withval" != "xno" ; then
2019 AC_DEFINE(IPV4_IN_IPV6)
2020 IPV4_IN6_HACK_MSG="yes"
2025 if test "x$inet6_default_4in6" = "xyes"; then
2026 AC_MSG_RESULT([yes (default)])
2027 AC_DEFINE(IPV4_IN_IPV6)
2028 IPV4_IN6_HACK_MSG="yes"
2030 AC_MSG_RESULT([no (default)])
2035 # Whether to enable BSD auth support
2037 AC_ARG_WITH(bsd-auth,
2038 [ --with-bsd-auth Enable BSD auth support],
2040 if test "x$withval" != "xno" ; then
2047 AC_MSG_CHECKING(whether to install ssh as suid root)
2048 AC_ARG_ENABLE(suid-ssh,
2049 [ --enable-suid-ssh Install ssh as suid root (default)
2050 --disable-suid-ssh Install ssh without suid bit],
2051 [ case "$enableval" in
2056 *) AC_MSG_RESULT(yes)
2066 # Where to place sshd.pid
2068 # make sure the directory exists
2069 if test ! -d $piddir ; then
2070 piddir=`eval echo ${sysconfdir}`
2072 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2076 AC_ARG_WITH(pid-dir,
2077 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2079 if test "x$withval" != "xno" ; then
2081 if test ! -d $piddir ; then
2082 AC_MSG_WARN([** no $piddir directory on this system **])
2088 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2091 dnl allow user to disable some login recording features
2092 AC_ARG_ENABLE(lastlog,
2093 [ --disable-lastlog disable use of lastlog even if detected [no]],
2094 [ AC_DEFINE(DISABLE_LASTLOG) ]
2097 [ --disable-utmp disable use of utmp even if detected [no]],
2098 [ AC_DEFINE(DISABLE_UTMP) ]
2100 AC_ARG_ENABLE(utmpx,
2101 [ --disable-utmpx disable use of utmpx even if detected [no]],
2102 [ AC_DEFINE(DISABLE_UTMPX) ]
2105 [ --disable-wtmp disable use of wtmp even if detected [no]],
2106 [ AC_DEFINE(DISABLE_WTMP) ]
2108 AC_ARG_ENABLE(wtmpx,
2109 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2110 [ AC_DEFINE(DISABLE_WTMPX) ]
2112 AC_ARG_ENABLE(libutil,
2113 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2114 [ AC_DEFINE(DISABLE_LOGIN) ]
2116 AC_ARG_ENABLE(pututline,
2117 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2118 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2120 AC_ARG_ENABLE(pututxline,
2121 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2122 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2124 AC_ARG_WITH(lastlog,
2125 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2127 if test "x$withval" = "xno" ; then
2128 AC_DEFINE(DISABLE_LASTLOG)
2130 conf_lastlog_location=$withval
2135 dnl lastlog, [uw]tmpx? detection
2136 dnl NOTE: set the paths in the platform section to avoid the
2137 dnl need for command-line parameters
2138 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2140 dnl lastlog detection
2141 dnl NOTE: the code itself will detect if lastlog is a directory
2142 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2144 #include <sys/types.h>
2146 #ifdef HAVE_LASTLOG_H
2147 # include <lastlog.h>
2156 [ char *lastlog = LASTLOG_FILE; ],
2157 [ AC_MSG_RESULT(yes) ],
2160 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2162 #include <sys/types.h>
2164 #ifdef HAVE_LASTLOG_H
2165 # include <lastlog.h>
2171 [ char *lastlog = _PATH_LASTLOG; ],
2172 [ AC_MSG_RESULT(yes) ],
2175 system_lastlog_path=no
2180 if test -z "$conf_lastlog_location"; then
2181 if test x"$system_lastlog_path" = x"no" ; then
2182 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2183 if (test -d "$f" || test -f "$f") ; then
2184 conf_lastlog_location=$f
2187 if test -z "$conf_lastlog_location"; then
2188 AC_MSG_WARN([** Cannot find lastlog **])
2189 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2194 if test -n "$conf_lastlog_location"; then
2195 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2199 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2201 #include <sys/types.h>
2207 [ char *utmp = UTMP_FILE; ],
2208 [ AC_MSG_RESULT(yes) ],
2210 system_utmp_path=no ]
2212 if test -z "$conf_utmp_location"; then
2213 if test x"$system_utmp_path" = x"no" ; then
2214 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2215 if test -f $f ; then
2216 conf_utmp_location=$f
2219 if test -z "$conf_utmp_location"; then
2220 AC_DEFINE(DISABLE_UTMP)
2224 if test -n "$conf_utmp_location"; then
2225 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2229 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2231 #include <sys/types.h>
2237 [ char *wtmp = WTMP_FILE; ],
2238 [ AC_MSG_RESULT(yes) ],
2240 system_wtmp_path=no ]
2242 if test -z "$conf_wtmp_location"; then
2243 if test x"$system_wtmp_path" = x"no" ; then
2244 for f in /usr/adm/wtmp /var/log/wtmp; do
2245 if test -f $f ; then
2246 conf_wtmp_location=$f
2249 if test -z "$conf_wtmp_location"; then
2250 AC_DEFINE(DISABLE_WTMP)
2254 if test -n "$conf_wtmp_location"; then
2255 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2259 dnl utmpx detection - I don't know any system so perverse as to require
2260 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2262 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2264 #include <sys/types.h>
2273 [ char *utmpx = UTMPX_FILE; ],
2274 [ AC_MSG_RESULT(yes) ],
2276 system_utmpx_path=no ]
2278 if test -z "$conf_utmpx_location"; then
2279 if test x"$system_utmpx_path" = x"no" ; then
2280 AC_DEFINE(DISABLE_UTMPX)
2283 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2287 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2289 #include <sys/types.h>
2298 [ char *wtmpx = WTMPX_FILE; ],
2299 [ AC_MSG_RESULT(yes) ],
2301 system_wtmpx_path=no ]
2303 if test -z "$conf_wtmpx_location"; then
2304 if test x"$system_wtmpx_path" = x"no" ; then
2305 AC_DEFINE(DISABLE_WTMPX)
2308 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2312 if test ! -z "$blibpath" ; then
2313 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2314 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2317 dnl remove pam and dl because they are in $LIBPAM
2318 if test "$PAM_MSG" = yes ; then
2319 LIBS=`echo $LIBS | sed 's/-lpam //'`
2321 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2322 LIBS=`echo $LIBS | sed 's/-ldl //'`
2326 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2329 # Print summary of options
2331 # Someone please show me a better way :)
2332 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2333 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2334 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2335 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2336 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2337 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2338 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2339 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
2342 echo "OpenSSH has been configured with the following options:"
2343 echo " User binaries: $B"
2344 echo " System binaries: $C"
2345 echo " Configuration files: $D"
2346 echo " Askpass program: $E"
2347 echo " Manual pages: $F"
2348 echo " PID file: $G"
2349 echo " sshd default user PATH: $H"
2350 echo " Manpage format: $MANTYPE"
2351 echo " PAM support: ${PAM_MSG}"
2352 echo " KerberosIV support: $KRB4_MSG"
2353 echo " Smartcard support: $SCARD_MSG"
2354 echo " AFS support: $AFS_MSG"
2355 echo " S/KEY support: $SKEY_MSG"
2356 echo " TCP Wrappers support: $TCPW_MSG"
2357 echo " MD5 password support: $MD5_MSG"
2358 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2359 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2360 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2361 echo " BSD Auth support: $BSD_AUTH_MSG"
2362 echo " Random number source: $RAND_MSG"
2363 if test ! -z "$USE_RAND_HELPER" ; then
2364 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2369 echo " Host: ${host}"
2370 echo " Compiler: ${CC}"
2371 echo " Compiler flags: ${CFLAGS}"
2372 echo "Preprocessor flags: ${CPPFLAGS}"
2373 echo " Linker flags: ${LDFLAGS}"
2374 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2378 if test "x$PAM_MSG" = "xyes" ; then
2379 echo "PAM is enabled. You may need to install a PAM control file "
2380 echo "for sshd, otherwise password authentication may fail. "
2381 echo "Example PAM control files can be found in the contrib/ "
2386 if test ! -z "$NO_SFTP"; then
2387 echo "sftp-server will be disabled. Your compiler does not "
2388 echo "support 64bit integers."
2392 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2393 echo "WARNING: you are using the builtin random number collection "
2394 echo "service. Please read WARNING.RNG and request that your OS "
2395 echo "vendor includes kernel-based random number collection in "
2396 echo "future versions of your OS."