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_DEFINE(BROKEN_GETADDRINFO)
104 if test -z "$GCC"; then
107 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
108 IPADDR_IN_DISPLAY=yes
109 AC_DEFINE(HAVE_SECUREWARE)
111 AC_DEFINE(LOGIN_NO_ENDOPT)
112 AC_DEFINE(LOGIN_NEEDS_UTMPX)
113 AC_DEFINE(DISABLE_SHADOW)
114 AC_DEFINE(DISABLE_UTMP)
115 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
116 LIBS="$LIBS -lxnet -lsec -lsecpw"
117 disable_ptmx_check=yes
120 if test -z "$GCC"; then
123 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
124 IPADDR_IN_DISPLAY=yes
126 AC_DEFINE(LOGIN_NO_ENDOPT)
127 AC_DEFINE(LOGIN_NEEDS_UTMPX)
128 AC_DEFINE(DISABLE_SHADOW)
129 AC_DEFINE(DISABLE_UTMP)
130 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
131 LIBS="$LIBS -lxnet -lsec"
134 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
135 IPADDR_IN_DISPLAY=yes
136 AC_DEFINE(PAM_SUN_CODEBASE)
138 AC_DEFINE(LOGIN_NO_ENDOPT)
139 AC_DEFINE(LOGIN_NEEDS_UTMPX)
140 AC_DEFINE(DISABLE_SHADOW)
141 AC_DEFINE(DISABLE_UTMP)
142 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
143 LIBS="$LIBS -lxnet -lsec"
146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
148 PATH="$PATH:/usr/etc"
149 AC_DEFINE(BROKEN_INET_NTOA)
150 AC_DEFINE(WITH_ABBREV_NO_TTY)
153 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
155 PATH="$PATH:/usr/etc"
156 AC_DEFINE(WITH_IRIX_ARRAY)
157 AC_DEFINE(WITH_IRIX_PROJECT)
158 AC_DEFINE(WITH_IRIX_AUDIT)
159 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
160 AC_DEFINE(BROKEN_INET_NTOA)
161 AC_DEFINE(WITH_ABBREV_NO_TTY)
165 check_for_libcrypt_later=1
166 AC_DEFINE(DONT_TRY_OTHER_AF)
167 AC_DEFINE(PAM_TTY_KLUDGE)
168 inet6_default_4in6=yes
170 mips-sony-bsd|mips-sony-newsos4)
171 AC_DEFINE(HAVE_NEWS4)
178 check_for_libcrypt_later=1
181 conf_lastlog_location="/usr/adm/lastlog"
182 conf_utmp_location=/etc/utmp
183 conf_wtmp_location=/usr/adm/wtmp
186 AC_DEFINE(BROKEN_REALPATH)
188 AC_DEFINE(BROKEN_SAVED_UIDS)
189 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
196 AC_DEFINE(PAM_SUN_CODEBASE)
197 AC_DEFINE(LOGIN_NEEDS_UTMPX)
198 AC_DEFINE(LOGIN_NEEDS_TERM)
199 AC_DEFINE(PAM_TTY_KLUDGE)
200 # hardwire lastlog location (can't detect it on some versions)
201 conf_lastlog_location="/var/adm/lastlog"
202 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
203 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
204 if test "$sol2ver" -ge 8; then
206 AC_DEFINE(DISABLE_UTMP)
207 AC_DEFINE(DISABLE_WTMP)
213 CPPFLAGS="$CPPFLAGS -DSUNOS4"
214 AC_CHECK_FUNCS(getpwanam)
215 AC_DEFINE(PAM_SUN_CODEBASE)
216 conf_utmp_location=/etc/utmp
217 conf_wtmp_location=/var/adm/wtmp
218 conf_lastlog_location=/var/adm/lastlog
222 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
223 LDFLAGS="$LDFLAGS -L/usr/local/lib"
228 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
229 # /usr/ucblib MUST NOT be searched on ReliantUNIX
230 LDFLAGS="$LDFLAGS -L/usr/local/lib"
231 IPADDR_IN_DISPLAY=yes
233 AC_DEFINE(IP_TOS_IS_BROKEN)
234 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
235 # Attention: always take care to bind libsocket and libnsl before libc,
236 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
240 LDFLAGS="$LDFLAGS -L/usr/local/lib"
244 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
245 LDFLAGS="$LDFLAGS -L/usr/local/lib"
249 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
250 LDFLAGS="$LDFLAGS -L/usr/local/lib"
253 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
254 LDFLAGS="$LDFLAGS -L/usr/local/lib"
255 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
258 AC_DEFINE(BROKEN_SYS_TERMIO_H)
260 AC_DEFINE(HAVE_SECUREWARE)
261 AC_DEFINE(DISABLE_SHADOW)
262 AC_DEFINE(BROKEN_SAVED_UIDS)
263 AC_CHECK_FUNCS(getluid setluid)
265 do_sco3_extra_lib_check=yes
268 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
269 LDFLAGS="$LDFLAGS -L/usr/local/lib"
270 LIBS="$LIBS -lprot -lx -ltinfo -lm"
273 AC_DEFINE(HAVE_SECUREWARE)
274 AC_DEFINE(DISABLE_SHADOW)
275 AC_DEFINE(DISABLE_FD_PASSING)
276 AC_CHECK_FUNCS(getluid setluid)
283 AC_DEFINE(DISABLE_FD_PASSING)
284 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
285 LIBS="$LIBS -lgen -lrsc"
288 AC_MSG_CHECKING(for Digital Unix SIA)
291 [ --with-osfsia Enable Digital Unix SIA],
293 if test "x$withval" = "xno" ; then
294 AC_MSG_RESULT(disabled)
299 if test -z "$no_osfsia" ; then
300 if test -f /etc/sia/matrix.conf; then
302 AC_DEFINE(HAVE_OSF_SIA)
303 AC_DEFINE(DISABLE_LOGIN)
304 LIBS="$LIBS -lsecurity -ldb -lm -laud"
313 AC_DEFINE(NO_X11_UNIX_SOCKETS)
314 AC_DEFINE(MISSING_NFDBITS)
315 AC_DEFINE(MISSING_HOWMANY)
316 AC_DEFINE(MISSING_FD_MASK)
320 # Allow user to specify flags
322 [ --with-cflags Specify additional flags to pass to compiler],
324 if test "x$withval" != "xno" ; then
325 CFLAGS="$CFLAGS $withval"
329 AC_ARG_WITH(cppflags,
330 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
332 if test "x$withval" != "xno"; then
333 CPPFLAGS="$CPPFLAGS $withval"
338 [ --with-ldflags Specify additional flags to pass to linker],
340 if test "x$withval" != "xno" ; then
341 LDFLAGS="$LDFLAGS $withval"
346 [ --with-libs Specify additional libraries to link with],
348 if test "x$withval" != "xno" ; then
349 LIBS="$LIBS $withval"
354 # Checks for header files.
355 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
356 getopt.h glob.h lastlog.h limits.h login.h \
357 login_cap.h maillock.h netdb.h netgroup.h \
358 netinet/in_systm.h paths.h pty.h readpassphrase.h \
359 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
360 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
361 sys/mman.h sys/select.h sys/stat.h \
362 sys/stropts.h sys/sysmacros.h sys/time.h \
363 sys/un.h time.h ttyent.h usersec.h \
364 util.h utime.h utmp.h utmpx.h)
366 # Checks for libraries.
367 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
368 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
370 dnl SCO OS3 needs this for libwrap
371 if test "x$with_tcp_wrappers" != "xno" ; then
372 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
373 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
377 AC_CHECK_FUNC(getspnam, ,
378 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
381 [ --without-rpath Disable auto-added -R linker paths],
383 if test "x$withval" = "xno" ; then
386 if test "x$withval" = "xyes" ; then
394 [ --with-zlib=PATH Use zlib in PATH],
396 if test "x$withval" = "xno" ; then
397 AC_MSG_ERROR([*** zlib is required ***])
399 if test -d "$withval/lib"; then
400 if test -n "${need_dash_r}"; then
401 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
403 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
406 if test -n "${need_dash_r}"; then
407 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
409 LDFLAGS="-L${withval} ${LDFLAGS}"
412 if test -d "$withval/include"; then
413 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
415 CPPFLAGS="-I${withval} ${CPPFLAGS}"
420 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
423 AC_CHECK_FUNC(strcasecmp,
424 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
426 AC_CHECK_FUNC(utimes,
427 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
428 LIBS="$LIBS -lc89"]) ]
431 dnl Checks for libutil functions
432 AC_CHECK_HEADERS(libutil.h)
433 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
434 AC_CHECK_FUNCS(logout updwtmp logwtmp)
438 # Check for ALTDIRFUNC glob() extension
439 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
440 AC_EGREP_CPP(FOUNDIT,
443 #ifdef GLOB_ALTDIRFUNC
448 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
456 # Check for g.gl_matchc glob() extension
457 AC_MSG_CHECKING(for gl_matchc field in glob_t)
458 AC_EGREP_CPP(FOUNDIT,
461 int main(void){glob_t g; g.gl_matchc = 1;}
464 AC_DEFINE(GLOB_HAS_GL_MATCHC)
472 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
475 #include <sys/types.h>
477 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
479 [AC_MSG_RESULT(yes)],
482 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
486 # Check whether user wants S/Key support
489 [ --with-skey[[=PATH]] Enable S/Key support
490 (optionally in PATH)],
492 if test "x$withval" != "xno" ; then
494 if test "x$withval" != "xyes" ; then
495 CPPFLAGS="$CPPFLAGS -I${withval}/include"
496 LDFLAGS="$LDFLAGS -L${withval}/lib"
503 AC_MSG_CHECKING([for s/key support])
508 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
510 [AC_MSG_RESULT(yes)],
513 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
519 # Check whether user wants TCP wrappers support
521 AC_ARG_WITH(tcp-wrappers,
522 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
523 (optionally in PATH)],
525 if test "x$withval" != "xno" ; then
527 saved_LDFLAGS="$LDFLAGS"
528 saved_CPPFLAGS="$CPPFLAGS"
529 if test -n "${withval}" -a "${withval}" != "yes"; then
530 if test -d "${withval}/lib"; then
531 if test -n "${need_dash_r}"; then
532 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
534 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
537 if test -n "${need_dash_r}"; then
538 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
540 LDFLAGS="-L${withval} ${LDFLAGS}"
543 if test -d "${withval}/include"; then
544 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
546 CPPFLAGS="-I${withval} ${CPPFLAGS}"
550 LIBS="$LIBWRAP $LIBS"
551 AC_MSG_CHECKING(for libwrap)
555 int deny_severity = 0, allow_severity = 0;
565 AC_MSG_ERROR([*** libwrap missing])
573 dnl Checks for library functions.
574 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
575 clock fchmod fchown freeaddrinfo futimes gai_strerror \
576 getaddrinfo getcwd getgrouplist getnameinfo getopt \
577 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
578 inet_ntop innetgr login_getcapbool md5_crypt memmove \
579 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
580 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
581 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
582 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
583 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
584 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
586 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
587 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
588 AC_CHECK_LIB(gen, dirname,[
589 AC_CACHE_CHECK([for broken dirname],
590 ac_cv_have_broken_dirname, [
598 int main(int argc, char **argv) {
601 strncpy(buf,"/etc", 32);
603 if (!s || strncmp(s, "/", 32) != 0) {
610 [ ac_cv_have_broken_dirname="no" ],
611 [ ac_cv_have_broken_dirname="yes" ]
615 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
617 AC_DEFINE(HAVE_DIRNAME)
618 AC_CHECK_HEADERS(libgen.h)
623 dnl Checks for time functions
624 AC_CHECK_FUNCS(gettimeofday time)
625 dnl Checks for utmp functions
626 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
627 AC_CHECK_FUNCS(utmpname)
628 dnl Checks for utmpx functions
629 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
630 AC_CHECK_FUNCS(setutxent utmpxname)
632 AC_CHECK_FUNC(daemon,
633 [AC_DEFINE(HAVE_DAEMON)],
634 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
637 AC_CHECK_FUNC(getpagesize,
638 [AC_DEFINE(HAVE_GETPAGESIZE)],
639 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
642 # Check for broken snprintf
643 if test "x$ac_cv_func_snprintf" = "xyes" ; then
644 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
648 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
650 [AC_MSG_RESULT(yes)],
653 AC_DEFINE(BROKEN_SNPRINTF)
654 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
664 [ --with-pam Enable PAM support ],
666 if test "x$withval" != "xno" ; then
667 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
668 AC_MSG_ERROR([PAM headers not found])
671 AC_CHECK_LIB(dl, dlopen, , )
672 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
673 AC_CHECK_FUNCS(pam_getenvlist)
679 if test $ac_cv_lib_dl_dlopen = yes; then
689 # Check for older PAM
690 if test "x$PAM_MSG" = "xyes" ; then
691 # Check PAM strerror arguments (old PAM)
692 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
696 #include <security/pam_appl.h>
698 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
701 AC_DEFINE(HAVE_OLD_PAM)
703 PAM_MSG="yes (old library)"
709 saved_CPPFLAGS="$CPPFLAGS"
710 saved_LDFLAGS="$LDFLAGS"
712 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
714 if test "x$withval" != "xno" ; then
715 if test -d "$withval/lib"; then
716 if test -n "${need_dash_r}"; then
717 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
719 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
722 if test -n "${need_dash_r}"; then
723 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
725 LDFLAGS="-L${withval} ${LDFLAGS}"
728 if test -d "$withval/include"; then
729 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
731 CPPFLAGS="-I${withval} ${CPPFLAGS}"
736 LIBS="$LIBS -lcrypto"
737 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
739 dnl Check default openssl install dir
740 if test -n "${need_dash_r}"; then
741 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
743 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
745 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
746 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
748 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
755 # Sanity check OpenSSL headers
756 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
760 #include <openssl/opensslv.h>
761 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
768 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
772 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
773 # version in OpenSSL. Skip this for PAM
774 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
775 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
779 ### Configure cryptographic random number support
781 # Check wheter OpenSSL seeds itself
782 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
786 #include <openssl/rand.h>
787 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
790 OPENSSL_SEEDS_ITSELF=yes
795 # Default to use of the rand helper if OpenSSL doesn't
802 # Do we want to force the use of the rand helper?
803 AC_ARG_WITH(rand-helper,
804 [ --with-rand-helper Use subprocess to gather strong randomness ],
806 if test "x$withval" = "xno" ; then
807 # Force use of OpenSSL's internal RNG, even if
808 # the previous test showed it to be unseeded.
809 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
810 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
811 OPENSSL_SEEDS_ITSELF=yes
820 # Which randomness source do we use?
821 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
823 AC_DEFINE(OPENSSL_PRNG_ONLY)
824 RAND_MSG="OpenSSL internal ONLY"
825 INSTALL_SSH_RAND_HELPER=""
826 elif test ! -z "$USE_RAND_HELPER" ; then
827 # install rand helper
828 RAND_MSG="ssh-rand-helper"
829 INSTALL_SSH_RAND_HELPER="yes"
831 AC_SUBST(INSTALL_SSH_RAND_HELPER)
833 ### Configuration of ssh-rand-helper
836 AC_ARG_WITH(prngd-port,
837 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
846 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
849 if test ! -z "$withval" ; then
850 PRNGD_PORT="$withval"
851 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
856 # PRNGD Unix domain socket
857 AC_ARG_WITH(prngd-socket,
858 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
862 withval="/var/run/egd-pool"
870 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
874 if test ! -z "$withval" ; then
875 if test ! -z "$PRNGD_PORT" ; then
876 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
878 if test ! -r "$withval" ; then
879 AC_MSG_WARN(Entropy socket is not readable)
881 PRNGD_SOCKET="$withval"
882 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
886 # Check for existing socket only if we don't have a random device already
887 if test "$USE_RAND_HELPER" = yes ; then
888 AC_MSG_CHECKING(for PRNGD/EGD socket)
889 # Insert other locations here
890 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
891 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
893 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
897 if test ! -z "$PRNGD_SOCKET" ; then
898 AC_MSG_RESULT($PRNGD_SOCKET)
900 AC_MSG_RESULT(not found)
906 # Change default command timeout for hashing entropy source
908 AC_ARG_WITH(entropy-timeout,
909 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
911 if test "x$withval" != "xno" ; then
912 entropy_timeout=$withval
916 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
918 SSH_PRIVSEP_USER=sshd
919 AC_ARG_WITH(privsep-user,
920 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
922 if test -n "$withval"; then
923 SSH_PRIVSEP_USER=$withval
927 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
928 AC_SUBST(SSH_PRIVSEP_USER)
930 # We do this little dance with the search path to insure
931 # that programs that we select for use by installed programs
932 # (which may be run by the super-user) come from trusted
933 # locations before they come from the user's private area.
934 # This should help avoid accidentally configuring some
935 # random version of a program in someone's personal bin.
939 test -h /bin 2> /dev/null && PATH=/usr/bin
940 test -d /sbin && PATH=$PATH:/sbin
941 test -d /usr/sbin && PATH=$PATH:/usr/sbin
942 PATH=$PATH:/etc:$OPATH
944 # These programs are used by the command hashing source to gather entropy
945 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
946 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
947 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
948 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
949 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
950 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
951 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
952 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
953 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
954 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
955 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
956 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
957 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
958 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
959 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
960 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
964 # Where does ssh-rand-helper get its randomness from?
965 INSTALL_SSH_PRNG_CMDS=""
966 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
967 if test ! -z "$PRNGD_PORT" ; then
968 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
969 elif test ! -z "$PRNGD_SOCKET" ; then
970 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
972 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
973 RAND_HELPER_CMDHASH=yes
974 INSTALL_SSH_PRNG_CMDS="yes"
977 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
980 # Cheap hack to ensure NEWS-OS libraries are arranged right.
981 if test ! -z "$SONY" ; then
982 LIBS="$LIBS -liberty";
985 # Checks for data types
986 AC_CHECK_SIZEOF(char, 1)
987 AC_CHECK_SIZEOF(short int, 2)
988 AC_CHECK_SIZEOF(int, 4)
989 AC_CHECK_SIZEOF(long int, 4)
990 AC_CHECK_SIZEOF(long long int, 8)
992 # Sanity check long long for some platforms (AIX)
993 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
994 ac_cv_sizeof_long_long_int=0
997 # More checks for data types
998 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1000 [ #include <sys/types.h> ],
1002 [ ac_cv_have_u_int="yes" ],
1003 [ ac_cv_have_u_int="no" ]
1006 if test "x$ac_cv_have_u_int" = "xyes" ; then
1007 AC_DEFINE(HAVE_U_INT)
1011 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1013 [ #include <sys/types.h> ],
1014 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1015 [ ac_cv_have_intxx_t="yes" ],
1016 [ ac_cv_have_intxx_t="no" ]
1019 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1020 AC_DEFINE(HAVE_INTXX_T)
1024 if (test -z "$have_intxx_t" && \
1025 test "x$ac_cv_header_stdint_h" = "xyes")
1027 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1029 [ #include <stdint.h> ],
1030 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1032 AC_DEFINE(HAVE_INTXX_T)
1035 [ AC_MSG_RESULT(no) ]
1039 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1041 [ #include <sys/types.h> ],
1042 [ int64_t a; a = 1;],
1043 [ ac_cv_have_int64_t="yes" ],
1044 [ ac_cv_have_int64_t="no" ]
1047 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1048 AC_DEFINE(HAVE_INT64_T)
1052 if test -z "$have_int64_t" ; then
1053 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1055 [ #include <sys/socket.h> ],
1056 [ int64_t a; a = 1],
1058 AC_DEFINE(HAVE_INT64_T)
1061 [ AC_MSG_RESULT(no) ]
1065 if test -z "$have_int64_t" ; then
1066 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1068 [ #include <sys/bitypes.h> ],
1069 [ int64_t a; a = 1],
1071 AC_DEFINE(HAVE_INT64_T)
1074 [ AC_MSG_RESULT(no) ]
1078 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1080 [ #include <sys/types.h> ],
1081 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1082 [ ac_cv_have_u_intxx_t="yes" ],
1083 [ ac_cv_have_u_intxx_t="no" ]
1086 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1087 AC_DEFINE(HAVE_U_INTXX_T)
1091 if test -z "$have_u_intxx_t" ; then
1092 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1094 [ #include <sys/socket.h> ],
1095 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1097 AC_DEFINE(HAVE_U_INTXX_T)
1100 [ AC_MSG_RESULT(no) ]
1104 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1106 [ #include <sys/types.h> ],
1107 [ u_int64_t a; a = 1;],
1108 [ ac_cv_have_u_int64_t="yes" ],
1109 [ ac_cv_have_u_int64_t="no" ]
1112 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1113 AC_DEFINE(HAVE_U_INT64_T)
1117 if test -z "$have_u_int64_t" ; then
1118 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1120 [ #include <sys/bitypes.h> ],
1121 [ u_int64_t a; a = 1],
1123 AC_DEFINE(HAVE_U_INT64_T)
1126 [ AC_MSG_RESULT(no) ]
1130 if test -z "$have_u_intxx_t" ; then
1131 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1134 #include <sys/types.h>
1136 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1137 [ ac_cv_have_uintxx_t="yes" ],
1138 [ ac_cv_have_uintxx_t="no" ]
1141 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1142 AC_DEFINE(HAVE_UINTXX_T)
1146 if test -z "$have_uintxx_t" ; then
1147 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1149 [ #include <stdint.h> ],
1150 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1152 AC_DEFINE(HAVE_UINTXX_T)
1155 [ AC_MSG_RESULT(no) ]
1159 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1160 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1162 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1165 #include <sys/bitypes.h>
1168 int8_t a; int16_t b; int32_t c;
1169 u_int8_t e; u_int16_t f; u_int32_t g;
1170 a = b = c = e = f = g = 1;
1173 AC_DEFINE(HAVE_U_INTXX_T)
1174 AC_DEFINE(HAVE_INTXX_T)
1182 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1185 #include <sys/types.h>
1187 [ u_char foo; foo = 125; ],
1188 [ ac_cv_have_u_char="yes" ],
1189 [ ac_cv_have_u_char="no" ]
1192 if test "x$ac_cv_have_u_char" = "xyes" ; then
1193 AC_DEFINE(HAVE_U_CHAR)
1198 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1200 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1203 #include <sys/types.h>
1205 [ size_t foo; foo = 1235; ],
1206 [ ac_cv_have_size_t="yes" ],
1207 [ ac_cv_have_size_t="no" ]
1210 if test "x$ac_cv_have_size_t" = "xyes" ; then
1211 AC_DEFINE(HAVE_SIZE_T)
1214 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1217 #include <sys/types.h>
1219 [ ssize_t foo; foo = 1235; ],
1220 [ ac_cv_have_ssize_t="yes" ],
1221 [ ac_cv_have_ssize_t="no" ]
1224 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1225 AC_DEFINE(HAVE_SSIZE_T)
1228 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1233 [ clock_t foo; foo = 1235; ],
1234 [ ac_cv_have_clock_t="yes" ],
1235 [ ac_cv_have_clock_t="no" ]
1238 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1239 AC_DEFINE(HAVE_CLOCK_T)
1242 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1245 #include <sys/types.h>
1246 #include <sys/socket.h>
1248 [ sa_family_t foo; foo = 1235; ],
1249 [ ac_cv_have_sa_family_t="yes" ],
1252 #include <sys/types.h>
1253 #include <sys/socket.h>
1254 #include <netinet/in.h>
1256 [ sa_family_t foo; foo = 1235; ],
1257 [ ac_cv_have_sa_family_t="yes" ],
1259 [ ac_cv_have_sa_family_t="no" ]
1263 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1264 AC_DEFINE(HAVE_SA_FAMILY_T)
1267 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1270 #include <sys/types.h>
1272 [ pid_t foo; foo = 1235; ],
1273 [ ac_cv_have_pid_t="yes" ],
1274 [ ac_cv_have_pid_t="no" ]
1277 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1278 AC_DEFINE(HAVE_PID_T)
1281 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1284 #include <sys/types.h>
1286 [ mode_t foo; foo = 1235; ],
1287 [ ac_cv_have_mode_t="yes" ],
1288 [ ac_cv_have_mode_t="no" ]
1291 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1292 AC_DEFINE(HAVE_MODE_T)
1296 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1299 #include <sys/types.h>
1300 #include <sys/socket.h>
1302 [ struct sockaddr_storage s; ],
1303 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1304 [ ac_cv_have_struct_sockaddr_storage="no" ]
1307 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1308 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1311 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1314 #include <sys/types.h>
1315 #include <netinet/in.h>
1317 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1318 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1319 [ ac_cv_have_struct_sockaddr_in6="no" ]
1322 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1323 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1326 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1329 #include <sys/types.h>
1330 #include <netinet/in.h>
1332 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1333 [ ac_cv_have_struct_in6_addr="yes" ],
1334 [ ac_cv_have_struct_in6_addr="no" ]
1337 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1338 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1341 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1344 #include <sys/types.h>
1345 #include <sys/socket.h>
1348 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1349 [ ac_cv_have_struct_addrinfo="yes" ],
1350 [ ac_cv_have_struct_addrinfo="no" ]
1353 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1354 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1357 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1359 [ #include <sys/time.h> ],
1360 [ struct timeval tv; tv.tv_sec = 1;],
1361 [ ac_cv_have_struct_timeval="yes" ],
1362 [ ac_cv_have_struct_timeval="no" ]
1365 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1366 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1367 have_struct_timeval=1
1370 # If we don't have int64_t then we can't compile sftp-server. So don't
1371 # even attempt to do it.
1372 if test "x$ac_cv_have_int64_t" = "xno" -a \
1373 "x$ac_cv_sizeof_long_int" != "x8" -a \
1374 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1377 dnl test snprintf (broken on SCO w/gcc)
1382 #ifdef HAVE_SNPRINTF
1386 char expected_out[50];
1388 #if (SIZEOF_LONG_INT == 8)
1389 long int num = 0x7fffffffffffffff;
1391 long long num = 0x7fffffffffffffffll;
1393 strcpy(expected_out, "9223372036854775807");
1394 snprintf(buf, mazsize, "%lld", num);
1395 if(strcmp(buf, expected_out) != 0)
1402 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1407 dnl Checks for structure members
1408 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1409 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1410 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1411 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1412 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1413 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1414 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1415 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1416 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1417 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1418 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1419 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1420 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1421 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1422 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1423 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1424 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1426 AC_CHECK_MEMBERS([struct stat.st_blksize])
1428 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1429 ac_cv_have_ss_family_in_struct_ss, [
1432 #include <sys/types.h>
1433 #include <sys/socket.h>
1435 [ struct sockaddr_storage s; s.ss_family = 1; ],
1436 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1437 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1440 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1441 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1444 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1445 ac_cv_have___ss_family_in_struct_ss, [
1448 #include <sys/types.h>
1449 #include <sys/socket.h>
1451 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1452 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1453 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1456 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1457 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1460 AC_CACHE_CHECK([for pw_class field in struct passwd],
1461 ac_cv_have_pw_class_in_struct_passwd, [
1466 [ struct passwd p; p.pw_class = 0; ],
1467 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1468 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1471 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1472 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1475 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1476 ac_cv_have_pw_expire_in_struct_passwd, [
1481 [ struct passwd p; p.pw_expire = 0; ],
1482 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1483 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1486 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1487 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1490 AC_CACHE_CHECK([for pw_change field in struct passwd],
1491 ac_cv_have_pw_change_in_struct_passwd, [
1496 [ struct passwd p; p.pw_change = 0; ],
1497 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1498 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1501 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1502 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1505 dnl make sure we're using the real structure members and not defines
1506 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1507 ac_cv_have_accrights_in_msghdr, [
1510 #include <sys/types.h>
1511 #include <sys/socket.h>
1512 #include <sys/uio.h>
1514 #ifdef msg_accrights
1518 m.msg_accrights = 0;
1522 [ ac_cv_have_accrights_in_msghdr="yes" ],
1523 [ ac_cv_have_accrights_in_msghdr="no" ]
1526 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1527 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1530 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1531 ac_cv_have_control_in_msghdr, [
1534 #include <sys/types.h>
1535 #include <sys/socket.h>
1536 #include <sys/uio.h>
1546 [ ac_cv_have_control_in_msghdr="yes" ],
1547 [ ac_cv_have_control_in_msghdr="no" ]
1550 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1551 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1554 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1556 [ extern char *__progname; printf("%s", __progname); ],
1557 [ ac_cv_libc_defines___progname="yes" ],
1558 [ ac_cv_libc_defines___progname="no" ]
1561 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1562 AC_DEFINE(HAVE___PROGNAME)
1565 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1569 [ printf("%s", __FUNCTION__); ],
1570 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1571 [ ac_cv_cc_implements___FUNCTION__="no" ]
1574 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1575 AC_DEFINE(HAVE___FUNCTION__)
1578 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1582 [ printf("%s", __func__); ],
1583 [ ac_cv_cc_implements___func__="yes" ],
1584 [ ac_cv_cc_implements___func__="no" ]
1587 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1588 AC_DEFINE(HAVE___func__)
1591 AC_CACHE_CHECK([whether getopt has optreset support],
1592 ac_cv_have_getopt_optreset, [
1597 [ extern int optreset; optreset = 0; ],
1598 [ ac_cv_have_getopt_optreset="yes" ],
1599 [ ac_cv_have_getopt_optreset="no" ]
1602 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1603 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1606 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1608 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1609 [ ac_cv_libc_defines_sys_errlist="yes" ],
1610 [ ac_cv_libc_defines_sys_errlist="no" ]
1613 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1614 AC_DEFINE(HAVE_SYS_ERRLIST)
1618 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1620 [ extern int sys_nerr; printf("%i", sys_nerr);],
1621 [ ac_cv_libc_defines_sys_nerr="yes" ],
1622 [ ac_cv_libc_defines_sys_nerr="no" ]
1625 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1626 AC_DEFINE(HAVE_SYS_NERR)
1631 # Check whether user wants sectok support
1633 [ --with-sectok Enable smartcard support using libsectok],
1635 if test "x$withval" != "xno" ; then
1636 if test "x$withval" != "xyes" ; then
1637 CPPFLAGS="$CPPFLAGS -I${withval}"
1638 LDFLAGS="$LDFLAGS -L${withval}"
1639 if test ! -z "$need_dash_r" ; then
1640 LDFLAGS="$LDFLAGS -R${withval}"
1642 if test ! -z "$blibpath" ; then
1643 blibpath="$blibpath:${withval}"
1646 AC_CHECK_HEADERS(sectok.h)
1647 if test "$ac_cv_header_sectok_h" != yes; then
1648 AC_MSG_ERROR(Can't find sectok.h)
1650 AC_CHECK_LIB(sectok, sectok_open)
1651 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1652 AC_MSG_ERROR(Can't find libsectok)
1654 AC_DEFINE(SMARTCARD)
1655 AC_DEFINE(USE_SECTOK)
1656 SCARD_MSG="yes, using sectok"
1661 # Check whether user wants OpenSC support
1663 AC_HELP_STRING([--with-opensc=PFX],
1664 [Enable smartcard support using OpenSC]),
1665 opensc_config_prefix="$withval", opensc_config_prefix="")
1666 if test x$opensc_config_prefix != x ; then
1667 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1668 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1669 if test "$OPENSC_CONFIG" != "no"; then
1670 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1671 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1672 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1673 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1674 AC_DEFINE(SMARTCARD)
1675 AC_DEFINE(USE_OPENSC)
1676 SCARD_MSG="yes, using OpenSC"
1680 # Check whether user wants Kerberos 5 support
1682 AC_ARG_WITH(kerberos5,
1683 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1685 if test "x$withval" != "xno" ; then
1686 if test "x$withval" = "xyes" ; then
1687 KRB5ROOT="/usr/local"
1691 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1692 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1695 AC_MSG_CHECKING(whether we are using Heimdal)
1696 AC_TRY_COMPILE([ #include <krb5.h> ],
1697 [ char *tmp = heimdal_version; ],
1698 [ AC_MSG_RESULT(yes)
1700 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1703 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1706 if test ! -z "$need_dash_r" ; then
1707 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1709 if test ! -z "$blibpath" ; then
1710 blibpath="$blibpath:${KRB5ROOT}/lib"
1712 AC_CHECK_LIB(resolv, dn_expand, , )
1718 # Check whether user wants Kerberos 4 support
1720 AC_ARG_WITH(kerberos4,
1721 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1723 if test "x$withval" != "xno" ; then
1724 if test "x$withval" != "xyes" ; then
1725 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1726 LDFLAGS="$LDFLAGS -L${withval}/lib"
1727 if test ! -z "$need_dash_r" ; then
1728 LDFLAGS="$LDFLAGS -R${withval}/lib"
1730 if test ! -z "$blibpath" ; then
1731 blibpath="$blibpath:${withval}/lib"
1734 if test -d /usr/include/kerberosIV ; then
1735 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1739 AC_CHECK_HEADERS(krb.h)
1740 if test "$ac_cv_header_krb_h" != yes; then
1741 AC_MSG_WARN([Cannot find krb.h, build may fail])
1743 AC_CHECK_LIB(krb, main)
1744 if test "$ac_cv_lib_krb_main" != yes; then
1745 AC_CHECK_LIB(krb4, main)
1746 if test "$ac_cv_lib_krb4_main" != yes; then
1747 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1754 AC_CHECK_LIB(des, des_cbc_encrypt)
1755 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1756 AC_CHECK_LIB(des425, des_cbc_encrypt)
1757 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1758 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1765 AC_CHECK_LIB(resolv, dn_expand, , )
1773 # Check whether user wants AFS support
1776 [ --with-afs=PATH Enable AFS support],
1778 if test "x$withval" != "xno" ; then
1780 if test "x$withval" != "xyes" ; then
1781 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1782 LDFLAGS="$LDFLAGS -L${withval}/lib"
1785 if test -z "$KRB4" ; then
1786 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1790 if test ! -z "$AFS_LIBS" ; then
1791 LIBS="$LIBS $AFS_LIBS"
1798 LIBS="$LIBS $KLIBS $K5LIBS"
1800 # Looking for programs, paths and files
1802 PRIVSEP_PATH=/var/empty
1803 AC_ARG_WITH(privsep-path,
1804 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1806 if test "x$withval" != "$no" ; then
1807 PRIVSEP_PATH=$withval
1811 AC_SUBST(PRIVSEP_PATH)
1814 [ --with-xauth=PATH Specify path to xauth program ],
1816 if test "x$withval" != "xno" ; then
1822 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1823 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1824 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1825 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1826 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1827 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1828 xauth_path="/usr/openwin/bin/xauth"
1833 if test -z "$xauth_path" ; then
1834 XAUTH_PATH="undefined"
1835 AC_SUBST(XAUTH_PATH)
1837 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1838 XAUTH_PATH=$xauth_path
1839 AC_SUBST(XAUTH_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 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
1881 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
1882 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1884 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1891 if test "$MANTYPE" = "doc"; then
1898 # Check whether to enable MD5 passwords
1900 AC_ARG_WITH(md5-passwords,
1901 [ --with-md5-passwords Enable use of MD5 passwords],
1903 if test "x$withval" != "xno" ; then
1904 AC_DEFINE(HAVE_MD5_PASSWORDS)
1910 # Whether to disable shadow password support
1912 [ --without-shadow Disable shadow password support],
1914 if test "x$withval" = "xno" ; then
1915 AC_DEFINE(DISABLE_SHADOW)
1921 if test -z "$disable_shadow" ; then
1922 AC_MSG_CHECKING([if the systems has expire shadow information])
1925 #include <sys/types.h>
1928 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1929 [ sp_expire_available=yes ], []
1932 if test "x$sp_expire_available" = "xyes" ; then
1934 AC_DEFINE(HAS_SHADOW_EXPIRE)
1940 # Use ip address instead of hostname in $DISPLAY
1941 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1942 DISPLAY_HACK_MSG="yes"
1943 AC_DEFINE(IPADDR_IN_DISPLAY)
1945 DISPLAY_HACK_MSG="no"
1946 AC_ARG_WITH(ipaddr-display,
1947 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1949 if test "x$withval" != "xno" ; then
1950 AC_DEFINE(IPADDR_IN_DISPLAY)
1951 DISPLAY_HACK_MSG="yes"
1957 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1958 if test $ac_cv_func_login_getcapbool = "yes" -a \
1959 $ac_cv_header_login_cap_h = "yes" ; then
1962 # Whether to mess with the default path
1963 SERVER_PATH_MSG="(default)"
1964 AC_ARG_WITH(default-path,
1965 [ --with-default-path= Specify default \$PATH environment for server],
1967 if test "$USES_LOGIN_CONF" = "yes" ; then
1969 --with-default-path=PATH has no effect on this system.
1970 Edit /etc/login.conf instead.])
1971 elif test "x$withval" != "xno" ; then
1972 user_path="$withval"
1973 SERVER_PATH_MSG="$withval"
1976 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1977 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
1981 /* find out what STDPATH is */
1986 #ifndef _PATH_STDPATH
1987 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1989 #include <sys/types.h>
1990 #include <sys/stat.h>
1992 #define DATA "conftest.stdpath"
1999 fd = fopen(DATA,"w");
2003 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2008 ], [ user_path=`cat conftest.stdpath` ],
2009 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2010 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2012 # make sure $bindir is in USER_PATH so scp will work
2013 t_bindir=`eval echo ${bindir}`
2015 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2018 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2020 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2021 if test $? -ne 0 ; then
2022 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2023 if test $? -ne 0 ; then
2024 user_path=$user_path:$t_bindir
2025 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2030 if test "$USES_LOGIN_CONF" != "yes" ; then
2031 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2035 # Set superuser path separately to user path
2036 AC_ARG_WITH(superuser-path,
2037 [ --with-superuser-path= Specify different path for super-user],
2039 if test "x$withval" != "xno" ; then
2040 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2041 superuser_path=$withval
2047 # Whether to force IPv4 by default (needed on broken glibc Linux)
2049 AC_ARG_WITH(ipv4-default,
2050 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2052 if test "x$withval" != "xno" ; then
2053 AC_DEFINE(IPV4_DEFAULT)
2059 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2060 IPV4_IN6_HACK_MSG="no"
2062 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2064 if test "x$withval" != "xno" ; then
2066 AC_DEFINE(IPV4_IN_IPV6)
2067 IPV4_IN6_HACK_MSG="yes"
2072 if test "x$inet6_default_4in6" = "xyes"; then
2073 AC_MSG_RESULT([yes (default)])
2074 AC_DEFINE(IPV4_IN_IPV6)
2075 IPV4_IN6_HACK_MSG="yes"
2077 AC_MSG_RESULT([no (default)])
2082 # Whether to enable BSD auth support
2084 AC_ARG_WITH(bsd-auth,
2085 [ --with-bsd-auth Enable BSD auth support],
2087 if test "x$withval" != "xno" ; then
2094 # Where to place sshd.pid
2096 # make sure the directory exists
2097 if test ! -d $piddir ; then
2098 piddir=`eval echo ${sysconfdir}`
2100 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2104 AC_ARG_WITH(pid-dir,
2105 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2107 if test "x$withval" != "xno" ; then
2109 if test ! -d $piddir ; then
2110 AC_MSG_WARN([** no $piddir directory on this system **])
2116 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2119 dnl allow user to disable some login recording features
2120 AC_ARG_ENABLE(lastlog,
2121 [ --disable-lastlog disable use of lastlog even if detected [no]],
2122 [ AC_DEFINE(DISABLE_LASTLOG) ]
2125 [ --disable-utmp disable use of utmp even if detected [no]],
2126 [ AC_DEFINE(DISABLE_UTMP) ]
2128 AC_ARG_ENABLE(utmpx,
2129 [ --disable-utmpx disable use of utmpx even if detected [no]],
2130 [ AC_DEFINE(DISABLE_UTMPX) ]
2133 [ --disable-wtmp disable use of wtmp even if detected [no]],
2134 [ AC_DEFINE(DISABLE_WTMP) ]
2136 AC_ARG_ENABLE(wtmpx,
2137 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2138 [ AC_DEFINE(DISABLE_WTMPX) ]
2140 AC_ARG_ENABLE(libutil,
2141 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2142 [ AC_DEFINE(DISABLE_LOGIN) ]
2144 AC_ARG_ENABLE(pututline,
2145 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2146 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2148 AC_ARG_ENABLE(pututxline,
2149 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2150 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2152 AC_ARG_WITH(lastlog,
2153 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2155 if test "x$withval" = "xno" ; then
2156 AC_DEFINE(DISABLE_LASTLOG)
2158 conf_lastlog_location=$withval
2163 dnl lastlog, [uw]tmpx? detection
2164 dnl NOTE: set the paths in the platform section to avoid the
2165 dnl need for command-line parameters
2166 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2168 dnl lastlog detection
2169 dnl NOTE: the code itself will detect if lastlog is a directory
2170 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2172 #include <sys/types.h>
2174 #ifdef HAVE_LASTLOG_H
2175 # include <lastlog.h>
2184 [ char *lastlog = LASTLOG_FILE; ],
2185 [ AC_MSG_RESULT(yes) ],
2188 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2190 #include <sys/types.h>
2192 #ifdef HAVE_LASTLOG_H
2193 # include <lastlog.h>
2199 [ char *lastlog = _PATH_LASTLOG; ],
2200 [ AC_MSG_RESULT(yes) ],
2203 system_lastlog_path=no
2208 if test -z "$conf_lastlog_location"; then
2209 if test x"$system_lastlog_path" = x"no" ; then
2210 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2211 if (test -d "$f" || test -f "$f") ; then
2212 conf_lastlog_location=$f
2215 if test -z "$conf_lastlog_location"; then
2216 AC_MSG_WARN([** Cannot find lastlog **])
2217 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2222 if test -n "$conf_lastlog_location"; then
2223 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2227 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2229 #include <sys/types.h>
2235 [ char *utmp = UTMP_FILE; ],
2236 [ AC_MSG_RESULT(yes) ],
2238 system_utmp_path=no ]
2240 if test -z "$conf_utmp_location"; then
2241 if test x"$system_utmp_path" = x"no" ; then
2242 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2243 if test -f $f ; then
2244 conf_utmp_location=$f
2247 if test -z "$conf_utmp_location"; then
2248 AC_DEFINE(DISABLE_UTMP)
2252 if test -n "$conf_utmp_location"; then
2253 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2257 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2259 #include <sys/types.h>
2265 [ char *wtmp = WTMP_FILE; ],
2266 [ AC_MSG_RESULT(yes) ],
2268 system_wtmp_path=no ]
2270 if test -z "$conf_wtmp_location"; then
2271 if test x"$system_wtmp_path" = x"no" ; then
2272 for f in /usr/adm/wtmp /var/log/wtmp; do
2273 if test -f $f ; then
2274 conf_wtmp_location=$f
2277 if test -z "$conf_wtmp_location"; then
2278 AC_DEFINE(DISABLE_WTMP)
2282 if test -n "$conf_wtmp_location"; then
2283 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2287 dnl utmpx detection - I don't know any system so perverse as to require
2288 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2290 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2292 #include <sys/types.h>
2301 [ char *utmpx = UTMPX_FILE; ],
2302 [ AC_MSG_RESULT(yes) ],
2304 system_utmpx_path=no ]
2306 if test -z "$conf_utmpx_location"; then
2307 if test x"$system_utmpx_path" = x"no" ; then
2308 AC_DEFINE(DISABLE_UTMPX)
2311 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2315 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2317 #include <sys/types.h>
2326 [ char *wtmpx = WTMPX_FILE; ],
2327 [ AC_MSG_RESULT(yes) ],
2329 system_wtmpx_path=no ]
2331 if test -z "$conf_wtmpx_location"; then
2332 if test x"$system_wtmpx_path" = x"no" ; then
2333 AC_DEFINE(DISABLE_WTMPX)
2336 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2340 if test ! -z "$blibpath" ; then
2341 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2342 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2345 dnl remove pam and dl because they are in $LIBPAM
2346 if test "$PAM_MSG" = yes ; then
2347 LIBS=`echo $LIBS | sed 's/-lpam //'`
2349 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2350 LIBS=`echo $LIBS | sed 's/-ldl //'`
2354 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2357 # Print summary of options
2359 # Someone please show me a better way :)
2360 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2361 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2362 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2363 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2364 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2365 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2366 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2367 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2368 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2369 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2372 echo "OpenSSH has been configured with the following options:"
2373 echo " User binaries: $B"
2374 echo " System binaries: $C"
2375 echo " Configuration files: $D"
2376 echo " Askpass program: $E"
2377 echo " Manual pages: $F"
2378 echo " PID file: $G"
2379 echo " Privilege separation chroot path: $H"
2380 if test "$USES_LOGIN_CONF" = "yes" ; then
2381 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2383 echo " sshd default user PATH: $I"
2385 if test ! -z "$superuser_path" ; then
2386 echo " sshd superuser user PATH: $J"
2388 echo " Manpage format: $MANTYPE"
2389 echo " PAM support: ${PAM_MSG}"
2390 echo " KerberosIV support: $KRB4_MSG"
2391 echo " KerberosV support: $KRB5_MSG"
2392 echo " Smartcard support: $SCARD_MSG"
2393 echo " AFS support: $AFS_MSG"
2394 echo " S/KEY support: $SKEY_MSG"
2395 echo " TCP Wrappers support: $TCPW_MSG"
2396 echo " MD5 password support: $MD5_MSG"
2397 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2398 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2399 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2400 echo " BSD Auth support: $BSD_AUTH_MSG"
2401 echo " Random number source: $RAND_MSG"
2402 if test ! -z "$USE_RAND_HELPER" ; then
2403 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2408 echo " Host: ${host}"
2409 echo " Compiler: ${CC}"
2410 echo " Compiler flags: ${CFLAGS}"
2411 echo "Preprocessor flags: ${CPPFLAGS}"
2412 echo " Linker flags: ${LDFLAGS}"
2413 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2417 if test "x$PAM_MSG" = "xyes" ; then
2418 echo "PAM is enabled. You may need to install a PAM control file "
2419 echo "for sshd, otherwise password authentication may fail. "
2420 echo "Example PAM control files can be found in the contrib/ "
2425 if test ! -z "$NO_SFTP"; then
2426 echo "sftp-server will be disabled. Your compiler does not "
2427 echo "support 64bit integers."
2431 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2432 echo "WARNING: you are using the builtin random number collection "
2433 echo "service. Please read WARNING.RNG and request that your OS "
2434 echo "vendor includes kernel-based random number collection in "
2435 echo "future versions of your OS."