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)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
75 AC_DEFINE(BROKEN_GETADDRINFO)
76 AC_DEFINE(BROKEN_REALPATH)
77 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
81 LIBS="$LIBS /usr/lib/textmode.o"
82 AC_DEFINE(HAVE_CYGWIN)
84 AC_DEFINE(DISABLE_SHADOW)
85 AC_DEFINE(IPV4_DEFAULT)
86 AC_DEFINE(IP_TOS_IS_BROKEN)
87 AC_DEFINE(NO_X11_UNIX_SOCKETS)
88 AC_DEFINE(SETGROUPS_NOOP)
91 AC_DEFINE(IP_TOS_IS_BROKEN)
94 AC_DEFINE(BROKEN_GETADDRINFO)
97 if test -z "$GCC"; then
100 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
101 IPADDR_IN_DISPLAY=yes
102 AC_DEFINE(HAVE_SECUREWARE)
104 AC_DEFINE(LOGIN_NO_ENDOPT)
105 AC_DEFINE(LOGIN_NEEDS_UTMPX)
106 AC_DEFINE(DISABLE_SHADOW)
107 AC_DEFINE(DISABLE_UTMP)
108 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
109 LIBS="$LIBS -lxnet -lsec -lsecpw"
110 disable_ptmx_check=yes
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
119 AC_DEFINE(LOGIN_NO_ENDOPT)
120 AC_DEFINE(LOGIN_NEEDS_UTMPX)
121 AC_DEFINE(DISABLE_SHADOW)
122 AC_DEFINE(DISABLE_UTMP)
123 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
124 LIBS="$LIBS -lxnet -lsec"
127 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
128 IPADDR_IN_DISPLAY=yes
129 AC_DEFINE(PAM_SUN_CODEBASE)
131 AC_DEFINE(LOGIN_NO_ENDOPT)
132 AC_DEFINE(LOGIN_NEEDS_UTMPX)
133 AC_DEFINE(DISABLE_SHADOW)
134 AC_DEFINE(DISABLE_UTMP)
135 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
136 LIBS="$LIBS -lxnet -lsec"
139 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
141 PATH="$PATH:/usr/etc"
142 AC_DEFINE(BROKEN_INET_NTOA)
143 AC_DEFINE(WITH_ABBREV_NO_TTY)
146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
148 PATH="$PATH:/usr/etc"
149 AC_DEFINE(WITH_IRIX_ARRAY)
150 AC_DEFINE(WITH_IRIX_PROJECT)
151 AC_DEFINE(WITH_IRIX_AUDIT)
152 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
153 AC_DEFINE(BROKEN_INET_NTOA)
154 AC_DEFINE(WITH_ABBREV_NO_TTY)
158 check_for_libcrypt_later=1
159 AC_DEFINE(DONT_TRY_OTHER_AF)
160 AC_DEFINE(PAM_TTY_KLUDGE)
161 inet6_default_4in6=yes
163 mips-sony-bsd|mips-sony-newsos4)
164 AC_DEFINE(HAVE_NEWS4)
171 check_for_libcrypt_later=1
174 conf_lastlog_location="/usr/adm/lastlog"
175 conf_utmp_location=/etc/utmp
176 conf_wtmp_location=/usr/adm/wtmp
179 AC_DEFINE(BROKEN_REALPATH)
181 AC_DEFINE(BROKEN_SAVED_UIDS)
182 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
186 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
187 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
189 AC_DEFINE(PAM_SUN_CODEBASE)
190 AC_DEFINE(LOGIN_NEEDS_UTMPX)
191 AC_DEFINE(LOGIN_NEEDS_TERM)
192 AC_DEFINE(PAM_TTY_KLUDGE)
193 # hardwire lastlog location (can't detect it on some versions)
194 conf_lastlog_location="/var/adm/lastlog"
195 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
196 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
197 if test "$sol2ver" -ge 8; then
199 AC_DEFINE(DISABLE_UTMP)
200 AC_DEFINE(DISABLE_WTMP)
206 CPPFLAGS="$CPPFLAGS -DSUNOS4"
207 AC_CHECK_FUNCS(getpwanam)
208 AC_DEFINE(PAM_SUN_CODEBASE)
209 conf_utmp_location=/etc/utmp
210 conf_wtmp_location=/var/adm/wtmp
211 conf_lastlog_location=/var/adm/lastlog
215 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
216 LDFLAGS="$LDFLAGS -L/usr/local/lib"
221 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
222 # /usr/ucblib MUST NOT be searched on ReliantUNIX
223 LDFLAGS="$LDFLAGS -L/usr/local/lib"
224 IPADDR_IN_DISPLAY=yes
226 AC_DEFINE(IP_TOS_IS_BROKEN)
227 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
228 # Attention: always take care to bind libsocket and libnsl before libc,
229 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
232 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
233 LDFLAGS="$LDFLAGS -L/usr/local/lib"
237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
246 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
247 LDFLAGS="$LDFLAGS -L/usr/local/lib"
248 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
249 rsh_path="/usr/bin/rcmd"
252 AC_DEFINE(BROKEN_SYS_TERMIO_H)
254 AC_DEFINE(HAVE_SECUREWARE)
255 AC_DEFINE(DISABLE_SHADOW)
256 AC_DEFINE(BROKEN_SAVED_UIDS)
257 AC_CHECK_FUNCS(getluid setluid)
259 do_sco3_extra_lib_check=yes
262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
263 LDFLAGS="$LDFLAGS -L/usr/local/lib"
264 LIBS="$LIBS -lprot -lx -ltinfo -lm"
266 rsh_path="/usr/bin/rcmd"
268 AC_DEFINE(HAVE_SECUREWARE)
269 AC_DEFINE(DISABLE_SHADOW)
270 AC_CHECK_FUNCS(getluid setluid)
277 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
278 LIBS="$LIBS -lgen -lrsc"
281 AC_MSG_CHECKING(for Digital Unix SIA)
284 [ --with-osfsia Enable Digital Unix SIA],
286 if test "x$withval" = "xno" ; then
287 AC_MSG_RESULT(disabled)
292 if test -z "$no_osfsia" ; then
293 if test -f /etc/sia/matrix.conf; then
295 AC_DEFINE(HAVE_OSF_SIA)
296 AC_DEFINE(DISABLE_LOGIN)
297 LIBS="$LIBS -lsecurity -ldb -lm -laud"
306 AC_DEFINE(NO_X11_UNIX_SOCKETS)
307 AC_DEFINE(MISSING_NFDBITS)
308 AC_DEFINE(MISSING_HOWMANY)
309 AC_DEFINE(MISSING_FD_MASK)
313 # Allow user to specify flags
315 [ --with-cflags Specify additional flags to pass to compiler],
317 if test "x$withval" != "xno" ; then
318 CFLAGS="$CFLAGS $withval"
322 AC_ARG_WITH(cppflags,
323 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
325 if test "x$withval" != "xno"; then
326 CPPFLAGS="$CPPFLAGS $withval"
331 [ --with-ldflags Specify additional flags to pass to linker],
333 if test "x$withval" != "xno" ; then
334 LDFLAGS="$LDFLAGS $withval"
339 [ --with-libs Specify additional libraries to link with],
341 if test "x$withval" != "xno" ; then
342 LIBS="$LIBS $withval"
347 # Checks for header files.
348 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
349 getopt.h glob.h lastlog.h limits.h login.h \
350 login_cap.h maillock.h netdb.h netgroup.h \
351 netinet/in_systm.h paths.h pty.h readpassphrase.h \
352 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
353 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
354 sys/mman.h sys/select.h sys/stat.h \
355 sys/stropts.h sys/sysmacros.h sys/time.h \
356 sys/un.h time.h ttyent.h usersec.h \
357 util.h utime.h utmp.h utmpx.h)
359 # Checks for libraries.
360 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
361 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
363 dnl SCO OS3 needs this for libwrap
364 if test "x$with_tcp_wrappers" != "xno" ; then
365 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
366 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
370 AC_CHECK_FUNC(getspnam, ,
371 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
374 [ --without-rpath Disable auto-added -R linker paths],
376 if test "x$withval" = "xno" ; then
379 if test "x$withval" = "xyes" ; then
387 [ --with-zlib=PATH Use zlib in PATH],
389 if test "x$withval" = "xno" ; then
390 AC_MSG_ERROR([*** zlib is required ***])
392 if test -d "$withval/lib"; then
393 if test -n "${need_dash_r}"; then
394 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
396 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
399 if test -n "${need_dash_r}"; then
400 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
402 LDFLAGS="-L${withval} ${LDFLAGS}"
405 if test -d "$withval/include"; then
406 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
408 CPPFLAGS="-I${withval} ${CPPFLAGS}"
413 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
416 AC_CHECK_FUNC(strcasecmp,
417 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
419 AC_CHECK_FUNC(utimes,
420 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
423 dnl Checks for libutil functions
424 AC_CHECK_HEADERS(libutil.h)
425 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
426 AC_CHECK_FUNCS(logout updwtmp logwtmp)
430 # Check for ALTDIRFUNC glob() extension
431 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
432 AC_EGREP_CPP(FOUNDIT,
435 #ifdef GLOB_ALTDIRFUNC
440 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
448 # Check for g.gl_matchc glob() extension
449 AC_MSG_CHECKING(for gl_matchc field in glob_t)
450 AC_EGREP_CPP(FOUNDIT,
453 int main(void){glob_t g; g.gl_matchc = 1;}
456 AC_DEFINE(GLOB_HAS_GL_MATCHC)
464 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
467 #include <sys/types.h>
469 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
471 [AC_MSG_RESULT(yes)],
474 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
478 # Check whether user wants S/Key support
481 [ --with-skey[[=PATH]] Enable S/Key support
482 (optionally in PATH)],
484 if test "x$withval" != "xno" ; then
486 if test "x$withval" != "xyes" ; then
487 CPPFLAGS="$CPPFLAGS -I${withval}/include"
488 LDFLAGS="$LDFLAGS -L${withval}/lib"
495 AC_MSG_CHECKING([for s/key support])
500 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
502 [AC_MSG_RESULT(yes)],
505 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
511 # Check whether user wants TCP wrappers support
513 AC_ARG_WITH(tcp-wrappers,
514 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
515 (optionally in PATH)],
517 if test "x$withval" != "xno" ; then
519 saved_LDFLAGS="$LDFLAGS"
520 saved_CPPFLAGS="$CPPFLAGS"
521 if test -n "${withval}" -a "${withval}" != "yes"; then
522 if test -d "${withval}/lib"; then
523 if test -n "${need_dash_r}"; then
524 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
526 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
529 if test -n "${need_dash_r}"; then
530 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
532 LDFLAGS="-L${withval} ${LDFLAGS}"
535 if test -d "${withval}/include"; then
536 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
538 CPPFLAGS="-I${withval} ${CPPFLAGS}"
542 LIBS="$LIBWRAP $LIBS"
543 AC_MSG_CHECKING(for libwrap)
547 int deny_severity = 0, allow_severity = 0;
557 AC_MSG_ERROR([*** libwrap missing])
565 dnl Checks for library functions.
566 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
567 clock fchmod fchown freeaddrinfo futimes gai_strerror \
568 getaddrinfo getcwd getgrouplist getnameinfo getopt \
569 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
570 inet_ntop innetgr login_getcapbool md5_crypt memmove \
571 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
572 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
573 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
574 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
575 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
576 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
578 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
579 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
580 AC_CHECK_LIB(gen, dirname,[
581 AC_CACHE_CHECK([for broken dirname],
582 ac_cv_have_broken_dirname, [
590 int main(int argc, char **argv) {
593 strncpy(buf,"/etc", 32);
595 if (!s || strncmp(s, "/", 32) != 0) {
602 [ ac_cv_have_broken_dirname="no" ],
603 [ ac_cv_have_broken_dirname="yes" ]
607 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
609 AC_DEFINE(HAVE_DIRNAME)
610 AC_CHECK_HEADERS(libgen.h)
615 dnl Checks for time functions
616 AC_CHECK_FUNCS(gettimeofday time)
617 dnl Checks for utmp functions
618 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
619 AC_CHECK_FUNCS(utmpname)
620 dnl Checks for utmpx functions
621 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
622 AC_CHECK_FUNCS(setutxent utmpxname)
624 AC_CHECK_FUNC(daemon,
625 [AC_DEFINE(HAVE_DAEMON)],
626 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
629 AC_CHECK_FUNC(getpagesize,
630 [AC_DEFINE(HAVE_GETPAGESIZE)],
631 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
634 # Check for broken snprintf
635 if test "x$ac_cv_func_snprintf" = "xyes" ; then
636 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
640 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
642 [AC_MSG_RESULT(yes)],
645 AC_DEFINE(BROKEN_SNPRINTF)
646 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
656 [ --with-pam Enable PAM support ],
658 if test "x$withval" != "xno" ; then
659 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
660 AC_MSG_ERROR([PAM headers not found])
663 AC_CHECK_LIB(dl, dlopen, , )
664 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
665 AC_CHECK_FUNCS(pam_getenvlist)
671 if test $ac_cv_lib_dl_dlopen = yes; then
681 # Check for older PAM
682 if test "x$PAM_MSG" = "xyes" ; then
683 # Check PAM strerror arguments (old PAM)
684 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
688 #include <security/pam_appl.h>
690 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
693 AC_DEFINE(HAVE_OLD_PAM)
695 PAM_MSG="yes (old library)"
701 saved_CPPFLAGS="$CPPFLAGS"
702 saved_LDFLAGS="$LDFLAGS"
704 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
706 if test "x$withval" != "xno" ; then
707 if test -d "$withval/lib"; then
708 if test -n "${need_dash_r}"; then
709 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
711 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
714 if test -n "${need_dash_r}"; then
715 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
717 LDFLAGS="-L${withval} ${LDFLAGS}"
720 if test -d "$withval/include"; then
721 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
723 CPPFLAGS="-I${withval} ${CPPFLAGS}"
728 LIBS="$LIBS -lcrypto"
729 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
731 dnl Check default openssl install dir
732 if test -n "${need_dash_r}"; then
733 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
735 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
737 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
738 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
740 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
747 # Sanity check OpenSSL headers
748 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
752 #include <openssl/opensslv.h>
753 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
760 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
764 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
765 # version in OpenSSL. Skip this for PAM
766 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
767 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
771 ### Configure cryptographic random number support
773 # Check wheter OpenSSL seeds itself
774 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
778 #include <openssl/rand.h>
779 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
782 OPENSSL_SEEDS_ITSELF=yes
787 # Default to use of the rand helper if OpenSSL doesn't
794 # Do we want to force the use of the rand helper?
795 AC_ARG_WITH(rand-helper,
796 [ --with-rand-helper Use subprocess to gather strong randomness ],
798 if test "x$withval" = "xno" ; then
799 # Force use of OpenSSL's internal RNG, even if
800 # the previous test showed it to be unseeded.
801 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
802 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
803 OPENSSL_SEEDS_ITSELF=yes
812 # Which randomness source do we use?
813 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
815 AC_DEFINE(OPENSSL_PRNG_ONLY)
816 RAND_MSG="OpenSSL internal ONLY"
817 INSTALL_SSH_RAND_HELPER=""
818 elif test ! -z "$USE_RAND_HELPER" ; then
819 # install rand helper
820 RAND_MSG="ssh-rand-helper"
821 INSTALL_SSH_RAND_HELPER="yes"
823 AC_SUBST(INSTALL_SSH_RAND_HELPER)
825 ### Configuration of ssh-rand-helper
828 AC_ARG_WITH(prngd-port,
829 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
838 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
841 if test ! -z "$withval" ; then
842 PRNGD_PORT="$withval"
843 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
848 # PRNGD Unix domain socket
849 AC_ARG_WITH(prngd-socket,
850 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
854 withval="/var/run/egd-pool"
862 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
866 if test ! -z "$withval" ; then
867 if test ! -z "$PRNGD_PORT" ; then
868 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
870 if test ! -r "$withval" ; then
871 AC_MSG_WARN(Entropy socket is not readable)
873 PRNGD_SOCKET="$withval"
874 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
878 # Check for existing socket only if we don't have a random device already
879 if test "$USE_RAND_HELPER" = yes ; then
880 AC_MSG_CHECKING(for PRNGD/EGD socket)
881 # Insert other locations here
882 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
883 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
885 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
889 if test ! -z "$PRNGD_SOCKET" ; then
890 AC_MSG_RESULT($PRNGD_SOCKET)
892 AC_MSG_RESULT(not found)
898 # Change default command timeout for hashing entropy source
900 AC_ARG_WITH(entropy-timeout,
901 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
903 if test "x$withval" != "xno" ; then
904 entropy_timeout=$withval
908 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
910 ssh_privsep_user=sshd
911 AC_ARG_WITH(privsep-user,
912 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
914 if test -n "$withval"; then
915 ssh_privsep_user=$withval
919 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
921 # We do this little dance with the search path to insure
922 # that programs that we select for use by installed programs
923 # (which may be run by the super-user) come from trusted
924 # locations before they come from the user's private area.
925 # This should help avoid accidentally configuring some
926 # random version of a program in someone's personal bin.
930 test -h /bin 2> /dev/null && PATH=/usr/bin
931 test -d /sbin && PATH=$PATH:/sbin
932 test -d /usr/sbin && PATH=$PATH:/usr/sbin
933 PATH=$PATH:/etc:$OPATH
935 # These programs are used by the command hashing source to gather entropy
936 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
937 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
938 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
939 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
940 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
941 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
942 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
943 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
944 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
945 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
946 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
947 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
948 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
949 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
950 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
951 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
955 # Where does ssh-rand-helper get its randomness from?
956 INSTALL_SSH_PRNG_CMDS=""
957 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
958 if test ! -z "$PRNGD_PORT" ; then
959 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
960 elif test ! -z "$PRNGD_SOCKET" ; then
961 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
963 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
964 RAND_HELPER_CMDHASH=yes
965 INSTALL_SSH_PRNG_CMDS="yes"
968 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
971 # Cheap hack to ensure NEWS-OS libraries are arranged right.
972 if test ! -z "$SONY" ; then
973 LIBS="$LIBS -liberty";
976 # Checks for data types
977 AC_CHECK_SIZEOF(char, 1)
978 AC_CHECK_SIZEOF(short int, 2)
979 AC_CHECK_SIZEOF(int, 4)
980 AC_CHECK_SIZEOF(long int, 4)
981 AC_CHECK_SIZEOF(long long int, 8)
983 # Sanity check long long for some platforms (AIX)
984 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
985 ac_cv_sizeof_long_long_int=0
988 # More checks for data types
989 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
991 [ #include <sys/types.h> ],
993 [ ac_cv_have_u_int="yes" ],
994 [ ac_cv_have_u_int="no" ]
997 if test "x$ac_cv_have_u_int" = "xyes" ; then
998 AC_DEFINE(HAVE_U_INT)
1002 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1004 [ #include <sys/types.h> ],
1005 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1006 [ ac_cv_have_intxx_t="yes" ],
1007 [ ac_cv_have_intxx_t="no" ]
1010 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1011 AC_DEFINE(HAVE_INTXX_T)
1015 if (test -z "$have_intxx_t" && \
1016 test "x$ac_cv_header_stdint_h" = "xyes")
1018 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1020 [ #include <stdint.h> ],
1021 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1023 AC_DEFINE(HAVE_INTXX_T)
1026 [ AC_MSG_RESULT(no) ]
1030 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1032 [ #include <sys/types.h> ],
1033 [ int64_t a; a = 1;],
1034 [ ac_cv_have_int64_t="yes" ],
1035 [ ac_cv_have_int64_t="no" ]
1038 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1039 AC_DEFINE(HAVE_INT64_T)
1043 if test -z "$have_int64_t" ; then
1044 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1046 [ #include <sys/socket.h> ],
1047 [ int64_t a; a = 1],
1049 AC_DEFINE(HAVE_INT64_T)
1052 [ AC_MSG_RESULT(no) ]
1056 if test -z "$have_int64_t" ; then
1057 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1059 [ #include <sys/bitypes.h> ],
1060 [ int64_t a; a = 1],
1062 AC_DEFINE(HAVE_INT64_T)
1065 [ AC_MSG_RESULT(no) ]
1069 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1071 [ #include <sys/types.h> ],
1072 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1073 [ ac_cv_have_u_intxx_t="yes" ],
1074 [ ac_cv_have_u_intxx_t="no" ]
1077 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1078 AC_DEFINE(HAVE_U_INTXX_T)
1082 if test -z "$have_u_intxx_t" ; then
1083 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1085 [ #include <sys/socket.h> ],
1086 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1088 AC_DEFINE(HAVE_U_INTXX_T)
1091 [ AC_MSG_RESULT(no) ]
1095 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1097 [ #include <sys/types.h> ],
1098 [ u_int64_t a; a = 1;],
1099 [ ac_cv_have_u_int64_t="yes" ],
1100 [ ac_cv_have_u_int64_t="no" ]
1103 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1104 AC_DEFINE(HAVE_U_INT64_T)
1108 if test -z "$have_u_int64_t" ; then
1109 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1111 [ #include <sys/bitypes.h> ],
1112 [ u_int64_t a; a = 1],
1114 AC_DEFINE(HAVE_U_INT64_T)
1117 [ AC_MSG_RESULT(no) ]
1121 if test -z "$have_u_intxx_t" ; then
1122 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1125 #include <sys/types.h>
1127 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1128 [ ac_cv_have_uintxx_t="yes" ],
1129 [ ac_cv_have_uintxx_t="no" ]
1132 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1133 AC_DEFINE(HAVE_UINTXX_T)
1137 if test -z "$have_uintxx_t" ; then
1138 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1140 [ #include <stdint.h> ],
1141 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1143 AC_DEFINE(HAVE_UINTXX_T)
1146 [ AC_MSG_RESULT(no) ]
1150 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1151 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1153 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1156 #include <sys/bitypes.h>
1159 int8_t a; int16_t b; int32_t c;
1160 u_int8_t e; u_int16_t f; u_int32_t g;
1161 a = b = c = e = f = g = 1;
1164 AC_DEFINE(HAVE_U_INTXX_T)
1165 AC_DEFINE(HAVE_INTXX_T)
1173 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1176 #include <sys/types.h>
1178 [ u_char foo; foo = 125; ],
1179 [ ac_cv_have_u_char="yes" ],
1180 [ ac_cv_have_u_char="no" ]
1183 if test "x$ac_cv_have_u_char" = "xyes" ; then
1184 AC_DEFINE(HAVE_U_CHAR)
1189 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1191 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1194 #include <sys/types.h>
1196 [ size_t foo; foo = 1235; ],
1197 [ ac_cv_have_size_t="yes" ],
1198 [ ac_cv_have_size_t="no" ]
1201 if test "x$ac_cv_have_size_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_SIZE_T)
1205 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1208 #include <sys/types.h>
1210 [ ssize_t foo; foo = 1235; ],
1211 [ ac_cv_have_ssize_t="yes" ],
1212 [ ac_cv_have_ssize_t="no" ]
1215 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1216 AC_DEFINE(HAVE_SSIZE_T)
1219 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1224 [ clock_t foo; foo = 1235; ],
1225 [ ac_cv_have_clock_t="yes" ],
1226 [ ac_cv_have_clock_t="no" ]
1229 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1230 AC_DEFINE(HAVE_CLOCK_T)
1233 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1236 #include <sys/types.h>
1237 #include <sys/socket.h>
1239 [ sa_family_t foo; foo = 1235; ],
1240 [ ac_cv_have_sa_family_t="yes" ],
1243 #include <sys/types.h>
1244 #include <sys/socket.h>
1245 #include <netinet/in.h>
1247 [ sa_family_t foo; foo = 1235; ],
1248 [ ac_cv_have_sa_family_t="yes" ],
1250 [ ac_cv_have_sa_family_t="no" ]
1254 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1255 AC_DEFINE(HAVE_SA_FAMILY_T)
1258 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1261 #include <sys/types.h>
1263 [ pid_t foo; foo = 1235; ],
1264 [ ac_cv_have_pid_t="yes" ],
1265 [ ac_cv_have_pid_t="no" ]
1268 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1269 AC_DEFINE(HAVE_PID_T)
1272 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1275 #include <sys/types.h>
1277 [ mode_t foo; foo = 1235; ],
1278 [ ac_cv_have_mode_t="yes" ],
1279 [ ac_cv_have_mode_t="no" ]
1282 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1283 AC_DEFINE(HAVE_MODE_T)
1287 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1290 #include <sys/types.h>
1291 #include <sys/socket.h>
1293 [ struct sockaddr_storage s; ],
1294 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1295 [ ac_cv_have_struct_sockaddr_storage="no" ]
1298 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1299 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1302 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1305 #include <sys/types.h>
1306 #include <netinet/in.h>
1308 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1309 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1310 [ ac_cv_have_struct_sockaddr_in6="no" ]
1313 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1314 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1317 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1320 #include <sys/types.h>
1321 #include <netinet/in.h>
1323 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1324 [ ac_cv_have_struct_in6_addr="yes" ],
1325 [ ac_cv_have_struct_in6_addr="no" ]
1328 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1329 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1332 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1335 #include <sys/types.h>
1336 #include <sys/socket.h>
1339 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1340 [ ac_cv_have_struct_addrinfo="yes" ],
1341 [ ac_cv_have_struct_addrinfo="no" ]
1344 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1345 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1348 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1350 [ #include <sys/time.h> ],
1351 [ struct timeval tv; tv.tv_sec = 1;],
1352 [ ac_cv_have_struct_timeval="yes" ],
1353 [ ac_cv_have_struct_timeval="no" ]
1356 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1357 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1358 have_struct_timeval=1
1361 # If we don't have int64_t then we can't compile sftp-server. So don't
1362 # even attempt to do it.
1363 if test "x$ac_cv_have_int64_t" = "xno" -a \
1364 "x$ac_cv_sizeof_long_int" != "x8" -a \
1365 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1368 dnl test snprintf (broken on SCO w/gcc)
1373 #ifdef HAVE_SNPRINTF
1377 char expected_out[50];
1379 #if (SIZEOF_LONG_INT == 8)
1380 long int num = 0x7fffffffffffffff;
1382 long long num = 0x7fffffffffffffffll;
1384 strcpy(expected_out, "9223372036854775807");
1385 snprintf(buf, mazsize, "%lld", num);
1386 if(strcmp(buf, expected_out) != 0)
1393 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1398 dnl Checks for structure members
1399 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1400 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1401 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1402 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1403 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1404 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1405 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1406 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1407 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1408 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1409 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1410 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1411 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1412 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1413 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1414 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1415 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1417 AC_CHECK_MEMBERS([struct stat.st_blksize])
1419 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1420 ac_cv_have_ss_family_in_struct_ss, [
1423 #include <sys/types.h>
1424 #include <sys/socket.h>
1426 [ struct sockaddr_storage s; s.ss_family = 1; ],
1427 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1428 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1431 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1432 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1435 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1436 ac_cv_have___ss_family_in_struct_ss, [
1439 #include <sys/types.h>
1440 #include <sys/socket.h>
1442 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1443 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1444 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1447 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1448 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1451 AC_CACHE_CHECK([for pw_class field in struct passwd],
1452 ac_cv_have_pw_class_in_struct_passwd, [
1457 [ struct passwd p; p.pw_class = 0; ],
1458 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1459 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1462 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1463 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1466 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1467 ac_cv_have_pw_expire_in_struct_passwd, [
1472 [ struct passwd p; p.pw_expire = 0; ],
1473 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1474 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1477 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1478 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1481 AC_CACHE_CHECK([for pw_change field in struct passwd],
1482 ac_cv_have_pw_change_in_struct_passwd, [
1487 [ struct passwd p; p.pw_change = 0; ],
1488 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1489 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1492 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1493 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1496 dnl make sure we're using the real structure members and not defines
1497 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1498 ac_cv_have_accrights_in_msghdr, [
1501 #include <sys/types.h>
1502 #include <sys/socket.h>
1503 #include <sys/uio.h>
1505 #ifdef msg_accrights
1509 m.msg_accrights = 0;
1513 [ ac_cv_have_accrights_in_msghdr="yes" ],
1514 [ ac_cv_have_accrights_in_msghdr="no" ]
1517 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1518 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1521 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1522 ac_cv_have_control_in_msghdr, [
1525 #include <sys/types.h>
1526 #include <sys/socket.h>
1527 #include <sys/uio.h>
1537 [ ac_cv_have_control_in_msghdr="yes" ],
1538 [ ac_cv_have_control_in_msghdr="no" ]
1541 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1542 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1545 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1547 [ extern char *__progname; printf("%s", __progname); ],
1548 [ ac_cv_libc_defines___progname="yes" ],
1549 [ ac_cv_libc_defines___progname="no" ]
1552 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1553 AC_DEFINE(HAVE___PROGNAME)
1556 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1560 [ printf("%s", __FUNCTION__); ],
1561 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1562 [ ac_cv_cc_implements___FUNCTION__="no" ]
1565 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1566 AC_DEFINE(HAVE___FUNCTION__)
1569 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1573 [ printf("%s", __func__); ],
1574 [ ac_cv_cc_implements___func__="yes" ],
1575 [ ac_cv_cc_implements___func__="no" ]
1578 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1579 AC_DEFINE(HAVE___func__)
1582 AC_CACHE_CHECK([whether getopt has optreset support],
1583 ac_cv_have_getopt_optreset, [
1588 [ extern int optreset; optreset = 0; ],
1589 [ ac_cv_have_getopt_optreset="yes" ],
1590 [ ac_cv_have_getopt_optreset="no" ]
1593 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1594 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1597 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1599 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1600 [ ac_cv_libc_defines_sys_errlist="yes" ],
1601 [ ac_cv_libc_defines_sys_errlist="no" ]
1604 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1605 AC_DEFINE(HAVE_SYS_ERRLIST)
1609 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1611 [ extern int sys_nerr; printf("%i", sys_nerr);],
1612 [ ac_cv_libc_defines_sys_nerr="yes" ],
1613 [ ac_cv_libc_defines_sys_nerr="no" ]
1616 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1617 AC_DEFINE(HAVE_SYS_NERR)
1622 # Check whether user wants sectok support
1624 [ --with-sectok Enable smartcard support using libsectok],
1626 if test "x$withval" != "xno" ; then
1627 if test "x$withval" != "xyes" ; then
1628 CPPFLAGS="$CPPFLAGS -I${withval}"
1629 LDFLAGS="$LDFLAGS -L${withval}"
1630 if test ! -z "$need_dash_r" ; then
1631 LDFLAGS="$LDFLAGS -R${withval}"
1633 if test ! -z "$blibpath" ; then
1634 blibpath="$blibpath:${withval}"
1637 AC_CHECK_HEADERS(sectok.h)
1638 if test "$ac_cv_header_sectok_h" != yes; then
1639 AC_MSG_ERROR(Can't find sectok.h)
1641 AC_CHECK_LIB(sectok, sectok_open)
1642 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1643 AC_MSG_ERROR(Can't find libsectok)
1645 AC_DEFINE(SMARTCARD)
1646 AC_DEFINE(USE_SECTOK)
1647 SCARD_MSG="yes, using sectok"
1652 # Check whether user wants OpenSC support
1654 AC_HELP_STRING([--with-opensc=PFX],
1655 [Enable smartcard support using OpenSC]),
1656 opensc_config_prefix="$withval", opensc_config_prefix="")
1657 if test x$opensc_config_prefix != x ; then
1658 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1659 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1660 if test "$OPENSC_CONFIG" != "no"; then
1661 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1662 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1663 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1664 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1665 AC_DEFINE(SMARTCARD)
1666 AC_DEFINE(USE_OPENSC)
1667 SCARD_MSG="yes, using OpenSC"
1671 # Check whether user wants Kerberos 5 support
1673 AC_ARG_WITH(kerberos5,
1674 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1676 if test "x$withval" != "xno" ; then
1677 if test "x$withval" = "xyes" ; then
1678 KRB5ROOT="/usr/local"
1682 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1683 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1686 AC_MSG_CHECKING(whether we are using Heimdal)
1687 AC_TRY_COMPILE([ #include <krb5.h> ],
1688 [ char *tmp = heimdal_version; ],
1689 [ AC_MSG_RESULT(yes)
1691 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1694 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1697 if test ! -z "$need_dash_r" ; then
1698 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1700 if test ! -z "$blibpath" ; then
1701 blibpath="$blibpath:${KRB5ROOT}/lib"
1703 AC_CHECK_LIB(resolv, dn_expand, , )
1709 # Check whether user wants Kerberos 4 support
1711 AC_ARG_WITH(kerberos4,
1712 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1714 if test "x$withval" != "xno" ; then
1715 if test "x$withval" != "xyes" ; then
1716 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1717 LDFLAGS="$LDFLAGS -L${withval}/lib"
1718 if test ! -z "$need_dash_r" ; then
1719 LDFLAGS="$LDFLAGS -R${withval}/lib"
1721 if test ! -z "$blibpath" ; then
1722 blibpath="$blibpath:${withval}/lib"
1725 if test -d /usr/include/kerberosIV ; then
1726 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1730 AC_CHECK_HEADERS(krb.h)
1731 if test "$ac_cv_header_krb_h" != yes; then
1732 AC_MSG_WARN([Cannot find krb.h, build may fail])
1734 AC_CHECK_LIB(krb, main)
1735 if test "$ac_cv_lib_krb_main" != yes; then
1736 AC_CHECK_LIB(krb4, main)
1737 if test "$ac_cv_lib_krb4_main" != yes; then
1738 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1745 AC_CHECK_LIB(des, des_cbc_encrypt)
1746 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1747 AC_CHECK_LIB(des425, des_cbc_encrypt)
1748 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1749 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1756 AC_CHECK_LIB(resolv, dn_expand, , )
1764 # Check whether user wants AFS support
1767 [ --with-afs=PATH Enable AFS support],
1769 if test "x$withval" != "xno" ; then
1771 if test "x$withval" != "xyes" ; then
1772 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1773 LDFLAGS="$LDFLAGS -L${withval}/lib"
1776 if test -z "$KRB4" ; then
1777 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1781 if test ! -z "$AFS_LIBS" ; then
1782 LIBS="$LIBS $AFS_LIBS"
1789 LIBS="$LIBS $KLIBS $K5LIBS"
1791 # Looking for programs, paths and files
1793 [ --with-rsh=PATH Specify path to remote shell program ],
1795 if test "x$withval" != "$no" ; then
1800 AC_PATH_PROG(rsh_path, rsh)
1804 PRIVSEP_PATH=/var/empty
1805 AC_ARG_WITH(privsep-path,
1806 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1808 if test "x$withval" != "$no" ; then
1809 PRIVSEP_PATH=$withval
1813 AC_SUBST(PRIVSEP_PATH)
1816 [ --with-xauth=PATH Specify path to xauth program ],
1818 if test "x$withval" != "xno" ; then
1823 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1824 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1825 xauth_path="/usr/openwin/bin/xauth"
1830 if test -z "$xauth_path" ; then
1831 XAUTH_PATH="undefined"
1832 AC_SUBST(XAUTH_PATH)
1834 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1835 XAUTH_PATH=$xauth_path
1836 AC_SUBST(XAUTH_PATH)
1838 if test ! -z "$rsh_path" ; then
1839 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1842 # Check for mail directory (last resort if we cannot get it from headers)
1843 if test ! -z "$MAIL" ; then
1844 maildir=`dirname $MAIL`
1845 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1848 if test -z "$no_dev_ptmx" ; then
1849 if test "x$disable_ptmx_check" != "xyes" ; then
1850 AC_CHECK_FILE("/dev/ptmx",
1852 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1858 AC_CHECK_FILE("/dev/ptc",
1860 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1865 # Options from here on. Some of these are preset by platform above
1866 AC_ARG_WITH(mantype,
1867 [ --with-mantype=man|cat|doc Set man page type],
1874 AC_MSG_ERROR(invalid man type: $withval)
1879 if test -z "$MANTYPE"; then
1880 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1881 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1883 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1890 if test "$MANTYPE" = "doc"; then
1897 # Check whether to enable MD5 passwords
1899 AC_ARG_WITH(md5-passwords,
1900 [ --with-md5-passwords Enable use of MD5 passwords],
1902 if test "x$withval" != "xno" ; then
1903 AC_DEFINE(HAVE_MD5_PASSWORDS)
1909 # Whether to disable shadow password support
1911 [ --without-shadow Disable shadow password support],
1913 if test "x$withval" = "xno" ; then
1914 AC_DEFINE(DISABLE_SHADOW)
1920 if test -z "$disable_shadow" ; then
1921 AC_MSG_CHECKING([if the systems has expire shadow information])
1924 #include <sys/types.h>
1927 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1928 [ sp_expire_available=yes ], []
1931 if test "x$sp_expire_available" = "xyes" ; then
1933 AC_DEFINE(HAS_SHADOW_EXPIRE)
1939 # Use ip address instead of hostname in $DISPLAY
1940 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1941 DISPLAY_HACK_MSG="yes"
1942 AC_DEFINE(IPADDR_IN_DISPLAY)
1944 DISPLAY_HACK_MSG="no"
1945 AC_ARG_WITH(ipaddr-display,
1946 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1948 if test "x$withval" != "xno" ; then
1949 AC_DEFINE(IPADDR_IN_DISPLAY)
1950 DISPLAY_HACK_MSG="yes"
1956 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1957 if test $ac_cv_func_login_getcapbool = "yes" -a \
1958 $ac_cv_header_login_cap_h = "yes" ; then
1961 # Whether to mess with the default path
1962 SERVER_PATH_MSG="(default)"
1963 AC_ARG_WITH(default-path,
1964 [ --with-default-path= Specify default \$PATH environment for server],
1966 if test "$USES_LOGIN_CONF" = "yes" ; then
1968 --with-default-path=PATH has no effect on this system.
1969 Edit /etc/login.conf instead.])
1970 elif test "x$withval" != "xno" ; then
1971 user_path="$withval"
1972 SERVER_PATH_MSG="$withval"
1975 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1976 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
1980 /* find out what STDPATH is */
1985 #ifndef _PATH_STDPATH
1986 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1988 #include <sys/types.h>
1989 #include <sys/stat.h>
1991 #define DATA "conftest.stdpath"
1998 fd = fopen(DATA,"w");
2002 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2007 ], [ user_path=`cat conftest.stdpath` ],
2008 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2009 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2011 # make sure $bindir is in USER_PATH so scp will work
2012 t_bindir=`eval echo ${bindir}`
2014 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2017 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2019 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2020 if test $? -ne 0 ; then
2021 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2022 if test $? -ne 0 ; then
2023 user_path=$user_path:$t_bindir
2024 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2029 if test "$USES_LOGIN_CONF" != "yes" ; then
2030 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2034 # Set superuser path separately to user path
2035 AC_ARG_WITH(superuser-path,
2036 [ --with-superuser-path= Specify different path for super-user],
2038 if test "x$withval" != "xno" ; then
2039 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2040 superuser_path=$withval
2046 # Whether to force IPv4 by default (needed on broken glibc Linux)
2048 AC_ARG_WITH(ipv4-default,
2049 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2051 if test "x$withval" != "xno" ; then
2052 AC_DEFINE(IPV4_DEFAULT)
2058 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2059 IPV4_IN6_HACK_MSG="no"
2061 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2063 if test "x$withval" != "xno" ; then
2065 AC_DEFINE(IPV4_IN_IPV6)
2066 IPV4_IN6_HACK_MSG="yes"
2071 if test "x$inet6_default_4in6" = "xyes"; then
2072 AC_MSG_RESULT([yes (default)])
2073 AC_DEFINE(IPV4_IN_IPV6)
2074 IPV4_IN6_HACK_MSG="yes"
2076 AC_MSG_RESULT([no (default)])
2081 # Whether to enable BSD auth support
2083 AC_ARG_WITH(bsd-auth,
2084 [ --with-bsd-auth Enable BSD auth support],
2086 if test "x$withval" != "xno" ; then
2093 # Where to place sshd.pid
2095 # make sure the directory exists
2096 if test ! -d $piddir ; then
2097 piddir=`eval echo ${sysconfdir}`
2099 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2103 AC_ARG_WITH(pid-dir,
2104 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2106 if test "x$withval" != "xno" ; then
2108 if test ! -d $piddir ; then
2109 AC_MSG_WARN([** no $piddir directory on this system **])
2115 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2118 dnl allow user to disable some login recording features
2119 AC_ARG_ENABLE(lastlog,
2120 [ --disable-lastlog disable use of lastlog even if detected [no]],
2121 [ AC_DEFINE(DISABLE_LASTLOG) ]
2124 [ --disable-utmp disable use of utmp even if detected [no]],
2125 [ AC_DEFINE(DISABLE_UTMP) ]
2127 AC_ARG_ENABLE(utmpx,
2128 [ --disable-utmpx disable use of utmpx even if detected [no]],
2129 [ AC_DEFINE(DISABLE_UTMPX) ]
2132 [ --disable-wtmp disable use of wtmp even if detected [no]],
2133 [ AC_DEFINE(DISABLE_WTMP) ]
2135 AC_ARG_ENABLE(wtmpx,
2136 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2137 [ AC_DEFINE(DISABLE_WTMPX) ]
2139 AC_ARG_ENABLE(libutil,
2140 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2141 [ AC_DEFINE(DISABLE_LOGIN) ]
2143 AC_ARG_ENABLE(pututline,
2144 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2145 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2147 AC_ARG_ENABLE(pututxline,
2148 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2149 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2151 AC_ARG_WITH(lastlog,
2152 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2154 if test "x$withval" = "xno" ; then
2155 AC_DEFINE(DISABLE_LASTLOG)
2157 conf_lastlog_location=$withval
2162 dnl lastlog, [uw]tmpx? detection
2163 dnl NOTE: set the paths in the platform section to avoid the
2164 dnl need for command-line parameters
2165 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2167 dnl lastlog detection
2168 dnl NOTE: the code itself will detect if lastlog is a directory
2169 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2171 #include <sys/types.h>
2173 #ifdef HAVE_LASTLOG_H
2174 # include <lastlog.h>
2183 [ char *lastlog = LASTLOG_FILE; ],
2184 [ AC_MSG_RESULT(yes) ],
2187 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2189 #include <sys/types.h>
2191 #ifdef HAVE_LASTLOG_H
2192 # include <lastlog.h>
2198 [ char *lastlog = _PATH_LASTLOG; ],
2199 [ AC_MSG_RESULT(yes) ],
2202 system_lastlog_path=no
2207 if test -z "$conf_lastlog_location"; then
2208 if test x"$system_lastlog_path" = x"no" ; then
2209 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2210 if (test -d "$f" || test -f "$f") ; then
2211 conf_lastlog_location=$f
2214 if test -z "$conf_lastlog_location"; then
2215 AC_MSG_WARN([** Cannot find lastlog **])
2216 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2221 if test -n "$conf_lastlog_location"; then
2222 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2226 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2228 #include <sys/types.h>
2234 [ char *utmp = UTMP_FILE; ],
2235 [ AC_MSG_RESULT(yes) ],
2237 system_utmp_path=no ]
2239 if test -z "$conf_utmp_location"; then
2240 if test x"$system_utmp_path" = x"no" ; then
2241 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2242 if test -f $f ; then
2243 conf_utmp_location=$f
2246 if test -z "$conf_utmp_location"; then
2247 AC_DEFINE(DISABLE_UTMP)
2251 if test -n "$conf_utmp_location"; then
2252 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2256 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2258 #include <sys/types.h>
2264 [ char *wtmp = WTMP_FILE; ],
2265 [ AC_MSG_RESULT(yes) ],
2267 system_wtmp_path=no ]
2269 if test -z "$conf_wtmp_location"; then
2270 if test x"$system_wtmp_path" = x"no" ; then
2271 for f in /usr/adm/wtmp /var/log/wtmp; do
2272 if test -f $f ; then
2273 conf_wtmp_location=$f
2276 if test -z "$conf_wtmp_location"; then
2277 AC_DEFINE(DISABLE_WTMP)
2281 if test -n "$conf_wtmp_location"; then
2282 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2286 dnl utmpx detection - I don't know any system so perverse as to require
2287 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2289 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2291 #include <sys/types.h>
2300 [ char *utmpx = UTMPX_FILE; ],
2301 [ AC_MSG_RESULT(yes) ],
2303 system_utmpx_path=no ]
2305 if test -z "$conf_utmpx_location"; then
2306 if test x"$system_utmpx_path" = x"no" ; then
2307 AC_DEFINE(DISABLE_UTMPX)
2310 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2314 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2316 #include <sys/types.h>
2325 [ char *wtmpx = WTMPX_FILE; ],
2326 [ AC_MSG_RESULT(yes) ],
2328 system_wtmpx_path=no ]
2330 if test -z "$conf_wtmpx_location"; then
2331 if test x"$system_wtmpx_path" = x"no" ; then
2332 AC_DEFINE(DISABLE_WTMPX)
2335 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2339 if test ! -z "$blibpath" ; then
2340 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2341 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2344 dnl remove pam and dl because they are in $LIBPAM
2345 if test "$PAM_MSG" = yes ; then
2346 LIBS=`echo $LIBS | sed 's/-lpam //'`
2348 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2349 LIBS=`echo $LIBS | sed 's/-ldl //'`
2353 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2356 # Print summary of options
2358 # Someone please show me a better way :)
2359 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2360 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2361 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2362 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2363 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2364 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2365 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2366 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2367 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2368 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2371 echo "OpenSSH has been configured with the following options:"
2372 echo " User binaries: $B"
2373 echo " System binaries: $C"
2374 echo " Configuration files: $D"
2375 echo " Askpass program: $E"
2376 echo " Manual pages: $F"
2377 echo " PID file: $G"
2378 echo " Privilege separation chroot path: $H"
2379 if test "$USES_LOGIN_CONF" = "yes" ; then
2380 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2382 echo " sshd default user PATH: $I"
2384 if test ! -z "$superuser_path" ; then
2385 echo " sshd superuser user PATH: $J"
2387 echo " Manpage format: $MANTYPE"
2388 echo " PAM support: ${PAM_MSG}"
2389 echo " KerberosIV support: $KRB4_MSG"
2390 echo " KerberosV support: $KRB5_MSG"
2391 echo " Smartcard support: $SCARD_MSG"
2392 echo " AFS support: $AFS_MSG"
2393 echo " S/KEY support: $SKEY_MSG"
2394 echo " TCP Wrappers support: $TCPW_MSG"
2395 echo " MD5 password support: $MD5_MSG"
2396 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2397 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2398 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2399 echo " BSD Auth support: $BSD_AUTH_MSG"
2400 echo " Random number source: $RAND_MSG"
2401 if test ! -z "$USE_RAND_HELPER" ; then
2402 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2407 echo " Host: ${host}"
2408 echo " Compiler: ${CC}"
2409 echo " Compiler flags: ${CFLAGS}"
2410 echo "Preprocessor flags: ${CPPFLAGS}"
2411 echo " Linker flags: ${LDFLAGS}"
2412 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2416 if test "x$PAM_MSG" = "xyes" ; then
2417 echo "PAM is enabled. You may need to install a PAM control file "
2418 echo "for sshd, otherwise password authentication may fail. "
2419 echo "Example PAM control files can be found in the contrib/ "
2424 if test ! -z "$NO_SFTP"; then
2425 echo "sftp-server will be disabled. Your compiler does not "
2426 echo "support 64bit integers."
2430 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2431 echo "WARNING: you are using the builtin random number collection "
2432 echo "service. Please read WARNING.RNG and request that your OS "
2433 echo "vendor includes kernel-based random number collection in "
2434 echo "future versions of your OS."