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)
68 LIBS="$LIBS /usr/lib/textmode.o"
69 AC_DEFINE(HAVE_CYGWIN)
71 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
74 AC_DEFINE(NO_X11_UNIX_SOCKETS)
77 AC_DEFINE(IP_TOS_IS_BROKEN)
80 AC_DEFINE(BROKEN_GETADDRINFO)
83 if test -z "$GCC"; then
86 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
89 AC_DEFINE(DISABLE_SHADOW)
90 AC_DEFINE(DISABLE_UTMP)
91 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
92 LIBS="$LIBS -lxnet -lsec"
95 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
97 AC_DEFINE(PAM_SUN_CODEBASE)
99 AC_DEFINE(DISABLE_SHADOW)
100 AC_DEFINE(DISABLE_UTMP)
101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
102 LIBS="$LIBS -lxnet -lsec"
105 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
107 PATH="$PATH:/usr/etc"
108 AC_DEFINE(BROKEN_INET_NTOA)
111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
113 PATH="$PATH:/usr/etc"
114 AC_DEFINE(WITH_IRIX_ARRAY)
115 AC_DEFINE(WITH_IRIX_PROJECT)
116 AC_DEFINE(WITH_IRIX_AUDIT)
117 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
118 AC_DEFINE(BROKEN_INET_NTOA)
122 check_for_libcrypt_later=1
123 AC_DEFINE(DONT_TRY_OTHER_AF)
124 AC_DEFINE(PAM_TTY_KLUDGE)
125 inet6_default_4in6=yes
127 mips-sony-bsd|mips-sony-newsos4)
128 AC_DEFINE(HAVE_NEWS4)
135 check_for_libcrypt_later=1
138 conf_lastlog_location="/usr/adm/lastlog"
139 conf_utmp_location=/etc/utmp
140 conf_wtmp_location=/usr/adm/wtmp
143 AC_DEFINE(BROKEN_REALPATH)
145 AC_DEFINE(BROKEN_SAVED_UIDS)
146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
150 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
151 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
153 AC_DEFINE(PAM_SUN_CODEBASE)
154 AC_DEFINE(LOGIN_NEEDS_UTMPX)
155 AC_DEFINE(LOGIN_NEEDS_TERM)
156 AC_DEFINE(PAM_TTY_KLUDGE)
157 # hardwire lastlog location (can't detect it on some versions)
158 conf_lastlog_location="/var/adm/lastlog"
159 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
160 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
161 if test "$sol2ver" -ge 8; then
163 AC_DEFINE(DISABLE_UTMP)
164 AC_DEFINE(DISABLE_WTMP)
170 CPPFLAGS="$CPPFLAGS -DSUNOS4"
171 AC_CHECK_FUNCS(getpwanam)
172 AC_DEFINE(PAM_SUN_CODEBASE)
173 conf_utmp_location=/etc/utmp
174 conf_wtmp_location=/var/adm/wtmp
175 conf_lastlog_location=/var/adm/lastlog
179 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
180 LDFLAGS="$LDFLAGS -L/usr/local/lib"
185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
186 # /usr/ucblib MUST NOT be searched on ReliantUNIX
187 LDFLAGS="$LDFLAGS -L/usr/local/lib"
188 IPADDR_IN_DISPLAY=yes
190 AC_DEFINE(IP_TOS_IS_BROKEN)
191 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
192 # Attention: always take care to bind libsocket and libnsl before libc,
193 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
196 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
197 LDFLAGS="$LDFLAGS -L/usr/local/lib"
202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
212 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
213 LDFLAGS="$LDFLAGS -L/usr/local/lib"
214 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
215 rsh_path="/usr/bin/rcmd"
218 AC_DEFINE(BROKEN_SYS_TERMIO_H)
220 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
221 AC_DEFINE(DISABLE_SHADOW)
222 AC_DEFINE(BROKEN_SAVED_UIDS)
223 AC_CHECK_FUNCS(getluid setluid)
225 do_sco3_extra_lib_check=yes
228 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
229 LDFLAGS="$LDFLAGS -L/usr/local/lib"
230 LIBS="$LIBS -lprot -lx -ltinfo -lm"
232 rsh_path="/usr/bin/rcmd"
234 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
235 AC_DEFINE(DISABLE_SHADOW)
236 AC_CHECK_FUNCS(getluid setluid)
243 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
244 LIBS="$LIBS -lgen -lrsc"
247 AC_MSG_CHECKING(for Digital Unix SIA)
250 [ --with-osfsia Enable Digital Unix SIA],
252 if test "x$withval" = "xno" ; then
253 AC_MSG_RESULT(disabled)
258 if test -z "$no_osfsia" ; then
259 if test -f /etc/sia/matrix.conf; then
261 AC_DEFINE(HAVE_OSF_SIA)
262 AC_DEFINE(DISABLE_LOGIN)
263 LIBS="$LIBS -lsecurity -ldb -lm -laud"
272 AC_DEFINE(NO_X11_UNIX_SOCKETS)
273 AC_DEFINE(MISSING_NFDBITS)
274 AC_DEFINE(MISSING_HOWMANY)
275 AC_DEFINE(MISSING_FD_MASK)
279 # Allow user to specify flags
281 [ --with-cflags Specify additional flags to pass to compiler],
283 if test "x$withval" != "xno" ; then
284 CFLAGS="$CFLAGS $withval"
288 AC_ARG_WITH(cppflags,
289 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
291 if test "x$withval" != "xno"; then
292 CPPFLAGS="$CPPFLAGS $withval"
297 [ --with-ldflags Specify additional flags to pass to linker],
299 if test "x$withval" != "xno" ; then
300 LDFLAGS="$LDFLAGS $withval"
305 [ --with-libs Specify additional libraries to link with],
307 if test "x$withval" != "xno" ; then
308 LIBS="$LIBS $withval"
313 # Checks for header files.
314 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
315 getopt.h glob.h lastlog.h limits.h login.h \
316 login_cap.h maillock.h netdb.h netgroup.h \
317 netinet/in_systm.h paths.h poll.h pty.h \
318 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
319 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
320 sys/mman.h sys/poll.h sys/select.h sys/stat.h \
321 sys/stropts.h sys/sysmacros.h sys/time.h \
322 sys/un.h time.h ttyent.h usersec.h \
323 util.h utime.h utmp.h utmpx.h)
325 # Checks for libraries.
326 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
327 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
329 dnl SCO OS3 needs this for libwrap
330 if test "x$with_tcp_wrappers" != "xno" ; then
331 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
332 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
336 AC_CHECK_FUNC(getspnam, ,
337 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
340 [ --without-rpath Disable auto-added -R linker paths],
342 if test "x$withval" = "xno" ; then
345 if test "x$withval" = "xyes" ; then
353 [ --with-zlib=PATH Use zlib in PATH],
355 if test "x$withval" = "xno" ; then
356 AC_MSG_ERROR([*** zlib is required ***])
358 if test -d "$withval/lib"; then
359 if test -n "${need_dash_r}"; then
360 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
362 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
365 if test -n "${need_dash_r}"; then
366 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
368 LDFLAGS="-L${withval} ${LDFLAGS}"
371 if test -d "$withval/include"; then
372 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
374 CPPFLAGS="-I${withval} ${CPPFLAGS}"
379 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
382 AC_CHECK_FUNC(strcasecmp,
383 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
385 AC_CHECK_FUNC(utimes,
386 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
389 dnl Checks for libutil functions
390 AC_CHECK_HEADERS(libutil.h)
391 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
392 AC_CHECK_FUNCS(logout updwtmp logwtmp)
396 # Check for ALTDIRFUNC glob() extension
397 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
398 AC_EGREP_CPP(FOUNDIT,
401 #ifdef GLOB_ALTDIRFUNC
406 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
414 # Check for g.gl_matchc glob() extension
415 AC_MSG_CHECKING(for gl_matchc field in glob_t)
416 AC_EGREP_CPP(FOUNDIT,
419 int main(void){glob_t g; g.gl_matchc = 1;}
422 AC_DEFINE(GLOB_HAS_GL_MATCHC)
430 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
433 #include <sys/types.h>
435 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
437 [AC_MSG_RESULT(yes)],
440 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
444 # Check whether user wants S/Key support
447 [ --with-skey[[=PATH]] Enable S/Key support
448 (optionally in PATH)],
450 if test "x$withval" != "xno" ; then
452 if test "x$withval" != "xyes" ; then
453 CPPFLAGS="$CPPFLAGS -I${withval}/include"
454 LDFLAGS="$LDFLAGS -L${withval}/lib"
461 AC_MSG_CHECKING([for s/key support])
466 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
468 [AC_MSG_RESULT(yes)],
471 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
477 # Check whether user wants TCP wrappers support
479 AC_ARG_WITH(tcp-wrappers,
480 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
481 (optionally in PATH)],
483 if test "x$withval" != "xno" ; then
485 saved_LDFLAGS="$LDFLAGS"
486 saved_CPPFLAGS="$CPPFLAGS"
487 if test -n "${withval}" -a "${withval}" != "yes"; then
488 if test -d "${withval}/lib"; then
489 if test -n "${need_dash_r}"; then
490 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
492 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
495 if test -n "${need_dash_r}"; then
496 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
498 LDFLAGS="-L${withval} ${LDFLAGS}"
501 if test -d "${withval}/include"; then
502 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
504 CPPFLAGS="-I${withval} ${CPPFLAGS}"
508 LIBS="$LIBWRAP $LIBS"
509 AC_MSG_CHECKING(for libwrap)
513 int deny_severity = 0, allow_severity = 0;
523 AC_MSG_ERROR([*** libwrap missing])
531 dnl Checks for library functions.
532 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
533 clock fchmod fchown freeaddrinfo futimes gai_strerror \
534 getaddrinfo getcwd getgrouplist getnameinfo getopt \
535 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
536 inet_ntop innetgr login_getcapbool md5_crypt memmove \
537 mkdtemp mmap openpty readpassphrase realpath \
538 rresvport_af setdtablesize setegid setenv seteuid \
539 setlogin setproctitle setresgid setreuid setrlimit \
540 setsid setvbuf sigaction sigvec snprintf strerror \
541 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
542 vhangup vsnprintf waitpid __b64_ntop _getpty)
544 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
545 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
546 AC_CHECK_LIB(gen, dirname,[
547 AC_CACHE_CHECK([for broken dirname],
548 ac_cv_have_broken_dirname, [
556 int main(int argc, char **argv) {
559 strncpy(buf,"/etc", 32);
561 if (!s || strncmp(s, "/", 32) != 0) {
568 [ ac_cv_have_broken_dirname="no" ],
569 [ ac_cv_have_broken_dirname="yes" ]
573 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
575 AC_DEFINE(HAVE_DIRNAME)
576 AC_CHECK_HEADERS(libgen.h)
581 dnl Checks for time functions
582 AC_CHECK_FUNCS(gettimeofday time)
583 dnl Checks for utmp functions
584 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
585 AC_CHECK_FUNCS(utmpname)
586 dnl Checks for utmpx functions
587 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
588 AC_CHECK_FUNCS(setutxent utmpxname)
590 AC_CHECK_FUNC(getuserattr,
591 [AC_DEFINE(HAVE_GETUSERATTR)],
592 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
595 AC_CHECK_FUNC(daemon,
596 [AC_DEFINE(HAVE_DAEMON)],
597 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
600 AC_CHECK_FUNC(getpagesize,
601 [AC_DEFINE(HAVE_GETPAGESIZE)],
602 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
605 # Check for broken snprintf
606 if test "x$ac_cv_func_snprintf" = "xyes" ; then
607 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
611 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
613 [AC_MSG_RESULT(yes)],
616 AC_DEFINE(BROKEN_SNPRINTF)
617 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
627 [ --with-pam Enable PAM support ],
629 if test "x$withval" != "xno" ; then
630 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
631 AC_MSG_ERROR([PAM headers not found])
634 AC_CHECK_LIB(dl, dlopen, , )
635 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
636 AC_CHECK_FUNCS(pam_getenvlist)
642 if test $ac_cv_lib_dl_dlopen = yes; then
652 # Check for older PAM
653 if test "x$PAM_MSG" = "xyes" ; then
654 # Check PAM strerror arguments (old PAM)
655 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
659 #include <security/pam_appl.h>
661 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
664 AC_DEFINE(HAVE_OLD_PAM)
666 PAM_MSG="yes (old library)"
671 # The big search for OpenSSL
673 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
675 if test "x$withval" != "xno" ; then
682 saved_LDFLAGS="$LDFLAGS"
683 saved_CPPFLAGS="$CPPFLAGS"
684 if test "x$prefix" != "xNONE" ; then
685 tryssldir="$tryssldir $prefix"
687 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
688 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
689 CPPFLAGS="$saved_CPPFLAGS"
690 LDFLAGS="$saved_LDFLAGS"
691 LIBS="$saved_LIBS -lcrypto"
693 # Skip directories if they don't exist
694 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
697 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
698 # Try to use $ssldir/lib if it exists, otherwise
700 if test -d "$ssldir/lib" ; then
701 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
702 if test ! -z "$need_dash_r" ; then
703 LDFLAGS="-R$ssldir/lib $LDFLAGS"
706 LDFLAGS="-L$ssldir $saved_LDFLAGS"
707 if test ! -z "$need_dash_r" ; then
708 LDFLAGS="-R$ssldir $LDFLAGS"
711 # Try to use $ssldir/include if it exists, otherwise
713 if test -d "$ssldir/include" ; then
714 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
716 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
720 # Basic test to check for compatible version and correct linking
721 # *does not* test for RSA - that comes later.
725 #include <openssl/rand.h>
729 memset(a, 0, sizeof(a));
730 RAND_add(a, sizeof(a), sizeof(a));
731 return(RAND_status() <= 0);
740 if test ! -z "$found_crypto" ; then
745 if test -z "$found_crypto" ; then
746 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
748 if test -z "$ssldir" ; then
752 ac_cv_openssldir=$ssldir
755 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
756 AC_DEFINE(HAVE_OPENSSL)
757 dnl Need to recover ssldir - test above runs in subshell
758 ssldir=$ac_cv_openssldir
759 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
760 # Try to use $ssldir/lib if it exists, otherwise
762 if test -d "$ssldir/lib" ; then
763 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
764 if test ! -z "$need_dash_r" ; then
765 LDFLAGS="-R$ssldir/lib $LDFLAGS"
768 LDFLAGS="-L$ssldir $saved_LDFLAGS"
769 if test ! -z "$need_dash_r" ; then
770 LDFLAGS="-R$ssldir $LDFLAGS"
773 # Try to use $ssldir/include if it exists, otherwise
775 if test -d "$ssldir/include" ; then
776 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
778 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
782 LIBS="$saved_LIBS -lcrypto"
784 # Now test RSA support
786 AC_MSG_CHECKING([for RSA support])
787 for WANTS_RSAREF in "" 1 ; do
788 if test -z "$WANTS_RSAREF" ; then
791 LIBS="$saved_LIBS -lRSAglue -lrsaref"
795 #include <openssl/rand.h>
796 #include <openssl/rsa.h>
797 #include <openssl/bn.h>
798 #include <openssl/sha.h>
801 int num; RSA *key; static unsigned char p_in[] = "blahblah";
802 unsigned char c[256], p[256];
803 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
804 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
805 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
806 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
816 if test ! -z "$no_rsa" ; then
817 AC_MSG_RESULT(disabled)
820 if test -z "$rsa_works" ; then
821 AC_MSG_WARN([*** No RSA support found *** ])
824 if test -z "$WANTS_RSAREF" ; then
828 RSA_MSG="yes (using RSAref)"
829 AC_MSG_RESULT(using RSAref)
830 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
835 # Sanity check OpenSSL headers
836 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
840 #include <openssl/opensslv.h>
841 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
848 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
852 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
853 # version in OpenSSL. Skip this for PAM
854 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
855 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
859 ### Configure cryptographic random number support
861 # Check wheter OpenSSL seeds itself
862 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
866 #include <openssl/rand.h>
867 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
870 OPENSSL_SEEDS_ITSELF=yes
875 # Default to use of the rand helper if OpenSSL doesn't
882 # Do we want to force the use of the rand helper?
883 AC_ARG_WITH(rand-helper,
884 [ --with-rand-helper Use subprocess to gather strong randomness ],
886 if test "x$withval" = "xno" ; then
887 # Force use of OpenSSL's internal RNG, even if
888 # the previous test showed it to be unseeded.
889 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
890 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
891 OPENSSL_SEEDS_ITSELF=yes
900 # Which randomness source do we use?
901 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
903 AC_DEFINE(OPENSSL_PRNG_ONLY)
904 RAND_MSG="OpenSSL internal ONLY"
905 INSTALL_SSH_RAND_HELPER=""
906 elif test ! -z "$USE_RAND_HELPER" ; then
907 # install rand helper
908 RAND_MSG="ssh-rand-helper"
909 INSTALL_SSH_RAND_HELPER="yes"
911 AC_SUBST(INSTALL_SSH_RAND_HELPER)
913 ### Configuration of ssh-rand-helper
916 AC_ARG_WITH(prngd-port,
917 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
926 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
929 if test ! -z "$withval" ; then
930 PRNGD_PORT="$withval"
931 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
936 # PRNGD Unix domain socket
937 AC_ARG_WITH(prngd-socket,
938 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
942 withval="/var/run/egd-pool"
950 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
954 if test ! -z "$withval" ; then
955 if test ! -z "$PRNGD_PORT" ; then
956 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
958 if test ! -r "$withval" ; then
959 AC_MSG_WARN(Entropy socket is not readable)
961 PRNGD_SOCKET="$withval"
962 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
966 # Check for existing socket only if we don't have a random device already
967 if test "$USE_RAND_HELPER" = yes ; then
968 AC_MSG_CHECKING(for PRNGD/EGD socket)
969 # Insert other locations here
970 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
971 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
973 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
977 if test ! -z "$PRNGD_SOCKET" ; then
978 AC_MSG_RESULT($PRNGD_SOCKET)
980 AC_MSG_RESULT(not found)
986 # Change default command timeout for hashing entropy source
988 AC_ARG_WITH(entropy-timeout,
989 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
991 if test "x$withval" != "xno" ; then
992 entropy_timeout=$withval
997 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
999 # We do this little dance with the search path to insure
1000 # that programs that we select for use by installed programs
1001 # (which may be run by the super-user) come from trusted
1002 # locations before they come from the user's private area.
1003 # This should help avoid accidentally configuring some
1004 # random version of a program in someone's personal bin.
1008 /bin/test -L /bin 2> /dev/null && PATH=/usr/bin
1009 test -d /sbin && PATH=$PATH:/sbin
1010 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1011 PATH=$PATH:/etc:$OPATH
1013 # These programs are used by the command hashing source to gather entropy
1014 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1015 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1016 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1017 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1018 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1019 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1020 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1021 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1022 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1023 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1024 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1025 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1026 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1027 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1028 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1029 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1033 # Where does ssh-rand-helper get its randomness from?
1034 INSTALL_SSH_PRNG_CMDS=""
1035 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1036 if test ! -z "$PRNGD_PORT" ; then
1037 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1038 elif test ! -z "$PRNGD_SOCKET" ; then
1039 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1041 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1042 RAND_HELPER_CMDHASH=yes
1043 INSTALL_SSH_PRNG_CMDS="yes"
1046 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1049 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1050 if test ! -z "$SONY" ; then
1051 LIBS="$LIBS -liberty";
1054 # Checks for data types
1055 AC_CHECK_SIZEOF(char, 1)
1056 AC_CHECK_SIZEOF(short int, 2)
1057 AC_CHECK_SIZEOF(int, 4)
1058 AC_CHECK_SIZEOF(long int, 4)
1059 AC_CHECK_SIZEOF(long long int, 8)
1061 # More checks for data types
1062 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1064 [ #include <sys/types.h> ],
1066 [ ac_cv_have_u_int="yes" ],
1067 [ ac_cv_have_u_int="no" ]
1070 if test "x$ac_cv_have_u_int" = "xyes" ; then
1071 AC_DEFINE(HAVE_U_INT)
1075 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1077 [ #include <sys/types.h> ],
1078 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1079 [ ac_cv_have_intxx_t="yes" ],
1080 [ ac_cv_have_intxx_t="no" ]
1083 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1084 AC_DEFINE(HAVE_INTXX_T)
1088 if (test -z "$have_intxx_t" && \
1089 test "x$ac_cv_header_stdint_h" = "xyes")
1091 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1093 [ #include <stdint.h> ],
1094 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1096 AC_DEFINE(HAVE_INTXX_T)
1099 [ AC_MSG_RESULT(no) ]
1103 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1105 [ #include <sys/types.h> ],
1106 [ int64_t a; a = 1;],
1107 [ ac_cv_have_int64_t="yes" ],
1108 [ ac_cv_have_int64_t="no" ]
1111 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1112 AC_DEFINE(HAVE_INT64_T)
1116 if test -z "$have_int64_t" ; then
1117 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1119 [ #include <sys/socket.h> ],
1120 [ int64_t a; a = 1],
1122 AC_DEFINE(HAVE_INT64_T)
1125 [ AC_MSG_RESULT(no) ]
1129 if test -z "$have_int64_t" ; then
1130 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1132 [ #include <sys/bitypes.h> ],
1133 [ int64_t a; a = 1],
1135 AC_DEFINE(HAVE_INT64_T)
1138 [ AC_MSG_RESULT(no) ]
1142 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1144 [ #include <sys/types.h> ],
1145 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1146 [ ac_cv_have_u_intxx_t="yes" ],
1147 [ ac_cv_have_u_intxx_t="no" ]
1150 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1151 AC_DEFINE(HAVE_U_INTXX_T)
1155 if test -z "$have_u_intxx_t" ; then
1156 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1158 [ #include <sys/socket.h> ],
1159 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1161 AC_DEFINE(HAVE_U_INTXX_T)
1164 [ AC_MSG_RESULT(no) ]
1168 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1170 [ #include <sys/types.h> ],
1171 [ u_int64_t a; a = 1;],
1172 [ ac_cv_have_u_int64_t="yes" ],
1173 [ ac_cv_have_u_int64_t="no" ]
1176 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1177 AC_DEFINE(HAVE_U_INT64_T)
1181 if test -z "$have_u_int64_t" ; then
1182 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1184 [ #include <sys/bitypes.h> ],
1185 [ u_int64_t a; a = 1],
1187 AC_DEFINE(HAVE_U_INT64_T)
1190 [ AC_MSG_RESULT(no) ]
1194 if test -z "$have_u_intxx_t" ; then
1195 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1198 #include <sys/types.h>
1200 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1201 [ ac_cv_have_uintxx_t="yes" ],
1202 [ ac_cv_have_uintxx_t="no" ]
1205 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1206 AC_DEFINE(HAVE_UINTXX_T)
1210 if test -z "$have_uintxx_t" ; then
1211 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1213 [ #include <stdint.h> ],
1214 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1216 AC_DEFINE(HAVE_UINTXX_T)
1219 [ AC_MSG_RESULT(no) ]
1223 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1224 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1226 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1229 #include <sys/bitypes.h>
1232 int8_t a; int16_t b; int32_t c;
1233 u_int8_t e; u_int16_t f; u_int32_t g;
1234 a = b = c = e = f = g = 1;
1237 AC_DEFINE(HAVE_U_INTXX_T)
1238 AC_DEFINE(HAVE_INTXX_T)
1246 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1249 #include <sys/types.h>
1251 [ u_char foo; foo = 125; ],
1252 [ ac_cv_have_u_char="yes" ],
1253 [ ac_cv_have_u_char="no" ]
1256 if test "x$ac_cv_have_u_char" = "xyes" ; then
1257 AC_DEFINE(HAVE_U_CHAR)
1262 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1264 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1267 #include <sys/types.h>
1269 [ size_t foo; foo = 1235; ],
1270 [ ac_cv_have_size_t="yes" ],
1271 [ ac_cv_have_size_t="no" ]
1274 if test "x$ac_cv_have_size_t" = "xyes" ; then
1275 AC_DEFINE(HAVE_SIZE_T)
1278 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1281 #include <sys/types.h>
1283 [ ssize_t foo; foo = 1235; ],
1284 [ ac_cv_have_ssize_t="yes" ],
1285 [ ac_cv_have_ssize_t="no" ]
1288 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1289 AC_DEFINE(HAVE_SSIZE_T)
1292 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1297 [ clock_t foo; foo = 1235; ],
1298 [ ac_cv_have_clock_t="yes" ],
1299 [ ac_cv_have_clock_t="no" ]
1302 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1303 AC_DEFINE(HAVE_CLOCK_T)
1306 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1309 #include <sys/types.h>
1310 #include <sys/socket.h>
1312 [ sa_family_t foo; foo = 1235; ],
1313 [ ac_cv_have_sa_family_t="yes" ],
1316 #include <sys/types.h>
1317 #include <sys/socket.h>
1318 #include <netinet/in.h>
1320 [ sa_family_t foo; foo = 1235; ],
1321 [ ac_cv_have_sa_family_t="yes" ],
1323 [ ac_cv_have_sa_family_t="no" ]
1327 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1328 AC_DEFINE(HAVE_SA_FAMILY_T)
1331 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1334 #include <sys/types.h>
1336 [ pid_t foo; foo = 1235; ],
1337 [ ac_cv_have_pid_t="yes" ],
1338 [ ac_cv_have_pid_t="no" ]
1341 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1342 AC_DEFINE(HAVE_PID_T)
1345 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1348 #include <sys/types.h>
1350 [ mode_t foo; foo = 1235; ],
1351 [ ac_cv_have_mode_t="yes" ],
1352 [ ac_cv_have_mode_t="no" ]
1355 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1356 AC_DEFINE(HAVE_MODE_T)
1360 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1363 #include <sys/types.h>
1364 #include <sys/socket.h>
1366 [ struct sockaddr_storage s; ],
1367 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1368 [ ac_cv_have_struct_sockaddr_storage="no" ]
1371 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1372 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1375 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1378 #include <sys/types.h>
1379 #include <netinet/in.h>
1381 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1382 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1383 [ ac_cv_have_struct_sockaddr_in6="no" ]
1386 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1387 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1390 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1393 #include <sys/types.h>
1394 #include <netinet/in.h>
1396 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1397 [ ac_cv_have_struct_in6_addr="yes" ],
1398 [ ac_cv_have_struct_in6_addr="no" ]
1401 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1402 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1405 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1408 #include <sys/types.h>
1409 #include <sys/socket.h>
1412 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1413 [ ac_cv_have_struct_addrinfo="yes" ],
1414 [ ac_cv_have_struct_addrinfo="no" ]
1417 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1418 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1421 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1423 [ #include <sys/time.h> ],
1424 [ struct timeval tv; tv.tv_sec = 1;],
1425 [ ac_cv_have_struct_timeval="yes" ],
1426 [ ac_cv_have_struct_timeval="no" ]
1429 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1430 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1431 have_struct_timeval=1
1434 # If we don't have int64_t then we can't compile sftp-server. So don't
1435 # even attempt to do it.
1436 if test "x$ac_cv_have_int64_t" = "xno" -a \
1437 "x$ac_cv_sizeof_long_int" != "x8" -a \
1438 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1441 dnl test snprintf (broken on SCO w/gcc)
1446 #ifdef HAVE_SNPRINTF
1450 char expected_out[50];
1452 #if (SIZEOF_LONG_INT == 8)
1453 long int num = 0x7fffffffffffffff;
1455 long long num = 0x7fffffffffffffffll;
1457 strcpy(expected_out, "9223372036854775807");
1458 snprintf(buf, mazsize, "%lld", num);
1459 if(strcmp(buf, expected_out) != 0)
1466 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1471 dnl Checks for structure members
1472 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1473 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1474 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1475 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1476 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1477 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1478 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1479 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1480 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1481 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1482 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1483 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1484 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1485 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1486 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1487 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1488 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1490 AC_CHECK_MEMBERS([struct stat.st_blksize])
1492 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1493 ac_cv_have_ss_family_in_struct_ss, [
1496 #include <sys/types.h>
1497 #include <sys/socket.h>
1499 [ struct sockaddr_storage s; s.ss_family = 1; ],
1500 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1501 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1504 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1505 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1508 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1509 ac_cv_have___ss_family_in_struct_ss, [
1512 #include <sys/types.h>
1513 #include <sys/socket.h>
1515 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1516 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1517 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1520 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1521 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1524 AC_CACHE_CHECK([for pw_class field in struct passwd],
1525 ac_cv_have_pw_class_in_struct_passwd, [
1530 [ struct passwd p; p.pw_class = 0; ],
1531 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1532 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1535 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1536 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1539 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1540 ac_cv_have_pw_expire_in_struct_passwd, [
1545 [ struct passwd p; p.pw_expire = 0; ],
1546 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1547 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1550 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1551 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1554 AC_CACHE_CHECK([for pw_change field in struct passwd],
1555 ac_cv_have_pw_change_in_struct_passwd, [
1560 [ struct passwd p; p.pw_change = 0; ],
1561 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1562 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1565 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1566 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1569 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1570 ac_cv_have_accrights_in_msghdr, [
1573 #include <sys/socket.h>
1574 #include <sys/uio.h>
1576 [ struct msghdr m; m.msg_accrights = 0; ],
1577 [ ac_cv_have_accrights_in_msghdr="yes" ],
1578 [ ac_cv_have_accrights_in_msghdr="no" ]
1581 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1582 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1585 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1586 ac_cv_have_control_in_msghdr, [
1589 #include <sys/socket.h>
1590 #include <sys/uio.h>
1592 [ struct msghdr m; m.msg_control = 0; ],
1593 [ ac_cv_have_control_in_msghdr="yes" ],
1594 [ ac_cv_have_control_in_msghdr="no" ]
1597 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1598 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1601 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1603 [ extern char *__progname; printf("%s", __progname); ],
1604 [ ac_cv_libc_defines___progname="yes" ],
1605 [ ac_cv_libc_defines___progname="no" ]
1608 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1609 AC_DEFINE(HAVE___PROGNAME)
1612 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1616 [ printf("%s", __FUNCTION__); ],
1617 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1618 [ ac_cv_cc_implements___FUNCTION__="no" ]
1621 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1622 AC_DEFINE(HAVE___FUNCTION__)
1625 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1629 [ printf("%s", __func__); ],
1630 [ ac_cv_cc_implements___func__="yes" ],
1631 [ ac_cv_cc_implements___func__="no" ]
1634 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1635 AC_DEFINE(HAVE___func__)
1638 AC_CACHE_CHECK([whether getopt has optreset support],
1639 ac_cv_have_getopt_optreset, [
1644 [ extern int optreset; optreset = 0; ],
1645 [ ac_cv_have_getopt_optreset="yes" ],
1646 [ ac_cv_have_getopt_optreset="no" ]
1649 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1650 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1653 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1655 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1656 [ ac_cv_libc_defines_sys_errlist="yes" ],
1657 [ ac_cv_libc_defines_sys_errlist="no" ]
1660 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1661 AC_DEFINE(HAVE_SYS_ERRLIST)
1665 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1667 [ extern int sys_nerr; printf("%i", sys_nerr);],
1668 [ ac_cv_libc_defines_sys_nerr="yes" ],
1669 [ ac_cv_libc_defines_sys_nerr="no" ]
1672 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1673 AC_DEFINE(HAVE_SYS_NERR)
1678 # Check whether user wants sectok support
1680 [ --with-sectok Enable smartcard support using libsectok],
1682 if test "x$withval" != "xno" ; then
1683 if test "x$withval" != "xyes" ; then
1684 CPPFLAGS="$CPPFLAGS -I${withval}"
1685 LDFLAGS="$LDFLAGS -L${withval}"
1686 if test ! -z "$need_dash_r" ; then
1687 LDFLAGS="$LDFLAGS -R${withval}"
1689 if test ! -z "$blibpath" ; then
1690 blibpath="$blibpath:${withval}"
1693 AC_CHECK_HEADERS(sectok.h)
1694 if test "$ac_cv_header_sectok_h" != yes; then
1695 AC_MSG_ERROR(Can't find sectok.h)
1697 AC_CHECK_LIB(sectok, sectok_open)
1698 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1699 AC_MSG_ERROR(Can't find libsectok)
1701 AC_DEFINE(SMARTCARD)
1702 AC_DEFINE(USE_SECTOK)
1703 SCARD_MSG="yes, using sectok"
1708 # Check whether user wants OpenSC support
1710 [ --with-opensc Enable smartcard support using OpenSC],
1712 if test "x$withval" != "xno" ; then
1713 if test "x$withval" != "xyes" ; then
1714 CPPFLAGS="$CPPFLAGS -I${withval}"
1715 LDFLAGS="$LDFLAGS -L${withval}"
1716 if test ! -z "$need_dash_r" ; then
1717 LDFLAGS="$LDFLAGS -R${withval}"
1719 if test ! -z "$blibpath" ; then
1720 blibpath="$blibpath:${withval}"
1723 AC_CHECK_HEADERS(opensc-pkcs15.h)
1724 if test "$ac_cv_header_opensc_pkcs15_h" != yes; then
1725 AC_MSG_ERROR(Can't find opensc-pkcs15.h)
1727 AC_CHECK_LIB(opensc, sc_pkcs15_bind)
1728 if test "$ac_cv_lib_opensc_sc_pkcs15_bind" != yes; then
1729 AC_MSG_ERROR(Can't find libopensc)
1731 AC_DEFINE(SMARTCARD)
1732 AC_DEFINE(USE_OPENSC)
1733 SCARD_MSG="yes, using OpenSC"
1738 # Check whether user wants Kerberos support
1740 AC_ARG_WITH(kerberos4,
1741 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1743 if test "x$withval" != "xno" ; then
1744 if test "x$withval" != "xyes" ; then
1745 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1746 LDFLAGS="$LDFLAGS -L${withval}/lib"
1747 if test ! -z "$need_dash_r" ; then
1748 LDFLAGS="$LDFLAGS -R${withval}/lib"
1750 if test ! -z "$blibpath" ; then
1751 blibpath="$blibpath:${withval}/lib"
1754 if test -d /usr/include/kerberosIV ; then
1755 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1759 AC_CHECK_HEADERS(krb.h)
1760 if test "$ac_cv_header_krb_h" != yes; then
1761 AC_MSG_WARN([Cannot find krb.h, build may fail])
1763 AC_CHECK_LIB(krb, main)
1764 if test "$ac_cv_lib_krb_main" != yes; then
1765 AC_CHECK_LIB(krb4, main)
1766 if test "$ac_cv_lib_krb4_main" != yes; then
1767 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1774 AC_CHECK_LIB(des, des_cbc_encrypt)
1775 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1776 AC_CHECK_LIB(des425, des_cbc_encrypt)
1777 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1778 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1785 AC_CHECK_LIB(resolv, dn_expand, , )
1793 # Check whether user wants AFS support
1796 [ --with-afs=PATH Enable AFS support],
1798 if test "x$withval" != "xno" ; then
1800 if test "x$withval" != "xyes" ; then
1801 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1802 LDFLAGS="$LDFLAGS -L${withval}/lib"
1805 if test -z "$KRB4" ; then
1806 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1810 if test ! -z "$AFS_LIBS" ; then
1811 LIBS="$LIBS $AFS_LIBS"
1820 # Looking for programs, paths and files
1822 [ --with-rsh=PATH Specify path to remote shell program ],
1824 if test "x$withval" != "$no" ; then
1829 AC_PATH_PROG(rsh_path, rsh)
1834 [ --with-xauth=PATH Specify path to xauth program ],
1836 if test "x$withval" != "xno" ; then
1841 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1842 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1843 xauth_path="/usr/openwin/bin/xauth"
1848 if test -z "$xauth_path" ; then
1849 XAUTH_PATH="undefined"
1850 AC_SUBST(XAUTH_PATH)
1852 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1853 XAUTH_PATH=$xauth_path
1854 AC_SUBST(XAUTH_PATH)
1856 if test ! -z "$rsh_path" ; then
1857 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1860 # Check for mail directory (last resort if we cannot get it from headers)
1861 if test ! -z "$MAIL" ; then
1862 maildir=`dirname $MAIL`
1863 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1866 if test -z "$no_dev_ptmx" ; then
1867 AC_CHECK_FILE("/dev/ptmx",
1869 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1874 AC_CHECK_FILE("/dev/ptc",
1876 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1881 # Options from here on. Some of these are preset by platform above
1882 AC_ARG_WITH(mantype,
1883 [ --with-mantype=man|cat|doc Set man page type],
1890 AC_MSG_ERROR(invalid man type: $withval)
1895 if test -z "$MANTYPE"; then
1896 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1897 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1899 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1906 if test "$MANTYPE" = "doc"; then
1913 # Check whether to enable MD5 passwords
1915 AC_ARG_WITH(md5-passwords,
1916 [ --with-md5-passwords Enable use of MD5 passwords],
1918 if test "x$withval" != "xno" ; then
1919 AC_DEFINE(HAVE_MD5_PASSWORDS)
1925 # Whether to disable shadow password support
1927 [ --without-shadow Disable shadow password support],
1929 if test "x$withval" = "xno" ; then
1930 AC_DEFINE(DISABLE_SHADOW)
1936 if test -z "$disable_shadow" ; then
1937 AC_MSG_CHECKING([if the systems has expire shadow information])
1940 #include <sys/types.h>
1943 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1944 [ sp_expire_available=yes ], []
1947 if test "x$sp_expire_available" = "xyes" ; then
1949 AC_DEFINE(HAS_SHADOW_EXPIRE)
1955 # Use ip address instead of hostname in $DISPLAY
1956 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1957 DISPLAY_HACK_MSG="yes"
1958 AC_DEFINE(IPADDR_IN_DISPLAY)
1960 DISPLAY_HACK_MSG="no"
1961 AC_ARG_WITH(ipaddr-display,
1962 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1964 if test "x$withval" != "xno" ; then
1965 AC_DEFINE(IPADDR_IN_DISPLAY)
1966 DISPLAY_HACK_MSG="yes"
1972 # Whether to mess with the default path
1973 SERVER_PATH_MSG="(default)"
1974 AC_ARG_WITH(default-path,
1975 [ --with-default-path=PATH Specify default \$PATH environment for server],
1977 if test "x$withval" != "xno" ; then
1978 user_path="$withval"
1979 SERVER_PATH_MSG="$withval"
1985 /* find out what STDPATH is */
1990 #ifndef _PATH_STDPATH
1991 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1993 #include <sys/types.h>
1994 #include <sys/stat.h>
1996 #define DATA "conftest.stdpath"
2003 fd = fopen(DATA,"w");
2007 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2012 ], [ user_path=`cat conftest.stdpath` ],
2013 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2014 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2016 # make sure $bindir is in USER_PATH so scp will work
2017 t_bindir=`eval echo ${bindir}`
2019 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2022 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2024 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2025 if test $? -ne 0 ; then
2026 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2027 if test $? -ne 0 ; then
2028 user_path=$user_path:$t_bindir
2029 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2034 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2037 # Whether to force IPv4 by default (needed on broken glibc Linux)
2039 AC_ARG_WITH(ipv4-default,
2040 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2042 if test "x$withval" != "xno" ; then
2043 AC_DEFINE(IPV4_DEFAULT)
2049 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2050 IPV4_IN6_HACK_MSG="no"
2052 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2054 if test "x$withval" != "xno" ; then
2056 AC_DEFINE(IPV4_IN_IPV6)
2057 IPV4_IN6_HACK_MSG="yes"
2062 if test "x$inet6_default_4in6" = "xyes"; then
2063 AC_MSG_RESULT([yes (default)])
2064 AC_DEFINE(IPV4_IN_IPV6)
2065 IPV4_IN6_HACK_MSG="yes"
2067 AC_MSG_RESULT([no (default)])
2072 # Whether to enable BSD auth support
2074 AC_ARG_WITH(bsd-auth,
2075 [ --with-bsd-auth Enable BSD auth support],
2077 if test "x$withval" != "xno" ; then
2084 AC_MSG_CHECKING(whether to install ssh as suid root)
2085 AC_ARG_ENABLE(suid-ssh,
2086 [ --enable-suid-ssh Install ssh as suid root (default)
2087 --disable-suid-ssh Install ssh without suid bit],
2088 [ case "$enableval" in
2093 *) AC_MSG_RESULT(yes)
2103 # Where to place sshd.pid
2105 # make sure the directory exists
2106 if test ! -d $piddir ; then
2107 piddir=`eval echo ${sysconfdir}`
2109 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2113 AC_ARG_WITH(pid-dir,
2114 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2116 if test "x$withval" != "xno" ; then
2118 if test ! -d $piddir ; then
2119 AC_MSG_WARN([** no $piddir directory on this system **])
2125 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2128 dnl allow user to disable some login recording features
2129 AC_ARG_ENABLE(lastlog,
2130 [ --disable-lastlog disable use of lastlog even if detected [no]],
2131 [ AC_DEFINE(DISABLE_LASTLOG) ]
2134 [ --disable-utmp disable use of utmp even if detected [no]],
2135 [ AC_DEFINE(DISABLE_UTMP) ]
2137 AC_ARG_ENABLE(utmpx,
2138 [ --disable-utmpx disable use of utmpx even if detected [no]],
2139 [ AC_DEFINE(DISABLE_UTMPX) ]
2142 [ --disable-wtmp disable use of wtmp even if detected [no]],
2143 [ AC_DEFINE(DISABLE_WTMP) ]
2145 AC_ARG_ENABLE(wtmpx,
2146 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2147 [ AC_DEFINE(DISABLE_WTMPX) ]
2149 AC_ARG_ENABLE(libutil,
2150 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2151 [ AC_DEFINE(DISABLE_LOGIN) ]
2153 AC_ARG_ENABLE(pututline,
2154 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2155 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2157 AC_ARG_ENABLE(pututxline,
2158 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2159 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2161 AC_ARG_WITH(lastlog,
2162 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2164 if test "x$withval" = "xno" ; then
2165 AC_DEFINE(DISABLE_LASTLOG)
2167 conf_lastlog_location=$withval
2172 dnl lastlog, [uw]tmpx? detection
2173 dnl NOTE: set the paths in the platform section to avoid the
2174 dnl need for command-line parameters
2175 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2177 dnl lastlog detection
2178 dnl NOTE: the code itself will detect if lastlog is a directory
2179 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2181 #include <sys/types.h>
2183 #ifdef HAVE_LASTLOG_H
2184 # include <lastlog.h>
2193 [ char *lastlog = LASTLOG_FILE; ],
2194 [ AC_MSG_RESULT(yes) ],
2197 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2199 #include <sys/types.h>
2201 #ifdef HAVE_LASTLOG_H
2202 # include <lastlog.h>
2208 [ char *lastlog = _PATH_LASTLOG; ],
2209 [ AC_MSG_RESULT(yes) ],
2212 system_lastlog_path=no
2217 if test -z "$conf_lastlog_location"; then
2218 if test x"$system_lastlog_path" = x"no" ; then
2219 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2220 if (test -d "$f" || test -f "$f") ; then
2221 conf_lastlog_location=$f
2224 if test -z "$conf_lastlog_location"; then
2225 AC_MSG_WARN([** Cannot find lastlog **])
2226 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2231 if test -n "$conf_lastlog_location"; then
2232 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2236 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2238 #include <sys/types.h>
2244 [ char *utmp = UTMP_FILE; ],
2245 [ AC_MSG_RESULT(yes) ],
2247 system_utmp_path=no ]
2249 if test -z "$conf_utmp_location"; then
2250 if test x"$system_utmp_path" = x"no" ; then
2251 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2252 if test -f $f ; then
2253 conf_utmp_location=$f
2256 if test -z "$conf_utmp_location"; then
2257 AC_DEFINE(DISABLE_UTMP)
2261 if test -n "$conf_utmp_location"; then
2262 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2266 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2268 #include <sys/types.h>
2274 [ char *wtmp = WTMP_FILE; ],
2275 [ AC_MSG_RESULT(yes) ],
2277 system_wtmp_path=no ]
2279 if test -z "$conf_wtmp_location"; then
2280 if test x"$system_wtmp_path" = x"no" ; then
2281 for f in /usr/adm/wtmp /var/log/wtmp; do
2282 if test -f $f ; then
2283 conf_wtmp_location=$f
2286 if test -z "$conf_wtmp_location"; then
2287 AC_DEFINE(DISABLE_WTMP)
2291 if test -n "$conf_wtmp_location"; then
2292 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2296 dnl utmpx detection - I don't know any system so perverse as to require
2297 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2299 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2301 #include <sys/types.h>
2310 [ char *utmpx = UTMPX_FILE; ],
2311 [ AC_MSG_RESULT(yes) ],
2313 system_utmpx_path=no ]
2315 if test -z "$conf_utmpx_location"; then
2316 if test x"$system_utmpx_path" = x"no" ; then
2317 AC_DEFINE(DISABLE_UTMPX)
2320 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2324 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2326 #include <sys/types.h>
2335 [ char *wtmpx = WTMPX_FILE; ],
2336 [ AC_MSG_RESULT(yes) ],
2338 system_wtmpx_path=no ]
2340 if test -z "$conf_wtmpx_location"; then
2341 if test x"$system_wtmpx_path" = x"no" ; then
2342 AC_DEFINE(DISABLE_WTMPX)
2345 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2349 if test ! -z "$blibpath" ; then
2350 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2351 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2354 dnl remove pam and dl because they are in $LIBPAM
2355 if test "$PAM_MSG" = yes ; then
2356 LIBS=`echo $LIBS | sed 's/-lpam //'`
2358 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2359 LIBS=`echo $LIBS | sed 's/-ldl //'`
2363 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2366 # Print summary of options
2368 # Someone please show me a better way :)
2369 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2370 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2371 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2372 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2373 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2374 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2375 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2376 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
2379 echo "OpenSSH has been configured with the following options:"
2380 echo " User binaries: $B"
2381 echo " System binaries: $C"
2382 echo " Configuration files: $D"
2383 echo " Askpass program: $E"
2384 echo " Manual pages: $F"
2385 echo " PID file: $G"
2386 echo " sshd default user PATH: $H"
2387 echo " Manpage format: $MANTYPE"
2388 echo " PAM support: ${PAM_MSG}"
2389 echo " KerberosIV support: $KRB4_MSG"
2390 echo " Smartcard support: $SCARD_MSG"
2391 echo " AFS support: $AFS_MSG"
2392 echo " S/KEY support: $SKEY_MSG"
2393 echo " TCP Wrappers support: $TCPW_MSG"
2394 echo " MD5 password support: $MD5_MSG"
2395 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2396 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2397 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2398 echo " BSD Auth support: $BSD_AUTH_MSG"
2399 echo " Random number source: $RAND_MSG"
2400 if test ! -z "$USE_RAND_HELPER" ; then
2401 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2406 echo " Host: ${host}"
2407 echo " Compiler: ${CC}"
2408 echo " Compiler flags: ${CFLAGS}"
2409 echo "Preprocessor flags: ${CPPFLAGS}"
2410 echo " Linker flags: ${LDFLAGS}"
2411 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2415 if test "x$PAM_MSG" = "xyes" ; then
2416 echo "PAM is enabled. You may need to install a PAM control file "
2417 echo "for sshd, otherwise password authentication may fail. "
2418 echo "Example PAM control files can be found in the contrib/ "
2423 if test ! -z "$NO_SFTP"; then
2424 echo "sftp-server will be disabled. Your compiler does not "
2425 echo "support 64bit integers."
2429 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2430 echo "WARNING: you are using the builtin random number collection "
2431 echo "service. Please read WARNING.RNG and request that your OS "
2432 echo "vendor includes kernel-based random number collection in "
2433 echo "future versions of your OS."