4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(ENT, ent)
20 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
21 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
75 AC_DEFINE(BROKEN_GETADDRINFO)
76 AC_DEFINE(BROKEN_REALPATH)
77 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
81 LIBS="$LIBS /usr/lib/textmode.o"
82 AC_DEFINE(HAVE_CYGWIN)
84 AC_DEFINE(DISABLE_SHADOW)
85 AC_DEFINE(IPV4_DEFAULT)
86 AC_DEFINE(IP_TOS_IS_BROKEN)
87 AC_DEFINE(NO_X11_UNIX_SOCKETS)
90 AC_DEFINE(IP_TOS_IS_BROKEN)
93 AC_DEFINE(BROKEN_GETADDRINFO)
96 if test -z "$GCC"; then
99 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
100 IPADDR_IN_DISPLAY=yes
101 AC_DEFINE(HAVE_SECUREWARE)
103 AC_DEFINE(LOGIN_NO_ENDOPT)
104 AC_DEFINE(LOGIN_NEEDS_UTMPX)
105 AC_DEFINE(DISABLE_SHADOW)
106 AC_DEFINE(DISABLE_UTMP)
107 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
108 LIBS="$LIBS -lxnet -lsec -lsecpw"
109 disable_ptmx_check=yes
112 if test -z "$GCC"; then
115 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
116 IPADDR_IN_DISPLAY=yes
118 AC_DEFINE(LOGIN_NO_ENDOPT)
119 AC_DEFINE(LOGIN_NEEDS_UTMPX)
120 AC_DEFINE(DISABLE_SHADOW)
121 AC_DEFINE(DISABLE_UTMP)
122 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
123 LIBS="$LIBS -lxnet -lsec"
126 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
127 IPADDR_IN_DISPLAY=yes
128 AC_DEFINE(PAM_SUN_CODEBASE)
130 AC_DEFINE(LOGIN_NO_ENDOPT)
131 AC_DEFINE(LOGIN_NEEDS_UTMPX)
132 AC_DEFINE(DISABLE_SHADOW)
133 AC_DEFINE(DISABLE_UTMP)
134 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
135 LIBS="$LIBS -lxnet -lsec"
138 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
140 PATH="$PATH:/usr/etc"
141 AC_DEFINE(BROKEN_INET_NTOA)
142 AC_DEFINE(WITH_ABBREV_NO_TTY)
145 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
147 PATH="$PATH:/usr/etc"
148 AC_DEFINE(WITH_IRIX_ARRAY)
149 AC_DEFINE(WITH_IRIX_PROJECT)
150 AC_DEFINE(WITH_IRIX_AUDIT)
151 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
152 AC_DEFINE(BROKEN_INET_NTOA)
153 AC_DEFINE(WITH_ABBREV_NO_TTY)
157 check_for_libcrypt_later=1
158 AC_DEFINE(DONT_TRY_OTHER_AF)
159 AC_DEFINE(PAM_TTY_KLUDGE)
160 inet6_default_4in6=yes
162 mips-sony-bsd|mips-sony-newsos4)
163 AC_DEFINE(HAVE_NEWS4)
170 check_for_libcrypt_later=1
173 conf_lastlog_location="/usr/adm/lastlog"
174 conf_utmp_location=/etc/utmp
175 conf_wtmp_location=/usr/adm/wtmp
178 AC_DEFINE(BROKEN_REALPATH)
180 AC_DEFINE(BROKEN_SAVED_UIDS)
181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
186 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
188 AC_DEFINE(PAM_SUN_CODEBASE)
189 AC_DEFINE(LOGIN_NEEDS_UTMPX)
190 AC_DEFINE(LOGIN_NEEDS_TERM)
191 AC_DEFINE(PAM_TTY_KLUDGE)
192 # hardwire lastlog location (can't detect it on some versions)
193 conf_lastlog_location="/var/adm/lastlog"
194 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
195 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
196 if test "$sol2ver" -ge 8; then
198 AC_DEFINE(DISABLE_UTMP)
199 AC_DEFINE(DISABLE_WTMP)
205 CPPFLAGS="$CPPFLAGS -DSUNOS4"
206 AC_CHECK_FUNCS(getpwanam)
207 AC_DEFINE(PAM_SUN_CODEBASE)
208 conf_utmp_location=/etc/utmp
209 conf_wtmp_location=/var/adm/wtmp
210 conf_lastlog_location=/var/adm/lastlog
214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
220 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
221 # /usr/ucblib MUST NOT be searched on ReliantUNIX
222 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 IPADDR_IN_DISPLAY=yes
225 AC_DEFINE(IP_TOS_IS_BROKEN)
226 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
227 # Attention: always take care to bind libsocket and libnsl before libc,
228 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
231 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
232 LDFLAGS="$LDFLAGS -L/usr/local/lib"
237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
244 LDFLAGS="$LDFLAGS -L/usr/local/lib"
247 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
248 LDFLAGS="$LDFLAGS -L/usr/local/lib"
249 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
250 rsh_path="/usr/bin/rcmd"
253 AC_DEFINE(BROKEN_SYS_TERMIO_H)
255 AC_DEFINE(HAVE_SECUREWARE)
256 AC_DEFINE(DISABLE_SHADOW)
257 AC_DEFINE(BROKEN_SAVED_UIDS)
258 AC_CHECK_FUNCS(getluid setluid)
260 do_sco3_extra_lib_check=yes
263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
265 LIBS="$LIBS -lprot -lx -ltinfo -lm"
267 rsh_path="/usr/bin/rcmd"
269 AC_DEFINE(HAVE_SECUREWARE)
270 AC_DEFINE(DISABLE_SHADOW)
271 AC_CHECK_FUNCS(getluid setluid)
278 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
279 LIBS="$LIBS -lgen -lrsc"
282 AC_MSG_CHECKING(for Digital Unix SIA)
285 [ --with-osfsia Enable Digital Unix SIA],
287 if test "x$withval" = "xno" ; then
288 AC_MSG_RESULT(disabled)
293 if test -z "$no_osfsia" ; then
294 if test -f /etc/sia/matrix.conf; then
296 AC_DEFINE(HAVE_OSF_SIA)
297 AC_DEFINE(DISABLE_LOGIN)
298 LIBS="$LIBS -lsecurity -ldb -lm -laud"
307 AC_DEFINE(NO_X11_UNIX_SOCKETS)
308 AC_DEFINE(MISSING_NFDBITS)
309 AC_DEFINE(MISSING_HOWMANY)
310 AC_DEFINE(MISSING_FD_MASK)
314 # Allow user to specify flags
316 [ --with-cflags Specify additional flags to pass to compiler],
318 if test "x$withval" != "xno" ; then
319 CFLAGS="$CFLAGS $withval"
323 AC_ARG_WITH(cppflags,
324 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
326 if test "x$withval" != "xno"; then
327 CPPFLAGS="$CPPFLAGS $withval"
332 [ --with-ldflags Specify additional flags to pass to linker],
334 if test "x$withval" != "xno" ; then
335 LDFLAGS="$LDFLAGS $withval"
340 [ --with-libs Specify additional libraries to link with],
342 if test "x$withval" != "xno" ; then
343 LIBS="$LIBS $withval"
348 # Checks for header files.
349 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
350 getopt.h glob.h lastlog.h limits.h login.h \
351 login_cap.h maillock.h netdb.h netgroup.h \
352 netinet/in_systm.h paths.h pty.h readpassphrase.h \
353 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
354 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
355 sys/mman.h sys/select.h sys/stat.h \
356 sys/stropts.h sys/sysmacros.h sys/time.h \
357 sys/un.h time.h ttyent.h usersec.h \
358 util.h utime.h utmp.h utmpx.h)
360 # Checks for libraries.
361 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
362 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
364 dnl SCO OS3 needs this for libwrap
365 if test "x$with_tcp_wrappers" != "xno" ; then
366 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
367 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
371 AC_CHECK_FUNC(getspnam, ,
372 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
375 [ --without-rpath Disable auto-added -R linker paths],
377 if test "x$withval" = "xno" ; then
380 if test "x$withval" = "xyes" ; then
388 [ --with-zlib=PATH Use zlib in PATH],
390 if test "x$withval" = "xno" ; then
391 AC_MSG_ERROR([*** zlib is required ***])
393 if test -d "$withval/lib"; then
394 if test -n "${need_dash_r}"; then
395 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
397 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
400 if test -n "${need_dash_r}"; then
401 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
403 LDFLAGS="-L${withval} ${LDFLAGS}"
406 if test -d "$withval/include"; then
407 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
409 CPPFLAGS="-I${withval} ${CPPFLAGS}"
414 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
417 AC_CHECK_FUNC(strcasecmp,
418 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
420 AC_CHECK_FUNC(utimes,
421 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
424 dnl Checks for libutil functions
425 AC_CHECK_HEADERS(libutil.h)
426 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
427 AC_CHECK_FUNCS(logout updwtmp logwtmp)
431 # Check for ALTDIRFUNC glob() extension
432 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
433 AC_EGREP_CPP(FOUNDIT,
436 #ifdef GLOB_ALTDIRFUNC
441 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
449 # Check for g.gl_matchc glob() extension
450 AC_MSG_CHECKING(for gl_matchc field in glob_t)
451 AC_EGREP_CPP(FOUNDIT,
454 int main(void){glob_t g; g.gl_matchc = 1;}
457 AC_DEFINE(GLOB_HAS_GL_MATCHC)
465 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
468 #include <sys/types.h>
470 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
472 [AC_MSG_RESULT(yes)],
475 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
479 # Check whether the user wants GSI (Globus) support
482 [ --with-gsi=PATH Enable GSI/Globus authentication support],
489 [ --with-globus=PATH Enable GSI/Globus authentication support],
495 # Check whether the user has a Globus flavor type
496 globus_flavor_type="no"
497 AC_ARG_WITH(globus-flavor,
498 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
500 globus_flavor_type="$withval"
504 if test "x$gsi_path" != "xno" ; then
505 # Globus GSSAPI configuration
509 # Find GLOBUS/GSI installation Directory
510 AC_MSG_CHECKING(for Globus/GSI installation directory)
512 globus_install_dir=$gsi_path
514 if test "x$globus_install_dir" = "xyes" ; then
515 if test -n "$GLOBUS_INSTALL_PATH" ; then
516 globus_install_dir=$GLOBUS_INSTALL_PATH
517 elif test -n "$GSI_INSTALL_PATH" ; then
518 globus_install_dir=$GSI_INSTALL_PATH
519 elif test -d /usr/local/globus ; then
520 globus_install_dir="/usr/local/globus"
521 elif test -d /usr/local/gsi ; then
522 globus_install_dir="/usr/local/gsi"
524 AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
527 AC_MSG_RESULT($globus_install_dir)
529 # Find GLOBUS/GSI development directory
530 AC_MSG_CHECKING(for Globus/GSI development directory)
532 if test -d ${globus_install_dir}/lib ; then
533 # Looks like a flat directory structure from configure/make
534 # and not globus-install or gsi-install
535 globus_dev_dir=$globus_install_dir
538 # Assume a true globus installation with architecture
539 # directories and run globus-development-path to find
540 # the development directory
542 # Set GLOBUS_INSTALL_PATH
543 GLOBUS_INSTALL_PATH=$globus_install_dir
544 export GLOBUS_INSTALL_PATH
546 dev_path_program=${globus_install_dir}/bin/globus-development-path
548 if test ! -x ${dev_path_program} ; then
549 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
552 globus_dev_dir=`${dev_path_program}`
554 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
555 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
558 if test ! -d "$globus_dev_dir" ; then
559 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
562 AC_MSG_RESULT($globus_dev_dir)
564 # Find GLOBUS/GSI flavor Directory
565 AC_MSG_CHECKING(for Globus flavor type)
567 if test "x$globus_flavor_type" = "xno" ; then
568 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
569 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
570 GSI_CFLAGS="-I${globus_dev_dir}/include"
573 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
575 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
576 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
579 AC_MSG_RESULT($globus_flavor_type)
580 GSI_LIBS="-lglobus_gss_assist_${globus_flavor_type} -lglobus_gssapi_gsi_${globus_flavor_type}"
581 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
582 GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
585 LIBS="$LIBS $GSI_LIBS"
586 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
587 CFLAGS="$CFLAGS $GSI_CFLAGS"
588 # End Globus/GSI section
591 # Check whether user wants S/Key support
594 [ --with-skey[[=PATH]] Enable S/Key support
595 (optionally in PATH)],
597 if test "x$withval" != "xno" ; then
599 if test "x$withval" != "xyes" ; then
600 CPPFLAGS="$CPPFLAGS -I${withval}/include"
601 LDFLAGS="$LDFLAGS -L${withval}/lib"
608 AC_MSG_CHECKING([for s/key support])
613 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
615 [AC_MSG_RESULT(yes)],
618 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
624 # Check whether user wants TCP wrappers support
626 AC_ARG_WITH(tcp-wrappers,
627 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
628 (optionally in PATH)],
630 if test "x$withval" != "xno" ; then
632 saved_LDFLAGS="$LDFLAGS"
633 saved_CPPFLAGS="$CPPFLAGS"
634 if test -n "${withval}" -a "${withval}" != "yes"; then
635 if test -d "${withval}/lib"; then
636 if test -n "${need_dash_r}"; then
637 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
639 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
642 if test -n "${need_dash_r}"; then
643 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
645 LDFLAGS="-L${withval} ${LDFLAGS}"
648 if test -d "${withval}/include"; then
649 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
651 CPPFLAGS="-I${withval} ${CPPFLAGS}"
655 LIBS="$LIBWRAP $LIBS"
656 AC_MSG_CHECKING(for libwrap)
660 int deny_severity = 0, allow_severity = 0;
670 AC_MSG_ERROR([*** libwrap missing])
678 dnl Checks for library functions.
679 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
680 clock fchmod fchown freeaddrinfo futimes gai_strerror \
681 getaddrinfo getcwd getgrouplist getnameinfo getopt \
682 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
683 inet_ntop innetgr login_getcapbool md5_crypt memmove \
684 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
685 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
686 setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \
687 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
688 strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \
689 vhangup vsnprintf waitpid __b64_ntop _getpty)
691 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
692 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
693 AC_CHECK_LIB(gen, dirname,[
694 AC_CACHE_CHECK([for broken dirname],
695 ac_cv_have_broken_dirname, [
703 int main(int argc, char **argv) {
706 strncpy(buf,"/etc", 32);
708 if (!s || strncmp(s, "/", 32) != 0) {
715 [ ac_cv_have_broken_dirname="no" ],
716 [ ac_cv_have_broken_dirname="yes" ]
720 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
722 AC_DEFINE(HAVE_DIRNAME)
723 AC_CHECK_HEADERS(libgen.h)
728 dnl Checks for time functions
729 AC_CHECK_FUNCS(gettimeofday time)
730 dnl Checks for utmp functions
731 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
732 AC_CHECK_FUNCS(utmpname)
733 dnl Checks for utmpx functions
734 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
735 AC_CHECK_FUNCS(setutxent utmpxname)
737 AC_CHECK_FUNC(getuserattr,
738 [AC_DEFINE(HAVE_GETUSERATTR)],
739 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
742 AC_CHECK_FUNC(daemon,
743 [AC_DEFINE(HAVE_DAEMON)],
744 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
747 AC_CHECK_FUNC(getpagesize,
748 [AC_DEFINE(HAVE_GETPAGESIZE)],
749 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
752 # Check for broken snprintf
753 if test "x$ac_cv_func_snprintf" = "xyes" ; then
754 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
758 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
760 [AC_MSG_RESULT(yes)],
763 AC_DEFINE(BROKEN_SNPRINTF)
764 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
774 [ --with-pam Enable PAM support ],
776 if test "x$withval" != "xno" ; then
777 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
778 AC_MSG_ERROR([PAM headers not found])
781 AC_CHECK_LIB(dl, dlopen, , )
782 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
783 AC_CHECK_FUNCS(pam_getenvlist)
784 AC_CHECK_FUNCS(pam_putenv)
790 if test $ac_cv_lib_dl_dlopen = yes; then
801 # Check for older PAM
802 if test "x$PAM_MSG" = "xyes" ; then
803 # Check PAM strerror arguments (old PAM)
804 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
808 #include <security/pam_appl.h>
810 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
813 AC_DEFINE(HAVE_OLD_PAM)
815 PAM_MSG="yes (old library)"
821 saved_CPPFLAGS="$CPPFLAGS"
822 saved_LDFLAGS="$LDFLAGS"
824 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
826 if test "x$withval" != "xno" ; then
827 if test -d "$withval/lib"; then
828 if test -n "${need_dash_r}"; then
829 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
831 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
834 if test -n "${need_dash_r}"; then
835 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
837 LDFLAGS="-L${withval} ${LDFLAGS}"
840 if test -d "$withval/include"; then
841 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
843 CPPFLAGS="-I${withval} ${CPPFLAGS}"
849 # Patch up SSL libraries for GSI authentication as needed
850 if test "x$globus_flavor_type" != "xno" ; then
851 # For Globus 2, always link with the static libraries
852 LIBS="$LIBS ${gsi_path}/lib/libglobus_ssl_utils_${globus_flavor_type}.a ${gsi_path}/lib/libssl_${globus_flavor_type}.a ${gsi_path}/lib/libcrypto_${globus_flavor_type}.a"
854 if test "x$gsi_path" != "xno" ; then
855 # Older GSI needs -lssl too
856 LIBS="$LIBS -lssl -lcrypto"
857 else # if no GSI authentication (i.e., OpenSSL default)
858 LIBS="$LIBS -lcrypto"
860 fi # globus_flavor_type
862 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
864 dnl Check default openssl install dir
865 if test -n "${need_dash_r}"; then
866 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
868 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
870 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
871 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
873 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
880 # Sanity check OpenSSL headers
881 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
885 #include <openssl/opensslv.h>
886 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
893 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
897 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
898 # version in OpenSSL. Skip this for PAM
899 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
900 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
904 ### Configure cryptographic random number support
906 # Check wheter OpenSSL seeds itself
907 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
911 #include <openssl/rand.h>
912 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
915 OPENSSL_SEEDS_ITSELF=yes
920 # Default to use of the rand helper if OpenSSL doesn't
927 # Do we want to force the use of the rand helper?
928 AC_ARG_WITH(rand-helper,
929 [ --with-rand-helper Use subprocess to gather strong randomness ],
931 if test "x$withval" = "xno" ; then
932 # Force use of OpenSSL's internal RNG, even if
933 # the previous test showed it to be unseeded.
934 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
935 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
936 OPENSSL_SEEDS_ITSELF=yes
945 # Which randomness source do we use?
946 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
948 AC_DEFINE(OPENSSL_PRNG_ONLY)
949 RAND_MSG="OpenSSL internal ONLY"
950 INSTALL_SSH_RAND_HELPER=""
951 elif test ! -z "$USE_RAND_HELPER" ; then
952 # install rand helper
953 RAND_MSG="ssh-rand-helper"
954 INSTALL_SSH_RAND_HELPER="yes"
956 AC_SUBST(INSTALL_SSH_RAND_HELPER)
958 ### Configuration of ssh-rand-helper
961 AC_ARG_WITH(prngd-port,
962 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
971 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
974 if test ! -z "$withval" ; then
975 PRNGD_PORT="$withval"
976 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
981 # PRNGD Unix domain socket
982 AC_ARG_WITH(prngd-socket,
983 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
987 withval="/var/run/egd-pool"
995 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
999 if test ! -z "$withval" ; then
1000 if test ! -z "$PRNGD_PORT" ; then
1001 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1003 if test ! -r "$withval" ; then
1004 AC_MSG_WARN(Entropy socket is not readable)
1006 PRNGD_SOCKET="$withval"
1007 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1011 # Check for existing socket only if we don't have a random device already
1012 if test "$USE_RAND_HELPER" = yes ; then
1013 AC_MSG_CHECKING(for PRNGD/EGD socket)
1014 # Insert other locations here
1015 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1016 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1017 PRNGD_SOCKET="$sock"
1018 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1022 if test ! -z "$PRNGD_SOCKET" ; then
1023 AC_MSG_RESULT($PRNGD_SOCKET)
1025 AC_MSG_RESULT(not found)
1031 # Change default command timeout for hashing entropy source
1033 AC_ARG_WITH(entropy-timeout,
1034 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1036 if test "x$withval" != "xno" ; then
1037 entropy_timeout=$withval
1041 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1043 ssh_privsep_user=sshd
1044 AC_ARG_WITH(privsep-user,
1045 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1047 if test -n "$withval"; then
1048 ssh_privsep_user=$withval
1052 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
1054 # We do this little dance with the search path to insure
1055 # that programs that we select for use by installed programs
1056 # (which may be run by the super-user) come from trusted
1057 # locations before they come from the user's private area.
1058 # This should help avoid accidentally configuring some
1059 # random version of a program in someone's personal bin.
1063 test -h /bin 2> /dev/null && PATH=/usr/bin
1064 test -d /sbin && PATH=$PATH:/sbin
1065 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1066 PATH=$PATH:/etc:$OPATH
1068 # These programs are used by the command hashing source to gather entropy
1069 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1070 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1071 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1072 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1073 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1074 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1075 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1076 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1077 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1078 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1079 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1080 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1081 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1082 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1083 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1084 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1088 # Where does ssh-rand-helper get its randomness from?
1089 INSTALL_SSH_PRNG_CMDS=""
1090 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1091 if test ! -z "$PRNGD_PORT" ; then
1092 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1093 elif test ! -z "$PRNGD_SOCKET" ; then
1094 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1096 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1097 RAND_HELPER_CMDHASH=yes
1098 INSTALL_SSH_PRNG_CMDS="yes"
1101 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1104 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1105 if test ! -z "$SONY" ; then
1106 LIBS="$LIBS -liberty";
1109 # Checks for data types
1110 AC_CHECK_SIZEOF(char, 1)
1111 AC_CHECK_SIZEOF(short int, 2)
1112 AC_CHECK_SIZEOF(int, 4)
1113 AC_CHECK_SIZEOF(long int, 4)
1114 AC_CHECK_SIZEOF(long long int, 8)
1116 # Sanity check long long for some platforms (AIX)
1117 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1118 ac_cv_sizeof_long_long_int=0
1121 # More checks for data types
1122 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1124 [ #include <sys/types.h> ],
1126 [ ac_cv_have_u_int="yes" ],
1127 [ ac_cv_have_u_int="no" ]
1130 if test "x$ac_cv_have_u_int" = "xyes" ; then
1131 AC_DEFINE(HAVE_U_INT)
1135 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1137 [ #include <sys/types.h> ],
1138 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1139 [ ac_cv_have_intxx_t="yes" ],
1140 [ ac_cv_have_intxx_t="no" ]
1143 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1144 AC_DEFINE(HAVE_INTXX_T)
1148 if (test -z "$have_intxx_t" && \
1149 test "x$ac_cv_header_stdint_h" = "xyes")
1151 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1153 [ #include <stdint.h> ],
1154 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1156 AC_DEFINE(HAVE_INTXX_T)
1159 [ AC_MSG_RESULT(no) ]
1163 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1165 [ #include <sys/types.h> ],
1166 [ int64_t a; a = 1;],
1167 [ ac_cv_have_int64_t="yes" ],
1168 [ ac_cv_have_int64_t="no" ]
1171 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1172 AC_DEFINE(HAVE_INT64_T)
1176 if test -z "$have_int64_t" ; then
1177 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1179 [ #include <sys/socket.h> ],
1180 [ int64_t a; a = 1],
1182 AC_DEFINE(HAVE_INT64_T)
1185 [ AC_MSG_RESULT(no) ]
1189 if test -z "$have_int64_t" ; then
1190 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1192 [ #include <sys/bitypes.h> ],
1193 [ int64_t a; a = 1],
1195 AC_DEFINE(HAVE_INT64_T)
1198 [ AC_MSG_RESULT(no) ]
1202 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1204 [ #include <sys/types.h> ],
1205 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1206 [ ac_cv_have_u_intxx_t="yes" ],
1207 [ ac_cv_have_u_intxx_t="no" ]
1210 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1211 AC_DEFINE(HAVE_U_INTXX_T)
1215 if test -z "$have_u_intxx_t" ; then
1216 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1218 [ #include <sys/socket.h> ],
1219 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1221 AC_DEFINE(HAVE_U_INTXX_T)
1224 [ AC_MSG_RESULT(no) ]
1228 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1230 [ #include <sys/types.h> ],
1231 [ u_int64_t a; a = 1;],
1232 [ ac_cv_have_u_int64_t="yes" ],
1233 [ ac_cv_have_u_int64_t="no" ]
1236 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1237 AC_DEFINE(HAVE_U_INT64_T)
1241 if test -z "$have_u_int64_t" ; then
1242 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1244 [ #include <sys/bitypes.h> ],
1245 [ u_int64_t a; a = 1],
1247 AC_DEFINE(HAVE_U_INT64_T)
1250 [ AC_MSG_RESULT(no) ]
1254 if test -z "$have_u_intxx_t" ; then
1255 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1258 #include <sys/types.h>
1260 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1261 [ ac_cv_have_uintxx_t="yes" ],
1262 [ ac_cv_have_uintxx_t="no" ]
1265 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1266 AC_DEFINE(HAVE_UINTXX_T)
1270 if test -z "$have_uintxx_t" ; then
1271 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1273 [ #include <stdint.h> ],
1274 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1276 AC_DEFINE(HAVE_UINTXX_T)
1279 [ AC_MSG_RESULT(no) ]
1283 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1284 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1286 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1289 #include <sys/bitypes.h>
1292 int8_t a; int16_t b; int32_t c;
1293 u_int8_t e; u_int16_t f; u_int32_t g;
1294 a = b = c = e = f = g = 1;
1297 AC_DEFINE(HAVE_U_INTXX_T)
1298 AC_DEFINE(HAVE_INTXX_T)
1306 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1309 #include <sys/types.h>
1311 [ u_char foo; foo = 125; ],
1312 [ ac_cv_have_u_char="yes" ],
1313 [ ac_cv_have_u_char="no" ]
1316 if test "x$ac_cv_have_u_char" = "xyes" ; then
1317 AC_DEFINE(HAVE_U_CHAR)
1322 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1324 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1327 #include <sys/types.h>
1329 [ size_t foo; foo = 1235; ],
1330 [ ac_cv_have_size_t="yes" ],
1331 [ ac_cv_have_size_t="no" ]
1334 if test "x$ac_cv_have_size_t" = "xyes" ; then
1335 AC_DEFINE(HAVE_SIZE_T)
1338 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1341 #include <sys/types.h>
1343 [ ssize_t foo; foo = 1235; ],
1344 [ ac_cv_have_ssize_t="yes" ],
1345 [ ac_cv_have_ssize_t="no" ]
1348 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1349 AC_DEFINE(HAVE_SSIZE_T)
1352 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1357 [ clock_t foo; foo = 1235; ],
1358 [ ac_cv_have_clock_t="yes" ],
1359 [ ac_cv_have_clock_t="no" ]
1362 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1363 AC_DEFINE(HAVE_CLOCK_T)
1366 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1369 #include <sys/types.h>
1370 #include <sys/socket.h>
1372 [ sa_family_t foo; foo = 1235; ],
1373 [ ac_cv_have_sa_family_t="yes" ],
1376 #include <sys/types.h>
1377 #include <sys/socket.h>
1378 #include <netinet/in.h>
1380 [ sa_family_t foo; foo = 1235; ],
1381 [ ac_cv_have_sa_family_t="yes" ],
1383 [ ac_cv_have_sa_family_t="no" ]
1387 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1388 AC_DEFINE(HAVE_SA_FAMILY_T)
1391 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1394 #include <sys/types.h>
1396 [ pid_t foo; foo = 1235; ],
1397 [ ac_cv_have_pid_t="yes" ],
1398 [ ac_cv_have_pid_t="no" ]
1401 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1402 AC_DEFINE(HAVE_PID_T)
1405 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1408 #include <sys/types.h>
1410 [ mode_t foo; foo = 1235; ],
1411 [ ac_cv_have_mode_t="yes" ],
1412 [ ac_cv_have_mode_t="no" ]
1415 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1416 AC_DEFINE(HAVE_MODE_T)
1420 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1423 #include <sys/types.h>
1424 #include <sys/socket.h>
1426 [ struct sockaddr_storage s; ],
1427 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1428 [ ac_cv_have_struct_sockaddr_storage="no" ]
1431 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1432 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1435 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1438 #include <sys/types.h>
1439 #include <netinet/in.h>
1441 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1442 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1443 [ ac_cv_have_struct_sockaddr_in6="no" ]
1446 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1447 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1450 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1453 #include <sys/types.h>
1454 #include <netinet/in.h>
1456 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1457 [ ac_cv_have_struct_in6_addr="yes" ],
1458 [ ac_cv_have_struct_in6_addr="no" ]
1461 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1462 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1465 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1468 #include <sys/types.h>
1469 #include <sys/socket.h>
1472 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1473 [ ac_cv_have_struct_addrinfo="yes" ],
1474 [ ac_cv_have_struct_addrinfo="no" ]
1477 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1478 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1481 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1483 [ #include <sys/time.h> ],
1484 [ struct timeval tv; tv.tv_sec = 1;],
1485 [ ac_cv_have_struct_timeval="yes" ],
1486 [ ac_cv_have_struct_timeval="no" ]
1489 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1490 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1491 have_struct_timeval=1
1494 # If we don't have int64_t then we can't compile sftp-server. So don't
1495 # even attempt to do it.
1496 if test "x$ac_cv_have_int64_t" = "xno" -a \
1497 "x$ac_cv_sizeof_long_int" != "x8" -a \
1498 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1501 dnl test snprintf (broken on SCO w/gcc)
1506 #ifdef HAVE_SNPRINTF
1510 char expected_out[50];
1512 #if (SIZEOF_LONG_INT == 8)
1513 long int num = 0x7fffffffffffffff;
1515 long long num = 0x7fffffffffffffffll;
1517 strcpy(expected_out, "9223372036854775807");
1518 snprintf(buf, mazsize, "%lld", num);
1519 if(strcmp(buf, expected_out) != 0)
1526 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1531 dnl Checks for structure members
1532 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1533 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1534 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1535 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1536 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1537 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1538 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1539 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1540 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1541 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1542 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1543 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1544 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1545 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1546 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1547 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1548 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1550 AC_CHECK_MEMBERS([struct stat.st_blksize])
1552 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1553 ac_cv_have_ss_family_in_struct_ss, [
1556 #include <sys/types.h>
1557 #include <sys/socket.h>
1559 [ struct sockaddr_storage s; s.ss_family = 1; ],
1560 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1561 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1564 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1565 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1568 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1569 ac_cv_have___ss_family_in_struct_ss, [
1572 #include <sys/types.h>
1573 #include <sys/socket.h>
1575 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1576 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1577 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1580 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1581 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1584 AC_CACHE_CHECK([for pw_class field in struct passwd],
1585 ac_cv_have_pw_class_in_struct_passwd, [
1590 [ struct passwd p; p.pw_class = 0; ],
1591 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1592 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1595 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1596 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1599 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1600 ac_cv_have_pw_expire_in_struct_passwd, [
1605 [ struct passwd p; p.pw_expire = 0; ],
1606 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1607 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1610 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1611 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1614 AC_CACHE_CHECK([for pw_change field in struct passwd],
1615 ac_cv_have_pw_change_in_struct_passwd, [
1620 [ struct passwd p; p.pw_change = 0; ],
1621 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1622 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1625 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1626 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1629 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1630 ac_cv_have_accrights_in_msghdr, [
1633 #include <sys/types.h>
1634 #include <sys/socket.h>
1635 #include <sys/uio.h>
1637 [ struct msghdr m; m.msg_accrights = 0; ],
1638 [ ac_cv_have_accrights_in_msghdr="yes" ],
1639 [ ac_cv_have_accrights_in_msghdr="no" ]
1642 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1643 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1646 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1647 ac_cv_have_control_in_msghdr, [
1650 #include <sys/types.h>
1651 #include <sys/socket.h>
1652 #include <sys/uio.h>
1654 [ struct msghdr m; m.msg_control = 0; ],
1655 [ ac_cv_have_control_in_msghdr="yes" ],
1656 [ ac_cv_have_control_in_msghdr="no" ]
1659 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1660 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1663 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1665 [ extern char *__progname; printf("%s", __progname); ],
1666 [ ac_cv_libc_defines___progname="yes" ],
1667 [ ac_cv_libc_defines___progname="no" ]
1670 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1671 AC_DEFINE(HAVE___PROGNAME)
1674 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1678 [ printf("%s", __FUNCTION__); ],
1679 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1680 [ ac_cv_cc_implements___FUNCTION__="no" ]
1683 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1684 AC_DEFINE(HAVE___FUNCTION__)
1687 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1691 [ printf("%s", __func__); ],
1692 [ ac_cv_cc_implements___func__="yes" ],
1693 [ ac_cv_cc_implements___func__="no" ]
1696 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1697 AC_DEFINE(HAVE___func__)
1700 AC_CACHE_CHECK([whether getopt has optreset support],
1701 ac_cv_have_getopt_optreset, [
1706 [ extern int optreset; optreset = 0; ],
1707 [ ac_cv_have_getopt_optreset="yes" ],
1708 [ ac_cv_have_getopt_optreset="no" ]
1711 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1712 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1715 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1717 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1718 [ ac_cv_libc_defines_sys_errlist="yes" ],
1719 [ ac_cv_libc_defines_sys_errlist="no" ]
1722 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1723 AC_DEFINE(HAVE_SYS_ERRLIST)
1727 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1729 [ extern int sys_nerr; printf("%i", sys_nerr);],
1730 [ ac_cv_libc_defines_sys_nerr="yes" ],
1731 [ ac_cv_libc_defines_sys_nerr="no" ]
1734 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1735 AC_DEFINE(HAVE_SYS_NERR)
1740 # Check whether user wants sectok support
1742 [ --with-sectok Enable smartcard support using libsectok],
1744 if test "x$withval" != "xno" ; then
1745 if test "x$withval" != "xyes" ; then
1746 CPPFLAGS="$CPPFLAGS -I${withval}"
1747 LDFLAGS="$LDFLAGS -L${withval}"
1748 if test ! -z "$need_dash_r" ; then
1749 LDFLAGS="$LDFLAGS -R${withval}"
1751 if test ! -z "$blibpath" ; then
1752 blibpath="$blibpath:${withval}"
1755 AC_CHECK_HEADERS(sectok.h)
1756 if test "$ac_cv_header_sectok_h" != yes; then
1757 AC_MSG_ERROR(Can't find sectok.h)
1759 AC_CHECK_LIB(sectok, sectok_open)
1760 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1761 AC_MSG_ERROR(Can't find libsectok)
1763 AC_DEFINE(SMARTCARD)
1764 AC_DEFINE(USE_SECTOK)
1765 SCARD_MSG="yes, using sectok"
1770 # Check whether user wants OpenSC support
1772 AC_HELP_STRING([--with-opensc=PFX],
1773 [Enable smartcard support using OpenSC]),
1774 opensc_config_prefix="$withval", opensc_config_prefix="")
1775 if test x$opensc_config_prefix != x ; then
1776 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1777 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1778 if test "$OPENSC_CONFIG" != "no"; then
1779 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1780 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1781 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1782 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1783 AC_DEFINE(SMARTCARD)
1784 AC_DEFINE(USE_OPENSC)
1785 SCARD_MSG="yes, using OpenSC"
1789 # Check whether user wants Kerberos 5 support
1791 AC_ARG_WITH(kerberos5,
1792 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1794 if test "x$withval" != "xno" ; then
1795 if test "x$withval" = "xyes" ; then
1796 KRB5ROOT="/usr/local"
1800 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1801 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1804 AC_MSG_CHECKING(whether we are using Heimdal)
1805 AC_TRY_COMPILE([ #include <krb5.h> ],
1806 [ char *tmp = heimdal_version; ],
1807 [ AC_MSG_RESULT(yes)
1809 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1812 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1815 if test ! -z "$need_dash_r" ; then
1816 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1818 if test ! -z "$blibpath" ; then
1819 blibpath="$blibpath:${KRB5ROOT}/lib"
1821 AC_CHECK_LIB(resolv, dn_expand, , )
1823 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1825 K5LIBS="-lgssapi $K5LIBS" ],
1826 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1828 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1829 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1834 AC_CHECK_HEADER(gssapi.h, ,
1835 [ unset ac_cv_header_gssapi_h
1836 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1837 AC_CHECK_HEADERS(gssapi.h, ,
1838 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1844 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1845 AC_CHECK_HEADER(gssapi_krb5.h, ,
1846 [ CPPFLAGS="$oldCPP" ])
1852 # Check whether user wants Kerberos 4 support
1854 AC_ARG_WITH(kerberos4,
1855 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1857 if test "x$withval" != "xno" ; then
1858 if test "x$withval" != "xyes" ; then
1859 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1860 LDFLAGS="$LDFLAGS -L${withval}/lib"
1861 if test ! -z "$need_dash_r" ; then
1862 LDFLAGS="$LDFLAGS -R${withval}/lib"
1864 if test ! -z "$blibpath" ; then
1865 blibpath="$blibpath:${withval}/lib"
1868 if test -d /usr/include/kerberosIV ; then
1869 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1873 AC_CHECK_HEADERS(krb.h)
1874 if test "$ac_cv_header_krb_h" != yes; then
1875 AC_MSG_WARN([Cannot find krb.h, build may fail])
1877 AC_CHECK_LIB(krb, main)
1878 if test "$ac_cv_lib_krb_main" != yes; then
1879 AC_CHECK_LIB(krb4, main)
1880 if test "$ac_cv_lib_krb4_main" != yes; then
1881 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1888 AC_CHECK_LIB(des, des_cbc_encrypt)
1889 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1890 AC_CHECK_LIB(des425, des_cbc_encrypt)
1891 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1892 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1899 AC_CHECK_LIB(resolv, dn_expand, , )
1907 # Check whether user wants AFS support
1910 [ --with-afs=PATH Enable AFS support],
1912 if test "x$withval" != "xno" ; then
1914 if test "x$withval" != "xyes" ; then
1915 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1916 LDFLAGS="$LDFLAGS -L${withval}/lib"
1919 if test -z "$KRB4" ; then
1920 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1924 if test ! -z "$AFS_LIBS" ; then
1925 LIBS="$LIBS $AFS_LIBS"
1932 LIBS="$LIBS $KLIBS $K5LIBS"
1934 # Looking for programs, paths and files
1936 [ --with-rsh=PATH Specify path to remote shell program ],
1938 if test "x$withval" != "$no" ; then
1943 AC_PATH_PROG(rsh_path, rsh)
1947 PRIVSEP_PATH=/var/empty
1948 AC_ARG_WITH(privsep-path,
1949 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1951 if test "x$withval" != "$no" ; then
1952 PRIVSEP_PATH=$withval
1956 AC_SUBST(PRIVSEP_PATH)
1959 [ --with-xauth=PATH Specify path to xauth program ],
1961 if test "x$withval" != "xno" ; then
1966 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1967 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1968 xauth_path="/usr/openwin/bin/xauth"
1973 if test -z "$xauth_path" ; then
1974 XAUTH_PATH="undefined"
1975 AC_SUBST(XAUTH_PATH)
1977 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1978 XAUTH_PATH=$xauth_path
1979 AC_SUBST(XAUTH_PATH)
1981 if test ! -z "$rsh_path" ; then
1982 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1985 # Check for mail directory (last resort if we cannot get it from headers)
1986 if test ! -z "$MAIL" ; then
1987 maildir=`dirname $MAIL`
1988 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1991 if test -z "$no_dev_ptmx" ; then
1992 if test "x$disable_ptmx_check" != "xyes" ; then
1993 AC_CHECK_FILE("/dev/ptmx",
1995 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2001 AC_CHECK_FILE("/dev/ptc",
2003 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2008 # Options from here on. Some of these are preset by platform above
2009 AC_ARG_WITH(mantype,
2010 [ --with-mantype=man|cat|doc Set man page type],
2017 AC_MSG_ERROR(invalid man type: $withval)
2022 if test -z "$MANTYPE"; then
2023 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
2024 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2026 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2033 if test "$MANTYPE" = "doc"; then
2040 # Check whether to enable MD5 passwords
2042 AC_ARG_WITH(md5-passwords,
2043 [ --with-md5-passwords Enable use of MD5 passwords],
2045 if test "x$withval" != "xno" ; then
2046 AC_DEFINE(HAVE_MD5_PASSWORDS)
2052 # Whether to disable shadow password support
2054 [ --without-shadow Disable shadow password support],
2056 if test "x$withval" = "xno" ; then
2057 AC_DEFINE(DISABLE_SHADOW)
2063 if test -z "$disable_shadow" ; then
2064 AC_MSG_CHECKING([if the systems has expire shadow information])
2067 #include <sys/types.h>
2070 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2071 [ sp_expire_available=yes ], []
2074 if test "x$sp_expire_available" = "xyes" ; then
2076 AC_DEFINE(HAS_SHADOW_EXPIRE)
2082 # Use ip address instead of hostname in $DISPLAY
2083 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2084 DISPLAY_HACK_MSG="yes"
2085 AC_DEFINE(IPADDR_IN_DISPLAY)
2087 DISPLAY_HACK_MSG="no"
2088 AC_ARG_WITH(ipaddr-display,
2089 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2091 if test "x$withval" != "xno" ; then
2092 AC_DEFINE(IPADDR_IN_DISPLAY)
2093 DISPLAY_HACK_MSG="yes"
2099 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2100 if test $ac_cv_func_login_getcapbool = "yes" -a \
2101 $ac_cv_header_login_cap_h = "yes" ; then
2104 # Whether to mess with the default path
2105 SERVER_PATH_MSG="(default)"
2106 AC_ARG_WITH(default-path,
2107 [ --with-default-path= Specify default \$PATH environment for server],
2109 if test "$USES_LOGIN_CONF" = "yes" ; then
2111 --with-default-path=PATH has no effect on this system.
2112 Edit /etc/login.conf instead.])
2113 elif test "x$withval" != "xno" ; then
2114 user_path="$withval"
2115 SERVER_PATH_MSG="$withval"
2118 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2119 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2123 /* find out what STDPATH is */
2128 #ifndef _PATH_STDPATH
2129 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2131 #include <sys/types.h>
2132 #include <sys/stat.h>
2134 #define DATA "conftest.stdpath"
2141 fd = fopen(DATA,"w");
2145 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2150 ], [ user_path=`cat conftest.stdpath` ],
2151 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2152 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2154 # make sure $bindir is in USER_PATH so scp will work
2155 t_bindir=`eval echo ${bindir}`
2157 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2160 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2162 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2163 if test $? -ne 0 ; then
2164 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2165 if test $? -ne 0 ; then
2166 user_path=$user_path:$t_bindir
2167 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2172 if test "$USES_LOGIN_CONF" != "yes" ; then
2173 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2177 # Set superuser path separately to user path
2178 AC_ARG_WITH(superuser-path,
2179 [ --with-superuser-path= Specify different path for super-user],
2181 if test "x$withval" != "xno" ; then
2182 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2183 superuser_path=$withval
2189 # Whether to force IPv4 by default (needed on broken glibc Linux)
2191 AC_ARG_WITH(ipv4-default,
2192 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2194 if test "x$withval" != "xno" ; then
2195 AC_DEFINE(IPV4_DEFAULT)
2201 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2202 IPV4_IN6_HACK_MSG="no"
2204 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2206 if test "x$withval" != "xno" ; then
2208 AC_DEFINE(IPV4_IN_IPV6)
2209 IPV4_IN6_HACK_MSG="yes"
2214 if test "x$inet6_default_4in6" = "xyes"; then
2215 AC_MSG_RESULT([yes (default)])
2216 AC_DEFINE(IPV4_IN_IPV6)
2217 IPV4_IN6_HACK_MSG="yes"
2219 AC_MSG_RESULT([no (default)])
2224 # Whether to enable BSD auth support
2226 AC_ARG_WITH(bsd-auth,
2227 [ --with-bsd-auth Enable BSD auth support],
2229 if test "x$withval" != "xno" ; then
2236 AC_MSG_CHECKING(whether to install ssh as suid root)
2237 AC_ARG_ENABLE(suid-ssh,
2238 [ --enable-suid-ssh Install ssh as suid root (default)
2239 --disable-suid-ssh Install ssh without suid bit],
2240 [ case "$enableval" in
2245 *) AC_MSG_RESULT(yes)
2255 # Where to place sshd.pid
2257 # make sure the directory exists
2258 if test ! -d $piddir ; then
2259 piddir=`eval echo ${sysconfdir}`
2261 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2265 AC_ARG_WITH(pid-dir,
2266 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2268 if test "x$withval" != "xno" ; then
2270 if test ! -d $piddir ; then
2271 AC_MSG_WARN([** no $piddir directory on this system **])
2277 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2280 dnl allow user to disable some login recording features
2281 AC_ARG_ENABLE(lastlog,
2282 [ --disable-lastlog disable use of lastlog even if detected [no]],
2283 [ AC_DEFINE(DISABLE_LASTLOG) ]
2286 [ --disable-utmp disable use of utmp even if detected [no]],
2287 [ AC_DEFINE(DISABLE_UTMP) ]
2289 AC_ARG_ENABLE(utmpx,
2290 [ --disable-utmpx disable use of utmpx even if detected [no]],
2291 [ AC_DEFINE(DISABLE_UTMPX) ]
2294 [ --disable-wtmp disable use of wtmp even if detected [no]],
2295 [ AC_DEFINE(DISABLE_WTMP) ]
2297 AC_ARG_ENABLE(wtmpx,
2298 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2299 [ AC_DEFINE(DISABLE_WTMPX) ]
2301 AC_ARG_ENABLE(libutil,
2302 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2303 [ AC_DEFINE(DISABLE_LOGIN) ]
2305 AC_ARG_ENABLE(pututline,
2306 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2307 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2309 AC_ARG_ENABLE(pututxline,
2310 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2311 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2313 AC_ARG_WITH(lastlog,
2314 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2316 if test "x$withval" = "xno" ; then
2317 AC_DEFINE(DISABLE_LASTLOG)
2319 conf_lastlog_location=$withval
2324 dnl lastlog, [uw]tmpx? detection
2325 dnl NOTE: set the paths in the platform section to avoid the
2326 dnl need for command-line parameters
2327 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2329 dnl lastlog detection
2330 dnl NOTE: the code itself will detect if lastlog is a directory
2331 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2333 #include <sys/types.h>
2335 #ifdef HAVE_LASTLOG_H
2336 # include <lastlog.h>
2345 [ char *lastlog = LASTLOG_FILE; ],
2346 [ AC_MSG_RESULT(yes) ],
2349 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2351 #include <sys/types.h>
2353 #ifdef HAVE_LASTLOG_H
2354 # include <lastlog.h>
2360 [ char *lastlog = _PATH_LASTLOG; ],
2361 [ AC_MSG_RESULT(yes) ],
2364 system_lastlog_path=no
2369 if test -z "$conf_lastlog_location"; then
2370 if test x"$system_lastlog_path" = x"no" ; then
2371 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2372 if (test -d "$f" || test -f "$f") ; then
2373 conf_lastlog_location=$f
2376 if test -z "$conf_lastlog_location"; then
2377 AC_MSG_WARN([** Cannot find lastlog **])
2378 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2383 if test -n "$conf_lastlog_location"; then
2384 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2388 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2390 #include <sys/types.h>
2396 [ char *utmp = UTMP_FILE; ],
2397 [ AC_MSG_RESULT(yes) ],
2399 system_utmp_path=no ]
2401 if test -z "$conf_utmp_location"; then
2402 if test x"$system_utmp_path" = x"no" ; then
2403 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2404 if test -f $f ; then
2405 conf_utmp_location=$f
2408 if test -z "$conf_utmp_location"; then
2409 AC_DEFINE(DISABLE_UTMP)
2413 if test -n "$conf_utmp_location"; then
2414 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2418 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2420 #include <sys/types.h>
2426 [ char *wtmp = WTMP_FILE; ],
2427 [ AC_MSG_RESULT(yes) ],
2429 system_wtmp_path=no ]
2431 if test -z "$conf_wtmp_location"; then
2432 if test x"$system_wtmp_path" = x"no" ; then
2433 for f in /usr/adm/wtmp /var/log/wtmp; do
2434 if test -f $f ; then
2435 conf_wtmp_location=$f
2438 if test -z "$conf_wtmp_location"; then
2439 AC_DEFINE(DISABLE_WTMP)
2443 if test -n "$conf_wtmp_location"; then
2444 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2448 dnl utmpx detection - I don't know any system so perverse as to require
2449 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2451 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2453 #include <sys/types.h>
2462 [ char *utmpx = UTMPX_FILE; ],
2463 [ AC_MSG_RESULT(yes) ],
2465 system_utmpx_path=no ]
2467 if test -z "$conf_utmpx_location"; then
2468 if test x"$system_utmpx_path" = x"no" ; then
2469 AC_DEFINE(DISABLE_UTMPX)
2472 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2476 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2478 #include <sys/types.h>
2487 [ char *wtmpx = WTMPX_FILE; ],
2488 [ AC_MSG_RESULT(yes) ],
2490 system_wtmpx_path=no ]
2492 if test -z "$conf_wtmpx_location"; then
2493 if test x"$system_wtmpx_path" = x"no" ; then
2494 AC_DEFINE(DISABLE_WTMPX)
2497 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2501 if test ! -z "$blibpath" ; then
2502 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2503 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2506 dnl remove pam and dl because they are in $LIBPAM
2507 if test "$PAM_MSG" = yes ; then
2508 LIBS=`echo $LIBS | sed 's/-lpam //'`
2510 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2511 LIBS=`echo $LIBS | sed 's/-ldl //'`
2515 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2518 # Print summary of options
2520 # Someone please show me a better way :)
2521 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2522 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2523 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2524 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2525 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2526 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2527 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2528 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2529 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2530 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2533 echo "OpenSSH has been configured with the following options:"
2534 echo " User binaries: $B"
2535 echo " System binaries: $C"
2536 echo " Configuration files: $D"
2537 echo " Askpass program: $E"
2538 echo " Manual pages: $F"
2539 echo " PID file: $G"
2540 echo " Privilege separation chroot path: $H"
2541 if test "$USES_LOGIN_CONF" = "yes" ; then
2542 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2544 echo " sshd default user PATH: $I"
2546 if test ! -z "$superuser_path" ; then
2547 echo " sshd superuser user PATH: $J"
2549 echo " Manpage format: $MANTYPE"
2550 echo " PAM support: ${PAM_MSG}"
2551 echo " KerberosIV support: $KRB4_MSG"
2552 echo " KerberosV support: $KRB5_MSG"
2553 echo " Smartcard support: $SCARD_MSG"
2554 echo " AFS support: $AFS_MSG"
2555 echo " S/KEY support: $SKEY_MSG"
2556 echo " TCP Wrappers support: $TCPW_MSG"
2557 echo " MD5 password support: $MD5_MSG"
2558 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2559 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2560 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2561 echo " BSD Auth support: $BSD_AUTH_MSG"
2562 echo " Random number source: $RAND_MSG"
2563 if test ! -z "$USE_RAND_HELPER" ; then
2564 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2569 echo " Host: ${host}"
2570 echo " Compiler: ${CC}"
2571 echo " Compiler flags: ${CFLAGS}"
2572 echo "Preprocessor flags: ${CPPFLAGS}"
2573 echo " Linker flags: ${LDFLAGS}"
2574 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2578 if test "x$PAM_MSG" = "xyes" ; then
2579 echo "PAM is enabled. You may need to install a PAM control file "
2580 echo "for sshd, otherwise password authentication may fail. "
2581 echo "Example PAM control files can be found in the contrib/ "
2586 if test ! -z "$NO_SFTP"; then
2587 echo "sftp-server will be disabled. Your compiler does not "
2588 echo "support 64bit integers."
2592 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2593 echo "WARNING: you are using the builtin random number collection "
2594 echo "service. Please read WARNING.RNG and request that your OS "
2595 echo "vendor includes kernel-based random number collection in "
2596 echo "future versions of your OS."