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_CHECK_LIB(s,authenticate,
76 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 AC_DEFINE(BROKEN_REALPATH)
82 dnl AIX handles lastlog as part of its login message
83 AC_DEFINE(DISABLE_LASTLOG)
84 AC_DEFINE(LOGIN_NEEDS_UTMPX)
87 LIBS="$LIBS /usr/lib/textmode.o"
88 AC_DEFINE(HAVE_CYGWIN)
90 AC_DEFINE(DISABLE_SHADOW)
91 AC_DEFINE(IPV4_DEFAULT)
92 AC_DEFINE(IP_TOS_IS_BROKEN)
93 AC_DEFINE(NO_X11_UNIX_SOCKETS)
94 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
95 AC_DEFINE(DISABLE_FD_PASSING)
96 AC_DEFINE(SETGROUPS_NOOP)
99 AC_DEFINE(IP_TOS_IS_BROKEN)
102 AC_DEFINE(BROKEN_GETADDRINFO)
105 if test -z "$GCC"; then
108 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
109 IPADDR_IN_DISPLAY=yes
110 AC_DEFINE(HAVE_SECUREWARE)
112 AC_DEFINE(LOGIN_NO_ENDOPT)
113 AC_DEFINE(LOGIN_NEEDS_UTMPX)
114 AC_DEFINE(DISABLE_SHADOW)
115 AC_DEFINE(DISABLE_UTMP)
116 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
117 LIBS="$LIBS -lxnet -lsec -lsecpw"
118 disable_ptmx_check=yes
121 if test -z "$GCC"; then
124 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
125 IPADDR_IN_DISPLAY=yes
127 AC_DEFINE(LOGIN_NO_ENDOPT)
128 AC_DEFINE(LOGIN_NEEDS_UTMPX)
129 AC_DEFINE(DISABLE_SHADOW)
130 AC_DEFINE(DISABLE_UTMP)
131 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
132 LIBS="$LIBS -lxnet -lsec"
135 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
136 IPADDR_IN_DISPLAY=yes
137 AC_DEFINE(PAM_SUN_CODEBASE)
139 AC_DEFINE(LOGIN_NO_ENDOPT)
140 AC_DEFINE(LOGIN_NEEDS_UTMPX)
141 AC_DEFINE(DISABLE_SHADOW)
142 AC_DEFINE(DISABLE_UTMP)
143 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
144 LIBS="$LIBS -lxnet -lsec"
147 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
149 PATH="$PATH:/usr/etc"
150 AC_DEFINE(BROKEN_INET_NTOA)
151 AC_DEFINE(WITH_ABBREV_NO_TTY)
154 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
156 PATH="$PATH:/usr/etc"
157 AC_DEFINE(WITH_IRIX_ARRAY)
158 AC_DEFINE(WITH_IRIX_PROJECT)
159 AC_DEFINE(WITH_IRIX_AUDIT)
160 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
161 AC_DEFINE(BROKEN_INET_NTOA)
162 AC_DEFINE(WITH_ABBREV_NO_TTY)
166 check_for_libcrypt_later=1
167 AC_DEFINE(DONT_TRY_OTHER_AF)
168 AC_DEFINE(PAM_TTY_KLUDGE)
169 inet6_default_4in6=yes
171 mips-sony-bsd|mips-sony-newsos4)
172 AC_DEFINE(HAVE_NEWS4)
179 check_for_libcrypt_later=1
182 conf_lastlog_location="/usr/adm/lastlog"
183 conf_utmp_location=/etc/utmp
184 conf_wtmp_location=/usr/adm/wtmp
187 AC_DEFINE(BROKEN_REALPATH)
189 AC_DEFINE(BROKEN_SAVED_UIDS)
190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
195 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
197 AC_DEFINE(PAM_SUN_CODEBASE)
198 AC_DEFINE(LOGIN_NEEDS_UTMPX)
199 AC_DEFINE(LOGIN_NEEDS_TERM)
200 AC_DEFINE(PAM_TTY_KLUDGE)
201 # hardwire lastlog location (can't detect it on some versions)
202 conf_lastlog_location="/var/adm/lastlog"
203 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
204 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
205 if test "$sol2ver" -ge 8; then
207 AC_DEFINE(DISABLE_UTMP)
208 AC_DEFINE(DISABLE_WTMP)
214 CPPFLAGS="$CPPFLAGS -DSUNOS4"
215 AC_CHECK_FUNCS(getpwanam)
216 AC_DEFINE(PAM_SUN_CODEBASE)
217 conf_utmp_location=/etc/utmp
218 conf_wtmp_location=/var/adm/wtmp
219 conf_lastlog_location=/var/adm/lastlog
223 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
224 LDFLAGS="$LDFLAGS -L/usr/local/lib"
229 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
230 # /usr/ucblib MUST NOT be searched on ReliantUNIX
231 LDFLAGS="$LDFLAGS -L/usr/local/lib"
232 IPADDR_IN_DISPLAY=yes
234 AC_DEFINE(IP_TOS_IS_BROKEN)
235 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
236 # Attention: always take care to bind libsocket and libnsl before libc,
237 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
240 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
241 LDFLAGS="$LDFLAGS -L/usr/local/lib"
245 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
246 LDFLAGS="$LDFLAGS -L/usr/local/lib"
250 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
251 LDFLAGS="$LDFLAGS -L/usr/local/lib"
254 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
255 LDFLAGS="$LDFLAGS -L/usr/local/lib"
256 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
259 AC_DEFINE(BROKEN_SYS_TERMIO_H)
261 AC_DEFINE(HAVE_SECUREWARE)
262 AC_DEFINE(DISABLE_SHADOW)
263 AC_DEFINE(BROKEN_SAVED_UIDS)
264 AC_CHECK_FUNCS(getluid setluid)
266 do_sco3_extra_lib_check=yes
269 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
270 LDFLAGS="$LDFLAGS -L/usr/local/lib"
271 LIBS="$LIBS -lprot -lx -ltinfo -lm"
274 AC_DEFINE(HAVE_SECUREWARE)
275 AC_DEFINE(DISABLE_SHADOW)
276 AC_DEFINE(DISABLE_FD_PASSING)
277 AC_CHECK_FUNCS(getluid setluid)
284 AC_DEFINE(DISABLE_FD_PASSING)
285 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
286 LIBS="$LIBS -lgen -lrsc"
289 AC_MSG_CHECKING(for Digital Unix SIA)
292 [ --with-osfsia Enable Digital Unix SIA],
294 if test "x$withval" = "xno" ; then
295 AC_MSG_RESULT(disabled)
300 if test -z "$no_osfsia" ; then
301 if test -f /etc/sia/matrix.conf; then
303 AC_DEFINE(HAVE_OSF_SIA)
304 AC_DEFINE(DISABLE_LOGIN)
305 LIBS="$LIBS -lsecurity -ldb -lm -laud"
314 AC_DEFINE(NO_X11_UNIX_SOCKETS)
315 AC_DEFINE(MISSING_NFDBITS)
316 AC_DEFINE(MISSING_HOWMANY)
317 AC_DEFINE(MISSING_FD_MASK)
321 # Allow user to specify flags
323 [ --with-cflags Specify additional flags to pass to compiler],
325 if test "x$withval" != "xno" ; then
326 CFLAGS="$CFLAGS $withval"
330 AC_ARG_WITH(cppflags,
331 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
333 if test "x$withval" != "xno"; then
334 CPPFLAGS="$CPPFLAGS $withval"
339 [ --with-ldflags Specify additional flags to pass to linker],
341 if test "x$withval" != "xno" ; then
342 LDFLAGS="$LDFLAGS $withval"
347 [ --with-libs Specify additional libraries to link with],
349 if test "x$withval" != "xno" ; then
350 LIBS="$LIBS $withval"
355 # Checks for header files.
356 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
357 getopt.h glob.h lastlog.h limits.h login.h \
358 login_cap.h maillock.h netdb.h netgroup.h \
359 netinet/in_systm.h paths.h pty.h readpassphrase.h \
360 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
361 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
362 sys/mman.h sys/select.h sys/stat.h \
363 sys/stropts.h sys/sysmacros.h sys/time.h \
364 sys/un.h time.h ttyent.h usersec.h \
365 util.h utime.h utmp.h utmpx.h)
367 # Checks for libraries.
368 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
369 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
371 dnl SCO OS3 needs this for libwrap
372 if test "x$with_tcp_wrappers" != "xno" ; then
373 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
374 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
378 AC_CHECK_FUNC(getspnam, ,
379 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
382 [ --without-rpath Disable auto-added -R linker paths],
384 if test "x$withval" = "xno" ; then
387 if test "x$withval" = "xyes" ; then
395 [ --with-zlib=PATH Use zlib in PATH],
397 if test "x$withval" = "xno" ; then
398 AC_MSG_ERROR([*** zlib is required ***])
400 if test -d "$withval/lib"; then
401 if test -n "${need_dash_r}"; then
402 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
404 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
407 if test -n "${need_dash_r}"; then
408 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
410 LDFLAGS="-L${withval} ${LDFLAGS}"
413 if test -d "$withval/include"; then
414 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
416 CPPFLAGS="-I${withval} ${CPPFLAGS}"
421 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
424 AC_CHECK_FUNC(strcasecmp,
425 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
427 AC_CHECK_FUNC(utimes,
428 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
429 LIBS="$LIBS -lc89"]) ]
432 dnl Checks for libutil functions
433 AC_CHECK_HEADERS(libutil.h)
434 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
435 AC_CHECK_FUNCS(logout updwtmp logwtmp)
439 # Check for ALTDIRFUNC glob() extension
440 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
441 AC_EGREP_CPP(FOUNDIT,
444 #ifdef GLOB_ALTDIRFUNC
449 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
457 # Check for g.gl_matchc glob() extension
458 AC_MSG_CHECKING(for gl_matchc field in glob_t)
459 AC_EGREP_CPP(FOUNDIT,
462 int main(void){glob_t g; g.gl_matchc = 1;}
465 AC_DEFINE(GLOB_HAS_GL_MATCHC)
473 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
476 #include <sys/types.h>
478 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
480 [AC_MSG_RESULT(yes)],
483 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
487 # Check whether user wants S/Key support
490 [ --with-skey[[=PATH]] Enable S/Key support
491 (optionally in PATH)],
493 if test "x$withval" != "xno" ; then
495 if test "x$withval" != "xyes" ; then
496 CPPFLAGS="$CPPFLAGS -I${withval}/include"
497 LDFLAGS="$LDFLAGS -L${withval}/lib"
504 AC_MSG_CHECKING([for s/key support])
509 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
511 [AC_MSG_RESULT(yes)],
514 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
520 # Check whether user wants TCP wrappers support
522 AC_ARG_WITH(tcp-wrappers,
523 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
524 (optionally in PATH)],
526 if test "x$withval" != "xno" ; then
528 saved_LDFLAGS="$LDFLAGS"
529 saved_CPPFLAGS="$CPPFLAGS"
530 if test -n "${withval}" -a "${withval}" != "yes"; then
531 if test -d "${withval}/lib"; then
532 if test -n "${need_dash_r}"; then
533 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
535 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
538 if test -n "${need_dash_r}"; then
539 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
541 LDFLAGS="-L${withval} ${LDFLAGS}"
544 if test -d "${withval}/include"; then
545 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
547 CPPFLAGS="-I${withval} ${CPPFLAGS}"
551 LIBS="$LIBWRAP $LIBS"
552 AC_MSG_CHECKING(for libwrap)
556 int deny_severity = 0, allow_severity = 0;
566 AC_MSG_ERROR([*** libwrap missing])
574 dnl Checks for library functions.
575 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
576 clock fchmod fchown freeaddrinfo futimes gai_strerror \
577 getaddrinfo getcwd getgrouplist getnameinfo getopt \
578 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
579 inet_ntop innetgr login_getcapbool md5_crypt memmove \
580 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
581 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
582 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
583 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
584 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
585 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
587 if test $ac_cv_func_mmap = yes ; then
588 AC_MSG_CHECKING([for mmap anon shared])
592 #include <sys/types.h>
593 #include <sys/mman.h>
594 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
595 #define MAP_ANON MAP_ANONYMOUS
598 p = (char *) mmap(NULL, 10, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0);
606 AC_DEFINE(HAVE_MMAP_ANON_SHARED)
608 [ AC_MSG_RESULT(no) ]
612 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
613 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
614 AC_CHECK_LIB(gen, dirname,[
615 AC_CACHE_CHECK([for broken dirname],
616 ac_cv_have_broken_dirname, [
624 int main(int argc, char **argv) {
627 strncpy(buf,"/etc", 32);
629 if (!s || strncmp(s, "/", 32) != 0) {
636 [ ac_cv_have_broken_dirname="no" ],
637 [ ac_cv_have_broken_dirname="yes" ]
641 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
643 AC_DEFINE(HAVE_DIRNAME)
644 AC_CHECK_HEADERS(libgen.h)
649 dnl Checks for time functions
650 AC_CHECK_FUNCS(gettimeofday time)
651 dnl Checks for utmp functions
652 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
653 AC_CHECK_FUNCS(utmpname)
654 dnl Checks for utmpx functions
655 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
656 AC_CHECK_FUNCS(setutxent utmpxname)
658 AC_CHECK_FUNC(daemon,
659 [AC_DEFINE(HAVE_DAEMON)],
660 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
663 AC_CHECK_FUNC(getpagesize,
664 [AC_DEFINE(HAVE_GETPAGESIZE)],
665 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
668 # Check for broken snprintf
669 if test "x$ac_cv_func_snprintf" = "xyes" ; then
670 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
674 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
676 [AC_MSG_RESULT(yes)],
679 AC_DEFINE(BROKEN_SNPRINTF)
680 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
690 [ --with-pam Enable PAM support ],
692 if test "x$withval" != "xno" ; then
693 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
694 AC_MSG_ERROR([PAM headers not found])
697 AC_CHECK_LIB(dl, dlopen, , )
698 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
699 AC_CHECK_FUNCS(pam_getenvlist)
705 if test $ac_cv_lib_dl_dlopen = yes; then
715 # Check for older PAM
716 if test "x$PAM_MSG" = "xyes" ; then
717 # Check PAM strerror arguments (old PAM)
718 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
722 #include <security/pam_appl.h>
724 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
727 AC_DEFINE(HAVE_OLD_PAM)
729 PAM_MSG="yes (old library)"
735 saved_CPPFLAGS="$CPPFLAGS"
736 saved_LDFLAGS="$LDFLAGS"
738 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
740 if test "x$withval" != "xno" ; then
741 if test -d "$withval/lib"; then
742 if test -n "${need_dash_r}"; then
743 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
745 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
748 if test -n "${need_dash_r}"; then
749 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
751 LDFLAGS="-L${withval} ${LDFLAGS}"
754 if test -d "$withval/include"; then
755 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
757 CPPFLAGS="-I${withval} ${CPPFLAGS}"
762 LIBS="$LIBS -lcrypto"
763 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
765 dnl Check default openssl install dir
766 if test -n "${need_dash_r}"; then
767 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
769 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
771 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
772 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
774 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
781 # Sanity check OpenSSL headers
782 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
786 #include <openssl/opensslv.h>
787 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
794 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
798 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
799 # version in OpenSSL. Skip this for PAM
800 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
801 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
805 ### Configure cryptographic random number support
807 # Check wheter OpenSSL seeds itself
808 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
812 #include <openssl/rand.h>
813 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
816 OPENSSL_SEEDS_ITSELF=yes
821 # Default to use of the rand helper if OpenSSL doesn't
828 # Do we want to force the use of the rand helper?
829 AC_ARG_WITH(rand-helper,
830 [ --with-rand-helper Use subprocess to gather strong randomness ],
832 if test "x$withval" = "xno" ; then
833 # Force use of OpenSSL's internal RNG, even if
834 # the previous test showed it to be unseeded.
835 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
836 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
837 OPENSSL_SEEDS_ITSELF=yes
846 # Which randomness source do we use?
847 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
849 AC_DEFINE(OPENSSL_PRNG_ONLY)
850 RAND_MSG="OpenSSL internal ONLY"
851 INSTALL_SSH_RAND_HELPER=""
852 elif test ! -z "$USE_RAND_HELPER" ; then
853 # install rand helper
854 RAND_MSG="ssh-rand-helper"
855 INSTALL_SSH_RAND_HELPER="yes"
857 AC_SUBST(INSTALL_SSH_RAND_HELPER)
859 ### Configuration of ssh-rand-helper
862 AC_ARG_WITH(prngd-port,
863 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
872 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
875 if test ! -z "$withval" ; then
876 PRNGD_PORT="$withval"
877 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
882 # PRNGD Unix domain socket
883 AC_ARG_WITH(prngd-socket,
884 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
888 withval="/var/run/egd-pool"
896 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
900 if test ! -z "$withval" ; then
901 if test ! -z "$PRNGD_PORT" ; then
902 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
904 if test ! -r "$withval" ; then
905 AC_MSG_WARN(Entropy socket is not readable)
907 PRNGD_SOCKET="$withval"
908 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
912 # Check for existing socket only if we don't have a random device already
913 if test "$USE_RAND_HELPER" = yes ; then
914 AC_MSG_CHECKING(for PRNGD/EGD socket)
915 # Insert other locations here
916 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
917 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
919 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
923 if test ! -z "$PRNGD_SOCKET" ; then
924 AC_MSG_RESULT($PRNGD_SOCKET)
926 AC_MSG_RESULT(not found)
932 # Change default command timeout for hashing entropy source
934 AC_ARG_WITH(entropy-timeout,
935 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
937 if test "x$withval" != "xno" ; then
938 entropy_timeout=$withval
942 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
944 SSH_PRIVSEP_USER=sshd
945 AC_ARG_WITH(privsep-user,
946 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
948 if test -n "$withval"; then
949 SSH_PRIVSEP_USER=$withval
953 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
954 AC_SUBST(SSH_PRIVSEP_USER)
956 # We do this little dance with the search path to insure
957 # that programs that we select for use by installed programs
958 # (which may be run by the super-user) come from trusted
959 # locations before they come from the user's private area.
960 # This should help avoid accidentally configuring some
961 # random version of a program in someone's personal bin.
965 test -h /bin 2> /dev/null && PATH=/usr/bin
966 test -d /sbin && PATH=$PATH:/sbin
967 test -d /usr/sbin && PATH=$PATH:/usr/sbin
968 PATH=$PATH:/etc:$OPATH
970 # These programs are used by the command hashing source to gather entropy
971 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
972 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
973 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
974 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
975 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
976 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
977 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
978 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
979 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
980 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
981 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
982 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
983 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
984 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
985 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
986 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
990 # Where does ssh-rand-helper get its randomness from?
991 INSTALL_SSH_PRNG_CMDS=""
992 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
993 if test ! -z "$PRNGD_PORT" ; then
994 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
995 elif test ! -z "$PRNGD_SOCKET" ; then
996 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
998 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
999 RAND_HELPER_CMDHASH=yes
1000 INSTALL_SSH_PRNG_CMDS="yes"
1003 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1006 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1007 if test ! -z "$SONY" ; then
1008 LIBS="$LIBS -liberty";
1011 # Checks for data types
1012 AC_CHECK_SIZEOF(char, 1)
1013 AC_CHECK_SIZEOF(short int, 2)
1014 AC_CHECK_SIZEOF(int, 4)
1015 AC_CHECK_SIZEOF(long int, 4)
1016 AC_CHECK_SIZEOF(long long int, 8)
1018 # Sanity check long long for some platforms (AIX)
1019 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1020 ac_cv_sizeof_long_long_int=0
1023 # More checks for data types
1024 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1026 [ #include <sys/types.h> ],
1028 [ ac_cv_have_u_int="yes" ],
1029 [ ac_cv_have_u_int="no" ]
1032 if test "x$ac_cv_have_u_int" = "xyes" ; then
1033 AC_DEFINE(HAVE_U_INT)
1037 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1039 [ #include <sys/types.h> ],
1040 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1041 [ ac_cv_have_intxx_t="yes" ],
1042 [ ac_cv_have_intxx_t="no" ]
1045 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1046 AC_DEFINE(HAVE_INTXX_T)
1050 if (test -z "$have_intxx_t" && \
1051 test "x$ac_cv_header_stdint_h" = "xyes")
1053 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1055 [ #include <stdint.h> ],
1056 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1058 AC_DEFINE(HAVE_INTXX_T)
1061 [ AC_MSG_RESULT(no) ]
1065 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1067 [ #include <sys/types.h> ],
1068 [ int64_t a; a = 1;],
1069 [ ac_cv_have_int64_t="yes" ],
1070 [ ac_cv_have_int64_t="no" ]
1073 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1074 AC_DEFINE(HAVE_INT64_T)
1078 if test -z "$have_int64_t" ; then
1079 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1081 [ #include <sys/socket.h> ],
1082 [ int64_t a; a = 1],
1084 AC_DEFINE(HAVE_INT64_T)
1087 [ AC_MSG_RESULT(no) ]
1091 if test -z "$have_int64_t" ; then
1092 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1094 [ #include <sys/bitypes.h> ],
1095 [ int64_t a; a = 1],
1097 AC_DEFINE(HAVE_INT64_T)
1100 [ AC_MSG_RESULT(no) ]
1104 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1106 [ #include <sys/types.h> ],
1107 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1108 [ ac_cv_have_u_intxx_t="yes" ],
1109 [ ac_cv_have_u_intxx_t="no" ]
1112 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1113 AC_DEFINE(HAVE_U_INTXX_T)
1117 if test -z "$have_u_intxx_t" ; then
1118 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1120 [ #include <sys/socket.h> ],
1121 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1123 AC_DEFINE(HAVE_U_INTXX_T)
1126 [ AC_MSG_RESULT(no) ]
1130 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1132 [ #include <sys/types.h> ],
1133 [ u_int64_t a; a = 1;],
1134 [ ac_cv_have_u_int64_t="yes" ],
1135 [ ac_cv_have_u_int64_t="no" ]
1138 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1139 AC_DEFINE(HAVE_U_INT64_T)
1143 if test -z "$have_u_int64_t" ; then
1144 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1146 [ #include <sys/bitypes.h> ],
1147 [ u_int64_t a; a = 1],
1149 AC_DEFINE(HAVE_U_INT64_T)
1152 [ AC_MSG_RESULT(no) ]
1156 if test -z "$have_u_intxx_t" ; then
1157 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1160 #include <sys/types.h>
1162 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1163 [ ac_cv_have_uintxx_t="yes" ],
1164 [ ac_cv_have_uintxx_t="no" ]
1167 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1168 AC_DEFINE(HAVE_UINTXX_T)
1172 if test -z "$have_uintxx_t" ; then
1173 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1175 [ #include <stdint.h> ],
1176 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1178 AC_DEFINE(HAVE_UINTXX_T)
1181 [ AC_MSG_RESULT(no) ]
1185 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1186 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1188 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1191 #include <sys/bitypes.h>
1194 int8_t a; int16_t b; int32_t c;
1195 u_int8_t e; u_int16_t f; u_int32_t g;
1196 a = b = c = e = f = g = 1;
1199 AC_DEFINE(HAVE_U_INTXX_T)
1200 AC_DEFINE(HAVE_INTXX_T)
1208 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1211 #include <sys/types.h>
1213 [ u_char foo; foo = 125; ],
1214 [ ac_cv_have_u_char="yes" ],
1215 [ ac_cv_have_u_char="no" ]
1218 if test "x$ac_cv_have_u_char" = "xyes" ; then
1219 AC_DEFINE(HAVE_U_CHAR)
1224 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1226 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1229 #include <sys/types.h>
1231 [ size_t foo; foo = 1235; ],
1232 [ ac_cv_have_size_t="yes" ],
1233 [ ac_cv_have_size_t="no" ]
1236 if test "x$ac_cv_have_size_t" = "xyes" ; then
1237 AC_DEFINE(HAVE_SIZE_T)
1240 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1243 #include <sys/types.h>
1245 [ ssize_t foo; foo = 1235; ],
1246 [ ac_cv_have_ssize_t="yes" ],
1247 [ ac_cv_have_ssize_t="no" ]
1250 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1251 AC_DEFINE(HAVE_SSIZE_T)
1254 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1259 [ clock_t foo; foo = 1235; ],
1260 [ ac_cv_have_clock_t="yes" ],
1261 [ ac_cv_have_clock_t="no" ]
1264 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1265 AC_DEFINE(HAVE_CLOCK_T)
1268 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1271 #include <sys/types.h>
1272 #include <sys/socket.h>
1274 [ sa_family_t foo; foo = 1235; ],
1275 [ ac_cv_have_sa_family_t="yes" ],
1278 #include <sys/types.h>
1279 #include <sys/socket.h>
1280 #include <netinet/in.h>
1282 [ sa_family_t foo; foo = 1235; ],
1283 [ ac_cv_have_sa_family_t="yes" ],
1285 [ ac_cv_have_sa_family_t="no" ]
1289 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1290 AC_DEFINE(HAVE_SA_FAMILY_T)
1293 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1296 #include <sys/types.h>
1298 [ pid_t foo; foo = 1235; ],
1299 [ ac_cv_have_pid_t="yes" ],
1300 [ ac_cv_have_pid_t="no" ]
1303 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1304 AC_DEFINE(HAVE_PID_T)
1307 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1310 #include <sys/types.h>
1312 [ mode_t foo; foo = 1235; ],
1313 [ ac_cv_have_mode_t="yes" ],
1314 [ ac_cv_have_mode_t="no" ]
1317 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1318 AC_DEFINE(HAVE_MODE_T)
1322 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1325 #include <sys/types.h>
1326 #include <sys/socket.h>
1328 [ struct sockaddr_storage s; ],
1329 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1330 [ ac_cv_have_struct_sockaddr_storage="no" ]
1333 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1334 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1337 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1340 #include <sys/types.h>
1341 #include <netinet/in.h>
1343 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1344 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1345 [ ac_cv_have_struct_sockaddr_in6="no" ]
1348 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1349 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1352 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1355 #include <sys/types.h>
1356 #include <netinet/in.h>
1358 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1359 [ ac_cv_have_struct_in6_addr="yes" ],
1360 [ ac_cv_have_struct_in6_addr="no" ]
1363 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1364 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1367 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1370 #include <sys/types.h>
1371 #include <sys/socket.h>
1374 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1375 [ ac_cv_have_struct_addrinfo="yes" ],
1376 [ ac_cv_have_struct_addrinfo="no" ]
1379 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1380 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1383 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1385 [ #include <sys/time.h> ],
1386 [ struct timeval tv; tv.tv_sec = 1;],
1387 [ ac_cv_have_struct_timeval="yes" ],
1388 [ ac_cv_have_struct_timeval="no" ]
1391 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1392 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1393 have_struct_timeval=1
1396 # If we don't have int64_t then we can't compile sftp-server. So don't
1397 # even attempt to do it.
1398 if test "x$ac_cv_have_int64_t" = "xno" -a \
1399 "x$ac_cv_sizeof_long_int" != "x8" -a \
1400 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1403 dnl test snprintf (broken on SCO w/gcc)
1408 #ifdef HAVE_SNPRINTF
1412 char expected_out[50];
1414 #if (SIZEOF_LONG_INT == 8)
1415 long int num = 0x7fffffffffffffff;
1417 long long num = 0x7fffffffffffffffll;
1419 strcpy(expected_out, "9223372036854775807");
1420 snprintf(buf, mazsize, "%lld", num);
1421 if(strcmp(buf, expected_out) != 0)
1428 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1433 dnl Checks for structure members
1434 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1435 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1436 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1437 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1438 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1439 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1440 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1441 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1442 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1443 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1444 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1445 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1446 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1447 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1448 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1449 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1450 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1452 AC_CHECK_MEMBERS([struct stat.st_blksize])
1454 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1455 ac_cv_have_ss_family_in_struct_ss, [
1458 #include <sys/types.h>
1459 #include <sys/socket.h>
1461 [ struct sockaddr_storage s; s.ss_family = 1; ],
1462 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1463 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1466 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1467 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1470 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1471 ac_cv_have___ss_family_in_struct_ss, [
1474 #include <sys/types.h>
1475 #include <sys/socket.h>
1477 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1478 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1479 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1482 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1483 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1486 AC_CACHE_CHECK([for pw_class field in struct passwd],
1487 ac_cv_have_pw_class_in_struct_passwd, [
1492 [ struct passwd p; p.pw_class = 0; ],
1493 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1494 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1497 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1498 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1501 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1502 ac_cv_have_pw_expire_in_struct_passwd, [
1507 [ struct passwd p; p.pw_expire = 0; ],
1508 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1509 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1512 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1513 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1516 AC_CACHE_CHECK([for pw_change field in struct passwd],
1517 ac_cv_have_pw_change_in_struct_passwd, [
1522 [ struct passwd p; p.pw_change = 0; ],
1523 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1524 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1527 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1528 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1531 dnl make sure we're using the real structure members and not defines
1532 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1533 ac_cv_have_accrights_in_msghdr, [
1536 #include <sys/types.h>
1537 #include <sys/socket.h>
1538 #include <sys/uio.h>
1540 #ifdef msg_accrights
1544 m.msg_accrights = 0;
1548 [ ac_cv_have_accrights_in_msghdr="yes" ],
1549 [ ac_cv_have_accrights_in_msghdr="no" ]
1552 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1553 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1556 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1557 ac_cv_have_control_in_msghdr, [
1560 #include <sys/types.h>
1561 #include <sys/socket.h>
1562 #include <sys/uio.h>
1572 [ ac_cv_have_control_in_msghdr="yes" ],
1573 [ ac_cv_have_control_in_msghdr="no" ]
1576 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1577 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1580 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1582 [ extern char *__progname; printf("%s", __progname); ],
1583 [ ac_cv_libc_defines___progname="yes" ],
1584 [ ac_cv_libc_defines___progname="no" ]
1587 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1588 AC_DEFINE(HAVE___PROGNAME)
1591 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1595 [ printf("%s", __FUNCTION__); ],
1596 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1597 [ ac_cv_cc_implements___FUNCTION__="no" ]
1600 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1601 AC_DEFINE(HAVE___FUNCTION__)
1604 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1608 [ printf("%s", __func__); ],
1609 [ ac_cv_cc_implements___func__="yes" ],
1610 [ ac_cv_cc_implements___func__="no" ]
1613 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1614 AC_DEFINE(HAVE___func__)
1617 AC_CACHE_CHECK([whether getopt has optreset support],
1618 ac_cv_have_getopt_optreset, [
1623 [ extern int optreset; optreset = 0; ],
1624 [ ac_cv_have_getopt_optreset="yes" ],
1625 [ ac_cv_have_getopt_optreset="no" ]
1628 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1629 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1632 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1634 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1635 [ ac_cv_libc_defines_sys_errlist="yes" ],
1636 [ ac_cv_libc_defines_sys_errlist="no" ]
1639 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1640 AC_DEFINE(HAVE_SYS_ERRLIST)
1644 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1646 [ extern int sys_nerr; printf("%i", sys_nerr);],
1647 [ ac_cv_libc_defines_sys_nerr="yes" ],
1648 [ ac_cv_libc_defines_sys_nerr="no" ]
1651 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1652 AC_DEFINE(HAVE_SYS_NERR)
1657 # Check whether user wants sectok support
1659 [ --with-sectok Enable smartcard support using libsectok],
1661 if test "x$withval" != "xno" ; then
1662 if test "x$withval" != "xyes" ; then
1663 CPPFLAGS="$CPPFLAGS -I${withval}"
1664 LDFLAGS="$LDFLAGS -L${withval}"
1665 if test ! -z "$need_dash_r" ; then
1666 LDFLAGS="$LDFLAGS -R${withval}"
1668 if test ! -z "$blibpath" ; then
1669 blibpath="$blibpath:${withval}"
1672 AC_CHECK_HEADERS(sectok.h)
1673 if test "$ac_cv_header_sectok_h" != yes; then
1674 AC_MSG_ERROR(Can't find sectok.h)
1676 AC_CHECK_LIB(sectok, sectok_open)
1677 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1678 AC_MSG_ERROR(Can't find libsectok)
1680 AC_DEFINE(SMARTCARD)
1681 AC_DEFINE(USE_SECTOK)
1682 SCARD_MSG="yes, using sectok"
1687 # Check whether user wants OpenSC support
1689 AC_HELP_STRING([--with-opensc=PFX],
1690 [Enable smartcard support using OpenSC]),
1691 opensc_config_prefix="$withval", opensc_config_prefix="")
1692 if test x$opensc_config_prefix != x ; then
1693 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1694 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1695 if test "$OPENSC_CONFIG" != "no"; then
1696 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1697 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1698 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1699 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1700 AC_DEFINE(SMARTCARD)
1701 AC_DEFINE(USE_OPENSC)
1702 SCARD_MSG="yes, using OpenSC"
1706 # Check whether user wants Kerberos 5 support
1708 AC_ARG_WITH(kerberos5,
1709 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1711 if test "x$withval" != "xno" ; then
1712 if test "x$withval" = "xyes" ; then
1713 KRB5ROOT="/usr/local"
1717 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1718 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1721 AC_MSG_CHECKING(whether we are using Heimdal)
1722 AC_TRY_COMPILE([ #include <krb5.h> ],
1723 [ char *tmp = heimdal_version; ],
1724 [ AC_MSG_RESULT(yes)
1726 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1729 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1732 if test ! -z "$need_dash_r" ; then
1733 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1735 if test ! -z "$blibpath" ; then
1736 blibpath="$blibpath:${KRB5ROOT}/lib"
1738 AC_CHECK_LIB(resolv, dn_expand, , )
1744 # Check whether user wants Kerberos 4 support
1746 AC_ARG_WITH(kerberos4,
1747 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1749 if test "x$withval" != "xno" ; then
1750 if test "x$withval" != "xyes" ; then
1751 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1752 LDFLAGS="$LDFLAGS -L${withval}/lib"
1753 if test ! -z "$need_dash_r" ; then
1754 LDFLAGS="$LDFLAGS -R${withval}/lib"
1756 if test ! -z "$blibpath" ; then
1757 blibpath="$blibpath:${withval}/lib"
1760 if test -d /usr/include/kerberosIV ; then
1761 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1765 AC_CHECK_HEADERS(krb.h)
1766 if test "$ac_cv_header_krb_h" != yes; then
1767 AC_MSG_WARN([Cannot find krb.h, build may fail])
1769 AC_CHECK_LIB(krb, main)
1770 if test "$ac_cv_lib_krb_main" != yes; then
1771 AC_CHECK_LIB(krb4, main)
1772 if test "$ac_cv_lib_krb4_main" != yes; then
1773 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1780 AC_CHECK_LIB(des, des_cbc_encrypt)
1781 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1782 AC_CHECK_LIB(des425, des_cbc_encrypt)
1783 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1784 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1791 AC_CHECK_LIB(resolv, dn_expand, , )
1799 # Check whether user wants AFS support
1802 [ --with-afs=PATH Enable AFS support],
1804 if test "x$withval" != "xno" ; then
1806 if test "x$withval" != "xyes" ; then
1807 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1808 LDFLAGS="$LDFLAGS -L${withval}/lib"
1811 if test -z "$KRB4" ; then
1812 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1816 if test ! -z "$AFS_LIBS" ; then
1817 LIBS="$LIBS $AFS_LIBS"
1824 LIBS="$LIBS $KLIBS $K5LIBS"
1826 # Looking for programs, paths and files
1828 PRIVSEP_PATH=/var/empty
1829 AC_ARG_WITH(privsep-path,
1830 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1832 if test "x$withval" != "$no" ; then
1833 PRIVSEP_PATH=$withval
1837 AC_SUBST(PRIVSEP_PATH)
1840 [ --with-xauth=PATH Specify path to xauth program ],
1842 if test "x$withval" != "xno" ; then
1847 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1848 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1849 xauth_path="/usr/openwin/bin/xauth"
1854 if test -z "$xauth_path" ; then
1855 XAUTH_PATH="undefined"
1856 AC_SUBST(XAUTH_PATH)
1858 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1859 XAUTH_PATH=$xauth_path
1860 AC_SUBST(XAUTH_PATH)
1863 # Check for mail directory (last resort if we cannot get it from headers)
1864 if test ! -z "$MAIL" ; then
1865 maildir=`dirname $MAIL`
1866 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1869 if test -z "$no_dev_ptmx" ; then
1870 if test "x$disable_ptmx_check" != "xyes" ; then
1871 AC_CHECK_FILE("/dev/ptmx",
1873 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1879 AC_CHECK_FILE("/dev/ptc",
1881 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1886 # Options from here on. Some of these are preset by platform above
1887 AC_ARG_WITH(mantype,
1888 [ --with-mantype=man|cat|doc Set man page type],
1895 AC_MSG_ERROR(invalid man type: $withval)
1900 if test -z "$MANTYPE"; then
1901 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1902 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1904 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1911 if test "$MANTYPE" = "doc"; then
1918 # Check whether to enable MD5 passwords
1920 AC_ARG_WITH(md5-passwords,
1921 [ --with-md5-passwords Enable use of MD5 passwords],
1923 if test "x$withval" != "xno" ; then
1924 AC_DEFINE(HAVE_MD5_PASSWORDS)
1930 # Whether to disable shadow password support
1932 [ --without-shadow Disable shadow password support],
1934 if test "x$withval" = "xno" ; then
1935 AC_DEFINE(DISABLE_SHADOW)
1941 if test -z "$disable_shadow" ; then
1942 AC_MSG_CHECKING([if the systems has expire shadow information])
1945 #include <sys/types.h>
1948 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1949 [ sp_expire_available=yes ], []
1952 if test "x$sp_expire_available" = "xyes" ; then
1954 AC_DEFINE(HAS_SHADOW_EXPIRE)
1960 # Use ip address instead of hostname in $DISPLAY
1961 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1962 DISPLAY_HACK_MSG="yes"
1963 AC_DEFINE(IPADDR_IN_DISPLAY)
1965 DISPLAY_HACK_MSG="no"
1966 AC_ARG_WITH(ipaddr-display,
1967 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1969 if test "x$withval" != "xno" ; then
1970 AC_DEFINE(IPADDR_IN_DISPLAY)
1971 DISPLAY_HACK_MSG="yes"
1977 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1978 if test $ac_cv_func_login_getcapbool = "yes" -a \
1979 $ac_cv_header_login_cap_h = "yes" ; then
1982 # Whether to mess with the default path
1983 SERVER_PATH_MSG="(default)"
1984 AC_ARG_WITH(default-path,
1985 [ --with-default-path= Specify default \$PATH environment for server],
1987 if test "$USES_LOGIN_CONF" = "yes" ; then
1989 --with-default-path=PATH has no effect on this system.
1990 Edit /etc/login.conf instead.])
1991 elif test "x$withval" != "xno" ; then
1992 user_path="$withval"
1993 SERVER_PATH_MSG="$withval"
1996 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1997 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2001 /* find out what STDPATH is */
2006 #ifndef _PATH_STDPATH
2007 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2009 #include <sys/types.h>
2010 #include <sys/stat.h>
2012 #define DATA "conftest.stdpath"
2019 fd = fopen(DATA,"w");
2023 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2028 ], [ user_path=`cat conftest.stdpath` ],
2029 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2030 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2032 # make sure $bindir is in USER_PATH so scp will work
2033 t_bindir=`eval echo ${bindir}`
2035 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2038 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2040 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2041 if test $? -ne 0 ; then
2042 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2043 if test $? -ne 0 ; then
2044 user_path=$user_path:$t_bindir
2045 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2050 if test "$USES_LOGIN_CONF" != "yes" ; then
2051 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2055 # Set superuser path separately to user path
2056 AC_ARG_WITH(superuser-path,
2057 [ --with-superuser-path= Specify different path for super-user],
2059 if test "x$withval" != "xno" ; then
2060 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2061 superuser_path=$withval
2067 # Whether to force IPv4 by default (needed on broken glibc Linux)
2069 AC_ARG_WITH(ipv4-default,
2070 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2072 if test "x$withval" != "xno" ; then
2073 AC_DEFINE(IPV4_DEFAULT)
2079 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2080 IPV4_IN6_HACK_MSG="no"
2082 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2084 if test "x$withval" != "xno" ; then
2086 AC_DEFINE(IPV4_IN_IPV6)
2087 IPV4_IN6_HACK_MSG="yes"
2092 if test "x$inet6_default_4in6" = "xyes"; then
2093 AC_MSG_RESULT([yes (default)])
2094 AC_DEFINE(IPV4_IN_IPV6)
2095 IPV4_IN6_HACK_MSG="yes"
2097 AC_MSG_RESULT([no (default)])
2102 # Whether to enable BSD auth support
2104 AC_ARG_WITH(bsd-auth,
2105 [ --with-bsd-auth Enable BSD auth support],
2107 if test "x$withval" != "xno" ; then
2114 # Where to place sshd.pid
2116 # make sure the directory exists
2117 if test ! -d $piddir ; then
2118 piddir=`eval echo ${sysconfdir}`
2120 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2124 AC_ARG_WITH(pid-dir,
2125 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2127 if test "x$withval" != "xno" ; then
2129 if test ! -d $piddir ; then
2130 AC_MSG_WARN([** no $piddir directory on this system **])
2136 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2139 dnl allow user to disable some login recording features
2140 AC_ARG_ENABLE(lastlog,
2141 [ --disable-lastlog disable use of lastlog even if detected [no]],
2142 [ AC_DEFINE(DISABLE_LASTLOG) ]
2145 [ --disable-utmp disable use of utmp even if detected [no]],
2146 [ AC_DEFINE(DISABLE_UTMP) ]
2148 AC_ARG_ENABLE(utmpx,
2149 [ --disable-utmpx disable use of utmpx even if detected [no]],
2150 [ AC_DEFINE(DISABLE_UTMPX) ]
2153 [ --disable-wtmp disable use of wtmp even if detected [no]],
2154 [ AC_DEFINE(DISABLE_WTMP) ]
2156 AC_ARG_ENABLE(wtmpx,
2157 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2158 [ AC_DEFINE(DISABLE_WTMPX) ]
2160 AC_ARG_ENABLE(libutil,
2161 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2162 [ AC_DEFINE(DISABLE_LOGIN) ]
2164 AC_ARG_ENABLE(pututline,
2165 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2166 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2168 AC_ARG_ENABLE(pututxline,
2169 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2170 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2172 AC_ARG_WITH(lastlog,
2173 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2175 if test "x$withval" = "xno" ; then
2176 AC_DEFINE(DISABLE_LASTLOG)
2178 conf_lastlog_location=$withval
2183 dnl lastlog, [uw]tmpx? detection
2184 dnl NOTE: set the paths in the platform section to avoid the
2185 dnl need for command-line parameters
2186 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2188 dnl lastlog detection
2189 dnl NOTE: the code itself will detect if lastlog is a directory
2190 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2192 #include <sys/types.h>
2194 #ifdef HAVE_LASTLOG_H
2195 # include <lastlog.h>
2204 [ char *lastlog = LASTLOG_FILE; ],
2205 [ AC_MSG_RESULT(yes) ],
2208 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2210 #include <sys/types.h>
2212 #ifdef HAVE_LASTLOG_H
2213 # include <lastlog.h>
2219 [ char *lastlog = _PATH_LASTLOG; ],
2220 [ AC_MSG_RESULT(yes) ],
2223 system_lastlog_path=no
2228 if test -z "$conf_lastlog_location"; then
2229 if test x"$system_lastlog_path" = x"no" ; then
2230 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2231 if (test -d "$f" || test -f "$f") ; then
2232 conf_lastlog_location=$f
2235 if test -z "$conf_lastlog_location"; then
2236 AC_MSG_WARN([** Cannot find lastlog **])
2237 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2242 if test -n "$conf_lastlog_location"; then
2243 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2247 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2249 #include <sys/types.h>
2255 [ char *utmp = UTMP_FILE; ],
2256 [ AC_MSG_RESULT(yes) ],
2258 system_utmp_path=no ]
2260 if test -z "$conf_utmp_location"; then
2261 if test x"$system_utmp_path" = x"no" ; then
2262 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2263 if test -f $f ; then
2264 conf_utmp_location=$f
2267 if test -z "$conf_utmp_location"; then
2268 AC_DEFINE(DISABLE_UTMP)
2272 if test -n "$conf_utmp_location"; then
2273 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2277 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2279 #include <sys/types.h>
2285 [ char *wtmp = WTMP_FILE; ],
2286 [ AC_MSG_RESULT(yes) ],
2288 system_wtmp_path=no ]
2290 if test -z "$conf_wtmp_location"; then
2291 if test x"$system_wtmp_path" = x"no" ; then
2292 for f in /usr/adm/wtmp /var/log/wtmp; do
2293 if test -f $f ; then
2294 conf_wtmp_location=$f
2297 if test -z "$conf_wtmp_location"; then
2298 AC_DEFINE(DISABLE_WTMP)
2302 if test -n "$conf_wtmp_location"; then
2303 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2307 dnl utmpx detection - I don't know any system so perverse as to require
2308 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2310 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2312 #include <sys/types.h>
2321 [ char *utmpx = UTMPX_FILE; ],
2322 [ AC_MSG_RESULT(yes) ],
2324 system_utmpx_path=no ]
2326 if test -z "$conf_utmpx_location"; then
2327 if test x"$system_utmpx_path" = x"no" ; then
2328 AC_DEFINE(DISABLE_UTMPX)
2331 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2335 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2337 #include <sys/types.h>
2346 [ char *wtmpx = WTMPX_FILE; ],
2347 [ AC_MSG_RESULT(yes) ],
2349 system_wtmpx_path=no ]
2351 if test -z "$conf_wtmpx_location"; then
2352 if test x"$system_wtmpx_path" = x"no" ; then
2353 AC_DEFINE(DISABLE_WTMPX)
2356 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2360 if test ! -z "$blibpath" ; then
2361 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2362 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2365 dnl remove pam and dl because they are in $LIBPAM
2366 if test "$PAM_MSG" = yes ; then
2367 LIBS=`echo $LIBS | sed 's/-lpam //'`
2369 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2370 LIBS=`echo $LIBS | sed 's/-ldl //'`
2374 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2377 # Print summary of options
2379 # Someone please show me a better way :)
2380 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2381 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2382 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2383 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2384 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2385 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2386 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2387 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2388 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2389 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2392 echo "OpenSSH has been configured with the following options:"
2393 echo " User binaries: $B"
2394 echo " System binaries: $C"
2395 echo " Configuration files: $D"
2396 echo " Askpass program: $E"
2397 echo " Manual pages: $F"
2398 echo " PID file: $G"
2399 echo " Privilege separation chroot path: $H"
2400 if test "$USES_LOGIN_CONF" = "yes" ; then
2401 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2403 echo " sshd default user PATH: $I"
2405 if test ! -z "$superuser_path" ; then
2406 echo " sshd superuser user PATH: $J"
2408 echo " Manpage format: $MANTYPE"
2409 echo " PAM support: ${PAM_MSG}"
2410 echo " KerberosIV support: $KRB4_MSG"
2411 echo " KerberosV support: $KRB5_MSG"
2412 echo " Smartcard support: $SCARD_MSG"
2413 echo " AFS support: $AFS_MSG"
2414 echo " S/KEY support: $SKEY_MSG"
2415 echo " TCP Wrappers support: $TCPW_MSG"
2416 echo " MD5 password support: $MD5_MSG"
2417 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2418 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2419 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2420 echo " BSD Auth support: $BSD_AUTH_MSG"
2421 echo " Random number source: $RAND_MSG"
2422 if test ! -z "$USE_RAND_HELPER" ; then
2423 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2428 echo " Host: ${host}"
2429 echo " Compiler: ${CC}"
2430 echo " Compiler flags: ${CFLAGS}"
2431 echo "Preprocessor flags: ${CPPFLAGS}"
2432 echo " Linker flags: ${LDFLAGS}"
2433 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2437 if test "x$PAM_MSG" = "xyes" ; then
2438 echo "PAM is enabled. You may need to install a PAM control file "
2439 echo "for sshd, otherwise password authentication may fail. "
2440 echo "Example PAM control files can be found in the contrib/ "
2445 if test ! -z "$NO_SFTP"; then
2446 echo "sftp-server will be disabled. Your compiler does not "
2447 echo "support 64bit integers."
2451 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2452 echo "WARNING: you are using the builtin random number collection "
2453 echo "service. Please read WARNING.RNG and request that your OS "
2454 echo "vendor includes kernel-based random number collection in "
2455 echo "future versions of your OS."