4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(ENT, ent)
20 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
21 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
75 AC_DEFINE(BROKEN_GETADDRINFO)
76 AC_DEFINE(BROKEN_REALPATH)
77 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
79 AC_DEFINE(LOGIN_NEEDS_UTMPX)
82 LIBS="$LIBS /usr/lib/textmode.o"
83 AC_DEFINE(HAVE_CYGWIN)
85 AC_DEFINE(DISABLE_SHADOW)
86 AC_DEFINE(IPV4_DEFAULT)
87 AC_DEFINE(IP_TOS_IS_BROKEN)
88 AC_DEFINE(NO_X11_UNIX_SOCKETS)
89 AC_DEFINE(BROKEN_FD_PASSING)
90 AC_DEFINE(SETGROUPS_NOOP)
93 AC_DEFINE(IP_TOS_IS_BROKEN)
96 AC_DEFINE(BROKEN_GETADDRINFO)
99 if test -z "$GCC"; then
102 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
103 IPADDR_IN_DISPLAY=yes
104 AC_DEFINE(HAVE_SECUREWARE)
106 AC_DEFINE(LOGIN_NO_ENDOPT)
107 AC_DEFINE(LOGIN_NEEDS_UTMPX)
108 AC_DEFINE(DISABLE_SHADOW)
109 AC_DEFINE(DISABLE_UTMP)
110 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
111 LIBS="$LIBS -lxnet -lsec -lsecpw"
112 disable_ptmx_check=yes
115 if test -z "$GCC"; then
118 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
119 IPADDR_IN_DISPLAY=yes
121 AC_DEFINE(LOGIN_NO_ENDOPT)
122 AC_DEFINE(LOGIN_NEEDS_UTMPX)
123 AC_DEFINE(DISABLE_SHADOW)
124 AC_DEFINE(DISABLE_UTMP)
125 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
126 LIBS="$LIBS -lxnet -lsec"
129 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
130 IPADDR_IN_DISPLAY=yes
131 AC_DEFINE(PAM_SUN_CODEBASE)
133 AC_DEFINE(LOGIN_NO_ENDOPT)
134 AC_DEFINE(LOGIN_NEEDS_UTMPX)
135 AC_DEFINE(DISABLE_SHADOW)
136 AC_DEFINE(DISABLE_UTMP)
137 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
138 LIBS="$LIBS -lxnet -lsec"
141 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
143 PATH="$PATH:/usr/etc"
144 AC_DEFINE(BROKEN_INET_NTOA)
145 AC_DEFINE(WITH_ABBREV_NO_TTY)
148 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
150 PATH="$PATH:/usr/etc"
151 AC_DEFINE(WITH_IRIX_ARRAY)
152 AC_DEFINE(WITH_IRIX_PROJECT)
153 AC_DEFINE(WITH_IRIX_AUDIT)
154 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
155 AC_DEFINE(BROKEN_INET_NTOA)
156 AC_DEFINE(WITH_ABBREV_NO_TTY)
160 check_for_libcrypt_later=1
161 AC_DEFINE(DONT_TRY_OTHER_AF)
162 AC_DEFINE(PAM_TTY_KLUDGE)
163 inet6_default_4in6=yes
165 mips-sony-bsd|mips-sony-newsos4)
166 AC_DEFINE(HAVE_NEWS4)
173 check_for_libcrypt_later=1
176 conf_lastlog_location="/usr/adm/lastlog"
177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/usr/adm/wtmp
181 AC_DEFINE(BROKEN_REALPATH)
183 AC_DEFINE(BROKEN_SAVED_UIDS)
184 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
189 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
191 AC_DEFINE(PAM_SUN_CODEBASE)
192 AC_DEFINE(LOGIN_NEEDS_UTMPX)
193 AC_DEFINE(LOGIN_NEEDS_TERM)
194 AC_DEFINE(PAM_TTY_KLUDGE)
195 # hardwire lastlog location (can't detect it on some versions)
196 conf_lastlog_location="/var/adm/lastlog"
197 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
198 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
199 if test "$sol2ver" -ge 8; then
201 AC_DEFINE(DISABLE_UTMP)
202 AC_DEFINE(DISABLE_WTMP)
208 CPPFLAGS="$CPPFLAGS -DSUNOS4"
209 AC_CHECK_FUNCS(getpwanam)
210 AC_DEFINE(PAM_SUN_CODEBASE)
211 conf_utmp_location=/etc/utmp
212 conf_wtmp_location=/var/adm/wtmp
213 conf_lastlog_location=/var/adm/lastlog
217 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
218 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
224 # /usr/ucblib MUST NOT be searched on ReliantUNIX
225 LDFLAGS="$LDFLAGS -L/usr/local/lib"
226 IPADDR_IN_DISPLAY=yes
228 AC_DEFINE(IP_TOS_IS_BROKEN)
229 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
230 # Attention: always take care to bind libsocket and libnsl before libc,
231 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
234 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
235 LDFLAGS="$LDFLAGS -L/usr/local/lib"
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"
248 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
249 LDFLAGS="$LDFLAGS -L/usr/local/lib"
250 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
253 AC_DEFINE(BROKEN_SYS_TERMIO_H)
255 AC_DEFINE(HAVE_SECUREWARE)
256 AC_DEFINE(DISABLE_SHADOW)
257 AC_DEFINE(BROKEN_SAVED_UIDS)
258 AC_CHECK_FUNCS(getluid setluid)
260 do_sco3_extra_lib_check=yes
263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
265 LIBS="$LIBS -lprot -lx -ltinfo -lm"
268 AC_DEFINE(HAVE_SECUREWARE)
269 AC_DEFINE(DISABLE_SHADOW)
270 AC_DEFINE(BROKEN_FD_PASSING)
271 AC_CHECK_FUNCS(getluid setluid)
278 AC_DEFINE(BROKEN_FD_PASSING)
279 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
280 LIBS="$LIBS -lgen -lrsc"
283 AC_MSG_CHECKING(for Digital Unix SIA)
286 [ --with-osfsia Enable Digital Unix SIA],
288 if test "x$withval" = "xno" ; then
289 AC_MSG_RESULT(disabled)
294 if test -z "$no_osfsia" ; then
295 if test -f /etc/sia/matrix.conf; then
297 AC_DEFINE(HAVE_OSF_SIA)
298 AC_DEFINE(DISABLE_LOGIN)
299 LIBS="$LIBS -lsecurity -ldb -lm -laud"
308 AC_DEFINE(NO_X11_UNIX_SOCKETS)
309 AC_DEFINE(MISSING_NFDBITS)
310 AC_DEFINE(MISSING_HOWMANY)
311 AC_DEFINE(MISSING_FD_MASK)
315 # Allow user to specify flags
317 [ --with-cflags Specify additional flags to pass to compiler],
319 if test "x$withval" != "xno" ; then
320 CFLAGS="$CFLAGS $withval"
324 AC_ARG_WITH(cppflags,
325 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
327 if test "x$withval" != "xno"; then
328 CPPFLAGS="$CPPFLAGS $withval"
333 [ --with-ldflags Specify additional flags to pass to linker],
335 if test "x$withval" != "xno" ; then
336 LDFLAGS="$LDFLAGS $withval"
341 [ --with-libs Specify additional libraries to link with],
343 if test "x$withval" != "xno" ; then
344 LIBS="$LIBS $withval"
349 # Checks for header files.
350 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
351 getopt.h glob.h lastlog.h limits.h login.h \
352 login_cap.h maillock.h netdb.h netgroup.h \
353 netinet/in_systm.h paths.h pty.h readpassphrase.h \
354 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
355 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
356 sys/mman.h sys/select.h sys/stat.h \
357 sys/stropts.h sys/sysmacros.h sys/time.h \
358 sys/un.h time.h ttyent.h usersec.h \
359 util.h utime.h utmp.h utmpx.h)
361 # Checks for libraries.
362 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
363 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
365 dnl SCO OS3 needs this for libwrap
366 if test "x$with_tcp_wrappers" != "xno" ; then
367 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
368 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
372 AC_CHECK_FUNC(getspnam, ,
373 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
376 [ --without-rpath Disable auto-added -R linker paths],
378 if test "x$withval" = "xno" ; then
381 if test "x$withval" = "xyes" ; then
389 [ --with-zlib=PATH Use zlib in PATH],
391 if test "x$withval" = "xno" ; then
392 AC_MSG_ERROR([*** zlib is required ***])
394 if test -d "$withval/lib"; then
395 if test -n "${need_dash_r}"; then
396 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
398 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
401 if test -n "${need_dash_r}"; then
402 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
404 LDFLAGS="-L${withval} ${LDFLAGS}"
407 if test -d "$withval/include"; then
408 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
410 CPPFLAGS="-I${withval} ${CPPFLAGS}"
415 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
418 AC_CHECK_FUNC(strcasecmp,
419 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
421 AC_CHECK_FUNC(utimes,
422 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
425 dnl Checks for libutil functions
426 AC_CHECK_HEADERS(libutil.h)
427 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
428 AC_CHECK_FUNCS(logout updwtmp logwtmp)
432 # Check for ALTDIRFUNC glob() extension
433 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
434 AC_EGREP_CPP(FOUNDIT,
437 #ifdef GLOB_ALTDIRFUNC
442 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
450 # Check for g.gl_matchc glob() extension
451 AC_MSG_CHECKING(for gl_matchc field in glob_t)
452 AC_EGREP_CPP(FOUNDIT,
455 int main(void){glob_t g; g.gl_matchc = 1;}
458 AC_DEFINE(GLOB_HAS_GL_MATCHC)
466 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
469 #include <sys/types.h>
471 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
473 [AC_MSG_RESULT(yes)],
476 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
480 # Check whether user wants S/Key support
483 [ --with-skey[[=PATH]] Enable S/Key support
484 (optionally in PATH)],
486 if test "x$withval" != "xno" ; then
488 if test "x$withval" != "xyes" ; then
489 CPPFLAGS="$CPPFLAGS -I${withval}/include"
490 LDFLAGS="$LDFLAGS -L${withval}/lib"
497 AC_MSG_CHECKING([for s/key support])
502 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
504 [AC_MSG_RESULT(yes)],
507 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
513 # Check whether user wants TCP wrappers support
515 AC_ARG_WITH(tcp-wrappers,
516 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
517 (optionally in PATH)],
519 if test "x$withval" != "xno" ; then
521 saved_LDFLAGS="$LDFLAGS"
522 saved_CPPFLAGS="$CPPFLAGS"
523 if test -n "${withval}" -a "${withval}" != "yes"; then
524 if test -d "${withval}/lib"; then
525 if test -n "${need_dash_r}"; then
526 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
528 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
531 if test -n "${need_dash_r}"; then
532 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
534 LDFLAGS="-L${withval} ${LDFLAGS}"
537 if test -d "${withval}/include"; then
538 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
540 CPPFLAGS="-I${withval} ${CPPFLAGS}"
544 LIBS="$LIBWRAP $LIBS"
545 AC_MSG_CHECKING(for libwrap)
549 int deny_severity = 0, allow_severity = 0;
559 AC_MSG_ERROR([*** libwrap missing])
567 dnl Checks for library functions.
568 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
569 clock fchmod fchown freeaddrinfo futimes gai_strerror \
570 getaddrinfo getcwd getgrouplist getnameinfo getopt \
571 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
572 inet_ntop innetgr login_getcapbool md5_crypt memmove \
573 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
574 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
575 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
576 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
577 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
578 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
580 if test $ac_cv_func_mmap = yes ; then
581 AC_MSG_CHECKING([for mmap anon shared])
585 #include <sys/types.h>
586 #include <sys/mman.h>
587 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
588 #define MAP_ANON MAP_ANONYMOUS
591 p = (char *) mmap(NULL, 10, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0);
599 AC_DEFINE(HAVE_MMAP_ANON_SHARED)
601 [ AC_MSG_RESULT(no) ]
605 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
606 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
607 AC_CHECK_LIB(gen, dirname,[
608 AC_CACHE_CHECK([for broken dirname],
609 ac_cv_have_broken_dirname, [
617 int main(int argc, char **argv) {
620 strncpy(buf,"/etc", 32);
622 if (!s || strncmp(s, "/", 32) != 0) {
629 [ ac_cv_have_broken_dirname="no" ],
630 [ ac_cv_have_broken_dirname="yes" ]
634 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
636 AC_DEFINE(HAVE_DIRNAME)
637 AC_CHECK_HEADERS(libgen.h)
642 dnl Checks for time functions
643 AC_CHECK_FUNCS(gettimeofday time)
644 dnl Checks for utmp functions
645 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
646 AC_CHECK_FUNCS(utmpname)
647 dnl Checks for utmpx functions
648 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
649 AC_CHECK_FUNCS(setutxent utmpxname)
651 AC_CHECK_FUNC(daemon,
652 [AC_DEFINE(HAVE_DAEMON)],
653 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
656 AC_CHECK_FUNC(getpagesize,
657 [AC_DEFINE(HAVE_GETPAGESIZE)],
658 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
661 # Check for broken snprintf
662 if test "x$ac_cv_func_snprintf" = "xyes" ; then
663 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
667 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
669 [AC_MSG_RESULT(yes)],
672 AC_DEFINE(BROKEN_SNPRINTF)
673 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
683 [ --with-pam Enable PAM support ],
685 if test "x$withval" != "xno" ; then
686 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
687 AC_MSG_ERROR([PAM headers not found])
690 AC_CHECK_LIB(dl, dlopen, , )
691 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
692 AC_CHECK_FUNCS(pam_getenvlist)
698 if test $ac_cv_lib_dl_dlopen = yes; then
708 # Check for older PAM
709 if test "x$PAM_MSG" = "xyes" ; then
710 # Check PAM strerror arguments (old PAM)
711 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
715 #include <security/pam_appl.h>
717 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
720 AC_DEFINE(HAVE_OLD_PAM)
722 PAM_MSG="yes (old library)"
728 saved_CPPFLAGS="$CPPFLAGS"
729 saved_LDFLAGS="$LDFLAGS"
731 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
733 if test "x$withval" != "xno" ; then
734 if test -d "$withval/lib"; then
735 if test -n "${need_dash_r}"; then
736 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
738 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
741 if test -n "${need_dash_r}"; then
742 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
744 LDFLAGS="-L${withval} ${LDFLAGS}"
747 if test -d "$withval/include"; then
748 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
750 CPPFLAGS="-I${withval} ${CPPFLAGS}"
755 LIBS="$LIBS -lcrypto"
756 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
758 dnl Check default openssl install dir
759 if test -n "${need_dash_r}"; then
760 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
762 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
764 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
765 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
767 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
774 # Sanity check OpenSSL headers
775 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
779 #include <openssl/opensslv.h>
780 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
787 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
791 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
792 # version in OpenSSL. Skip this for PAM
793 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
794 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
798 ### Configure cryptographic random number support
800 # Check wheter OpenSSL seeds itself
801 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
805 #include <openssl/rand.h>
806 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
809 OPENSSL_SEEDS_ITSELF=yes
814 # Default to use of the rand helper if OpenSSL doesn't
821 # Do we want to force the use of the rand helper?
822 AC_ARG_WITH(rand-helper,
823 [ --with-rand-helper Use subprocess to gather strong randomness ],
825 if test "x$withval" = "xno" ; then
826 # Force use of OpenSSL's internal RNG, even if
827 # the previous test showed it to be unseeded.
828 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
829 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
830 OPENSSL_SEEDS_ITSELF=yes
839 # Which randomness source do we use?
840 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
842 AC_DEFINE(OPENSSL_PRNG_ONLY)
843 RAND_MSG="OpenSSL internal ONLY"
844 INSTALL_SSH_RAND_HELPER=""
845 elif test ! -z "$USE_RAND_HELPER" ; then
846 # install rand helper
847 RAND_MSG="ssh-rand-helper"
848 INSTALL_SSH_RAND_HELPER="yes"
850 AC_SUBST(INSTALL_SSH_RAND_HELPER)
852 ### Configuration of ssh-rand-helper
855 AC_ARG_WITH(prngd-port,
856 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
865 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
868 if test ! -z "$withval" ; then
869 PRNGD_PORT="$withval"
870 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
875 # PRNGD Unix domain socket
876 AC_ARG_WITH(prngd-socket,
877 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
881 withval="/var/run/egd-pool"
889 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
893 if test ! -z "$withval" ; then
894 if test ! -z "$PRNGD_PORT" ; then
895 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
897 if test ! -r "$withval" ; then
898 AC_MSG_WARN(Entropy socket is not readable)
900 PRNGD_SOCKET="$withval"
901 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
905 # Check for existing socket only if we don't have a random device already
906 if test "$USE_RAND_HELPER" = yes ; then
907 AC_MSG_CHECKING(for PRNGD/EGD socket)
908 # Insert other locations here
909 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
910 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
912 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
916 if test ! -z "$PRNGD_SOCKET" ; then
917 AC_MSG_RESULT($PRNGD_SOCKET)
919 AC_MSG_RESULT(not found)
925 # Change default command timeout for hashing entropy source
927 AC_ARG_WITH(entropy-timeout,
928 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
930 if test "x$withval" != "xno" ; then
931 entropy_timeout=$withval
935 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
937 SSH_PRIVSEP_USER=sshd
938 AC_ARG_WITH(privsep-user,
939 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
941 if test -n "$withval"; then
942 SSH_PRIVSEP_USER=$withval
946 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
947 AC_SUBST(SSH_PRIVSEP_USER)
949 # We do this little dance with the search path to insure
950 # that programs that we select for use by installed programs
951 # (which may be run by the super-user) come from trusted
952 # locations before they come from the user's private area.
953 # This should help avoid accidentally configuring some
954 # random version of a program in someone's personal bin.
958 test -h /bin 2> /dev/null && PATH=/usr/bin
959 test -d /sbin && PATH=$PATH:/sbin
960 test -d /usr/sbin && PATH=$PATH:/usr/sbin
961 PATH=$PATH:/etc:$OPATH
963 # These programs are used by the command hashing source to gather entropy
964 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
965 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
966 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
967 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
968 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
969 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
970 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
971 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
972 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
973 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
974 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
975 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
976 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
977 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
978 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
979 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
983 # Where does ssh-rand-helper get its randomness from?
984 INSTALL_SSH_PRNG_CMDS=""
985 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
986 if test ! -z "$PRNGD_PORT" ; then
987 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
988 elif test ! -z "$PRNGD_SOCKET" ; then
989 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
991 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
992 RAND_HELPER_CMDHASH=yes
993 INSTALL_SSH_PRNG_CMDS="yes"
996 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
999 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1000 if test ! -z "$SONY" ; then
1001 LIBS="$LIBS -liberty";
1004 # Checks for data types
1005 AC_CHECK_SIZEOF(char, 1)
1006 AC_CHECK_SIZEOF(short int, 2)
1007 AC_CHECK_SIZEOF(int, 4)
1008 AC_CHECK_SIZEOF(long int, 4)
1009 AC_CHECK_SIZEOF(long long int, 8)
1011 # Sanity check long long for some platforms (AIX)
1012 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1013 ac_cv_sizeof_long_long_int=0
1016 # More checks for data types
1017 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1019 [ #include <sys/types.h> ],
1021 [ ac_cv_have_u_int="yes" ],
1022 [ ac_cv_have_u_int="no" ]
1025 if test "x$ac_cv_have_u_int" = "xyes" ; then
1026 AC_DEFINE(HAVE_U_INT)
1030 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1032 [ #include <sys/types.h> ],
1033 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1034 [ ac_cv_have_intxx_t="yes" ],
1035 [ ac_cv_have_intxx_t="no" ]
1038 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1039 AC_DEFINE(HAVE_INTXX_T)
1043 if (test -z "$have_intxx_t" && \
1044 test "x$ac_cv_header_stdint_h" = "xyes")
1046 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1048 [ #include <stdint.h> ],
1049 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1051 AC_DEFINE(HAVE_INTXX_T)
1054 [ AC_MSG_RESULT(no) ]
1058 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1060 [ #include <sys/types.h> ],
1061 [ int64_t a; a = 1;],
1062 [ ac_cv_have_int64_t="yes" ],
1063 [ ac_cv_have_int64_t="no" ]
1066 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1067 AC_DEFINE(HAVE_INT64_T)
1071 if test -z "$have_int64_t" ; then
1072 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1074 [ #include <sys/socket.h> ],
1075 [ int64_t a; a = 1],
1077 AC_DEFINE(HAVE_INT64_T)
1080 [ AC_MSG_RESULT(no) ]
1084 if test -z "$have_int64_t" ; then
1085 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1087 [ #include <sys/bitypes.h> ],
1088 [ int64_t a; a = 1],
1090 AC_DEFINE(HAVE_INT64_T)
1093 [ AC_MSG_RESULT(no) ]
1097 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1099 [ #include <sys/types.h> ],
1100 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1101 [ ac_cv_have_u_intxx_t="yes" ],
1102 [ ac_cv_have_u_intxx_t="no" ]
1105 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1106 AC_DEFINE(HAVE_U_INTXX_T)
1110 if test -z "$have_u_intxx_t" ; then
1111 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1113 [ #include <sys/socket.h> ],
1114 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1116 AC_DEFINE(HAVE_U_INTXX_T)
1119 [ AC_MSG_RESULT(no) ]
1123 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1125 [ #include <sys/types.h> ],
1126 [ u_int64_t a; a = 1;],
1127 [ ac_cv_have_u_int64_t="yes" ],
1128 [ ac_cv_have_u_int64_t="no" ]
1131 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1132 AC_DEFINE(HAVE_U_INT64_T)
1136 if test -z "$have_u_int64_t" ; then
1137 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1139 [ #include <sys/bitypes.h> ],
1140 [ u_int64_t a; a = 1],
1142 AC_DEFINE(HAVE_U_INT64_T)
1145 [ AC_MSG_RESULT(no) ]
1149 if test -z "$have_u_intxx_t" ; then
1150 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1153 #include <sys/types.h>
1155 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1156 [ ac_cv_have_uintxx_t="yes" ],
1157 [ ac_cv_have_uintxx_t="no" ]
1160 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1161 AC_DEFINE(HAVE_UINTXX_T)
1165 if test -z "$have_uintxx_t" ; then
1166 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1168 [ #include <stdint.h> ],
1169 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1171 AC_DEFINE(HAVE_UINTXX_T)
1174 [ AC_MSG_RESULT(no) ]
1178 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1179 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1181 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1184 #include <sys/bitypes.h>
1187 int8_t a; int16_t b; int32_t c;
1188 u_int8_t e; u_int16_t f; u_int32_t g;
1189 a = b = c = e = f = g = 1;
1192 AC_DEFINE(HAVE_U_INTXX_T)
1193 AC_DEFINE(HAVE_INTXX_T)
1201 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1204 #include <sys/types.h>
1206 [ u_char foo; foo = 125; ],
1207 [ ac_cv_have_u_char="yes" ],
1208 [ ac_cv_have_u_char="no" ]
1211 if test "x$ac_cv_have_u_char" = "xyes" ; then
1212 AC_DEFINE(HAVE_U_CHAR)
1217 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1219 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1222 #include <sys/types.h>
1224 [ size_t foo; foo = 1235; ],
1225 [ ac_cv_have_size_t="yes" ],
1226 [ ac_cv_have_size_t="no" ]
1229 if test "x$ac_cv_have_size_t" = "xyes" ; then
1230 AC_DEFINE(HAVE_SIZE_T)
1233 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1236 #include <sys/types.h>
1238 [ ssize_t foo; foo = 1235; ],
1239 [ ac_cv_have_ssize_t="yes" ],
1240 [ ac_cv_have_ssize_t="no" ]
1243 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1244 AC_DEFINE(HAVE_SSIZE_T)
1247 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1252 [ clock_t foo; foo = 1235; ],
1253 [ ac_cv_have_clock_t="yes" ],
1254 [ ac_cv_have_clock_t="no" ]
1257 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1258 AC_DEFINE(HAVE_CLOCK_T)
1261 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1264 #include <sys/types.h>
1265 #include <sys/socket.h>
1267 [ sa_family_t foo; foo = 1235; ],
1268 [ ac_cv_have_sa_family_t="yes" ],
1271 #include <sys/types.h>
1272 #include <sys/socket.h>
1273 #include <netinet/in.h>
1275 [ sa_family_t foo; foo = 1235; ],
1276 [ ac_cv_have_sa_family_t="yes" ],
1278 [ ac_cv_have_sa_family_t="no" ]
1282 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1283 AC_DEFINE(HAVE_SA_FAMILY_T)
1286 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1289 #include <sys/types.h>
1291 [ pid_t foo; foo = 1235; ],
1292 [ ac_cv_have_pid_t="yes" ],
1293 [ ac_cv_have_pid_t="no" ]
1296 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1297 AC_DEFINE(HAVE_PID_T)
1300 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1303 #include <sys/types.h>
1305 [ mode_t foo; foo = 1235; ],
1306 [ ac_cv_have_mode_t="yes" ],
1307 [ ac_cv_have_mode_t="no" ]
1310 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1311 AC_DEFINE(HAVE_MODE_T)
1315 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1318 #include <sys/types.h>
1319 #include <sys/socket.h>
1321 [ struct sockaddr_storage s; ],
1322 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1323 [ ac_cv_have_struct_sockaddr_storage="no" ]
1326 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1327 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1330 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1333 #include <sys/types.h>
1334 #include <netinet/in.h>
1336 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1337 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1338 [ ac_cv_have_struct_sockaddr_in6="no" ]
1341 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1342 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1345 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1348 #include <sys/types.h>
1349 #include <netinet/in.h>
1351 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1352 [ ac_cv_have_struct_in6_addr="yes" ],
1353 [ ac_cv_have_struct_in6_addr="no" ]
1356 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1357 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1360 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1363 #include <sys/types.h>
1364 #include <sys/socket.h>
1367 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1368 [ ac_cv_have_struct_addrinfo="yes" ],
1369 [ ac_cv_have_struct_addrinfo="no" ]
1372 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1373 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1376 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1378 [ #include <sys/time.h> ],
1379 [ struct timeval tv; tv.tv_sec = 1;],
1380 [ ac_cv_have_struct_timeval="yes" ],
1381 [ ac_cv_have_struct_timeval="no" ]
1384 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1385 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1386 have_struct_timeval=1
1389 # If we don't have int64_t then we can't compile sftp-server. So don't
1390 # even attempt to do it.
1391 if test "x$ac_cv_have_int64_t" = "xno" -a \
1392 "x$ac_cv_sizeof_long_int" != "x8" -a \
1393 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1396 dnl test snprintf (broken on SCO w/gcc)
1401 #ifdef HAVE_SNPRINTF
1405 char expected_out[50];
1407 #if (SIZEOF_LONG_INT == 8)
1408 long int num = 0x7fffffffffffffff;
1410 long long num = 0x7fffffffffffffffll;
1412 strcpy(expected_out, "9223372036854775807");
1413 snprintf(buf, mazsize, "%lld", num);
1414 if(strcmp(buf, expected_out) != 0)
1421 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1426 dnl Checks for structure members
1427 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1428 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1429 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1430 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1431 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1432 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1433 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1434 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1435 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1436 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1437 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1438 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1439 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1440 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1441 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1442 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1443 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1445 AC_CHECK_MEMBERS([struct stat.st_blksize])
1447 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1448 ac_cv_have_ss_family_in_struct_ss, [
1451 #include <sys/types.h>
1452 #include <sys/socket.h>
1454 [ struct sockaddr_storage s; s.ss_family = 1; ],
1455 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1456 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1459 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1460 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1463 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1464 ac_cv_have___ss_family_in_struct_ss, [
1467 #include <sys/types.h>
1468 #include <sys/socket.h>
1470 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1471 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1472 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1475 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1476 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1479 AC_CACHE_CHECK([for pw_class field in struct passwd],
1480 ac_cv_have_pw_class_in_struct_passwd, [
1485 [ struct passwd p; p.pw_class = 0; ],
1486 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1487 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1490 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1491 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1494 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1495 ac_cv_have_pw_expire_in_struct_passwd, [
1500 [ struct passwd p; p.pw_expire = 0; ],
1501 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1502 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1505 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1506 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1509 AC_CACHE_CHECK([for pw_change field in struct passwd],
1510 ac_cv_have_pw_change_in_struct_passwd, [
1515 [ struct passwd p; p.pw_change = 0; ],
1516 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1517 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1520 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1521 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1524 dnl make sure we're using the real structure members and not defines
1525 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1526 ac_cv_have_accrights_in_msghdr, [
1529 #include <sys/types.h>
1530 #include <sys/socket.h>
1531 #include <sys/uio.h>
1533 #ifdef msg_accrights
1537 m.msg_accrights = 0;
1541 [ ac_cv_have_accrights_in_msghdr="yes" ],
1542 [ ac_cv_have_accrights_in_msghdr="no" ]
1545 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1546 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1549 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1550 ac_cv_have_control_in_msghdr, [
1553 #include <sys/types.h>
1554 #include <sys/socket.h>
1555 #include <sys/uio.h>
1565 [ ac_cv_have_control_in_msghdr="yes" ],
1566 [ ac_cv_have_control_in_msghdr="no" ]
1569 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1570 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1573 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1575 [ extern char *__progname; printf("%s", __progname); ],
1576 [ ac_cv_libc_defines___progname="yes" ],
1577 [ ac_cv_libc_defines___progname="no" ]
1580 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1581 AC_DEFINE(HAVE___PROGNAME)
1584 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1588 [ printf("%s", __FUNCTION__); ],
1589 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1590 [ ac_cv_cc_implements___FUNCTION__="no" ]
1593 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1594 AC_DEFINE(HAVE___FUNCTION__)
1597 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1601 [ printf("%s", __func__); ],
1602 [ ac_cv_cc_implements___func__="yes" ],
1603 [ ac_cv_cc_implements___func__="no" ]
1606 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1607 AC_DEFINE(HAVE___func__)
1610 AC_CACHE_CHECK([whether getopt has optreset support],
1611 ac_cv_have_getopt_optreset, [
1616 [ extern int optreset; optreset = 0; ],
1617 [ ac_cv_have_getopt_optreset="yes" ],
1618 [ ac_cv_have_getopt_optreset="no" ]
1621 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1622 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1625 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1627 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1628 [ ac_cv_libc_defines_sys_errlist="yes" ],
1629 [ ac_cv_libc_defines_sys_errlist="no" ]
1632 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1633 AC_DEFINE(HAVE_SYS_ERRLIST)
1637 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1639 [ extern int sys_nerr; printf("%i", sys_nerr);],
1640 [ ac_cv_libc_defines_sys_nerr="yes" ],
1641 [ ac_cv_libc_defines_sys_nerr="no" ]
1644 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1645 AC_DEFINE(HAVE_SYS_NERR)
1650 # Check whether user wants sectok support
1652 [ --with-sectok Enable smartcard support using libsectok],
1654 if test "x$withval" != "xno" ; then
1655 if test "x$withval" != "xyes" ; then
1656 CPPFLAGS="$CPPFLAGS -I${withval}"
1657 LDFLAGS="$LDFLAGS -L${withval}"
1658 if test ! -z "$need_dash_r" ; then
1659 LDFLAGS="$LDFLAGS -R${withval}"
1661 if test ! -z "$blibpath" ; then
1662 blibpath="$blibpath:${withval}"
1665 AC_CHECK_HEADERS(sectok.h)
1666 if test "$ac_cv_header_sectok_h" != yes; then
1667 AC_MSG_ERROR(Can't find sectok.h)
1669 AC_CHECK_LIB(sectok, sectok_open)
1670 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1671 AC_MSG_ERROR(Can't find libsectok)
1673 AC_DEFINE(SMARTCARD)
1674 AC_DEFINE(USE_SECTOK)
1675 SCARD_MSG="yes, using sectok"
1680 # Check whether user wants OpenSC support
1682 AC_HELP_STRING([--with-opensc=PFX],
1683 [Enable smartcard support using OpenSC]),
1684 opensc_config_prefix="$withval", opensc_config_prefix="")
1685 if test x$opensc_config_prefix != x ; then
1686 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1687 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1688 if test "$OPENSC_CONFIG" != "no"; then
1689 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1690 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1691 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1692 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1693 AC_DEFINE(SMARTCARD)
1694 AC_DEFINE(USE_OPENSC)
1695 SCARD_MSG="yes, using OpenSC"
1699 # Check whether user wants Kerberos 5 support
1701 AC_ARG_WITH(kerberos5,
1702 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1704 if test "x$withval" != "xno" ; then
1705 if test "x$withval" = "xyes" ; then
1706 KRB5ROOT="/usr/local"
1710 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1711 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1714 AC_MSG_CHECKING(whether we are using Heimdal)
1715 AC_TRY_COMPILE([ #include <krb5.h> ],
1716 [ char *tmp = heimdal_version; ],
1717 [ AC_MSG_RESULT(yes)
1719 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1722 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1725 if test ! -z "$need_dash_r" ; then
1726 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1728 if test ! -z "$blibpath" ; then
1729 blibpath="$blibpath:${KRB5ROOT}/lib"
1731 AC_CHECK_LIB(resolv, dn_expand, , )
1737 # Check whether user wants Kerberos 4 support
1739 AC_ARG_WITH(kerberos4,
1740 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1742 if test "x$withval" != "xno" ; then
1743 if test "x$withval" != "xyes" ; then
1744 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1745 LDFLAGS="$LDFLAGS -L${withval}/lib"
1746 if test ! -z "$need_dash_r" ; then
1747 LDFLAGS="$LDFLAGS -R${withval}/lib"
1749 if test ! -z "$blibpath" ; then
1750 blibpath="$blibpath:${withval}/lib"
1753 if test -d /usr/include/kerberosIV ; then
1754 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1758 AC_CHECK_HEADERS(krb.h)
1759 if test "$ac_cv_header_krb_h" != yes; then
1760 AC_MSG_WARN([Cannot find krb.h, build may fail])
1762 AC_CHECK_LIB(krb, main)
1763 if test "$ac_cv_lib_krb_main" != yes; then
1764 AC_CHECK_LIB(krb4, main)
1765 if test "$ac_cv_lib_krb4_main" != yes; then
1766 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1773 AC_CHECK_LIB(des, des_cbc_encrypt)
1774 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1775 AC_CHECK_LIB(des425, des_cbc_encrypt)
1776 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1777 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1784 AC_CHECK_LIB(resolv, dn_expand, , )
1792 # Check whether user wants AFS support
1795 [ --with-afs=PATH Enable AFS support],
1797 if test "x$withval" != "xno" ; then
1799 if test "x$withval" != "xyes" ; then
1800 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1801 LDFLAGS="$LDFLAGS -L${withval}/lib"
1804 if test -z "$KRB4" ; then
1805 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1809 if test ! -z "$AFS_LIBS" ; then
1810 LIBS="$LIBS $AFS_LIBS"
1817 LIBS="$LIBS $KLIBS $K5LIBS"
1819 # Looking for programs, paths and files
1821 PRIVSEP_PATH=/var/empty
1822 AC_ARG_WITH(privsep-path,
1823 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1825 if test "x$withval" != "$no" ; then
1826 PRIVSEP_PATH=$withval
1830 AC_SUBST(PRIVSEP_PATH)
1833 [ --with-xauth=PATH Specify path to xauth program ],
1835 if test "x$withval" != "xno" ; then
1840 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1841 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1842 xauth_path="/usr/openwin/bin/xauth"
1847 if test -z "$xauth_path" ; then
1848 XAUTH_PATH="undefined"
1849 AC_SUBST(XAUTH_PATH)
1851 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1852 XAUTH_PATH=$xauth_path
1853 AC_SUBST(XAUTH_PATH)
1856 # Check for mail directory (last resort if we cannot get it from headers)
1857 if test ! -z "$MAIL" ; then
1858 maildir=`dirname $MAIL`
1859 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1862 if test -z "$no_dev_ptmx" ; then
1863 if test "x$disable_ptmx_check" != "xyes" ; then
1864 AC_CHECK_FILE("/dev/ptmx",
1866 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1872 AC_CHECK_FILE("/dev/ptc",
1874 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1879 # Options from here on. Some of these are preset by platform above
1880 AC_ARG_WITH(mantype,
1881 [ --with-mantype=man|cat|doc Set man page type],
1888 AC_MSG_ERROR(invalid man type: $withval)
1893 if test -z "$MANTYPE"; then
1894 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1895 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1897 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1904 if test "$MANTYPE" = "doc"; then
1911 # Check whether to enable MD5 passwords
1913 AC_ARG_WITH(md5-passwords,
1914 [ --with-md5-passwords Enable use of MD5 passwords],
1916 if test "x$withval" != "xno" ; then
1917 AC_DEFINE(HAVE_MD5_PASSWORDS)
1923 # Whether to disable shadow password support
1925 [ --without-shadow Disable shadow password support],
1927 if test "x$withval" = "xno" ; then
1928 AC_DEFINE(DISABLE_SHADOW)
1934 if test -z "$disable_shadow" ; then
1935 AC_MSG_CHECKING([if the systems has expire shadow information])
1938 #include <sys/types.h>
1941 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1942 [ sp_expire_available=yes ], []
1945 if test "x$sp_expire_available" = "xyes" ; then
1947 AC_DEFINE(HAS_SHADOW_EXPIRE)
1953 # Use ip address instead of hostname in $DISPLAY
1954 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1955 DISPLAY_HACK_MSG="yes"
1956 AC_DEFINE(IPADDR_IN_DISPLAY)
1958 DISPLAY_HACK_MSG="no"
1959 AC_ARG_WITH(ipaddr-display,
1960 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1962 if test "x$withval" != "xno" ; then
1963 AC_DEFINE(IPADDR_IN_DISPLAY)
1964 DISPLAY_HACK_MSG="yes"
1970 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1971 if test $ac_cv_func_login_getcapbool = "yes" -a \
1972 $ac_cv_header_login_cap_h = "yes" ; then
1975 # Whether to mess with the default path
1976 SERVER_PATH_MSG="(default)"
1977 AC_ARG_WITH(default-path,
1978 [ --with-default-path= Specify default \$PATH environment for server],
1980 if test "$USES_LOGIN_CONF" = "yes" ; then
1982 --with-default-path=PATH has no effect on this system.
1983 Edit /etc/login.conf instead.])
1984 elif test "x$withval" != "xno" ; then
1985 user_path="$withval"
1986 SERVER_PATH_MSG="$withval"
1989 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1990 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
1994 /* find out what STDPATH is */
1999 #ifndef _PATH_STDPATH
2000 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2002 #include <sys/types.h>
2003 #include <sys/stat.h>
2005 #define DATA "conftest.stdpath"
2012 fd = fopen(DATA,"w");
2016 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2021 ], [ user_path=`cat conftest.stdpath` ],
2022 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2023 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2025 # make sure $bindir is in USER_PATH so scp will work
2026 t_bindir=`eval echo ${bindir}`
2028 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2031 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2033 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2034 if test $? -ne 0 ; then
2035 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2036 if test $? -ne 0 ; then
2037 user_path=$user_path:$t_bindir
2038 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2043 if test "$USES_LOGIN_CONF" != "yes" ; then
2044 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2048 # Set superuser path separately to user path
2049 AC_ARG_WITH(superuser-path,
2050 [ --with-superuser-path= Specify different path for super-user],
2052 if test "x$withval" != "xno" ; then
2053 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2054 superuser_path=$withval
2060 # Whether to force IPv4 by default (needed on broken glibc Linux)
2062 AC_ARG_WITH(ipv4-default,
2063 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2065 if test "x$withval" != "xno" ; then
2066 AC_DEFINE(IPV4_DEFAULT)
2072 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2073 IPV4_IN6_HACK_MSG="no"
2075 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2077 if test "x$withval" != "xno" ; then
2079 AC_DEFINE(IPV4_IN_IPV6)
2080 IPV4_IN6_HACK_MSG="yes"
2085 if test "x$inet6_default_4in6" = "xyes"; then
2086 AC_MSG_RESULT([yes (default)])
2087 AC_DEFINE(IPV4_IN_IPV6)
2088 IPV4_IN6_HACK_MSG="yes"
2090 AC_MSG_RESULT([no (default)])
2095 # Whether to enable BSD auth support
2097 AC_ARG_WITH(bsd-auth,
2098 [ --with-bsd-auth Enable BSD auth support],
2100 if test "x$withval" != "xno" ; then
2107 # Where to place sshd.pid
2109 # make sure the directory exists
2110 if test ! -d $piddir ; then
2111 piddir=`eval echo ${sysconfdir}`
2113 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2117 AC_ARG_WITH(pid-dir,
2118 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2120 if test "x$withval" != "xno" ; then
2122 if test ! -d $piddir ; then
2123 AC_MSG_WARN([** no $piddir directory on this system **])
2129 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2132 dnl allow user to disable some login recording features
2133 AC_ARG_ENABLE(lastlog,
2134 [ --disable-lastlog disable use of lastlog even if detected [no]],
2135 [ AC_DEFINE(DISABLE_LASTLOG) ]
2138 [ --disable-utmp disable use of utmp even if detected [no]],
2139 [ AC_DEFINE(DISABLE_UTMP) ]
2141 AC_ARG_ENABLE(utmpx,
2142 [ --disable-utmpx disable use of utmpx even if detected [no]],
2143 [ AC_DEFINE(DISABLE_UTMPX) ]
2146 [ --disable-wtmp disable use of wtmp even if detected [no]],
2147 [ AC_DEFINE(DISABLE_WTMP) ]
2149 AC_ARG_ENABLE(wtmpx,
2150 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2151 [ AC_DEFINE(DISABLE_WTMPX) ]
2153 AC_ARG_ENABLE(libutil,
2154 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2155 [ AC_DEFINE(DISABLE_LOGIN) ]
2157 AC_ARG_ENABLE(pututline,
2158 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2159 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2161 AC_ARG_ENABLE(pututxline,
2162 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2163 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2165 AC_ARG_WITH(lastlog,
2166 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2168 if test "x$withval" = "xno" ; then
2169 AC_DEFINE(DISABLE_LASTLOG)
2171 conf_lastlog_location=$withval
2176 dnl lastlog, [uw]tmpx? detection
2177 dnl NOTE: set the paths in the platform section to avoid the
2178 dnl need for command-line parameters
2179 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2181 dnl lastlog detection
2182 dnl NOTE: the code itself will detect if lastlog is a directory
2183 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2185 #include <sys/types.h>
2187 #ifdef HAVE_LASTLOG_H
2188 # include <lastlog.h>
2197 [ char *lastlog = LASTLOG_FILE; ],
2198 [ AC_MSG_RESULT(yes) ],
2201 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2203 #include <sys/types.h>
2205 #ifdef HAVE_LASTLOG_H
2206 # include <lastlog.h>
2212 [ char *lastlog = _PATH_LASTLOG; ],
2213 [ AC_MSG_RESULT(yes) ],
2216 system_lastlog_path=no
2221 if test -z "$conf_lastlog_location"; then
2222 if test x"$system_lastlog_path" = x"no" ; then
2223 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2224 if (test -d "$f" || test -f "$f") ; then
2225 conf_lastlog_location=$f
2228 if test -z "$conf_lastlog_location"; then
2229 AC_MSG_WARN([** Cannot find lastlog **])
2230 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2235 if test -n "$conf_lastlog_location"; then
2236 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2240 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2242 #include <sys/types.h>
2248 [ char *utmp = UTMP_FILE; ],
2249 [ AC_MSG_RESULT(yes) ],
2251 system_utmp_path=no ]
2253 if test -z "$conf_utmp_location"; then
2254 if test x"$system_utmp_path" = x"no" ; then
2255 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2256 if test -f $f ; then
2257 conf_utmp_location=$f
2260 if test -z "$conf_utmp_location"; then
2261 AC_DEFINE(DISABLE_UTMP)
2265 if test -n "$conf_utmp_location"; then
2266 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2270 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2272 #include <sys/types.h>
2278 [ char *wtmp = WTMP_FILE; ],
2279 [ AC_MSG_RESULT(yes) ],
2281 system_wtmp_path=no ]
2283 if test -z "$conf_wtmp_location"; then
2284 if test x"$system_wtmp_path" = x"no" ; then
2285 for f in /usr/adm/wtmp /var/log/wtmp; do
2286 if test -f $f ; then
2287 conf_wtmp_location=$f
2290 if test -z "$conf_wtmp_location"; then
2291 AC_DEFINE(DISABLE_WTMP)
2295 if test -n "$conf_wtmp_location"; then
2296 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2300 dnl utmpx detection - I don't know any system so perverse as to require
2301 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2303 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2305 #include <sys/types.h>
2314 [ char *utmpx = UTMPX_FILE; ],
2315 [ AC_MSG_RESULT(yes) ],
2317 system_utmpx_path=no ]
2319 if test -z "$conf_utmpx_location"; then
2320 if test x"$system_utmpx_path" = x"no" ; then
2321 AC_DEFINE(DISABLE_UTMPX)
2324 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2328 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2330 #include <sys/types.h>
2339 [ char *wtmpx = WTMPX_FILE; ],
2340 [ AC_MSG_RESULT(yes) ],
2342 system_wtmpx_path=no ]
2344 if test -z "$conf_wtmpx_location"; then
2345 if test x"$system_wtmpx_path" = x"no" ; then
2346 AC_DEFINE(DISABLE_WTMPX)
2349 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2353 if test ! -z "$blibpath" ; then
2354 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2355 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2358 dnl remove pam and dl because they are in $LIBPAM
2359 if test "$PAM_MSG" = yes ; then
2360 LIBS=`echo $LIBS | sed 's/-lpam //'`
2362 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2363 LIBS=`echo $LIBS | sed 's/-ldl //'`
2367 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2370 # Print summary of options
2372 # Someone please show me a better way :)
2373 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2374 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2375 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2376 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2377 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2378 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2379 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2380 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2381 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2382 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2385 echo "OpenSSH has been configured with the following options:"
2386 echo " User binaries: $B"
2387 echo " System binaries: $C"
2388 echo " Configuration files: $D"
2389 echo " Askpass program: $E"
2390 echo " Manual pages: $F"
2391 echo " PID file: $G"
2392 echo " Privilege separation chroot path: $H"
2393 if test "$USES_LOGIN_CONF" = "yes" ; then
2394 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2396 echo " sshd default user PATH: $I"
2398 if test ! -z "$superuser_path" ; then
2399 echo " sshd superuser user PATH: $J"
2401 echo " Manpage format: $MANTYPE"
2402 echo " PAM support: ${PAM_MSG}"
2403 echo " KerberosIV support: $KRB4_MSG"
2404 echo " KerberosV support: $KRB5_MSG"
2405 echo " Smartcard support: $SCARD_MSG"
2406 echo " AFS support: $AFS_MSG"
2407 echo " S/KEY support: $SKEY_MSG"
2408 echo " TCP Wrappers support: $TCPW_MSG"
2409 echo " MD5 password support: $MD5_MSG"
2410 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2411 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2412 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2413 echo " BSD Auth support: $BSD_AUTH_MSG"
2414 echo " Random number source: $RAND_MSG"
2415 if test ! -z "$USE_RAND_HELPER" ; then
2416 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2421 echo " Host: ${host}"
2422 echo " Compiler: ${CC}"
2423 echo " Compiler flags: ${CFLAGS}"
2424 echo "Preprocessor flags: ${CPPFLAGS}"
2425 echo " Linker flags: ${LDFLAGS}"
2426 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2430 if test "x$PAM_MSG" = "xyes" ; then
2431 echo "PAM is enabled. You may need to install a PAM control file "
2432 echo "for sshd, otherwise password authentication may fail. "
2433 echo "Example PAM control files can be found in the contrib/ "
2438 if test ! -z "$NO_SFTP"; then
2439 echo "sftp-server will be disabled. Your compiler does not "
2440 echo "support 64bit integers."
2444 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2445 echo "WARNING: you are using the builtin random number collection "
2446 echo "service. Please read WARNING.RNG and request that your OS "
2447 echo "vendor includes kernel-based random number collection in "
2448 echo "future versions of your OS."