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 AC_MSG_ERROR(Cannot find Globus/GSI installation directory -- a path must be specified!)
517 AC_MSG_RESULT($globus_install_dir)
519 # Find GLOBUS/GSI development directory
520 AC_MSG_CHECKING(for Globus/GSI development directory)
522 if test -d ${globus_install_dir}/lib ; then
523 # Looks like a flat directory structure from configure/make
524 # and not globus-install or gsi-install
525 globus_dev_dir=$globus_install_dir
528 # Assume a true globus installation with architecture
529 # directories and run globus-development-path to find
530 # the development directory
532 # Set GLOBUS_INSTALL_PATH
533 GLOBUS_INSTALL_PATH=$globus_install_dir
534 export GLOBUS_INSTALL_PATH
536 dev_path_program=${globus_install_dir}/bin/globus-development-path
538 if test ! -x ${dev_path_program} ; then
539 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
542 globus_dev_dir=`${dev_path_program}`
544 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
545 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
548 if test ! -d "$globus_dev_dir" ; then
549 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
552 AC_MSG_RESULT($globus_dev_dir)
554 # Find GLOBUS/GSI flavor Directory
555 AC_MSG_CHECKING(for Globus flavor type)
557 if test "x$globus_flavor_type" = "xno" ; then
558 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
559 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
560 GSI_CFLAGS="-I${globus_dev_dir}/include"
563 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
565 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
566 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
569 AC_MSG_RESULT($globus_flavor_type)
570 GSI_LIBS="${gsi_path}/lib/libglobus_gss_assist_${globus_flavor_type}.a ${gsi_path}/lib/libglobus_gssapi_gsi_${globus_flavor_type}.a"
571 GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
574 LIBS="$LIBS $GSI_LIBS"
575 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
576 CFLAGS="$CFLAGS $GSI_CFLAGS"
577 # End Globus/GSI section
580 # Check whether user wants S/Key support
583 [ --with-skey[[=PATH]] Enable S/Key support
584 (optionally in PATH)],
586 if test "x$withval" != "xno" ; then
588 if test "x$withval" != "xyes" ; then
589 CPPFLAGS="$CPPFLAGS -I${withval}/include"
590 LDFLAGS="$LDFLAGS -L${withval}/lib"
597 AC_MSG_CHECKING([for s/key support])
602 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
604 [AC_MSG_RESULT(yes)],
607 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
613 # Check whether user wants TCP wrappers support
615 AC_ARG_WITH(tcp-wrappers,
616 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
617 (optionally in PATH)],
619 if test "x$withval" != "xno" ; then
621 saved_LDFLAGS="$LDFLAGS"
622 saved_CPPFLAGS="$CPPFLAGS"
623 if test -n "${withval}" -a "${withval}" != "yes"; then
624 if test -d "${withval}/lib"; then
625 if test -n "${need_dash_r}"; then
626 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
628 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
631 if test -n "${need_dash_r}"; then
632 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
634 LDFLAGS="-L${withval} ${LDFLAGS}"
637 if test -d "${withval}/include"; then
638 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
640 CPPFLAGS="-I${withval} ${CPPFLAGS}"
644 LIBS="$LIBWRAP $LIBS"
645 AC_MSG_CHECKING(for libwrap)
649 int deny_severity = 0, allow_severity = 0;
659 AC_MSG_ERROR([*** libwrap missing])
667 dnl Checks for library functions.
668 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
669 clock fchmod fchown freeaddrinfo futimes gai_strerror \
670 getaddrinfo getcwd getgrouplist getnameinfo getopt \
671 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
672 inet_ntop innetgr login_getcapbool md5_crypt memmove \
673 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
674 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
675 setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \
676 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
677 strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \
678 vhangup vsnprintf waitpid __b64_ntop _getpty)
680 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
681 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
682 AC_CHECK_LIB(gen, dirname,[
683 AC_CACHE_CHECK([for broken dirname],
684 ac_cv_have_broken_dirname, [
692 int main(int argc, char **argv) {
695 strncpy(buf,"/etc", 32);
697 if (!s || strncmp(s, "/", 32) != 0) {
704 [ ac_cv_have_broken_dirname="no" ],
705 [ ac_cv_have_broken_dirname="yes" ]
709 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
711 AC_DEFINE(HAVE_DIRNAME)
712 AC_CHECK_HEADERS(libgen.h)
717 dnl Checks for time functions
718 AC_CHECK_FUNCS(gettimeofday time)
719 dnl Checks for utmp functions
720 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
721 AC_CHECK_FUNCS(utmpname)
722 dnl Checks for utmpx functions
723 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
724 AC_CHECK_FUNCS(setutxent utmpxname)
726 AC_CHECK_FUNC(getuserattr,
727 [AC_DEFINE(HAVE_GETUSERATTR)],
728 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
731 AC_CHECK_FUNC(daemon,
732 [AC_DEFINE(HAVE_DAEMON)],
733 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
736 AC_CHECK_FUNC(getpagesize,
737 [AC_DEFINE(HAVE_GETPAGESIZE)],
738 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
741 # Check for broken snprintf
742 if test "x$ac_cv_func_snprintf" = "xyes" ; then
743 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
747 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
749 [AC_MSG_RESULT(yes)],
752 AC_DEFINE(BROKEN_SNPRINTF)
753 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
763 [ --with-pam Enable PAM support ],
765 if test "x$withval" != "xno" ; then
766 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
767 AC_MSG_ERROR([PAM headers not found])
770 AC_CHECK_LIB(dl, dlopen, , )
771 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
772 AC_CHECK_FUNCS(pam_getenvlist)
773 AC_CHECK_FUNCS(pam_putenv)
779 if test $ac_cv_lib_dl_dlopen = yes; then
789 # Check for older PAM
790 if test "x$PAM_MSG" = "xyes" ; then
791 # Check PAM strerror arguments (old PAM)
792 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
796 #include <security/pam_appl.h>
798 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
801 AC_DEFINE(HAVE_OLD_PAM)
803 PAM_MSG="yes (old library)"
809 saved_CPPFLAGS="$CPPFLAGS"
810 saved_LDFLAGS="$LDFLAGS"
812 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
814 if test "x$withval" != "xno" ; then
815 if test -d "$withval/lib"; then
816 if test -n "${need_dash_r}"; then
817 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
819 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
822 if test -n "${need_dash_r}"; then
823 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
825 LDFLAGS="-L${withval} ${LDFLAGS}"
828 if test -d "$withval/include"; then
829 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
831 CPPFLAGS="-I${withval} ${CPPFLAGS}"
837 # Patch up SSL libraries for GSI authentication as needed
838 if test "x$globus_flavor_type" != "xno" ; then
839 # For Globus 2, always link with the static libraries
840 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"
842 if test "x$gsi_path" != "xno" ; then
843 # Older GSI needs -lssl too
844 LIBS="$LIBS -lssl -lcrypto"
845 else # if no GSI authentication (i.e., OpenSSL default)
846 LIBS="$LIBS -lcrypto"
848 fi # globus_flavor_type
850 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
852 dnl Check default openssl install dir
853 if test -n "${need_dash_r}"; then
854 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
856 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
858 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
859 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
861 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
868 # Sanity check OpenSSL headers
869 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
873 #include <openssl/opensslv.h>
874 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
881 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
885 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
886 # version in OpenSSL. Skip this for PAM
887 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
888 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
892 ### Configure cryptographic random number support
894 # Check wheter OpenSSL seeds itself
895 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
899 #include <openssl/rand.h>
900 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
903 OPENSSL_SEEDS_ITSELF=yes
908 # Default to use of the rand helper if OpenSSL doesn't
915 # Do we want to force the use of the rand helper?
916 AC_ARG_WITH(rand-helper,
917 [ --with-rand-helper Use subprocess to gather strong randomness ],
919 if test "x$withval" = "xno" ; then
920 # Force use of OpenSSL's internal RNG, even if
921 # the previous test showed it to be unseeded.
922 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
923 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
924 OPENSSL_SEEDS_ITSELF=yes
933 # Which randomness source do we use?
934 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
936 AC_DEFINE(OPENSSL_PRNG_ONLY)
937 RAND_MSG="OpenSSL internal ONLY"
938 INSTALL_SSH_RAND_HELPER=""
939 elif test ! -z "$USE_RAND_HELPER" ; then
940 # install rand helper
941 RAND_MSG="ssh-rand-helper"
942 INSTALL_SSH_RAND_HELPER="yes"
944 AC_SUBST(INSTALL_SSH_RAND_HELPER)
946 ### Configuration of ssh-rand-helper
949 AC_ARG_WITH(prngd-port,
950 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
959 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
962 if test ! -z "$withval" ; then
963 PRNGD_PORT="$withval"
964 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
969 # PRNGD Unix domain socket
970 AC_ARG_WITH(prngd-socket,
971 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
975 withval="/var/run/egd-pool"
983 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
987 if test ! -z "$withval" ; then
988 if test ! -z "$PRNGD_PORT" ; then
989 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
991 if test ! -r "$withval" ; then
992 AC_MSG_WARN(Entropy socket is not readable)
994 PRNGD_SOCKET="$withval"
995 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
999 # Check for existing socket only if we don't have a random device already
1000 if test "$USE_RAND_HELPER" = yes ; then
1001 AC_MSG_CHECKING(for PRNGD/EGD socket)
1002 # Insert other locations here
1003 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1004 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1005 PRNGD_SOCKET="$sock"
1006 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1010 if test ! -z "$PRNGD_SOCKET" ; then
1011 AC_MSG_RESULT($PRNGD_SOCKET)
1013 AC_MSG_RESULT(not found)
1019 # Change default command timeout for hashing entropy source
1021 AC_ARG_WITH(entropy-timeout,
1022 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1024 if test "x$withval" != "xno" ; then
1025 entropy_timeout=$withval
1029 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1031 ssh_privsep_user=sshd
1032 AC_ARG_WITH(privsep-user,
1033 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1035 if test -n "$withval"; then
1036 ssh_privsep_user=$withval
1040 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
1042 # We do this little dance with the search path to insure
1043 # that programs that we select for use by installed programs
1044 # (which may be run by the super-user) come from trusted
1045 # locations before they come from the user's private area.
1046 # This should help avoid accidentally configuring some
1047 # random version of a program in someone's personal bin.
1051 test -h /bin 2> /dev/null && PATH=/usr/bin
1052 test -d /sbin && PATH=$PATH:/sbin
1053 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1054 PATH=$PATH:/etc:$OPATH
1056 # These programs are used by the command hashing source to gather entropy
1057 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1058 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1059 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1060 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1061 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1062 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1063 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1064 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1065 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1066 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1067 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1068 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1069 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1070 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1071 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1072 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1076 # Where does ssh-rand-helper get its randomness from?
1077 INSTALL_SSH_PRNG_CMDS=""
1078 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1079 if test ! -z "$PRNGD_PORT" ; then
1080 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1081 elif test ! -z "$PRNGD_SOCKET" ; then
1082 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1084 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1085 RAND_HELPER_CMDHASH=yes
1086 INSTALL_SSH_PRNG_CMDS="yes"
1089 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1092 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1093 if test ! -z "$SONY" ; then
1094 LIBS="$LIBS -liberty";
1097 # Checks for data types
1098 AC_CHECK_SIZEOF(char, 1)
1099 AC_CHECK_SIZEOF(short int, 2)
1100 AC_CHECK_SIZEOF(int, 4)
1101 AC_CHECK_SIZEOF(long int, 4)
1102 AC_CHECK_SIZEOF(long long int, 8)
1104 # Sanity check long long for some platforms (AIX)
1105 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1106 ac_cv_sizeof_long_long_int=0
1109 # More checks for data types
1110 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1112 [ #include <sys/types.h> ],
1114 [ ac_cv_have_u_int="yes" ],
1115 [ ac_cv_have_u_int="no" ]
1118 if test "x$ac_cv_have_u_int" = "xyes" ; then
1119 AC_DEFINE(HAVE_U_INT)
1123 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1125 [ #include <sys/types.h> ],
1126 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1127 [ ac_cv_have_intxx_t="yes" ],
1128 [ ac_cv_have_intxx_t="no" ]
1131 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1132 AC_DEFINE(HAVE_INTXX_T)
1136 if (test -z "$have_intxx_t" && \
1137 test "x$ac_cv_header_stdint_h" = "xyes")
1139 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1141 [ #include <stdint.h> ],
1142 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1144 AC_DEFINE(HAVE_INTXX_T)
1147 [ AC_MSG_RESULT(no) ]
1151 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1153 [ #include <sys/types.h> ],
1154 [ int64_t a; a = 1;],
1155 [ ac_cv_have_int64_t="yes" ],
1156 [ ac_cv_have_int64_t="no" ]
1159 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1160 AC_DEFINE(HAVE_INT64_T)
1164 if test -z "$have_int64_t" ; then
1165 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1167 [ #include <sys/socket.h> ],
1168 [ int64_t a; a = 1],
1170 AC_DEFINE(HAVE_INT64_T)
1173 [ AC_MSG_RESULT(no) ]
1177 if test -z "$have_int64_t" ; then
1178 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1180 [ #include <sys/bitypes.h> ],
1181 [ int64_t a; a = 1],
1183 AC_DEFINE(HAVE_INT64_T)
1186 [ AC_MSG_RESULT(no) ]
1190 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1192 [ #include <sys/types.h> ],
1193 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1194 [ ac_cv_have_u_intxx_t="yes" ],
1195 [ ac_cv_have_u_intxx_t="no" ]
1198 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1199 AC_DEFINE(HAVE_U_INTXX_T)
1203 if test -z "$have_u_intxx_t" ; then
1204 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1206 [ #include <sys/socket.h> ],
1207 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1209 AC_DEFINE(HAVE_U_INTXX_T)
1212 [ AC_MSG_RESULT(no) ]
1216 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1218 [ #include <sys/types.h> ],
1219 [ u_int64_t a; a = 1;],
1220 [ ac_cv_have_u_int64_t="yes" ],
1221 [ ac_cv_have_u_int64_t="no" ]
1224 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1225 AC_DEFINE(HAVE_U_INT64_T)
1229 if test -z "$have_u_int64_t" ; then
1230 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1232 [ #include <sys/bitypes.h> ],
1233 [ u_int64_t a; a = 1],
1235 AC_DEFINE(HAVE_U_INT64_T)
1238 [ AC_MSG_RESULT(no) ]
1242 if test -z "$have_u_intxx_t" ; then
1243 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1246 #include <sys/types.h>
1248 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1249 [ ac_cv_have_uintxx_t="yes" ],
1250 [ ac_cv_have_uintxx_t="no" ]
1253 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1254 AC_DEFINE(HAVE_UINTXX_T)
1258 if test -z "$have_uintxx_t" ; then
1259 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1261 [ #include <stdint.h> ],
1262 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1264 AC_DEFINE(HAVE_UINTXX_T)
1267 [ AC_MSG_RESULT(no) ]
1271 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1272 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1274 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1277 #include <sys/bitypes.h>
1280 int8_t a; int16_t b; int32_t c;
1281 u_int8_t e; u_int16_t f; u_int32_t g;
1282 a = b = c = e = f = g = 1;
1285 AC_DEFINE(HAVE_U_INTXX_T)
1286 AC_DEFINE(HAVE_INTXX_T)
1294 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1297 #include <sys/types.h>
1299 [ u_char foo; foo = 125; ],
1300 [ ac_cv_have_u_char="yes" ],
1301 [ ac_cv_have_u_char="no" ]
1304 if test "x$ac_cv_have_u_char" = "xyes" ; then
1305 AC_DEFINE(HAVE_U_CHAR)
1310 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1312 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1315 #include <sys/types.h>
1317 [ size_t foo; foo = 1235; ],
1318 [ ac_cv_have_size_t="yes" ],
1319 [ ac_cv_have_size_t="no" ]
1322 if test "x$ac_cv_have_size_t" = "xyes" ; then
1323 AC_DEFINE(HAVE_SIZE_T)
1326 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1329 #include <sys/types.h>
1331 [ ssize_t foo; foo = 1235; ],
1332 [ ac_cv_have_ssize_t="yes" ],
1333 [ ac_cv_have_ssize_t="no" ]
1336 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1337 AC_DEFINE(HAVE_SSIZE_T)
1340 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1345 [ clock_t foo; foo = 1235; ],
1346 [ ac_cv_have_clock_t="yes" ],
1347 [ ac_cv_have_clock_t="no" ]
1350 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1351 AC_DEFINE(HAVE_CLOCK_T)
1354 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1357 #include <sys/types.h>
1358 #include <sys/socket.h>
1360 [ sa_family_t foo; foo = 1235; ],
1361 [ ac_cv_have_sa_family_t="yes" ],
1364 #include <sys/types.h>
1365 #include <sys/socket.h>
1366 #include <netinet/in.h>
1368 [ sa_family_t foo; foo = 1235; ],
1369 [ ac_cv_have_sa_family_t="yes" ],
1371 [ ac_cv_have_sa_family_t="no" ]
1375 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1376 AC_DEFINE(HAVE_SA_FAMILY_T)
1379 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1382 #include <sys/types.h>
1384 [ pid_t foo; foo = 1235; ],
1385 [ ac_cv_have_pid_t="yes" ],
1386 [ ac_cv_have_pid_t="no" ]
1389 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1390 AC_DEFINE(HAVE_PID_T)
1393 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1396 #include <sys/types.h>
1398 [ mode_t foo; foo = 1235; ],
1399 [ ac_cv_have_mode_t="yes" ],
1400 [ ac_cv_have_mode_t="no" ]
1403 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1404 AC_DEFINE(HAVE_MODE_T)
1408 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1411 #include <sys/types.h>
1412 #include <sys/socket.h>
1414 [ struct sockaddr_storage s; ],
1415 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1416 [ ac_cv_have_struct_sockaddr_storage="no" ]
1419 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1420 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1423 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1426 #include <sys/types.h>
1427 #include <netinet/in.h>
1429 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1430 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1431 [ ac_cv_have_struct_sockaddr_in6="no" ]
1434 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1435 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1438 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1441 #include <sys/types.h>
1442 #include <netinet/in.h>
1444 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1445 [ ac_cv_have_struct_in6_addr="yes" ],
1446 [ ac_cv_have_struct_in6_addr="no" ]
1449 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1450 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1453 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1456 #include <sys/types.h>
1457 #include <sys/socket.h>
1460 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1461 [ ac_cv_have_struct_addrinfo="yes" ],
1462 [ ac_cv_have_struct_addrinfo="no" ]
1465 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1466 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1469 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1471 [ #include <sys/time.h> ],
1472 [ struct timeval tv; tv.tv_sec = 1;],
1473 [ ac_cv_have_struct_timeval="yes" ],
1474 [ ac_cv_have_struct_timeval="no" ]
1477 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1478 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1479 have_struct_timeval=1
1482 # If we don't have int64_t then we can't compile sftp-server. So don't
1483 # even attempt to do it.
1484 if test "x$ac_cv_have_int64_t" = "xno" -a \
1485 "x$ac_cv_sizeof_long_int" != "x8" -a \
1486 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1489 dnl test snprintf (broken on SCO w/gcc)
1494 #ifdef HAVE_SNPRINTF
1498 char expected_out[50];
1500 #if (SIZEOF_LONG_INT == 8)
1501 long int num = 0x7fffffffffffffff;
1503 long long num = 0x7fffffffffffffffll;
1505 strcpy(expected_out, "9223372036854775807");
1506 snprintf(buf, mazsize, "%lld", num);
1507 if(strcmp(buf, expected_out) != 0)
1514 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1519 dnl Checks for structure members
1520 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1521 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1522 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1523 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1524 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1525 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1526 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1527 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1528 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1529 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1530 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1531 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1532 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1533 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1534 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1535 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1536 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1538 AC_CHECK_MEMBERS([struct stat.st_blksize])
1540 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1541 ac_cv_have_ss_family_in_struct_ss, [
1544 #include <sys/types.h>
1545 #include <sys/socket.h>
1547 [ struct sockaddr_storage s; s.ss_family = 1; ],
1548 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1549 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1552 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1553 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1556 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1557 ac_cv_have___ss_family_in_struct_ss, [
1560 #include <sys/types.h>
1561 #include <sys/socket.h>
1563 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1564 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1565 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1568 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1569 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1572 AC_CACHE_CHECK([for pw_class field in struct passwd],
1573 ac_cv_have_pw_class_in_struct_passwd, [
1578 [ struct passwd p; p.pw_class = 0; ],
1579 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1580 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1583 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1584 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1587 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1588 ac_cv_have_pw_expire_in_struct_passwd, [
1593 [ struct passwd p; p.pw_expire = 0; ],
1594 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1595 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1598 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1599 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1602 AC_CACHE_CHECK([for pw_change field in struct passwd],
1603 ac_cv_have_pw_change_in_struct_passwd, [
1608 [ struct passwd p; p.pw_change = 0; ],
1609 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1610 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1613 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1614 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1617 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1618 ac_cv_have_accrights_in_msghdr, [
1621 #include <sys/types.h>
1622 #include <sys/socket.h>
1623 #include <sys/uio.h>
1625 [ struct msghdr m; m.msg_accrights = 0; ],
1626 [ ac_cv_have_accrights_in_msghdr="yes" ],
1627 [ ac_cv_have_accrights_in_msghdr="no" ]
1630 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1631 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1634 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1635 ac_cv_have_control_in_msghdr, [
1638 #include <sys/types.h>
1639 #include <sys/socket.h>
1640 #include <sys/uio.h>
1642 [ struct msghdr m; m.msg_control = 0; ],
1643 [ ac_cv_have_control_in_msghdr="yes" ],
1644 [ ac_cv_have_control_in_msghdr="no" ]
1647 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1648 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1651 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1653 [ extern char *__progname; printf("%s", __progname); ],
1654 [ ac_cv_libc_defines___progname="yes" ],
1655 [ ac_cv_libc_defines___progname="no" ]
1658 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1659 AC_DEFINE(HAVE___PROGNAME)
1662 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1666 [ printf("%s", __FUNCTION__); ],
1667 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1668 [ ac_cv_cc_implements___FUNCTION__="no" ]
1671 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1672 AC_DEFINE(HAVE___FUNCTION__)
1675 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1679 [ printf("%s", __func__); ],
1680 [ ac_cv_cc_implements___func__="yes" ],
1681 [ ac_cv_cc_implements___func__="no" ]
1684 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1685 AC_DEFINE(HAVE___func__)
1688 AC_CACHE_CHECK([whether getopt has optreset support],
1689 ac_cv_have_getopt_optreset, [
1694 [ extern int optreset; optreset = 0; ],
1695 [ ac_cv_have_getopt_optreset="yes" ],
1696 [ ac_cv_have_getopt_optreset="no" ]
1699 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1700 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1703 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1705 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1706 [ ac_cv_libc_defines_sys_errlist="yes" ],
1707 [ ac_cv_libc_defines_sys_errlist="no" ]
1710 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1711 AC_DEFINE(HAVE_SYS_ERRLIST)
1715 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1717 [ extern int sys_nerr; printf("%i", sys_nerr);],
1718 [ ac_cv_libc_defines_sys_nerr="yes" ],
1719 [ ac_cv_libc_defines_sys_nerr="no" ]
1722 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1723 AC_DEFINE(HAVE_SYS_NERR)
1728 # Check whether user wants sectok support
1730 [ --with-sectok Enable smartcard support using libsectok],
1732 if test "x$withval" != "xno" ; then
1733 if test "x$withval" != "xyes" ; then
1734 CPPFLAGS="$CPPFLAGS -I${withval}"
1735 LDFLAGS="$LDFLAGS -L${withval}"
1736 if test ! -z "$need_dash_r" ; then
1737 LDFLAGS="$LDFLAGS -R${withval}"
1739 if test ! -z "$blibpath" ; then
1740 blibpath="$blibpath:${withval}"
1743 AC_CHECK_HEADERS(sectok.h)
1744 if test "$ac_cv_header_sectok_h" != yes; then
1745 AC_MSG_ERROR(Can't find sectok.h)
1747 AC_CHECK_LIB(sectok, sectok_open)
1748 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1749 AC_MSG_ERROR(Can't find libsectok)
1751 AC_DEFINE(SMARTCARD)
1752 AC_DEFINE(USE_SECTOK)
1753 SCARD_MSG="yes, using sectok"
1758 # Check whether user wants OpenSC support
1760 AC_HELP_STRING([--with-opensc=PFX],
1761 [Enable smartcard support using OpenSC]),
1762 opensc_config_prefix="$withval", opensc_config_prefix="")
1763 if test x$opensc_config_prefix != x ; then
1764 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1765 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1766 if test "$OPENSC_CONFIG" != "no"; then
1767 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1768 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1769 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1770 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1771 AC_DEFINE(SMARTCARD)
1772 AC_DEFINE(USE_OPENSC)
1773 SCARD_MSG="yes, using OpenSC"
1777 # Check whether user wants Kerberos 5 support
1779 AC_ARG_WITH(kerberos5,
1780 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1782 if test "x$withval" != "xno" ; then
1783 if test "x$withval" = "xyes" ; then
1784 KRB5ROOT="/usr/local"
1788 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1789 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1792 AC_MSG_CHECKING(whether we are using Heimdal)
1793 AC_TRY_COMPILE([ #include <krb5.h> ],
1794 [ char *tmp = heimdal_version; ],
1795 [ AC_MSG_RESULT(yes)
1797 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1800 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1803 if test ! -z "$need_dash_r" ; then
1804 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1806 if test ! -z "$blibpath" ; then
1807 blibpath="$blibpath:${KRB5ROOT}/lib"
1809 AC_CHECK_LIB(resolv, dn_expand, , )
1811 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1813 K5LIBS="-lgssapi $K5LIBS" ],
1814 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1816 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1817 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1822 AC_CHECK_HEADER(gssapi.h, ,
1823 [ unset ac_cv_header_gssapi_h
1824 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1825 AC_CHECK_HEADERS(gssapi.h, ,
1826 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1832 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1833 AC_CHECK_HEADER(gssapi_krb5.h, ,
1834 [ CPPFLAGS="$oldCPP" ])
1840 # Check whether user wants Kerberos 4 support
1842 AC_ARG_WITH(kerberos4,
1843 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1845 if test "x$withval" != "xno" ; then
1846 if test "x$withval" != "xyes" ; then
1847 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1848 LDFLAGS="$LDFLAGS -L${withval}/lib"
1849 if test ! -z "$need_dash_r" ; then
1850 LDFLAGS="$LDFLAGS -R${withval}/lib"
1852 if test ! -z "$blibpath" ; then
1853 blibpath="$blibpath:${withval}/lib"
1856 if test -d /usr/include/kerberosIV ; then
1857 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1861 AC_CHECK_HEADERS(krb.h)
1862 if test "$ac_cv_header_krb_h" != yes; then
1863 AC_MSG_WARN([Cannot find krb.h, build may fail])
1865 AC_CHECK_LIB(krb, main)
1866 if test "$ac_cv_lib_krb_main" != yes; then
1867 AC_CHECK_LIB(krb4, main)
1868 if test "$ac_cv_lib_krb4_main" != yes; then
1869 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1876 AC_CHECK_LIB(des, des_cbc_encrypt)
1877 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1878 AC_CHECK_LIB(des425, des_cbc_encrypt)
1879 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1880 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1887 AC_CHECK_LIB(resolv, dn_expand, , )
1895 # Check whether user wants AFS support
1898 [ --with-afs=PATH Enable AFS support],
1900 if test "x$withval" != "xno" ; then
1902 if test "x$withval" != "xyes" ; then
1903 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1904 LDFLAGS="$LDFLAGS -L${withval}/lib"
1907 if test -z "$KRB4" ; then
1908 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1912 if test ! -z "$AFS_LIBS" ; then
1913 LIBS="$LIBS $AFS_LIBS"
1920 LIBS="$LIBS $KLIBS $K5LIBS"
1922 # Looking for programs, paths and files
1924 [ --with-rsh=PATH Specify path to remote shell program ],
1926 if test "x$withval" != "$no" ; then
1931 AC_PATH_PROG(rsh_path, rsh)
1935 PRIVSEP_PATH=/var/empty
1936 AC_ARG_WITH(privsep-path,
1937 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1939 if test "x$withval" != "$no" ; then
1940 PRIVSEP_PATH=$withval
1944 AC_SUBST(PRIVSEP_PATH)
1947 [ --with-xauth=PATH Specify path to xauth program ],
1949 if test "x$withval" != "xno" ; then
1954 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1955 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1956 xauth_path="/usr/openwin/bin/xauth"
1961 if test -z "$xauth_path" ; then
1962 XAUTH_PATH="undefined"
1963 AC_SUBST(XAUTH_PATH)
1965 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1966 XAUTH_PATH=$xauth_path
1967 AC_SUBST(XAUTH_PATH)
1969 if test ! -z "$rsh_path" ; then
1970 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1973 # Check for mail directory (last resort if we cannot get it from headers)
1974 if test ! -z "$MAIL" ; then
1975 maildir=`dirname $MAIL`
1976 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1979 if test -z "$no_dev_ptmx" ; then
1980 if test "x$disable_ptmx_check" != "xyes" ; then
1981 AC_CHECK_FILE("/dev/ptmx",
1983 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1989 AC_CHECK_FILE("/dev/ptc",
1991 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1996 # Options from here on. Some of these are preset by platform above
1997 AC_ARG_WITH(mantype,
1998 [ --with-mantype=man|cat|doc Set man page type],
2005 AC_MSG_ERROR(invalid man type: $withval)
2010 if test -z "$MANTYPE"; then
2011 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
2012 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2014 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2021 if test "$MANTYPE" = "doc"; then
2028 # Check whether to enable MD5 passwords
2030 AC_ARG_WITH(md5-passwords,
2031 [ --with-md5-passwords Enable use of MD5 passwords],
2033 if test "x$withval" != "xno" ; then
2034 AC_DEFINE(HAVE_MD5_PASSWORDS)
2040 # Whether to disable shadow password support
2042 [ --without-shadow Disable shadow password support],
2044 if test "x$withval" = "xno" ; then
2045 AC_DEFINE(DISABLE_SHADOW)
2051 if test -z "$disable_shadow" ; then
2052 AC_MSG_CHECKING([if the systems has expire shadow information])
2055 #include <sys/types.h>
2058 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2059 [ sp_expire_available=yes ], []
2062 if test "x$sp_expire_available" = "xyes" ; then
2064 AC_DEFINE(HAS_SHADOW_EXPIRE)
2070 # Use ip address instead of hostname in $DISPLAY
2071 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2072 DISPLAY_HACK_MSG="yes"
2073 AC_DEFINE(IPADDR_IN_DISPLAY)
2075 DISPLAY_HACK_MSG="no"
2076 AC_ARG_WITH(ipaddr-display,
2077 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2079 if test "x$withval" != "xno" ; then
2080 AC_DEFINE(IPADDR_IN_DISPLAY)
2081 DISPLAY_HACK_MSG="yes"
2087 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2088 if test $ac_cv_func_login_getcapbool = "yes" -a \
2089 $ac_cv_header_login_cap_h = "yes" ; then
2092 # Whether to mess with the default path
2093 SERVER_PATH_MSG="(default)"
2094 AC_ARG_WITH(default-path,
2095 [ --with-default-path= Specify default \$PATH environment for server],
2097 if test "$USES_LOGIN_CONF" = "yes" ; then
2099 --with-default-path=PATH has no effect on this system.
2100 Edit /etc/login.conf instead.])
2101 elif test "x$withval" != "xno" ; then
2102 user_path="$withval"
2103 SERVER_PATH_MSG="$withval"
2106 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2107 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2111 /* find out what STDPATH is */
2116 #ifndef _PATH_STDPATH
2117 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2119 #include <sys/types.h>
2120 #include <sys/stat.h>
2122 #define DATA "conftest.stdpath"
2129 fd = fopen(DATA,"w");
2133 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2138 ], [ user_path=`cat conftest.stdpath` ],
2139 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2140 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2142 # make sure $bindir is in USER_PATH so scp will work
2143 t_bindir=`eval echo ${bindir}`
2145 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2148 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2150 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2151 if test $? -ne 0 ; then
2152 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2153 if test $? -ne 0 ; then
2154 user_path=$user_path:$t_bindir
2155 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2160 if test "$USES_LOGIN_CONF" != "yes" ; then
2161 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2165 # Set superuser path separately to user path
2166 AC_ARG_WITH(superuser-path,
2167 [ --with-superuser-path= Specify different path for super-user],
2169 if test "x$withval" != "xno" ; then
2170 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2171 superuser_path=$withval
2177 # Whether to force IPv4 by default (needed on broken glibc Linux)
2179 AC_ARG_WITH(ipv4-default,
2180 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2182 if test "x$withval" != "xno" ; then
2183 AC_DEFINE(IPV4_DEFAULT)
2189 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2190 IPV4_IN6_HACK_MSG="no"
2192 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2194 if test "x$withval" != "xno" ; then
2196 AC_DEFINE(IPV4_IN_IPV6)
2197 IPV4_IN6_HACK_MSG="yes"
2202 if test "x$inet6_default_4in6" = "xyes"; then
2203 AC_MSG_RESULT([yes (default)])
2204 AC_DEFINE(IPV4_IN_IPV6)
2205 IPV4_IN6_HACK_MSG="yes"
2207 AC_MSG_RESULT([no (default)])
2212 # Whether to enable BSD auth support
2214 AC_ARG_WITH(bsd-auth,
2215 [ --with-bsd-auth Enable BSD auth support],
2217 if test "x$withval" != "xno" ; then
2224 AC_MSG_CHECKING(whether to install ssh as suid root)
2225 AC_ARG_ENABLE(suid-ssh,
2226 [ --enable-suid-ssh Install ssh as suid root (default)
2227 --disable-suid-ssh Install ssh without suid bit],
2228 [ case "$enableval" in
2233 *) AC_MSG_RESULT(yes)
2243 # Where to place sshd.pid
2245 # make sure the directory exists
2246 if test ! -d $piddir ; then
2247 piddir=`eval echo ${sysconfdir}`
2249 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2253 AC_ARG_WITH(pid-dir,
2254 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2256 if test "x$withval" != "xno" ; then
2258 if test ! -d $piddir ; then
2259 AC_MSG_WARN([** no $piddir directory on this system **])
2265 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2268 dnl allow user to disable some login recording features
2269 AC_ARG_ENABLE(lastlog,
2270 [ --disable-lastlog disable use of lastlog even if detected [no]],
2271 [ AC_DEFINE(DISABLE_LASTLOG) ]
2274 [ --disable-utmp disable use of utmp even if detected [no]],
2275 [ AC_DEFINE(DISABLE_UTMP) ]
2277 AC_ARG_ENABLE(utmpx,
2278 [ --disable-utmpx disable use of utmpx even if detected [no]],
2279 [ AC_DEFINE(DISABLE_UTMPX) ]
2282 [ --disable-wtmp disable use of wtmp even if detected [no]],
2283 [ AC_DEFINE(DISABLE_WTMP) ]
2285 AC_ARG_ENABLE(wtmpx,
2286 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2287 [ AC_DEFINE(DISABLE_WTMPX) ]
2289 AC_ARG_ENABLE(libutil,
2290 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2291 [ AC_DEFINE(DISABLE_LOGIN) ]
2293 AC_ARG_ENABLE(pututline,
2294 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2295 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2297 AC_ARG_ENABLE(pututxline,
2298 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2299 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2301 AC_ARG_WITH(lastlog,
2302 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2304 if test "x$withval" = "xno" ; then
2305 AC_DEFINE(DISABLE_LASTLOG)
2307 conf_lastlog_location=$withval
2312 dnl lastlog, [uw]tmpx? detection
2313 dnl NOTE: set the paths in the platform section to avoid the
2314 dnl need for command-line parameters
2315 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2317 dnl lastlog detection
2318 dnl NOTE: the code itself will detect if lastlog is a directory
2319 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2321 #include <sys/types.h>
2323 #ifdef HAVE_LASTLOG_H
2324 # include <lastlog.h>
2333 [ char *lastlog = LASTLOG_FILE; ],
2334 [ AC_MSG_RESULT(yes) ],
2337 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2339 #include <sys/types.h>
2341 #ifdef HAVE_LASTLOG_H
2342 # include <lastlog.h>
2348 [ char *lastlog = _PATH_LASTLOG; ],
2349 [ AC_MSG_RESULT(yes) ],
2352 system_lastlog_path=no
2357 if test -z "$conf_lastlog_location"; then
2358 if test x"$system_lastlog_path" = x"no" ; then
2359 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2360 if (test -d "$f" || test -f "$f") ; then
2361 conf_lastlog_location=$f
2364 if test -z "$conf_lastlog_location"; then
2365 AC_MSG_WARN([** Cannot find lastlog **])
2366 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2371 if test -n "$conf_lastlog_location"; then
2372 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2376 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2378 #include <sys/types.h>
2384 [ char *utmp = UTMP_FILE; ],
2385 [ AC_MSG_RESULT(yes) ],
2387 system_utmp_path=no ]
2389 if test -z "$conf_utmp_location"; then
2390 if test x"$system_utmp_path" = x"no" ; then
2391 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2392 if test -f $f ; then
2393 conf_utmp_location=$f
2396 if test -z "$conf_utmp_location"; then
2397 AC_DEFINE(DISABLE_UTMP)
2401 if test -n "$conf_utmp_location"; then
2402 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2406 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2408 #include <sys/types.h>
2414 [ char *wtmp = WTMP_FILE; ],
2415 [ AC_MSG_RESULT(yes) ],
2417 system_wtmp_path=no ]
2419 if test -z "$conf_wtmp_location"; then
2420 if test x"$system_wtmp_path" = x"no" ; then
2421 for f in /usr/adm/wtmp /var/log/wtmp; do
2422 if test -f $f ; then
2423 conf_wtmp_location=$f
2426 if test -z "$conf_wtmp_location"; then
2427 AC_DEFINE(DISABLE_WTMP)
2431 if test -n "$conf_wtmp_location"; then
2432 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2436 dnl utmpx detection - I don't know any system so perverse as to require
2437 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2439 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2441 #include <sys/types.h>
2450 [ char *utmpx = UTMPX_FILE; ],
2451 [ AC_MSG_RESULT(yes) ],
2453 system_utmpx_path=no ]
2455 if test -z "$conf_utmpx_location"; then
2456 if test x"$system_utmpx_path" = x"no" ; then
2457 AC_DEFINE(DISABLE_UTMPX)
2460 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2464 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2466 #include <sys/types.h>
2475 [ char *wtmpx = WTMPX_FILE; ],
2476 [ AC_MSG_RESULT(yes) ],
2478 system_wtmpx_path=no ]
2480 if test -z "$conf_wtmpx_location"; then
2481 if test x"$system_wtmpx_path" = x"no" ; then
2482 AC_DEFINE(DISABLE_WTMPX)
2485 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2489 if test ! -z "$blibpath" ; then
2490 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2491 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2494 dnl remove pam and dl because they are in $LIBPAM
2495 if test "$PAM_MSG" = yes ; then
2496 LIBS=`echo $LIBS | sed 's/-lpam //'`
2498 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2499 LIBS=`echo $LIBS | sed 's/-ldl //'`
2503 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2506 # Print summary of options
2508 # Someone please show me a better way :)
2509 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2510 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2511 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2512 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2513 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2514 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2515 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2516 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2517 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2518 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2521 echo "OpenSSH has been configured with the following options:"
2522 echo " User binaries: $B"
2523 echo " System binaries: $C"
2524 echo " Configuration files: $D"
2525 echo " Askpass program: $E"
2526 echo " Manual pages: $F"
2527 echo " PID file: $G"
2528 echo " Privilege separation chroot path: $H"
2529 if test "$USES_LOGIN_CONF" = "yes" ; then
2530 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2532 echo " sshd default user PATH: $I"
2534 if test ! -z "$superuser_path" ; then
2535 echo " sshd superuser user PATH: $J"
2537 echo " Manpage format: $MANTYPE"
2538 echo " PAM support: ${PAM_MSG}"
2539 echo " KerberosIV support: $KRB4_MSG"
2540 echo " KerberosV support: $KRB5_MSG"
2541 echo " Smartcard support: $SCARD_MSG"
2542 echo " AFS support: $AFS_MSG"
2543 echo " S/KEY support: $SKEY_MSG"
2544 echo " TCP Wrappers support: $TCPW_MSG"
2545 echo " MD5 password support: $MD5_MSG"
2546 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2547 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2548 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2549 echo " BSD Auth support: $BSD_AUTH_MSG"
2550 echo " Random number source: $RAND_MSG"
2551 if test ! -z "$USE_RAND_HELPER" ; then
2552 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2557 echo " Host: ${host}"
2558 echo " Compiler: ${CC}"
2559 echo " Compiler flags: ${CFLAGS}"
2560 echo "Preprocessor flags: ${CPPFLAGS}"
2561 echo " Linker flags: ${LDFLAGS}"
2562 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2566 if test "x$PAM_MSG" = "xyes" ; then
2567 echo "PAM is enabled. You may need to install a PAM control file "
2568 echo "for sshd, otherwise password authentication may fail. "
2569 echo "Example PAM control files can be found in the contrib/ "
2574 if test ! -z "$NO_SFTP"; then
2575 echo "sftp-server will be disabled. Your compiler does not "
2576 echo "support 64bit integers."
2580 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2581 echo "WARNING: you are using the builtin random number collection "
2582 echo "service. Please read WARNING.RNG and request that your OS "
2583 echo "vendor includes kernel-based random number collection in "
2584 echo "future versions of your OS."