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_CHECK_FUNC(jlimit_startjob, [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 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/ttcompat.h 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 the user wants GSI (Globus) support
457 [ --with-gsi=PATH Enable GSI/Globus authentication support],
464 [ --with-globus=PATH Enable GSI/Globus authentication support],
470 if test "x$gsi_path" != "xno" ; then
471 # Globus GSSAPI configuration
475 # Find GLOBUS/GSI installation Directory
476 AC_MSG_CHECKING(for Globus/GSI installation directory)
478 globus_install_dir=$gsi_path
480 if test "x$globus_install_dir" = "xyes" ; then
481 if test -n "$GLOBUS_INSTALL_PATH" ; then
482 globus_install_dir=$GLOBUS_INSTALL_PATH
483 elif test -n "$GSI_INSTALL_PATH" ; then
484 globus_install_dir=$GSI_INSTALL_PATH
485 elif test -d /usr/local/globus ; then
486 globus_install_dir="/usr/local/globus"
487 elif test -d /usr/local/gsi ; then
488 globus_install_dir="/usr/local/gsi"
490 AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
493 AC_MSG_RESULT($globus_install_dir)
495 # Find GLOBUS/GSI development directory
496 AC_MSG_CHECKING(for Globus/GSI development directory)
498 if test -d ${globus_install_dir}/lib ; then
499 # Looks like a flat directory structure from configure/make
500 # and not globus-install or gsi-install
501 globus_dev_dir=$globus_install_dir
504 # Assume a true globus installation with architecture
505 # directories and run globus-development-path to find
506 # the development directory
508 # Set GLOBUS_INSTALL_PATH
509 GLOBUS_INSTALL_PATH=$globus_install_dir
510 export GLOBUS_INSTALL_PATH
512 dev_path_program=${globus_install_dir}/bin/globus-development-path
514 if test ! -x ${dev_path_program} ; then
515 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
518 globus_dev_dir=`${dev_path_program}`
520 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
521 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
524 if test ! -d "$globus_dev_dir" ; then
525 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
528 AC_MSG_RESULT($globus_dev_dir)
530 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa -lssl -lcrypto"
531 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
532 GSI_CFLAGS="-I${globus_dev_dir}/include"
534 LIBS="$LIBS $GSI_LIBS"
535 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
536 CFLAGS="$CFLAGS $GSI_CFLAGS"
537 # End Globus/GSI section
540 # Check whether user wants S/Key support
543 [ --with-skey[[=PATH]] Enable S/Key support
544 (optionally in PATH)],
546 if test "x$withval" != "xno" ; then
548 if test "x$withval" != "xyes" ; then
549 CPPFLAGS="$CPPFLAGS -I${withval}/include"
550 LDFLAGS="$LDFLAGS -L${withval}/lib"
557 AC_MSG_CHECKING([for s/key support])
562 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
564 [AC_MSG_RESULT(yes)],
567 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
573 # Check whether user wants TCP wrappers support
575 AC_ARG_WITH(tcp-wrappers,
576 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
577 (optionally in PATH)],
579 if test "x$withval" != "xno" ; then
581 saved_LDFLAGS="$LDFLAGS"
582 saved_CPPFLAGS="$CPPFLAGS"
583 if test -n "${withval}" -a "${withval}" != "yes"; then
584 if test -d "${withval}/lib"; then
585 if test -n "${need_dash_r}"; then
586 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
588 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
591 if test -n "${need_dash_r}"; then
592 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
594 LDFLAGS="-L${withval} ${LDFLAGS}"
597 if test -d "${withval}/include"; then
598 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
600 CPPFLAGS="-I${withval} ${CPPFLAGS}"
604 LIBS="$LIBWRAP $LIBS"
605 AC_MSG_CHECKING(for libwrap)
609 int deny_severity = 0, allow_severity = 0;
619 AC_MSG_ERROR([*** libwrap missing])
627 dnl Checks for library functions.
628 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
629 clock fchmod fchown freeaddrinfo futimes gai_strerror \
630 getaddrinfo getcwd getgrouplist getnameinfo getopt \
631 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
632 inet_ntop innetgr login_getcapbool md5_crypt memmove \
633 mkdtemp on_exit openpty readpassphrase realpath \
634 rresvport_af setdtablesize setegid setenv seteuid \
635 setlogin setproctitle setresgid setreuid setrlimit \
636 setsid setvbuf sigaction sigvec snprintf strerror \
637 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
638 vhangup vsnprintf waitpid __b64_ntop _getpty)
640 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
641 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
642 AC_CHECK_LIB(gen, dirname,[
643 AC_CACHE_CHECK([for broken dirname],
644 ac_cv_have_broken_dirname, [
652 int main(int argc, char **argv) {
655 strncpy(buf,"/etc", 32);
657 if (!s || strncmp(s, "/", 32) != 0) {
664 [ ac_cv_have_broken_dirname="no" ],
665 [ ac_cv_have_broken_dirname="yes" ]
669 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
671 AC_DEFINE(HAVE_DIRNAME)
672 AC_CHECK_HEADERS(libgen.h)
677 dnl Checks for time functions
678 AC_CHECK_FUNCS(gettimeofday time)
679 dnl Checks for utmp functions
680 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
681 AC_CHECK_FUNCS(utmpname)
682 dnl Checks for utmpx functions
683 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
684 AC_CHECK_FUNCS(setutxent utmpxname)
686 AC_CHECK_FUNC(getuserattr,
687 [AC_DEFINE(HAVE_GETUSERATTR)],
688 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
691 AC_CHECK_FUNC(daemon,
692 [AC_DEFINE(HAVE_DAEMON)],
693 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
696 AC_CHECK_FUNC(getpagesize,
697 [AC_DEFINE(HAVE_GETPAGESIZE)],
698 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
701 # Check for broken snprintf
702 if test "x$ac_cv_func_snprintf" = "xyes" ; then
703 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
707 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
709 [AC_MSG_RESULT(yes)],
712 AC_DEFINE(BROKEN_SNPRINTF)
713 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
723 [ --with-pam Enable PAM support ],
725 if test "x$withval" != "xno" ; then
726 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
727 AC_MSG_ERROR([PAM headers not found])
730 AC_CHECK_LIB(dl, dlopen, , )
731 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
732 AC_CHECK_FUNCS(pam_getenvlist)
738 if test $ac_cv_lib_dl_dlopen = yes; then
748 # Check for older PAM
749 if test "x$PAM_MSG" = "xyes" ; then
750 # Check PAM strerror arguments (old PAM)
751 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
755 #include <security/pam_appl.h>
757 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
760 AC_DEFINE(HAVE_OLD_PAM)
762 PAM_MSG="yes (old library)"
767 # The big search for OpenSSL
769 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
771 if test "x$withval" != "xno" ; then
778 saved_LDFLAGS="$LDFLAGS"
779 saved_CPPFLAGS="$CPPFLAGS"
780 if test "x$prefix" != "xNONE" ; then
781 tryssldir="$tryssldir $prefix"
783 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
784 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
785 CPPFLAGS="$saved_CPPFLAGS"
786 LDFLAGS="$saved_LDFLAGS"
787 LIBS="$saved_LIBS -lcrypto"
789 # Skip directories if they don't exist
790 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
793 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
794 # Try to use $ssldir/lib if it exists, otherwise
796 if test -d "$ssldir/lib" ; then
797 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
798 if test ! -z "$need_dash_r" ; then
799 LDFLAGS="-R$ssldir/lib $LDFLAGS"
802 LDFLAGS="-L$ssldir $saved_LDFLAGS"
803 if test ! -z "$need_dash_r" ; then
804 LDFLAGS="-R$ssldir $LDFLAGS"
807 # Try to use $ssldir/include if it exists, otherwise
809 if test -d "$ssldir/include" ; then
810 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
812 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
816 # Basic test to check for compatible version and correct linking
817 # *does not* test for RSA - that comes later.
821 #include <openssl/rand.h>
825 memset(a, 0, sizeof(a));
826 RAND_add(a, sizeof(a), sizeof(a));
827 return(RAND_status() <= 0);
836 if test ! -z "$found_crypto" ; then
841 if test -z "$found_crypto" ; then
842 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
844 if test -z "$ssldir" ; then
848 ac_cv_openssldir=$ssldir
851 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
852 AC_DEFINE(HAVE_OPENSSL)
853 dnl Need to recover ssldir - test above runs in subshell
854 ssldir=$ac_cv_openssldir
855 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
856 # Try to use $ssldir/lib if it exists, otherwise
858 if test -d "$ssldir/lib" ; then
859 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
860 if test ! -z "$need_dash_r" ; then
861 LDFLAGS="-R$ssldir/lib $LDFLAGS"
864 LDFLAGS="-L$ssldir $saved_LDFLAGS"
865 if test ! -z "$need_dash_r" ; then
866 LDFLAGS="-R$ssldir $LDFLAGS"
869 # Try to use $ssldir/include if it exists, otherwise
871 if test -d "$ssldir/include" ; then
872 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
874 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
878 LIBS="$saved_LIBS -lcrypto"
880 # Now test RSA support
882 AC_MSG_CHECKING([for RSA support])
883 for WANTS_RSAREF in "" 1 ; do
884 if test -z "$WANTS_RSAREF" ; then
887 LIBS="$saved_LIBS -lRSAglue -lrsaref"
891 #include <openssl/rand.h>
892 #include <openssl/rsa.h>
893 #include <openssl/bn.h>
894 #include <openssl/sha.h>
897 int num; RSA *key; static unsigned char p_in[] = "blahblah";
898 unsigned char c[256], p[256];
899 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
900 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
901 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
902 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
912 if test ! -z "$no_rsa" ; then
913 AC_MSG_RESULT(disabled)
916 if test -z "$rsa_works" ; then
917 AC_MSG_WARN([*** No RSA support found *** ])
920 if test -z "$WANTS_RSAREF" ; then
924 RSA_MSG="yes (using RSAref)"
925 AC_MSG_RESULT(using RSAref)
926 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
931 # Sanity check OpenSSL headers
932 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
936 #include <openssl/opensslv.h>
937 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
944 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
948 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
949 # version in OpenSSL. Skip this for PAM
950 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
951 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
955 ### Configure cryptographic random number support
957 # Check wheter OpenSSL seeds itself
958 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
962 #include <openssl/rand.h>
963 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
966 OPENSSL_SEEDS_ITSELF=yes
971 # Default to use of the rand helper if OpenSSL doesn't
978 # Do we want to force the use of the rand helper?
979 AC_ARG_WITH(rand-helper,
980 [ --with-rand-helper Use subprocess to gather strong randomness ],
982 if test "x$withval" = "xno" ; then
983 # Force use of OpenSSL's internal RNG, even if
984 # the previous test showed it to be unseeded.
985 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
986 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
987 OPENSSL_SEEDS_ITSELF=yes
996 # Which randomness source do we use?
997 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
999 AC_DEFINE(OPENSSL_PRNG_ONLY)
1000 RAND_MSG="OpenSSL internal ONLY"
1001 INSTALL_SSH_RAND_HELPER=""
1002 elif test ! -z "$USE_RAND_HELPER" ; then
1003 # install rand helper
1004 RAND_MSG="ssh-rand-helper"
1005 INSTALL_SSH_RAND_HELPER="yes"
1007 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1009 ### Configuration of ssh-rand-helper
1012 AC_ARG_WITH(prngd-port,
1013 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1022 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1025 if test ! -z "$withval" ; then
1026 PRNGD_PORT="$withval"
1027 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1032 # PRNGD Unix domain socket
1033 AC_ARG_WITH(prngd-socket,
1034 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1038 withval="/var/run/egd-pool"
1046 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1050 if test ! -z "$withval" ; then
1051 if test ! -z "$PRNGD_PORT" ; then
1052 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1054 if test ! -r "$withval" ; then
1055 AC_MSG_WARN(Entropy socket is not readable)
1057 PRNGD_SOCKET="$withval"
1058 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1062 # Check for existing socket only if we don't have a random device already
1063 if test "$USE_RAND_HELPER" = yes ; then
1064 AC_MSG_CHECKING(for PRNGD/EGD socket)
1065 # Insert other locations here
1066 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1067 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1068 PRNGD_SOCKET="$sock"
1069 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1073 if test ! -z "$PRNGD_SOCKET" ; then
1074 AC_MSG_RESULT($PRNGD_SOCKET)
1076 AC_MSG_RESULT(not found)
1082 # Change default command timeout for hashing entropy source
1084 AC_ARG_WITH(entropy-timeout,
1085 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1087 if test "x$withval" != "xno" ; then
1088 entropy_timeout=$withval
1093 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1095 # These programs are used by the command hashing source to gather entropy
1096 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1097 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1098 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1099 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1100 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1101 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1102 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1103 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1104 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1105 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1106 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1107 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1108 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1109 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1110 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1111 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1113 # Where does ssh-rand-helper get its randomness from?
1114 INSTALL_SSH_PRNG_CMDS=""
1115 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1116 if test ! -z "$PRNGD_PORT" ; then
1117 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1118 elif test ! -z "$PRNGD_SOCKET" ; then
1119 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1121 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1122 RAND_HELPER_CMDHASH=yes
1123 INSTALL_SSH_PRNG_CMDS="yes"
1126 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1129 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1130 if test ! -z "$SONY" ; then
1131 LIBS="$LIBS -liberty";
1134 # Checks for data types
1135 AC_CHECK_SIZEOF(char, 1)
1136 AC_CHECK_SIZEOF(short int, 2)
1137 AC_CHECK_SIZEOF(int, 4)
1138 AC_CHECK_SIZEOF(long int, 4)
1139 AC_CHECK_SIZEOF(long long int, 8)
1141 # More checks for data types
1142 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1144 [ #include <sys/types.h> ],
1146 [ ac_cv_have_u_int="yes" ],
1147 [ ac_cv_have_u_int="no" ]
1150 if test "x$ac_cv_have_u_int" = "xyes" ; then
1151 AC_DEFINE(HAVE_U_INT)
1155 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1157 [ #include <sys/types.h> ],
1158 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1159 [ ac_cv_have_intxx_t="yes" ],
1160 [ ac_cv_have_intxx_t="no" ]
1163 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1164 AC_DEFINE(HAVE_INTXX_T)
1168 if (test -z "$have_intxx_t" && \
1169 test "x$ac_cv_header_stdint_h" = "xyes")
1171 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1173 [ #include <stdint.h> ],
1174 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1176 AC_DEFINE(HAVE_INTXX_T)
1179 [ AC_MSG_RESULT(no) ]
1183 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1185 [ #include <sys/types.h> ],
1186 [ int64_t a; a = 1;],
1187 [ ac_cv_have_int64_t="yes" ],
1188 [ ac_cv_have_int64_t="no" ]
1191 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1192 AC_DEFINE(HAVE_INT64_T)
1196 if test -z "$have_int64_t" ; then
1197 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1199 [ #include <sys/socket.h> ],
1200 [ int64_t a; a = 1],
1202 AC_DEFINE(HAVE_INT64_T)
1205 [ AC_MSG_RESULT(no) ]
1209 if test -z "$have_int64_t" ; then
1210 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1212 [ #include <sys/bitypes.h> ],
1213 [ int64_t a; a = 1],
1215 AC_DEFINE(HAVE_INT64_T)
1218 [ AC_MSG_RESULT(no) ]
1222 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1224 [ #include <sys/types.h> ],
1225 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1226 [ ac_cv_have_u_intxx_t="yes" ],
1227 [ ac_cv_have_u_intxx_t="no" ]
1230 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1231 AC_DEFINE(HAVE_U_INTXX_T)
1235 if test -z "$have_u_intxx_t" ; then
1236 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1238 [ #include <sys/socket.h> ],
1239 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1241 AC_DEFINE(HAVE_U_INTXX_T)
1244 [ AC_MSG_RESULT(no) ]
1248 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1250 [ #include <sys/types.h> ],
1251 [ u_int64_t a; a = 1;],
1252 [ ac_cv_have_u_int64_t="yes" ],
1253 [ ac_cv_have_u_int64_t="no" ]
1256 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1257 AC_DEFINE(HAVE_U_INT64_T)
1261 if test -z "$have_u_int64_t" ; then
1262 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1264 [ #include <sys/bitypes.h> ],
1265 [ u_int64_t a; a = 1],
1267 AC_DEFINE(HAVE_U_INT64_T)
1270 [ AC_MSG_RESULT(no) ]
1274 if test -z "$have_u_intxx_t" ; then
1275 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1278 #include <sys/types.h>
1280 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1281 [ ac_cv_have_uintxx_t="yes" ],
1282 [ ac_cv_have_uintxx_t="no" ]
1285 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1286 AC_DEFINE(HAVE_UINTXX_T)
1290 if test -z "$have_uintxx_t" ; then
1291 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1293 [ #include <stdint.h> ],
1294 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1296 AC_DEFINE(HAVE_UINTXX_T)
1299 [ AC_MSG_RESULT(no) ]
1303 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1304 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1306 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1309 #include <sys/bitypes.h>
1312 int8_t a; int16_t b; int32_t c;
1313 u_int8_t e; u_int16_t f; u_int32_t g;
1314 a = b = c = e = f = g = 1;
1317 AC_DEFINE(HAVE_U_INTXX_T)
1318 AC_DEFINE(HAVE_INTXX_T)
1326 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1329 #include <sys/types.h>
1331 [ u_char foo; foo = 125; ],
1332 [ ac_cv_have_u_char="yes" ],
1333 [ ac_cv_have_u_char="no" ]
1336 if test "x$ac_cv_have_u_char" = "xyes" ; then
1337 AC_DEFINE(HAVE_U_CHAR)
1342 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1344 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1347 #include <sys/types.h>
1349 [ size_t foo; foo = 1235; ],
1350 [ ac_cv_have_size_t="yes" ],
1351 [ ac_cv_have_size_t="no" ]
1354 if test "x$ac_cv_have_size_t" = "xyes" ; then
1355 AC_DEFINE(HAVE_SIZE_T)
1358 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1361 #include <sys/types.h>
1363 [ ssize_t foo; foo = 1235; ],
1364 [ ac_cv_have_ssize_t="yes" ],
1365 [ ac_cv_have_ssize_t="no" ]
1368 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1369 AC_DEFINE(HAVE_SSIZE_T)
1372 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1377 [ clock_t foo; foo = 1235; ],
1378 [ ac_cv_have_clock_t="yes" ],
1379 [ ac_cv_have_clock_t="no" ]
1382 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1383 AC_DEFINE(HAVE_CLOCK_T)
1386 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1389 #include <sys/types.h>
1390 #include <sys/socket.h>
1392 [ sa_family_t foo; foo = 1235; ],
1393 [ ac_cv_have_sa_family_t="yes" ],
1396 #include <sys/types.h>
1397 #include <sys/socket.h>
1398 #include <netinet/in.h>
1400 [ sa_family_t foo; foo = 1235; ],
1401 [ ac_cv_have_sa_family_t="yes" ],
1403 [ ac_cv_have_sa_family_t="no" ]
1407 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1408 AC_DEFINE(HAVE_SA_FAMILY_T)
1411 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1414 #include <sys/types.h>
1416 [ pid_t foo; foo = 1235; ],
1417 [ ac_cv_have_pid_t="yes" ],
1418 [ ac_cv_have_pid_t="no" ]
1421 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1422 AC_DEFINE(HAVE_PID_T)
1425 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1428 #include <sys/types.h>
1430 [ mode_t foo; foo = 1235; ],
1431 [ ac_cv_have_mode_t="yes" ],
1432 [ ac_cv_have_mode_t="no" ]
1435 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1436 AC_DEFINE(HAVE_MODE_T)
1440 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1443 #include <sys/types.h>
1444 #include <sys/socket.h>
1446 [ struct sockaddr_storage s; ],
1447 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1448 [ ac_cv_have_struct_sockaddr_storage="no" ]
1451 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1452 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1455 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1458 #include <sys/types.h>
1459 #include <netinet/in.h>
1461 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1462 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1463 [ ac_cv_have_struct_sockaddr_in6="no" ]
1466 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1467 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1470 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1473 #include <sys/types.h>
1474 #include <netinet/in.h>
1476 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1477 [ ac_cv_have_struct_in6_addr="yes" ],
1478 [ ac_cv_have_struct_in6_addr="no" ]
1481 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1482 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1485 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1488 #include <sys/types.h>
1489 #include <sys/socket.h>
1492 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1493 [ ac_cv_have_struct_addrinfo="yes" ],
1494 [ ac_cv_have_struct_addrinfo="no" ]
1497 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1498 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1501 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1503 [ #include <sys/time.h> ],
1504 [ struct timeval tv; tv.tv_sec = 1;],
1505 [ ac_cv_have_struct_timeval="yes" ],
1506 [ ac_cv_have_struct_timeval="no" ]
1509 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1510 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1511 have_struct_timeval=1
1514 # If we don't have int64_t then we can't compile sftp-server. So don't
1515 # even attempt to do it.
1516 if test "x$ac_cv_have_int64_t" = "xno" -a \
1517 "x$ac_cv_sizeof_long_int" != "x8" -a \
1518 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1521 dnl test snprintf (broken on SCO w/gcc)
1526 #ifdef HAVE_SNPRINTF
1530 char expected_out[50];
1532 #if (SIZEOF_LONG_INT == 8)
1533 long int num = 0x7fffffffffffffff;
1535 long long num = 0x7fffffffffffffffll;
1537 strcpy(expected_out, "9223372036854775807");
1538 snprintf(buf, mazsize, "%lld", num);
1539 if(strcmp(buf, expected_out) != 0)
1546 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1551 dnl Checks for structure members
1552 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1553 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1554 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1555 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1556 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1557 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1558 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1559 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1560 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1561 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1562 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1563 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1564 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1565 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1566 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1567 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1568 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1570 AC_CHECK_MEMBERS([struct stat.st_blksize])
1572 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1573 ac_cv_have_ss_family_in_struct_ss, [
1576 #include <sys/types.h>
1577 #include <sys/socket.h>
1579 [ struct sockaddr_storage s; s.ss_family = 1; ],
1580 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1581 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1584 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1585 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1588 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1589 ac_cv_have___ss_family_in_struct_ss, [
1592 #include <sys/types.h>
1593 #include <sys/socket.h>
1595 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1596 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1597 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1600 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1601 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1604 AC_CACHE_CHECK([for pw_class field in struct passwd],
1605 ac_cv_have_pw_class_in_struct_passwd, [
1610 [ struct passwd p; p.pw_class = 0; ],
1611 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1612 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1615 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1616 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1619 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1620 ac_cv_have_pw_expire_in_struct_passwd, [
1625 [ struct passwd p; p.pw_expire = 0; ],
1626 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1627 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1630 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1631 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1634 AC_CACHE_CHECK([for pw_change field in struct passwd],
1635 ac_cv_have_pw_change_in_struct_passwd, [
1640 [ struct passwd p; p.pw_change = 0; ],
1641 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1642 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1645 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1646 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1649 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1651 [ extern char *__progname; printf("%s", __progname); ],
1652 [ ac_cv_libc_defines___progname="yes" ],
1653 [ ac_cv_libc_defines___progname="no" ]
1656 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1657 AC_DEFINE(HAVE___PROGNAME)
1660 AC_CACHE_CHECK([whether getopt has optreset support],
1661 ac_cv_have_getopt_optreset, [
1666 [ extern int optreset; optreset = 0; ],
1667 [ ac_cv_have_getopt_optreset="yes" ],
1668 [ ac_cv_have_getopt_optreset="no" ]
1671 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1672 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1675 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1677 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1678 [ ac_cv_libc_defines_sys_errlist="yes" ],
1679 [ ac_cv_libc_defines_sys_errlist="no" ]
1682 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1683 AC_DEFINE(HAVE_SYS_ERRLIST)
1687 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1689 [ extern int sys_nerr; printf("%i", sys_nerr);],
1690 [ ac_cv_libc_defines_sys_nerr="yes" ],
1691 [ ac_cv_libc_defines_sys_nerr="no" ]
1694 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1695 AC_DEFINE(HAVE_SYS_NERR)
1699 # Check whether user wants Kerberos support
1701 AC_ARG_WITH(smartcard,
1702 [ --with-smartcard Enable smartcard support],
1704 if test "x$withval" != "xno" ; then
1705 if test "x$withval" != "xyes" ; then
1706 CPPFLAGS="$CPPFLAGS -I${withval}"
1707 LDFLAGS="$LDFLAGS -L${withval}"
1708 if test ! -z "$need_dash_r" ; then
1709 LDFLAGS="$LDFLAGS -R${withval}"
1711 if test ! -z "$blibpath" ; then
1712 blibpath="$blibpath:${withval}"
1715 AC_CHECK_HEADERS(sectok.h)
1716 if test "$ac_cv_header_sectok_h" != yes; then
1717 AC_MSG_ERROR(Can't find sectok.h)
1719 AC_CHECK_LIB(sectok, sectok_open)
1720 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1721 AC_MSG_ERROR(Can't find libsectok)
1723 AC_DEFINE(SMARTCARD)
1729 # Check whether user wants Kerberos 5 support
1730 AC_ARG_WITH(kerberos5,
1731 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1733 if test "x$withval" != "xno" ; then
1734 if test "x$withval" = "xyes" ; then
1735 KRB5ROOT="/usr/local"
1739 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1740 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1742 AC_MSG_CHECKING(whether we are using Heimdal)
1743 AC_TRY_COMPILE([ #include <krb5.h> ],
1744 [ char *tmp = heimdal_version; ],
1745 [ AC_MSG_RESULT(yes)
1747 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1750 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1753 if test ! -z "$need_dash_r" ; then
1754 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1756 if test ! -z "$blibpath" ; then
1757 blibpath="$blibpath:${KRB5ROOT}/lib"
1759 AC_CHECK_LIB(resolv, dn_expand, , )
1761 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1763 K5LIBS="-lgssapi $K5LIBS" ],
1764 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1766 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1767 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1772 AC_CHECK_HEADER(gssapi.h, ,
1773 [ unset ac_cv_header_gssapi_h
1774 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1775 AC_CHECK_HEADERS(gssapi.h, ,
1776 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1782 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1783 AC_CHECK_HEADER(gssapi_krb5.h, ,
1784 [ CPPFLAGS="$oldCPP" ])
1790 # Check whether user wants Kerberos 4 support
1792 AC_ARG_WITH(kerberos4,
1793 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1795 if test "x$withval" != "xno" ; then
1796 if test "x$withval" != "xyes" ; then
1797 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1798 LDFLAGS="$LDFLAGS -L${withval}/lib"
1799 if test ! -z "$need_dash_r" ; then
1800 LDFLAGS="$LDFLAGS -R${withval}/lib"
1802 if test ! -z "$blibpath" ; then
1803 blibpath="$blibpath:${withval}/lib"
1806 if test -d /usr/include/kerberosIV ; then
1807 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1811 AC_CHECK_HEADERS(krb.h)
1812 if test "$ac_cv_header_krb_h" != yes; then
1813 AC_MSG_WARN([Cannot find krb.h, build may fail])
1815 AC_CHECK_LIB(krb, main)
1816 if test "$ac_cv_lib_krb_main" != yes; then
1817 AC_CHECK_LIB(krb4, main)
1818 if test "$ac_cv_lib_krb4_main" != yes; then
1819 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1826 AC_CHECK_LIB(des, des_cbc_encrypt)
1827 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1828 AC_CHECK_LIB(des425, des_cbc_encrypt)
1829 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1830 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1837 AC_CHECK_LIB(resolv, dn_expand, , )
1845 # Check whether user wants AFS support
1848 [ --with-afs=PATH Enable AFS support],
1850 if test "x$withval" != "xno" ; then
1852 if test "x$withval" != "xyes" ; then
1853 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1854 LDFLAGS="$LDFLAGS -L${withval}/lib"
1857 if test -z "$KRB4" ; then
1858 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1862 if test ! -z "$AFS_LIBS" ; then
1863 LIBS="$LIBS $AFS_LIBS"
1870 LIBS="$LIBS $KLIBS $K5LIBS"
1872 # Looking for programs, paths and files
1874 [ --with-rsh=PATH Specify path to remote shell program ],
1876 if test "x$withval" != "$no" ; then
1881 AC_PATH_PROG(rsh_path, rsh)
1886 [ --with-xauth=PATH Specify path to xauth program ],
1888 if test "x$withval" != "xno" ; then
1893 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1894 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1895 xauth_path="/usr/openwin/bin/xauth"
1900 if test -z "$xauth_path" ; then
1901 XAUTH_PATH="undefined"
1902 AC_SUBST(XAUTH_PATH)
1904 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1905 XAUTH_PATH=$xauth_path
1906 AC_SUBST(XAUTH_PATH)
1908 if test ! -z "$rsh_path" ; then
1909 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1912 # Check for mail directory (last resort if we cannot get it from headers)
1913 if test ! -z "$MAIL" ; then
1914 maildir=`dirname $MAIL`
1915 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1918 if test -z "$no_dev_ptmx" ; then
1919 AC_CHECK_FILE("/dev/ptmx",
1921 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1926 AC_CHECK_FILE("/dev/ptc",
1928 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1933 # Options from here on. Some of these are preset by platform above
1934 AC_ARG_WITH(mantype,
1935 [ --with-mantype=man|cat|doc Set man page type],
1942 AC_MSG_ERROR(invalid man type: $withval)
1947 if test -z "$MANTYPE"; then
1948 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1949 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1951 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1958 if test "$MANTYPE" = "doc"; then
1965 # Check whether to enable MD5 passwords
1967 AC_ARG_WITH(md5-passwords,
1968 [ --with-md5-passwords Enable use of MD5 passwords],
1970 if test "x$withval" != "xno" ; then
1971 AC_DEFINE(HAVE_MD5_PASSWORDS)
1977 # Whether to disable shadow password support
1979 [ --without-shadow Disable shadow password support],
1981 if test "x$withval" = "xno" ; then
1982 AC_DEFINE(DISABLE_SHADOW)
1988 if test -z "$disable_shadow" ; then
1989 AC_MSG_CHECKING([if the systems has expire shadow information])
1992 #include <sys/types.h>
1995 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1996 [ sp_expire_available=yes ], []
1999 if test "x$sp_expire_available" = "xyes" ; then
2001 AC_DEFINE(HAS_SHADOW_EXPIRE)
2007 # Use ip address instead of hostname in $DISPLAY
2008 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2009 DISPLAY_HACK_MSG="yes"
2010 AC_DEFINE(IPADDR_IN_DISPLAY)
2012 DISPLAY_HACK_MSG="no"
2013 AC_ARG_WITH(ipaddr-display,
2014 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2016 if test "x$withval" != "xno" ; then
2017 AC_DEFINE(IPADDR_IN_DISPLAY)
2018 DISPLAY_HACK_MSG="yes"
2024 # Whether to mess with the default path
2025 SERVER_PATH_MSG="(default)"
2026 AC_ARG_WITH(default-path,
2027 [ --with-default-path=PATH Specify default \$PATH environment for server],
2029 if test "x$withval" != "xno" ; then
2030 user_path="$withval"
2031 SERVER_PATH_MSG="$withval"
2037 /* find out what STDPATH is */
2042 #ifndef _PATH_STDPATH
2043 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2045 #include <sys/types.h>
2046 #include <sys/stat.h>
2048 #define DATA "conftest.stdpath"
2055 fd = fopen(DATA,"w");
2059 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2064 ], [ user_path=`cat conftest.stdpath` ],
2065 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2066 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2068 # make sure $bindir is in USER_PATH so scp will work
2069 t_bindir=`eval echo ${bindir}`
2071 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2074 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2076 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2077 if test $? -ne 0 ; then
2078 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2079 if test $? -ne 0 ; then
2080 user_path=$user_path:$t_bindir
2081 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2086 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2089 # Whether to force IPv4 by default (needed on broken glibc Linux)
2091 AC_ARG_WITH(ipv4-default,
2092 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2094 if test "x$withval" != "xno" ; then
2095 AC_DEFINE(IPV4_DEFAULT)
2101 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2102 IPV4_IN6_HACK_MSG="no"
2104 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2106 if test "x$withval" != "xno" ; then
2108 AC_DEFINE(IPV4_IN_IPV6)
2109 IPV4_IN6_HACK_MSG="yes"
2114 if test "x$inet6_default_4in6" = "xyes"; then
2115 AC_MSG_RESULT([yes (default)])
2116 AC_DEFINE(IPV4_IN_IPV6)
2117 IPV4_IN6_HACK_MSG="yes"
2119 AC_MSG_RESULT([no (default)])
2124 # Whether to enable BSD auth support
2126 AC_ARG_WITH(bsd-auth,
2127 [ --with-bsd-auth Enable BSD auth support],
2129 if test "x$withval" != "xno" ; then
2136 AC_MSG_CHECKING(whether to install ssh as suid root)
2137 AC_ARG_ENABLE(suid-ssh,
2138 [ --enable-suid-ssh Install ssh as suid root (default)
2139 --disable-suid-ssh Install ssh without suid bit],
2140 [ case "$enableval" in
2145 *) AC_MSG_RESULT(yes)
2155 # Where to place sshd.pid
2157 AC_ARG_WITH(pid-dir,
2158 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2160 if test "x$withval" != "xno" ; then
2166 # make sure the directory exists
2167 if test ! -d $piddir ; then
2168 piddir=`eval echo ${sysconfdir}`
2170 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2174 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2177 dnl allow user to disable some login recording features
2178 AC_ARG_ENABLE(lastlog,
2179 [ --disable-lastlog disable use of lastlog even if detected [no]],
2180 [ AC_DEFINE(DISABLE_LASTLOG) ]
2183 [ --disable-utmp disable use of utmp even if detected [no]],
2184 [ AC_DEFINE(DISABLE_UTMP) ]
2186 AC_ARG_ENABLE(utmpx,
2187 [ --disable-utmpx disable use of utmpx even if detected [no]],
2188 [ AC_DEFINE(DISABLE_UTMPX) ]
2191 [ --disable-wtmp disable use of wtmp even if detected [no]],
2192 [ AC_DEFINE(DISABLE_WTMP) ]
2194 AC_ARG_ENABLE(wtmpx,
2195 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2196 [ AC_DEFINE(DISABLE_WTMPX) ]
2198 AC_ARG_ENABLE(libutil,
2199 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2200 [ AC_DEFINE(DISABLE_LOGIN) ]
2202 AC_ARG_ENABLE(pututline,
2203 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2204 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2206 AC_ARG_ENABLE(pututxline,
2207 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2208 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2210 AC_ARG_WITH(lastlog,
2211 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2213 if test "x$withval" = "xno" ; then
2214 AC_DEFINE(DISABLE_LASTLOG)
2216 conf_lastlog_location=$withval
2221 dnl lastlog, [uw]tmpx? detection
2222 dnl NOTE: set the paths in the platform section to avoid the
2223 dnl need for command-line parameters
2224 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2226 dnl lastlog detection
2227 dnl NOTE: the code itself will detect if lastlog is a directory
2228 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2230 #include <sys/types.h>
2232 #ifdef HAVE_LASTLOG_H
2233 # include <lastlog.h>
2242 [ char *lastlog = LASTLOG_FILE; ],
2243 [ AC_MSG_RESULT(yes) ],
2246 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2248 #include <sys/types.h>
2250 #ifdef HAVE_LASTLOG_H
2251 # include <lastlog.h>
2257 [ char *lastlog = _PATH_LASTLOG; ],
2258 [ AC_MSG_RESULT(yes) ],
2261 system_lastlog_path=no
2266 if test -z "$conf_lastlog_location"; then
2267 if test x"$system_lastlog_path" = x"no" ; then
2268 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2269 if (test -d "$f" || test -f "$f") ; then
2270 conf_lastlog_location=$f
2273 if test -z "$conf_lastlog_location"; then
2274 AC_MSG_WARN([** Cannot find lastlog **])
2275 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2280 if test -n "$conf_lastlog_location"; then
2281 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2285 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2287 #include <sys/types.h>
2293 [ char *utmp = UTMP_FILE; ],
2294 [ AC_MSG_RESULT(yes) ],
2296 system_utmp_path=no ]
2298 if test -z "$conf_utmp_location"; then
2299 if test x"$system_utmp_path" = x"no" ; then
2300 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2301 if test -f $f ; then
2302 conf_utmp_location=$f
2305 if test -z "$conf_utmp_location"; then
2306 AC_DEFINE(DISABLE_UTMP)
2310 if test -n "$conf_utmp_location"; then
2311 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2315 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2317 #include <sys/types.h>
2323 [ char *wtmp = WTMP_FILE; ],
2324 [ AC_MSG_RESULT(yes) ],
2326 system_wtmp_path=no ]
2328 if test -z "$conf_wtmp_location"; then
2329 if test x"$system_wtmp_path" = x"no" ; then
2330 for f in /usr/adm/wtmp /var/log/wtmp; do
2331 if test -f $f ; then
2332 conf_wtmp_location=$f
2335 if test -z "$conf_wtmp_location"; then
2336 AC_DEFINE(DISABLE_WTMP)
2340 if test -n "$conf_wtmp_location"; then
2341 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2345 dnl utmpx detection - I don't know any system so perverse as to require
2346 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2348 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2350 #include <sys/types.h>
2359 [ char *utmpx = UTMPX_FILE; ],
2360 [ AC_MSG_RESULT(yes) ],
2362 system_utmpx_path=no ]
2364 if test -z "$conf_utmpx_location"; then
2365 if test x"$system_utmpx_path" = x"no" ; then
2366 AC_DEFINE(DISABLE_UTMPX)
2369 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2373 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2375 #include <sys/types.h>
2384 [ char *wtmpx = WTMPX_FILE; ],
2385 [ AC_MSG_RESULT(yes) ],
2387 system_wtmpx_path=no ]
2389 if test -z "$conf_wtmpx_location"; then
2390 if test x"$system_wtmpx_path" = x"no" ; then
2391 AC_DEFINE(DISABLE_WTMPX)
2394 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2398 if test ! -z "$blibpath" ; then
2399 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2400 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2403 dnl remove pam and dl because they are in $LIBPAM
2404 if test "$PAM_MSG" = yes ; then
2405 LIBS=`echo $LIBS | sed 's/-lpam //'`
2407 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2408 LIBS=`echo $LIBS | sed 's/-ldl //'`
2412 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2415 # Print summary of options
2417 # Someone please show me a better way :)
2418 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2419 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2420 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2421 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2422 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2423 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2424 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2425 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
2428 echo "OpenSSH has been configured with the following options:"
2429 echo " User binaries: $B"
2430 echo " System binaries: $C"
2431 echo " Configuration files: $D"
2432 echo " Askpass program: $E"
2433 echo " Manual pages: $F"
2434 echo " PID file: $G"
2435 echo " sshd default user PATH: $H"
2436 echo " Manpage format: $MANTYPE"
2437 echo " PAM support: ${PAM_MSG}"
2438 echo " KerberosIV support: $KRB4_MSG"
2439 echo " Smartcard support: $SCARD_MSG"
2440 echo " AFS support: $AFS_MSG"
2441 echo " S/KEY support: $SKEY_MSG"
2442 echo " TCP Wrappers support: $TCPW_MSG"
2443 echo " MD5 password support: $MD5_MSG"
2444 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2445 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2446 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2447 echo " BSD Auth support: $BSD_AUTH_MSG"
2448 echo " Random number source: $RAND_MSG"
2449 if test ! -z "$USE_RAND_HELPER" ; then
2450 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2455 echo " Host: ${host}"
2456 echo " Compiler: ${CC}"
2457 echo " Compiler flags: ${CFLAGS}"
2458 echo "Preprocessor flags: ${CPPFLAGS}"
2459 echo " Linker flags: ${LDFLAGS}"
2460 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2464 if test "x$PAM_MSG" = "xyes" ; then
2465 echo "PAM is enabled. You may need to install a PAM control file "
2466 echo "for sshd, otherwise password authentication may fail. "
2467 echo "Example PAM control files can be found in the contrib/ "
2472 if test ! -z "$NO_SFTP"; then
2473 echo "sftp-server will be disabled. Your compiler does not "
2474 echo "support 64bit integers."
2478 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2479 echo "WARNING: you are using the builtin random number collection "
2480 echo "service. Please read WARNING.RNG and request that your OS "
2481 echo "vendor includes kernel-based random number collection in "
2482 echo "future versions of your OS."