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 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
75 [AC_CHECK_LIB(s,authenticate,
76 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 AC_DEFINE(BROKEN_REALPATH)
82 dnl AIX handles lastlog as part of its login message
83 AC_DEFINE(DISABLE_LASTLOG)
84 AC_DEFINE(LOGIN_NEEDS_UTMPX)
85 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
86 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
89 check_for_libcrypt_later=1
90 LIBS="$LIBS /usr/lib/textmode.o"
91 AC_DEFINE(HAVE_CYGWIN)
93 AC_DEFINE(DISABLE_SHADOW)
94 AC_DEFINE(IPV4_DEFAULT)
95 AC_DEFINE(IP_TOS_IS_BROKEN)
96 AC_DEFINE(NO_X11_UNIX_SOCKETS)
97 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
98 AC_DEFINE(DISABLE_FD_PASSING)
99 AC_DEFINE(SETGROUPS_NOOP)
102 AC_DEFINE(IP_TOS_IS_BROKEN)
105 AC_MSG_CHECKING(if we have working getaddrinfo)
106 AC_TRY_RUN([#include <mach-o/dyld.h>
107 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
111 }], [AC_MSG_RESULT(working)],
112 [AC_MSG_RESULT(buggy)
113 AC_DEFINE(BROKEN_GETADDRINFO)],
114 [AC_MSG_RESULT(assume it is working)])
117 if test -z "$GCC"; then
120 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
121 IPADDR_IN_DISPLAY=yes
122 AC_DEFINE(HAVE_SECUREWARE)
124 AC_DEFINE(LOGIN_NO_ENDOPT)
125 AC_DEFINE(LOGIN_NEEDS_UTMPX)
126 AC_DEFINE(DISABLE_SHADOW)
127 AC_DEFINE(DISABLE_UTMP)
128 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
129 LIBS="$LIBS -lsec -lsecpw"
130 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
131 disable_ptmx_check=yes
134 if test -z "$GCC"; then
137 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
138 IPADDR_IN_DISPLAY=yes
140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
142 AC_DEFINE(DISABLE_SHADOW)
143 AC_DEFINE(DISABLE_UTMP)
144 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
146 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
149 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
150 IPADDR_IN_DISPLAY=yes
151 AC_DEFINE(PAM_SUN_CODEBASE)
153 AC_DEFINE(LOGIN_NO_ENDOPT)
154 AC_DEFINE(LOGIN_NEEDS_UTMPX)
155 AC_DEFINE(DISABLE_SHADOW)
156 AC_DEFINE(DISABLE_UTMP)
157 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
159 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
162 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
164 PATH="$PATH:/usr/etc"
165 AC_DEFINE(BROKEN_INET_NTOA)
166 AC_DEFINE(WITH_ABBREV_NO_TTY)
169 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
171 PATH="$PATH:/usr/etc"
172 AC_DEFINE(WITH_IRIX_ARRAY)
173 AC_DEFINE(WITH_IRIX_PROJECT)
174 AC_DEFINE(WITH_IRIX_AUDIT)
175 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
176 AC_DEFINE(BROKEN_INET_NTOA)
177 AC_DEFINE(WITH_ABBREV_NO_TTY)
181 check_for_libcrypt_later=1
182 AC_DEFINE(DONT_TRY_OTHER_AF)
183 AC_DEFINE(PAM_TTY_KLUDGE)
184 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
185 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
186 inet6_default_4in6=yes
188 mips-sony-bsd|mips-sony-newsos4)
189 AC_DEFINE(HAVE_NEWS4)
193 check_for_libcrypt_before=1
197 check_for_libcrypt_later=1
200 conf_lastlog_location="/usr/adm/lastlog"
201 conf_utmp_location=/etc/utmp
202 conf_wtmp_location=/usr/adm/wtmp
205 AC_DEFINE(BROKEN_REALPATH)
207 AC_DEFINE(BROKEN_SAVED_UIDS)
208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
213 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
215 AC_DEFINE(PAM_SUN_CODEBASE)
216 AC_DEFINE(LOGIN_NEEDS_UTMPX)
217 AC_DEFINE(LOGIN_NEEDS_TERM)
218 AC_DEFINE(PAM_TTY_KLUDGE)
219 # hardwire lastlog location (can't detect it on some versions)
220 conf_lastlog_location="/var/adm/lastlog"
221 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
222 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
223 if test "$sol2ver" -ge 8; then
225 AC_DEFINE(DISABLE_UTMP)
226 AC_DEFINE(DISABLE_WTMP)
232 CPPFLAGS="$CPPFLAGS -DSUNOS4"
233 AC_CHECK_FUNCS(getpwanam)
234 AC_DEFINE(PAM_SUN_CODEBASE)
235 conf_utmp_location=/etc/utmp
236 conf_wtmp_location=/var/adm/wtmp
237 conf_lastlog_location=/var/adm/lastlog
241 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
242 LDFLAGS="$LDFLAGS -L/usr/local/lib"
247 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
248 # /usr/ucblib MUST NOT be searched on ReliantUNIX
249 LDFLAGS="$LDFLAGS -L/usr/local/lib"
250 IPADDR_IN_DISPLAY=yes
252 AC_DEFINE(IP_TOS_IS_BROKEN)
253 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
254 # Attention: always take care to bind libsocket and libnsl before libc,
255 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
258 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
259 LDFLAGS="$LDFLAGS -L/usr/local/lib"
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"
272 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
273 LDFLAGS="$LDFLAGS -L/usr/local/lib"
274 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
277 AC_DEFINE(BROKEN_SYS_TERMIO_H)
279 AC_DEFINE(HAVE_SECUREWARE)
280 AC_DEFINE(DISABLE_SHADOW)
281 AC_DEFINE(BROKEN_SAVED_UIDS)
282 AC_CHECK_FUNCS(getluid setluid)
284 do_sco3_extra_lib_check=yes
287 if test -z "$GCC"; then
288 CFLAGS="$CFLAGS -belf"
290 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
291 LDFLAGS="$LDFLAGS -L/usr/local/lib"
292 LIBS="$LIBS -lprot -lx -ltinfo -lm"
295 AC_DEFINE(HAVE_SECUREWARE)
296 AC_DEFINE(DISABLE_SHADOW)
297 AC_DEFINE(DISABLE_FD_PASSING)
298 AC_CHECK_FUNCS(getluid setluid)
303 AC_DEFINE(DISABLE_FD_PASSING)
305 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
310 AC_DEFINE(DISABLE_FD_PASSING)
311 AC_DEFINE(NO_SSH_LASTLOG)
312 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
313 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
317 AC_MSG_CHECKING(for Digital Unix SIA)
320 [ --with-osfsia Enable Digital Unix SIA],
322 if test "x$withval" = "xno" ; then
323 AC_MSG_RESULT(disabled)
328 if test -z "$no_osfsia" ; then
329 if test -f /etc/sia/matrix.conf; then
331 AC_DEFINE(HAVE_OSF_SIA)
332 AC_DEFINE(DISABLE_LOGIN)
333 LIBS="$LIBS -lsecurity -ldb -lm -laud"
338 AC_DEFINE(DISABLE_FD_PASSING)
343 AC_DEFINE(NO_X11_UNIX_SOCKETS)
344 AC_DEFINE(MISSING_NFDBITS)
345 AC_DEFINE(MISSING_HOWMANY)
346 AC_DEFINE(MISSING_FD_MASK)
350 # Allow user to specify flags
352 [ --with-cflags Specify additional flags to pass to compiler],
354 if test "x$withval" != "xno" ; then
355 CFLAGS="$CFLAGS $withval"
359 AC_ARG_WITH(cppflags,
360 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
362 if test "x$withval" != "xno"; then
363 CPPFLAGS="$CPPFLAGS $withval"
368 [ --with-ldflags Specify additional flags to pass to linker],
370 if test "x$withval" != "xno" ; then
371 LDFLAGS="$LDFLAGS $withval"
376 [ --with-libs Specify additional libraries to link with],
378 if test "x$withval" != "xno" ; then
379 LIBS="$LIBS $withval"
384 # Checks for header files.
385 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
386 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
387 login_cap.h maillock.h netdb.h netgroup.h \
388 netinet/in_systm.h paths.h pty.h readpassphrase.h \
389 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
390 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
391 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
392 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
393 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
394 util.h utime.h utmp.h utmpx.h)
396 # Checks for libraries.
397 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
398 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
400 dnl SCO OS3 needs this for libwrap
401 if test "x$with_tcp_wrappers" != "xno" ; then
402 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
403 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
407 AC_CHECK_FUNC(getspnam, ,
408 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
411 [ --without-rpath Disable auto-added -R linker paths],
413 if test "x$withval" = "xno" ; then
416 if test "x$withval" = "xyes" ; then
424 [ --with-zlib=PATH Use zlib in PATH],
426 if test "x$withval" = "xno" ; then
427 AC_MSG_ERROR([*** zlib is required ***])
429 if test -d "$withval/lib"; then
430 if test -n "${need_dash_r}"; then
431 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
433 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
436 if test -n "${need_dash_r}"; then
437 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
439 LDFLAGS="-L${withval} ${LDFLAGS}"
442 if test -d "$withval/include"; then
443 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
445 CPPFLAGS="-I${withval} ${CPPFLAGS}"
450 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
453 AC_CHECK_FUNC(strcasecmp,
454 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
456 AC_CHECK_FUNC(utimes,
457 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
458 LIBS="$LIBS -lc89"]) ]
461 dnl Checks for libutil functions
462 AC_CHECK_HEADERS(libutil.h)
463 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
464 AC_CHECK_FUNCS(logout updwtmp logwtmp)
468 # Check for ALTDIRFUNC glob() extension
469 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
470 AC_EGREP_CPP(FOUNDIT,
473 #ifdef GLOB_ALTDIRFUNC
478 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
486 # Check for g.gl_matchc glob() extension
487 AC_MSG_CHECKING(for gl_matchc field in glob_t)
488 AC_EGREP_CPP(FOUNDIT,
491 int main(void){glob_t g; g.gl_matchc = 1;}
494 AC_DEFINE(GLOB_HAS_GL_MATCHC)
502 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
505 #include <sys/types.h>
507 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
509 [AC_MSG_RESULT(yes)],
512 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
516 # Check whether user wants S/Key support
519 [ --with-skey[[=PATH]] Enable S/Key support
520 (optionally in PATH)],
522 if test "x$withval" != "xno" ; then
524 if test "x$withval" != "xyes" ; then
525 CPPFLAGS="$CPPFLAGS -I${withval}/include"
526 LDFLAGS="$LDFLAGS -L${withval}/lib"
533 AC_MSG_CHECKING([for s/key support])
538 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
540 [AC_MSG_RESULT(yes)],
543 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
549 # Check whether user wants TCP wrappers support
551 AC_ARG_WITH(tcp-wrappers,
552 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
553 (optionally in PATH)],
555 if test "x$withval" != "xno" ; then
557 saved_LDFLAGS="$LDFLAGS"
558 saved_CPPFLAGS="$CPPFLAGS"
559 if test -n "${withval}" -a "${withval}" != "yes"; then
560 if test -d "${withval}/lib"; then
561 if test -n "${need_dash_r}"; then
562 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
564 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
567 if test -n "${need_dash_r}"; then
568 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
570 LDFLAGS="-L${withval} ${LDFLAGS}"
573 if test -d "${withval}/include"; then
574 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
576 CPPFLAGS="-I${withval} ${CPPFLAGS}"
580 LIBS="$LIBWRAP $LIBS"
581 AC_MSG_CHECKING(for libwrap)
585 int deny_severity = 0, allow_severity = 0;
595 AC_MSG_ERROR([*** libwrap missing])
603 dnl Checks for library functions. Please keep in alphabetical order
605 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
606 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
607 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
608 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
609 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
610 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
611 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
612 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
613 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
614 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
615 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
618 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
620 dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
621 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
623 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
624 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
625 AC_CHECK_LIB(gen, dirname,[
626 AC_CACHE_CHECK([for broken dirname],
627 ac_cv_have_broken_dirname, [
635 int main(int argc, char **argv) {
638 strncpy(buf,"/etc", 32);
640 if (!s || strncmp(s, "/", 32) != 0) {
647 [ ac_cv_have_broken_dirname="no" ],
648 [ ac_cv_have_broken_dirname="yes" ]
652 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
654 AC_DEFINE(HAVE_DIRNAME)
655 AC_CHECK_HEADERS(libgen.h)
660 dnl Checks for time functions
661 AC_CHECK_FUNCS(gettimeofday time)
662 dnl Checks for utmp functions
663 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
664 AC_CHECK_FUNCS(utmpname)
665 dnl Checks for utmpx functions
666 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
667 AC_CHECK_FUNCS(setutxent utmpxname)
669 AC_CHECK_FUNC(daemon,
670 [AC_DEFINE(HAVE_DAEMON)],
671 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
674 AC_CHECK_FUNC(getpagesize,
675 [AC_DEFINE(HAVE_GETPAGESIZE)],
676 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
679 # Check for broken snprintf
680 if test "x$ac_cv_func_snprintf" = "xyes" ; then
681 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
685 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
687 [AC_MSG_RESULT(yes)],
690 AC_DEFINE(BROKEN_SNPRINTF)
691 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
696 dnl see whether mkstemp() requires XXXXXX
697 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
698 AC_MSG_CHECKING([for (overly) strict mkstemp])
702 main() { char template[]="conftest.mkstemp-test";
703 if (mkstemp(template) == -1)
705 unlink(template); exit(0);
713 AC_DEFINE(HAVE_STRICT_MKSTEMP)
717 AC_DEFINE(HAVE_STRICT_MKSTEMP)
727 [ --with-pam Enable PAM support ],
729 if test "x$withval" != "xno" ; then
730 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
731 AC_MSG_ERROR([PAM headers not found])
734 AC_CHECK_LIB(dl, dlopen, , )
735 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
736 AC_CHECK_FUNCS(pam_getenvlist)
742 if test $ac_cv_lib_dl_dlopen = yes; then
752 # Check for older PAM
753 if test "x$PAM_MSG" = "xyes" ; then
754 # Check PAM strerror arguments (old PAM)
755 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
759 #include <security/pam_appl.h>
761 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
764 AC_DEFINE(HAVE_OLD_PAM)
766 PAM_MSG="yes (old library)"
771 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
772 # because the system crypt() is more featureful.
773 if test "x$check_for_libcrypt_before" = "x1"; then
774 AC_CHECK_LIB(crypt, crypt)
778 saved_CPPFLAGS="$CPPFLAGS"
779 saved_LDFLAGS="$LDFLAGS"
781 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
783 if test "x$withval" != "xno" ; then
784 if test -d "$withval/lib"; then
785 if test -n "${need_dash_r}"; then
786 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
788 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
791 if test -n "${need_dash_r}"; then
792 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
794 LDFLAGS="-L${withval} ${LDFLAGS}"
797 if test -d "$withval/include"; then
798 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
800 CPPFLAGS="-I${withval} ${CPPFLAGS}"
805 LIBS="$LIBS -lcrypto"
806 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
808 dnl Check default openssl install dir
809 if test -n "${need_dash_r}"; then
810 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
812 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
814 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
815 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
817 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
823 # Determine OpenSSL header version
824 AC_MSG_CHECKING([OpenSSL header version])
829 #include <openssl/opensslv.h>
830 #define DATA "conftest.sslincver"
835 fd = fopen(DATA,"w");
839 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
846 ssl_header_ver=`cat conftest.sslincver`
847 AC_MSG_RESULT($ssl_header_ver)
850 AC_MSG_RESULT(not found)
851 AC_MSG_ERROR(OpenSSL version header not found.)
855 # Determine OpenSSL library version
856 AC_MSG_CHECKING([OpenSSL library version])
861 #include <openssl/opensslv.h>
862 #include <openssl/crypto.h>
863 #define DATA "conftest.ssllibver"
868 fd = fopen(DATA,"w");
872 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
879 ssl_library_ver=`cat conftest.ssllibver`
880 AC_MSG_RESULT($ssl_library_ver)
883 AC_MSG_RESULT(not found)
884 AC_MSG_ERROR(OpenSSL library not found.)
888 # Sanity check OpenSSL headers
889 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
893 #include <openssl/opensslv.h>
894 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
901 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
905 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
906 # version in OpenSSL. Skip this for PAM
907 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
908 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
912 ### Configure cryptographic random number support
914 # Check wheter OpenSSL seeds itself
915 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
919 #include <openssl/rand.h>
920 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
923 OPENSSL_SEEDS_ITSELF=yes
928 # Default to use of the rand helper if OpenSSL doesn't
935 # Do we want to force the use of the rand helper?
936 AC_ARG_WITH(rand-helper,
937 [ --with-rand-helper Use subprocess to gather strong randomness ],
939 if test "x$withval" = "xno" ; then
940 # Force use of OpenSSL's internal RNG, even if
941 # the previous test showed it to be unseeded.
942 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
943 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
944 OPENSSL_SEEDS_ITSELF=yes
953 # Which randomness source do we use?
954 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
956 AC_DEFINE(OPENSSL_PRNG_ONLY)
957 RAND_MSG="OpenSSL internal ONLY"
958 INSTALL_SSH_RAND_HELPER=""
959 elif test ! -z "$USE_RAND_HELPER" ; then
960 # install rand helper
961 RAND_MSG="ssh-rand-helper"
962 INSTALL_SSH_RAND_HELPER="yes"
964 AC_SUBST(INSTALL_SSH_RAND_HELPER)
966 ### Configuration of ssh-rand-helper
969 AC_ARG_WITH(prngd-port,
970 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
979 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
982 if test ! -z "$withval" ; then
983 PRNGD_PORT="$withval"
984 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
989 # PRNGD Unix domain socket
990 AC_ARG_WITH(prngd-socket,
991 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
995 withval="/var/run/egd-pool"
1003 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1007 if test ! -z "$withval" ; then
1008 if test ! -z "$PRNGD_PORT" ; then
1009 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1011 if test ! -r "$withval" ; then
1012 AC_MSG_WARN(Entropy socket is not readable)
1014 PRNGD_SOCKET="$withval"
1015 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1019 # Check for existing socket only if we don't have a random device already
1020 if test "$USE_RAND_HELPER" = yes ; then
1021 AC_MSG_CHECKING(for PRNGD/EGD socket)
1022 # Insert other locations here
1023 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1024 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1025 PRNGD_SOCKET="$sock"
1026 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1030 if test ! -z "$PRNGD_SOCKET" ; then
1031 AC_MSG_RESULT($PRNGD_SOCKET)
1033 AC_MSG_RESULT(not found)
1039 # Change default command timeout for hashing entropy source
1041 AC_ARG_WITH(entropy-timeout,
1042 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1044 if test "x$withval" != "xno" ; then
1045 entropy_timeout=$withval
1049 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1051 SSH_PRIVSEP_USER=sshd
1052 AC_ARG_WITH(privsep-user,
1053 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1055 if test -n "$withval"; then
1056 SSH_PRIVSEP_USER=$withval
1060 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1061 AC_SUBST(SSH_PRIVSEP_USER)
1063 # We do this little dance with the search path to insure
1064 # that programs that we select for use by installed programs
1065 # (which may be run by the super-user) come from trusted
1066 # locations before they come from the user's private area.
1067 # This should help avoid accidentally configuring some
1068 # random version of a program in someone's personal bin.
1072 test -h /bin 2> /dev/null && PATH=/usr/bin
1073 test -d /sbin && PATH=$PATH:/sbin
1074 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1075 PATH=$PATH:/etc:$OPATH
1077 # These programs are used by the command hashing source to gather entropy
1078 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1079 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1080 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1081 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1082 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1083 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1084 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1085 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1086 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1087 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1088 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1089 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1090 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1091 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1092 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1093 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1097 # Where does ssh-rand-helper get its randomness from?
1098 INSTALL_SSH_PRNG_CMDS=""
1099 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1100 if test ! -z "$PRNGD_PORT" ; then
1101 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1102 elif test ! -z "$PRNGD_SOCKET" ; then
1103 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1105 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1106 RAND_HELPER_CMDHASH=yes
1107 INSTALL_SSH_PRNG_CMDS="yes"
1110 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1113 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1114 if test ! -z "$SONY" ; then
1115 LIBS="$LIBS -liberty";
1118 # Checks for data types
1119 AC_CHECK_SIZEOF(char, 1)
1120 AC_CHECK_SIZEOF(short int, 2)
1121 AC_CHECK_SIZEOF(int, 4)
1122 AC_CHECK_SIZEOF(long int, 4)
1123 AC_CHECK_SIZEOF(long long int, 8)
1125 # Sanity check long long for some platforms (AIX)
1126 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1127 ac_cv_sizeof_long_long_int=0
1130 # More checks for data types
1131 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1133 [ #include <sys/types.h> ],
1135 [ ac_cv_have_u_int="yes" ],
1136 [ ac_cv_have_u_int="no" ]
1139 if test "x$ac_cv_have_u_int" = "xyes" ; then
1140 AC_DEFINE(HAVE_U_INT)
1144 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1146 [ #include <sys/types.h> ],
1147 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1148 [ ac_cv_have_intxx_t="yes" ],
1149 [ ac_cv_have_intxx_t="no" ]
1152 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1153 AC_DEFINE(HAVE_INTXX_T)
1157 if (test -z "$have_intxx_t" && \
1158 test "x$ac_cv_header_stdint_h" = "xyes")
1160 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1162 [ #include <stdint.h> ],
1163 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1165 AC_DEFINE(HAVE_INTXX_T)
1168 [ AC_MSG_RESULT(no) ]
1172 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1175 #include <sys/types.h>
1176 #ifdef HAVE_STDINT_H
1177 # include <stdint.h>
1179 #include <sys/socket.h>
1180 #ifdef HAVE_SYS_BITYPES_H
1181 # include <sys/bitypes.h>
1184 [ int64_t a; a = 1;],
1185 [ ac_cv_have_int64_t="yes" ],
1186 [ ac_cv_have_int64_t="no" ]
1189 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1190 AC_DEFINE(HAVE_INT64_T)
1193 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1195 [ #include <sys/types.h> ],
1196 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1197 [ ac_cv_have_u_intxx_t="yes" ],
1198 [ ac_cv_have_u_intxx_t="no" ]
1201 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_U_INTXX_T)
1206 if test -z "$have_u_intxx_t" ; then
1207 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1209 [ #include <sys/socket.h> ],
1210 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1212 AC_DEFINE(HAVE_U_INTXX_T)
1215 [ AC_MSG_RESULT(no) ]
1219 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1221 [ #include <sys/types.h> ],
1222 [ u_int64_t a; a = 1;],
1223 [ ac_cv_have_u_int64_t="yes" ],
1224 [ ac_cv_have_u_int64_t="no" ]
1227 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1228 AC_DEFINE(HAVE_U_INT64_T)
1232 if test -z "$have_u_int64_t" ; then
1233 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1235 [ #include <sys/bitypes.h> ],
1236 [ u_int64_t a; a = 1],
1238 AC_DEFINE(HAVE_U_INT64_T)
1241 [ AC_MSG_RESULT(no) ]
1245 if test -z "$have_u_intxx_t" ; then
1246 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1249 #include <sys/types.h>
1251 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1252 [ ac_cv_have_uintxx_t="yes" ],
1253 [ ac_cv_have_uintxx_t="no" ]
1256 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1257 AC_DEFINE(HAVE_UINTXX_T)
1261 if test -z "$have_uintxx_t" ; then
1262 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1264 [ #include <stdint.h> ],
1265 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1267 AC_DEFINE(HAVE_UINTXX_T)
1270 [ AC_MSG_RESULT(no) ]
1274 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1275 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1277 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1280 #include <sys/bitypes.h>
1283 int8_t a; int16_t b; int32_t c;
1284 u_int8_t e; u_int16_t f; u_int32_t g;
1285 a = b = c = e = f = g = 1;
1288 AC_DEFINE(HAVE_U_INTXX_T)
1289 AC_DEFINE(HAVE_INTXX_T)
1297 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1300 #include <sys/types.h>
1302 [ u_char foo; foo = 125; ],
1303 [ ac_cv_have_u_char="yes" ],
1304 [ ac_cv_have_u_char="no" ]
1307 if test "x$ac_cv_have_u_char" = "xyes" ; then
1308 AC_DEFINE(HAVE_U_CHAR)
1313 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1315 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1318 #include <sys/types.h>
1320 [ size_t foo; foo = 1235; ],
1321 [ ac_cv_have_size_t="yes" ],
1322 [ ac_cv_have_size_t="no" ]
1325 if test "x$ac_cv_have_size_t" = "xyes" ; then
1326 AC_DEFINE(HAVE_SIZE_T)
1329 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1332 #include <sys/types.h>
1334 [ ssize_t foo; foo = 1235; ],
1335 [ ac_cv_have_ssize_t="yes" ],
1336 [ ac_cv_have_ssize_t="no" ]
1339 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1340 AC_DEFINE(HAVE_SSIZE_T)
1343 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1348 [ clock_t foo; foo = 1235; ],
1349 [ ac_cv_have_clock_t="yes" ],
1350 [ ac_cv_have_clock_t="no" ]
1353 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1354 AC_DEFINE(HAVE_CLOCK_T)
1357 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1360 #include <sys/types.h>
1361 #include <sys/socket.h>
1363 [ sa_family_t foo; foo = 1235; ],
1364 [ ac_cv_have_sa_family_t="yes" ],
1367 #include <sys/types.h>
1368 #include <sys/socket.h>
1369 #include <netinet/in.h>
1371 [ sa_family_t foo; foo = 1235; ],
1372 [ ac_cv_have_sa_family_t="yes" ],
1374 [ ac_cv_have_sa_family_t="no" ]
1378 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1379 AC_DEFINE(HAVE_SA_FAMILY_T)
1382 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1385 #include <sys/types.h>
1387 [ pid_t foo; foo = 1235; ],
1388 [ ac_cv_have_pid_t="yes" ],
1389 [ ac_cv_have_pid_t="no" ]
1392 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1393 AC_DEFINE(HAVE_PID_T)
1396 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1399 #include <sys/types.h>
1401 [ mode_t foo; foo = 1235; ],
1402 [ ac_cv_have_mode_t="yes" ],
1403 [ ac_cv_have_mode_t="no" ]
1406 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1407 AC_DEFINE(HAVE_MODE_T)
1411 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1414 #include <sys/types.h>
1415 #include <sys/socket.h>
1417 [ struct sockaddr_storage s; ],
1418 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1419 [ ac_cv_have_struct_sockaddr_storage="no" ]
1422 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1423 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1426 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1429 #include <sys/types.h>
1430 #include <netinet/in.h>
1432 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1433 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1434 [ ac_cv_have_struct_sockaddr_in6="no" ]
1437 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1438 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1441 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1444 #include <sys/types.h>
1445 #include <netinet/in.h>
1447 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1448 [ ac_cv_have_struct_in6_addr="yes" ],
1449 [ ac_cv_have_struct_in6_addr="no" ]
1452 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1453 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1456 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1459 #include <sys/types.h>
1460 #include <sys/socket.h>
1463 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1464 [ ac_cv_have_struct_addrinfo="yes" ],
1465 [ ac_cv_have_struct_addrinfo="no" ]
1468 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1469 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1472 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1474 [ #include <sys/time.h> ],
1475 [ struct timeval tv; tv.tv_sec = 1;],
1476 [ ac_cv_have_struct_timeval="yes" ],
1477 [ ac_cv_have_struct_timeval="no" ]
1480 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1481 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1482 have_struct_timeval=1
1485 # If we don't have int64_t then we can't compile sftp-server. So don't
1486 # even attempt to do it.
1487 if test "x$ac_cv_have_int64_t" = "xno" -a \
1488 "x$ac_cv_sizeof_long_int" != "x8" -a \
1489 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1492 dnl test snprintf (broken on SCO w/gcc)
1497 #ifdef HAVE_SNPRINTF
1501 char expected_out[50];
1503 #if (SIZEOF_LONG_INT == 8)
1504 long int num = 0x7fffffffffffffff;
1506 long long num = 0x7fffffffffffffffll;
1508 strcpy(expected_out, "9223372036854775807");
1509 snprintf(buf, mazsize, "%lld", num);
1510 if(strcmp(buf, expected_out) != 0)
1517 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1522 dnl Checks for structure members
1523 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1524 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1525 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1526 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1527 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1528 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1529 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1530 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1531 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1532 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1533 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1534 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1535 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1536 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1537 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1538 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1539 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1541 AC_CHECK_MEMBERS([struct stat.st_blksize])
1543 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1544 ac_cv_have_ss_family_in_struct_ss, [
1547 #include <sys/types.h>
1548 #include <sys/socket.h>
1550 [ struct sockaddr_storage s; s.ss_family = 1; ],
1551 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1552 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1555 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1556 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1559 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1560 ac_cv_have___ss_family_in_struct_ss, [
1563 #include <sys/types.h>
1564 #include <sys/socket.h>
1566 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1567 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1568 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1571 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1572 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1575 AC_CACHE_CHECK([for pw_class field in struct passwd],
1576 ac_cv_have_pw_class_in_struct_passwd, [
1581 [ struct passwd p; p.pw_class = 0; ],
1582 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1583 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1586 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1587 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1590 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1591 ac_cv_have_pw_expire_in_struct_passwd, [
1596 [ struct passwd p; p.pw_expire = 0; ],
1597 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1598 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1601 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1602 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1605 AC_CACHE_CHECK([for pw_change field in struct passwd],
1606 ac_cv_have_pw_change_in_struct_passwd, [
1611 [ struct passwd p; p.pw_change = 0; ],
1612 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1613 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1616 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1617 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1620 dnl make sure we're using the real structure members and not defines
1621 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1622 ac_cv_have_accrights_in_msghdr, [
1625 #include <sys/types.h>
1626 #include <sys/socket.h>
1627 #include <sys/uio.h>
1629 #ifdef msg_accrights
1633 m.msg_accrights = 0;
1637 [ ac_cv_have_accrights_in_msghdr="yes" ],
1638 [ ac_cv_have_accrights_in_msghdr="no" ]
1641 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1642 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1645 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1646 ac_cv_have_control_in_msghdr, [
1649 #include <sys/types.h>
1650 #include <sys/socket.h>
1651 #include <sys/uio.h>
1661 [ ac_cv_have_control_in_msghdr="yes" ],
1662 [ ac_cv_have_control_in_msghdr="no" ]
1665 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1666 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1669 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1671 [ extern char *__progname; printf("%s", __progname); ],
1672 [ ac_cv_libc_defines___progname="yes" ],
1673 [ ac_cv_libc_defines___progname="no" ]
1676 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1677 AC_DEFINE(HAVE___PROGNAME)
1680 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1684 [ printf("%s", __FUNCTION__); ],
1685 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1686 [ ac_cv_cc_implements___FUNCTION__="no" ]
1689 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1690 AC_DEFINE(HAVE___FUNCTION__)
1693 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1697 [ printf("%s", __func__); ],
1698 [ ac_cv_cc_implements___func__="yes" ],
1699 [ ac_cv_cc_implements___func__="no" ]
1702 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1703 AC_DEFINE(HAVE___func__)
1706 AC_CACHE_CHECK([whether getopt has optreset support],
1707 ac_cv_have_getopt_optreset, [
1712 [ extern int optreset; optreset = 0; ],
1713 [ ac_cv_have_getopt_optreset="yes" ],
1714 [ ac_cv_have_getopt_optreset="no" ]
1717 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1718 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1721 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1723 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1724 [ ac_cv_libc_defines_sys_errlist="yes" ],
1725 [ ac_cv_libc_defines_sys_errlist="no" ]
1728 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1729 AC_DEFINE(HAVE_SYS_ERRLIST)
1733 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1735 [ extern int sys_nerr; printf("%i", sys_nerr);],
1736 [ ac_cv_libc_defines_sys_nerr="yes" ],
1737 [ ac_cv_libc_defines_sys_nerr="no" ]
1740 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1741 AC_DEFINE(HAVE_SYS_NERR)
1746 # Check whether user wants sectok support
1748 [ --with-sectok Enable smartcard support using libsectok],
1750 if test "x$withval" != "xno" ; then
1751 if test "x$withval" != "xyes" ; then
1752 CPPFLAGS="$CPPFLAGS -I${withval}"
1753 LDFLAGS="$LDFLAGS -L${withval}"
1754 if test ! -z "$need_dash_r" ; then
1755 LDFLAGS="$LDFLAGS -R${withval}"
1757 if test ! -z "$blibpath" ; then
1758 blibpath="$blibpath:${withval}"
1761 AC_CHECK_HEADERS(sectok.h)
1762 if test "$ac_cv_header_sectok_h" != yes; then
1763 AC_MSG_ERROR(Can't find sectok.h)
1765 AC_CHECK_LIB(sectok, sectok_open)
1766 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1767 AC_MSG_ERROR(Can't find libsectok)
1769 AC_DEFINE(SMARTCARD)
1770 AC_DEFINE(USE_SECTOK)
1771 SCARD_MSG="yes, using sectok"
1776 # Check whether user wants OpenSC support
1778 AC_HELP_STRING([--with-opensc=PFX],
1779 [Enable smartcard support using OpenSC]),
1780 opensc_config_prefix="$withval", opensc_config_prefix="")
1781 if test x$opensc_config_prefix != x ; then
1782 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1783 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1784 if test "$OPENSC_CONFIG" != "no"; then
1785 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1786 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1787 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1788 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1789 AC_DEFINE(SMARTCARD)
1790 AC_DEFINE(USE_OPENSC)
1791 SCARD_MSG="yes, using OpenSC"
1795 # Check whether user wants Kerberos 5 support
1797 AC_ARG_WITH(kerberos5,
1798 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1800 if test "x$withval" != "xno" ; then
1801 if test "x$withval" = "xyes" ; then
1802 KRB5ROOT="/usr/local"
1806 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1807 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1810 AC_MSG_CHECKING(whether we are using Heimdal)
1811 AC_TRY_COMPILE([ #include <krb5.h> ],
1812 [ char *tmp = heimdal_version; ],
1813 [ AC_MSG_RESULT(yes)
1815 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1818 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1821 if test ! -z "$need_dash_r" ; then
1822 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1824 if test ! -z "$blibpath" ; then
1825 blibpath="$blibpath:${KRB5ROOT}/lib"
1827 AC_CHECK_LIB(resolv, dn_expand, , )
1833 # Check whether user wants Kerberos 4 support
1835 AC_ARG_WITH(kerberos4,
1836 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1838 if test "x$withval" != "xno" ; then
1839 if test "x$withval" != "xyes" ; then
1840 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1841 LDFLAGS="$LDFLAGS -L${withval}/lib"
1842 if test ! -z "$need_dash_r" ; then
1843 LDFLAGS="$LDFLAGS -R${withval}/lib"
1845 if test ! -z "$blibpath" ; then
1846 blibpath="$blibpath:${withval}/lib"
1849 if test -d /usr/include/kerberosIV ; then
1850 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1854 AC_CHECK_HEADERS(krb.h)
1855 if test "$ac_cv_header_krb_h" != yes; then
1856 AC_MSG_WARN([Cannot find krb.h, build may fail])
1858 AC_CHECK_LIB(krb, main)
1859 if test "$ac_cv_lib_krb_main" != yes; then
1860 AC_CHECK_LIB(krb4, main)
1861 if test "$ac_cv_lib_krb4_main" != yes; then
1862 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1869 AC_CHECK_LIB(des, des_cbc_encrypt)
1870 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1871 AC_CHECK_LIB(des425, des_cbc_encrypt)
1872 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1873 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1880 AC_CHECK_LIB(resolv, dn_expand, , )
1888 # Check whether user wants AFS support
1891 [ --with-afs=PATH Enable AFS support],
1893 if test "x$withval" != "xno" ; then
1895 if test "x$withval" != "xyes" ; then
1896 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1897 LDFLAGS="$LDFLAGS -L${withval}/lib"
1900 if test -z "$KRB4" ; then
1901 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1905 if test ! -z "$AFS_LIBS" ; then
1906 LIBS="$LIBS $AFS_LIBS"
1913 LIBS="$LIBS $KLIBS $K5LIBS"
1915 # Looking for programs, paths and files
1917 PRIVSEP_PATH=/var/empty
1918 AC_ARG_WITH(privsep-path,
1919 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1921 if test "x$withval" != "$no" ; then
1922 PRIVSEP_PATH=$withval
1926 AC_SUBST(PRIVSEP_PATH)
1929 [ --with-xauth=PATH Specify path to xauth program ],
1931 if test "x$withval" != "xno" ; then
1937 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1938 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1939 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1940 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1941 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1942 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1943 xauth_path="/usr/openwin/bin/xauth"
1949 AC_ARG_ENABLE(strip,
1950 [ --disable-strip Disable calling strip(1) on install],
1952 if test "x$enableval" = "xno" ; then
1959 if test -z "$xauth_path" ; then
1960 XAUTH_PATH="undefined"
1961 AC_SUBST(XAUTH_PATH)
1963 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1964 XAUTH_PATH=$xauth_path
1965 AC_SUBST(XAUTH_PATH)
1968 # Check for mail directory (last resort if we cannot get it from headers)
1969 if test ! -z "$MAIL" ; then
1970 maildir=`dirname $MAIL`
1971 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1974 if test -z "$no_dev_ptmx" ; then
1975 if test "x$disable_ptmx_check" != "xyes" ; then
1976 AC_CHECK_FILE("/dev/ptmx",
1978 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1984 AC_CHECK_FILE("/dev/ptc",
1986 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1991 # Options from here on. Some of these are preset by platform above
1992 AC_ARG_WITH(mantype,
1993 [ --with-mantype=man|cat|doc Set man page type],
2000 AC_MSG_ERROR(invalid man type: $withval)
2005 if test -z "$MANTYPE"; then
2006 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2007 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2008 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2010 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2017 if test "$MANTYPE" = "doc"; then
2024 # Check whether to enable MD5 passwords
2026 AC_ARG_WITH(md5-passwords,
2027 [ --with-md5-passwords Enable use of MD5 passwords],
2029 if test "x$withval" != "xno" ; then
2030 AC_DEFINE(HAVE_MD5_PASSWORDS)
2036 # Whether to disable shadow password support
2038 [ --without-shadow Disable shadow password support],
2040 if test "x$withval" = "xno" ; then
2041 AC_DEFINE(DISABLE_SHADOW)
2047 if test -z "$disable_shadow" ; then
2048 AC_MSG_CHECKING([if the systems has expire shadow information])
2051 #include <sys/types.h>
2054 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2055 [ sp_expire_available=yes ], []
2058 if test "x$sp_expire_available" = "xyes" ; then
2060 AC_DEFINE(HAS_SHADOW_EXPIRE)
2066 # Use ip address instead of hostname in $DISPLAY
2067 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2068 DISPLAY_HACK_MSG="yes"
2069 AC_DEFINE(IPADDR_IN_DISPLAY)
2071 DISPLAY_HACK_MSG="no"
2072 AC_ARG_WITH(ipaddr-display,
2073 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2075 if test "x$withval" != "xno" ; then
2076 AC_DEFINE(IPADDR_IN_DISPLAY)
2077 DISPLAY_HACK_MSG="yes"
2083 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2084 if test $ac_cv_func_login_getcapbool = "yes" -a \
2085 $ac_cv_header_login_cap_h = "yes" ; then
2088 # Whether to mess with the default path
2089 SERVER_PATH_MSG="(default)"
2090 AC_ARG_WITH(default-path,
2091 [ --with-default-path= Specify default \$PATH environment for server],
2093 if test "$USES_LOGIN_CONF" = "yes" ; then
2095 --with-default-path=PATH has no effect on this system.
2096 Edit /etc/login.conf instead.])
2097 elif test "x$withval" != "xno" ; then
2098 user_path="$withval"
2099 SERVER_PATH_MSG="$withval"
2102 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2103 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2107 /* find out what STDPATH is */
2112 #ifndef _PATH_STDPATH
2113 # ifdef _PATH_USERPATH /* Irix */
2114 # define _PATH_STDPATH _PATH_USERPATH
2116 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2119 #include <sys/types.h>
2120 #include <sys/stat.h>
2122 #define DATA "conftest.stdpath"
2129 fd = fopen(DATA,"w");
2133 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2138 ], [ user_path=`cat conftest.stdpath` ],
2139 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2140 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2142 # make sure $bindir is in USER_PATH so scp will work
2143 t_bindir=`eval echo ${bindir}`
2145 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2148 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2150 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2151 if test $? -ne 0 ; then
2152 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2153 if test $? -ne 0 ; then
2154 user_path=$user_path:$t_bindir
2155 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2160 if test "$USES_LOGIN_CONF" != "yes" ; then
2161 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2165 # Set superuser path separately to user path
2166 AC_ARG_WITH(superuser-path,
2167 [ --with-superuser-path= Specify different path for super-user],
2169 if test "x$withval" != "xno" ; then
2170 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2171 superuser_path=$withval
2177 # Whether to force IPv4 by default (needed on broken glibc Linux)
2179 AC_ARG_WITH(ipv4-default,
2180 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2182 if test "x$withval" != "xno" ; then
2183 AC_DEFINE(IPV4_DEFAULT)
2189 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2190 IPV4_IN6_HACK_MSG="no"
2192 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2194 if test "x$withval" != "xno" ; then
2196 AC_DEFINE(IPV4_IN_IPV6)
2197 IPV4_IN6_HACK_MSG="yes"
2202 if test "x$inet6_default_4in6" = "xyes"; then
2203 AC_MSG_RESULT([yes (default)])
2204 AC_DEFINE(IPV4_IN_IPV6)
2205 IPV4_IN6_HACK_MSG="yes"
2207 AC_MSG_RESULT([no (default)])
2212 # Whether to enable BSD auth support
2214 AC_ARG_WITH(bsd-auth,
2215 [ --with-bsd-auth Enable BSD auth support],
2217 if test "x$withval" != "xno" ; then
2224 # Where to place sshd.pid
2226 # make sure the directory exists
2227 if test ! -d $piddir ; then
2228 piddir=`eval echo ${sysconfdir}`
2230 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2234 AC_ARG_WITH(pid-dir,
2235 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2237 if test "x$withval" != "xno" ; then
2239 if test ! -d $piddir ; then
2240 AC_MSG_WARN([** no $piddir directory on this system **])
2246 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2249 dnl allow user to disable some login recording features
2250 AC_ARG_ENABLE(lastlog,
2251 [ --disable-lastlog disable use of lastlog even if detected [no]],
2252 [ AC_DEFINE(DISABLE_LASTLOG) ]
2255 [ --disable-utmp disable use of utmp even if detected [no]],
2256 [ AC_DEFINE(DISABLE_UTMP) ]
2258 AC_ARG_ENABLE(utmpx,
2259 [ --disable-utmpx disable use of utmpx even if detected [no]],
2260 [ AC_DEFINE(DISABLE_UTMPX) ]
2263 [ --disable-wtmp disable use of wtmp even if detected [no]],
2264 [ AC_DEFINE(DISABLE_WTMP) ]
2266 AC_ARG_ENABLE(wtmpx,
2267 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2268 [ AC_DEFINE(DISABLE_WTMPX) ]
2270 AC_ARG_ENABLE(libutil,
2271 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2272 [ AC_DEFINE(DISABLE_LOGIN) ]
2274 AC_ARG_ENABLE(pututline,
2275 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2276 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2278 AC_ARG_ENABLE(pututxline,
2279 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2280 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2282 AC_ARG_WITH(lastlog,
2283 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2285 if test "x$withval" = "xno" ; then
2286 AC_DEFINE(DISABLE_LASTLOG)
2288 conf_lastlog_location=$withval
2293 dnl lastlog, [uw]tmpx? detection
2294 dnl NOTE: set the paths in the platform section to avoid the
2295 dnl need for command-line parameters
2296 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2298 dnl lastlog detection
2299 dnl NOTE: the code itself will detect if lastlog is a directory
2300 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2302 #include <sys/types.h>
2304 #ifdef HAVE_LASTLOG_H
2305 # include <lastlog.h>
2314 [ char *lastlog = LASTLOG_FILE; ],
2315 [ AC_MSG_RESULT(yes) ],
2318 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2320 #include <sys/types.h>
2322 #ifdef HAVE_LASTLOG_H
2323 # include <lastlog.h>
2329 [ char *lastlog = _PATH_LASTLOG; ],
2330 [ AC_MSG_RESULT(yes) ],
2333 system_lastlog_path=no
2338 if test -z "$conf_lastlog_location"; then
2339 if test x"$system_lastlog_path" = x"no" ; then
2340 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2341 if (test -d "$f" || test -f "$f") ; then
2342 conf_lastlog_location=$f
2345 if test -z "$conf_lastlog_location"; then
2346 AC_MSG_WARN([** Cannot find lastlog **])
2347 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2352 if test -n "$conf_lastlog_location"; then
2353 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2357 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2359 #include <sys/types.h>
2365 [ char *utmp = UTMP_FILE; ],
2366 [ AC_MSG_RESULT(yes) ],
2368 system_utmp_path=no ]
2370 if test -z "$conf_utmp_location"; then
2371 if test x"$system_utmp_path" = x"no" ; then
2372 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2373 if test -f $f ; then
2374 conf_utmp_location=$f
2377 if test -z "$conf_utmp_location"; then
2378 AC_DEFINE(DISABLE_UTMP)
2382 if test -n "$conf_utmp_location"; then
2383 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2387 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2389 #include <sys/types.h>
2395 [ char *wtmp = WTMP_FILE; ],
2396 [ AC_MSG_RESULT(yes) ],
2398 system_wtmp_path=no ]
2400 if test -z "$conf_wtmp_location"; then
2401 if test x"$system_wtmp_path" = x"no" ; then
2402 for f in /usr/adm/wtmp /var/log/wtmp; do
2403 if test -f $f ; then
2404 conf_wtmp_location=$f
2407 if test -z "$conf_wtmp_location"; then
2408 AC_DEFINE(DISABLE_WTMP)
2412 if test -n "$conf_wtmp_location"; then
2413 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2417 dnl utmpx detection - I don't know any system so perverse as to require
2418 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2420 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2422 #include <sys/types.h>
2431 [ char *utmpx = UTMPX_FILE; ],
2432 [ AC_MSG_RESULT(yes) ],
2434 system_utmpx_path=no ]
2436 if test -z "$conf_utmpx_location"; then
2437 if test x"$system_utmpx_path" = x"no" ; then
2438 AC_DEFINE(DISABLE_UTMPX)
2441 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2445 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2447 #include <sys/types.h>
2456 [ char *wtmpx = WTMPX_FILE; ],
2457 [ AC_MSG_RESULT(yes) ],
2459 system_wtmpx_path=no ]
2461 if test -z "$conf_wtmpx_location"; then
2462 if test x"$system_wtmpx_path" = x"no" ; then
2463 AC_DEFINE(DISABLE_WTMPX)
2466 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2470 if test ! -z "$blibpath" ; then
2471 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2472 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2475 dnl remove pam and dl because they are in $LIBPAM
2476 if test "$PAM_MSG" = yes ; then
2477 LIBS=`echo $LIBS | sed 's/-lpam //'`
2479 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2480 LIBS=`echo $LIBS | sed 's/-ldl //'`
2484 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2487 # Print summary of options
2489 # Someone please show me a better way :)
2490 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2491 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2492 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2493 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2494 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2495 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2496 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2497 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2498 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2499 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2502 echo "OpenSSH has been configured with the following options:"
2503 echo " User binaries: $B"
2504 echo " System binaries: $C"
2505 echo " Configuration files: $D"
2506 echo " Askpass program: $E"
2507 echo " Manual pages: $F"
2508 echo " PID file: $G"
2509 echo " Privilege separation chroot path: $H"
2510 if test "$USES_LOGIN_CONF" = "yes" ; then
2511 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2513 echo " sshd default user PATH: $I"
2515 if test ! -z "$superuser_path" ; then
2516 echo " sshd superuser user PATH: $J"
2518 echo " Manpage format: $MANTYPE"
2519 echo " PAM support: ${PAM_MSG}"
2520 echo " KerberosIV support: $KRB4_MSG"
2521 echo " KerberosV support: $KRB5_MSG"
2522 echo " Smartcard support: $SCARD_MSG"
2523 echo " AFS support: $AFS_MSG"
2524 echo " S/KEY support: $SKEY_MSG"
2525 echo " TCP Wrappers support: $TCPW_MSG"
2526 echo " MD5 password support: $MD5_MSG"
2527 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2528 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2529 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2530 echo " BSD Auth support: $BSD_AUTH_MSG"
2531 echo " Random number source: $RAND_MSG"
2532 if test ! -z "$USE_RAND_HELPER" ; then
2533 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2538 echo " Host: ${host}"
2539 echo " Compiler: ${CC}"
2540 echo " Compiler flags: ${CFLAGS}"
2541 echo "Preprocessor flags: ${CPPFLAGS}"
2542 echo " Linker flags: ${LDFLAGS}"
2543 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2547 if test "x$PAM_MSG" = "xyes" ; then
2548 echo "PAM is enabled. You may need to install a PAM control file "
2549 echo "for sshd, otherwise password authentication may fail. "
2550 echo "Example PAM control files can be found in the contrib/ "
2555 if test ! -z "$NO_SFTP"; then
2556 echo "sftp-server will be disabled. Your compiler does not "
2557 echo "support 64bit integers."
2561 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2562 echo "WARNING: you are using the builtin random number collection "
2563 echo "service. Please read WARNING.RNG and request that your OS "
2564 echo "vendor includes kernel-based random number collection in "
2565 echo "future versions of your OS."