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
191 AC_MSG_CHECKING(for broken cmsg_type)
195 AC_DEFINE(BROKEN_CMSG_TYPE)
202 mips-sony-bsd|mips-sony-newsos4)
203 AC_DEFINE(HAVE_NEWS4)
207 check_for_libcrypt_before=1
211 check_for_libcrypt_later=1
214 conf_lastlog_location="/usr/adm/lastlog"
215 conf_utmp_location=/etc/utmp
216 conf_wtmp_location=/usr/adm/wtmp
219 AC_DEFINE(BROKEN_REALPATH)
221 AC_DEFINE(BROKEN_SAVED_UIDS)
222 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
226 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
227 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
229 AC_DEFINE(PAM_SUN_CODEBASE)
230 AC_DEFINE(LOGIN_NEEDS_UTMPX)
231 AC_DEFINE(LOGIN_NEEDS_TERM)
232 AC_DEFINE(PAM_TTY_KLUDGE)
233 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
234 # hardwire lastlog location (can't detect it on some versions)
235 conf_lastlog_location="/var/adm/lastlog"
236 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
237 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
238 if test "$sol2ver" -ge 8; then
240 AC_DEFINE(DISABLE_UTMP)
241 AC_DEFINE(DISABLE_WTMP)
247 CPPFLAGS="$CPPFLAGS -DSUNOS4"
248 AC_CHECK_FUNCS(getpwanam)
249 AC_DEFINE(PAM_SUN_CODEBASE)
250 conf_utmp_location=/etc/utmp
251 conf_wtmp_location=/var/adm/wtmp
252 conf_lastlog_location=/var/adm/lastlog
256 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
257 LDFLAGS="$LDFLAGS -L/usr/local/lib"
262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
263 # /usr/ucblib MUST NOT be searched on ReliantUNIX
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
265 IPADDR_IN_DISPLAY=yes
267 AC_DEFINE(IP_TOS_IS_BROKEN)
268 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
269 # Attention: always take care to bind libsocket and libnsl before libc,
270 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
273 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
278 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
279 LDFLAGS="$LDFLAGS -L/usr/local/lib"
283 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
284 LDFLAGS="$LDFLAGS -L/usr/local/lib"
287 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
288 LDFLAGS="$LDFLAGS -L/usr/local/lib"
289 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
292 AC_DEFINE(BROKEN_SYS_TERMIO_H)
294 AC_DEFINE(HAVE_SECUREWARE)
295 AC_DEFINE(DISABLE_SHADOW)
296 AC_DEFINE(BROKEN_SAVED_UIDS)
297 AC_CHECK_FUNCS(getluid setluid)
299 do_sco3_extra_lib_check=yes
302 if test -z "$GCC"; then
303 CFLAGS="$CFLAGS -belf"
305 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
306 LDFLAGS="$LDFLAGS -L/usr/local/lib"
307 LIBS="$LIBS -lprot -lx -ltinfo -lm"
310 AC_DEFINE(HAVE_SECUREWARE)
311 AC_DEFINE(DISABLE_SHADOW)
312 AC_DEFINE(DISABLE_FD_PASSING)
313 AC_CHECK_FUNCS(getluid setluid)
318 AC_DEFINE(DISABLE_FD_PASSING)
320 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
325 AC_DEFINE(DISABLE_FD_PASSING)
326 AC_DEFINE(NO_SSH_LASTLOG)
327 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
328 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
332 AC_MSG_CHECKING(for Digital Unix SIA)
335 [ --with-osfsia Enable Digital Unix SIA],
337 if test "x$withval" = "xno" ; then
338 AC_MSG_RESULT(disabled)
343 if test -z "$no_osfsia" ; then
344 if test -f /etc/sia/matrix.conf; then
346 AC_DEFINE(HAVE_OSF_SIA)
347 AC_DEFINE(DISABLE_LOGIN)
348 AC_DEFINE(DISABLE_FD_PASSING)
349 LIBS="$LIBS -lsecurity -ldb -lm -laud"
354 AC_DEFINE(DISABLE_FD_PASSING)
359 AC_DEFINE(NO_X11_UNIX_SOCKETS)
360 AC_DEFINE(MISSING_NFDBITS)
361 AC_DEFINE(MISSING_HOWMANY)
362 AC_DEFINE(MISSING_FD_MASK)
366 # Allow user to specify flags
368 [ --with-cflags Specify additional flags to pass to compiler],
370 if test "x$withval" != "xno" ; then
371 CFLAGS="$CFLAGS $withval"
375 AC_ARG_WITH(cppflags,
376 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
378 if test "x$withval" != "xno"; then
379 CPPFLAGS="$CPPFLAGS $withval"
384 [ --with-ldflags Specify additional flags to pass to linker],
386 if test "x$withval" != "xno" ; then
387 LDFLAGS="$LDFLAGS $withval"
392 [ --with-libs Specify additional libraries to link with],
394 if test "x$withval" != "xno" ; then
395 LIBS="$LIBS $withval"
400 # Checks for header files.
401 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
402 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
403 login_cap.h maillock.h netdb.h netgroup.h \
404 netinet/in_systm.h paths.h pty.h readpassphrase.h \
405 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
406 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
407 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
408 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
409 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
410 util.h utime.h utmp.h utmpx.h)
412 # Checks for libraries.
413 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
414 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
416 dnl SCO OS3 needs this for libwrap
417 if test "x$with_tcp_wrappers" != "xno" ; then
418 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
419 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
423 AC_CHECK_FUNC(getspnam, ,
424 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
427 [ --without-rpath Disable auto-added -R linker paths],
429 if test "x$withval" = "xno" ; then
432 if test "x$withval" = "xyes" ; then
440 [ --with-zlib=PATH Use zlib in PATH],
442 if test "x$withval" = "xno" ; then
443 AC_MSG_ERROR([*** zlib is required ***])
445 if test -d "$withval/lib"; then
446 if test -n "${need_dash_r}"; then
447 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
449 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
452 if test -n "${need_dash_r}"; then
453 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
455 LDFLAGS="-L${withval} ${LDFLAGS}"
458 if test -d "$withval/include"; then
459 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
461 CPPFLAGS="-I${withval} ${CPPFLAGS}"
466 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
469 AC_CHECK_FUNC(strcasecmp,
470 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
472 AC_CHECK_FUNC(utimes,
473 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
474 LIBS="$LIBS -lc89"]) ]
477 dnl Checks for libutil functions
478 AC_CHECK_HEADERS(libutil.h)
479 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
480 AC_CHECK_FUNCS(logout updwtmp logwtmp)
484 # Check for ALTDIRFUNC glob() extension
485 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
486 AC_EGREP_CPP(FOUNDIT,
489 #ifdef GLOB_ALTDIRFUNC
494 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
502 # Check for g.gl_matchc glob() extension
503 AC_MSG_CHECKING(for gl_matchc field in glob_t)
504 AC_EGREP_CPP(FOUNDIT,
507 int main(void){glob_t g; g.gl_matchc = 1;}
510 AC_DEFINE(GLOB_HAS_GL_MATCHC)
518 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
521 #include <sys/types.h>
523 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
525 [AC_MSG_RESULT(yes)],
528 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
532 # Check whether user wants S/Key support
535 [ --with-skey[[=PATH]] Enable S/Key support
536 (optionally in PATH)],
538 if test "x$withval" != "xno" ; then
540 if test "x$withval" != "xyes" ; then
541 CPPFLAGS="$CPPFLAGS -I${withval}/include"
542 LDFLAGS="$LDFLAGS -L${withval}/lib"
549 AC_MSG_CHECKING([for s/key support])
554 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
556 [AC_MSG_RESULT(yes)],
559 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
565 # Check whether user wants TCP wrappers support
567 AC_ARG_WITH(tcp-wrappers,
568 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
569 (optionally in PATH)],
571 if test "x$withval" != "xno" ; then
573 saved_LDFLAGS="$LDFLAGS"
574 saved_CPPFLAGS="$CPPFLAGS"
575 if test -n "${withval}" -a "${withval}" != "yes"; then
576 if test -d "${withval}/lib"; then
577 if test -n "${need_dash_r}"; then
578 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
580 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
583 if test -n "${need_dash_r}"; then
584 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
586 LDFLAGS="-L${withval} ${LDFLAGS}"
589 if test -d "${withval}/include"; then
590 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
592 CPPFLAGS="-I${withval} ${CPPFLAGS}"
596 LIBS="$LIBWRAP $LIBS"
597 AC_MSG_CHECKING(for libwrap)
601 int deny_severity = 0, allow_severity = 0;
611 AC_MSG_ERROR([*** libwrap missing])
619 dnl Checks for library functions. Please keep in alphabetical order
621 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
622 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
623 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
624 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
625 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
626 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
627 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
628 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
629 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
630 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
631 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
634 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
635 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
637 dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
638 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
640 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
641 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
642 AC_CHECK_LIB(gen, dirname,[
643 AC_CACHE_CHECK([for broken dirname],
644 ac_cv_have_broken_dirname, [
652 int main(int argc, char **argv) {
655 strncpy(buf,"/etc", 32);
657 if (!s || strncmp(s, "/", 32) != 0) {
664 [ ac_cv_have_broken_dirname="no" ],
665 [ ac_cv_have_broken_dirname="yes" ]
669 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
671 AC_DEFINE(HAVE_DIRNAME)
672 AC_CHECK_HEADERS(libgen.h)
677 dnl Checks for time functions
678 AC_CHECK_FUNCS(gettimeofday time)
679 dnl Checks for utmp functions
680 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
681 AC_CHECK_FUNCS(utmpname)
682 dnl Checks for utmpx functions
683 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
684 AC_CHECK_FUNCS(setutxent utmpxname)
686 AC_CHECK_FUNC(daemon,
687 [AC_DEFINE(HAVE_DAEMON)],
688 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
691 AC_CHECK_FUNC(getpagesize,
692 [AC_DEFINE(HAVE_GETPAGESIZE)],
693 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
696 # Check for broken snprintf
697 if test "x$ac_cv_func_snprintf" = "xyes" ; then
698 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
702 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
704 [AC_MSG_RESULT(yes)],
707 AC_DEFINE(BROKEN_SNPRINTF)
708 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
713 dnl see whether mkstemp() requires XXXXXX
714 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
715 AC_MSG_CHECKING([for (overly) strict mkstemp])
719 main() { char template[]="conftest.mkstemp-test";
720 if (mkstemp(template) == -1)
722 unlink(template); exit(0);
730 AC_DEFINE(HAVE_STRICT_MKSTEMP)
734 AC_DEFINE(HAVE_STRICT_MKSTEMP)
744 [ --with-pam Enable PAM support ],
746 if test "x$withval" != "xno" ; then
747 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
748 AC_MSG_ERROR([PAM headers not found])
751 AC_CHECK_LIB(dl, dlopen, , )
752 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
753 AC_CHECK_FUNCS(pam_getenvlist)
759 if test $ac_cv_lib_dl_dlopen = yes; then
769 # Check for older PAM
770 if test "x$PAM_MSG" = "xyes" ; then
771 # Check PAM strerror arguments (old PAM)
772 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
776 #include <security/pam_appl.h>
778 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
781 AC_DEFINE(HAVE_OLD_PAM)
783 PAM_MSG="yes (old library)"
788 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
789 # because the system crypt() is more featureful.
790 if test "x$check_for_libcrypt_before" = "x1"; then
791 AC_CHECK_LIB(crypt, crypt)
795 saved_CPPFLAGS="$CPPFLAGS"
796 saved_LDFLAGS="$LDFLAGS"
798 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
800 if test "x$withval" != "xno" ; then
801 if test -d "$withval/lib"; then
802 if test -n "${need_dash_r}"; then
803 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
805 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
808 if test -n "${need_dash_r}"; then
809 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
811 LDFLAGS="-L${withval} ${LDFLAGS}"
814 if test -d "$withval/include"; then
815 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
817 CPPFLAGS="-I${withval} ${CPPFLAGS}"
822 LIBS="$LIBS -lcrypto"
823 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
825 dnl Check default openssl install dir
826 if test -n "${need_dash_r}"; then
827 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
829 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
831 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
832 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
834 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
840 # Determine OpenSSL header version
841 AC_MSG_CHECKING([OpenSSL header version])
846 #include <openssl/opensslv.h>
847 #define DATA "conftest.sslincver"
852 fd = fopen(DATA,"w");
856 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
863 ssl_header_ver=`cat conftest.sslincver`
864 AC_MSG_RESULT($ssl_header_ver)
867 AC_MSG_RESULT(not found)
868 AC_MSG_ERROR(OpenSSL version header not found.)
872 # Determine OpenSSL library version
873 AC_MSG_CHECKING([OpenSSL library version])
878 #include <openssl/opensslv.h>
879 #include <openssl/crypto.h>
880 #define DATA "conftest.ssllibver"
885 fd = fopen(DATA,"w");
889 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
896 ssl_library_ver=`cat conftest.ssllibver`
897 AC_MSG_RESULT($ssl_library_ver)
900 AC_MSG_RESULT(not found)
901 AC_MSG_ERROR(OpenSSL library not found.)
905 # Sanity check OpenSSL headers
906 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
910 #include <openssl/opensslv.h>
911 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
918 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
922 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
923 # version in OpenSSL. Skip this for PAM
924 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
925 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
929 ### Configure cryptographic random number support
931 # Check wheter OpenSSL seeds itself
932 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
936 #include <openssl/rand.h>
937 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
940 OPENSSL_SEEDS_ITSELF=yes
945 # Default to use of the rand helper if OpenSSL doesn't
952 # Do we want to force the use of the rand helper?
953 AC_ARG_WITH(rand-helper,
954 [ --with-rand-helper Use subprocess to gather strong randomness ],
956 if test "x$withval" = "xno" ; then
957 # Force use of OpenSSL's internal RNG, even if
958 # the previous test showed it to be unseeded.
959 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
960 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
961 OPENSSL_SEEDS_ITSELF=yes
970 # Which randomness source do we use?
971 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
973 AC_DEFINE(OPENSSL_PRNG_ONLY)
974 RAND_MSG="OpenSSL internal ONLY"
975 INSTALL_SSH_RAND_HELPER=""
976 elif test ! -z "$USE_RAND_HELPER" ; then
977 # install rand helper
978 RAND_MSG="ssh-rand-helper"
979 INSTALL_SSH_RAND_HELPER="yes"
981 AC_SUBST(INSTALL_SSH_RAND_HELPER)
983 ### Configuration of ssh-rand-helper
986 AC_ARG_WITH(prngd-port,
987 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
996 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
999 if test ! -z "$withval" ; then
1000 PRNGD_PORT="$withval"
1001 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1006 # PRNGD Unix domain socket
1007 AC_ARG_WITH(prngd-socket,
1008 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1012 withval="/var/run/egd-pool"
1020 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1024 if test ! -z "$withval" ; then
1025 if test ! -z "$PRNGD_PORT" ; then
1026 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1028 if test ! -r "$withval" ; then
1029 AC_MSG_WARN(Entropy socket is not readable)
1031 PRNGD_SOCKET="$withval"
1032 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1036 # Check for existing socket only if we don't have a random device already
1037 if test "$USE_RAND_HELPER" = yes ; then
1038 AC_MSG_CHECKING(for PRNGD/EGD socket)
1039 # Insert other locations here
1040 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1041 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1042 PRNGD_SOCKET="$sock"
1043 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1047 if test ! -z "$PRNGD_SOCKET" ; then
1048 AC_MSG_RESULT($PRNGD_SOCKET)
1050 AC_MSG_RESULT(not found)
1056 # Change default command timeout for hashing entropy source
1058 AC_ARG_WITH(entropy-timeout,
1059 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1061 if test "x$withval" != "xno" ; then
1062 entropy_timeout=$withval
1066 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1068 SSH_PRIVSEP_USER=sshd
1069 AC_ARG_WITH(privsep-user,
1070 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1072 if test -n "$withval"; then
1073 SSH_PRIVSEP_USER=$withval
1077 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1078 AC_SUBST(SSH_PRIVSEP_USER)
1080 # We do this little dance with the search path to insure
1081 # that programs that we select for use by installed programs
1082 # (which may be run by the super-user) come from trusted
1083 # locations before they come from the user's private area.
1084 # This should help avoid accidentally configuring some
1085 # random version of a program in someone's personal bin.
1089 test -h /bin 2> /dev/null && PATH=/usr/bin
1090 test -d /sbin && PATH=$PATH:/sbin
1091 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1092 PATH=$PATH:/etc:$OPATH
1094 # These programs are used by the command hashing source to gather entropy
1095 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1096 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1097 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1098 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1099 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1100 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1101 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1102 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1103 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1104 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1105 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1106 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1107 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1108 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1109 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1110 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1114 # Where does ssh-rand-helper get its randomness from?
1115 INSTALL_SSH_PRNG_CMDS=""
1116 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1117 if test ! -z "$PRNGD_PORT" ; then
1118 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1119 elif test ! -z "$PRNGD_SOCKET" ; then
1120 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1122 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1123 RAND_HELPER_CMDHASH=yes
1124 INSTALL_SSH_PRNG_CMDS="yes"
1127 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1130 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1131 if test ! -z "$SONY" ; then
1132 LIBS="$LIBS -liberty";
1135 # Checks for data types
1136 AC_CHECK_SIZEOF(char, 1)
1137 AC_CHECK_SIZEOF(short int, 2)
1138 AC_CHECK_SIZEOF(int, 4)
1139 AC_CHECK_SIZEOF(long int, 4)
1140 AC_CHECK_SIZEOF(long long int, 8)
1142 # Sanity check long long for some platforms (AIX)
1143 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1144 ac_cv_sizeof_long_long_int=0
1147 # More checks for data types
1148 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1150 [ #include <sys/types.h> ],
1152 [ ac_cv_have_u_int="yes" ],
1153 [ ac_cv_have_u_int="no" ]
1156 if test "x$ac_cv_have_u_int" = "xyes" ; then
1157 AC_DEFINE(HAVE_U_INT)
1161 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1163 [ #include <sys/types.h> ],
1164 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1165 [ ac_cv_have_intxx_t="yes" ],
1166 [ ac_cv_have_intxx_t="no" ]
1169 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1170 AC_DEFINE(HAVE_INTXX_T)
1174 if (test -z "$have_intxx_t" && \
1175 test "x$ac_cv_header_stdint_h" = "xyes")
1177 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1179 [ #include <stdint.h> ],
1180 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1182 AC_DEFINE(HAVE_INTXX_T)
1185 [ AC_MSG_RESULT(no) ]
1189 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1192 #include <sys/types.h>
1193 #ifdef HAVE_STDINT_H
1194 # include <stdint.h>
1196 #include <sys/socket.h>
1197 #ifdef HAVE_SYS_BITYPES_H
1198 # include <sys/bitypes.h>
1201 [ int64_t a; a = 1;],
1202 [ ac_cv_have_int64_t="yes" ],
1203 [ ac_cv_have_int64_t="no" ]
1206 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1207 AC_DEFINE(HAVE_INT64_T)
1210 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1212 [ #include <sys/types.h> ],
1213 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1214 [ ac_cv_have_u_intxx_t="yes" ],
1215 [ ac_cv_have_u_intxx_t="no" ]
1218 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1219 AC_DEFINE(HAVE_U_INTXX_T)
1223 if test -z "$have_u_intxx_t" ; then
1224 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1226 [ #include <sys/socket.h> ],
1227 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1229 AC_DEFINE(HAVE_U_INTXX_T)
1232 [ AC_MSG_RESULT(no) ]
1236 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1238 [ #include <sys/types.h> ],
1239 [ u_int64_t a; a = 1;],
1240 [ ac_cv_have_u_int64_t="yes" ],
1241 [ ac_cv_have_u_int64_t="no" ]
1244 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1245 AC_DEFINE(HAVE_U_INT64_T)
1249 if test -z "$have_u_int64_t" ; then
1250 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1252 [ #include <sys/bitypes.h> ],
1253 [ u_int64_t a; a = 1],
1255 AC_DEFINE(HAVE_U_INT64_T)
1258 [ AC_MSG_RESULT(no) ]
1262 if test -z "$have_u_intxx_t" ; then
1263 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1266 #include <sys/types.h>
1268 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1269 [ ac_cv_have_uintxx_t="yes" ],
1270 [ ac_cv_have_uintxx_t="no" ]
1273 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1274 AC_DEFINE(HAVE_UINTXX_T)
1278 if test -z "$have_uintxx_t" ; then
1279 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1281 [ #include <stdint.h> ],
1282 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1284 AC_DEFINE(HAVE_UINTXX_T)
1287 [ AC_MSG_RESULT(no) ]
1291 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1292 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1294 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1297 #include <sys/bitypes.h>
1300 int8_t a; int16_t b; int32_t c;
1301 u_int8_t e; u_int16_t f; u_int32_t g;
1302 a = b = c = e = f = g = 1;
1305 AC_DEFINE(HAVE_U_INTXX_T)
1306 AC_DEFINE(HAVE_INTXX_T)
1314 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1317 #include <sys/types.h>
1319 [ u_char foo; foo = 125; ],
1320 [ ac_cv_have_u_char="yes" ],
1321 [ ac_cv_have_u_char="no" ]
1324 if test "x$ac_cv_have_u_char" = "xyes" ; then
1325 AC_DEFINE(HAVE_U_CHAR)
1330 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1332 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1335 #include <sys/types.h>
1337 [ size_t foo; foo = 1235; ],
1338 [ ac_cv_have_size_t="yes" ],
1339 [ ac_cv_have_size_t="no" ]
1342 if test "x$ac_cv_have_size_t" = "xyes" ; then
1343 AC_DEFINE(HAVE_SIZE_T)
1346 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1349 #include <sys/types.h>
1351 [ ssize_t foo; foo = 1235; ],
1352 [ ac_cv_have_ssize_t="yes" ],
1353 [ ac_cv_have_ssize_t="no" ]
1356 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1357 AC_DEFINE(HAVE_SSIZE_T)
1360 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1365 [ clock_t foo; foo = 1235; ],
1366 [ ac_cv_have_clock_t="yes" ],
1367 [ ac_cv_have_clock_t="no" ]
1370 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1371 AC_DEFINE(HAVE_CLOCK_T)
1374 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1377 #include <sys/types.h>
1378 #include <sys/socket.h>
1380 [ sa_family_t foo; foo = 1235; ],
1381 [ ac_cv_have_sa_family_t="yes" ],
1384 #include <sys/types.h>
1385 #include <sys/socket.h>
1386 #include <netinet/in.h>
1388 [ sa_family_t foo; foo = 1235; ],
1389 [ ac_cv_have_sa_family_t="yes" ],
1391 [ ac_cv_have_sa_family_t="no" ]
1395 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1396 AC_DEFINE(HAVE_SA_FAMILY_T)
1399 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1402 #include <sys/types.h>
1404 [ pid_t foo; foo = 1235; ],
1405 [ ac_cv_have_pid_t="yes" ],
1406 [ ac_cv_have_pid_t="no" ]
1409 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1410 AC_DEFINE(HAVE_PID_T)
1413 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1416 #include <sys/types.h>
1418 [ mode_t foo; foo = 1235; ],
1419 [ ac_cv_have_mode_t="yes" ],
1420 [ ac_cv_have_mode_t="no" ]
1423 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1424 AC_DEFINE(HAVE_MODE_T)
1428 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1431 #include <sys/types.h>
1432 #include <sys/socket.h>
1434 [ struct sockaddr_storage s; ],
1435 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1436 [ ac_cv_have_struct_sockaddr_storage="no" ]
1439 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1440 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1443 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1446 #include <sys/types.h>
1447 #include <netinet/in.h>
1449 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1450 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1451 [ ac_cv_have_struct_sockaddr_in6="no" ]
1454 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1455 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1458 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1461 #include <sys/types.h>
1462 #include <netinet/in.h>
1464 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1465 [ ac_cv_have_struct_in6_addr="yes" ],
1466 [ ac_cv_have_struct_in6_addr="no" ]
1469 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1470 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1473 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1476 #include <sys/types.h>
1477 #include <sys/socket.h>
1480 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1481 [ ac_cv_have_struct_addrinfo="yes" ],
1482 [ ac_cv_have_struct_addrinfo="no" ]
1485 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1486 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1489 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1491 [ #include <sys/time.h> ],
1492 [ struct timeval tv; tv.tv_sec = 1;],
1493 [ ac_cv_have_struct_timeval="yes" ],
1494 [ ac_cv_have_struct_timeval="no" ]
1497 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1498 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1499 have_struct_timeval=1
1502 AC_CHECK_TYPES(struct timespec)
1504 # We need int64_t or else certian parts of the compile will fail.
1505 if test "x$ac_cv_have_int64_t" = "xno" -a \
1506 "x$ac_cv_sizeof_long_int" != "x8" -a \
1507 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1508 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1509 echo "an alternative compiler (I.E., GCC) before continuing."
1513 dnl test snprintf (broken on SCO w/gcc)
1518 #ifdef HAVE_SNPRINTF
1522 char expected_out[50];
1524 #if (SIZEOF_LONG_INT == 8)
1525 long int num = 0x7fffffffffffffff;
1527 long long num = 0x7fffffffffffffffll;
1529 strcpy(expected_out, "9223372036854775807");
1530 snprintf(buf, mazsize, "%lld", num);
1531 if(strcmp(buf, expected_out) != 0)
1538 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1542 dnl Checks for structure members
1543 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1544 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1545 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1546 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1547 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1548 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1549 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1550 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1551 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1552 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1553 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1554 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1555 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1556 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1557 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1558 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1559 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1561 AC_CHECK_MEMBERS([struct stat.st_blksize])
1563 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1564 ac_cv_have_ss_family_in_struct_ss, [
1567 #include <sys/types.h>
1568 #include <sys/socket.h>
1570 [ struct sockaddr_storage s; s.ss_family = 1; ],
1571 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1572 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1575 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1576 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1579 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1580 ac_cv_have___ss_family_in_struct_ss, [
1583 #include <sys/types.h>
1584 #include <sys/socket.h>
1586 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1587 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1588 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1591 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1592 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1595 AC_CACHE_CHECK([for pw_class field in struct passwd],
1596 ac_cv_have_pw_class_in_struct_passwd, [
1601 [ struct passwd p; p.pw_class = 0; ],
1602 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1603 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1606 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1607 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1610 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1611 ac_cv_have_pw_expire_in_struct_passwd, [
1616 [ struct passwd p; p.pw_expire = 0; ],
1617 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1618 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1621 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1622 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1625 AC_CACHE_CHECK([for pw_change field in struct passwd],
1626 ac_cv_have_pw_change_in_struct_passwd, [
1631 [ struct passwd p; p.pw_change = 0; ],
1632 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1633 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1636 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1637 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1640 dnl make sure we're using the real structure members and not defines
1641 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1642 ac_cv_have_accrights_in_msghdr, [
1645 #include <sys/types.h>
1646 #include <sys/socket.h>
1647 #include <sys/uio.h>
1649 #ifdef msg_accrights
1653 m.msg_accrights = 0;
1657 [ ac_cv_have_accrights_in_msghdr="yes" ],
1658 [ ac_cv_have_accrights_in_msghdr="no" ]
1661 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1662 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1665 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1666 ac_cv_have_control_in_msghdr, [
1669 #include <sys/types.h>
1670 #include <sys/socket.h>
1671 #include <sys/uio.h>
1681 [ ac_cv_have_control_in_msghdr="yes" ],
1682 [ ac_cv_have_control_in_msghdr="no" ]
1685 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1686 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1689 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1691 [ extern char *__progname; printf("%s", __progname); ],
1692 [ ac_cv_libc_defines___progname="yes" ],
1693 [ ac_cv_libc_defines___progname="no" ]
1696 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1697 AC_DEFINE(HAVE___PROGNAME)
1700 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1704 [ printf("%s", __FUNCTION__); ],
1705 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1706 [ ac_cv_cc_implements___FUNCTION__="no" ]
1709 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1710 AC_DEFINE(HAVE___FUNCTION__)
1713 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1717 [ printf("%s", __func__); ],
1718 [ ac_cv_cc_implements___func__="yes" ],
1719 [ ac_cv_cc_implements___func__="no" ]
1722 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1723 AC_DEFINE(HAVE___func__)
1726 AC_CACHE_CHECK([whether getopt has optreset support],
1727 ac_cv_have_getopt_optreset, [
1732 [ extern int optreset; optreset = 0; ],
1733 [ ac_cv_have_getopt_optreset="yes" ],
1734 [ ac_cv_have_getopt_optreset="no" ]
1737 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1738 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1741 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1743 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1744 [ ac_cv_libc_defines_sys_errlist="yes" ],
1745 [ ac_cv_libc_defines_sys_errlist="no" ]
1748 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1749 AC_DEFINE(HAVE_SYS_ERRLIST)
1753 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1755 [ extern int sys_nerr; printf("%i", sys_nerr);],
1756 [ ac_cv_libc_defines_sys_nerr="yes" ],
1757 [ ac_cv_libc_defines_sys_nerr="no" ]
1760 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1761 AC_DEFINE(HAVE_SYS_NERR)
1766 # Check whether user wants sectok support
1768 [ --with-sectok Enable smartcard support using libsectok],
1770 if test "x$withval" != "xno" ; then
1771 if test "x$withval" != "xyes" ; then
1772 CPPFLAGS="$CPPFLAGS -I${withval}"
1773 LDFLAGS="$LDFLAGS -L${withval}"
1774 if test ! -z "$need_dash_r" ; then
1775 LDFLAGS="$LDFLAGS -R${withval}"
1777 if test ! -z "$blibpath" ; then
1778 blibpath="$blibpath:${withval}"
1781 AC_CHECK_HEADERS(sectok.h)
1782 if test "$ac_cv_header_sectok_h" != yes; then
1783 AC_MSG_ERROR(Can't find sectok.h)
1785 AC_CHECK_LIB(sectok, sectok_open)
1786 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1787 AC_MSG_ERROR(Can't find libsectok)
1789 AC_DEFINE(SMARTCARD)
1790 AC_DEFINE(USE_SECTOK)
1791 SCARD_MSG="yes, using sectok"
1796 # Check whether user wants OpenSC support
1798 AC_HELP_STRING([--with-opensc=PFX],
1799 [Enable smartcard support using OpenSC]),
1800 opensc_config_prefix="$withval", opensc_config_prefix="")
1801 if test x$opensc_config_prefix != x ; then
1802 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1803 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1804 if test "$OPENSC_CONFIG" != "no"; then
1805 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1806 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1807 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1808 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1809 AC_DEFINE(SMARTCARD)
1810 AC_DEFINE(USE_OPENSC)
1811 SCARD_MSG="yes, using OpenSC"
1815 # Check whether user wants Kerberos 5 support
1817 AC_ARG_WITH(kerberos5,
1818 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1820 if test "x$withval" != "xno" ; then
1821 if test "x$withval" = "xyes" ; then
1822 KRB5ROOT="/usr/local"
1826 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1827 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1830 AC_MSG_CHECKING(whether we are using Heimdal)
1831 AC_TRY_COMPILE([ #include <krb5.h> ],
1832 [ char *tmp = heimdal_version; ],
1833 [ AC_MSG_RESULT(yes)
1835 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1838 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1841 if test ! -z "$need_dash_r" ; then
1842 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1844 if test ! -z "$blibpath" ; then
1845 blibpath="$blibpath:${KRB5ROOT}/lib"
1847 AC_CHECK_LIB(resolv, dn_expand, , )
1853 # Check whether user wants Kerberos 4 support
1855 AC_ARG_WITH(kerberos4,
1856 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1858 if test "x$withval" != "xno" ; then
1859 if test "x$withval" != "xyes" ; then
1860 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1861 LDFLAGS="$LDFLAGS -L${withval}/lib"
1862 if test ! -z "$need_dash_r" ; then
1863 LDFLAGS="$LDFLAGS -R${withval}/lib"
1865 if test ! -z "$blibpath" ; then
1866 blibpath="$blibpath:${withval}/lib"
1869 if test -d /usr/include/kerberosIV ; then
1870 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1874 AC_CHECK_HEADERS(krb.h)
1875 if test "$ac_cv_header_krb_h" != yes; then
1876 AC_MSG_WARN([Cannot find krb.h, build may fail])
1878 AC_CHECK_LIB(krb, main)
1879 if test "$ac_cv_lib_krb_main" != yes; then
1880 AC_CHECK_LIB(krb4, main)
1881 if test "$ac_cv_lib_krb4_main" != yes; then
1882 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1889 AC_CHECK_LIB(des, des_cbc_encrypt)
1890 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1891 AC_CHECK_LIB(des425, des_cbc_encrypt)
1892 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1893 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1900 AC_CHECK_LIB(resolv, dn_expand, , )
1908 # Check whether user wants AFS support
1911 [ --with-afs=PATH Enable AFS support],
1913 if test "x$withval" != "xno" ; then
1915 if test "x$withval" != "xyes" ; then
1916 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1917 LDFLAGS="$LDFLAGS -L${withval}/lib"
1920 if test -z "$KRB4" ; then
1921 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1925 if test ! -z "$AFS_LIBS" ; then
1926 LIBS="$LIBS $AFS_LIBS"
1933 LIBS="$LIBS $KLIBS $K5LIBS"
1935 # Looking for programs, paths and files
1937 PRIVSEP_PATH=/var/empty
1938 AC_ARG_WITH(privsep-path,
1939 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1941 if test "x$withval" != "$no" ; then
1942 PRIVSEP_PATH=$withval
1946 AC_SUBST(PRIVSEP_PATH)
1949 [ --with-xauth=PATH Specify path to xauth program ],
1951 if test "x$withval" != "xno" ; then
1957 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1958 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1959 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1960 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1961 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1962 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1963 xauth_path="/usr/openwin/bin/xauth"
1969 AC_ARG_ENABLE(strip,
1970 [ --disable-strip Disable calling strip(1) on install],
1972 if test "x$enableval" = "xno" ; then
1979 if test -z "$xauth_path" ; then
1980 XAUTH_PATH="undefined"
1981 AC_SUBST(XAUTH_PATH)
1983 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1984 XAUTH_PATH=$xauth_path
1985 AC_SUBST(XAUTH_PATH)
1988 # Check for mail directory (last resort if we cannot get it from headers)
1989 if test ! -z "$MAIL" ; then
1990 maildir=`dirname $MAIL`
1991 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1994 if test -z "$no_dev_ptmx" ; then
1995 if test "x$disable_ptmx_check" != "xyes" ; then
1996 AC_CHECK_FILE("/dev/ptmx",
1998 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2004 AC_CHECK_FILE("/dev/ptc",
2006 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2011 # Options from here on. Some of these are preset by platform above
2012 AC_ARG_WITH(mantype,
2013 [ --with-mantype=man|cat|doc Set man page type],
2020 AC_MSG_ERROR(invalid man type: $withval)
2025 if test -z "$MANTYPE"; then
2026 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2027 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2028 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2030 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2037 if test "$MANTYPE" = "doc"; then
2044 # Check whether to enable MD5 passwords
2046 AC_ARG_WITH(md5-passwords,
2047 [ --with-md5-passwords Enable use of MD5 passwords],
2049 if test "x$withval" != "xno" ; then
2050 AC_DEFINE(HAVE_MD5_PASSWORDS)
2056 # Whether to disable shadow password support
2058 [ --without-shadow Disable shadow password support],
2060 if test "x$withval" = "xno" ; then
2061 AC_DEFINE(DISABLE_SHADOW)
2067 if test -z "$disable_shadow" ; then
2068 AC_MSG_CHECKING([if the systems has expire shadow information])
2071 #include <sys/types.h>
2074 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2075 [ sp_expire_available=yes ], []
2078 if test "x$sp_expire_available" = "xyes" ; then
2080 AC_DEFINE(HAS_SHADOW_EXPIRE)
2086 # Use ip address instead of hostname in $DISPLAY
2087 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2088 DISPLAY_HACK_MSG="yes"
2089 AC_DEFINE(IPADDR_IN_DISPLAY)
2091 DISPLAY_HACK_MSG="no"
2092 AC_ARG_WITH(ipaddr-display,
2093 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2095 if test "x$withval" != "xno" ; then
2096 AC_DEFINE(IPADDR_IN_DISPLAY)
2097 DISPLAY_HACK_MSG="yes"
2103 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2104 if test $ac_cv_func_login_getcapbool = "yes" -a \
2105 $ac_cv_header_login_cap_h = "yes" ; then
2108 # Whether to mess with the default path
2109 SERVER_PATH_MSG="(default)"
2110 AC_ARG_WITH(default-path,
2111 [ --with-default-path= Specify default \$PATH environment for server],
2113 if test "$USES_LOGIN_CONF" = "yes" ; then
2115 --with-default-path=PATH has no effect on this system.
2116 Edit /etc/login.conf instead.])
2117 elif test "x$withval" != "xno" ; then
2118 user_path="$withval"
2119 SERVER_PATH_MSG="$withval"
2122 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2123 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2127 /* find out what STDPATH is */
2132 #ifndef _PATH_STDPATH
2133 # ifdef _PATH_USERPATH /* Irix */
2134 # define _PATH_STDPATH _PATH_USERPATH
2136 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2139 #include <sys/types.h>
2140 #include <sys/stat.h>
2142 #define DATA "conftest.stdpath"
2149 fd = fopen(DATA,"w");
2153 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2158 ], [ user_path=`cat conftest.stdpath` ],
2159 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2160 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2162 # make sure $bindir is in USER_PATH so scp will work
2163 t_bindir=`eval echo ${bindir}`
2165 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2168 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2170 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2171 if test $? -ne 0 ; then
2172 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2173 if test $? -ne 0 ; then
2174 user_path=$user_path:$t_bindir
2175 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2180 if test "$USES_LOGIN_CONF" != "yes" ; then
2181 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2185 # Set superuser path separately to user path
2186 AC_ARG_WITH(superuser-path,
2187 [ --with-superuser-path= Specify different path for super-user],
2189 if test "x$withval" != "xno" ; then
2190 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2191 superuser_path=$withval
2197 # Whether to force IPv4 by default (needed on broken glibc Linux)
2199 AC_ARG_WITH(ipv4-default,
2200 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2202 if test "x$withval" != "xno" ; then
2203 AC_DEFINE(IPV4_DEFAULT)
2209 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2210 IPV4_IN6_HACK_MSG="no"
2212 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2214 if test "x$withval" != "xno" ; then
2216 AC_DEFINE(IPV4_IN_IPV6)
2217 IPV4_IN6_HACK_MSG="yes"
2222 if test "x$inet6_default_4in6" = "xyes"; then
2223 AC_MSG_RESULT([yes (default)])
2224 AC_DEFINE(IPV4_IN_IPV6)
2225 IPV4_IN6_HACK_MSG="yes"
2227 AC_MSG_RESULT([no (default)])
2232 # Whether to enable BSD auth support
2234 AC_ARG_WITH(bsd-auth,
2235 [ --with-bsd-auth Enable BSD auth support],
2237 if test "x$withval" != "xno" ; then
2244 # Where to place sshd.pid
2246 # make sure the directory exists
2247 if test ! -d $piddir ; then
2248 piddir=`eval echo ${sysconfdir}`
2250 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2254 AC_ARG_WITH(pid-dir,
2255 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2257 if test "x$withval" != "xno" ; then
2259 if test ! -d $piddir ; then
2260 AC_MSG_WARN([** no $piddir directory on this system **])
2266 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2269 dnl allow user to disable some login recording features
2270 AC_ARG_ENABLE(lastlog,
2271 [ --disable-lastlog disable use of lastlog even if detected [no]],
2272 [ AC_DEFINE(DISABLE_LASTLOG) ]
2275 [ --disable-utmp disable use of utmp even if detected [no]],
2276 [ AC_DEFINE(DISABLE_UTMP) ]
2278 AC_ARG_ENABLE(utmpx,
2279 [ --disable-utmpx disable use of utmpx even if detected [no]],
2280 [ AC_DEFINE(DISABLE_UTMPX) ]
2283 [ --disable-wtmp disable use of wtmp even if detected [no]],
2284 [ AC_DEFINE(DISABLE_WTMP) ]
2286 AC_ARG_ENABLE(wtmpx,
2287 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2288 [ AC_DEFINE(DISABLE_WTMPX) ]
2290 AC_ARG_ENABLE(libutil,
2291 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2292 [ AC_DEFINE(DISABLE_LOGIN) ]
2294 AC_ARG_ENABLE(pututline,
2295 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2296 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2298 AC_ARG_ENABLE(pututxline,
2299 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2300 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2302 AC_ARG_WITH(lastlog,
2303 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2305 if test "x$withval" = "xno" ; then
2306 AC_DEFINE(DISABLE_LASTLOG)
2308 conf_lastlog_location=$withval
2313 dnl lastlog, [uw]tmpx? detection
2314 dnl NOTE: set the paths in the platform section to avoid the
2315 dnl need for command-line parameters
2316 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2318 dnl lastlog detection
2319 dnl NOTE: the code itself will detect if lastlog is a directory
2320 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2322 #include <sys/types.h>
2324 #ifdef HAVE_LASTLOG_H
2325 # include <lastlog.h>
2334 [ char *lastlog = LASTLOG_FILE; ],
2335 [ AC_MSG_RESULT(yes) ],
2338 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2340 #include <sys/types.h>
2342 #ifdef HAVE_LASTLOG_H
2343 # include <lastlog.h>
2349 [ char *lastlog = _PATH_LASTLOG; ],
2350 [ AC_MSG_RESULT(yes) ],
2353 system_lastlog_path=no
2358 if test -z "$conf_lastlog_location"; then
2359 if test x"$system_lastlog_path" = x"no" ; then
2360 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2361 if (test -d "$f" || test -f "$f") ; then
2362 conf_lastlog_location=$f
2365 if test -z "$conf_lastlog_location"; then
2366 AC_MSG_WARN([** Cannot find lastlog **])
2367 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2372 if test -n "$conf_lastlog_location"; then
2373 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2377 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2379 #include <sys/types.h>
2385 [ char *utmp = UTMP_FILE; ],
2386 [ AC_MSG_RESULT(yes) ],
2388 system_utmp_path=no ]
2390 if test -z "$conf_utmp_location"; then
2391 if test x"$system_utmp_path" = x"no" ; then
2392 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2393 if test -f $f ; then
2394 conf_utmp_location=$f
2397 if test -z "$conf_utmp_location"; then
2398 AC_DEFINE(DISABLE_UTMP)
2402 if test -n "$conf_utmp_location"; then
2403 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2407 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2409 #include <sys/types.h>
2415 [ char *wtmp = WTMP_FILE; ],
2416 [ AC_MSG_RESULT(yes) ],
2418 system_wtmp_path=no ]
2420 if test -z "$conf_wtmp_location"; then
2421 if test x"$system_wtmp_path" = x"no" ; then
2422 for f in /usr/adm/wtmp /var/log/wtmp; do
2423 if test -f $f ; then
2424 conf_wtmp_location=$f
2427 if test -z "$conf_wtmp_location"; then
2428 AC_DEFINE(DISABLE_WTMP)
2432 if test -n "$conf_wtmp_location"; then
2433 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2437 dnl utmpx detection - I don't know any system so perverse as to require
2438 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2440 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2442 #include <sys/types.h>
2451 [ char *utmpx = UTMPX_FILE; ],
2452 [ AC_MSG_RESULT(yes) ],
2454 system_utmpx_path=no ]
2456 if test -z "$conf_utmpx_location"; then
2457 if test x"$system_utmpx_path" = x"no" ; then
2458 AC_DEFINE(DISABLE_UTMPX)
2461 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2465 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2467 #include <sys/types.h>
2476 [ char *wtmpx = WTMPX_FILE; ],
2477 [ AC_MSG_RESULT(yes) ],
2479 system_wtmpx_path=no ]
2481 if test -z "$conf_wtmpx_location"; then
2482 if test x"$system_wtmpx_path" = x"no" ; then
2483 AC_DEFINE(DISABLE_WTMPX)
2486 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2490 if test ! -z "$blibpath" ; then
2491 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2492 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
2495 dnl remove pam and dl because they are in $LIBPAM
2496 if test "$PAM_MSG" = yes ; then
2497 LIBS=`echo $LIBS | sed 's/-lpam //'`
2499 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2500 LIBS=`echo $LIBS | sed 's/-ldl //'`
2504 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2507 # Print summary of options
2509 # Someone please show me a better way :)
2510 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2511 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2512 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2513 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2514 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2515 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2516 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2517 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2518 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2519 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2522 echo "OpenSSH has been configured with the following options:"
2523 echo " User binaries: $B"
2524 echo " System binaries: $C"
2525 echo " Configuration files: $D"
2526 echo " Askpass program: $E"
2527 echo " Manual pages: $F"
2528 echo " PID file: $G"
2529 echo " Privilege separation chroot path: $H"
2530 if test "$USES_LOGIN_CONF" = "yes" ; then
2531 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2533 echo " sshd default user PATH: $I"
2535 if test ! -z "$superuser_path" ; then
2536 echo " sshd superuser user PATH: $J"
2538 echo " Manpage format: $MANTYPE"
2539 echo " PAM support: ${PAM_MSG}"
2540 echo " KerberosIV support: $KRB4_MSG"
2541 echo " KerberosV support: $KRB5_MSG"
2542 echo " Smartcard support: $SCARD_MSG"
2543 echo " AFS support: $AFS_MSG"
2544 echo " S/KEY support: $SKEY_MSG"
2545 echo " TCP Wrappers support: $TCPW_MSG"
2546 echo " MD5 password support: $MD5_MSG"
2547 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2548 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2549 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2550 echo " BSD Auth support: $BSD_AUTH_MSG"
2551 echo " Random number source: $RAND_MSG"
2552 if test ! -z "$USE_RAND_HELPER" ; then
2553 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2558 echo " Host: ${host}"
2559 echo " Compiler: ${CC}"
2560 echo " Compiler flags: ${CFLAGS}"
2561 echo "Preprocessor flags: ${CPPFLAGS}"
2562 echo " Linker flags: ${LDFLAGS}"
2563 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2567 if test "x$PAM_MSG" = "xyes" ; then
2568 echo "PAM is enabled. You may need to install a PAM control file "
2569 echo "for sshd, otherwise password authentication may fail. "
2570 echo "Example PAM control files can be found in the contrib/ "
2575 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2576 echo "WARNING: you are using the builtin random number collection "
2577 echo "service. Please read WARNING.RNG and request that your OS "
2578 echo "vendor includes kernel-based random number collection in "
2579 echo "future versions of your OS."