4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
17 AC_PATH_PROG(SED, sed)
19 AC_PATH_PROG(ENT, ent)
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 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
64 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
75 AC_MSG_RESULT($blibflags)
77 LDFLAGS="$saved_LDFLAGS"
78 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
79 [AC_CHECK_LIB(s,authenticate,
80 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
84 AC_DEFINE(BROKEN_GETADDRINFO)
85 AC_DEFINE(BROKEN_REALPATH)
86 dnl AIX handles lastlog as part of its login message
87 AC_DEFINE(DISABLE_LASTLOG)
88 AC_DEFINE(LOGIN_NEEDS_UTMPX)
89 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
90 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
93 check_for_libcrypt_later=1
94 LIBS="$LIBS /usr/lib/textmode.o"
95 AC_DEFINE(HAVE_CYGWIN)
97 AC_DEFINE(DISABLE_SHADOW)
98 AC_DEFINE(IPV4_DEFAULT)
99 AC_DEFINE(IP_TOS_IS_BROKEN)
100 AC_DEFINE(NO_X11_UNIX_SOCKETS)
101 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
102 AC_DEFINE(DISABLE_FD_PASSING)
103 AC_DEFINE(SETGROUPS_NOOP)
106 AC_DEFINE(IP_TOS_IS_BROKEN)
109 AC_MSG_CHECKING(if we have working getaddrinfo)
110 AC_TRY_RUN([#include <mach-o/dyld.h>
111 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
115 }], [AC_MSG_RESULT(working)],
116 [AC_MSG_RESULT(buggy)
117 AC_DEFINE(BROKEN_GETADDRINFO)],
118 [AC_MSG_RESULT(assume it is working)])
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
126 AC_DEFINE(HAVE_SECUREWARE)
128 AC_DEFINE(LOGIN_NO_ENDOPT)
129 AC_DEFINE(LOGIN_NEEDS_UTMPX)
130 AC_DEFINE(DISABLE_SHADOW)
131 AC_DEFINE(DISABLE_UTMP)
132 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
133 LIBS="$LIBS -lsec -lsecpw"
134 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
135 disable_ptmx_check=yes
138 if test -z "$GCC"; then
141 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
142 IPADDR_IN_DISPLAY=yes
144 AC_DEFINE(LOGIN_NO_ENDOPT)
145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
146 AC_DEFINE(DISABLE_SHADOW)
147 AC_DEFINE(DISABLE_UTMP)
148 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
150 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
153 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
154 IPADDR_IN_DISPLAY=yes
155 AC_DEFINE(PAM_SUN_CODEBASE)
157 AC_DEFINE(LOGIN_NO_ENDOPT)
158 AC_DEFINE(LOGIN_NEEDS_UTMPX)
159 AC_DEFINE(DISABLE_SHADOW)
160 AC_DEFINE(DISABLE_UTMP)
161 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
163 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
166 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
168 PATH="$PATH:/usr/etc"
169 AC_DEFINE(BROKEN_INET_NTOA)
170 AC_DEFINE(WITH_ABBREV_NO_TTY)
173 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
175 PATH="$PATH:/usr/etc"
176 AC_DEFINE(WITH_IRIX_ARRAY)
177 AC_DEFINE(WITH_IRIX_PROJECT)
178 AC_DEFINE(WITH_IRIX_AUDIT)
179 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
180 AC_DEFINE(BROKEN_INET_NTOA)
181 AC_DEFINE(WITH_ABBREV_NO_TTY)
185 check_for_libcrypt_later=1
186 AC_DEFINE(DONT_TRY_OTHER_AF)
187 AC_DEFINE(PAM_TTY_KLUDGE)
188 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
189 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
190 inet6_default_4in6=yes
192 mips-sony-bsd|mips-sony-newsos4)
193 AC_DEFINE(HAVE_NEWS4)
197 check_for_libcrypt_before=1
201 check_for_libcrypt_later=1
204 conf_lastlog_location="/usr/adm/lastlog"
205 conf_utmp_location=/etc/utmp
206 conf_wtmp_location=/usr/adm/wtmp
209 AC_DEFINE(BROKEN_REALPATH)
211 AC_DEFINE(BROKEN_SAVED_UIDS)
212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
216 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
217 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
219 AC_DEFINE(PAM_SUN_CODEBASE)
220 AC_DEFINE(LOGIN_NEEDS_UTMPX)
221 AC_DEFINE(LOGIN_NEEDS_TERM)
222 AC_DEFINE(PAM_TTY_KLUDGE)
223 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
224 # hardwire lastlog location (can't detect it on some versions)
225 conf_lastlog_location="/var/adm/lastlog"
226 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
227 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
228 if test "$sol2ver" -ge 8; then
230 AC_DEFINE(DISABLE_UTMP)
231 AC_DEFINE(DISABLE_WTMP)
237 CPPFLAGS="$CPPFLAGS -DSUNOS4"
238 AC_CHECK_FUNCS(getpwanam)
239 AC_DEFINE(PAM_SUN_CODEBASE)
240 conf_utmp_location=/etc/utmp
241 conf_wtmp_location=/var/adm/wtmp
242 conf_lastlog_location=/var/adm/lastlog
246 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
247 LDFLAGS="$LDFLAGS -L/usr/local/lib"
252 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
253 # /usr/ucblib MUST NOT be searched on ReliantUNIX
254 LDFLAGS="$LDFLAGS -L/usr/local/lib"
255 IPADDR_IN_DISPLAY=yes
257 AC_DEFINE(IP_TOS_IS_BROKEN)
258 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
259 # Attention: always take care to bind libsocket and libnsl before libc,
260 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
268 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
269 LDFLAGS="$LDFLAGS -L/usr/local/lib"
273 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
277 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
278 LDFLAGS="$LDFLAGS -L/usr/local/lib"
279 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
282 AC_DEFINE(BROKEN_SYS_TERMIO_H)
284 AC_DEFINE(HAVE_SECUREWARE)
285 AC_DEFINE(DISABLE_SHADOW)
286 AC_DEFINE(BROKEN_SAVED_UIDS)
287 AC_CHECK_FUNCS(getluid setluid)
289 do_sco3_extra_lib_check=yes
292 if test -z "$GCC"; then
293 CFLAGS="$CFLAGS -belf"
295 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
296 LDFLAGS="$LDFLAGS -L/usr/local/lib"
297 LIBS="$LIBS -lprot -lx -ltinfo -lm"
300 AC_DEFINE(HAVE_SECUREWARE)
301 AC_DEFINE(DISABLE_SHADOW)
302 AC_DEFINE(DISABLE_FD_PASSING)
303 AC_CHECK_FUNCS(getluid setluid)
308 AC_DEFINE(DISABLE_FD_PASSING)
310 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
315 AC_DEFINE(DISABLE_FD_PASSING)
316 AC_DEFINE(NO_SSH_LASTLOG)
317 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
318 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
322 AC_MSG_CHECKING(for Digital Unix SIA)
325 [ --with-osfsia Enable Digital Unix SIA],
327 if test "x$withval" = "xno" ; then
328 AC_MSG_RESULT(disabled)
333 if test -z "$no_osfsia" ; then
334 if test -f /etc/sia/matrix.conf; then
336 AC_DEFINE(HAVE_OSF_SIA)
337 AC_DEFINE(DISABLE_LOGIN)
338 AC_DEFINE(DISABLE_FD_PASSING)
339 LIBS="$LIBS -lsecurity -ldb -lm -laud"
344 AC_DEFINE(DISABLE_FD_PASSING)
349 AC_DEFINE(NO_X11_UNIX_SOCKETS)
350 AC_DEFINE(MISSING_NFDBITS)
351 AC_DEFINE(MISSING_HOWMANY)
352 AC_DEFINE(MISSING_FD_MASK)
356 # Allow user to specify flags
358 [ --with-cflags Specify additional flags to pass to compiler],
360 if test "x$withval" != "xno" ; then
361 CFLAGS="$CFLAGS $withval"
365 AC_ARG_WITH(cppflags,
366 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
368 if test "x$withval" != "xno"; then
369 CPPFLAGS="$CPPFLAGS $withval"
374 [ --with-ldflags Specify additional flags to pass to linker],
376 if test "x$withval" != "xno" ; then
377 LDFLAGS="$LDFLAGS $withval"
382 [ --with-libs Specify additional libraries to link with],
384 if test "x$withval" != "xno" ; then
385 LIBS="$LIBS $withval"
390 # Checks for header files.
391 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
392 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
393 login_cap.h maillock.h netdb.h netgroup.h \
394 netinet/in_systm.h paths.h pty.h readpassphrase.h \
395 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
396 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
397 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
398 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
399 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
400 util.h utime.h utmp.h utmpx.h)
402 # Checks for libraries.
403 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
404 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
406 dnl SCO OS3 needs this for libwrap
407 if test "x$with_tcp_wrappers" != "xno" ; then
408 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
409 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
413 AC_CHECK_FUNC(getspnam, ,
414 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
417 [ --without-rpath Disable auto-added -R linker paths],
419 if test "x$withval" = "xno" ; then
422 if test "x$withval" = "xyes" ; then
430 [ --with-zlib=PATH Use zlib in PATH],
432 if test "x$withval" = "xno" ; then
433 AC_MSG_ERROR([*** zlib is required ***])
435 if test -d "$withval/lib"; then
436 if test -n "${need_dash_r}"; then
437 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
439 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
442 if test -n "${need_dash_r}"; then
443 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
445 LDFLAGS="-L${withval} ${LDFLAGS}"
448 if test -d "$withval/include"; then
449 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
451 CPPFLAGS="-I${withval} ${CPPFLAGS}"
456 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
459 AC_CHECK_FUNC(strcasecmp,
460 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
462 AC_CHECK_FUNC(utimes,
463 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
464 LIBS="$LIBS -lc89"]) ]
467 dnl Checks for libutil functions
468 AC_CHECK_HEADERS(libutil.h)
469 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
470 AC_CHECK_FUNCS(logout updwtmp logwtmp)
474 # Check for ALTDIRFUNC glob() extension
475 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
476 AC_EGREP_CPP(FOUNDIT,
479 #ifdef GLOB_ALTDIRFUNC
484 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
492 # Check for g.gl_matchc glob() extension
493 AC_MSG_CHECKING(for gl_matchc field in glob_t)
494 AC_EGREP_CPP(FOUNDIT,
497 int main(void){glob_t g; g.gl_matchc = 1;}
500 AC_DEFINE(GLOB_HAS_GL_MATCHC)
508 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
511 #include <sys/types.h>
513 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
515 [AC_MSG_RESULT(yes)],
518 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
522 # Check whether user wants S/Key support
525 [ --with-skey[[=PATH]] Enable S/Key support
526 (optionally in PATH)],
528 if test "x$withval" != "xno" ; then
530 if test "x$withval" != "xyes" ; then
531 CPPFLAGS="$CPPFLAGS -I${withval}/include"
532 LDFLAGS="$LDFLAGS -L${withval}/lib"
539 AC_MSG_CHECKING([for s/key support])
544 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
546 [AC_MSG_RESULT(yes)],
549 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
555 # Check whether user wants TCP wrappers support
557 AC_ARG_WITH(tcp-wrappers,
558 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
559 (optionally in PATH)],
561 if test "x$withval" != "xno" ; then
563 saved_LDFLAGS="$LDFLAGS"
564 saved_CPPFLAGS="$CPPFLAGS"
565 if test -n "${withval}" -a "${withval}" != "yes"; then
566 if test -d "${withval}/lib"; then
567 if test -n "${need_dash_r}"; then
568 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
570 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
573 if test -n "${need_dash_r}"; then
574 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
576 LDFLAGS="-L${withval} ${LDFLAGS}"
579 if test -d "${withval}/include"; then
580 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
582 CPPFLAGS="-I${withval} ${CPPFLAGS}"
586 LIBS="$LIBWRAP $LIBS"
587 AC_MSG_CHECKING(for libwrap)
591 int deny_severity = 0, allow_severity = 0;
601 AC_MSG_ERROR([*** libwrap missing])
609 dnl Checks for library functions. Please keep in alphabetical order
611 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
612 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
613 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
614 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
615 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
616 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
617 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
618 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
619 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
620 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
621 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
624 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
625 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
627 dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
628 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
630 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
631 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
632 AC_CHECK_LIB(gen, dirname,[
633 AC_CACHE_CHECK([for broken dirname],
634 ac_cv_have_broken_dirname, [
642 int main(int argc, char **argv) {
645 strncpy(buf,"/etc", 32);
647 if (!s || strncmp(s, "/", 32) != 0) {
654 [ ac_cv_have_broken_dirname="no" ],
655 [ ac_cv_have_broken_dirname="yes" ]
659 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
661 AC_DEFINE(HAVE_DIRNAME)
662 AC_CHECK_HEADERS(libgen.h)
667 dnl Checks for time functions
668 AC_CHECK_FUNCS(gettimeofday time)
669 dnl Checks for utmp functions
670 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
671 AC_CHECK_FUNCS(utmpname)
672 dnl Checks for utmpx functions
673 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
674 AC_CHECK_FUNCS(setutxent utmpxname)
676 AC_CHECK_FUNC(daemon,
677 [AC_DEFINE(HAVE_DAEMON)],
678 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
681 AC_CHECK_FUNC(getpagesize,
682 [AC_DEFINE(HAVE_GETPAGESIZE)],
683 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
686 # Check for broken snprintf
687 if test "x$ac_cv_func_snprintf" = "xyes" ; then
688 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
692 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
694 [AC_MSG_RESULT(yes)],
697 AC_DEFINE(BROKEN_SNPRINTF)
698 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
703 dnl see whether mkstemp() requires XXXXXX
704 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
705 AC_MSG_CHECKING([for (overly) strict mkstemp])
709 main() { char template[]="conftest.mkstemp-test";
710 if (mkstemp(template) == -1)
712 unlink(template); exit(0);
720 AC_DEFINE(HAVE_STRICT_MKSTEMP)
724 AC_DEFINE(HAVE_STRICT_MKSTEMP)
734 [ --with-pam Enable PAM support ],
736 if test "x$withval" != "xno" ; then
737 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
738 AC_MSG_ERROR([PAM headers not found])
741 AC_CHECK_LIB(dl, dlopen, , )
742 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
743 AC_CHECK_FUNCS(pam_getenvlist)
749 if test $ac_cv_lib_dl_dlopen = yes; then
759 # Check for older PAM
760 if test "x$PAM_MSG" = "xyes" ; then
761 # Check PAM strerror arguments (old PAM)
762 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
766 #include <security/pam_appl.h>
768 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
771 AC_DEFINE(HAVE_OLD_PAM)
773 PAM_MSG="yes (old library)"
778 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
779 # because the system crypt() is more featureful.
780 if test "x$check_for_libcrypt_before" = "x1"; then
781 AC_CHECK_LIB(crypt, crypt)
785 saved_CPPFLAGS="$CPPFLAGS"
786 saved_LDFLAGS="$LDFLAGS"
788 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
790 if test "x$withval" != "xno" ; then
791 if test -d "$withval/lib"; then
792 if test -n "${need_dash_r}"; then
793 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
795 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
798 if test -n "${need_dash_r}"; then
799 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
801 LDFLAGS="-L${withval} ${LDFLAGS}"
804 if test -d "$withval/include"; then
805 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
807 CPPFLAGS="-I${withval} ${CPPFLAGS}"
812 LIBS="$LIBS -lcrypto"
813 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
815 dnl Check default openssl install dir
816 if test -n "${need_dash_r}"; then
817 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
819 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
821 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
822 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
824 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
830 # Determine OpenSSL header version
831 AC_MSG_CHECKING([OpenSSL header version])
836 #include <openssl/opensslv.h>
837 #define DATA "conftest.sslincver"
842 fd = fopen(DATA,"w");
846 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
853 ssl_header_ver=`cat conftest.sslincver`
854 AC_MSG_RESULT($ssl_header_ver)
857 AC_MSG_RESULT(not found)
858 AC_MSG_ERROR(OpenSSL version header not found.)
862 # Determine OpenSSL library version
863 AC_MSG_CHECKING([OpenSSL library version])
868 #include <openssl/opensslv.h>
869 #include <openssl/crypto.h>
870 #define DATA "conftest.ssllibver"
875 fd = fopen(DATA,"w");
879 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
886 ssl_library_ver=`cat conftest.ssllibver`
887 AC_MSG_RESULT($ssl_library_ver)
890 AC_MSG_RESULT(not found)
891 AC_MSG_ERROR(OpenSSL library not found.)
895 # Sanity check OpenSSL headers
896 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
900 #include <openssl/opensslv.h>
901 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
908 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
912 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
913 # version in OpenSSL. Skip this for PAM
914 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
915 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
919 ### Configure cryptographic random number support
921 # Check wheter OpenSSL seeds itself
922 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
926 #include <openssl/rand.h>
927 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
930 OPENSSL_SEEDS_ITSELF=yes
935 # Default to use of the rand helper if OpenSSL doesn't
942 # Do we want to force the use of the rand helper?
943 AC_ARG_WITH(rand-helper,
944 [ --with-rand-helper Use subprocess to gather strong randomness ],
946 if test "x$withval" = "xno" ; then
947 # Force use of OpenSSL's internal RNG, even if
948 # the previous test showed it to be unseeded.
949 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
950 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
951 OPENSSL_SEEDS_ITSELF=yes
960 # Which randomness source do we use?
961 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
963 AC_DEFINE(OPENSSL_PRNG_ONLY)
964 RAND_MSG="OpenSSL internal ONLY"
965 INSTALL_SSH_RAND_HELPER=""
966 elif test ! -z "$USE_RAND_HELPER" ; then
967 # install rand helper
968 RAND_MSG="ssh-rand-helper"
969 INSTALL_SSH_RAND_HELPER="yes"
971 AC_SUBST(INSTALL_SSH_RAND_HELPER)
973 ### Configuration of ssh-rand-helper
976 AC_ARG_WITH(prngd-port,
977 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
986 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
989 if test ! -z "$withval" ; then
990 PRNGD_PORT="$withval"
991 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
996 # PRNGD Unix domain socket
997 AC_ARG_WITH(prngd-socket,
998 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1002 withval="/var/run/egd-pool"
1010 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1014 if test ! -z "$withval" ; then
1015 if test ! -z "$PRNGD_PORT" ; then
1016 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1018 if test ! -r "$withval" ; then
1019 AC_MSG_WARN(Entropy socket is not readable)
1021 PRNGD_SOCKET="$withval"
1022 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1026 # Check for existing socket only if we don't have a random device already
1027 if test "$USE_RAND_HELPER" = yes ; then
1028 AC_MSG_CHECKING(for PRNGD/EGD socket)
1029 # Insert other locations here
1030 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1031 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1032 PRNGD_SOCKET="$sock"
1033 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1037 if test ! -z "$PRNGD_SOCKET" ; then
1038 AC_MSG_RESULT($PRNGD_SOCKET)
1040 AC_MSG_RESULT(not found)
1046 # Change default command timeout for hashing entropy source
1048 AC_ARG_WITH(entropy-timeout,
1049 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1051 if test "x$withval" != "xno" ; then
1052 entropy_timeout=$withval
1056 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1058 SSH_PRIVSEP_USER=sshd
1059 AC_ARG_WITH(privsep-user,
1060 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1062 if test -n "$withval"; then
1063 SSH_PRIVSEP_USER=$withval
1067 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1068 AC_SUBST(SSH_PRIVSEP_USER)
1070 # We do this little dance with the search path to insure
1071 # that programs that we select for use by installed programs
1072 # (which may be run by the super-user) come from trusted
1073 # locations before they come from the user's private area.
1074 # This should help avoid accidentally configuring some
1075 # random version of a program in someone's personal bin.
1079 test -h /bin 2> /dev/null && PATH=/usr/bin
1080 test -d /sbin && PATH=$PATH:/sbin
1081 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1082 PATH=$PATH:/etc:$OPATH
1084 # These programs are used by the command hashing source to gather entropy
1085 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1086 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1087 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1088 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1089 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1090 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1091 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1092 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1093 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1094 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1095 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1096 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1097 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1098 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1099 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1100 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1104 # Where does ssh-rand-helper get its randomness from?
1105 INSTALL_SSH_PRNG_CMDS=""
1106 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1107 if test ! -z "$PRNGD_PORT" ; then
1108 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1109 elif test ! -z "$PRNGD_SOCKET" ; then
1110 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1112 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1113 RAND_HELPER_CMDHASH=yes
1114 INSTALL_SSH_PRNG_CMDS="yes"
1117 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1120 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1121 if test ! -z "$SONY" ; then
1122 LIBS="$LIBS -liberty";
1125 # Checks for data types
1126 AC_CHECK_SIZEOF(char, 1)
1127 AC_CHECK_SIZEOF(short int, 2)
1128 AC_CHECK_SIZEOF(int, 4)
1129 AC_CHECK_SIZEOF(long int, 4)
1130 AC_CHECK_SIZEOF(long long int, 8)
1132 # Sanity check long long for some platforms (AIX)
1133 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1134 ac_cv_sizeof_long_long_int=0
1137 # More checks for data types
1138 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1140 [ #include <sys/types.h> ],
1142 [ ac_cv_have_u_int="yes" ],
1143 [ ac_cv_have_u_int="no" ]
1146 if test "x$ac_cv_have_u_int" = "xyes" ; then
1147 AC_DEFINE(HAVE_U_INT)
1151 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1153 [ #include <sys/types.h> ],
1154 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1155 [ ac_cv_have_intxx_t="yes" ],
1156 [ ac_cv_have_intxx_t="no" ]
1159 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1160 AC_DEFINE(HAVE_INTXX_T)
1164 if (test -z "$have_intxx_t" && \
1165 test "x$ac_cv_header_stdint_h" = "xyes")
1167 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1169 [ #include <stdint.h> ],
1170 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1172 AC_DEFINE(HAVE_INTXX_T)
1175 [ AC_MSG_RESULT(no) ]
1179 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1182 #include <sys/types.h>
1183 #ifdef HAVE_STDINT_H
1184 # include <stdint.h>
1186 #include <sys/socket.h>
1187 #ifdef HAVE_SYS_BITYPES_H
1188 # include <sys/bitypes.h>
1191 [ int64_t a; a = 1;],
1192 [ ac_cv_have_int64_t="yes" ],
1193 [ ac_cv_have_int64_t="no" ]
1196 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1197 AC_DEFINE(HAVE_INT64_T)
1200 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1202 [ #include <sys/types.h> ],
1203 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1204 [ ac_cv_have_u_intxx_t="yes" ],
1205 [ ac_cv_have_u_intxx_t="no" ]
1208 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1209 AC_DEFINE(HAVE_U_INTXX_T)
1213 if test -z "$have_u_intxx_t" ; then
1214 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1216 [ #include <sys/socket.h> ],
1217 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1219 AC_DEFINE(HAVE_U_INTXX_T)
1222 [ AC_MSG_RESULT(no) ]
1226 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1228 [ #include <sys/types.h> ],
1229 [ u_int64_t a; a = 1;],
1230 [ ac_cv_have_u_int64_t="yes" ],
1231 [ ac_cv_have_u_int64_t="no" ]
1234 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1235 AC_DEFINE(HAVE_U_INT64_T)
1239 if test -z "$have_u_int64_t" ; then
1240 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1242 [ #include <sys/bitypes.h> ],
1243 [ u_int64_t a; a = 1],
1245 AC_DEFINE(HAVE_U_INT64_T)
1248 [ AC_MSG_RESULT(no) ]
1252 if test -z "$have_u_intxx_t" ; then
1253 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1256 #include <sys/types.h>
1258 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1259 [ ac_cv_have_uintxx_t="yes" ],
1260 [ ac_cv_have_uintxx_t="no" ]
1263 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1264 AC_DEFINE(HAVE_UINTXX_T)
1268 if test -z "$have_uintxx_t" ; then
1269 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1271 [ #include <stdint.h> ],
1272 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1274 AC_DEFINE(HAVE_UINTXX_T)
1277 [ AC_MSG_RESULT(no) ]
1281 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1282 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1284 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1287 #include <sys/bitypes.h>
1290 int8_t a; int16_t b; int32_t c;
1291 u_int8_t e; u_int16_t f; u_int32_t g;
1292 a = b = c = e = f = g = 1;
1295 AC_DEFINE(HAVE_U_INTXX_T)
1296 AC_DEFINE(HAVE_INTXX_T)
1304 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1307 #include <sys/types.h>
1309 [ u_char foo; foo = 125; ],
1310 [ ac_cv_have_u_char="yes" ],
1311 [ ac_cv_have_u_char="no" ]
1314 if test "x$ac_cv_have_u_char" = "xyes" ; then
1315 AC_DEFINE(HAVE_U_CHAR)
1320 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1322 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1325 #include <sys/types.h>
1327 [ size_t foo; foo = 1235; ],
1328 [ ac_cv_have_size_t="yes" ],
1329 [ ac_cv_have_size_t="no" ]
1332 if test "x$ac_cv_have_size_t" = "xyes" ; then
1333 AC_DEFINE(HAVE_SIZE_T)
1336 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1339 #include <sys/types.h>
1341 [ ssize_t foo; foo = 1235; ],
1342 [ ac_cv_have_ssize_t="yes" ],
1343 [ ac_cv_have_ssize_t="no" ]
1346 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1347 AC_DEFINE(HAVE_SSIZE_T)
1350 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1355 [ clock_t foo; foo = 1235; ],
1356 [ ac_cv_have_clock_t="yes" ],
1357 [ ac_cv_have_clock_t="no" ]
1360 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1361 AC_DEFINE(HAVE_CLOCK_T)
1364 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1367 #include <sys/types.h>
1368 #include <sys/socket.h>
1370 [ sa_family_t foo; foo = 1235; ],
1371 [ ac_cv_have_sa_family_t="yes" ],
1374 #include <sys/types.h>
1375 #include <sys/socket.h>
1376 #include <netinet/in.h>
1378 [ sa_family_t foo; foo = 1235; ],
1379 [ ac_cv_have_sa_family_t="yes" ],
1381 [ ac_cv_have_sa_family_t="no" ]
1385 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1386 AC_DEFINE(HAVE_SA_FAMILY_T)
1389 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1392 #include <sys/types.h>
1394 [ pid_t foo; foo = 1235; ],
1395 [ ac_cv_have_pid_t="yes" ],
1396 [ ac_cv_have_pid_t="no" ]
1399 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1400 AC_DEFINE(HAVE_PID_T)
1403 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1406 #include <sys/types.h>
1408 [ mode_t foo; foo = 1235; ],
1409 [ ac_cv_have_mode_t="yes" ],
1410 [ ac_cv_have_mode_t="no" ]
1413 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1414 AC_DEFINE(HAVE_MODE_T)
1418 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1421 #include <sys/types.h>
1422 #include <sys/socket.h>
1424 [ struct sockaddr_storage s; ],
1425 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1426 [ ac_cv_have_struct_sockaddr_storage="no" ]
1429 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1430 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1433 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1436 #include <sys/types.h>
1437 #include <netinet/in.h>
1439 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1440 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1441 [ ac_cv_have_struct_sockaddr_in6="no" ]
1444 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1445 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1448 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1451 #include <sys/types.h>
1452 #include <netinet/in.h>
1454 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1455 [ ac_cv_have_struct_in6_addr="yes" ],
1456 [ ac_cv_have_struct_in6_addr="no" ]
1459 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1460 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1463 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1466 #include <sys/types.h>
1467 #include <sys/socket.h>
1470 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1471 [ ac_cv_have_struct_addrinfo="yes" ],
1472 [ ac_cv_have_struct_addrinfo="no" ]
1475 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1476 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1479 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1481 [ #include <sys/time.h> ],
1482 [ struct timeval tv; tv.tv_sec = 1;],
1483 [ ac_cv_have_struct_timeval="yes" ],
1484 [ ac_cv_have_struct_timeval="no" ]
1487 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1488 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1489 have_struct_timeval=1
1492 AC_CHECK_TYPES(struct timespec)
1494 # We need int64_t or else certian parts of the compile will fail.
1495 if test "x$ac_cv_have_int64_t" = "xno" -a \
1496 "x$ac_cv_sizeof_long_int" != "x8" -a \
1497 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1498 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1499 echo "an alternative compiler (I.E., GCC) before continuing."
1503 dnl test snprintf (broken on SCO w/gcc)
1508 #ifdef HAVE_SNPRINTF
1512 char expected_out[50];
1514 #if (SIZEOF_LONG_INT == 8)
1515 long int num = 0x7fffffffffffffff;
1517 long long num = 0x7fffffffffffffffll;
1519 strcpy(expected_out, "9223372036854775807");
1520 snprintf(buf, mazsize, "%lld", num);
1521 if(strcmp(buf, expected_out) != 0)
1528 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1532 dnl Checks for structure members
1533 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1534 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1535 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1536 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1537 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1538 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1539 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1540 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1541 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1542 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1543 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1544 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1545 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1546 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1547 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1548 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1549 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1551 AC_CHECK_MEMBERS([struct stat.st_blksize])
1553 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1554 ac_cv_have_ss_family_in_struct_ss, [
1557 #include <sys/types.h>
1558 #include <sys/socket.h>
1560 [ struct sockaddr_storage s; s.ss_family = 1; ],
1561 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1562 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1565 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1566 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1569 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1570 ac_cv_have___ss_family_in_struct_ss, [
1573 #include <sys/types.h>
1574 #include <sys/socket.h>
1576 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1577 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1578 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1581 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1582 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1585 AC_CACHE_CHECK([for pw_class field in struct passwd],
1586 ac_cv_have_pw_class_in_struct_passwd, [
1591 [ struct passwd p; p.pw_class = 0; ],
1592 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1593 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1596 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1597 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1600 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1601 ac_cv_have_pw_expire_in_struct_passwd, [
1606 [ struct passwd p; p.pw_expire = 0; ],
1607 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1608 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1611 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1612 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1615 AC_CACHE_CHECK([for pw_change field in struct passwd],
1616 ac_cv_have_pw_change_in_struct_passwd, [
1621 [ struct passwd p; p.pw_change = 0; ],
1622 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1623 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1626 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1627 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1630 dnl make sure we're using the real structure members and not defines
1631 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1632 ac_cv_have_accrights_in_msghdr, [
1635 #include <sys/types.h>
1636 #include <sys/socket.h>
1637 #include <sys/uio.h>
1639 #ifdef msg_accrights
1643 m.msg_accrights = 0;
1647 [ ac_cv_have_accrights_in_msghdr="yes" ],
1648 [ ac_cv_have_accrights_in_msghdr="no" ]
1651 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1652 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1655 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1656 ac_cv_have_control_in_msghdr, [
1659 #include <sys/types.h>
1660 #include <sys/socket.h>
1661 #include <sys/uio.h>
1671 [ ac_cv_have_control_in_msghdr="yes" ],
1672 [ ac_cv_have_control_in_msghdr="no" ]
1675 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1676 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1679 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1681 [ extern char *__progname; printf("%s", __progname); ],
1682 [ ac_cv_libc_defines___progname="yes" ],
1683 [ ac_cv_libc_defines___progname="no" ]
1686 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1687 AC_DEFINE(HAVE___PROGNAME)
1690 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1694 [ printf("%s", __FUNCTION__); ],
1695 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1696 [ ac_cv_cc_implements___FUNCTION__="no" ]
1699 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1700 AC_DEFINE(HAVE___FUNCTION__)
1703 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1707 [ printf("%s", __func__); ],
1708 [ ac_cv_cc_implements___func__="yes" ],
1709 [ ac_cv_cc_implements___func__="no" ]
1712 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1713 AC_DEFINE(HAVE___func__)
1716 AC_CACHE_CHECK([whether getopt has optreset support],
1717 ac_cv_have_getopt_optreset, [
1722 [ extern int optreset; optreset = 0; ],
1723 [ ac_cv_have_getopt_optreset="yes" ],
1724 [ ac_cv_have_getopt_optreset="no" ]
1727 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1728 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1731 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1733 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1734 [ ac_cv_libc_defines_sys_errlist="yes" ],
1735 [ ac_cv_libc_defines_sys_errlist="no" ]
1738 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1739 AC_DEFINE(HAVE_SYS_ERRLIST)
1743 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1745 [ extern int sys_nerr; printf("%i", sys_nerr);],
1746 [ ac_cv_libc_defines_sys_nerr="yes" ],
1747 [ ac_cv_libc_defines_sys_nerr="no" ]
1750 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1751 AC_DEFINE(HAVE_SYS_NERR)
1756 # Check whether user wants sectok support
1758 [ --with-sectok Enable smartcard support using libsectok],
1760 if test "x$withval" != "xno" ; then
1761 if test "x$withval" != "xyes" ; then
1762 CPPFLAGS="$CPPFLAGS -I${withval}"
1763 LDFLAGS="$LDFLAGS -L${withval}"
1764 if test ! -z "$need_dash_r" ; then
1765 LDFLAGS="$LDFLAGS -R${withval}"
1767 if test ! -z "$blibpath" ; then
1768 blibpath="$blibpath:${withval}"
1771 AC_CHECK_HEADERS(sectok.h)
1772 if test "$ac_cv_header_sectok_h" != yes; then
1773 AC_MSG_ERROR(Can't find sectok.h)
1775 AC_CHECK_LIB(sectok, sectok_open)
1776 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1777 AC_MSG_ERROR(Can't find libsectok)
1779 AC_DEFINE(SMARTCARD)
1780 AC_DEFINE(USE_SECTOK)
1781 SCARD_MSG="yes, using sectok"
1786 # Check whether user wants OpenSC support
1788 AC_HELP_STRING([--with-opensc=PFX],
1789 [Enable smartcard support using OpenSC]),
1790 opensc_config_prefix="$withval", opensc_config_prefix="")
1791 if test x$opensc_config_prefix != x ; then
1792 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1793 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1794 if test "$OPENSC_CONFIG" != "no"; then
1795 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1796 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1797 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1798 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1799 AC_DEFINE(SMARTCARD)
1800 AC_DEFINE(USE_OPENSC)
1801 SCARD_MSG="yes, using OpenSC"
1805 # Check whether user wants Kerberos 5 support
1807 AC_ARG_WITH(kerberos5,
1808 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1810 if test "x$withval" != "xno" ; then
1811 if test "x$withval" = "xyes" ; then
1812 KRB5ROOT="/usr/local"
1816 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1817 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1820 AC_MSG_CHECKING(whether we are using Heimdal)
1821 AC_TRY_COMPILE([ #include <krb5.h> ],
1822 [ char *tmp = heimdal_version; ],
1823 [ AC_MSG_RESULT(yes)
1825 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1828 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1831 if test ! -z "$need_dash_r" ; then
1832 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1834 if test ! -z "$blibpath" ; then
1835 blibpath="$blibpath:${KRB5ROOT}/lib"
1837 AC_CHECK_LIB(resolv, dn_expand, , )
1843 # Check whether user wants Kerberos 4 support
1845 AC_ARG_WITH(kerberos4,
1846 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1848 if test "x$withval" != "xno" ; then
1849 if test "x$withval" != "xyes" ; then
1850 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1851 LDFLAGS="$LDFLAGS -L${withval}/lib"
1852 if test ! -z "$need_dash_r" ; then
1853 LDFLAGS="$LDFLAGS -R${withval}/lib"
1855 if test ! -z "$blibpath" ; then
1856 blibpath="$blibpath:${withval}/lib"
1859 if test -d /usr/include/kerberosIV ; then
1860 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1864 AC_CHECK_HEADERS(krb.h)
1865 if test "$ac_cv_header_krb_h" != yes; then
1866 AC_MSG_WARN([Cannot find krb.h, build may fail])
1868 AC_CHECK_LIB(krb, main)
1869 if test "$ac_cv_lib_krb_main" != yes; then
1870 AC_CHECK_LIB(krb4, main)
1871 if test "$ac_cv_lib_krb4_main" != yes; then
1872 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1879 AC_CHECK_LIB(des, des_cbc_encrypt)
1880 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1881 AC_CHECK_LIB(des425, des_cbc_encrypt)
1882 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1883 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1890 AC_CHECK_LIB(resolv, dn_expand, , )
1898 # Check whether user wants AFS support
1901 [ --with-afs=PATH Enable AFS support],
1903 if test "x$withval" != "xno" ; then
1905 if test "x$withval" != "xyes" ; then
1906 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1907 LDFLAGS="$LDFLAGS -L${withval}/lib"
1910 if test -z "$KRB4" ; then
1911 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1915 if test ! -z "$AFS_LIBS" ; then
1916 LIBS="$LIBS $AFS_LIBS"
1923 LIBS="$LIBS $KLIBS $K5LIBS"
1925 # Looking for programs, paths and files
1927 PRIVSEP_PATH=/var/empty
1928 AC_ARG_WITH(privsep-path,
1929 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1931 if test "x$withval" != "$no" ; then
1932 PRIVSEP_PATH=$withval
1936 AC_SUBST(PRIVSEP_PATH)
1939 [ --with-xauth=PATH Specify path to xauth program ],
1941 if test "x$withval" != "xno" ; then
1947 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1948 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1949 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1950 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1951 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1952 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1953 xauth_path="/usr/openwin/bin/xauth"
1959 AC_ARG_ENABLE(strip,
1960 [ --disable-strip Disable calling strip(1) on install],
1962 if test "x$enableval" = "xno" ; then
1969 if test -z "$xauth_path" ; then
1970 XAUTH_PATH="undefined"
1971 AC_SUBST(XAUTH_PATH)
1973 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1974 XAUTH_PATH=$xauth_path
1975 AC_SUBST(XAUTH_PATH)
1978 # Check for mail directory (last resort if we cannot get it from headers)
1979 if test ! -z "$MAIL" ; then
1980 maildir=`dirname $MAIL`
1981 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1984 if test -z "$no_dev_ptmx" ; then
1985 if test "x$disable_ptmx_check" != "xyes" ; then
1986 AC_CHECK_FILE("/dev/ptmx",
1988 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1994 AC_CHECK_FILE("/dev/ptc",
1996 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2001 # Options from here on. Some of these are preset by platform above
2002 AC_ARG_WITH(mantype,
2003 [ --with-mantype=man|cat|doc Set man page type],
2010 AC_MSG_ERROR(invalid man type: $withval)
2015 if test -z "$MANTYPE"; then
2016 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2017 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2018 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2020 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2027 if test "$MANTYPE" = "doc"; then
2034 # Check whether to enable MD5 passwords
2036 AC_ARG_WITH(md5-passwords,
2037 [ --with-md5-passwords Enable use of MD5 passwords],
2039 if test "x$withval" != "xno" ; then
2040 AC_DEFINE(HAVE_MD5_PASSWORDS)
2046 # Whether to disable shadow password support
2048 [ --without-shadow Disable shadow password support],
2050 if test "x$withval" = "xno" ; then
2051 AC_DEFINE(DISABLE_SHADOW)
2057 if test -z "$disable_shadow" ; then
2058 AC_MSG_CHECKING([if the systems has expire shadow information])
2061 #include <sys/types.h>
2064 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2065 [ sp_expire_available=yes ], []
2068 if test "x$sp_expire_available" = "xyes" ; then
2070 AC_DEFINE(HAS_SHADOW_EXPIRE)
2076 # Use ip address instead of hostname in $DISPLAY
2077 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2078 DISPLAY_HACK_MSG="yes"
2079 AC_DEFINE(IPADDR_IN_DISPLAY)
2081 DISPLAY_HACK_MSG="no"
2082 AC_ARG_WITH(ipaddr-display,
2083 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2085 if test "x$withval" != "xno" ; then
2086 AC_DEFINE(IPADDR_IN_DISPLAY)
2087 DISPLAY_HACK_MSG="yes"
2093 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2094 if test $ac_cv_func_login_getcapbool = "yes" -a \
2095 $ac_cv_header_login_cap_h = "yes" ; then
2098 # Whether to mess with the default path
2099 SERVER_PATH_MSG="(default)"
2100 AC_ARG_WITH(default-path,
2101 [ --with-default-path= Specify default \$PATH environment for server],
2103 if test "$USES_LOGIN_CONF" = "yes" ; then
2105 --with-default-path=PATH has no effect on this system.
2106 Edit /etc/login.conf instead.])
2107 elif test "x$withval" != "xno" ; then
2108 user_path="$withval"
2109 SERVER_PATH_MSG="$withval"
2112 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2113 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2117 /* find out what STDPATH is */
2122 #ifndef _PATH_STDPATH
2123 # ifdef _PATH_USERPATH /* Irix */
2124 # define _PATH_STDPATH _PATH_USERPATH
2126 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2129 #include <sys/types.h>
2130 #include <sys/stat.h>
2132 #define DATA "conftest.stdpath"
2139 fd = fopen(DATA,"w");
2143 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2148 ], [ user_path=`cat conftest.stdpath` ],
2149 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2150 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2152 # make sure $bindir is in USER_PATH so scp will work
2153 t_bindir=`eval echo ${bindir}`
2155 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2158 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2160 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2161 if test $? -ne 0 ; then
2162 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2163 if test $? -ne 0 ; then
2164 user_path=$user_path:$t_bindir
2165 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2170 if test "$USES_LOGIN_CONF" != "yes" ; then
2171 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2175 # Set superuser path separately to user path
2176 AC_ARG_WITH(superuser-path,
2177 [ --with-superuser-path= Specify different path for super-user],
2179 if test "x$withval" != "xno" ; then
2180 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2181 superuser_path=$withval
2187 # Whether to force IPv4 by default (needed on broken glibc Linux)
2189 AC_ARG_WITH(ipv4-default,
2190 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2192 if test "x$withval" != "xno" ; then
2193 AC_DEFINE(IPV4_DEFAULT)
2199 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2200 IPV4_IN6_HACK_MSG="no"
2202 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2204 if test "x$withval" != "xno" ; then
2206 AC_DEFINE(IPV4_IN_IPV6)
2207 IPV4_IN6_HACK_MSG="yes"
2212 if test "x$inet6_default_4in6" = "xyes"; then
2213 AC_MSG_RESULT([yes (default)])
2214 AC_DEFINE(IPV4_IN_IPV6)
2215 IPV4_IN6_HACK_MSG="yes"
2217 AC_MSG_RESULT([no (default)])
2222 # Whether to enable BSD auth support
2224 AC_ARG_WITH(bsd-auth,
2225 [ --with-bsd-auth Enable BSD auth support],
2227 if test "x$withval" != "xno" ; then
2234 # Where to place sshd.pid
2236 # make sure the directory exists
2237 if test ! -d $piddir ; then
2238 piddir=`eval echo ${sysconfdir}`
2240 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2244 AC_ARG_WITH(pid-dir,
2245 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2247 if test "x$withval" != "xno" ; then
2249 if test ! -d $piddir ; then
2250 AC_MSG_WARN([** no $piddir directory on this system **])
2256 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2259 dnl allow user to disable some login recording features
2260 AC_ARG_ENABLE(lastlog,
2261 [ --disable-lastlog disable use of lastlog even if detected [no]],
2262 [ AC_DEFINE(DISABLE_LASTLOG) ]
2265 [ --disable-utmp disable use of utmp even if detected [no]],
2266 [ AC_DEFINE(DISABLE_UTMP) ]
2268 AC_ARG_ENABLE(utmpx,
2269 [ --disable-utmpx disable use of utmpx even if detected [no]],
2270 [ AC_DEFINE(DISABLE_UTMPX) ]
2273 [ --disable-wtmp disable use of wtmp even if detected [no]],
2274 [ AC_DEFINE(DISABLE_WTMP) ]
2276 AC_ARG_ENABLE(wtmpx,
2277 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2278 [ AC_DEFINE(DISABLE_WTMPX) ]
2280 AC_ARG_ENABLE(libutil,
2281 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2282 [ AC_DEFINE(DISABLE_LOGIN) ]
2284 AC_ARG_ENABLE(pututline,
2285 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2286 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2288 AC_ARG_ENABLE(pututxline,
2289 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2290 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2292 AC_ARG_WITH(lastlog,
2293 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2295 if test "x$withval" = "xno" ; then
2296 AC_DEFINE(DISABLE_LASTLOG)
2298 conf_lastlog_location=$withval
2303 dnl lastlog, [uw]tmpx? detection
2304 dnl NOTE: set the paths in the platform section to avoid the
2305 dnl need for command-line parameters
2306 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2308 dnl lastlog detection
2309 dnl NOTE: the code itself will detect if lastlog is a directory
2310 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2312 #include <sys/types.h>
2314 #ifdef HAVE_LASTLOG_H
2315 # include <lastlog.h>
2324 [ char *lastlog = LASTLOG_FILE; ],
2325 [ AC_MSG_RESULT(yes) ],
2328 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2330 #include <sys/types.h>
2332 #ifdef HAVE_LASTLOG_H
2333 # include <lastlog.h>
2339 [ char *lastlog = _PATH_LASTLOG; ],
2340 [ AC_MSG_RESULT(yes) ],
2343 system_lastlog_path=no
2348 if test -z "$conf_lastlog_location"; then
2349 if test x"$system_lastlog_path" = x"no" ; then
2350 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2351 if (test -d "$f" || test -f "$f") ; then
2352 conf_lastlog_location=$f
2355 if test -z "$conf_lastlog_location"; then
2356 AC_MSG_WARN([** Cannot find lastlog **])
2357 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2362 if test -n "$conf_lastlog_location"; then
2363 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2367 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2369 #include <sys/types.h>
2375 [ char *utmp = UTMP_FILE; ],
2376 [ AC_MSG_RESULT(yes) ],
2378 system_utmp_path=no ]
2380 if test -z "$conf_utmp_location"; then
2381 if test x"$system_utmp_path" = x"no" ; then
2382 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2383 if test -f $f ; then
2384 conf_utmp_location=$f
2387 if test -z "$conf_utmp_location"; then
2388 AC_DEFINE(DISABLE_UTMP)
2392 if test -n "$conf_utmp_location"; then
2393 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2397 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2399 #include <sys/types.h>
2405 [ char *wtmp = WTMP_FILE; ],
2406 [ AC_MSG_RESULT(yes) ],
2408 system_wtmp_path=no ]
2410 if test -z "$conf_wtmp_location"; then
2411 if test x"$system_wtmp_path" = x"no" ; then
2412 for f in /usr/adm/wtmp /var/log/wtmp; do
2413 if test -f $f ; then
2414 conf_wtmp_location=$f
2417 if test -z "$conf_wtmp_location"; then
2418 AC_DEFINE(DISABLE_WTMP)
2422 if test -n "$conf_wtmp_location"; then
2423 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2427 dnl utmpx detection - I don't know any system so perverse as to require
2428 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2430 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2432 #include <sys/types.h>
2441 [ char *utmpx = UTMPX_FILE; ],
2442 [ AC_MSG_RESULT(yes) ],
2444 system_utmpx_path=no ]
2446 if test -z "$conf_utmpx_location"; then
2447 if test x"$system_utmpx_path" = x"no" ; then
2448 AC_DEFINE(DISABLE_UTMPX)
2451 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2455 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2457 #include <sys/types.h>
2466 [ char *wtmpx = WTMPX_FILE; ],
2467 [ AC_MSG_RESULT(yes) ],
2469 system_wtmpx_path=no ]
2471 if test -z "$conf_wtmpx_location"; then
2472 if test x"$system_wtmpx_path" = x"no" ; then
2473 AC_DEFINE(DISABLE_WTMPX)
2476 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2480 if test ! -z "$blibpath" ; then
2481 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2482 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
2485 dnl remove pam and dl because they are in $LIBPAM
2486 if test "$PAM_MSG" = yes ; then
2487 LIBS=`echo $LIBS | sed 's/-lpam //'`
2489 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2490 LIBS=`echo $LIBS | sed 's/-ldl //'`
2494 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2497 # Print summary of options
2499 # Someone please show me a better way :)
2500 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2501 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2502 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2503 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2504 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2505 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2506 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2507 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2508 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2509 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2512 echo "OpenSSH has been configured with the following options:"
2513 echo " User binaries: $B"
2514 echo " System binaries: $C"
2515 echo " Configuration files: $D"
2516 echo " Askpass program: $E"
2517 echo " Manual pages: $F"
2518 echo " PID file: $G"
2519 echo " Privilege separation chroot path: $H"
2520 if test "$USES_LOGIN_CONF" = "yes" ; then
2521 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2523 echo " sshd default user PATH: $I"
2525 if test ! -z "$superuser_path" ; then
2526 echo " sshd superuser user PATH: $J"
2528 echo " Manpage format: $MANTYPE"
2529 echo " PAM support: ${PAM_MSG}"
2530 echo " KerberosIV support: $KRB4_MSG"
2531 echo " KerberosV support: $KRB5_MSG"
2532 echo " Smartcard support: $SCARD_MSG"
2533 echo " AFS support: $AFS_MSG"
2534 echo " S/KEY support: $SKEY_MSG"
2535 echo " TCP Wrappers support: $TCPW_MSG"
2536 echo " MD5 password support: $MD5_MSG"
2537 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2538 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2539 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2540 echo " BSD Auth support: $BSD_AUTH_MSG"
2541 echo " Random number source: $RAND_MSG"
2542 if test ! -z "$USE_RAND_HELPER" ; then
2543 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2548 echo " Host: ${host}"
2549 echo " Compiler: ${CC}"
2550 echo " Compiler flags: ${CFLAGS}"
2551 echo "Preprocessor flags: ${CPPFLAGS}"
2552 echo " Linker flags: ${LDFLAGS}"
2553 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2557 if test "x$PAM_MSG" = "xyes" ; then
2558 echo "PAM is enabled. You may need to install a PAM control file "
2559 echo "for sshd, otherwise password authentication may fail. "
2560 echo "Example PAM control files can be found in the contrib/ "
2565 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2566 echo "WARNING: you are using the builtin random number collection "
2567 echo "service. Please read WARNING.RNG and request that your OS "
2568 echo "vendor includes kernel-based random number collection in "
2569 echo "future versions of your OS."