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)
28 if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32 # Use LOGIN_PROGRAM from environment if possible
33 if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
43 if test -z "$LD" ; then
49 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
53 # Check for some target-specific stuff
57 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
58 LDFLAGS="$LDFLAGS -L/usr/local/lib"
59 if (test "$LD" != "gcc" && test -z "$blibpath"); then
60 blibpath="/usr/lib:/lib:/usr/local/lib"
62 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
63 AC_DEFINE(BROKEN_GETADDRINFO)
64 dnl AIX handles lastlog as part of its login message
65 AC_DEFINE(DISABLE_LASTLOG)
66 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
69 LIBS="$LIBS /usr/lib/textmode.o"
70 AC_DEFINE(HAVE_CYGWIN)
72 AC_DEFINE(DISABLE_SHADOW)
73 AC_DEFINE(IPV4_DEFAULT)
74 AC_DEFINE(IP_TOS_IS_BROKEN)
75 AC_DEFINE(NO_X11_UNIX_SOCKETS)
78 AC_DEFINE(IP_TOS_IS_BROKEN)
81 AC_DEFINE(BROKEN_GETADDRINFO)
84 if test -z "$GCC"; then
87 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
90 AC_DEFINE(DISABLE_SHADOW)
91 AC_DEFINE(DISABLE_UTMP)
92 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
93 LIBS="$LIBS -lxnet -lsec"
96 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
98 AC_DEFINE(PAM_SUN_CODEBASE)
100 AC_DEFINE(DISABLE_SHADOW)
101 AC_DEFINE(DISABLE_UTMP)
102 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
103 LIBS="$LIBS -lxnet -lsec"
106 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
108 PATH="$PATH:/usr/etc"
109 AC_DEFINE(BROKEN_INET_NTOA)
112 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
114 PATH="$PATH:/usr/etc"
115 AC_DEFINE(WITH_IRIX_ARRAY)
116 AC_DEFINE(WITH_IRIX_PROJECT)
117 AC_DEFINE(WITH_IRIX_AUDIT)
118 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
119 AC_DEFINE(BROKEN_INET_NTOA)
123 check_for_libcrypt_later=1
124 AC_DEFINE(DONT_TRY_OTHER_AF)
125 AC_DEFINE(PAM_TTY_KLUDGE)
126 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
127 inet6_default_4in6=yes
129 mips-sony-bsd|mips-sony-newsos4)
130 AC_DEFINE(HAVE_NEWS4)
132 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
133 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
140 check_for_libcrypt_later=1
143 conf_lastlog_location="/usr/adm/lastlog"
144 conf_utmp_location=/etc/utmp
145 conf_wtmp_location=/usr/adm/wtmp
148 AC_DEFINE(BROKEN_REALPATH)
150 AC_DEFINE(BROKEN_SAVED_UIDS)
151 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
156 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
158 AC_DEFINE(PAM_SUN_CODEBASE)
159 AC_DEFINE(LOGIN_NEEDS_UTMPX)
160 AC_DEFINE(LOGIN_NEEDS_TERM)
161 AC_DEFINE(PAM_TTY_KLUDGE)
162 # hardwire lastlog location (can't detect it on some versions)
163 conf_lastlog_location="/var/adm/lastlog"
164 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
165 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
166 if test "$sol2ver" -ge 8; then
168 AC_DEFINE(DISABLE_UTMP)
169 AC_DEFINE(DISABLE_WTMP)
175 CPPFLAGS="$CPPFLAGS -DSUNOS4"
176 AC_CHECK_FUNCS(getpwanam)
177 AC_DEFINE(PAM_SUN_CODEBASE)
178 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
179 conf_utmp_location=/etc/utmp
180 conf_wtmp_location=/var/adm/wtmp
181 conf_lastlog_location=/var/adm/lastlog
185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
186 LDFLAGS="$LDFLAGS -L/usr/local/lib"
188 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
192 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
193 # /usr/ucblib MUST NOT be searched on ReliantUNIX
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 IPADDR_IN_DISPLAY=yes
197 AC_DEFINE(IP_TOS_IS_BROKEN)
198 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
199 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
200 # Attention: always take care to bind libsocket and libnsl before libc,
201 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
204 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
205 LDFLAGS="$LDFLAGS -L/usr/local/lib"
210 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
216 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
217 LDFLAGS="$LDFLAGS -L/usr/local/lib"
220 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
221 LDFLAGS="$LDFLAGS -L/usr/local/lib"
222 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
223 rsh_path="/usr/bin/rcmd"
226 AC_DEFINE(BROKEN_SYS_TERMIO_H)
228 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
229 AC_DEFINE(DISABLE_SHADOW)
230 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
231 AC_DEFINE(BROKEN_SAVED_UIDS)
232 AC_CHECK_FUNCS(getluid setluid)
234 do_sco3_extra_lib_check=yes
237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
239 LIBS="$LIBS -lprot -lx -ltinfo -lm"
241 rsh_path="/usr/bin/rcmd"
243 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
244 AC_DEFINE(DISABLE_SHADOW)
245 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
246 AC_CHECK_FUNCS(getluid setluid)
253 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
254 LIBS="$LIBS -lgen -lrsc"
257 AC_MSG_CHECKING(for Digital Unix SIA)
260 [ --with-osfsia Enable Digital Unix SIA],
262 if test "x$withval" = "xno" ; then
263 AC_MSG_RESULT(disabled)
268 if test -z "$no_osfsia" ; then
269 if test -f /etc/sia/matrix.conf; then
271 AC_DEFINE(HAVE_OSF_SIA)
272 AC_DEFINE(DISABLE_LOGIN)
273 LIBS="$LIBS -lsecurity -ldb -lm -laud"
282 AC_DEFINE(NO_X11_UNIX_SOCKETS)
283 AC_DEFINE(MISSING_NFDBITS)
284 AC_DEFINE(MISSING_HOWMANY)
285 AC_DEFINE(MISSING_FD_MASK)
289 # Allow user to specify flags
291 [ --with-cflags Specify additional flags to pass to compiler],
293 if test "x$withval" != "xno" ; then
294 CFLAGS="$CFLAGS $withval"
298 AC_ARG_WITH(cppflags,
299 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
301 if test "x$withval" != "xno"; then
302 CPPFLAGS="$CPPFLAGS $withval"
307 [ --with-ldflags Specify additional flags to pass to linker],
309 if test "x$withval" != "xno" ; then
310 LDFLAGS="$LDFLAGS $withval"
315 [ --with-libs Specify additional libraries to link with],
317 if test "x$withval" != "xno" ; then
318 LIBS="$LIBS $withval"
323 # Checks for header files.
324 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
325 getopt.h glob.h lastlog.h limits.h login.h \
326 login_cap.h maillock.h netdb.h netgroup.h \
327 netinet/in_systm.h paths.h poll.h pty.h \
328 security/pam_appl.h shadow.h stddef.h stdint.h \
329 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
330 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
331 sys/stropts.h sys/sysmacros.h sys/time.h \
332 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
333 util.h utime.h utmp.h utmpx.h)
335 # Checks for libraries.
336 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
337 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
339 dnl SCO OS3 needs this for libwrap
340 if test "x$with_tcp_wrappers" != "xno" ; then
341 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
342 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
346 AC_CHECK_FUNC(getspnam, ,
347 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
350 [ --without-rpath Disable auto-added -R linker paths],
352 if test "x$withval" = "xno" ; then
355 if test "x$withval" = "xyes" ; then
363 [ --with-zlib=PATH Use zlib in PATH],
365 if test "x$withval" = "xno" ; then
366 AC_MSG_ERROR([*** zlib is required ***])
368 if test -d "$withval/lib"; then
369 if test -n "${need_dash_r}"; then
370 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
372 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
375 if test -n "${need_dash_r}"; then
376 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
378 LDFLAGS="-L${withval} ${LDFLAGS}"
381 if test -d "$withval/include"; then
382 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
384 CPPFLAGS="-I${withval} ${CPPFLAGS}"
389 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
392 AC_CHECK_FUNC(strcasecmp,
393 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
395 AC_CHECK_FUNC(utimes,
396 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
399 dnl Checks for libutil functions
400 AC_CHECK_HEADERS(libutil.h)
401 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
402 AC_CHECK_FUNCS(logout updwtmp logwtmp)
406 # Check for ALTDIRFUNC glob() extension
407 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
408 AC_EGREP_CPP(FOUNDIT,
411 #ifdef GLOB_ALTDIRFUNC
416 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
424 # Check for g.gl_matchc glob() extension
425 AC_MSG_CHECKING(for gl_matchc field in glob_t)
426 AC_EGREP_CPP(FOUNDIT,
429 int main(void){glob_t g; g.gl_matchc = 1;}
432 AC_DEFINE(GLOB_HAS_GL_MATCHC)
440 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
443 #include <sys/types.h>
445 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
447 [AC_MSG_RESULT(yes)],
450 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
454 # Check whether the user wants GSI (Globus) support
457 [ --with-gsi=PATH Enable GSI/Globus authentication support],
464 [ --with-globus=PATH Enable GSI/Globus authentication support],
470 # Check whether the user has a Globus flavor type
471 globus_flavor_type="no"
472 AC_ARG_WITH(globus-flavor,
473 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
475 globus_flavor_type="$withval"
479 if test "x$gsi_path" != "xno" ; then
480 # Globus GSSAPI configuration
484 # Find GLOBUS/GSI installation Directory
485 AC_MSG_CHECKING(for Globus/GSI installation directory)
487 globus_install_dir=$gsi_path
489 if test "x$globus_install_dir" = "xyes" ; then
490 if test -n "$GLOBUS_INSTALL_PATH" ; then
491 globus_install_dir=$GLOBUS_INSTALL_PATH
492 elif test -n "$GSI_INSTALL_PATH" ; then
493 globus_install_dir=$GSI_INSTALL_PATH
494 elif test -d /usr/local/globus ; then
495 globus_install_dir="/usr/local/globus"
496 elif test -d /usr/local/gsi ; then
497 globus_install_dir="/usr/local/gsi"
499 AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
502 AC_MSG_RESULT($globus_install_dir)
504 # Find GLOBUS/GSI development directory
505 AC_MSG_CHECKING(for Globus/GSI development directory)
507 if test -d ${globus_install_dir}/lib ; then
508 # Looks like a flat directory structure from configure/make
509 # and not globus-install or gsi-install
510 globus_dev_dir=$globus_install_dir
513 # Assume a true globus installation with architecture
514 # directories and run globus-development-path to find
515 # the development directory
517 # Set GLOBUS_INSTALL_PATH
518 GLOBUS_INSTALL_PATH=$globus_install_dir
519 export GLOBUS_INSTALL_PATH
521 dev_path_program=${globus_install_dir}/bin/globus-development-path
523 if test ! -x ${dev_path_program} ; then
524 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
527 globus_dev_dir=`${dev_path_program}`
529 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
530 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
533 if test ! -d "$globus_dev_dir" ; then
534 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
537 AC_MSG_RESULT($globus_dev_dir)
539 # Find GLOBUS/GSI flavor Directory
540 AC_MSG_CHECKING(for Globus flavor type)
542 if test "x$globus_flavor_type" = "xno" ; then
543 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
544 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
545 GSI_CFLAGS="-I${globus_dev_dir}/include"
548 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
550 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
551 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
554 AC_MSG_RESULT($globus_flavor_type)
555 GSI_LIBS="-lglobus_gss_assist_${globus_flavor_type} -lglobus_gssapi_gsi_${globus_flavor_type}"
556 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
557 GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
560 LIBS="$LIBS $GSI_LIBS"
561 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
562 CFLAGS="$CFLAGS $GSI_CFLAGS"
563 # End Globus/GSI section
566 # Check whether user wants S/Key support
569 [ --with-skey[[=PATH]] Enable S/Key support
570 (optionally in PATH)],
572 if test "x$withval" != "xno" ; then
574 if test "x$withval" != "xyes" ; then
575 CPPFLAGS="$CPPFLAGS -I${withval}/include"
576 LDFLAGS="$LDFLAGS -L${withval}/lib"
583 AC_MSG_CHECKING([for s/key support])
588 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
590 [AC_MSG_RESULT(yes)],
593 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
599 # Check whether user wants TCP wrappers support
601 AC_ARG_WITH(tcp-wrappers,
602 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
603 (optionally in PATH)],
605 if test "x$withval" != "xno" ; then
607 saved_LDFLAGS="$LDFLAGS"
608 saved_CPPFLAGS="$CPPFLAGS"
609 if test -n "${withval}" -a "${withval}" != "yes"; then
610 if test -d "${withval}/lib"; then
611 if test -n "${need_dash_r}"; then
612 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
614 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
617 if test -n "${need_dash_r}"; then
618 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
620 LDFLAGS="-L${withval} ${LDFLAGS}"
623 if test -d "${withval}/include"; then
624 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
626 CPPFLAGS="-I${withval} ${CPPFLAGS}"
630 LIBS="$LIBWRAP $LIBS"
631 AC_MSG_CHECKING(for libwrap)
635 int deny_severity = 0, allow_severity = 0;
645 AC_MSG_ERROR([*** libwrap missing])
653 dnl Checks for library functions.
654 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
655 clock fchmod fchown freeaddrinfo futimes gai_strerror \
656 getaddrinfo getcwd getgrouplist getnameinfo getopt \
657 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
658 inet_ntop innetgr login_getcapbool md5_crypt memmove \
659 mkdtemp on_exit openpty readpassphrase realpath \
660 rresvport_af setdtablesize setegid setenv seteuid \
661 setlogin setproctitle setresgid setreuid setrlimit \
662 setsid setvbuf sigaction sigvec snprintf strerror \
663 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
664 vhangup vsnprintf waitpid __b64_ntop _getpty)
666 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
667 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
668 AC_CHECK_LIB(gen, dirname,[
669 AC_CACHE_CHECK([for broken dirname],
670 ac_cv_have_broken_dirname, [
678 int main(int argc, char **argv) {
681 strncpy(buf,"/etc", 32);
683 if (!s || strncmp(s, "/", 32) != 0) {
690 [ ac_cv_have_broken_dirname="no" ],
691 [ ac_cv_have_broken_dirname="yes" ]
695 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
697 AC_DEFINE(HAVE_DIRNAME)
698 AC_CHECK_HEADERS(libgen.h)
703 dnl Checks for time functions
704 AC_CHECK_FUNCS(gettimeofday time)
705 dnl Checks for utmp functions
706 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
707 AC_CHECK_FUNCS(utmpname)
708 dnl Checks for utmpx functions
709 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
710 AC_CHECK_FUNCS(setutxent utmpxname)
712 AC_CHECK_FUNC(getuserattr,
713 [AC_DEFINE(HAVE_GETUSERATTR)],
714 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
717 AC_CHECK_FUNC(daemon,
718 [AC_DEFINE(HAVE_DAEMON)],
719 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
722 AC_CHECK_FUNC(getpagesize,
723 [AC_DEFINE(HAVE_GETPAGESIZE)],
724 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
727 # Check for broken snprintf
728 if test "x$ac_cv_func_snprintf" = "xyes" ; then
729 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
733 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
735 [AC_MSG_RESULT(yes)],
738 AC_DEFINE(BROKEN_SNPRINTF)
739 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
749 [ --with-pam Enable PAM support ],
751 if test "x$withval" != "xno" ; then
752 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
753 AC_MSG_ERROR([PAM headers not found])
756 AC_CHECK_LIB(dl, dlopen, , )
757 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
758 AC_CHECK_FUNCS(pam_getenvlist)
759 AC_CHECK_FUNCS(pam_putenv)
765 if test $ac_cv_lib_dl_dlopen = yes; then
776 # Check for older PAM
777 if test "x$PAM_MSG" = "xyes" ; then
778 # Check PAM strerror arguments (old PAM)
779 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
783 #include <security/pam_appl.h>
785 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
788 AC_DEFINE(HAVE_OLD_PAM)
790 PAM_MSG="yes (old library)"
795 # The big search for OpenSSL
797 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
799 if test "x$withval" != "xno" ; then
806 saved_LDFLAGS="$LDFLAGS"
807 saved_CPPFLAGS="$CPPFLAGS"
808 if test "x$globus_flavor_type" != "xno" ; then
809 LIBS="$saved_LIBS -lglobus_ssl_utils_${globus_flavor_type} -lssl_${globus_flavor_type} -lcrypto_${globus_flavor_type}"
810 LDFLAGS="$saved_LDFLAGS"
811 CPPFLAGS="$saved_CPPFLAGS"
813 if test "x$prefix" != "xNONE" ; then
814 tryssldir="$tryssldir $prefix"
816 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
817 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
818 CPPFLAGS="$saved_CPPFLAGS"
819 LDFLAGS="$saved_LDFLAGS"
820 LIBS="$saved_LIBS -lcrypto"
822 # Skip directories if they don't exist
823 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
826 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
827 # Try to use $ssldir/lib if it exists, otherwise
829 if test -d "$ssldir/lib" ; then
830 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
831 if test ! -z "$need_dash_r" ; then
832 LDFLAGS="-R$ssldir/lib $LDFLAGS"
835 LDFLAGS="-L$ssldir $saved_LDFLAGS"
836 if test ! -z "$need_dash_r" ; then
837 LDFLAGS="-R$ssldir $LDFLAGS"
840 # Try to use $ssldir/include if it exists, otherwise
842 if test -d "$ssldir/include" ; then
843 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
845 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
849 # Basic test to check for compatible version and correct linking
850 # *does not* test for RSA - that comes later.
854 #include <openssl/rand.h>
858 memset(a, 0, sizeof(a));
859 RAND_add(a, sizeof(a), sizeof(a));
860 return(RAND_status() <= 0);
869 if test ! -z "$found_crypto" ; then
874 if test -z "$found_crypto" ; then
875 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
877 if test -z "$ssldir" ; then
881 ac_cv_openssldir=$ssldir
884 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
885 AC_DEFINE(HAVE_OPENSSL)
886 dnl Need to recover ssldir - test above runs in subshell
887 ssldir=$ac_cv_openssldir
888 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
889 # Try to use $ssldir/lib if it exists, otherwise
891 if test -d "$ssldir/lib" ; then
892 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
893 if test ! -z "$need_dash_r" ; then
894 LDFLAGS="-R$ssldir/lib $LDFLAGS"
897 LDFLAGS="-L$ssldir $saved_LDFLAGS"
898 if test ! -z "$need_dash_r" ; then
899 LDFLAGS="-R$ssldir $LDFLAGS"
902 # Try to use $ssldir/include if it exists, otherwise
904 if test -d "$ssldir/include" ; then
905 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
907 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
911 if test "x$gsi_path" == "xno" ; then
912 LIBS="$saved_LIBS -lcrypto"
914 LIBS="$saved_LIBS -lssl -lcrypto"
916 fi # globus_flavor_type
918 # Now test RSA support
920 AC_MSG_CHECKING([for RSA support])
921 for WANTS_RSAREF in "" 1 ; do
922 if test -z "$WANTS_RSAREF" ; then
925 LIBS="$saved_LIBS -lRSAglue -lrsaref"
929 #include <openssl/rand.h>
930 #include <openssl/rsa.h>
931 #include <openssl/bn.h>
932 #include <openssl/sha.h>
935 int num; RSA *key; static unsigned char p_in[] = "blahblah";
936 unsigned char c[256], p[256];
937 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
938 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
939 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
940 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
950 if test ! -z "$no_rsa" ; then
951 AC_MSG_RESULT(disabled)
954 if test -z "$rsa_works" ; then
955 AC_MSG_WARN([*** No RSA support found *** ])
958 if test -z "$WANTS_RSAREF" ; then
962 RSA_MSG="yes (using RSAref)"
963 AC_MSG_RESULT(using RSAref)
964 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
969 # Sanity check OpenSSL headers
970 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
974 #include <openssl/opensslv.h>
975 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
982 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
986 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
987 # version in OpenSSL. Skip this for PAM
988 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
989 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
993 ### Configure cryptographic random number support
995 # Check wheter OpenSSL seeds itself
996 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1000 #include <openssl/rand.h>
1001 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
1004 OPENSSL_SEEDS_ITSELF=yes
1009 # Default to use of the rand helper if OpenSSL doesn't
1016 # Do we want to force the use of the rand helper?
1017 AC_ARG_WITH(rand-helper,
1018 [ --with-rand-helper Use subprocess to gather strong randomness ],
1020 if test "x$withval" = "xno" ; then
1021 # Force use of OpenSSL's internal RNG, even if
1022 # the previous test showed it to be unseeded.
1023 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1024 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1025 OPENSSL_SEEDS_ITSELF=yes
1034 # Which randomness source do we use?
1035 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1037 AC_DEFINE(OPENSSL_PRNG_ONLY)
1038 RAND_MSG="OpenSSL internal ONLY"
1039 INSTALL_SSH_RAND_HELPER=""
1040 elif test ! -z "$USE_RAND_HELPER" ; then
1041 # install rand helper
1042 RAND_MSG="ssh-rand-helper"
1043 INSTALL_SSH_RAND_HELPER="yes"
1045 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1047 ### Configuration of ssh-rand-helper
1050 AC_ARG_WITH(prngd-port,
1051 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1060 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1063 if test ! -z "$withval" ; then
1064 PRNGD_PORT="$withval"
1065 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1070 # PRNGD Unix domain socket
1071 AC_ARG_WITH(prngd-socket,
1072 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1076 withval="/var/run/egd-pool"
1084 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1088 if test ! -z "$withval" ; then
1089 if test ! -z "$PRNGD_PORT" ; then
1090 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1092 if test ! -r "$withval" ; then
1093 AC_MSG_WARN(Entropy socket is not readable)
1095 PRNGD_SOCKET="$withval"
1096 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1100 # Check for existing socket only if we don't have a random device already
1101 if test "$USE_RAND_HELPER" = yes ; then
1102 AC_MSG_CHECKING(for PRNGD/EGD socket)
1103 # Insert other locations here
1104 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1105 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1106 PRNGD_SOCKET="$sock"
1107 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1111 if test ! -z "$PRNGD_SOCKET" ; then
1112 AC_MSG_RESULT($PRNGD_SOCKET)
1114 AC_MSG_RESULT(not found)
1120 # Change default command timeout for hashing entropy source
1122 AC_ARG_WITH(entropy-timeout,
1123 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1125 if test "x$withval" != "xno" ; then
1126 entropy_timeout=$withval
1131 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1133 # These programs are used by the command hashing source to gather entropy
1134 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1135 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1136 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1137 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1138 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1139 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1140 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1141 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1142 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1143 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1144 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1145 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1146 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1147 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1148 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1149 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1151 # Where does ssh-rand-helper get its randomness from?
1152 INSTALL_SSH_PRNG_CMDS=""
1153 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1154 if test ! -z "$PRNGD_PORT" ; then
1155 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1156 elif test ! -z "$PRNGD_SOCKET" ; then
1157 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1159 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1160 RAND_HELPER_CMDHASH=yes
1161 INSTALL_SSH_PRNG_CMDS="yes"
1164 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1167 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1168 if test ! -z "$SONY" ; then
1169 LIBS="$LIBS -liberty";
1172 # Checks for data types
1173 AC_CHECK_SIZEOF(char, 1)
1174 AC_CHECK_SIZEOF(short int, 2)
1175 AC_CHECK_SIZEOF(int, 4)
1176 AC_CHECK_SIZEOF(long int, 4)
1177 AC_CHECK_SIZEOF(long long int, 8)
1179 # More checks for data types
1180 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1182 [ #include <sys/types.h> ],
1184 [ ac_cv_have_u_int="yes" ],
1185 [ ac_cv_have_u_int="no" ]
1188 if test "x$ac_cv_have_u_int" = "xyes" ; then
1189 AC_DEFINE(HAVE_U_INT)
1193 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1195 [ #include <sys/types.h> ],
1196 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1197 [ ac_cv_have_intxx_t="yes" ],
1198 [ ac_cv_have_intxx_t="no" ]
1201 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_INTXX_T)
1206 if (test -z "$have_intxx_t" && \
1207 test "x$ac_cv_header_stdint_h" = "xyes")
1209 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1211 [ #include <stdint.h> ],
1212 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1214 AC_DEFINE(HAVE_INTXX_T)
1217 [ AC_MSG_RESULT(no) ]
1221 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1223 [ #include <sys/types.h> ],
1224 [ int64_t a; a = 1;],
1225 [ ac_cv_have_int64_t="yes" ],
1226 [ ac_cv_have_int64_t="no" ]
1229 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1230 AC_DEFINE(HAVE_INT64_T)
1234 if test -z "$have_int64_t" ; then
1235 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1237 [ #include <sys/socket.h> ],
1238 [ int64_t a; a = 1],
1240 AC_DEFINE(HAVE_INT64_T)
1243 [ AC_MSG_RESULT(no) ]
1247 if test -z "$have_int64_t" ; then
1248 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1250 [ #include <sys/bitypes.h> ],
1251 [ int64_t a; a = 1],
1253 AC_DEFINE(HAVE_INT64_T)
1256 [ AC_MSG_RESULT(no) ]
1260 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1262 [ #include <sys/types.h> ],
1263 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1264 [ ac_cv_have_u_intxx_t="yes" ],
1265 [ ac_cv_have_u_intxx_t="no" ]
1268 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1269 AC_DEFINE(HAVE_U_INTXX_T)
1273 if test -z "$have_u_intxx_t" ; then
1274 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1276 [ #include <sys/socket.h> ],
1277 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1279 AC_DEFINE(HAVE_U_INTXX_T)
1282 [ AC_MSG_RESULT(no) ]
1286 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1288 [ #include <sys/types.h> ],
1289 [ u_int64_t a; a = 1;],
1290 [ ac_cv_have_u_int64_t="yes" ],
1291 [ ac_cv_have_u_int64_t="no" ]
1294 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1295 AC_DEFINE(HAVE_U_INT64_T)
1299 if test -z "$have_u_int64_t" ; then
1300 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1302 [ #include <sys/bitypes.h> ],
1303 [ u_int64_t a; a = 1],
1305 AC_DEFINE(HAVE_U_INT64_T)
1308 [ AC_MSG_RESULT(no) ]
1312 if test -z "$have_u_intxx_t" ; then
1313 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1316 #include <sys/types.h>
1318 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1319 [ ac_cv_have_uintxx_t="yes" ],
1320 [ ac_cv_have_uintxx_t="no" ]
1323 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1324 AC_DEFINE(HAVE_UINTXX_T)
1328 if test -z "$have_uintxx_t" ; then
1329 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1331 [ #include <stdint.h> ],
1332 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1334 AC_DEFINE(HAVE_UINTXX_T)
1337 [ AC_MSG_RESULT(no) ]
1341 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1342 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1344 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1347 #include <sys/bitypes.h>
1350 int8_t a; int16_t b; int32_t c;
1351 u_int8_t e; u_int16_t f; u_int32_t g;
1352 a = b = c = e = f = g = 1;
1355 AC_DEFINE(HAVE_U_INTXX_T)
1356 AC_DEFINE(HAVE_INTXX_T)
1364 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1367 #include <sys/types.h>
1369 [ u_char foo; foo = 125; ],
1370 [ ac_cv_have_u_char="yes" ],
1371 [ ac_cv_have_u_char="no" ]
1374 if test "x$ac_cv_have_u_char" = "xyes" ; then
1375 AC_DEFINE(HAVE_U_CHAR)
1380 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1382 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1385 #include <sys/types.h>
1387 [ size_t foo; foo = 1235; ],
1388 [ ac_cv_have_size_t="yes" ],
1389 [ ac_cv_have_size_t="no" ]
1392 if test "x$ac_cv_have_size_t" = "xyes" ; then
1393 AC_DEFINE(HAVE_SIZE_T)
1396 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1399 #include <sys/types.h>
1401 [ ssize_t foo; foo = 1235; ],
1402 [ ac_cv_have_ssize_t="yes" ],
1403 [ ac_cv_have_ssize_t="no" ]
1406 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1407 AC_DEFINE(HAVE_SSIZE_T)
1410 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1415 [ clock_t foo; foo = 1235; ],
1416 [ ac_cv_have_clock_t="yes" ],
1417 [ ac_cv_have_clock_t="no" ]
1420 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1421 AC_DEFINE(HAVE_CLOCK_T)
1424 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1427 #include <sys/types.h>
1428 #include <sys/socket.h>
1430 [ sa_family_t foo; foo = 1235; ],
1431 [ ac_cv_have_sa_family_t="yes" ],
1434 #include <sys/types.h>
1435 #include <sys/socket.h>
1436 #include <netinet/in.h>
1438 [ sa_family_t foo; foo = 1235; ],
1439 [ ac_cv_have_sa_family_t="yes" ],
1441 [ ac_cv_have_sa_family_t="no" ]
1445 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1446 AC_DEFINE(HAVE_SA_FAMILY_T)
1449 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1452 #include <sys/types.h>
1454 [ pid_t foo; foo = 1235; ],
1455 [ ac_cv_have_pid_t="yes" ],
1456 [ ac_cv_have_pid_t="no" ]
1459 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1460 AC_DEFINE(HAVE_PID_T)
1463 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1466 #include <sys/types.h>
1468 [ mode_t foo; foo = 1235; ],
1469 [ ac_cv_have_mode_t="yes" ],
1470 [ ac_cv_have_mode_t="no" ]
1473 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1474 AC_DEFINE(HAVE_MODE_T)
1478 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1481 #include <sys/types.h>
1482 #include <sys/socket.h>
1484 [ struct sockaddr_storage s; ],
1485 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1486 [ ac_cv_have_struct_sockaddr_storage="no" ]
1489 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1490 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1493 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1496 #include <sys/types.h>
1497 #include <netinet/in.h>
1499 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1500 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1501 [ ac_cv_have_struct_sockaddr_in6="no" ]
1504 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1505 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1508 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1511 #include <sys/types.h>
1512 #include <netinet/in.h>
1514 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1515 [ ac_cv_have_struct_in6_addr="yes" ],
1516 [ ac_cv_have_struct_in6_addr="no" ]
1519 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1520 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1523 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1526 #include <sys/types.h>
1527 #include <sys/socket.h>
1530 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1531 [ ac_cv_have_struct_addrinfo="yes" ],
1532 [ ac_cv_have_struct_addrinfo="no" ]
1535 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1536 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1539 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1541 [ #include <sys/time.h> ],
1542 [ struct timeval tv; tv.tv_sec = 1;],
1543 [ ac_cv_have_struct_timeval="yes" ],
1544 [ ac_cv_have_struct_timeval="no" ]
1547 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1548 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1549 have_struct_timeval=1
1552 # If we don't have int64_t then we can't compile sftp-server. So don't
1553 # even attempt to do it.
1554 if test "x$ac_cv_have_int64_t" = "xno" -a \
1555 "x$ac_cv_sizeof_long_int" != "x8" -a \
1556 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1559 dnl test snprintf (broken on SCO w/gcc)
1564 #ifdef HAVE_SNPRINTF
1568 char expected_out[50];
1570 #if (SIZEOF_LONG_INT == 8)
1571 long int num = 0x7fffffffffffffff;
1573 long long num = 0x7fffffffffffffffll;
1575 strcpy(expected_out, "9223372036854775807");
1576 snprintf(buf, mazsize, "%lld", num);
1577 if(strcmp(buf, expected_out) != 0)
1584 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1589 dnl Checks for structure members
1590 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1591 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1592 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1593 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1594 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1595 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1596 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1597 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1598 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1599 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1600 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1601 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1602 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1603 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1604 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1605 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1606 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1608 AC_CHECK_MEMBERS([struct stat.st_blksize])
1610 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1611 ac_cv_have_ss_family_in_struct_ss, [
1614 #include <sys/types.h>
1615 #include <sys/socket.h>
1617 [ struct sockaddr_storage s; s.ss_family = 1; ],
1618 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1619 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1622 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1623 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1626 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1627 ac_cv_have___ss_family_in_struct_ss, [
1630 #include <sys/types.h>
1631 #include <sys/socket.h>
1633 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1634 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1635 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1638 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1639 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1642 AC_CACHE_CHECK([for pw_class field in struct passwd],
1643 ac_cv_have_pw_class_in_struct_passwd, [
1648 [ struct passwd p; p.pw_class = 0; ],
1649 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1650 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1653 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1654 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1657 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1658 ac_cv_have_pw_expire_in_struct_passwd, [
1663 [ struct passwd p; p.pw_expire = 0; ],
1664 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1665 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1668 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1669 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1672 AC_CACHE_CHECK([for pw_change field in struct passwd],
1673 ac_cv_have_pw_change_in_struct_passwd, [
1678 [ struct passwd p; p.pw_change = 0; ],
1679 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1680 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1683 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1684 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1687 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1689 [ extern char *__progname; printf("%s", __progname); ],
1690 [ ac_cv_libc_defines___progname="yes" ],
1691 [ ac_cv_libc_defines___progname="no" ]
1694 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1695 AC_DEFINE(HAVE___PROGNAME)
1698 AC_CACHE_CHECK([whether getopt has optreset support],
1699 ac_cv_have_getopt_optreset, [
1704 [ extern int optreset; optreset = 0; ],
1705 [ ac_cv_have_getopt_optreset="yes" ],
1706 [ ac_cv_have_getopt_optreset="no" ]
1709 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1710 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1713 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1715 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1716 [ ac_cv_libc_defines_sys_errlist="yes" ],
1717 [ ac_cv_libc_defines_sys_errlist="no" ]
1720 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1721 AC_DEFINE(HAVE_SYS_ERRLIST)
1725 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1727 [ extern int sys_nerr; printf("%i", sys_nerr);],
1728 [ ac_cv_libc_defines_sys_nerr="yes" ],
1729 [ ac_cv_libc_defines_sys_nerr="no" ]
1732 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1733 AC_DEFINE(HAVE_SYS_NERR)
1737 # Check whether user wants Kerberos support
1739 AC_ARG_WITH(smartcard,
1740 [ --with-smartcard Enable smartcard support],
1742 if test "x$withval" != "xno" ; then
1743 if test "x$withval" != "xyes" ; then
1744 CPPFLAGS="$CPPFLAGS -I${withval}"
1745 LDFLAGS="$LDFLAGS -L${withval}"
1746 if test ! -z "$need_dash_r" ; then
1747 LDFLAGS="$LDFLAGS -R${withval}"
1749 if test ! -z "$blibpath" ; then
1750 blibpath="$blibpath:${withval}"
1753 AC_CHECK_HEADERS(sectok.h)
1754 if test "$ac_cv_header_sectok_h" != yes; then
1755 AC_MSG_ERROR(Can't find sectok.h)
1757 AC_CHECK_LIB(sectok, sectok_open)
1758 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1759 AC_MSG_ERROR(Can't find libsectok)
1761 AC_DEFINE(SMARTCARD)
1767 # Check whether user wants Kerberos 5 support
1768 AC_ARG_WITH(kerberos5,
1769 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1771 if test "x$withval" != "xno" ; then
1772 if test "x$withval" = "xyes" ; then
1773 KRB5ROOT="/usr/local"
1777 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1778 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1780 AC_MSG_CHECKING(whether we are using Heimdal)
1781 AC_TRY_COMPILE([ #include <krb5.h> ],
1782 [ char *tmp = heimdal_version; ],
1783 [ AC_MSG_RESULT(yes)
1785 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1788 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1791 if test ! -z "$need_dash_r" ; then
1792 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1794 if test ! -z "$blibpath" ; then
1795 blibpath="$blibpath:${KRB5ROOT}/lib"
1797 AC_CHECK_LIB(resolv, dn_expand, , )
1799 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1801 K5LIBS="-lgssapi $K5LIBS" ],
1802 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1804 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1805 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1810 AC_CHECK_HEADER(gssapi.h, ,
1811 [ unset ac_cv_header_gssapi_h
1812 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1813 AC_CHECK_HEADERS(gssapi.h, ,
1814 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1820 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1821 AC_CHECK_HEADER(gssapi_krb5.h, ,
1822 [ CPPFLAGS="$oldCPP" ])
1828 # Check whether user wants Kerberos 4 support
1830 AC_ARG_WITH(kerberos4,
1831 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1833 if test "x$withval" != "xno" ; then
1834 if test "x$withval" != "xyes" ; then
1835 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1836 LDFLAGS="$LDFLAGS -L${withval}/lib"
1837 if test ! -z "$need_dash_r" ; then
1838 LDFLAGS="$LDFLAGS -R${withval}/lib"
1840 if test ! -z "$blibpath" ; then
1841 blibpath="$blibpath:${withval}/lib"
1844 if test -d /usr/include/kerberosIV ; then
1845 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1849 AC_CHECK_HEADERS(krb.h)
1850 if test "$ac_cv_header_krb_h" != yes; then
1851 AC_MSG_WARN([Cannot find krb.h, build may fail])
1853 AC_CHECK_LIB(krb, main)
1854 if test "$ac_cv_lib_krb_main" != yes; then
1855 AC_CHECK_LIB(krb4, main)
1856 if test "$ac_cv_lib_krb4_main" != yes; then
1857 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1864 AC_CHECK_LIB(des, des_cbc_encrypt)
1865 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1866 AC_CHECK_LIB(des425, des_cbc_encrypt)
1867 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1868 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1875 AC_CHECK_LIB(resolv, dn_expand, , )
1883 # Check whether user wants AFS support
1886 [ --with-afs=PATH Enable AFS support],
1888 if test "x$withval" != "xno" ; then
1890 if test "x$withval" != "xyes" ; then
1891 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1892 LDFLAGS="$LDFLAGS -L${withval}/lib"
1895 if test -z "$KRB4" ; then
1896 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1900 if test ! -z "$AFS_LIBS" ; then
1901 LIBS="$LIBS $AFS_LIBS"
1908 LIBS="$LIBS $KLIBS $K5LIBS"
1910 # Looking for programs, paths and files
1912 [ --with-rsh=PATH Specify path to remote shell program ],
1914 if test "x$withval" != "$no" ; then
1919 AC_PATH_PROG(rsh_path, rsh)
1924 [ --with-xauth=PATH Specify path to xauth program ],
1926 if test "x$withval" != "xno" ; then
1931 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1932 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1933 xauth_path="/usr/openwin/bin/xauth"
1938 if test -z "$xauth_path" ; then
1939 XAUTH_PATH="undefined"
1940 AC_SUBST(XAUTH_PATH)
1942 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1943 XAUTH_PATH=$xauth_path
1944 AC_SUBST(XAUTH_PATH)
1946 if test ! -z "$rsh_path" ; then
1947 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1950 # Check for mail directory (last resort if we cannot get it from headers)
1951 if test ! -z "$MAIL" ; then
1952 maildir=`dirname $MAIL`
1953 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1956 if test -z "$no_dev_ptmx" ; then
1957 AC_CHECK_FILE("/dev/ptmx",
1959 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1964 AC_CHECK_FILE("/dev/ptc",
1966 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1971 # Options from here on. Some of these are preset by platform above
1972 AC_ARG_WITH(mantype,
1973 [ --with-mantype=man|cat|doc Set man page type],
1980 AC_MSG_ERROR(invalid man type: $withval)
1985 if test -z "$MANTYPE"; then
1986 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1987 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1989 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1996 if test "$MANTYPE" = "doc"; then
2003 # Check whether to enable MD5 passwords
2005 AC_ARG_WITH(md5-passwords,
2006 [ --with-md5-passwords Enable use of MD5 passwords],
2008 if test "x$withval" != "xno" ; then
2009 AC_DEFINE(HAVE_MD5_PASSWORDS)
2015 # Whether to disable shadow password support
2017 [ --without-shadow Disable shadow password support],
2019 if test "x$withval" = "xno" ; then
2020 AC_DEFINE(DISABLE_SHADOW)
2026 if test -z "$disable_shadow" ; then
2027 AC_MSG_CHECKING([if the systems has expire shadow information])
2030 #include <sys/types.h>
2033 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2034 [ sp_expire_available=yes ], []
2037 if test "x$sp_expire_available" = "xyes" ; then
2039 AC_DEFINE(HAS_SHADOW_EXPIRE)
2045 # Use ip address instead of hostname in $DISPLAY
2046 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2047 DISPLAY_HACK_MSG="yes"
2048 AC_DEFINE(IPADDR_IN_DISPLAY)
2050 DISPLAY_HACK_MSG="no"
2051 AC_ARG_WITH(ipaddr-display,
2052 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2054 if test "x$withval" != "xno" ; then
2055 AC_DEFINE(IPADDR_IN_DISPLAY)
2056 DISPLAY_HACK_MSG="yes"
2062 # Whether to mess with the default path
2063 SERVER_PATH_MSG="(default)"
2064 AC_ARG_WITH(default-path,
2065 [ --with-default-path=PATH Specify default \$PATH environment for server],
2067 if test "x$withval" != "xno" ; then
2068 user_path="$withval"
2069 SERVER_PATH_MSG="$withval"
2075 /* find out what STDPATH is */
2080 #ifndef _PATH_STDPATH
2081 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2083 #include <sys/types.h>
2084 #include <sys/stat.h>
2086 #define DATA "conftest.stdpath"
2093 fd = fopen(DATA,"w");
2097 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2102 ], [ user_path=`cat conftest.stdpath` ],
2103 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2104 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2106 # make sure $bindir is in USER_PATH so scp will work
2107 t_bindir=`eval echo ${bindir}`
2109 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2112 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2114 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2115 if test $? -ne 0 ; then
2116 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2117 if test $? -ne 0 ; then
2118 user_path=$user_path:$t_bindir
2119 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2124 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2127 # Whether to force IPv4 by default (needed on broken glibc Linux)
2129 AC_ARG_WITH(ipv4-default,
2130 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2132 if test "x$withval" != "xno" ; then
2133 AC_DEFINE(IPV4_DEFAULT)
2139 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2140 IPV4_IN6_HACK_MSG="no"
2142 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2144 if test "x$withval" != "xno" ; then
2146 AC_DEFINE(IPV4_IN_IPV6)
2147 IPV4_IN6_HACK_MSG="yes"
2152 if test "x$inet6_default_4in6" = "xyes"; then
2153 AC_MSG_RESULT([yes (default)])
2154 AC_DEFINE(IPV4_IN_IPV6)
2155 IPV4_IN6_HACK_MSG="yes"
2157 AC_MSG_RESULT([no (default)])
2162 # Whether to enable BSD auth support
2164 AC_ARG_WITH(bsd-auth,
2165 [ --with-bsd-auth Enable BSD auth support],
2167 if test "x$withval" != "xno" ; then
2174 AC_MSG_CHECKING(whether to install ssh as suid root)
2175 AC_ARG_ENABLE(suid-ssh,
2176 [ --enable-suid-ssh Install ssh as suid root (default)
2177 --disable-suid-ssh Install ssh without suid bit],
2178 [ case "$enableval" in
2183 *) AC_MSG_RESULT(yes)
2193 # Where to place sshd.pid
2195 AC_ARG_WITH(pid-dir,
2196 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2198 if test "x$withval" != "xno" ; then
2204 # make sure the directory exists
2205 if test ! -d $piddir ; then
2206 piddir=`eval echo ${sysconfdir}`
2208 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2212 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2215 dnl allow user to disable some login recording features
2216 AC_ARG_ENABLE(lastlog,
2217 [ --disable-lastlog disable use of lastlog even if detected [no]],
2218 [ AC_DEFINE(DISABLE_LASTLOG) ]
2221 [ --disable-utmp disable use of utmp even if detected [no]],
2222 [ AC_DEFINE(DISABLE_UTMP) ]
2224 AC_ARG_ENABLE(utmpx,
2225 [ --disable-utmpx disable use of utmpx even if detected [no]],
2226 [ AC_DEFINE(DISABLE_UTMPX) ]
2229 [ --disable-wtmp disable use of wtmp even if detected [no]],
2230 [ AC_DEFINE(DISABLE_WTMP) ]
2232 AC_ARG_ENABLE(wtmpx,
2233 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2234 [ AC_DEFINE(DISABLE_WTMPX) ]
2236 AC_ARG_ENABLE(libutil,
2237 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2238 [ AC_DEFINE(DISABLE_LOGIN) ]
2240 AC_ARG_ENABLE(pututline,
2241 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2242 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2244 AC_ARG_ENABLE(pututxline,
2245 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2246 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2248 AC_ARG_WITH(lastlog,
2249 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2251 if test "x$withval" = "xno" ; then
2252 AC_DEFINE(DISABLE_LASTLOG)
2254 conf_lastlog_location=$withval
2259 dnl lastlog, [uw]tmpx? detection
2260 dnl NOTE: set the paths in the platform section to avoid the
2261 dnl need for command-line parameters
2262 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2264 dnl lastlog detection
2265 dnl NOTE: the code itself will detect if lastlog is a directory
2266 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2268 #include <sys/types.h>
2270 #ifdef HAVE_LASTLOG_H
2271 # include <lastlog.h>
2280 [ char *lastlog = LASTLOG_FILE; ],
2281 [ AC_MSG_RESULT(yes) ],
2284 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2286 #include <sys/types.h>
2288 #ifdef HAVE_LASTLOG_H
2289 # include <lastlog.h>
2295 [ char *lastlog = _PATH_LASTLOG; ],
2296 [ AC_MSG_RESULT(yes) ],
2299 system_lastlog_path=no
2304 if test -z "$conf_lastlog_location"; then
2305 if test x"$system_lastlog_path" = x"no" ; then
2306 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2307 if (test -d "$f" || test -f "$f") ; then
2308 conf_lastlog_location=$f
2311 if test -z "$conf_lastlog_location"; then
2312 AC_MSG_WARN([** Cannot find lastlog **])
2313 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2318 if test -n "$conf_lastlog_location"; then
2319 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2323 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2325 #include <sys/types.h>
2331 [ char *utmp = UTMP_FILE; ],
2332 [ AC_MSG_RESULT(yes) ],
2334 system_utmp_path=no ]
2336 if test -z "$conf_utmp_location"; then
2337 if test x"$system_utmp_path" = x"no" ; then
2338 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2339 if test -f $f ; then
2340 conf_utmp_location=$f
2343 if test -z "$conf_utmp_location"; then
2344 AC_DEFINE(DISABLE_UTMP)
2348 if test -n "$conf_utmp_location"; then
2349 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2353 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2355 #include <sys/types.h>
2361 [ char *wtmp = WTMP_FILE; ],
2362 [ AC_MSG_RESULT(yes) ],
2364 system_wtmp_path=no ]
2366 if test -z "$conf_wtmp_location"; then
2367 if test x"$system_wtmp_path" = x"no" ; then
2368 for f in /usr/adm/wtmp /var/log/wtmp; do
2369 if test -f $f ; then
2370 conf_wtmp_location=$f
2373 if test -z "$conf_wtmp_location"; then
2374 AC_DEFINE(DISABLE_WTMP)
2378 if test -n "$conf_wtmp_location"; then
2379 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2383 dnl utmpx detection - I don't know any system so perverse as to require
2384 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2386 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2388 #include <sys/types.h>
2397 [ char *utmpx = UTMPX_FILE; ],
2398 [ AC_MSG_RESULT(yes) ],
2400 system_utmpx_path=no ]
2402 if test -z "$conf_utmpx_location"; then
2403 if test x"$system_utmpx_path" = x"no" ; then
2404 AC_DEFINE(DISABLE_UTMPX)
2407 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2411 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2413 #include <sys/types.h>
2422 [ char *wtmpx = WTMPX_FILE; ],
2423 [ AC_MSG_RESULT(yes) ],
2425 system_wtmpx_path=no ]
2427 if test -z "$conf_wtmpx_location"; then
2428 if test x"$system_wtmpx_path" = x"no" ; then
2429 AC_DEFINE(DISABLE_WTMPX)
2432 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2436 if test ! -z "$blibpath" ; then
2437 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2438 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2441 dnl remove pam and dl because they are in $LIBPAM
2442 if test "$PAM_MSG" = yes ; then
2443 LIBS=`echo $LIBS | sed 's/-lpam //'`
2445 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2446 LIBS=`echo $LIBS | sed 's/-ldl //'`
2450 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2453 # Print summary of options
2455 # Someone please show me a better way :)
2456 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2457 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2458 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2459 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2460 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2461 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2462 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2463 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
2466 echo "OpenSSH has been configured with the following options:"
2467 echo " User binaries: $B"
2468 echo " System binaries: $C"
2469 echo " Configuration files: $D"
2470 echo " Askpass program: $E"
2471 echo " Manual pages: $F"
2472 echo " PID file: $G"
2473 echo " sshd default user PATH: $H"
2474 echo " Manpage format: $MANTYPE"
2475 echo " PAM support: ${PAM_MSG}"
2476 echo " KerberosIV support: $KRB4_MSG"
2477 echo " Smartcard support: $SCARD_MSG"
2478 echo " AFS support: $AFS_MSG"
2479 echo " S/KEY support: $SKEY_MSG"
2480 echo " TCP Wrappers support: $TCPW_MSG"
2481 echo " MD5 password support: $MD5_MSG"
2482 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2483 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2484 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2485 echo " BSD Auth support: $BSD_AUTH_MSG"
2486 echo " Random number source: $RAND_MSG"
2487 if test ! -z "$USE_RAND_HELPER" ; then
2488 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2493 echo " Host: ${host}"
2494 echo " Compiler: ${CC}"
2495 echo " Compiler flags: ${CFLAGS}"
2496 echo "Preprocessor flags: ${CPPFLAGS}"
2497 echo " Linker flags: ${LDFLAGS}"
2498 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2502 if test "x$PAM_MSG" = "xyes" ; then
2503 echo "PAM is enabled. You may need to install a PAM control file "
2504 echo "for sshd, otherwise password authentication may fail. "
2505 echo "Example PAM control files can be found in the contrib/ "
2510 if test ! -z "$NO_SFTP"; then
2511 echo "sftp-server will be disabled. Your compiler does not "
2512 echo "support 64bit integers."
2516 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2517 echo "WARNING: you are using the builtin random number collection "
2518 echo "service. Please read WARNING.RNG and request that your OS "
2519 echo "vendor includes kernel-based random number collection in "
2520 echo "future versions of your OS."