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_PROG(TEST_MINUS_S_SH, bash)
21 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22 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 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
61 saved_LDFLAGS="$LDFLAGS"
62 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
67 blibpath="/usr/lib:/lib:/usr/local/lib"
71 LDFLAGS="$saved_LDFLAGS"
73 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
74 [AC_CHECK_LIB(s,authenticate,
75 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
79 AC_DEFINE(BROKEN_GETADDRINFO)
80 AC_DEFINE(BROKEN_REALPATH)
81 dnl AIX handles lastlog as part of its login message
82 AC_DEFINE(DISABLE_LASTLOG)
83 AC_DEFINE(LOGIN_NEEDS_UTMPX)
86 LIBS="$LIBS /usr/lib/textmode.o"
87 AC_DEFINE(HAVE_CYGWIN)
89 AC_DEFINE(DISABLE_SHADOW)
90 AC_DEFINE(IPV4_DEFAULT)
91 AC_DEFINE(IP_TOS_IS_BROKEN)
92 AC_DEFINE(NO_X11_UNIX_SOCKETS)
93 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
94 AC_DEFINE(DISABLE_FD_PASSING)
95 AC_DEFINE(SETGROUPS_NOOP)
98 AC_DEFINE(IP_TOS_IS_BROKEN)
101 AC_MSG_CHECKING(if we have working getaddrinfo)
102 AC_TRY_RUN([#include <mach-o/dyld.h>
103 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
107 }], [AC_MSG_RESULT(working)],
108 [AC_MSG_RESULT(buggy)
109 AC_DEFINE(BROKEN_GETADDRINFO)],
110 [AC_MSG_RESULT(assume it is working)])
113 if test -z "$GCC"; then
116 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
117 IPADDR_IN_DISPLAY=yes
118 AC_DEFINE(HAVE_SECUREWARE)
120 AC_DEFINE(LOGIN_NO_ENDOPT)
121 AC_DEFINE(LOGIN_NEEDS_UTMPX)
122 AC_DEFINE(DISABLE_SHADOW)
123 AC_DEFINE(DISABLE_UTMP)
124 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
125 LIBS="$LIBS -lsec -lsecpw"
126 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
127 disable_ptmx_check=yes
130 if test -z "$GCC"; then
133 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
134 IPADDR_IN_DISPLAY=yes
136 AC_DEFINE(LOGIN_NO_ENDOPT)
137 AC_DEFINE(LOGIN_NEEDS_UTMPX)
138 AC_DEFINE(DISABLE_SHADOW)
139 AC_DEFINE(DISABLE_UTMP)
140 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
142 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
145 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
146 IPADDR_IN_DISPLAY=yes
147 AC_DEFINE(PAM_SUN_CODEBASE)
149 AC_DEFINE(LOGIN_NO_ENDOPT)
150 AC_DEFINE(LOGIN_NEEDS_UTMPX)
151 AC_DEFINE(DISABLE_SHADOW)
152 AC_DEFINE(DISABLE_UTMP)
153 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
155 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
158 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
160 PATH="$PATH:/usr/etc"
161 AC_DEFINE(BROKEN_INET_NTOA)
162 AC_DEFINE(WITH_ABBREV_NO_TTY)
165 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
167 PATH="$PATH:/usr/etc"
168 AC_DEFINE(WITH_IRIX_ARRAY)
169 AC_DEFINE(WITH_IRIX_PROJECT)
170 AC_DEFINE(WITH_IRIX_AUDIT)
171 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
172 AC_DEFINE(BROKEN_INET_NTOA)
173 AC_DEFINE(WITH_ABBREV_NO_TTY)
177 check_for_libcrypt_later=1
178 AC_DEFINE(DONT_TRY_OTHER_AF)
179 AC_DEFINE(PAM_TTY_KLUDGE)
180 inet6_default_4in6=yes
182 mips-sony-bsd|mips-sony-newsos4)
183 AC_DEFINE(HAVE_NEWS4)
187 check_for_libcrypt_before=1
191 check_for_libcrypt_later=1
194 conf_lastlog_location="/usr/adm/lastlog"
195 conf_utmp_location=/etc/utmp
196 conf_wtmp_location=/usr/adm/wtmp
199 AC_DEFINE(BROKEN_REALPATH)
201 AC_DEFINE(BROKEN_SAVED_UIDS)
202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
206 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
207 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
209 AC_DEFINE(PAM_SUN_CODEBASE)
210 AC_DEFINE(LOGIN_NEEDS_UTMPX)
211 AC_DEFINE(LOGIN_NEEDS_TERM)
212 AC_DEFINE(PAM_TTY_KLUDGE)
213 # hardwire lastlog location (can't detect it on some versions)
214 conf_lastlog_location="/var/adm/lastlog"
215 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
216 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
217 if test "$sol2ver" -ge 8; then
219 AC_DEFINE(DISABLE_UTMP)
220 AC_DEFINE(DISABLE_WTMP)
226 CPPFLAGS="$CPPFLAGS -DSUNOS4"
227 AC_CHECK_FUNCS(getpwanam)
228 AC_DEFINE(PAM_SUN_CODEBASE)
229 conf_utmp_location=/etc/utmp
230 conf_wtmp_location=/var/adm/wtmp
231 conf_lastlog_location=/var/adm/lastlog
235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
236 LDFLAGS="$LDFLAGS -L/usr/local/lib"
241 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
242 # /usr/ucblib MUST NOT be searched on ReliantUNIX
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
244 IPADDR_IN_DISPLAY=yes
246 AC_DEFINE(IP_TOS_IS_BROKEN)
247 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
248 # Attention: always take care to bind libsocket and libnsl before libc,
249 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
252 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
253 LDFLAGS="$LDFLAGS -L/usr/local/lib"
257 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
258 LDFLAGS="$LDFLAGS -L/usr/local/lib"
262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
263 LDFLAGS="$LDFLAGS -L/usr/local/lib"
266 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
267 LDFLAGS="$LDFLAGS -L/usr/local/lib"
268 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
271 AC_DEFINE(BROKEN_SYS_TERMIO_H)
273 AC_DEFINE(HAVE_SECUREWARE)
274 AC_DEFINE(DISABLE_SHADOW)
275 AC_DEFINE(BROKEN_SAVED_UIDS)
276 AC_CHECK_FUNCS(getluid setluid)
278 do_sco3_extra_lib_check=yes
281 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
282 LDFLAGS="$LDFLAGS -L/usr/local/lib"
283 LIBS="$LIBS -lprot -lx -ltinfo -lm"
286 AC_DEFINE(HAVE_SECUREWARE)
287 AC_DEFINE(DISABLE_SHADOW)
288 AC_DEFINE(DISABLE_FD_PASSING)
289 AC_CHECK_FUNCS(getluid setluid)
296 AC_DEFINE(DISABLE_FD_PASSING)
298 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
305 AC_DEFINE(DISABLE_FD_PASSING)
306 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
307 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
311 AC_MSG_CHECKING(for Digital Unix SIA)
314 [ --with-osfsia Enable Digital Unix SIA],
316 if test "x$withval" = "xno" ; then
317 AC_MSG_RESULT(disabled)
322 if test -z "$no_osfsia" ; then
323 if test -f /etc/sia/matrix.conf; then
325 AC_DEFINE(HAVE_OSF_SIA)
326 AC_DEFINE(DISABLE_LOGIN)
327 LIBS="$LIBS -lsecurity -ldb -lm -laud"
336 AC_DEFINE(NO_X11_UNIX_SOCKETS)
337 AC_DEFINE(MISSING_NFDBITS)
338 AC_DEFINE(MISSING_HOWMANY)
339 AC_DEFINE(MISSING_FD_MASK)
343 # Allow user to specify flags
345 [ --with-cflags Specify additional flags to pass to compiler],
347 if test "x$withval" != "xno" ; then
348 CFLAGS="$CFLAGS $withval"
352 AC_ARG_WITH(cppflags,
353 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
355 if test "x$withval" != "xno"; then
356 CPPFLAGS="$CPPFLAGS $withval"
361 [ --with-ldflags Specify additional flags to pass to linker],
363 if test "x$withval" != "xno" ; then
364 LDFLAGS="$LDFLAGS $withval"
369 [ --with-libs Specify additional libraries to link with],
371 if test "x$withval" != "xno" ; then
372 LIBS="$LIBS $withval"
377 # Checks for header files.
378 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
379 getopt.h glob.h lastlog.h limits.h login.h \
380 login_cap.h maillock.h netdb.h netgroup.h \
381 netinet/in_systm.h paths.h pty.h readpassphrase.h \
382 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
383 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
384 sys/mman.h sys/select.h sys/stat.h \
385 sys/stropts.h sys/sysmacros.h sys/time.h \
386 sys/un.h time.h ttyent.h usersec.h \
387 util.h utime.h utmp.h utmpx.h)
389 # Checks for libraries.
390 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
391 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
393 dnl SCO OS3 needs this for libwrap
394 if test "x$with_tcp_wrappers" != "xno" ; then
395 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
396 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
400 AC_CHECK_FUNC(getspnam, ,
401 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
404 [ --without-rpath Disable auto-added -R linker paths],
406 if test "x$withval" = "xno" ; then
409 if test "x$withval" = "xyes" ; then
417 [ --with-zlib=PATH Use zlib in PATH],
419 if test "x$withval" = "xno" ; then
420 AC_MSG_ERROR([*** zlib is required ***])
422 if test -d "$withval/lib"; then
423 if test -n "${need_dash_r}"; then
424 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
426 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
429 if test -n "${need_dash_r}"; then
430 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
432 LDFLAGS="-L${withval} ${LDFLAGS}"
435 if test -d "$withval/include"; then
436 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
438 CPPFLAGS="-I${withval} ${CPPFLAGS}"
443 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
446 AC_CHECK_FUNC(strcasecmp,
447 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
449 AC_CHECK_FUNC(utimes,
450 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
451 LIBS="$LIBS -lc89"]) ]
454 dnl Checks for libutil functions
455 AC_CHECK_HEADERS(libutil.h)
456 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
457 AC_CHECK_FUNCS(logout updwtmp logwtmp)
461 # Check for ALTDIRFUNC glob() extension
462 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
463 AC_EGREP_CPP(FOUNDIT,
466 #ifdef GLOB_ALTDIRFUNC
471 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
479 # Check for g.gl_matchc glob() extension
480 AC_MSG_CHECKING(for gl_matchc field in glob_t)
481 AC_EGREP_CPP(FOUNDIT,
484 int main(void){glob_t g; g.gl_matchc = 1;}
487 AC_DEFINE(GLOB_HAS_GL_MATCHC)
495 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
498 #include <sys/types.h>
500 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
502 [AC_MSG_RESULT(yes)],
505 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
509 # Check whether user wants S/Key support
512 [ --with-skey[[=PATH]] Enable S/Key support
513 (optionally in PATH)],
515 if test "x$withval" != "xno" ; then
517 if test "x$withval" != "xyes" ; then
518 CPPFLAGS="$CPPFLAGS -I${withval}/include"
519 LDFLAGS="$LDFLAGS -L${withval}/lib"
526 AC_MSG_CHECKING([for s/key support])
531 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
533 [AC_MSG_RESULT(yes)],
536 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
542 # Check whether user wants TCP wrappers support
544 AC_ARG_WITH(tcp-wrappers,
545 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
546 (optionally in PATH)],
548 if test "x$withval" != "xno" ; then
550 saved_LDFLAGS="$LDFLAGS"
551 saved_CPPFLAGS="$CPPFLAGS"
552 if test -n "${withval}" -a "${withval}" != "yes"; then
553 if test -d "${withval}/lib"; then
554 if test -n "${need_dash_r}"; then
555 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
557 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
560 if test -n "${need_dash_r}"; then
561 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
563 LDFLAGS="-L${withval} ${LDFLAGS}"
566 if test -d "${withval}/include"; then
567 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
569 CPPFLAGS="-I${withval} ${CPPFLAGS}"
573 LIBS="$LIBWRAP $LIBS"
574 AC_MSG_CHECKING(for libwrap)
578 int deny_severity = 0, allow_severity = 0;
588 AC_MSG_ERROR([*** libwrap missing])
596 dnl Checks for library functions.
597 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
598 clock fchmod fchown freeaddrinfo futimes gai_strerror \
599 getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\
600 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
601 inet_ntop innetgr login_getcapbool md5_crypt memmove \
602 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
603 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
604 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
605 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
606 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
607 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
609 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
610 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
611 AC_CHECK_LIB(gen, dirname,[
612 AC_CACHE_CHECK([for broken dirname],
613 ac_cv_have_broken_dirname, [
621 int main(int argc, char **argv) {
624 strncpy(buf,"/etc", 32);
626 if (!s || strncmp(s, "/", 32) != 0) {
633 [ ac_cv_have_broken_dirname="no" ],
634 [ ac_cv_have_broken_dirname="yes" ]
638 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
640 AC_DEFINE(HAVE_DIRNAME)
641 AC_CHECK_HEADERS(libgen.h)
646 dnl Checks for time functions
647 AC_CHECK_FUNCS(gettimeofday time)
648 dnl Checks for utmp functions
649 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
650 AC_CHECK_FUNCS(utmpname)
651 dnl Checks for utmpx functions
652 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
653 AC_CHECK_FUNCS(setutxent utmpxname)
655 AC_CHECK_FUNC(daemon,
656 [AC_DEFINE(HAVE_DAEMON)],
657 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
660 AC_CHECK_FUNC(getpagesize,
661 [AC_DEFINE(HAVE_GETPAGESIZE)],
662 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
665 # Check for broken snprintf
666 if test "x$ac_cv_func_snprintf" = "xyes" ; then
667 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
671 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
673 [AC_MSG_RESULT(yes)],
676 AC_DEFINE(BROKEN_SNPRINTF)
677 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
687 [ --with-pam Enable PAM support ],
689 if test "x$withval" != "xno" ; then
690 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
691 AC_MSG_ERROR([PAM headers not found])
694 AC_CHECK_LIB(dl, dlopen, , )
695 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
696 AC_CHECK_FUNCS(pam_getenvlist)
702 if test $ac_cv_lib_dl_dlopen = yes; then
712 # Check for older PAM
713 if test "x$PAM_MSG" = "xyes" ; then
714 # Check PAM strerror arguments (old PAM)
715 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
719 #include <security/pam_appl.h>
721 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
724 AC_DEFINE(HAVE_OLD_PAM)
726 PAM_MSG="yes (old library)"
731 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
732 # because the system crypt() is more featureful.
733 if test "x$check_for_libcrypt_before" = "x1"; then
734 AC_CHECK_LIB(crypt, crypt)
738 saved_CPPFLAGS="$CPPFLAGS"
739 saved_LDFLAGS="$LDFLAGS"
741 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
743 if test "x$withval" != "xno" ; then
744 if test -d "$withval/lib"; then
745 if test -n "${need_dash_r}"; then
746 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
748 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
751 if test -n "${need_dash_r}"; then
752 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
754 LDFLAGS="-L${withval} ${LDFLAGS}"
757 if test -d "$withval/include"; then
758 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
760 CPPFLAGS="-I${withval} ${CPPFLAGS}"
765 LIBS="$LIBS -lcrypto"
766 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
768 dnl Check default openssl install dir
769 if test -n "${need_dash_r}"; then
770 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
772 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
774 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
775 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
777 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
783 # Determine OpenSSL header version
784 AC_MSG_CHECKING([OpenSSL header version])
789 #include <openssl/opensslv.h>
790 #define DATA "conftest.sslincver"
795 fd = fopen(DATA,"w");
799 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
806 ssl_header_ver=`cat conftest.sslincver`
807 AC_MSG_RESULT($ssl_header_ver)
810 AC_MSG_RESULT(not found)
811 AC_MSG_ERROR(OpenSSL version header not found.)
815 # Determine OpenSSL library version
816 AC_MSG_CHECKING([OpenSSL library version])
821 #include <openssl/opensslv.h>
822 #include <openssl/crypto.h>
823 #define DATA "conftest.ssllibver"
828 fd = fopen(DATA,"w");
832 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
839 ssl_library_ver=`cat conftest.ssllibver`
840 AC_MSG_RESULT($ssl_library_ver)
843 AC_MSG_RESULT(not found)
844 AC_MSG_ERROR(OpenSSL library not found.)
848 # Sanity check OpenSSL headers
849 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
853 #include <openssl/opensslv.h>
854 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
861 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
865 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
866 # version in OpenSSL. Skip this for PAM
867 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
868 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
872 ### Configure cryptographic random number support
874 # Check wheter OpenSSL seeds itself
875 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
879 #include <openssl/rand.h>
880 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
883 OPENSSL_SEEDS_ITSELF=yes
888 # Default to use of the rand helper if OpenSSL doesn't
895 # Do we want to force the use of the rand helper?
896 AC_ARG_WITH(rand-helper,
897 [ --with-rand-helper Use subprocess to gather strong randomness ],
899 if test "x$withval" = "xno" ; then
900 # Force use of OpenSSL's internal RNG, even if
901 # the previous test showed it to be unseeded.
902 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
903 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
904 OPENSSL_SEEDS_ITSELF=yes
913 # Which randomness source do we use?
914 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
916 AC_DEFINE(OPENSSL_PRNG_ONLY)
917 RAND_MSG="OpenSSL internal ONLY"
918 INSTALL_SSH_RAND_HELPER=""
919 elif test ! -z "$USE_RAND_HELPER" ; then
920 # install rand helper
921 RAND_MSG="ssh-rand-helper"
922 INSTALL_SSH_RAND_HELPER="yes"
924 AC_SUBST(INSTALL_SSH_RAND_HELPER)
926 ### Configuration of ssh-rand-helper
929 AC_ARG_WITH(prngd-port,
930 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
939 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
942 if test ! -z "$withval" ; then
943 PRNGD_PORT="$withval"
944 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
949 # PRNGD Unix domain socket
950 AC_ARG_WITH(prngd-socket,
951 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
955 withval="/var/run/egd-pool"
963 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
967 if test ! -z "$withval" ; then
968 if test ! -z "$PRNGD_PORT" ; then
969 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
971 if test ! -r "$withval" ; then
972 AC_MSG_WARN(Entropy socket is not readable)
974 PRNGD_SOCKET="$withval"
975 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
979 # Check for existing socket only if we don't have a random device already
980 if test "$USE_RAND_HELPER" = yes ; then
981 AC_MSG_CHECKING(for PRNGD/EGD socket)
982 # Insert other locations here
983 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
984 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
986 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
990 if test ! -z "$PRNGD_SOCKET" ; then
991 AC_MSG_RESULT($PRNGD_SOCKET)
993 AC_MSG_RESULT(not found)
999 # Change default command timeout for hashing entropy source
1001 AC_ARG_WITH(entropy-timeout,
1002 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1004 if test "x$withval" != "xno" ; then
1005 entropy_timeout=$withval
1009 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1011 SSH_PRIVSEP_USER=sshd
1012 AC_ARG_WITH(privsep-user,
1013 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1015 if test -n "$withval"; then
1016 SSH_PRIVSEP_USER=$withval
1020 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1021 AC_SUBST(SSH_PRIVSEP_USER)
1023 # We do this little dance with the search path to insure
1024 # that programs that we select for use by installed programs
1025 # (which may be run by the super-user) come from trusted
1026 # locations before they come from the user's private area.
1027 # This should help avoid accidentally configuring some
1028 # random version of a program in someone's personal bin.
1032 test -h /bin 2> /dev/null && PATH=/usr/bin
1033 test -d /sbin && PATH=$PATH:/sbin
1034 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1035 PATH=$PATH:/etc:$OPATH
1037 # These programs are used by the command hashing source to gather entropy
1038 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1039 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1040 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1041 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1042 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1043 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1044 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1045 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1046 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1047 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1048 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1049 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1050 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1051 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1052 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1053 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1057 # Where does ssh-rand-helper get its randomness from?
1058 INSTALL_SSH_PRNG_CMDS=""
1059 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1060 if test ! -z "$PRNGD_PORT" ; then
1061 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1062 elif test ! -z "$PRNGD_SOCKET" ; then
1063 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1065 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1066 RAND_HELPER_CMDHASH=yes
1067 INSTALL_SSH_PRNG_CMDS="yes"
1070 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1073 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1074 if test ! -z "$SONY" ; then
1075 LIBS="$LIBS -liberty";
1078 # Checks for data types
1079 AC_CHECK_SIZEOF(char, 1)
1080 AC_CHECK_SIZEOF(short int, 2)
1081 AC_CHECK_SIZEOF(int, 4)
1082 AC_CHECK_SIZEOF(long int, 4)
1083 AC_CHECK_SIZEOF(long long int, 8)
1085 # Sanity check long long for some platforms (AIX)
1086 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1087 ac_cv_sizeof_long_long_int=0
1090 # More checks for data types
1091 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1093 [ #include <sys/types.h> ],
1095 [ ac_cv_have_u_int="yes" ],
1096 [ ac_cv_have_u_int="no" ]
1099 if test "x$ac_cv_have_u_int" = "xyes" ; then
1100 AC_DEFINE(HAVE_U_INT)
1104 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1106 [ #include <sys/types.h> ],
1107 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1108 [ ac_cv_have_intxx_t="yes" ],
1109 [ ac_cv_have_intxx_t="no" ]
1112 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1113 AC_DEFINE(HAVE_INTXX_T)
1117 if (test -z "$have_intxx_t" && \
1118 test "x$ac_cv_header_stdint_h" = "xyes")
1120 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1122 [ #include <stdint.h> ],
1123 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1125 AC_DEFINE(HAVE_INTXX_T)
1128 [ AC_MSG_RESULT(no) ]
1132 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1135 #include <sys/types.h>
1136 #ifdef HAVE_STDINT_H
1137 # include <stdint.h>
1139 #include <sys/socket.h>
1140 #ifdef HAVE_SYS_BITYPES_H
1141 # include <sys/bitypes.h>
1144 [ int64_t a; a = 1;],
1145 [ ac_cv_have_int64_t="yes" ],
1146 [ ac_cv_have_int64_t="no" ]
1149 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1150 AC_DEFINE(HAVE_INT64_T)
1153 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1155 [ #include <sys/types.h> ],
1156 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1157 [ ac_cv_have_u_intxx_t="yes" ],
1158 [ ac_cv_have_u_intxx_t="no" ]
1161 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1162 AC_DEFINE(HAVE_U_INTXX_T)
1166 if test -z "$have_u_intxx_t" ; then
1167 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1169 [ #include <sys/socket.h> ],
1170 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1172 AC_DEFINE(HAVE_U_INTXX_T)
1175 [ AC_MSG_RESULT(no) ]
1179 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1181 [ #include <sys/types.h> ],
1182 [ u_int64_t a; a = 1;],
1183 [ ac_cv_have_u_int64_t="yes" ],
1184 [ ac_cv_have_u_int64_t="no" ]
1187 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1188 AC_DEFINE(HAVE_U_INT64_T)
1192 if test -z "$have_u_int64_t" ; then
1193 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1195 [ #include <sys/bitypes.h> ],
1196 [ u_int64_t a; a = 1],
1198 AC_DEFINE(HAVE_U_INT64_T)
1201 [ AC_MSG_RESULT(no) ]
1205 if test -z "$have_u_intxx_t" ; then
1206 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1209 #include <sys/types.h>
1211 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1212 [ ac_cv_have_uintxx_t="yes" ],
1213 [ ac_cv_have_uintxx_t="no" ]
1216 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1217 AC_DEFINE(HAVE_UINTXX_T)
1221 if test -z "$have_uintxx_t" ; then
1222 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1224 [ #include <stdint.h> ],
1225 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1227 AC_DEFINE(HAVE_UINTXX_T)
1230 [ AC_MSG_RESULT(no) ]
1234 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1235 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1237 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1240 #include <sys/bitypes.h>
1243 int8_t a; int16_t b; int32_t c;
1244 u_int8_t e; u_int16_t f; u_int32_t g;
1245 a = b = c = e = f = g = 1;
1248 AC_DEFINE(HAVE_U_INTXX_T)
1249 AC_DEFINE(HAVE_INTXX_T)
1257 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1260 #include <sys/types.h>
1262 [ u_char foo; foo = 125; ],
1263 [ ac_cv_have_u_char="yes" ],
1264 [ ac_cv_have_u_char="no" ]
1267 if test "x$ac_cv_have_u_char" = "xyes" ; then
1268 AC_DEFINE(HAVE_U_CHAR)
1273 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1275 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1278 #include <sys/types.h>
1280 [ size_t foo; foo = 1235; ],
1281 [ ac_cv_have_size_t="yes" ],
1282 [ ac_cv_have_size_t="no" ]
1285 if test "x$ac_cv_have_size_t" = "xyes" ; then
1286 AC_DEFINE(HAVE_SIZE_T)
1289 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1292 #include <sys/types.h>
1294 [ ssize_t foo; foo = 1235; ],
1295 [ ac_cv_have_ssize_t="yes" ],
1296 [ ac_cv_have_ssize_t="no" ]
1299 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1300 AC_DEFINE(HAVE_SSIZE_T)
1303 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1308 [ clock_t foo; foo = 1235; ],
1309 [ ac_cv_have_clock_t="yes" ],
1310 [ ac_cv_have_clock_t="no" ]
1313 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1314 AC_DEFINE(HAVE_CLOCK_T)
1317 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1320 #include <sys/types.h>
1321 #include <sys/socket.h>
1323 [ sa_family_t foo; foo = 1235; ],
1324 [ ac_cv_have_sa_family_t="yes" ],
1327 #include <sys/types.h>
1328 #include <sys/socket.h>
1329 #include <netinet/in.h>
1331 [ sa_family_t foo; foo = 1235; ],
1332 [ ac_cv_have_sa_family_t="yes" ],
1334 [ ac_cv_have_sa_family_t="no" ]
1338 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1339 AC_DEFINE(HAVE_SA_FAMILY_T)
1342 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1345 #include <sys/types.h>
1347 [ pid_t foo; foo = 1235; ],
1348 [ ac_cv_have_pid_t="yes" ],
1349 [ ac_cv_have_pid_t="no" ]
1352 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1353 AC_DEFINE(HAVE_PID_T)
1356 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1359 #include <sys/types.h>
1361 [ mode_t foo; foo = 1235; ],
1362 [ ac_cv_have_mode_t="yes" ],
1363 [ ac_cv_have_mode_t="no" ]
1366 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1367 AC_DEFINE(HAVE_MODE_T)
1371 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1374 #include <sys/types.h>
1375 #include <sys/socket.h>
1377 [ struct sockaddr_storage s; ],
1378 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1379 [ ac_cv_have_struct_sockaddr_storage="no" ]
1382 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1383 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1386 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1389 #include <sys/types.h>
1390 #include <netinet/in.h>
1392 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1393 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1394 [ ac_cv_have_struct_sockaddr_in6="no" ]
1397 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1398 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1401 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1404 #include <sys/types.h>
1405 #include <netinet/in.h>
1407 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1408 [ ac_cv_have_struct_in6_addr="yes" ],
1409 [ ac_cv_have_struct_in6_addr="no" ]
1412 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1413 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1416 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1419 #include <sys/types.h>
1420 #include <sys/socket.h>
1423 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1424 [ ac_cv_have_struct_addrinfo="yes" ],
1425 [ ac_cv_have_struct_addrinfo="no" ]
1428 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1429 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1432 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1434 [ #include <sys/time.h> ],
1435 [ struct timeval tv; tv.tv_sec = 1;],
1436 [ ac_cv_have_struct_timeval="yes" ],
1437 [ ac_cv_have_struct_timeval="no" ]
1440 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1441 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1442 have_struct_timeval=1
1445 # If we don't have int64_t then we can't compile sftp-server. So don't
1446 # even attempt to do it.
1447 if test "x$ac_cv_have_int64_t" = "xno" -a \
1448 "x$ac_cv_sizeof_long_int" != "x8" -a \
1449 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1452 dnl test snprintf (broken on SCO w/gcc)
1457 #ifdef HAVE_SNPRINTF
1461 char expected_out[50];
1463 #if (SIZEOF_LONG_INT == 8)
1464 long int num = 0x7fffffffffffffff;
1466 long long num = 0x7fffffffffffffffll;
1468 strcpy(expected_out, "9223372036854775807");
1469 snprintf(buf, mazsize, "%lld", num);
1470 if(strcmp(buf, expected_out) != 0)
1477 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1482 dnl Checks for structure members
1483 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1484 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1485 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1486 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1487 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1488 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1489 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1490 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1491 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1492 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1493 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1494 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1495 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1496 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1497 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1498 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1499 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1501 AC_CHECK_MEMBERS([struct stat.st_blksize])
1503 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1504 ac_cv_have_ss_family_in_struct_ss, [
1507 #include <sys/types.h>
1508 #include <sys/socket.h>
1510 [ struct sockaddr_storage s; s.ss_family = 1; ],
1511 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1512 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1515 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1516 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1519 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1520 ac_cv_have___ss_family_in_struct_ss, [
1523 #include <sys/types.h>
1524 #include <sys/socket.h>
1526 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1527 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1528 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1531 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1532 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1535 AC_CACHE_CHECK([for pw_class field in struct passwd],
1536 ac_cv_have_pw_class_in_struct_passwd, [
1541 [ struct passwd p; p.pw_class = 0; ],
1542 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1543 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1546 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1547 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1550 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1551 ac_cv_have_pw_expire_in_struct_passwd, [
1556 [ struct passwd p; p.pw_expire = 0; ],
1557 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1558 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1561 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1562 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1565 AC_CACHE_CHECK([for pw_change field in struct passwd],
1566 ac_cv_have_pw_change_in_struct_passwd, [
1571 [ struct passwd p; p.pw_change = 0; ],
1572 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1573 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1576 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1577 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1580 dnl make sure we're using the real structure members and not defines
1581 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1582 ac_cv_have_accrights_in_msghdr, [
1585 #include <sys/types.h>
1586 #include <sys/socket.h>
1587 #include <sys/uio.h>
1589 #ifdef msg_accrights
1593 m.msg_accrights = 0;
1597 [ ac_cv_have_accrights_in_msghdr="yes" ],
1598 [ ac_cv_have_accrights_in_msghdr="no" ]
1601 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1602 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1605 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1606 ac_cv_have_control_in_msghdr, [
1609 #include <sys/types.h>
1610 #include <sys/socket.h>
1611 #include <sys/uio.h>
1621 [ ac_cv_have_control_in_msghdr="yes" ],
1622 [ ac_cv_have_control_in_msghdr="no" ]
1625 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1626 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1629 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1631 [ extern char *__progname; printf("%s", __progname); ],
1632 [ ac_cv_libc_defines___progname="yes" ],
1633 [ ac_cv_libc_defines___progname="no" ]
1636 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1637 AC_DEFINE(HAVE___PROGNAME)
1640 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1644 [ printf("%s", __FUNCTION__); ],
1645 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1646 [ ac_cv_cc_implements___FUNCTION__="no" ]
1649 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1650 AC_DEFINE(HAVE___FUNCTION__)
1653 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1657 [ printf("%s", __func__); ],
1658 [ ac_cv_cc_implements___func__="yes" ],
1659 [ ac_cv_cc_implements___func__="no" ]
1662 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1663 AC_DEFINE(HAVE___func__)
1666 AC_CACHE_CHECK([whether getopt has optreset support],
1667 ac_cv_have_getopt_optreset, [
1672 [ extern int optreset; optreset = 0; ],
1673 [ ac_cv_have_getopt_optreset="yes" ],
1674 [ ac_cv_have_getopt_optreset="no" ]
1677 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1678 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1681 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1683 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1684 [ ac_cv_libc_defines_sys_errlist="yes" ],
1685 [ ac_cv_libc_defines_sys_errlist="no" ]
1688 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1689 AC_DEFINE(HAVE_SYS_ERRLIST)
1693 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1695 [ extern int sys_nerr; printf("%i", sys_nerr);],
1696 [ ac_cv_libc_defines_sys_nerr="yes" ],
1697 [ ac_cv_libc_defines_sys_nerr="no" ]
1700 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1701 AC_DEFINE(HAVE_SYS_NERR)
1706 # Check whether user wants sectok support
1708 [ --with-sectok Enable smartcard support using libsectok],
1710 if test "x$withval" != "xno" ; then
1711 if test "x$withval" != "xyes" ; then
1712 CPPFLAGS="$CPPFLAGS -I${withval}"
1713 LDFLAGS="$LDFLAGS -L${withval}"
1714 if test ! -z "$need_dash_r" ; then
1715 LDFLAGS="$LDFLAGS -R${withval}"
1717 if test ! -z "$blibpath" ; then
1718 blibpath="$blibpath:${withval}"
1721 AC_CHECK_HEADERS(sectok.h)
1722 if test "$ac_cv_header_sectok_h" != yes; then
1723 AC_MSG_ERROR(Can't find sectok.h)
1725 AC_CHECK_LIB(sectok, sectok_open)
1726 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1727 AC_MSG_ERROR(Can't find libsectok)
1729 AC_DEFINE(SMARTCARD)
1730 AC_DEFINE(USE_SECTOK)
1731 SCARD_MSG="yes, using sectok"
1736 # Check whether user wants OpenSC support
1738 AC_HELP_STRING([--with-opensc=PFX],
1739 [Enable smartcard support using OpenSC]),
1740 opensc_config_prefix="$withval", opensc_config_prefix="")
1741 if test x$opensc_config_prefix != x ; then
1742 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1743 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1744 if test "$OPENSC_CONFIG" != "no"; then
1745 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1746 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1747 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1748 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1749 AC_DEFINE(SMARTCARD)
1750 AC_DEFINE(USE_OPENSC)
1751 SCARD_MSG="yes, using OpenSC"
1755 # Check whether user wants Kerberos 5 support
1757 AC_ARG_WITH(kerberos5,
1758 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1760 if test "x$withval" != "xno" ; then
1761 if test "x$withval" = "xyes" ; then
1762 KRB5ROOT="/usr/local"
1766 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1767 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1770 AC_MSG_CHECKING(whether we are using Heimdal)
1771 AC_TRY_COMPILE([ #include <krb5.h> ],
1772 [ char *tmp = heimdal_version; ],
1773 [ AC_MSG_RESULT(yes)
1775 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1778 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1781 if test ! -z "$need_dash_r" ; then
1782 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1784 if test ! -z "$blibpath" ; then
1785 blibpath="$blibpath:${KRB5ROOT}/lib"
1787 AC_CHECK_LIB(resolv, dn_expand, , )
1793 # Check whether user wants Kerberos 4 support
1795 AC_ARG_WITH(kerberos4,
1796 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1798 if test "x$withval" != "xno" ; then
1799 if test "x$withval" != "xyes" ; then
1800 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1801 LDFLAGS="$LDFLAGS -L${withval}/lib"
1802 if test ! -z "$need_dash_r" ; then
1803 LDFLAGS="$LDFLAGS -R${withval}/lib"
1805 if test ! -z "$blibpath" ; then
1806 blibpath="$blibpath:${withval}/lib"
1809 if test -d /usr/include/kerberosIV ; then
1810 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1814 AC_CHECK_HEADERS(krb.h)
1815 if test "$ac_cv_header_krb_h" != yes; then
1816 AC_MSG_WARN([Cannot find krb.h, build may fail])
1818 AC_CHECK_LIB(krb, main)
1819 if test "$ac_cv_lib_krb_main" != yes; then
1820 AC_CHECK_LIB(krb4, main)
1821 if test "$ac_cv_lib_krb4_main" != yes; then
1822 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1829 AC_CHECK_LIB(des, des_cbc_encrypt)
1830 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1831 AC_CHECK_LIB(des425, des_cbc_encrypt)
1832 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1833 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1840 AC_CHECK_LIB(resolv, dn_expand, , )
1848 # Check whether user wants AFS support
1851 [ --with-afs=PATH Enable AFS support],
1853 if test "x$withval" != "xno" ; then
1855 if test "x$withval" != "xyes" ; then
1856 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1857 LDFLAGS="$LDFLAGS -L${withval}/lib"
1860 if test -z "$KRB4" ; then
1861 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1865 if test ! -z "$AFS_LIBS" ; then
1866 LIBS="$LIBS $AFS_LIBS"
1873 LIBS="$LIBS $KLIBS $K5LIBS"
1875 # Looking for programs, paths and files
1877 PRIVSEP_PATH=/var/empty
1878 AC_ARG_WITH(privsep-path,
1879 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1881 if test "x$withval" != "$no" ; then
1882 PRIVSEP_PATH=$withval
1886 AC_SUBST(PRIVSEP_PATH)
1889 [ --with-xauth=PATH Specify path to xauth program ],
1891 if test "x$withval" != "xno" ; then
1897 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1898 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1899 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1900 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1901 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1902 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1903 xauth_path="/usr/openwin/bin/xauth"
1908 if test -z "$xauth_path" ; then
1909 XAUTH_PATH="undefined"
1910 AC_SUBST(XAUTH_PATH)
1912 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1913 XAUTH_PATH=$xauth_path
1914 AC_SUBST(XAUTH_PATH)
1917 # Check for mail directory (last resort if we cannot get it from headers)
1918 if test ! -z "$MAIL" ; then
1919 maildir=`dirname $MAIL`
1920 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1923 if test -z "$no_dev_ptmx" ; then
1924 if test "x$disable_ptmx_check" != "xyes" ; then
1925 AC_CHECK_FILE("/dev/ptmx",
1927 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1933 AC_CHECK_FILE("/dev/ptc",
1935 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1940 # Options from here on. Some of these are preset by platform above
1941 AC_ARG_WITH(mantype,
1942 [ --with-mantype=man|cat|doc Set man page type],
1949 AC_MSG_ERROR(invalid man type: $withval)
1954 if test -z "$MANTYPE"; then
1955 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
1956 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
1957 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1959 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1966 if test "$MANTYPE" = "doc"; then
1973 # Check whether to enable MD5 passwords
1975 AC_ARG_WITH(md5-passwords,
1976 [ --with-md5-passwords Enable use of MD5 passwords],
1978 if test "x$withval" != "xno" ; then
1979 AC_DEFINE(HAVE_MD5_PASSWORDS)
1985 # Whether to disable shadow password support
1987 [ --without-shadow Disable shadow password support],
1989 if test "x$withval" = "xno" ; then
1990 AC_DEFINE(DISABLE_SHADOW)
1996 if test -z "$disable_shadow" ; then
1997 AC_MSG_CHECKING([if the systems has expire shadow information])
2000 #include <sys/types.h>
2003 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2004 [ sp_expire_available=yes ], []
2007 if test "x$sp_expire_available" = "xyes" ; then
2009 AC_DEFINE(HAS_SHADOW_EXPIRE)
2015 # Use ip address instead of hostname in $DISPLAY
2016 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2017 DISPLAY_HACK_MSG="yes"
2018 AC_DEFINE(IPADDR_IN_DISPLAY)
2020 DISPLAY_HACK_MSG="no"
2021 AC_ARG_WITH(ipaddr-display,
2022 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2024 if test "x$withval" != "xno" ; then
2025 AC_DEFINE(IPADDR_IN_DISPLAY)
2026 DISPLAY_HACK_MSG="yes"
2032 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2033 if test $ac_cv_func_login_getcapbool = "yes" -a \
2034 $ac_cv_header_login_cap_h = "yes" ; then
2037 # Whether to mess with the default path
2038 SERVER_PATH_MSG="(default)"
2039 AC_ARG_WITH(default-path,
2040 [ --with-default-path= Specify default \$PATH environment for server],
2042 if test "$USES_LOGIN_CONF" = "yes" ; then
2044 --with-default-path=PATH has no effect on this system.
2045 Edit /etc/login.conf instead.])
2046 elif test "x$withval" != "xno" ; then
2047 user_path="$withval"
2048 SERVER_PATH_MSG="$withval"
2051 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2052 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2056 /* find out what STDPATH is */
2061 #ifndef _PATH_STDPATH
2062 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2064 #include <sys/types.h>
2065 #include <sys/stat.h>
2067 #define DATA "conftest.stdpath"
2074 fd = fopen(DATA,"w");
2078 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2083 ], [ user_path=`cat conftest.stdpath` ],
2084 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2085 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2087 # make sure $bindir is in USER_PATH so scp will work
2088 t_bindir=`eval echo ${bindir}`
2090 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2093 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2095 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2096 if test $? -ne 0 ; then
2097 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2098 if test $? -ne 0 ; then
2099 user_path=$user_path:$t_bindir
2100 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2105 if test "$USES_LOGIN_CONF" != "yes" ; then
2106 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2110 # Set superuser path separately to user path
2111 AC_ARG_WITH(superuser-path,
2112 [ --with-superuser-path= Specify different path for super-user],
2114 if test "x$withval" != "xno" ; then
2115 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2116 superuser_path=$withval
2122 # Whether to force IPv4 by default (needed on broken glibc Linux)
2124 AC_ARG_WITH(ipv4-default,
2125 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2127 if test "x$withval" != "xno" ; then
2128 AC_DEFINE(IPV4_DEFAULT)
2134 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2135 IPV4_IN6_HACK_MSG="no"
2137 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2139 if test "x$withval" != "xno" ; then
2141 AC_DEFINE(IPV4_IN_IPV6)
2142 IPV4_IN6_HACK_MSG="yes"
2147 if test "x$inet6_default_4in6" = "xyes"; then
2148 AC_MSG_RESULT([yes (default)])
2149 AC_DEFINE(IPV4_IN_IPV6)
2150 IPV4_IN6_HACK_MSG="yes"
2152 AC_MSG_RESULT([no (default)])
2157 # Whether to enable BSD auth support
2159 AC_ARG_WITH(bsd-auth,
2160 [ --with-bsd-auth Enable BSD auth support],
2162 if test "x$withval" != "xno" ; then
2169 # Where to place sshd.pid
2171 # make sure the directory exists
2172 if test ! -d $piddir ; then
2173 piddir=`eval echo ${sysconfdir}`
2175 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2179 AC_ARG_WITH(pid-dir,
2180 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2182 if test "x$withval" != "xno" ; then
2184 if test ! -d $piddir ; then
2185 AC_MSG_WARN([** no $piddir directory on this system **])
2191 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2194 dnl allow user to disable some login recording features
2195 AC_ARG_ENABLE(lastlog,
2196 [ --disable-lastlog disable use of lastlog even if detected [no]],
2197 [ AC_DEFINE(DISABLE_LASTLOG) ]
2200 [ --disable-utmp disable use of utmp even if detected [no]],
2201 [ AC_DEFINE(DISABLE_UTMP) ]
2203 AC_ARG_ENABLE(utmpx,
2204 [ --disable-utmpx disable use of utmpx even if detected [no]],
2205 [ AC_DEFINE(DISABLE_UTMPX) ]
2208 [ --disable-wtmp disable use of wtmp even if detected [no]],
2209 [ AC_DEFINE(DISABLE_WTMP) ]
2211 AC_ARG_ENABLE(wtmpx,
2212 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2213 [ AC_DEFINE(DISABLE_WTMPX) ]
2215 AC_ARG_ENABLE(libutil,
2216 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2217 [ AC_DEFINE(DISABLE_LOGIN) ]
2219 AC_ARG_ENABLE(pututline,
2220 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2221 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2223 AC_ARG_ENABLE(pututxline,
2224 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2225 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2227 AC_ARG_WITH(lastlog,
2228 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2230 if test "x$withval" = "xno" ; then
2231 AC_DEFINE(DISABLE_LASTLOG)
2233 conf_lastlog_location=$withval
2238 dnl lastlog, [uw]tmpx? detection
2239 dnl NOTE: set the paths in the platform section to avoid the
2240 dnl need for command-line parameters
2241 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2243 dnl lastlog detection
2244 dnl NOTE: the code itself will detect if lastlog is a directory
2245 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2247 #include <sys/types.h>
2249 #ifdef HAVE_LASTLOG_H
2250 # include <lastlog.h>
2259 [ char *lastlog = LASTLOG_FILE; ],
2260 [ AC_MSG_RESULT(yes) ],
2263 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2265 #include <sys/types.h>
2267 #ifdef HAVE_LASTLOG_H
2268 # include <lastlog.h>
2274 [ char *lastlog = _PATH_LASTLOG; ],
2275 [ AC_MSG_RESULT(yes) ],
2278 system_lastlog_path=no
2283 if test -z "$conf_lastlog_location"; then
2284 if test x"$system_lastlog_path" = x"no" ; then
2285 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2286 if (test -d "$f" || test -f "$f") ; then
2287 conf_lastlog_location=$f
2290 if test -z "$conf_lastlog_location"; then
2291 AC_MSG_WARN([** Cannot find lastlog **])
2292 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2297 if test -n "$conf_lastlog_location"; then
2298 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2302 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2304 #include <sys/types.h>
2310 [ char *utmp = UTMP_FILE; ],
2311 [ AC_MSG_RESULT(yes) ],
2313 system_utmp_path=no ]
2315 if test -z "$conf_utmp_location"; then
2316 if test x"$system_utmp_path" = x"no" ; then
2317 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2318 if test -f $f ; then
2319 conf_utmp_location=$f
2322 if test -z "$conf_utmp_location"; then
2323 AC_DEFINE(DISABLE_UTMP)
2327 if test -n "$conf_utmp_location"; then
2328 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2332 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2334 #include <sys/types.h>
2340 [ char *wtmp = WTMP_FILE; ],
2341 [ AC_MSG_RESULT(yes) ],
2343 system_wtmp_path=no ]
2345 if test -z "$conf_wtmp_location"; then
2346 if test x"$system_wtmp_path" = x"no" ; then
2347 for f in /usr/adm/wtmp /var/log/wtmp; do
2348 if test -f $f ; then
2349 conf_wtmp_location=$f
2352 if test -z "$conf_wtmp_location"; then
2353 AC_DEFINE(DISABLE_WTMP)
2357 if test -n "$conf_wtmp_location"; then
2358 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2362 dnl utmpx detection - I don't know any system so perverse as to require
2363 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2365 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2367 #include <sys/types.h>
2376 [ char *utmpx = UTMPX_FILE; ],
2377 [ AC_MSG_RESULT(yes) ],
2379 system_utmpx_path=no ]
2381 if test -z "$conf_utmpx_location"; then
2382 if test x"$system_utmpx_path" = x"no" ; then
2383 AC_DEFINE(DISABLE_UTMPX)
2386 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2390 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2392 #include <sys/types.h>
2401 [ char *wtmpx = WTMPX_FILE; ],
2402 [ AC_MSG_RESULT(yes) ],
2404 system_wtmpx_path=no ]
2406 if test -z "$conf_wtmpx_location"; then
2407 if test x"$system_wtmpx_path" = x"no" ; then
2408 AC_DEFINE(DISABLE_WTMPX)
2411 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2415 if test ! -z "$blibpath" ; then
2416 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2417 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2420 dnl remove pam and dl because they are in $LIBPAM
2421 if test "$PAM_MSG" = yes ; then
2422 LIBS=`echo $LIBS | sed 's/-lpam //'`
2424 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2425 LIBS=`echo $LIBS | sed 's/-ldl //'`
2429 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2432 # Print summary of options
2434 # Someone please show me a better way :)
2435 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2436 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2437 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2438 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2439 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2440 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2441 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2442 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2443 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2444 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2447 echo "OpenSSH has been configured with the following options:"
2448 echo " User binaries: $B"
2449 echo " System binaries: $C"
2450 echo " Configuration files: $D"
2451 echo " Askpass program: $E"
2452 echo " Manual pages: $F"
2453 echo " PID file: $G"
2454 echo " Privilege separation chroot path: $H"
2455 if test "$USES_LOGIN_CONF" = "yes" ; then
2456 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2458 echo " sshd default user PATH: $I"
2460 if test ! -z "$superuser_path" ; then
2461 echo " sshd superuser user PATH: $J"
2463 echo " Manpage format: $MANTYPE"
2464 echo " PAM support: ${PAM_MSG}"
2465 echo " KerberosIV support: $KRB4_MSG"
2466 echo " KerberosV support: $KRB5_MSG"
2467 echo " Smartcard support: $SCARD_MSG"
2468 echo " AFS support: $AFS_MSG"
2469 echo " S/KEY support: $SKEY_MSG"
2470 echo " TCP Wrappers support: $TCPW_MSG"
2471 echo " MD5 password support: $MD5_MSG"
2472 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2473 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2474 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2475 echo " BSD Auth support: $BSD_AUTH_MSG"
2476 echo " Random number source: $RAND_MSG"
2477 if test ! -z "$USE_RAND_HELPER" ; then
2478 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2483 echo " Host: ${host}"
2484 echo " Compiler: ${CC}"
2485 echo " Compiler flags: ${CFLAGS}"
2486 echo "Preprocessor flags: ${CPPFLAGS}"
2487 echo " Linker flags: ${LDFLAGS}"
2488 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2492 if test "x$PAM_MSG" = "xyes" ; then
2493 echo "PAM is enabled. You may need to install a PAM control file "
2494 echo "for sshd, otherwise password authentication may fail. "
2495 echo "Example PAM control files can be found in the contrib/ "
2500 if test ! -z "$NO_SFTP"; then
2501 echo "sftp-server will be disabled. Your compiler does not "
2502 echo "support 64bit integers."
2506 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2507 echo "WARNING: you are using the builtin random number collection "
2508 echo "service. Please read WARNING.RNG and request that your OS "
2509 echo "vendor includes kernel-based random number collection in "
2510 echo "future versions of your OS."