4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(ENT, ent)
20 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
28 if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32 # Use LOGIN_PROGRAM from environment if possible
33 if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
43 if test -z "$LD" ; then
49 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
53 # Check for some target-specific stuff
57 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
58 LDFLAGS="$LDFLAGS -L/usr/local/lib"
59 if (test "$LD" != "gcc" && test -z "$blibpath"); then
60 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
61 saved_LDFLAGS="$LDFLAGS"
62 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
67 blibpath="/usr/lib:/lib:/usr/local/lib"
71 LDFLAGS="$saved_LDFLAGS"
73 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
74 [AC_CHECK_LIB(s,authenticate,
75 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
79 AC_DEFINE(BROKEN_GETADDRINFO)
80 AC_DEFINE(BROKEN_REALPATH)
81 dnl AIX handles lastlog as part of its login message
82 AC_DEFINE(DISABLE_LASTLOG)
83 AC_DEFINE(LOGIN_NEEDS_UTMPX)
86 LIBS="$LIBS /usr/lib/textmode.o"
87 AC_DEFINE(HAVE_CYGWIN)
89 AC_DEFINE(DISABLE_SHADOW)
90 AC_DEFINE(IPV4_DEFAULT)
91 AC_DEFINE(IP_TOS_IS_BROKEN)
92 AC_DEFINE(NO_X11_UNIX_SOCKETS)
93 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
94 AC_DEFINE(DISABLE_FD_PASSING)
95 AC_DEFINE(SETGROUPS_NOOP)
98 AC_DEFINE(IP_TOS_IS_BROKEN)
101 AC_MSG_CHECKING(if we have working getaddrinfo)
102 AC_TRY_RUN([#include <mach-o/dyld.h>
103 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
107 }], [AC_MSG_RESULT(working)],
108 [AC_MSG_RESULT(buggy)
109 AC_DEFINE(BROKEN_GETADDRINFO)],
110 [AC_MSG_RESULT(assume it is working)])
113 if test -z "$GCC"; then
116 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
117 IPADDR_IN_DISPLAY=yes
118 AC_DEFINE(HAVE_SECUREWARE)
120 AC_DEFINE(LOGIN_NO_ENDOPT)
121 AC_DEFINE(LOGIN_NEEDS_UTMPX)
122 AC_DEFINE(DISABLE_SHADOW)
123 AC_DEFINE(DISABLE_UTMP)
124 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
125 LIBS="$LIBS -lsec -lsecpw"
126 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
127 disable_ptmx_check=yes
130 if test -z "$GCC"; then
133 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
134 IPADDR_IN_DISPLAY=yes
136 AC_DEFINE(LOGIN_NO_ENDOPT)
137 AC_DEFINE(LOGIN_NEEDS_UTMPX)
138 AC_DEFINE(DISABLE_SHADOW)
139 AC_DEFINE(DISABLE_UTMP)
140 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
142 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
145 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
146 IPADDR_IN_DISPLAY=yes
147 AC_DEFINE(PAM_SUN_CODEBASE)
149 AC_DEFINE(LOGIN_NO_ENDOPT)
150 AC_DEFINE(LOGIN_NEEDS_UTMPX)
151 AC_DEFINE(DISABLE_SHADOW)
152 AC_DEFINE(DISABLE_UTMP)
153 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
155 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
158 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
160 PATH="$PATH:/usr/etc"
161 AC_DEFINE(BROKEN_INET_NTOA)
162 AC_DEFINE(WITH_ABBREV_NO_TTY)
165 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
167 PATH="$PATH:/usr/etc"
168 AC_DEFINE(WITH_IRIX_ARRAY)
169 AC_DEFINE(WITH_IRIX_PROJECT)
170 AC_DEFINE(WITH_IRIX_AUDIT)
171 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
172 AC_DEFINE(BROKEN_INET_NTOA)
173 AC_DEFINE(WITH_ABBREV_NO_TTY)
177 check_for_libcrypt_later=1
178 AC_DEFINE(DONT_TRY_OTHER_AF)
179 AC_DEFINE(PAM_TTY_KLUDGE)
180 inet6_default_4in6=yes
182 mips-sony-bsd|mips-sony-newsos4)
183 AC_DEFINE(HAVE_NEWS4)
187 check_for_libcrypt_before=1
191 check_for_libcrypt_later=1
194 conf_lastlog_location="/usr/adm/lastlog"
195 conf_utmp_location=/etc/utmp
196 conf_wtmp_location=/usr/adm/wtmp
199 AC_DEFINE(BROKEN_REALPATH)
201 AC_DEFINE(BROKEN_SAVED_UIDS)
202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
206 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
207 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
209 AC_DEFINE(PAM_SUN_CODEBASE)
210 AC_DEFINE(LOGIN_NEEDS_UTMPX)
211 AC_DEFINE(LOGIN_NEEDS_TERM)
212 AC_DEFINE(PAM_TTY_KLUDGE)
213 # hardwire lastlog location (can't detect it on some versions)
214 conf_lastlog_location="/var/adm/lastlog"
215 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
216 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
217 if test "$sol2ver" -ge 8; then
219 AC_DEFINE(DISABLE_UTMP)
220 AC_DEFINE(DISABLE_WTMP)
226 CPPFLAGS="$CPPFLAGS -DSUNOS4"
227 AC_CHECK_FUNCS(getpwanam)
228 AC_DEFINE(PAM_SUN_CODEBASE)
229 conf_utmp_location=/etc/utmp
230 conf_wtmp_location=/var/adm/wtmp
231 conf_lastlog_location=/var/adm/lastlog
235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
236 LDFLAGS="$LDFLAGS -L/usr/local/lib"
241 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
242 # /usr/ucblib MUST NOT be searched on ReliantUNIX
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
244 IPADDR_IN_DISPLAY=yes
246 AC_DEFINE(IP_TOS_IS_BROKEN)
247 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
248 # Attention: always take care to bind libsocket and libnsl before libc,
249 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
252 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
253 LDFLAGS="$LDFLAGS -L/usr/local/lib"
257 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
258 LDFLAGS="$LDFLAGS -L/usr/local/lib"
262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
263 LDFLAGS="$LDFLAGS -L/usr/local/lib"
266 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
267 LDFLAGS="$LDFLAGS -L/usr/local/lib"
268 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
271 AC_DEFINE(BROKEN_SYS_TERMIO_H)
273 AC_DEFINE(HAVE_SECUREWARE)
274 AC_DEFINE(DISABLE_SHADOW)
275 AC_DEFINE(BROKEN_SAVED_UIDS)
276 AC_CHECK_FUNCS(getluid setluid)
278 do_sco3_extra_lib_check=yes
281 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
282 LDFLAGS="$LDFLAGS -L/usr/local/lib"
283 LIBS="$LIBS -lprot -lx -ltinfo -lm"
286 AC_DEFINE(HAVE_SECUREWARE)
287 AC_DEFINE(DISABLE_SHADOW)
288 AC_DEFINE(DISABLE_FD_PASSING)
289 AC_CHECK_FUNCS(getluid setluid)
294 AC_DEFINE(DISABLE_FD_PASSING)
296 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
301 AC_DEFINE(DISABLE_FD_PASSING)
302 AC_DEFINE(NO_SSH_LASTLOG)
303 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
304 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
308 AC_MSG_CHECKING(for Digital Unix SIA)
311 [ --with-osfsia Enable Digital Unix SIA],
313 if test "x$withval" = "xno" ; then
314 AC_MSG_RESULT(disabled)
319 if test -z "$no_osfsia" ; then
320 if test -f /etc/sia/matrix.conf; then
322 AC_DEFINE(HAVE_OSF_SIA)
323 AC_DEFINE(DISABLE_LOGIN)
324 LIBS="$LIBS -lsecurity -ldb -lm -laud"
329 AC_DEFINE(DISABLE_FD_PASSING)
334 AC_DEFINE(NO_X11_UNIX_SOCKETS)
335 AC_DEFINE(MISSING_NFDBITS)
336 AC_DEFINE(MISSING_HOWMANY)
337 AC_DEFINE(MISSING_FD_MASK)
341 # Allow user to specify flags
343 [ --with-cflags Specify additional flags to pass to compiler],
345 if test "x$withval" != "xno" ; then
346 CFLAGS="$CFLAGS $withval"
350 AC_ARG_WITH(cppflags,
351 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
353 if test "x$withval" != "xno"; then
354 CPPFLAGS="$CPPFLAGS $withval"
359 [ --with-ldflags Specify additional flags to pass to linker],
361 if test "x$withval" != "xno" ; then
362 LDFLAGS="$LDFLAGS $withval"
367 [ --with-libs Specify additional libraries to link with],
369 if test "x$withval" != "xno" ; then
370 LIBS="$LIBS $withval"
375 # Checks for header files.
376 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
377 getopt.h glob.h ia.h lastlog.h limits.h login.h \
378 login_cap.h maillock.h netdb.h netgroup.h \
379 netinet/in_systm.h paths.h pty.h readpassphrase.h \
380 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
381 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
382 sys/mman.h sys/select.h sys/stat.h \
383 sys/stropts.h sys/sysmacros.h sys/time.h \
384 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
385 util.h utime.h utmp.h utmpx.h)
387 # Checks for libraries.
388 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
389 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
391 dnl SCO OS3 needs this for libwrap
392 if test "x$with_tcp_wrappers" != "xno" ; then
393 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
394 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
398 AC_CHECK_FUNC(getspnam, ,
399 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
402 [ --without-rpath Disable auto-added -R linker paths],
404 if test "x$withval" = "xno" ; then
407 if test "x$withval" = "xyes" ; then
415 [ --with-zlib=PATH Use zlib in PATH],
417 if test "x$withval" = "xno" ; then
418 AC_MSG_ERROR([*** zlib is required ***])
420 if test -d "$withval/lib"; then
421 if test -n "${need_dash_r}"; then
422 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
424 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
427 if test -n "${need_dash_r}"; then
428 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
430 LDFLAGS="-L${withval} ${LDFLAGS}"
433 if test -d "$withval/include"; then
434 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
436 CPPFLAGS="-I${withval} ${CPPFLAGS}"
441 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
444 AC_CHECK_FUNC(strcasecmp,
445 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
447 AC_CHECK_FUNC(utimes,
448 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
449 LIBS="$LIBS -lc89"]) ]
452 dnl Checks for libutil functions
453 AC_CHECK_HEADERS(libutil.h)
454 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
455 AC_CHECK_FUNCS(logout updwtmp logwtmp)
459 # Check for ALTDIRFUNC glob() extension
460 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
461 AC_EGREP_CPP(FOUNDIT,
464 #ifdef GLOB_ALTDIRFUNC
469 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
477 # Check for g.gl_matchc glob() extension
478 AC_MSG_CHECKING(for gl_matchc field in glob_t)
479 AC_EGREP_CPP(FOUNDIT,
482 int main(void){glob_t g; g.gl_matchc = 1;}
485 AC_DEFINE(GLOB_HAS_GL_MATCHC)
493 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
496 #include <sys/types.h>
498 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
500 [AC_MSG_RESULT(yes)],
503 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
507 # Check whether user wants S/Key support
510 [ --with-skey[[=PATH]] Enable S/Key support
511 (optionally in PATH)],
513 if test "x$withval" != "xno" ; then
515 if test "x$withval" != "xyes" ; then
516 CPPFLAGS="$CPPFLAGS -I${withval}/include"
517 LDFLAGS="$LDFLAGS -L${withval}/lib"
524 AC_MSG_CHECKING([for s/key support])
529 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
531 [AC_MSG_RESULT(yes)],
534 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
540 # Check whether user wants TCP wrappers support
542 AC_ARG_WITH(tcp-wrappers,
543 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
544 (optionally in PATH)],
546 if test "x$withval" != "xno" ; then
548 saved_LDFLAGS="$LDFLAGS"
549 saved_CPPFLAGS="$CPPFLAGS"
550 if test -n "${withval}" -a "${withval}" != "yes"; then
551 if test -d "${withval}/lib"; then
552 if test -n "${need_dash_r}"; then
553 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
555 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
558 if test -n "${need_dash_r}"; then
559 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
561 LDFLAGS="-L${withval} ${LDFLAGS}"
564 if test -d "${withval}/include"; then
565 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
567 CPPFLAGS="-I${withval} ${CPPFLAGS}"
571 LIBS="$LIBWRAP $LIBS"
572 AC_MSG_CHECKING(for libwrap)
576 int deny_severity = 0, allow_severity = 0;
586 AC_MSG_ERROR([*** libwrap missing])
594 dnl Checks for library functions.
595 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
596 clock fchmod fchown freeaddrinfo futimes gai_strerror \
597 getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\
598 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
599 inet_ntop innetgr login_getcapbool md5_crypt memmove \
600 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
601 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
602 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
603 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
604 socketpair strerror strlcat strlcpy strmode sysconf tcgetpgrp \
605 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
607 dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
608 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
610 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
611 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
612 AC_CHECK_LIB(gen, dirname,[
613 AC_CACHE_CHECK([for broken dirname],
614 ac_cv_have_broken_dirname, [
622 int main(int argc, char **argv) {
625 strncpy(buf,"/etc", 32);
627 if (!s || strncmp(s, "/", 32) != 0) {
634 [ ac_cv_have_broken_dirname="no" ],
635 [ ac_cv_have_broken_dirname="yes" ]
639 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
641 AC_DEFINE(HAVE_DIRNAME)
642 AC_CHECK_HEADERS(libgen.h)
647 dnl Checks for time functions
648 AC_CHECK_FUNCS(gettimeofday time)
649 dnl Checks for utmp functions
650 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
651 AC_CHECK_FUNCS(utmpname)
652 dnl Checks for utmpx functions
653 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
654 AC_CHECK_FUNCS(setutxent utmpxname)
656 AC_CHECK_FUNC(daemon,
657 [AC_DEFINE(HAVE_DAEMON)],
658 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
661 AC_CHECK_FUNC(getpagesize,
662 [AC_DEFINE(HAVE_GETPAGESIZE)],
663 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
666 # Check for broken snprintf
667 if test "x$ac_cv_func_snprintf" = "xyes" ; then
668 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
672 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
674 [AC_MSG_RESULT(yes)],
677 AC_DEFINE(BROKEN_SNPRINTF)
678 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
683 dnl see whether mkstemp() requires XXXXXX
684 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
685 AC_MSG_CHECKING([for (overly) strict mkstemp])
689 main() { char template[]="conftest.mkstemp-test";
690 if (mkstemp(template) == -1)
692 unlink(template); exit(0);
700 AC_DEFINE(HAVE_STRICT_MKSTEMP)
704 AC_DEFINE(HAVE_STRICT_MKSTEMP)
714 [ --with-pam Enable PAM support ],
716 if test "x$withval" != "xno" ; then
717 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
718 AC_MSG_ERROR([PAM headers not found])
721 AC_CHECK_LIB(dl, dlopen, , )
722 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
723 AC_CHECK_FUNCS(pam_getenvlist)
729 if test $ac_cv_lib_dl_dlopen = yes; then
739 # Check for older PAM
740 if test "x$PAM_MSG" = "xyes" ; then
741 # Check PAM strerror arguments (old PAM)
742 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
746 #include <security/pam_appl.h>
748 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
751 AC_DEFINE(HAVE_OLD_PAM)
753 PAM_MSG="yes (old library)"
758 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
759 # because the system crypt() is more featureful.
760 if test "x$check_for_libcrypt_before" = "x1"; then
761 AC_CHECK_LIB(crypt, crypt)
765 saved_CPPFLAGS="$CPPFLAGS"
766 saved_LDFLAGS="$LDFLAGS"
768 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
770 if test "x$withval" != "xno" ; then
771 if test -d "$withval/lib"; then
772 if test -n "${need_dash_r}"; then
773 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
775 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
778 if test -n "${need_dash_r}"; then
779 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
781 LDFLAGS="-L${withval} ${LDFLAGS}"
784 if test -d "$withval/include"; then
785 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
787 CPPFLAGS="-I${withval} ${CPPFLAGS}"
792 LIBS="$LIBS -lcrypto"
793 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
795 dnl Check default openssl install dir
796 if test -n "${need_dash_r}"; then
797 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
799 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
801 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
802 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
804 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
810 # Determine OpenSSL header version
811 AC_MSG_CHECKING([OpenSSL header version])
816 #include <openssl/opensslv.h>
817 #define DATA "conftest.sslincver"
822 fd = fopen(DATA,"w");
826 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
833 ssl_header_ver=`cat conftest.sslincver`
834 AC_MSG_RESULT($ssl_header_ver)
837 AC_MSG_RESULT(not found)
838 AC_MSG_ERROR(OpenSSL version header not found.)
842 # Determine OpenSSL library version
843 AC_MSG_CHECKING([OpenSSL library version])
848 #include <openssl/opensslv.h>
849 #include <openssl/crypto.h>
850 #define DATA "conftest.ssllibver"
855 fd = fopen(DATA,"w");
859 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
866 ssl_library_ver=`cat conftest.ssllibver`
867 AC_MSG_RESULT($ssl_library_ver)
870 AC_MSG_RESULT(not found)
871 AC_MSG_ERROR(OpenSSL library not found.)
875 # Sanity check OpenSSL headers
876 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
880 #include <openssl/opensslv.h>
881 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
888 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
892 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
893 # version in OpenSSL. Skip this for PAM
894 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
895 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
899 ### Configure cryptographic random number support
901 # Check wheter OpenSSL seeds itself
902 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
906 #include <openssl/rand.h>
907 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
910 OPENSSL_SEEDS_ITSELF=yes
915 # Default to use of the rand helper if OpenSSL doesn't
922 # Do we want to force the use of the rand helper?
923 AC_ARG_WITH(rand-helper,
924 [ --with-rand-helper Use subprocess to gather strong randomness ],
926 if test "x$withval" = "xno" ; then
927 # Force use of OpenSSL's internal RNG, even if
928 # the previous test showed it to be unseeded.
929 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
930 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
931 OPENSSL_SEEDS_ITSELF=yes
940 # Which randomness source do we use?
941 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
943 AC_DEFINE(OPENSSL_PRNG_ONLY)
944 RAND_MSG="OpenSSL internal ONLY"
945 INSTALL_SSH_RAND_HELPER=""
946 elif test ! -z "$USE_RAND_HELPER" ; then
947 # install rand helper
948 RAND_MSG="ssh-rand-helper"
949 INSTALL_SSH_RAND_HELPER="yes"
951 AC_SUBST(INSTALL_SSH_RAND_HELPER)
953 ### Configuration of ssh-rand-helper
956 AC_ARG_WITH(prngd-port,
957 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
966 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
969 if test ! -z "$withval" ; then
970 PRNGD_PORT="$withval"
971 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
976 # PRNGD Unix domain socket
977 AC_ARG_WITH(prngd-socket,
978 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
982 withval="/var/run/egd-pool"
990 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
994 if test ! -z "$withval" ; then
995 if test ! -z "$PRNGD_PORT" ; then
996 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
998 if test ! -r "$withval" ; then
999 AC_MSG_WARN(Entropy socket is not readable)
1001 PRNGD_SOCKET="$withval"
1002 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1006 # Check for existing socket only if we don't have a random device already
1007 if test "$USE_RAND_HELPER" = yes ; then
1008 AC_MSG_CHECKING(for PRNGD/EGD socket)
1009 # Insert other locations here
1010 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1011 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1012 PRNGD_SOCKET="$sock"
1013 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1017 if test ! -z "$PRNGD_SOCKET" ; then
1018 AC_MSG_RESULT($PRNGD_SOCKET)
1020 AC_MSG_RESULT(not found)
1026 # Change default command timeout for hashing entropy source
1028 AC_ARG_WITH(entropy-timeout,
1029 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1031 if test "x$withval" != "xno" ; then
1032 entropy_timeout=$withval
1036 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1038 SSH_PRIVSEP_USER=sshd
1039 AC_ARG_WITH(privsep-user,
1040 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1042 if test -n "$withval"; then
1043 SSH_PRIVSEP_USER=$withval
1047 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1048 AC_SUBST(SSH_PRIVSEP_USER)
1050 # We do this little dance with the search path to insure
1051 # that programs that we select for use by installed programs
1052 # (which may be run by the super-user) come from trusted
1053 # locations before they come from the user's private area.
1054 # This should help avoid accidentally configuring some
1055 # random version of a program in someone's personal bin.
1059 test -h /bin 2> /dev/null && PATH=/usr/bin
1060 test -d /sbin && PATH=$PATH:/sbin
1061 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1062 PATH=$PATH:/etc:$OPATH
1064 # These programs are used by the command hashing source to gather entropy
1065 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1066 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1067 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1068 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1069 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1070 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1071 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1072 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1073 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1074 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1075 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1076 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1077 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1078 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1079 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1080 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1084 # Where does ssh-rand-helper get its randomness from?
1085 INSTALL_SSH_PRNG_CMDS=""
1086 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1087 if test ! -z "$PRNGD_PORT" ; then
1088 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1089 elif test ! -z "$PRNGD_SOCKET" ; then
1090 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1092 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1093 RAND_HELPER_CMDHASH=yes
1094 INSTALL_SSH_PRNG_CMDS="yes"
1097 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1100 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1101 if test ! -z "$SONY" ; then
1102 LIBS="$LIBS -liberty";
1105 # Checks for data types
1106 AC_CHECK_SIZEOF(char, 1)
1107 AC_CHECK_SIZEOF(short int, 2)
1108 AC_CHECK_SIZEOF(int, 4)
1109 AC_CHECK_SIZEOF(long int, 4)
1110 AC_CHECK_SIZEOF(long long int, 8)
1112 # Sanity check long long for some platforms (AIX)
1113 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1114 ac_cv_sizeof_long_long_int=0
1117 # More checks for data types
1118 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1120 [ #include <sys/types.h> ],
1122 [ ac_cv_have_u_int="yes" ],
1123 [ ac_cv_have_u_int="no" ]
1126 if test "x$ac_cv_have_u_int" = "xyes" ; then
1127 AC_DEFINE(HAVE_U_INT)
1131 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1133 [ #include <sys/types.h> ],
1134 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1135 [ ac_cv_have_intxx_t="yes" ],
1136 [ ac_cv_have_intxx_t="no" ]
1139 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1140 AC_DEFINE(HAVE_INTXX_T)
1144 if (test -z "$have_intxx_t" && \
1145 test "x$ac_cv_header_stdint_h" = "xyes")
1147 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1149 [ #include <stdint.h> ],
1150 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1152 AC_DEFINE(HAVE_INTXX_T)
1155 [ AC_MSG_RESULT(no) ]
1159 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1162 #include <sys/types.h>
1163 #ifdef HAVE_STDINT_H
1164 # include <stdint.h>
1166 #include <sys/socket.h>
1167 #ifdef HAVE_SYS_BITYPES_H
1168 # include <sys/bitypes.h>
1171 [ int64_t a; a = 1;],
1172 [ ac_cv_have_int64_t="yes" ],
1173 [ ac_cv_have_int64_t="no" ]
1176 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1177 AC_DEFINE(HAVE_INT64_T)
1180 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1182 [ #include <sys/types.h> ],
1183 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1184 [ ac_cv_have_u_intxx_t="yes" ],
1185 [ ac_cv_have_u_intxx_t="no" ]
1188 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1189 AC_DEFINE(HAVE_U_INTXX_T)
1193 if test -z "$have_u_intxx_t" ; then
1194 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1196 [ #include <sys/socket.h> ],
1197 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1199 AC_DEFINE(HAVE_U_INTXX_T)
1202 [ AC_MSG_RESULT(no) ]
1206 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1208 [ #include <sys/types.h> ],
1209 [ u_int64_t a; a = 1;],
1210 [ ac_cv_have_u_int64_t="yes" ],
1211 [ ac_cv_have_u_int64_t="no" ]
1214 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1215 AC_DEFINE(HAVE_U_INT64_T)
1219 if test -z "$have_u_int64_t" ; then
1220 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1222 [ #include <sys/bitypes.h> ],
1223 [ u_int64_t a; a = 1],
1225 AC_DEFINE(HAVE_U_INT64_T)
1228 [ AC_MSG_RESULT(no) ]
1232 if test -z "$have_u_intxx_t" ; then
1233 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1236 #include <sys/types.h>
1238 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1239 [ ac_cv_have_uintxx_t="yes" ],
1240 [ ac_cv_have_uintxx_t="no" ]
1243 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1244 AC_DEFINE(HAVE_UINTXX_T)
1248 if test -z "$have_uintxx_t" ; then
1249 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1251 [ #include <stdint.h> ],
1252 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1254 AC_DEFINE(HAVE_UINTXX_T)
1257 [ AC_MSG_RESULT(no) ]
1261 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1262 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1264 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1267 #include <sys/bitypes.h>
1270 int8_t a; int16_t b; int32_t c;
1271 u_int8_t e; u_int16_t f; u_int32_t g;
1272 a = b = c = e = f = g = 1;
1275 AC_DEFINE(HAVE_U_INTXX_T)
1276 AC_DEFINE(HAVE_INTXX_T)
1284 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1287 #include <sys/types.h>
1289 [ u_char foo; foo = 125; ],
1290 [ ac_cv_have_u_char="yes" ],
1291 [ ac_cv_have_u_char="no" ]
1294 if test "x$ac_cv_have_u_char" = "xyes" ; then
1295 AC_DEFINE(HAVE_U_CHAR)
1300 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1302 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1305 #include <sys/types.h>
1307 [ size_t foo; foo = 1235; ],
1308 [ ac_cv_have_size_t="yes" ],
1309 [ ac_cv_have_size_t="no" ]
1312 if test "x$ac_cv_have_size_t" = "xyes" ; then
1313 AC_DEFINE(HAVE_SIZE_T)
1316 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1319 #include <sys/types.h>
1321 [ ssize_t foo; foo = 1235; ],
1322 [ ac_cv_have_ssize_t="yes" ],
1323 [ ac_cv_have_ssize_t="no" ]
1326 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1327 AC_DEFINE(HAVE_SSIZE_T)
1330 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1335 [ clock_t foo; foo = 1235; ],
1336 [ ac_cv_have_clock_t="yes" ],
1337 [ ac_cv_have_clock_t="no" ]
1340 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1341 AC_DEFINE(HAVE_CLOCK_T)
1344 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1347 #include <sys/types.h>
1348 #include <sys/socket.h>
1350 [ sa_family_t foo; foo = 1235; ],
1351 [ ac_cv_have_sa_family_t="yes" ],
1354 #include <sys/types.h>
1355 #include <sys/socket.h>
1356 #include <netinet/in.h>
1358 [ sa_family_t foo; foo = 1235; ],
1359 [ ac_cv_have_sa_family_t="yes" ],
1361 [ ac_cv_have_sa_family_t="no" ]
1365 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1366 AC_DEFINE(HAVE_SA_FAMILY_T)
1369 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1372 #include <sys/types.h>
1374 [ pid_t foo; foo = 1235; ],
1375 [ ac_cv_have_pid_t="yes" ],
1376 [ ac_cv_have_pid_t="no" ]
1379 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1380 AC_DEFINE(HAVE_PID_T)
1383 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1386 #include <sys/types.h>
1388 [ mode_t foo; foo = 1235; ],
1389 [ ac_cv_have_mode_t="yes" ],
1390 [ ac_cv_have_mode_t="no" ]
1393 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1394 AC_DEFINE(HAVE_MODE_T)
1398 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1401 #include <sys/types.h>
1402 #include <sys/socket.h>
1404 [ struct sockaddr_storage s; ],
1405 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1406 [ ac_cv_have_struct_sockaddr_storage="no" ]
1409 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1410 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1413 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1416 #include <sys/types.h>
1417 #include <netinet/in.h>
1419 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1420 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1421 [ ac_cv_have_struct_sockaddr_in6="no" ]
1424 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1425 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1428 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1431 #include <sys/types.h>
1432 #include <netinet/in.h>
1434 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1435 [ ac_cv_have_struct_in6_addr="yes" ],
1436 [ ac_cv_have_struct_in6_addr="no" ]
1439 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1440 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1443 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1446 #include <sys/types.h>
1447 #include <sys/socket.h>
1450 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1451 [ ac_cv_have_struct_addrinfo="yes" ],
1452 [ ac_cv_have_struct_addrinfo="no" ]
1455 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1456 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1459 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1461 [ #include <sys/time.h> ],
1462 [ struct timeval tv; tv.tv_sec = 1;],
1463 [ ac_cv_have_struct_timeval="yes" ],
1464 [ ac_cv_have_struct_timeval="no" ]
1467 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1468 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1469 have_struct_timeval=1
1472 # If we don't have int64_t then we can't compile sftp-server. So don't
1473 # even attempt to do it.
1474 if test "x$ac_cv_have_int64_t" = "xno" -a \
1475 "x$ac_cv_sizeof_long_int" != "x8" -a \
1476 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1479 dnl test snprintf (broken on SCO w/gcc)
1484 #ifdef HAVE_SNPRINTF
1488 char expected_out[50];
1490 #if (SIZEOF_LONG_INT == 8)
1491 long int num = 0x7fffffffffffffff;
1493 long long num = 0x7fffffffffffffffll;
1495 strcpy(expected_out, "9223372036854775807");
1496 snprintf(buf, mazsize, "%lld", num);
1497 if(strcmp(buf, expected_out) != 0)
1504 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1509 dnl Checks for structure members
1510 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1511 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1512 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1513 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1514 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1515 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1516 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1517 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1518 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1519 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1520 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1521 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1522 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1523 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1524 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1525 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1526 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1528 AC_CHECK_MEMBERS([struct stat.st_blksize])
1530 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1531 ac_cv_have_ss_family_in_struct_ss, [
1534 #include <sys/types.h>
1535 #include <sys/socket.h>
1537 [ struct sockaddr_storage s; s.ss_family = 1; ],
1538 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1539 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1542 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1543 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1546 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1547 ac_cv_have___ss_family_in_struct_ss, [
1550 #include <sys/types.h>
1551 #include <sys/socket.h>
1553 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1554 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1555 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1558 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1559 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1562 AC_CACHE_CHECK([for pw_class field in struct passwd],
1563 ac_cv_have_pw_class_in_struct_passwd, [
1568 [ struct passwd p; p.pw_class = 0; ],
1569 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1570 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1573 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1574 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1577 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1578 ac_cv_have_pw_expire_in_struct_passwd, [
1583 [ struct passwd p; p.pw_expire = 0; ],
1584 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1585 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1588 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1589 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1592 AC_CACHE_CHECK([for pw_change field in struct passwd],
1593 ac_cv_have_pw_change_in_struct_passwd, [
1598 [ struct passwd p; p.pw_change = 0; ],
1599 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1600 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1603 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1604 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1607 dnl make sure we're using the real structure members and not defines
1608 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1609 ac_cv_have_accrights_in_msghdr, [
1612 #include <sys/types.h>
1613 #include <sys/socket.h>
1614 #include <sys/uio.h>
1616 #ifdef msg_accrights
1620 m.msg_accrights = 0;
1624 [ ac_cv_have_accrights_in_msghdr="yes" ],
1625 [ ac_cv_have_accrights_in_msghdr="no" ]
1628 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1629 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1632 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1633 ac_cv_have_control_in_msghdr, [
1636 #include <sys/types.h>
1637 #include <sys/socket.h>
1638 #include <sys/uio.h>
1648 [ ac_cv_have_control_in_msghdr="yes" ],
1649 [ ac_cv_have_control_in_msghdr="no" ]
1652 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1653 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1656 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1658 [ extern char *__progname; printf("%s", __progname); ],
1659 [ ac_cv_libc_defines___progname="yes" ],
1660 [ ac_cv_libc_defines___progname="no" ]
1663 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1664 AC_DEFINE(HAVE___PROGNAME)
1667 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1671 [ printf("%s", __FUNCTION__); ],
1672 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1673 [ ac_cv_cc_implements___FUNCTION__="no" ]
1676 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1677 AC_DEFINE(HAVE___FUNCTION__)
1680 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1684 [ printf("%s", __func__); ],
1685 [ ac_cv_cc_implements___func__="yes" ],
1686 [ ac_cv_cc_implements___func__="no" ]
1689 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1690 AC_DEFINE(HAVE___func__)
1693 AC_CACHE_CHECK([whether getopt has optreset support],
1694 ac_cv_have_getopt_optreset, [
1699 [ extern int optreset; optreset = 0; ],
1700 [ ac_cv_have_getopt_optreset="yes" ],
1701 [ ac_cv_have_getopt_optreset="no" ]
1704 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1705 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1708 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1710 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1711 [ ac_cv_libc_defines_sys_errlist="yes" ],
1712 [ ac_cv_libc_defines_sys_errlist="no" ]
1715 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1716 AC_DEFINE(HAVE_SYS_ERRLIST)
1720 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1722 [ extern int sys_nerr; printf("%i", sys_nerr);],
1723 [ ac_cv_libc_defines_sys_nerr="yes" ],
1724 [ ac_cv_libc_defines_sys_nerr="no" ]
1727 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1728 AC_DEFINE(HAVE_SYS_NERR)
1733 # Check whether user wants sectok support
1735 [ --with-sectok Enable smartcard support using libsectok],
1737 if test "x$withval" != "xno" ; then
1738 if test "x$withval" != "xyes" ; then
1739 CPPFLAGS="$CPPFLAGS -I${withval}"
1740 LDFLAGS="$LDFLAGS -L${withval}"
1741 if test ! -z "$need_dash_r" ; then
1742 LDFLAGS="$LDFLAGS -R${withval}"
1744 if test ! -z "$blibpath" ; then
1745 blibpath="$blibpath:${withval}"
1748 AC_CHECK_HEADERS(sectok.h)
1749 if test "$ac_cv_header_sectok_h" != yes; then
1750 AC_MSG_ERROR(Can't find sectok.h)
1752 AC_CHECK_LIB(sectok, sectok_open)
1753 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1754 AC_MSG_ERROR(Can't find libsectok)
1756 AC_DEFINE(SMARTCARD)
1757 AC_DEFINE(USE_SECTOK)
1758 SCARD_MSG="yes, using sectok"
1763 # Check whether user wants OpenSC support
1765 AC_HELP_STRING([--with-opensc=PFX],
1766 [Enable smartcard support using OpenSC]),
1767 opensc_config_prefix="$withval", opensc_config_prefix="")
1768 if test x$opensc_config_prefix != x ; then
1769 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1770 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1771 if test "$OPENSC_CONFIG" != "no"; then
1772 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1773 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1774 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1775 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1776 AC_DEFINE(SMARTCARD)
1777 AC_DEFINE(USE_OPENSC)
1778 SCARD_MSG="yes, using OpenSC"
1782 # Check whether user wants Kerberos 5 support
1784 AC_ARG_WITH(kerberos5,
1785 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1787 if test "x$withval" != "xno" ; then
1788 if test "x$withval" = "xyes" ; then
1789 KRB5ROOT="/usr/local"
1793 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1794 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1797 AC_MSG_CHECKING(whether we are using Heimdal)
1798 AC_TRY_COMPILE([ #include <krb5.h> ],
1799 [ char *tmp = heimdal_version; ],
1800 [ AC_MSG_RESULT(yes)
1802 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1805 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1808 if test ! -z "$need_dash_r" ; then
1809 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1811 if test ! -z "$blibpath" ; then
1812 blibpath="$blibpath:${KRB5ROOT}/lib"
1814 AC_CHECK_LIB(resolv, dn_expand, , )
1820 # Check whether user wants Kerberos 4 support
1822 AC_ARG_WITH(kerberos4,
1823 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1825 if test "x$withval" != "xno" ; then
1826 if test "x$withval" != "xyes" ; then
1827 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1828 LDFLAGS="$LDFLAGS -L${withval}/lib"
1829 if test ! -z "$need_dash_r" ; then
1830 LDFLAGS="$LDFLAGS -R${withval}/lib"
1832 if test ! -z "$blibpath" ; then
1833 blibpath="$blibpath:${withval}/lib"
1836 if test -d /usr/include/kerberosIV ; then
1837 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1841 AC_CHECK_HEADERS(krb.h)
1842 if test "$ac_cv_header_krb_h" != yes; then
1843 AC_MSG_WARN([Cannot find krb.h, build may fail])
1845 AC_CHECK_LIB(krb, main)
1846 if test "$ac_cv_lib_krb_main" != yes; then
1847 AC_CHECK_LIB(krb4, main)
1848 if test "$ac_cv_lib_krb4_main" != yes; then
1849 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1856 AC_CHECK_LIB(des, des_cbc_encrypt)
1857 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1858 AC_CHECK_LIB(des425, des_cbc_encrypt)
1859 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1860 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1867 AC_CHECK_LIB(resolv, dn_expand, , )
1875 # Check whether user wants AFS support
1878 [ --with-afs=PATH Enable AFS support],
1880 if test "x$withval" != "xno" ; then
1882 if test "x$withval" != "xyes" ; then
1883 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1884 LDFLAGS="$LDFLAGS -L${withval}/lib"
1887 if test -z "$KRB4" ; then
1888 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1892 if test ! -z "$AFS_LIBS" ; then
1893 LIBS="$LIBS $AFS_LIBS"
1900 LIBS="$LIBS $KLIBS $K5LIBS"
1902 # Looking for programs, paths and files
1904 PRIVSEP_PATH=/var/empty
1905 AC_ARG_WITH(privsep-path,
1906 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1908 if test "x$withval" != "$no" ; then
1909 PRIVSEP_PATH=$withval
1913 AC_SUBST(PRIVSEP_PATH)
1916 [ --with-xauth=PATH Specify path to xauth program ],
1918 if test "x$withval" != "xno" ; then
1924 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1925 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1926 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1927 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1928 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1929 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1930 xauth_path="/usr/openwin/bin/xauth"
1935 if test -z "$xauth_path" ; then
1936 XAUTH_PATH="undefined"
1937 AC_SUBST(XAUTH_PATH)
1939 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1940 XAUTH_PATH=$xauth_path
1941 AC_SUBST(XAUTH_PATH)
1944 # Check for mail directory (last resort if we cannot get it from headers)
1945 if test ! -z "$MAIL" ; then
1946 maildir=`dirname $MAIL`
1947 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1950 if test -z "$no_dev_ptmx" ; then
1951 if test "x$disable_ptmx_check" != "xyes" ; then
1952 AC_CHECK_FILE("/dev/ptmx",
1954 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1960 AC_CHECK_FILE("/dev/ptc",
1962 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1967 # Options from here on. Some of these are preset by platform above
1968 AC_ARG_WITH(mantype,
1969 [ --with-mantype=man|cat|doc Set man page type],
1976 AC_MSG_ERROR(invalid man type: $withval)
1981 if test -z "$MANTYPE"; then
1982 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
1983 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
1984 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1986 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1993 if test "$MANTYPE" = "doc"; then
2000 # Check whether to enable MD5 passwords
2002 AC_ARG_WITH(md5-passwords,
2003 [ --with-md5-passwords Enable use of MD5 passwords],
2005 if test "x$withval" != "xno" ; then
2006 AC_DEFINE(HAVE_MD5_PASSWORDS)
2012 # Whether to disable shadow password support
2014 [ --without-shadow Disable shadow password support],
2016 if test "x$withval" = "xno" ; then
2017 AC_DEFINE(DISABLE_SHADOW)
2023 if test -z "$disable_shadow" ; then
2024 AC_MSG_CHECKING([if the systems has expire shadow information])
2027 #include <sys/types.h>
2030 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2031 [ sp_expire_available=yes ], []
2034 if test "x$sp_expire_available" = "xyes" ; then
2036 AC_DEFINE(HAS_SHADOW_EXPIRE)
2042 # Use ip address instead of hostname in $DISPLAY
2043 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2044 DISPLAY_HACK_MSG="yes"
2045 AC_DEFINE(IPADDR_IN_DISPLAY)
2047 DISPLAY_HACK_MSG="no"
2048 AC_ARG_WITH(ipaddr-display,
2049 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2051 if test "x$withval" != "xno" ; then
2052 AC_DEFINE(IPADDR_IN_DISPLAY)
2053 DISPLAY_HACK_MSG="yes"
2059 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2060 if test $ac_cv_func_login_getcapbool = "yes" -a \
2061 $ac_cv_header_login_cap_h = "yes" ; then
2064 # Whether to mess with the default path
2065 SERVER_PATH_MSG="(default)"
2066 AC_ARG_WITH(default-path,
2067 [ --with-default-path= Specify default \$PATH environment for server],
2069 if test "$USES_LOGIN_CONF" = "yes" ; then
2071 --with-default-path=PATH has no effect on this system.
2072 Edit /etc/login.conf instead.])
2073 elif test "x$withval" != "xno" ; then
2074 user_path="$withval"
2075 SERVER_PATH_MSG="$withval"
2078 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2079 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2083 /* find out what STDPATH is */
2088 #ifndef _PATH_STDPATH
2089 # ifdef _PATH_USERPATH /* Irix */
2090 # define _PATH_STDPATH _PATH_USERPATH
2092 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2095 #include <sys/types.h>
2096 #include <sys/stat.h>
2098 #define DATA "conftest.stdpath"
2105 fd = fopen(DATA,"w");
2109 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2114 ], [ user_path=`cat conftest.stdpath` ],
2115 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2116 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2118 # make sure $bindir is in USER_PATH so scp will work
2119 t_bindir=`eval echo ${bindir}`
2121 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2124 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2126 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2127 if test $? -ne 0 ; then
2128 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2129 if test $? -ne 0 ; then
2130 user_path=$user_path:$t_bindir
2131 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2136 if test "$USES_LOGIN_CONF" != "yes" ; then
2137 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2141 # Set superuser path separately to user path
2142 AC_ARG_WITH(superuser-path,
2143 [ --with-superuser-path= Specify different path for super-user],
2145 if test "x$withval" != "xno" ; then
2146 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2147 superuser_path=$withval
2153 # Whether to force IPv4 by default (needed on broken glibc Linux)
2155 AC_ARG_WITH(ipv4-default,
2156 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2158 if test "x$withval" != "xno" ; then
2159 AC_DEFINE(IPV4_DEFAULT)
2165 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2166 IPV4_IN6_HACK_MSG="no"
2168 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2170 if test "x$withval" != "xno" ; then
2172 AC_DEFINE(IPV4_IN_IPV6)
2173 IPV4_IN6_HACK_MSG="yes"
2178 if test "x$inet6_default_4in6" = "xyes"; then
2179 AC_MSG_RESULT([yes (default)])
2180 AC_DEFINE(IPV4_IN_IPV6)
2181 IPV4_IN6_HACK_MSG="yes"
2183 AC_MSG_RESULT([no (default)])
2188 # Whether to enable BSD auth support
2190 AC_ARG_WITH(bsd-auth,
2191 [ --with-bsd-auth Enable BSD auth support],
2193 if test "x$withval" != "xno" ; then
2200 # Where to place sshd.pid
2202 # make sure the directory exists
2203 if test ! -d $piddir ; then
2204 piddir=`eval echo ${sysconfdir}`
2206 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2210 AC_ARG_WITH(pid-dir,
2211 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2213 if test "x$withval" != "xno" ; then
2215 if test ! -d $piddir ; then
2216 AC_MSG_WARN([** no $piddir directory on this system **])
2222 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2225 dnl allow user to disable some login recording features
2226 AC_ARG_ENABLE(lastlog,
2227 [ --disable-lastlog disable use of lastlog even if detected [no]],
2228 [ AC_DEFINE(DISABLE_LASTLOG) ]
2231 [ --disable-utmp disable use of utmp even if detected [no]],
2232 [ AC_DEFINE(DISABLE_UTMP) ]
2234 AC_ARG_ENABLE(utmpx,
2235 [ --disable-utmpx disable use of utmpx even if detected [no]],
2236 [ AC_DEFINE(DISABLE_UTMPX) ]
2239 [ --disable-wtmp disable use of wtmp even if detected [no]],
2240 [ AC_DEFINE(DISABLE_WTMP) ]
2242 AC_ARG_ENABLE(wtmpx,
2243 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2244 [ AC_DEFINE(DISABLE_WTMPX) ]
2246 AC_ARG_ENABLE(libutil,
2247 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2248 [ AC_DEFINE(DISABLE_LOGIN) ]
2250 AC_ARG_ENABLE(pututline,
2251 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2252 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2254 AC_ARG_ENABLE(pututxline,
2255 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2256 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2258 AC_ARG_WITH(lastlog,
2259 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2261 if test "x$withval" = "xno" ; then
2262 AC_DEFINE(DISABLE_LASTLOG)
2264 conf_lastlog_location=$withval
2269 dnl lastlog, [uw]tmpx? detection
2270 dnl NOTE: set the paths in the platform section to avoid the
2271 dnl need for command-line parameters
2272 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2274 dnl lastlog detection
2275 dnl NOTE: the code itself will detect if lastlog is a directory
2276 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2278 #include <sys/types.h>
2280 #ifdef HAVE_LASTLOG_H
2281 # include <lastlog.h>
2290 [ char *lastlog = LASTLOG_FILE; ],
2291 [ AC_MSG_RESULT(yes) ],
2294 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2296 #include <sys/types.h>
2298 #ifdef HAVE_LASTLOG_H
2299 # include <lastlog.h>
2305 [ char *lastlog = _PATH_LASTLOG; ],
2306 [ AC_MSG_RESULT(yes) ],
2309 system_lastlog_path=no
2314 if test -z "$conf_lastlog_location"; then
2315 if test x"$system_lastlog_path" = x"no" ; then
2316 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2317 if (test -d "$f" || test -f "$f") ; then
2318 conf_lastlog_location=$f
2321 if test -z "$conf_lastlog_location"; then
2322 AC_MSG_WARN([** Cannot find lastlog **])
2323 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2328 if test -n "$conf_lastlog_location"; then
2329 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2333 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2335 #include <sys/types.h>
2341 [ char *utmp = UTMP_FILE; ],
2342 [ AC_MSG_RESULT(yes) ],
2344 system_utmp_path=no ]
2346 if test -z "$conf_utmp_location"; then
2347 if test x"$system_utmp_path" = x"no" ; then
2348 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2349 if test -f $f ; then
2350 conf_utmp_location=$f
2353 if test -z "$conf_utmp_location"; then
2354 AC_DEFINE(DISABLE_UTMP)
2358 if test -n "$conf_utmp_location"; then
2359 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2363 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2365 #include <sys/types.h>
2371 [ char *wtmp = WTMP_FILE; ],
2372 [ AC_MSG_RESULT(yes) ],
2374 system_wtmp_path=no ]
2376 if test -z "$conf_wtmp_location"; then
2377 if test x"$system_wtmp_path" = x"no" ; then
2378 for f in /usr/adm/wtmp /var/log/wtmp; do
2379 if test -f $f ; then
2380 conf_wtmp_location=$f
2383 if test -z "$conf_wtmp_location"; then
2384 AC_DEFINE(DISABLE_WTMP)
2388 if test -n "$conf_wtmp_location"; then
2389 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2393 dnl utmpx detection - I don't know any system so perverse as to require
2394 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2396 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2398 #include <sys/types.h>
2407 [ char *utmpx = UTMPX_FILE; ],
2408 [ AC_MSG_RESULT(yes) ],
2410 system_utmpx_path=no ]
2412 if test -z "$conf_utmpx_location"; then
2413 if test x"$system_utmpx_path" = x"no" ; then
2414 AC_DEFINE(DISABLE_UTMPX)
2417 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2421 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2423 #include <sys/types.h>
2432 [ char *wtmpx = WTMPX_FILE; ],
2433 [ AC_MSG_RESULT(yes) ],
2435 system_wtmpx_path=no ]
2437 if test -z "$conf_wtmpx_location"; then
2438 if test x"$system_wtmpx_path" = x"no" ; then
2439 AC_DEFINE(DISABLE_WTMPX)
2442 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2446 if test ! -z "$blibpath" ; then
2447 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2448 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2451 dnl remove pam and dl because they are in $LIBPAM
2452 if test "$PAM_MSG" = yes ; then
2453 LIBS=`echo $LIBS | sed 's/-lpam //'`
2455 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2456 LIBS=`echo $LIBS | sed 's/-ldl //'`
2460 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2463 # Print summary of options
2465 # Someone please show me a better way :)
2466 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2467 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2468 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2469 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2470 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2471 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2472 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2473 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2474 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2475 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2478 echo "OpenSSH has been configured with the following options:"
2479 echo " User binaries: $B"
2480 echo " System binaries: $C"
2481 echo " Configuration files: $D"
2482 echo " Askpass program: $E"
2483 echo " Manual pages: $F"
2484 echo " PID file: $G"
2485 echo " Privilege separation chroot path: $H"
2486 if test "$USES_LOGIN_CONF" = "yes" ; then
2487 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2489 echo " sshd default user PATH: $I"
2491 if test ! -z "$superuser_path" ; then
2492 echo " sshd superuser user PATH: $J"
2494 echo " Manpage format: $MANTYPE"
2495 echo " PAM support: ${PAM_MSG}"
2496 echo " KerberosIV support: $KRB4_MSG"
2497 echo " KerberosV support: $KRB5_MSG"
2498 echo " Smartcard support: $SCARD_MSG"
2499 echo " AFS support: $AFS_MSG"
2500 echo " S/KEY support: $SKEY_MSG"
2501 echo " TCP Wrappers support: $TCPW_MSG"
2502 echo " MD5 password support: $MD5_MSG"
2503 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2504 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2505 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2506 echo " BSD Auth support: $BSD_AUTH_MSG"
2507 echo " Random number source: $RAND_MSG"
2508 if test ! -z "$USE_RAND_HELPER" ; then
2509 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2514 echo " Host: ${host}"
2515 echo " Compiler: ${CC}"
2516 echo " Compiler flags: ${CFLAGS}"
2517 echo "Preprocessor flags: ${CPPFLAGS}"
2518 echo " Linker flags: ${LDFLAGS}"
2519 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2523 if test "x$PAM_MSG" = "xyes" ; then
2524 echo "PAM is enabled. You may need to install a PAM control file "
2525 echo "for sshd, otherwise password authentication may fail. "
2526 echo "Example PAM control files can be found in the contrib/ "
2531 if test ! -z "$NO_SFTP"; then
2532 echo "sftp-server will be disabled. Your compiler does not "
2533 echo "support 64bit integers."
2537 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2538 echo "WARNING: you are using the builtin random number collection "
2539 echo "service. Please read WARNING.RNG and request that your OS "
2540 echo "vendor includes kernel-based random number collection in "
2541 echo "future versions of your OS."