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"
324 [ --with-pcre[[=PATH]] Override built in regex library with pcre
325 (optionally in PATH)],
330 if test "x$withval" != "xyes"; then
331 if test -d "$withval/lib"; then
332 if test -n "${need_dash_r}"; then
333 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
335 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
338 if test -n "${need_dash_r}"; then
339 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
341 LDFLAGS="-L${withval} ${LDFLAGS}"
344 if test -d "$withval/include"; then
345 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
347 CPPFLAGS="-I${withval} ${CPPFLAGS}"
351 AC_CHECK_HEADER(pcreposix.h,
352 AC_CHECK_LIB(pcre, pcre_info,[
353 AC_DEFINE(HAVE_LIBPCRE)
354 LIBS="$LIBS -lpcreposix -lpcre"
356 AC_MSG_ERROR([*** unable to locate pcre library ***])),
357 AC_MSG_ERROR([*** unable to locate pcreposix.h include file ***]))
363 # Checks for header files.
364 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
365 getopt.h glob.h lastlog.h limits.h login.h \
366 login_cap.h maillock.h netdb.h netgroup.h \
367 netinet/in_systm.h paths.h poll.h pty.h \
368 security/pam_appl.h shadow.h stddef.h stdint.h \
369 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
370 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
371 sys/stropts.h sys/sysmacros.h sys/time.h \
372 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
373 util.h utime.h utmp.h utmpx.h)
375 # Checks for libraries.
376 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
377 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
379 dnl SCO OS3 needs this for libwrap
380 if test "x$with_tcp_wrappers" != "xno" ; then
381 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
382 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
386 AC_CHECK_FUNC(getspnam, ,
387 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
390 [ --without-rpath Disable auto-added -R linker paths],
392 if test "x$withval" = "xno" ; then
395 if test "x$withval" = "xyes" ; then
403 [ --with-zlib=PATH Use zlib in PATH],
405 if test "x$withval" = "xno" ; then
406 AC_MSG_ERROR([*** zlib is required ***])
408 if test -d "$withval/lib"; then
409 if test -n "${need_dash_r}"; then
410 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
412 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
415 if test -n "${need_dash_r}"; then
416 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
418 LDFLAGS="-L${withval} ${LDFLAGS}"
421 if test -d "$withval/include"; then
422 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
424 CPPFLAGS="-I${withval} ${CPPFLAGS}"
429 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
432 AC_CHECK_FUNC(strcasecmp,
433 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
435 AC_CHECK_FUNC(utimes,
436 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
439 dnl Checks for libutil functions
440 AC_CHECK_HEADERS(libutil.h)
441 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
442 AC_CHECK_FUNCS(logout updwtmp logwtmp)
446 # Check for ALTDIRFUNC glob() extension
447 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
448 AC_EGREP_CPP(FOUNDIT,
451 #ifdef GLOB_ALTDIRFUNC
456 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
464 # Check for g.gl_matchc glob() extension
465 AC_MSG_CHECKING(for gl_matchc field in glob_t)
466 AC_EGREP_CPP(FOUNDIT,
469 int main(void){glob_t g; g.gl_matchc = 1;}
472 AC_DEFINE(GLOB_HAS_GL_MATCHC)
480 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
483 #include <sys/types.h>
485 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
487 [AC_MSG_RESULT(yes)],
490 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
494 # Check whether the user wants GSI (Globus) support
497 [ --with-gsi=PATH Enable GSI/Globus authentication support],
504 [ --with-globus=PATH Enable GSI/Globus authentication support],
510 if test "x$gsi_path" != "xno" ; then
511 # Globus GSSAPI configuration
515 # Find GLOBUS/GSI installation Directory
516 AC_MSG_CHECKING(for Globus/GSI installation directory)
518 globus_install_dir=$gsi_path
520 if test "x$globus_install_dir" = "xyes" ; then
521 if test -n "$GLOBUS_INSTALL_PATH" ; then
522 globus_install_dir=$GLOBUS_INSTALL_PATH
523 elif test -n "$GSI_INSTALL_PATH" ; then
524 globus_install_dir=$GSI_INSTALL_PATH
525 elif test -d /usr/local/globus ; then
526 globus_install_dir="/usr/local/globus"
527 elif test -d /usr/local/gsi ; then
528 globus_install_dir="/usr/local/gsi"
530 AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
533 AC_MSG_RESULT($globus_install_dir)
535 # Find GLOBUS/GSI development directory
536 AC_MSG_CHECKING(for Globus/GSI development directory)
538 if test -d ${globus_install_dir}/lib ; then
539 # Looks like a flat directory structure from configure/make
540 # and not globus-install or gsi-install
541 globus_dev_dir=$globus_install_dir
544 # Assume a true globus installation with architecture
545 # directories and run globus-development-path to find
546 # the development directory
548 # Set GLOBUS_INSTALL_PATH
549 GLOBUS_INSTALL_PATH=$globus_install_dir
550 export GLOBUS_INSTALL_PATH
552 dev_path_program=${globus_install_dir}/bin/globus-development-path
554 if test ! -x ${dev_path_program} ; then
555 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
558 globus_dev_dir=`${dev_path_program}`
560 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
561 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
564 if test ! -d "$globus_dev_dir" ; then
565 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
568 AC_MSG_RESULT($globus_dev_dir)
570 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa -lssl -lcrypto"
571 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
572 GSI_CFLAGS="-I${globus_dev_dir}/include"
574 LIBS="$LIBS $GSI_LIBS"
575 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
576 CFLAGS="$CFLAGS $GSI_CFLAGS"
577 # End Globus/GSI section
580 # Check whether user wants S/Key support
583 [ --with-skey[[=PATH]] Enable S/Key support
584 (optionally in PATH)],
586 if test "x$withval" != "xno" ; then
588 if test "x$withval" != "xyes" ; then
589 CPPFLAGS="$CPPFLAGS -I${withval}/include"
590 LDFLAGS="$LDFLAGS -L${withval}/lib"
597 AC_MSG_CHECKING([for s/key support])
602 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
604 [AC_MSG_RESULT(yes)],
607 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
613 # Check whether user wants TCP wrappers support
615 AC_ARG_WITH(tcp-wrappers,
616 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
617 (optionally in PATH)],
619 if test "x$withval" != "xno" ; then
621 saved_LDFLAGS="$LDFLAGS"
622 saved_CPPFLAGS="$CPPFLAGS"
623 if test -n "${withval}" -a "${withval}" != "yes"; then
624 if test -d "${withval}/lib"; then
625 if test -n "${need_dash_r}"; then
626 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
628 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
631 if test -n "${need_dash_r}"; then
632 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
634 LDFLAGS="-L${withval} ${LDFLAGS}"
637 if test -d "${withval}/include"; then
638 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
640 CPPFLAGS="-I${withval} ${CPPFLAGS}"
644 LIBS="$LIBWRAP $LIBS"
645 AC_MSG_CHECKING(for libwrap)
649 int deny_severity = 0, allow_severity = 0;
659 AC_MSG_ERROR([*** libwrap missing])
667 dnl Checks for library functions.
668 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
669 clock fchmod fchown freeaddrinfo futimes gai_strerror \
670 getaddrinfo getcwd getgrouplist getnameinfo getopt \
671 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
672 inet_ntop innetgr login_getcapbool md5_crypt memmove \
673 mkdtemp on_exit openpty readpassphrase realpath \
674 rresvport_af setdtablesize setegid setenv seteuid \
675 setlogin setproctitle setresgid setreuid setrlimit \
676 setsid setvbuf sigaction sigvec snprintf strerror \
677 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
678 vhangup vsnprintf waitpid __b64_ntop _getpty)
680 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
681 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
682 AC_CHECK_LIB(gen, dirname,[
683 AC_CACHE_CHECK([for broken dirname],
684 ac_cv_have_broken_dirname, [
692 int main(int argc, char **argv) {
695 strncpy(buf,"/etc", 32);
697 if (!s || strncmp(s, "/", 32) != 0) {
704 [ ac_cv_have_broken_dirname="no" ],
705 [ ac_cv_have_broken_dirname="yes" ]
709 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
711 AC_DEFINE(HAVE_DIRNAME)
712 AC_CHECK_HEADERS(libgen.h)
717 dnl Checks for time functions
718 AC_CHECK_FUNCS(gettimeofday time)
719 dnl Checks for utmp functions
720 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
721 AC_CHECK_FUNCS(utmpname)
722 dnl Checks for utmpx functions
723 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
724 AC_CHECK_FUNCS(setutxent utmpxname)
726 AC_CHECK_FUNC(getuserattr,
727 [AC_DEFINE(HAVE_GETUSERATTR)],
728 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
731 AC_CHECK_FUNC(daemon,
732 [AC_DEFINE(HAVE_DAEMON)],
733 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
736 AC_CHECK_FUNC(getpagesize,
737 [AC_DEFINE(HAVE_GETPAGESIZE)],
738 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
741 # Check for broken snprintf
742 if test "x$ac_cv_func_snprintf" = "xyes" ; then
743 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
747 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
749 [AC_MSG_RESULT(yes)],
752 AC_DEFINE(BROKEN_SNPRINTF)
753 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
763 [ --with-pam Enable PAM support ],
765 if test "x$withval" != "xno" ; then
766 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
767 AC_MSG_ERROR([PAM headers not found])
770 AC_CHECK_LIB(dl, dlopen, , )
771 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
772 AC_CHECK_FUNCS(pam_getenvlist)
778 if test $ac_cv_lib_dl_dlopen = yes; then
788 # Check for older PAM
789 if test "x$PAM_MSG" = "xyes" ; then
790 # Check PAM strerror arguments (old PAM)
791 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
795 #include <security/pam_appl.h>
797 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
800 AC_DEFINE(HAVE_OLD_PAM)
802 PAM_MSG="yes (old library)"
807 # The big search for OpenSSL
809 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
811 if test "x$withval" != "xno" ; then
818 saved_LDFLAGS="$LDFLAGS"
819 saved_CPPFLAGS="$CPPFLAGS"
820 if test "x$prefix" != "xNONE" ; then
821 tryssldir="$tryssldir $prefix"
823 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
824 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
825 CPPFLAGS="$saved_CPPFLAGS"
826 LDFLAGS="$saved_LDFLAGS"
827 LIBS="$saved_LIBS -lcrypto"
829 # Skip directories if they don't exist
830 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
833 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
834 # Try to use $ssldir/lib if it exists, otherwise
836 if test -d "$ssldir/lib" ; then
837 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
838 if test ! -z "$need_dash_r" ; then
839 LDFLAGS="-R$ssldir/lib $LDFLAGS"
842 LDFLAGS="-L$ssldir $saved_LDFLAGS"
843 if test ! -z "$need_dash_r" ; then
844 LDFLAGS="-R$ssldir $LDFLAGS"
847 # Try to use $ssldir/include if it exists, otherwise
849 if test -d "$ssldir/include" ; then
850 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
852 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
856 # Basic test to check for compatible version and correct linking
857 # *does not* test for RSA - that comes later.
861 #include <openssl/rand.h>
865 memset(a, 0, sizeof(a));
866 RAND_add(a, sizeof(a), sizeof(a));
867 return(RAND_status() <= 0);
876 if test ! -z "$found_crypto" ; then
881 if test -z "$found_crypto" ; then
882 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
884 if test -z "$ssldir" ; then
888 ac_cv_openssldir=$ssldir
891 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
892 AC_DEFINE(HAVE_OPENSSL)
893 dnl Need to recover ssldir - test above runs in subshell
894 ssldir=$ac_cv_openssldir
895 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
896 # Try to use $ssldir/lib if it exists, otherwise
898 if test -d "$ssldir/lib" ; then
899 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
900 if test ! -z "$need_dash_r" ; then
901 LDFLAGS="-R$ssldir/lib $LDFLAGS"
904 LDFLAGS="-L$ssldir $saved_LDFLAGS"
905 if test ! -z "$need_dash_r" ; then
906 LDFLAGS="-R$ssldir $LDFLAGS"
909 # Try to use $ssldir/include if it exists, otherwise
911 if test -d "$ssldir/include" ; then
912 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
914 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
918 LIBS="$saved_LIBS -lcrypto"
920 # Now test RSA support
922 AC_MSG_CHECKING([for RSA support])
923 for WANTS_RSAREF in "" 1 ; do
924 if test -z "$WANTS_RSAREF" ; then
927 LIBS="$saved_LIBS -lRSAglue -lrsaref"
931 #include <openssl/rand.h>
932 #include <openssl/rsa.h>
933 #include <openssl/bn.h>
934 #include <openssl/sha.h>
937 int num; RSA *key; static unsigned char p_in[] = "blahblah";
938 unsigned char c[256], p[256];
939 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
940 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
941 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
942 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
952 if test ! -z "$no_rsa" ; then
953 AC_MSG_RESULT(disabled)
956 if test -z "$rsa_works" ; then
957 AC_MSG_WARN([*** No RSA support found *** ])
960 if test -z "$WANTS_RSAREF" ; then
964 RSA_MSG="yes (using RSAref)"
965 AC_MSG_RESULT(using RSAref)
966 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
971 # Sanity check OpenSSL headers
972 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
976 #include <openssl/opensslv.h>
977 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
984 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
988 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
989 # version in OpenSSL. Skip this for PAM
990 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
991 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
995 ### Configure cryptographic random number support
997 # Check wheter OpenSSL seeds itself
998 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1002 #include <openssl/rand.h>
1003 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
1006 OPENSSL_SEEDS_ITSELF=yes
1011 # Default to use of the rand helper if OpenSSL doesn't
1018 # Do we want to force the use of the rand helper?
1019 AC_ARG_WITH(rand-helper,
1020 [ --with-rand-helper Use subprocess to gather strong randomness ],
1022 if test "x$withval" = "xno" ; then
1023 # Force use of OpenSSL's internal RNG, even if
1024 # the previous test showed it to be unseeded.
1025 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1026 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1027 OPENSSL_SEEDS_ITSELF=yes
1036 # Which randomness source do we use?
1037 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1039 AC_DEFINE(OPENSSL_PRNG_ONLY)
1040 RAND_MSG="OpenSSL internal ONLY"
1041 INSTALL_SSH_RAND_HELPER=""
1042 elif test ! -z "$USE_RAND_HELPER" ; then
1043 # install rand helper
1044 RAND_MSG="ssh-rand-helper"
1045 INSTALL_SSH_RAND_HELPER="yes"
1047 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1049 ### Configuration of ssh-rand-helper
1052 AC_ARG_WITH(prngd-port,
1053 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1062 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1065 if test ! -z "$withval" ; then
1066 PRNGD_PORT="$withval"
1067 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1072 # PRNGD Unix domain socket
1073 AC_ARG_WITH(prngd-socket,
1074 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1078 withval="/var/run/egd-pool"
1086 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1090 if test ! -z "$withval" ; then
1091 if test ! -z "$PRNGD_PORT" ; then
1092 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1094 if test ! -r "$withval" ; then
1095 AC_MSG_WARN(Entropy socket is not readable)
1097 PRNGD_SOCKET="$withval"
1098 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1102 # Check for existing socket only if we don't have a random device already
1103 if test "$USE_RAND_HELPER" = yes ; then
1104 AC_MSG_CHECKING(for PRNGD/EGD socket)
1105 # Insert other locations here
1106 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1107 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1108 PRNGD_SOCKET="$sock"
1109 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1113 if test ! -z "$PRNGD_SOCKET" ; then
1114 AC_MSG_RESULT($PRNGD_SOCKET)
1116 AC_MSG_RESULT(not found)
1122 # Change default command timeout for hashing entropy source
1124 AC_ARG_WITH(entropy-timeout,
1125 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1127 if test "x$withval" != "xno" ; then
1128 entropy_timeout=$withval
1133 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1135 # These programs are used by the command hashing source to gather entropy
1136 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1137 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1138 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1139 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1140 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1141 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1142 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1143 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1144 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1145 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1146 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1147 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1148 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1149 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1150 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1151 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1153 # Where does ssh-rand-helper get its randomness from?
1154 INSTALL_SSH_PRNG_CMDS=""
1155 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1156 if test ! -z "$PRNGD_PORT" ; then
1157 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1158 elif test ! -z "$PRNGD_SOCKET" ; then
1159 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1161 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1162 RAND_HELPER_CMDHASH=yes
1163 INSTALL_SSH_PRNG_CMDS="yes"
1166 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1169 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1170 if test ! -z "$SONY" ; then
1171 LIBS="$LIBS -liberty";
1174 # Checks for data types
1175 AC_CHECK_SIZEOF(char, 1)
1176 AC_CHECK_SIZEOF(short int, 2)
1177 AC_CHECK_SIZEOF(int, 4)
1178 AC_CHECK_SIZEOF(long int, 4)
1179 AC_CHECK_SIZEOF(long long int, 8)
1181 # More checks for data types
1182 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1184 [ #include <sys/types.h> ],
1186 [ ac_cv_have_u_int="yes" ],
1187 [ ac_cv_have_u_int="no" ]
1190 if test "x$ac_cv_have_u_int" = "xyes" ; then
1191 AC_DEFINE(HAVE_U_INT)
1195 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1197 [ #include <sys/types.h> ],
1198 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1199 [ ac_cv_have_intxx_t="yes" ],
1200 [ ac_cv_have_intxx_t="no" ]
1203 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1204 AC_DEFINE(HAVE_INTXX_T)
1208 if (test -z "$have_intxx_t" && \
1209 test "x$ac_cv_header_stdint_h" = "xyes")
1211 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1213 [ #include <stdint.h> ],
1214 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1216 AC_DEFINE(HAVE_INTXX_T)
1219 [ AC_MSG_RESULT(no) ]
1223 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1225 [ #include <sys/types.h> ],
1226 [ int64_t a; a = 1;],
1227 [ ac_cv_have_int64_t="yes" ],
1228 [ ac_cv_have_int64_t="no" ]
1231 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1232 AC_DEFINE(HAVE_INT64_T)
1236 if test -z "$have_int64_t" ; then
1237 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1239 [ #include <sys/socket.h> ],
1240 [ int64_t a; a = 1],
1242 AC_DEFINE(HAVE_INT64_T)
1245 [ AC_MSG_RESULT(no) ]
1249 if test -z "$have_int64_t" ; then
1250 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1252 [ #include <sys/bitypes.h> ],
1253 [ int64_t a; a = 1],
1255 AC_DEFINE(HAVE_INT64_T)
1258 [ AC_MSG_RESULT(no) ]
1262 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1264 [ #include <sys/types.h> ],
1265 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1266 [ ac_cv_have_u_intxx_t="yes" ],
1267 [ ac_cv_have_u_intxx_t="no" ]
1270 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1271 AC_DEFINE(HAVE_U_INTXX_T)
1275 if test -z "$have_u_intxx_t" ; then
1276 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1278 [ #include <sys/socket.h> ],
1279 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1281 AC_DEFINE(HAVE_U_INTXX_T)
1284 [ AC_MSG_RESULT(no) ]
1288 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1290 [ #include <sys/types.h> ],
1291 [ u_int64_t a; a = 1;],
1292 [ ac_cv_have_u_int64_t="yes" ],
1293 [ ac_cv_have_u_int64_t="no" ]
1296 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1297 AC_DEFINE(HAVE_U_INT64_T)
1301 if test -z "$have_u_int64_t" ; then
1302 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1304 [ #include <sys/bitypes.h> ],
1305 [ u_int64_t a; a = 1],
1307 AC_DEFINE(HAVE_U_INT64_T)
1310 [ AC_MSG_RESULT(no) ]
1314 if test -z "$have_u_intxx_t" ; then
1315 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1318 #include <sys/types.h>
1320 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1321 [ ac_cv_have_uintxx_t="yes" ],
1322 [ ac_cv_have_uintxx_t="no" ]
1325 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1326 AC_DEFINE(HAVE_UINTXX_T)
1330 if test -z "$have_uintxx_t" ; then
1331 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1333 [ #include <stdint.h> ],
1334 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1336 AC_DEFINE(HAVE_UINTXX_T)
1339 [ AC_MSG_RESULT(no) ]
1343 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1344 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1346 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1349 #include <sys/bitypes.h>
1352 int8_t a; int16_t b; int32_t c;
1353 u_int8_t e; u_int16_t f; u_int32_t g;
1354 a = b = c = e = f = g = 1;
1357 AC_DEFINE(HAVE_U_INTXX_T)
1358 AC_DEFINE(HAVE_INTXX_T)
1366 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1369 #include <sys/types.h>
1371 [ u_char foo; foo = 125; ],
1372 [ ac_cv_have_u_char="yes" ],
1373 [ ac_cv_have_u_char="no" ]
1376 if test "x$ac_cv_have_u_char" = "xyes" ; then
1377 AC_DEFINE(HAVE_U_CHAR)
1382 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1384 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1387 #include <sys/types.h>
1389 [ size_t foo; foo = 1235; ],
1390 [ ac_cv_have_size_t="yes" ],
1391 [ ac_cv_have_size_t="no" ]
1394 if test "x$ac_cv_have_size_t" = "xyes" ; then
1395 AC_DEFINE(HAVE_SIZE_T)
1398 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1401 #include <sys/types.h>
1403 [ ssize_t foo; foo = 1235; ],
1404 [ ac_cv_have_ssize_t="yes" ],
1405 [ ac_cv_have_ssize_t="no" ]
1408 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1409 AC_DEFINE(HAVE_SSIZE_T)
1412 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1417 [ clock_t foo; foo = 1235; ],
1418 [ ac_cv_have_clock_t="yes" ],
1419 [ ac_cv_have_clock_t="no" ]
1422 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1423 AC_DEFINE(HAVE_CLOCK_T)
1426 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1429 #include <sys/types.h>
1430 #include <sys/socket.h>
1432 [ sa_family_t foo; foo = 1235; ],
1433 [ ac_cv_have_sa_family_t="yes" ],
1436 #include <sys/types.h>
1437 #include <sys/socket.h>
1438 #include <netinet/in.h>
1440 [ sa_family_t foo; foo = 1235; ],
1441 [ ac_cv_have_sa_family_t="yes" ],
1443 [ ac_cv_have_sa_family_t="no" ]
1447 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1448 AC_DEFINE(HAVE_SA_FAMILY_T)
1451 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1454 #include <sys/types.h>
1456 [ pid_t foo; foo = 1235; ],
1457 [ ac_cv_have_pid_t="yes" ],
1458 [ ac_cv_have_pid_t="no" ]
1461 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1462 AC_DEFINE(HAVE_PID_T)
1465 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1468 #include <sys/types.h>
1470 [ mode_t foo; foo = 1235; ],
1471 [ ac_cv_have_mode_t="yes" ],
1472 [ ac_cv_have_mode_t="no" ]
1475 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1476 AC_DEFINE(HAVE_MODE_T)
1480 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1483 #include <sys/types.h>
1484 #include <sys/socket.h>
1486 [ struct sockaddr_storage s; ],
1487 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1488 [ ac_cv_have_struct_sockaddr_storage="no" ]
1491 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1492 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1495 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1498 #include <sys/types.h>
1499 #include <netinet/in.h>
1501 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1502 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1503 [ ac_cv_have_struct_sockaddr_in6="no" ]
1506 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1507 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1510 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1513 #include <sys/types.h>
1514 #include <netinet/in.h>
1516 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1517 [ ac_cv_have_struct_in6_addr="yes" ],
1518 [ ac_cv_have_struct_in6_addr="no" ]
1521 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1522 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1525 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1528 #include <sys/types.h>
1529 #include <sys/socket.h>
1532 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1533 [ ac_cv_have_struct_addrinfo="yes" ],
1534 [ ac_cv_have_struct_addrinfo="no" ]
1537 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1538 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1541 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1543 [ #include <sys/time.h> ],
1544 [ struct timeval tv; tv.tv_sec = 1;],
1545 [ ac_cv_have_struct_timeval="yes" ],
1546 [ ac_cv_have_struct_timeval="no" ]
1549 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1550 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1551 have_struct_timeval=1
1554 # If we don't have int64_t then we can't compile sftp-server. So don't
1555 # even attempt to do it.
1556 if test "x$ac_cv_have_int64_t" = "xno" -a \
1557 "x$ac_cv_sizeof_long_int" != "x8" -a \
1558 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1561 dnl test snprintf (broken on SCO w/gcc)
1566 #ifdef HAVE_SNPRINTF
1570 char expected_out[50];
1572 #if (SIZEOF_LONG_INT == 8)
1573 long int num = 0x7fffffffffffffff;
1575 long long num = 0x7fffffffffffffffll;
1577 strcpy(expected_out, "9223372036854775807");
1578 snprintf(buf, mazsize, "%lld", num);
1579 if(strcmp(buf, expected_out) != 0)
1586 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1591 dnl Checks for structure members
1592 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1593 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1594 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1595 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1596 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1597 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1598 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1599 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1600 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1601 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1602 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1603 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1604 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1605 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1606 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1607 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1608 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1610 AC_CHECK_MEMBERS([struct stat.st_blksize])
1612 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1613 ac_cv_have_ss_family_in_struct_ss, [
1616 #include <sys/types.h>
1617 #include <sys/socket.h>
1619 [ struct sockaddr_storage s; s.ss_family = 1; ],
1620 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1621 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1624 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1625 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1628 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1629 ac_cv_have___ss_family_in_struct_ss, [
1632 #include <sys/types.h>
1633 #include <sys/socket.h>
1635 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1636 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1637 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1640 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1641 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1644 AC_CACHE_CHECK([for pw_class field in struct passwd],
1645 ac_cv_have_pw_class_in_struct_passwd, [
1650 [ struct passwd p; p.pw_class = 0; ],
1651 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1652 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1655 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1656 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1659 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1660 ac_cv_have_pw_expire_in_struct_passwd, [
1665 [ struct passwd p; p.pw_expire = 0; ],
1666 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1667 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1670 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1671 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1674 AC_CACHE_CHECK([for pw_change field in struct passwd],
1675 ac_cv_have_pw_change_in_struct_passwd, [
1680 [ struct passwd p; p.pw_change = 0; ],
1681 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1682 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1685 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1686 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1689 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1691 [ extern char *__progname; printf("%s", __progname); ],
1692 [ ac_cv_libc_defines___progname="yes" ],
1693 [ ac_cv_libc_defines___progname="no" ]
1696 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1697 AC_DEFINE(HAVE___PROGNAME)
1700 AC_CACHE_CHECK([whether getopt has optreset support],
1701 ac_cv_have_getopt_optreset, [
1706 [ extern int optreset; optreset = 0; ],
1707 [ ac_cv_have_getopt_optreset="yes" ],
1708 [ ac_cv_have_getopt_optreset="no" ]
1711 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1712 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1715 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1717 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1718 [ ac_cv_libc_defines_sys_errlist="yes" ],
1719 [ ac_cv_libc_defines_sys_errlist="no" ]
1722 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1723 AC_DEFINE(HAVE_SYS_ERRLIST)
1727 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1729 [ extern int sys_nerr; printf("%i", sys_nerr);],
1730 [ ac_cv_libc_defines_sys_nerr="yes" ],
1731 [ ac_cv_libc_defines_sys_nerr="no" ]
1734 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1735 AC_DEFINE(HAVE_SYS_NERR)
1739 # Check whether user wants Kerberos support
1741 AC_ARG_WITH(smartcard,
1742 [ --with-smartcard Enable smartcard support],
1744 if test "x$withval" != "xno" ; then
1745 if test "x$withval" != "xyes" ; then
1746 CPPFLAGS="$CPPFLAGS -I${withval}"
1747 LDFLAGS="$LDFLAGS -L${withval}"
1748 if test ! -z "$need_dash_r" ; then
1749 LDFLAGS="$LDFLAGS -R${withval}"
1751 if test ! -z "$blibpath" ; then
1752 blibpath="$blibpath:${withval}"
1755 AC_CHECK_HEADERS(sectok.h)
1756 if test "$ac_cv_header_sectok_h" != yes; then
1757 AC_MSG_ERROR(Can't find sectok.h)
1759 AC_CHECK_LIB(sectok, sectok_open)
1760 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1761 AC_MSG_ERROR(Can't find libsectok)
1763 AC_DEFINE(SMARTCARD)
1769 # Check whether user wants Kerberos 5 support
1770 AC_ARG_WITH(kerberos5,
1771 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1773 if test "x$withval" != "xno" ; then
1774 if test "x$withval" = "xyes" ; then
1775 KRB5ROOT="/usr/local"
1779 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1780 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1782 AC_MSG_CHECKING(whether we are using Heimdal)
1783 AC_TRY_COMPILE([ #include <krb5.h> ],
1784 [ char *tmp = heimdal_version; ],
1785 [ AC_MSG_RESULT(yes)
1787 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1790 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1793 if test ! -z "$need_dash_r" ; then
1794 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1796 if test ! -z "$blibpath" ; then
1797 blibpath="$blibpath:${KRB5ROOT}/lib"
1799 AC_CHECK_LIB(resolv, dn_expand, , )
1801 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1803 K5LIBS="-lgssapi $K5LIBS" ],
1804 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1806 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1807 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1812 AC_CHECK_HEADER(gssapi.h, ,
1813 [ unset ac_cv_header_gssapi_h
1814 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1815 AC_CHECK_HEADERS(gssapi.h, ,
1816 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1822 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1823 AC_CHECK_HEADER(gssapi_krb5.h, ,
1824 [ CPPFLAGS="$oldCPP" ])
1830 # Check whether user wants Kerberos 4 support
1832 AC_ARG_WITH(kerberos4,
1833 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1835 if test "x$withval" != "xno" ; then
1836 if test "x$withval" != "xyes" ; then
1837 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1838 LDFLAGS="$LDFLAGS -L${withval}/lib"
1839 if test ! -z "$need_dash_r" ; then
1840 LDFLAGS="$LDFLAGS -R${withval}/lib"
1842 if test ! -z "$blibpath" ; then
1843 blibpath="$blibpath:${withval}/lib"
1846 if test -d /usr/include/kerberosIV ; then
1847 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1851 AC_CHECK_HEADERS(krb.h)
1852 if test "$ac_cv_header_krb_h" != yes; then
1853 AC_MSG_WARN([Cannot find krb.h, build may fail])
1855 AC_CHECK_LIB(krb, main)
1856 if test "$ac_cv_lib_krb_main" != yes; then
1857 AC_CHECK_LIB(krb4, main)
1858 if test "$ac_cv_lib_krb4_main" != yes; then
1859 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1866 AC_CHECK_LIB(des, des_cbc_encrypt)
1867 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1868 AC_CHECK_LIB(des425, des_cbc_encrypt)
1869 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1870 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1877 AC_CHECK_LIB(resolv, dn_expand, , )
1885 # Check whether user wants AFS support
1888 [ --with-afs=PATH Enable AFS support],
1890 if test "x$withval" != "xno" ; then
1892 if test "x$withval" != "xyes" ; then
1893 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1894 LDFLAGS="$LDFLAGS -L${withval}/lib"
1897 if test -z "$KRB4" ; then
1898 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1902 if test ! -z "$AFS_LIBS" ; then
1903 LIBS="$LIBS $AFS_LIBS"
1910 LIBS="$LIBS $KLIBS $K5LIBS"
1912 # Looking for programs, paths and files
1914 [ --with-rsh=PATH Specify path to remote shell program ],
1916 if test "x$withval" != "$no" ; then
1921 AC_PATH_PROG(rsh_path, rsh)
1926 [ --with-xauth=PATH Specify path to xauth program ],
1928 if test "x$withval" != "xno" ; then
1933 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1934 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1935 xauth_path="/usr/openwin/bin/xauth"
1940 if test -z "$xauth_path" ; then
1941 XAUTH_PATH="undefined"
1942 AC_SUBST(XAUTH_PATH)
1944 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1945 XAUTH_PATH=$xauth_path
1946 AC_SUBST(XAUTH_PATH)
1948 if test ! -z "$rsh_path" ; then
1949 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1952 # Check for mail directory (last resort if we cannot get it from headers)
1953 if test ! -z "$MAIL" ; then
1954 maildir=`dirname $MAIL`
1955 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1958 if test -z "$no_dev_ptmx" ; then
1959 AC_CHECK_FILE("/dev/ptmx",
1961 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1966 AC_CHECK_FILE("/dev/ptc",
1968 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1973 # Options from here on. Some of these are preset by platform above
1974 AC_ARG_WITH(mantype,
1975 [ --with-mantype=man|cat|doc Set man page type],
1982 AC_MSG_ERROR(invalid man type: $withval)
1987 if test -z "$MANTYPE"; then
1988 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1989 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1991 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1998 if test "$MANTYPE" = "doc"; then
2005 # Check whether to enable MD5 passwords
2007 AC_ARG_WITH(md5-passwords,
2008 [ --with-md5-passwords Enable use of MD5 passwords],
2010 if test "x$withval" != "xno" ; then
2011 AC_DEFINE(HAVE_MD5_PASSWORDS)
2017 # Whether to disable shadow password support
2019 [ --without-shadow Disable shadow password support],
2021 if test "x$withval" = "xno" ; then
2022 AC_DEFINE(DISABLE_SHADOW)
2028 if test -z "$disable_shadow" ; then
2029 AC_MSG_CHECKING([if the systems has expire shadow information])
2032 #include <sys/types.h>
2035 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2036 [ sp_expire_available=yes ], []
2039 if test "x$sp_expire_available" = "xyes" ; then
2041 AC_DEFINE(HAS_SHADOW_EXPIRE)
2047 # Use ip address instead of hostname in $DISPLAY
2048 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2049 DISPLAY_HACK_MSG="yes"
2050 AC_DEFINE(IPADDR_IN_DISPLAY)
2052 DISPLAY_HACK_MSG="no"
2053 AC_ARG_WITH(ipaddr-display,
2054 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2056 if test "x$withval" != "xno" ; then
2057 AC_DEFINE(IPADDR_IN_DISPLAY)
2058 DISPLAY_HACK_MSG="yes"
2064 # Whether to mess with the default path
2065 SERVER_PATH_MSG="(default)"
2066 AC_ARG_WITH(default-path,
2067 [ --with-default-path=PATH Specify default \$PATH environment for server],
2069 if test "x$withval" != "xno" ; then
2070 user_path="$withval"
2071 SERVER_PATH_MSG="$withval"
2077 /* find out what STDPATH is */
2082 #ifndef _PATH_STDPATH
2083 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2085 #include <sys/types.h>
2086 #include <sys/stat.h>
2088 #define DATA "conftest.stdpath"
2095 fd = fopen(DATA,"w");
2099 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2104 ], [ user_path=`cat conftest.stdpath` ],
2105 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2106 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2108 # make sure $bindir is in USER_PATH so scp will work
2109 t_bindir=`eval echo ${bindir}`
2111 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2114 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2116 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2117 if test $? -ne 0 ; then
2118 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2119 if test $? -ne 0 ; then
2120 user_path=$user_path:$t_bindir
2121 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2126 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2129 # Whether to force IPv4 by default (needed on broken glibc Linux)
2131 AC_ARG_WITH(ipv4-default,
2132 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2134 if test "x$withval" != "xno" ; then
2135 AC_DEFINE(IPV4_DEFAULT)
2141 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2142 IPV4_IN6_HACK_MSG="no"
2144 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2146 if test "x$withval" != "xno" ; then
2148 AC_DEFINE(IPV4_IN_IPV6)
2149 IPV4_IN6_HACK_MSG="yes"
2154 if test "x$inet6_default_4in6" = "xyes"; then
2155 AC_MSG_RESULT([yes (default)])
2156 AC_DEFINE(IPV4_IN_IPV6)
2157 IPV4_IN6_HACK_MSG="yes"
2159 AC_MSG_RESULT([no (default)])
2164 # Whether to enable BSD auth support
2166 AC_ARG_WITH(bsd-auth,
2167 [ --with-bsd-auth Enable BSD auth support],
2169 if test "x$withval" != "xno" ; then
2176 AC_MSG_CHECKING(whether to install ssh as suid root)
2177 AC_ARG_ENABLE(suid-ssh,
2178 [ --enable-suid-ssh Install ssh as suid root (default)
2179 --disable-suid-ssh Install ssh without suid bit],
2180 [ case "$enableval" in
2185 *) AC_MSG_RESULT(yes)
2195 # Where to place sshd.pid
2197 AC_ARG_WITH(pid-dir,
2198 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2200 if test "x$withval" != "xno" ; then
2206 # make sure the directory exists
2207 if test ! -d $piddir ; then
2208 piddir=`eval echo ${sysconfdir}`
2210 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2214 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2217 dnl allow user to disable some login recording features
2218 AC_ARG_ENABLE(lastlog,
2219 [ --disable-lastlog disable use of lastlog even if detected [no]],
2220 [ AC_DEFINE(DISABLE_LASTLOG) ]
2223 [ --disable-utmp disable use of utmp even if detected [no]],
2224 [ AC_DEFINE(DISABLE_UTMP) ]
2226 AC_ARG_ENABLE(utmpx,
2227 [ --disable-utmpx disable use of utmpx even if detected [no]],
2228 [ AC_DEFINE(DISABLE_UTMPX) ]
2231 [ --disable-wtmp disable use of wtmp even if detected [no]],
2232 [ AC_DEFINE(DISABLE_WTMP) ]
2234 AC_ARG_ENABLE(wtmpx,
2235 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2236 [ AC_DEFINE(DISABLE_WTMPX) ]
2238 AC_ARG_ENABLE(libutil,
2239 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2240 [ AC_DEFINE(DISABLE_LOGIN) ]
2242 AC_ARG_ENABLE(pututline,
2243 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2244 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2246 AC_ARG_ENABLE(pututxline,
2247 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2248 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2250 AC_ARG_WITH(lastlog,
2251 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2253 if test "x$withval" = "xno" ; then
2254 AC_DEFINE(DISABLE_LASTLOG)
2256 conf_lastlog_location=$withval
2261 dnl lastlog, [uw]tmpx? detection
2262 dnl NOTE: set the paths in the platform section to avoid the
2263 dnl need for command-line parameters
2264 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2266 dnl lastlog detection
2267 dnl NOTE: the code itself will detect if lastlog is a directory
2268 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2270 #include <sys/types.h>
2272 #ifdef HAVE_LASTLOG_H
2273 # include <lastlog.h>
2282 [ char *lastlog = LASTLOG_FILE; ],
2283 [ AC_MSG_RESULT(yes) ],
2286 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2288 #include <sys/types.h>
2290 #ifdef HAVE_LASTLOG_H
2291 # include <lastlog.h>
2297 [ char *lastlog = _PATH_LASTLOG; ],
2298 [ AC_MSG_RESULT(yes) ],
2301 system_lastlog_path=no
2306 if test -z "$conf_lastlog_location"; then
2307 if test x"$system_lastlog_path" = x"no" ; then
2308 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2309 if (test -d "$f" || test -f "$f") ; then
2310 conf_lastlog_location=$f
2313 if test -z "$conf_lastlog_location"; then
2314 AC_MSG_WARN([** Cannot find lastlog **])
2315 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2320 if test -n "$conf_lastlog_location"; then
2321 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2325 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2327 #include <sys/types.h>
2333 [ char *utmp = UTMP_FILE; ],
2334 [ AC_MSG_RESULT(yes) ],
2336 system_utmp_path=no ]
2338 if test -z "$conf_utmp_location"; then
2339 if test x"$system_utmp_path" = x"no" ; then
2340 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2341 if test -f $f ; then
2342 conf_utmp_location=$f
2345 if test -z "$conf_utmp_location"; then
2346 AC_DEFINE(DISABLE_UTMP)
2350 if test -n "$conf_utmp_location"; then
2351 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2355 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2357 #include <sys/types.h>
2363 [ char *wtmp = WTMP_FILE; ],
2364 [ AC_MSG_RESULT(yes) ],
2366 system_wtmp_path=no ]
2368 if test -z "$conf_wtmp_location"; then
2369 if test x"$system_wtmp_path" = x"no" ; then
2370 for f in /usr/adm/wtmp /var/log/wtmp; do
2371 if test -f $f ; then
2372 conf_wtmp_location=$f
2375 if test -z "$conf_wtmp_location"; then
2376 AC_DEFINE(DISABLE_WTMP)
2380 if test -n "$conf_wtmp_location"; then
2381 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2385 dnl utmpx detection - I don't know any system so perverse as to require
2386 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2388 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2390 #include <sys/types.h>
2399 [ char *utmpx = UTMPX_FILE; ],
2400 [ AC_MSG_RESULT(yes) ],
2402 system_utmpx_path=no ]
2404 if test -z "$conf_utmpx_location"; then
2405 if test x"$system_utmpx_path" = x"no" ; then
2406 AC_DEFINE(DISABLE_UTMPX)
2409 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2413 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2415 #include <sys/types.h>
2424 [ char *wtmpx = WTMPX_FILE; ],
2425 [ AC_MSG_RESULT(yes) ],
2427 system_wtmpx_path=no ]
2429 if test -z "$conf_wtmpx_location"; then
2430 if test x"$system_wtmpx_path" = x"no" ; then
2431 AC_DEFINE(DISABLE_WTMPX)
2434 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2438 if test ! -z "$blibpath" ; then
2439 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2440 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2443 dnl remove pam and dl because they are in $LIBPAM
2444 if test "$PAM_MSG" = yes ; then
2445 LIBS=`echo $LIBS | sed 's/-lpam //'`
2447 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2448 LIBS=`echo $LIBS | sed 's/-ldl //'`
2452 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2455 # Print summary of options
2457 # Someone please show me a better way :)
2458 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2459 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2460 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2461 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2462 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2463 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2464 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2465 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
2468 echo "OpenSSH has been configured with the following options:"
2469 echo " User binaries: $B"
2470 echo " System binaries: $C"
2471 echo " Configuration files: $D"
2472 echo " Askpass program: $E"
2473 echo " Manual pages: $F"
2474 echo " PID file: $G"
2475 echo " sshd default user PATH: $H"
2476 echo " Manpage format: $MANTYPE"
2477 echo " PAM support: ${PAM_MSG}"
2478 echo " KerberosIV support: $KRB4_MSG"
2479 echo " Smartcard support: $SCARD_MSG"
2480 echo " AFS support: $AFS_MSG"
2481 echo " S/KEY support: $SKEY_MSG"
2482 echo " TCP Wrappers support: $TCPW_MSG"
2483 echo " MD5 password support: $MD5_MSG"
2484 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2485 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2486 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2487 echo " BSD Auth support: $BSD_AUTH_MSG"
2488 echo " Random number source: $RAND_MSG"
2489 if test ! -z "$USE_RAND_HELPER" ; then
2490 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2495 echo " Host: ${host}"
2496 echo " Compiler: ${CC}"
2497 echo " Compiler flags: ${CFLAGS}"
2498 echo "Preprocessor flags: ${CPPFLAGS}"
2499 echo " Linker flags: ${LDFLAGS}"
2500 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2504 if test "x$PAM_MSG" = "xyes" ; then
2505 echo "PAM is enabled. You may need to install a PAM control file "
2506 echo "for sshd, otherwise password authentication may fail. "
2507 echo "Example PAM control files can be found in the contrib/ "
2512 if test ! -z "$NO_SFTP"; then
2513 echo "sftp-server will be disabled. Your compiler does not "
2514 echo "support 64bit integers."
2518 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2519 echo "WARNING: you are using the builtin random number collection "
2520 echo "service. Please read WARNING.RNG and request that your OS "
2521 echo "vendor includes kernel-based random number collection in "
2522 echo "future versions of your OS."