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)
79 AC_DEFINE(LOGIN_NEEDS_UTMPX)
82 LIBS="$LIBS /usr/lib/textmode.o"
83 AC_DEFINE(HAVE_CYGWIN)
85 AC_DEFINE(DISABLE_SHADOW)
86 AC_DEFINE(IPV4_DEFAULT)
87 AC_DEFINE(IP_TOS_IS_BROKEN)
88 AC_DEFINE(NO_X11_UNIX_SOCKETS)
89 AC_DEFINE(BROKEN_FD_PASSING)
90 AC_DEFINE(SETGROUPS_NOOP)
93 AC_DEFINE(IP_TOS_IS_BROKEN)
96 AC_DEFINE(BROKEN_GETADDRINFO)
99 if test -z "$GCC"; then
102 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
103 IPADDR_IN_DISPLAY=yes
104 AC_DEFINE(HAVE_SECUREWARE)
106 AC_DEFINE(LOGIN_NO_ENDOPT)
107 AC_DEFINE(LOGIN_NEEDS_UTMPX)
108 AC_DEFINE(DISABLE_SHADOW)
109 AC_DEFINE(DISABLE_UTMP)
110 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
111 LIBS="$LIBS -lxnet -lsec -lsecpw"
112 disable_ptmx_check=yes
115 if test -z "$GCC"; then
118 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
119 IPADDR_IN_DISPLAY=yes
121 AC_DEFINE(LOGIN_NO_ENDOPT)
122 AC_DEFINE(LOGIN_NEEDS_UTMPX)
123 AC_DEFINE(DISABLE_SHADOW)
124 AC_DEFINE(DISABLE_UTMP)
125 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
126 LIBS="$LIBS -lxnet -lsec"
129 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
130 IPADDR_IN_DISPLAY=yes
131 AC_DEFINE(PAM_SUN_CODEBASE)
133 AC_DEFINE(LOGIN_NO_ENDOPT)
134 AC_DEFINE(LOGIN_NEEDS_UTMPX)
135 AC_DEFINE(DISABLE_SHADOW)
136 AC_DEFINE(DISABLE_UTMP)
137 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
138 LIBS="$LIBS -lxnet -lsec"
141 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
143 PATH="$PATH:/usr/etc"
144 AC_DEFINE(BROKEN_INET_NTOA)
145 AC_DEFINE(WITH_ABBREV_NO_TTY)
148 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
150 PATH="$PATH:/usr/etc"
151 AC_DEFINE(WITH_IRIX_ARRAY)
152 AC_DEFINE(WITH_IRIX_PROJECT)
153 AC_DEFINE(WITH_IRIX_AUDIT)
154 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
155 AC_DEFINE(BROKEN_INET_NTOA)
156 AC_DEFINE(WITH_ABBREV_NO_TTY)
160 check_for_libcrypt_later=1
161 AC_DEFINE(DONT_TRY_OTHER_AF)
162 AC_DEFINE(PAM_TTY_KLUDGE)
163 inet6_default_4in6=yes
165 mips-sony-bsd|mips-sony-newsos4)
166 AC_DEFINE(HAVE_NEWS4)
173 check_for_libcrypt_later=1
176 conf_lastlog_location="/usr/adm/lastlog"
177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/usr/adm/wtmp
181 AC_DEFINE(BROKEN_REALPATH)
183 AC_DEFINE(BROKEN_SAVED_UIDS)
184 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
189 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
191 AC_DEFINE(PAM_SUN_CODEBASE)
192 AC_DEFINE(LOGIN_NEEDS_UTMPX)
193 AC_DEFINE(LOGIN_NEEDS_TERM)
194 AC_DEFINE(PAM_TTY_KLUDGE)
195 # hardwire lastlog location (can't detect it on some versions)
196 conf_lastlog_location="/var/adm/lastlog"
197 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
198 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
199 if test "$sol2ver" -ge 8; then
201 AC_DEFINE(DISABLE_UTMP)
202 AC_DEFINE(DISABLE_WTMP)
208 CPPFLAGS="$CPPFLAGS -DSUNOS4"
209 AC_CHECK_FUNCS(getpwanam)
210 AC_DEFINE(PAM_SUN_CODEBASE)
211 conf_utmp_location=/etc/utmp
212 conf_wtmp_location=/var/adm/wtmp
213 conf_lastlog_location=/var/adm/lastlog
217 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
218 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
224 # /usr/ucblib MUST NOT be searched on ReliantUNIX
225 LDFLAGS="$LDFLAGS -L/usr/local/lib"
226 IPADDR_IN_DISPLAY=yes
228 AC_DEFINE(IP_TOS_IS_BROKEN)
229 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
230 # Attention: always take care to bind libsocket and libnsl before libc,
231 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
234 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
235 LDFLAGS="$LDFLAGS -L/usr/local/lib"
239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
240 LDFLAGS="$LDFLAGS -L/usr/local/lib"
244 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
245 LDFLAGS="$LDFLAGS -L/usr/local/lib"
248 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
249 LDFLAGS="$LDFLAGS -L/usr/local/lib"
250 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
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"
268 AC_DEFINE(HAVE_SECUREWARE)
269 AC_DEFINE(DISABLE_SHADOW)
270 AC_DEFINE(BROKEN_FD_PASSING)
271 AC_CHECK_FUNCS(getluid setluid)
278 AC_DEFINE(BROKEN_FD_PASSING)
279 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
280 LIBS="$LIBS -lgen -lrsc"
283 AC_MSG_CHECKING(for Digital Unix SIA)
286 [ --with-osfsia Enable Digital Unix SIA],
288 if test "x$withval" = "xno" ; then
289 AC_MSG_RESULT(disabled)
294 if test -z "$no_osfsia" ; then
295 if test -f /etc/sia/matrix.conf; then
297 AC_DEFINE(HAVE_OSF_SIA)
298 AC_DEFINE(DISABLE_LOGIN)
299 LIBS="$LIBS -lsecurity -ldb -lm -laud"
308 AC_DEFINE(NO_X11_UNIX_SOCKETS)
309 AC_DEFINE(MISSING_NFDBITS)
310 AC_DEFINE(MISSING_HOWMANY)
311 AC_DEFINE(MISSING_FD_MASK)
315 # Allow user to specify flags
317 [ --with-cflags Specify additional flags to pass to compiler],
319 if test "x$withval" != "xno" ; then
320 CFLAGS="$CFLAGS $withval"
324 AC_ARG_WITH(cppflags,
325 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
327 if test "x$withval" != "xno"; then
328 CPPFLAGS="$CPPFLAGS $withval"
333 [ --with-ldflags Specify additional flags to pass to linker],
335 if test "x$withval" != "xno" ; then
336 LDFLAGS="$LDFLAGS $withval"
341 [ --with-libs Specify additional libraries to link with],
343 if test "x$withval" != "xno" ; then
344 LIBS="$LIBS $withval"
349 # Checks for header files.
350 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
351 getopt.h glob.h lastlog.h limits.h login.h \
352 login_cap.h maillock.h netdb.h netgroup.h \
353 netinet/in_systm.h paths.h pty.h readpassphrase.h \
354 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
355 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
356 sys/mman.h sys/select.h sys/stat.h \
357 sys/stropts.h sys/sysmacros.h sys/time.h \
358 sys/un.h time.h ttyent.h usersec.h \
359 util.h utime.h utmp.h utmpx.h)
361 # Checks for libraries.
362 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
363 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
365 dnl SCO OS3 needs this for libwrap
366 if test "x$with_tcp_wrappers" != "xno" ; then
367 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
368 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
372 AC_CHECK_FUNC(getspnam, ,
373 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
376 [ --without-rpath Disable auto-added -R linker paths],
378 if test "x$withval" = "xno" ; then
381 if test "x$withval" = "xyes" ; then
389 [ --with-zlib=PATH Use zlib in PATH],
391 if test "x$withval" = "xno" ; then
392 AC_MSG_ERROR([*** zlib is required ***])
394 if test -d "$withval/lib"; then
395 if test -n "${need_dash_r}"; then
396 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
398 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
401 if test -n "${need_dash_r}"; then
402 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
404 LDFLAGS="-L${withval} ${LDFLAGS}"
407 if test -d "$withval/include"; then
408 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
410 CPPFLAGS="-I${withval} ${CPPFLAGS}"
415 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
418 AC_CHECK_FUNC(strcasecmp,
419 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
421 AC_CHECK_FUNC(utimes,
422 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
425 dnl Checks for libutil functions
426 AC_CHECK_HEADERS(libutil.h)
427 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
428 AC_CHECK_FUNCS(logout updwtmp logwtmp)
432 # Check for ALTDIRFUNC glob() extension
433 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
434 AC_EGREP_CPP(FOUNDIT,
437 #ifdef GLOB_ALTDIRFUNC
442 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
450 # Check for g.gl_matchc glob() extension
451 AC_MSG_CHECKING(for gl_matchc field in glob_t)
452 AC_EGREP_CPP(FOUNDIT,
455 int main(void){glob_t g; g.gl_matchc = 1;}
458 AC_DEFINE(GLOB_HAS_GL_MATCHC)
466 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
469 #include <sys/types.h>
471 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
473 [AC_MSG_RESULT(yes)],
476 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
480 # Check whether the user wants GSI (Globus) support
483 [ --with-gsi=PATH Enable GSI/Globus authentication support],
490 [ --with-globus=PATH Enable GSI/Globus authentication support],
496 # Check whether the user has a Globus flavor type
497 globus_flavor_type="no"
498 AC_ARG_WITH(globus-flavor,
499 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
501 globus_flavor_type="$withval"
505 if test "x$gsi_path" != "xno" ; then
506 # Globus GSSAPI configuration
510 # Find GLOBUS/GSI installation Directory
511 AC_MSG_CHECKING(for Globus/GSI installation directory)
513 globus_install_dir=$gsi_path
515 if test "x$globus_install_dir" = "xyes" ; then
516 AC_MSG_ERROR(Cannot find Globus/GSI installation directory -- a path must be specified!)
518 AC_MSG_RESULT($globus_install_dir)
520 # Find GLOBUS/GSI development directory
521 AC_MSG_CHECKING(for Globus/GSI development directory)
523 if test -d ${globus_install_dir}/lib ; then
524 # Looks like a flat directory structure from configure/make
525 # and not globus-install or gsi-install
526 globus_dev_dir=$globus_install_dir
529 # Assume a true globus installation with architecture
530 # directories and run globus-development-path to find
531 # the development directory
533 # Set GLOBUS_INSTALL_PATH
534 GLOBUS_INSTALL_PATH=$globus_install_dir
535 export GLOBUS_INSTALL_PATH
537 dev_path_program=${globus_install_dir}/bin/globus-development-path
539 if test ! -x ${dev_path_program} ; then
540 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
543 globus_dev_dir=`${dev_path_program}`
545 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
546 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
549 if test ! -d "$globus_dev_dir" ; then
550 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
553 AC_MSG_RESULT($globus_dev_dir)
555 # Find GLOBUS/GSI flavor Directory
556 AC_MSG_CHECKING(for Globus flavor type)
558 if test "x$globus_flavor_type" = "xno" ; then
559 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
560 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
561 GSI_CFLAGS="-I${globus_dev_dir}/include"
564 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
566 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
567 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
570 AC_MSG_RESULT($globus_flavor_type)
571 GSI_LIBS="${gsi_path}/lib/libglobus_gss_assist_${globus_flavor_type}.a ${gsi_path}/lib/libglobus_gssapi_gsi_${globus_flavor_type}.a"
572 GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
575 LIBS="$LIBS $GSI_LIBS"
576 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
577 CFLAGS="$CFLAGS $GSI_CFLAGS"
582 AC_SUBST(INSTALL_GSISSH)
583 # End Globus/GSI section
585 # Check whether user wants S/Key support
588 [ --with-skey[[=PATH]] Enable S/Key support
589 (optionally in PATH)],
591 if test "x$withval" != "xno" ; then
593 if test "x$withval" != "xyes" ; then
594 CPPFLAGS="$CPPFLAGS -I${withval}/include"
595 LDFLAGS="$LDFLAGS -L${withval}/lib"
602 AC_MSG_CHECKING([for s/key support])
607 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
609 [AC_MSG_RESULT(yes)],
612 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
618 # Check whether user wants TCP wrappers support
620 AC_ARG_WITH(tcp-wrappers,
621 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
622 (optionally in PATH)],
624 if test "x$withval" != "xno" ; then
626 saved_LDFLAGS="$LDFLAGS"
627 saved_CPPFLAGS="$CPPFLAGS"
628 if test -n "${withval}" -a "${withval}" != "yes"; then
629 if test -d "${withval}/lib"; then
630 if test -n "${need_dash_r}"; then
631 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
633 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
636 if test -n "${need_dash_r}"; then
637 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
639 LDFLAGS="-L${withval} ${LDFLAGS}"
642 if test -d "${withval}/include"; then
643 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
645 CPPFLAGS="-I${withval} ${CPPFLAGS}"
649 LIBS="$LIBWRAP $LIBS"
650 AC_MSG_CHECKING(for libwrap)
654 int deny_severity = 0, allow_severity = 0;
664 AC_MSG_ERROR([*** libwrap missing])
672 dnl Checks for library functions.
673 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
674 clock fchmod fchown freeaddrinfo futimes gai_strerror \
675 getaddrinfo getcwd getgrouplist getnameinfo getopt \
676 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
677 inet_ntop innetgr login_getcapbool md5_crypt memmove \
678 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
679 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
680 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
681 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
682 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
683 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
685 if test $ac_cv_func_mmap = yes ; then
686 AC_MSG_CHECKING([for mmap anon shared])
690 #include <sys/mman.h>
691 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
692 #define MAP_ANON MAP_ANONYMOUS
695 p = (char *) mmap(NULL, 10, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0);
703 AC_DEFINE(HAVE_MMAP_ANON_SHARED)
705 [ AC_MSG_RESULT(no) ]
709 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
710 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
711 AC_CHECK_LIB(gen, dirname,[
712 AC_CACHE_CHECK([for broken dirname],
713 ac_cv_have_broken_dirname, [
721 int main(int argc, char **argv) {
724 strncpy(buf,"/etc", 32);
726 if (!s || strncmp(s, "/", 32) != 0) {
733 [ ac_cv_have_broken_dirname="no" ],
734 [ ac_cv_have_broken_dirname="yes" ]
738 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
740 AC_DEFINE(HAVE_DIRNAME)
741 AC_CHECK_HEADERS(libgen.h)
746 dnl Checks for time functions
747 AC_CHECK_FUNCS(gettimeofday time)
748 dnl Checks for utmp functions
749 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
750 AC_CHECK_FUNCS(utmpname)
751 dnl Checks for utmpx functions
752 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
753 AC_CHECK_FUNCS(setutxent utmpxname)
755 AC_CHECK_FUNC(daemon,
756 [AC_DEFINE(HAVE_DAEMON)],
757 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
760 AC_CHECK_FUNC(getpagesize,
761 [AC_DEFINE(HAVE_GETPAGESIZE)],
762 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
765 # Check for broken snprintf
766 if test "x$ac_cv_func_snprintf" = "xyes" ; then
767 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
771 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
773 [AC_MSG_RESULT(yes)],
776 AC_DEFINE(BROKEN_SNPRINTF)
777 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
787 [ --with-pam Enable PAM support ],
789 if test "x$withval" != "xno" ; then
790 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
791 AC_MSG_ERROR([PAM headers not found])
794 AC_CHECK_LIB(dl, dlopen, , )
795 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
796 AC_CHECK_FUNCS(pam_getenvlist)
797 AC_CHECK_FUNCS(pam_putenv)
803 if test $ac_cv_lib_dl_dlopen = yes; then
813 # Check for older PAM
814 if test "x$PAM_MSG" = "xyes" ; then
815 # Check PAM strerror arguments (old PAM)
816 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
820 #include <security/pam_appl.h>
822 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
825 AC_DEFINE(HAVE_OLD_PAM)
827 PAM_MSG="yes (old library)"
833 saved_CPPFLAGS="$CPPFLAGS"
834 saved_LDFLAGS="$LDFLAGS"
836 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
838 if test "x$withval" != "xno" ; then
839 if test -d "$withval/lib"; then
840 if test -n "${need_dash_r}"; then
841 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
843 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
846 if test -n "${need_dash_r}"; then
847 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
849 LDFLAGS="-L${withval} ${LDFLAGS}"
852 if test -d "$withval/include"; then
853 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
855 CPPFLAGS="-I${withval} ${CPPFLAGS}"
861 # Patch up SSL libraries for GSI authentication as needed
862 if test "x$globus_flavor_type" != "xno" ; then
863 # For Globus 2, always link with the static libraries
864 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"
866 if test "x$gsi_path" != "xno" ; then
867 # Older GSI needs -lssl too
868 LIBS="$LIBS -lssl -lcrypto"
869 else # if no GSI authentication (i.e., OpenSSL default)
870 LIBS="$LIBS -lcrypto"
872 fi # globus_flavor_type
874 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
876 dnl Check default openssl install dir
877 if test -n "${need_dash_r}"; then
878 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
880 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
882 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
883 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
885 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
892 # Sanity check OpenSSL headers
893 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
897 #include <openssl/opensslv.h>
898 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
905 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
909 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
910 # version in OpenSSL. Skip this for PAM
911 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
912 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
916 ### Configure cryptographic random number support
918 # Check wheter OpenSSL seeds itself
919 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
923 #include <openssl/rand.h>
924 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
927 OPENSSL_SEEDS_ITSELF=yes
932 # Default to use of the rand helper if OpenSSL doesn't
939 # Do we want to force the use of the rand helper?
940 AC_ARG_WITH(rand-helper,
941 [ --with-rand-helper Use subprocess to gather strong randomness ],
943 if test "x$withval" = "xno" ; then
944 # Force use of OpenSSL's internal RNG, even if
945 # the previous test showed it to be unseeded.
946 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
947 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
948 OPENSSL_SEEDS_ITSELF=yes
957 # Which randomness source do we use?
958 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
960 AC_DEFINE(OPENSSL_PRNG_ONLY)
961 RAND_MSG="OpenSSL internal ONLY"
962 INSTALL_SSH_RAND_HELPER=""
963 elif test ! -z "$USE_RAND_HELPER" ; then
964 # install rand helper
965 RAND_MSG="ssh-rand-helper"
966 INSTALL_SSH_RAND_HELPER="yes"
968 AC_SUBST(INSTALL_SSH_RAND_HELPER)
970 ### Configuration of ssh-rand-helper
973 AC_ARG_WITH(prngd-port,
974 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
983 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
986 if test ! -z "$withval" ; then
987 PRNGD_PORT="$withval"
988 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
993 # PRNGD Unix domain socket
994 AC_ARG_WITH(prngd-socket,
995 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
999 withval="/var/run/egd-pool"
1007 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1011 if test ! -z "$withval" ; then
1012 if test ! -z "$PRNGD_PORT" ; then
1013 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1015 if test ! -r "$withval" ; then
1016 AC_MSG_WARN(Entropy socket is not readable)
1018 PRNGD_SOCKET="$withval"
1019 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1023 # Check for existing socket only if we don't have a random device already
1024 if test "$USE_RAND_HELPER" = yes ; then
1025 AC_MSG_CHECKING(for PRNGD/EGD socket)
1026 # Insert other locations here
1027 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1028 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1029 PRNGD_SOCKET="$sock"
1030 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1034 if test ! -z "$PRNGD_SOCKET" ; then
1035 AC_MSG_RESULT($PRNGD_SOCKET)
1037 AC_MSG_RESULT(not found)
1043 # Change default command timeout for hashing entropy source
1045 AC_ARG_WITH(entropy-timeout,
1046 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1048 if test "x$withval" != "xno" ; then
1049 entropy_timeout=$withval
1053 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1055 SSH_PRIVSEP_USER=sshd
1056 AC_ARG_WITH(privsep-user,
1057 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1059 if test -n "$withval"; then
1060 SSH_PRIVSEP_USER=$withval
1064 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1065 AC_SUBST(SSH_PRIVSEP_USER)
1067 # We do this little dance with the search path to insure
1068 # that programs that we select for use by installed programs
1069 # (which may be run by the super-user) come from trusted
1070 # locations before they come from the user's private area.
1071 # This should help avoid accidentally configuring some
1072 # random version of a program in someone's personal bin.
1076 test -h /bin 2> /dev/null && PATH=/usr/bin
1077 test -d /sbin && PATH=$PATH:/sbin
1078 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1079 PATH=$PATH:/etc:$OPATH
1081 # These programs are used by the command hashing source to gather entropy
1082 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1083 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1084 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1085 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1086 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1087 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1088 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1089 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1090 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1091 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1092 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1093 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1094 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1095 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1096 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1097 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1101 # Where does ssh-rand-helper get its randomness from?
1102 INSTALL_SSH_PRNG_CMDS=""
1103 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1104 if test ! -z "$PRNGD_PORT" ; then
1105 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1106 elif test ! -z "$PRNGD_SOCKET" ; then
1107 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1109 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1110 RAND_HELPER_CMDHASH=yes
1111 INSTALL_SSH_PRNG_CMDS="yes"
1114 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1117 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1118 if test ! -z "$SONY" ; then
1119 LIBS="$LIBS -liberty";
1122 # Checks for data types
1123 AC_CHECK_SIZEOF(char, 1)
1124 AC_CHECK_SIZEOF(short int, 2)
1125 AC_CHECK_SIZEOF(int, 4)
1126 AC_CHECK_SIZEOF(long int, 4)
1127 AC_CHECK_SIZEOF(long long int, 8)
1129 # Sanity check long long for some platforms (AIX)
1130 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1131 ac_cv_sizeof_long_long_int=0
1134 # More checks for data types
1135 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1137 [ #include <sys/types.h> ],
1139 [ ac_cv_have_u_int="yes" ],
1140 [ ac_cv_have_u_int="no" ]
1143 if test "x$ac_cv_have_u_int" = "xyes" ; then
1144 AC_DEFINE(HAVE_U_INT)
1148 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1150 [ #include <sys/types.h> ],
1151 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1152 [ ac_cv_have_intxx_t="yes" ],
1153 [ ac_cv_have_intxx_t="no" ]
1156 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1157 AC_DEFINE(HAVE_INTXX_T)
1161 if (test -z "$have_intxx_t" && \
1162 test "x$ac_cv_header_stdint_h" = "xyes")
1164 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1166 [ #include <stdint.h> ],
1167 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1169 AC_DEFINE(HAVE_INTXX_T)
1172 [ AC_MSG_RESULT(no) ]
1176 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1178 [ #include <sys/types.h> ],
1179 [ int64_t a; a = 1;],
1180 [ ac_cv_have_int64_t="yes" ],
1181 [ ac_cv_have_int64_t="no" ]
1184 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1185 AC_DEFINE(HAVE_INT64_T)
1189 if test -z "$have_int64_t" ; then
1190 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1192 [ #include <sys/socket.h> ],
1193 [ int64_t a; a = 1],
1195 AC_DEFINE(HAVE_INT64_T)
1198 [ AC_MSG_RESULT(no) ]
1202 if test -z "$have_int64_t" ; then
1203 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1205 [ #include <sys/bitypes.h> ],
1206 [ int64_t a; a = 1],
1208 AC_DEFINE(HAVE_INT64_T)
1211 [ AC_MSG_RESULT(no) ]
1215 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1217 [ #include <sys/types.h> ],
1218 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1219 [ ac_cv_have_u_intxx_t="yes" ],
1220 [ ac_cv_have_u_intxx_t="no" ]
1223 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1224 AC_DEFINE(HAVE_U_INTXX_T)
1228 if test -z "$have_u_intxx_t" ; then
1229 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1231 [ #include <sys/socket.h> ],
1232 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1234 AC_DEFINE(HAVE_U_INTXX_T)
1237 [ AC_MSG_RESULT(no) ]
1241 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1243 [ #include <sys/types.h> ],
1244 [ u_int64_t a; a = 1;],
1245 [ ac_cv_have_u_int64_t="yes" ],
1246 [ ac_cv_have_u_int64_t="no" ]
1249 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1250 AC_DEFINE(HAVE_U_INT64_T)
1254 if test -z "$have_u_int64_t" ; then
1255 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1257 [ #include <sys/bitypes.h> ],
1258 [ u_int64_t a; a = 1],
1260 AC_DEFINE(HAVE_U_INT64_T)
1263 [ AC_MSG_RESULT(no) ]
1267 if test -z "$have_u_intxx_t" ; then
1268 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1271 #include <sys/types.h>
1273 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1274 [ ac_cv_have_uintxx_t="yes" ],
1275 [ ac_cv_have_uintxx_t="no" ]
1278 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1279 AC_DEFINE(HAVE_UINTXX_T)
1283 if test -z "$have_uintxx_t" ; then
1284 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1286 [ #include <stdint.h> ],
1287 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1289 AC_DEFINE(HAVE_UINTXX_T)
1292 [ AC_MSG_RESULT(no) ]
1296 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1297 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1299 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1302 #include <sys/bitypes.h>
1305 int8_t a; int16_t b; int32_t c;
1306 u_int8_t e; u_int16_t f; u_int32_t g;
1307 a = b = c = e = f = g = 1;
1310 AC_DEFINE(HAVE_U_INTXX_T)
1311 AC_DEFINE(HAVE_INTXX_T)
1319 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1322 #include <sys/types.h>
1324 [ u_char foo; foo = 125; ],
1325 [ ac_cv_have_u_char="yes" ],
1326 [ ac_cv_have_u_char="no" ]
1329 if test "x$ac_cv_have_u_char" = "xyes" ; then
1330 AC_DEFINE(HAVE_U_CHAR)
1335 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1337 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1340 #include <sys/types.h>
1342 [ size_t foo; foo = 1235; ],
1343 [ ac_cv_have_size_t="yes" ],
1344 [ ac_cv_have_size_t="no" ]
1347 if test "x$ac_cv_have_size_t" = "xyes" ; then
1348 AC_DEFINE(HAVE_SIZE_T)
1351 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1354 #include <sys/types.h>
1356 [ ssize_t foo; foo = 1235; ],
1357 [ ac_cv_have_ssize_t="yes" ],
1358 [ ac_cv_have_ssize_t="no" ]
1361 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1362 AC_DEFINE(HAVE_SSIZE_T)
1365 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1370 [ clock_t foo; foo = 1235; ],
1371 [ ac_cv_have_clock_t="yes" ],
1372 [ ac_cv_have_clock_t="no" ]
1375 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1376 AC_DEFINE(HAVE_CLOCK_T)
1379 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1382 #include <sys/types.h>
1383 #include <sys/socket.h>
1385 [ sa_family_t foo; foo = 1235; ],
1386 [ ac_cv_have_sa_family_t="yes" ],
1389 #include <sys/types.h>
1390 #include <sys/socket.h>
1391 #include <netinet/in.h>
1393 [ sa_family_t foo; foo = 1235; ],
1394 [ ac_cv_have_sa_family_t="yes" ],
1396 [ ac_cv_have_sa_family_t="no" ]
1400 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1401 AC_DEFINE(HAVE_SA_FAMILY_T)
1404 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1407 #include <sys/types.h>
1409 [ pid_t foo; foo = 1235; ],
1410 [ ac_cv_have_pid_t="yes" ],
1411 [ ac_cv_have_pid_t="no" ]
1414 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1415 AC_DEFINE(HAVE_PID_T)
1418 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1421 #include <sys/types.h>
1423 [ mode_t foo; foo = 1235; ],
1424 [ ac_cv_have_mode_t="yes" ],
1425 [ ac_cv_have_mode_t="no" ]
1428 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1429 AC_DEFINE(HAVE_MODE_T)
1433 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1436 #include <sys/types.h>
1437 #include <sys/socket.h>
1439 [ struct sockaddr_storage s; ],
1440 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1441 [ ac_cv_have_struct_sockaddr_storage="no" ]
1444 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1445 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1448 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1451 #include <sys/types.h>
1452 #include <netinet/in.h>
1454 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1455 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1456 [ ac_cv_have_struct_sockaddr_in6="no" ]
1459 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1460 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1463 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1466 #include <sys/types.h>
1467 #include <netinet/in.h>
1469 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1470 [ ac_cv_have_struct_in6_addr="yes" ],
1471 [ ac_cv_have_struct_in6_addr="no" ]
1474 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1475 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1478 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1481 #include <sys/types.h>
1482 #include <sys/socket.h>
1485 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1486 [ ac_cv_have_struct_addrinfo="yes" ],
1487 [ ac_cv_have_struct_addrinfo="no" ]
1490 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1491 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1494 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1496 [ #include <sys/time.h> ],
1497 [ struct timeval tv; tv.tv_sec = 1;],
1498 [ ac_cv_have_struct_timeval="yes" ],
1499 [ ac_cv_have_struct_timeval="no" ]
1502 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1503 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1504 have_struct_timeval=1
1507 # If we don't have int64_t then we can't compile sftp-server. So don't
1508 # even attempt to do it.
1509 if test "x$ac_cv_have_int64_t" = "xno" -a \
1510 "x$ac_cv_sizeof_long_int" != "x8" -a \
1511 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1514 dnl test snprintf (broken on SCO w/gcc)
1519 #ifdef HAVE_SNPRINTF
1523 char expected_out[50];
1525 #if (SIZEOF_LONG_INT == 8)
1526 long int num = 0x7fffffffffffffff;
1528 long long num = 0x7fffffffffffffffll;
1530 strcpy(expected_out, "9223372036854775807");
1531 snprintf(buf, mazsize, "%lld", num);
1532 if(strcmp(buf, expected_out) != 0)
1539 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1544 dnl Checks for structure members
1545 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1546 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1547 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1548 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1549 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1550 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1551 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1552 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1553 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1554 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1555 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1556 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1557 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1558 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1559 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1560 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1561 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1563 AC_CHECK_MEMBERS([struct stat.st_blksize])
1565 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1566 ac_cv_have_ss_family_in_struct_ss, [
1569 #include <sys/types.h>
1570 #include <sys/socket.h>
1572 [ struct sockaddr_storage s; s.ss_family = 1; ],
1573 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1574 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1577 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1578 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1581 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1582 ac_cv_have___ss_family_in_struct_ss, [
1585 #include <sys/types.h>
1586 #include <sys/socket.h>
1588 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1589 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1590 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1593 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1594 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1597 AC_CACHE_CHECK([for pw_class field in struct passwd],
1598 ac_cv_have_pw_class_in_struct_passwd, [
1603 [ struct passwd p; p.pw_class = 0; ],
1604 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1605 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1608 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1609 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1612 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1613 ac_cv_have_pw_expire_in_struct_passwd, [
1618 [ struct passwd p; p.pw_expire = 0; ],
1619 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1620 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1623 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1624 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1627 AC_CACHE_CHECK([for pw_change field in struct passwd],
1628 ac_cv_have_pw_change_in_struct_passwd, [
1633 [ struct passwd p; p.pw_change = 0; ],
1634 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1635 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1638 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1639 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1642 dnl make sure we're using the real structure members and not defines
1643 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1644 ac_cv_have_accrights_in_msghdr, [
1647 #include <sys/types.h>
1648 #include <sys/socket.h>
1649 #include <sys/uio.h>
1651 #ifdef msg_accrights
1655 m.msg_accrights = 0;
1659 [ ac_cv_have_accrights_in_msghdr="yes" ],
1660 [ ac_cv_have_accrights_in_msghdr="no" ]
1663 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1664 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1667 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1668 ac_cv_have_control_in_msghdr, [
1671 #include <sys/types.h>
1672 #include <sys/socket.h>
1673 #include <sys/uio.h>
1683 [ ac_cv_have_control_in_msghdr="yes" ],
1684 [ ac_cv_have_control_in_msghdr="no" ]
1687 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1688 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1691 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1693 [ extern char *__progname; printf("%s", __progname); ],
1694 [ ac_cv_libc_defines___progname="yes" ],
1695 [ ac_cv_libc_defines___progname="no" ]
1698 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1699 AC_DEFINE(HAVE___PROGNAME)
1702 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1706 [ printf("%s", __FUNCTION__); ],
1707 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1708 [ ac_cv_cc_implements___FUNCTION__="no" ]
1711 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1712 AC_DEFINE(HAVE___FUNCTION__)
1715 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1719 [ printf("%s", __func__); ],
1720 [ ac_cv_cc_implements___func__="yes" ],
1721 [ ac_cv_cc_implements___func__="no" ]
1724 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1725 AC_DEFINE(HAVE___func__)
1728 AC_CACHE_CHECK([whether getopt has optreset support],
1729 ac_cv_have_getopt_optreset, [
1734 [ extern int optreset; optreset = 0; ],
1735 [ ac_cv_have_getopt_optreset="yes" ],
1736 [ ac_cv_have_getopt_optreset="no" ]
1739 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1740 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1743 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1745 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1746 [ ac_cv_libc_defines_sys_errlist="yes" ],
1747 [ ac_cv_libc_defines_sys_errlist="no" ]
1750 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1751 AC_DEFINE(HAVE_SYS_ERRLIST)
1755 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1757 [ extern int sys_nerr; printf("%i", sys_nerr);],
1758 [ ac_cv_libc_defines_sys_nerr="yes" ],
1759 [ ac_cv_libc_defines_sys_nerr="no" ]
1762 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1763 AC_DEFINE(HAVE_SYS_NERR)
1768 # Check whether user wants sectok support
1770 [ --with-sectok Enable smartcard support using libsectok],
1772 if test "x$withval" != "xno" ; then
1773 if test "x$withval" != "xyes" ; then
1774 CPPFLAGS="$CPPFLAGS -I${withval}"
1775 LDFLAGS="$LDFLAGS -L${withval}"
1776 if test ! -z "$need_dash_r" ; then
1777 LDFLAGS="$LDFLAGS -R${withval}"
1779 if test ! -z "$blibpath" ; then
1780 blibpath="$blibpath:${withval}"
1783 AC_CHECK_HEADERS(sectok.h)
1784 if test "$ac_cv_header_sectok_h" != yes; then
1785 AC_MSG_ERROR(Can't find sectok.h)
1787 AC_CHECK_LIB(sectok, sectok_open)
1788 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1789 AC_MSG_ERROR(Can't find libsectok)
1791 AC_DEFINE(SMARTCARD)
1792 AC_DEFINE(USE_SECTOK)
1793 SCARD_MSG="yes, using sectok"
1798 # Check whether user wants OpenSC support
1800 AC_HELP_STRING([--with-opensc=PFX],
1801 [Enable smartcard support using OpenSC]),
1802 opensc_config_prefix="$withval", opensc_config_prefix="")
1803 if test x$opensc_config_prefix != x ; then
1804 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1805 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1806 if test "$OPENSC_CONFIG" != "no"; then
1807 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1808 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1809 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1810 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1811 AC_DEFINE(SMARTCARD)
1812 AC_DEFINE(USE_OPENSC)
1813 SCARD_MSG="yes, using OpenSC"
1817 # Check whether user wants Kerberos 5 support
1819 AC_ARG_WITH(kerberos5,
1820 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1822 if test "x$withval" != "xno" ; then
1823 if test "x$withval" = "xyes" ; then
1824 KRB5ROOT="/usr/local"
1828 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1829 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1832 AC_MSG_CHECKING(whether we are using Heimdal)
1833 AC_TRY_COMPILE([ #include <krb5.h> ],
1834 [ char *tmp = heimdal_version; ],
1835 [ AC_MSG_RESULT(yes)
1837 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1840 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1843 if test ! -z "$need_dash_r" ; then
1844 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1846 if test ! -z "$blibpath" ; then
1847 blibpath="$blibpath:${KRB5ROOT}/lib"
1849 AC_CHECK_LIB(resolv, dn_expand, , )
1851 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1853 K5LIBS="-lgssapi $K5LIBS" ],
1854 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1856 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1857 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1862 AC_CHECK_HEADER(gssapi.h, ,
1863 [ unset ac_cv_header_gssapi_h
1864 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1865 AC_CHECK_HEADERS(gssapi.h, ,
1866 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1872 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1873 AC_CHECK_HEADER(gssapi_krb5.h, ,
1874 [ CPPFLAGS="$oldCPP" ])
1880 # Check whether user wants Kerberos 4 support
1882 AC_ARG_WITH(kerberos4,
1883 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1885 if test "x$withval" != "xno" ; then
1886 if test "x$withval" != "xyes" ; then
1887 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1888 LDFLAGS="$LDFLAGS -L${withval}/lib"
1889 if test ! -z "$need_dash_r" ; then
1890 LDFLAGS="$LDFLAGS -R${withval}/lib"
1892 if test ! -z "$blibpath" ; then
1893 blibpath="$blibpath:${withval}/lib"
1896 if test -d /usr/include/kerberosIV ; then
1897 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1901 AC_CHECK_HEADERS(krb.h)
1902 if test "$ac_cv_header_krb_h" != yes; then
1903 AC_MSG_WARN([Cannot find krb.h, build may fail])
1905 AC_CHECK_LIB(krb, main)
1906 if test "$ac_cv_lib_krb_main" != yes; then
1907 AC_CHECK_LIB(krb4, main)
1908 if test "$ac_cv_lib_krb4_main" != yes; then
1909 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1916 AC_CHECK_LIB(des, des_cbc_encrypt)
1917 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1918 AC_CHECK_LIB(des425, des_cbc_encrypt)
1919 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1920 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1927 AC_CHECK_LIB(resolv, dn_expand, , )
1935 # Check whether user wants AFS support
1938 [ --with-afs=PATH Enable AFS support],
1940 if test "x$withval" != "xno" ; then
1942 if test "x$withval" != "xyes" ; then
1943 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1944 LDFLAGS="$LDFLAGS -L${withval}/lib"
1947 if test -z "$KRB4" ; then
1948 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1952 if test ! -z "$AFS_LIBS" ; then
1953 LIBS="$LIBS $AFS_LIBS"
1960 LIBS="$LIBS $KLIBS $K5LIBS"
1962 # Looking for programs, paths and files
1964 PRIVSEP_PATH=/var/empty
1965 AC_ARG_WITH(privsep-path,
1966 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1968 if test "x$withval" != "$no" ; then
1969 PRIVSEP_PATH=$withval
1973 AC_SUBST(PRIVSEP_PATH)
1976 [ --with-xauth=PATH Specify path to xauth program ],
1978 if test "x$withval" != "xno" ; then
1983 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1984 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1985 xauth_path="/usr/openwin/bin/xauth"
1990 if test -z "$xauth_path" ; then
1991 XAUTH_PATH="undefined"
1992 AC_SUBST(XAUTH_PATH)
1994 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1995 XAUTH_PATH=$xauth_path
1996 AC_SUBST(XAUTH_PATH)
1999 # Check for mail directory (last resort if we cannot get it from headers)
2000 if test ! -z "$MAIL" ; then
2001 maildir=`dirname $MAIL`
2002 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2005 if test -z "$no_dev_ptmx" ; then
2006 if test "x$disable_ptmx_check" != "xyes" ; then
2007 AC_CHECK_FILE("/dev/ptmx",
2009 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2015 AC_CHECK_FILE("/dev/ptc",
2017 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2022 # Options from here on. Some of these are preset by platform above
2023 AC_ARG_WITH(mantype,
2024 [ --with-mantype=man|cat|doc Set man page type],
2031 AC_MSG_ERROR(invalid man type: $withval)
2036 if test -z "$MANTYPE"; then
2037 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
2038 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2040 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2047 if test "$MANTYPE" = "doc"; then
2054 # Check whether to enable MD5 passwords
2056 AC_ARG_WITH(md5-passwords,
2057 [ --with-md5-passwords Enable use of MD5 passwords],
2059 if test "x$withval" != "xno" ; then
2060 AC_DEFINE(HAVE_MD5_PASSWORDS)
2066 # Whether to disable shadow password support
2068 [ --without-shadow Disable shadow password support],
2070 if test "x$withval" = "xno" ; then
2071 AC_DEFINE(DISABLE_SHADOW)
2077 if test -z "$disable_shadow" ; then
2078 AC_MSG_CHECKING([if the systems has expire shadow information])
2081 #include <sys/types.h>
2084 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2085 [ sp_expire_available=yes ], []
2088 if test "x$sp_expire_available" = "xyes" ; then
2090 AC_DEFINE(HAS_SHADOW_EXPIRE)
2096 # Use ip address instead of hostname in $DISPLAY
2097 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2098 DISPLAY_HACK_MSG="yes"
2099 AC_DEFINE(IPADDR_IN_DISPLAY)
2101 DISPLAY_HACK_MSG="no"
2102 AC_ARG_WITH(ipaddr-display,
2103 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2105 if test "x$withval" != "xno" ; then
2106 AC_DEFINE(IPADDR_IN_DISPLAY)
2107 DISPLAY_HACK_MSG="yes"
2113 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2114 if test $ac_cv_func_login_getcapbool = "yes" -a \
2115 $ac_cv_header_login_cap_h = "yes" ; then
2118 # Whether to mess with the default path
2119 SERVER_PATH_MSG="(default)"
2120 AC_ARG_WITH(default-path,
2121 [ --with-default-path= Specify default \$PATH environment for server],
2123 if test "$USES_LOGIN_CONF" = "yes" ; then
2125 --with-default-path=PATH has no effect on this system.
2126 Edit /etc/login.conf instead.])
2127 elif test "x$withval" != "xno" ; then
2128 user_path="$withval"
2129 SERVER_PATH_MSG="$withval"
2132 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2133 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2137 /* find out what STDPATH is */
2142 #ifndef _PATH_STDPATH
2143 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2145 #include <sys/types.h>
2146 #include <sys/stat.h>
2148 #define DATA "conftest.stdpath"
2155 fd = fopen(DATA,"w");
2159 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2164 ], [ user_path=`cat conftest.stdpath` ],
2165 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2166 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2168 # make sure $bindir is in USER_PATH so scp will work
2169 t_bindir=`eval echo ${bindir}`
2171 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2174 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2176 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2177 if test $? -ne 0 ; then
2178 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2179 if test $? -ne 0 ; then
2180 user_path=$user_path:$t_bindir
2181 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2186 if test "$USES_LOGIN_CONF" != "yes" ; then
2187 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2191 # Set superuser path separately to user path
2192 AC_ARG_WITH(superuser-path,
2193 [ --with-superuser-path= Specify different path for super-user],
2195 if test "x$withval" != "xno" ; then
2196 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2197 superuser_path=$withval
2203 # Whether to force IPv4 by default (needed on broken glibc Linux)
2205 AC_ARG_WITH(ipv4-default,
2206 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2208 if test "x$withval" != "xno" ; then
2209 AC_DEFINE(IPV4_DEFAULT)
2215 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2216 IPV4_IN6_HACK_MSG="no"
2218 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2220 if test "x$withval" != "xno" ; then
2222 AC_DEFINE(IPV4_IN_IPV6)
2223 IPV4_IN6_HACK_MSG="yes"
2228 if test "x$inet6_default_4in6" = "xyes"; then
2229 AC_MSG_RESULT([yes (default)])
2230 AC_DEFINE(IPV4_IN_IPV6)
2231 IPV4_IN6_HACK_MSG="yes"
2233 AC_MSG_RESULT([no (default)])
2238 # Whether to enable BSD auth support
2240 AC_ARG_WITH(bsd-auth,
2241 [ --with-bsd-auth Enable BSD auth support],
2243 if test "x$withval" != "xno" ; then
2250 # Where to place sshd.pid
2252 # make sure the directory exists
2253 if test ! -d $piddir ; then
2254 piddir=`eval echo ${sysconfdir}`
2256 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2260 AC_ARG_WITH(pid-dir,
2261 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2263 if test "x$withval" != "xno" ; then
2265 if test ! -d $piddir ; then
2266 AC_MSG_WARN([** no $piddir directory on this system **])
2272 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2275 dnl allow user to disable some login recording features
2276 AC_ARG_ENABLE(lastlog,
2277 [ --disable-lastlog disable use of lastlog even if detected [no]],
2278 [ AC_DEFINE(DISABLE_LASTLOG) ]
2281 [ --disable-utmp disable use of utmp even if detected [no]],
2282 [ AC_DEFINE(DISABLE_UTMP) ]
2284 AC_ARG_ENABLE(utmpx,
2285 [ --disable-utmpx disable use of utmpx even if detected [no]],
2286 [ AC_DEFINE(DISABLE_UTMPX) ]
2289 [ --disable-wtmp disable use of wtmp even if detected [no]],
2290 [ AC_DEFINE(DISABLE_WTMP) ]
2292 AC_ARG_ENABLE(wtmpx,
2293 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2294 [ AC_DEFINE(DISABLE_WTMPX) ]
2296 AC_ARG_ENABLE(libutil,
2297 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2298 [ AC_DEFINE(DISABLE_LOGIN) ]
2300 AC_ARG_ENABLE(pututline,
2301 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2302 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2304 AC_ARG_ENABLE(pututxline,
2305 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2306 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2308 AC_ARG_WITH(lastlog,
2309 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2311 if test "x$withval" = "xno" ; then
2312 AC_DEFINE(DISABLE_LASTLOG)
2314 conf_lastlog_location=$withval
2319 dnl lastlog, [uw]tmpx? detection
2320 dnl NOTE: set the paths in the platform section to avoid the
2321 dnl need for command-line parameters
2322 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2324 dnl lastlog detection
2325 dnl NOTE: the code itself will detect if lastlog is a directory
2326 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2328 #include <sys/types.h>
2330 #ifdef HAVE_LASTLOG_H
2331 # include <lastlog.h>
2340 [ char *lastlog = LASTLOG_FILE; ],
2341 [ AC_MSG_RESULT(yes) ],
2344 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2346 #include <sys/types.h>
2348 #ifdef HAVE_LASTLOG_H
2349 # include <lastlog.h>
2355 [ char *lastlog = _PATH_LASTLOG; ],
2356 [ AC_MSG_RESULT(yes) ],
2359 system_lastlog_path=no
2364 if test -z "$conf_lastlog_location"; then
2365 if test x"$system_lastlog_path" = x"no" ; then
2366 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2367 if (test -d "$f" || test -f "$f") ; then
2368 conf_lastlog_location=$f
2371 if test -z "$conf_lastlog_location"; then
2372 AC_MSG_WARN([** Cannot find lastlog **])
2373 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2378 if test -n "$conf_lastlog_location"; then
2379 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2383 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2385 #include <sys/types.h>
2391 [ char *utmp = UTMP_FILE; ],
2392 [ AC_MSG_RESULT(yes) ],
2394 system_utmp_path=no ]
2396 if test -z "$conf_utmp_location"; then
2397 if test x"$system_utmp_path" = x"no" ; then
2398 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2399 if test -f $f ; then
2400 conf_utmp_location=$f
2403 if test -z "$conf_utmp_location"; then
2404 AC_DEFINE(DISABLE_UTMP)
2408 if test -n "$conf_utmp_location"; then
2409 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2413 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2415 #include <sys/types.h>
2421 [ char *wtmp = WTMP_FILE; ],
2422 [ AC_MSG_RESULT(yes) ],
2424 system_wtmp_path=no ]
2426 if test -z "$conf_wtmp_location"; then
2427 if test x"$system_wtmp_path" = x"no" ; then
2428 for f in /usr/adm/wtmp /var/log/wtmp; do
2429 if test -f $f ; then
2430 conf_wtmp_location=$f
2433 if test -z "$conf_wtmp_location"; then
2434 AC_DEFINE(DISABLE_WTMP)
2438 if test -n "$conf_wtmp_location"; then
2439 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2443 dnl utmpx detection - I don't know any system so perverse as to require
2444 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2446 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2448 #include <sys/types.h>
2457 [ char *utmpx = UTMPX_FILE; ],
2458 [ AC_MSG_RESULT(yes) ],
2460 system_utmpx_path=no ]
2462 if test -z "$conf_utmpx_location"; then
2463 if test x"$system_utmpx_path" = x"no" ; then
2464 AC_DEFINE(DISABLE_UTMPX)
2467 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2471 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2473 #include <sys/types.h>
2482 [ char *wtmpx = WTMPX_FILE; ],
2483 [ AC_MSG_RESULT(yes) ],
2485 system_wtmpx_path=no ]
2487 if test -z "$conf_wtmpx_location"; then
2488 if test x"$system_wtmpx_path" = x"no" ; then
2489 AC_DEFINE(DISABLE_WTMPX)
2492 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2496 if test ! -z "$blibpath" ; then
2497 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2498 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2501 dnl remove pam and dl because they are in $LIBPAM
2502 if test "$PAM_MSG" = yes ; then
2503 LIBS=`echo $LIBS | sed 's/-lpam //'`
2505 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2506 LIBS=`echo $LIBS | sed 's/-ldl //'`
2510 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2513 # Print summary of options
2515 # Someone please show me a better way :)
2516 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2517 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2518 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2519 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2520 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2521 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2522 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2523 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2524 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2525 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2528 echo "OpenSSH has been configured with the following options:"
2529 echo " User binaries: $B"
2530 echo " System binaries: $C"
2531 echo " Configuration files: $D"
2532 echo " Askpass program: $E"
2533 echo " Manual pages: $F"
2534 echo " PID file: $G"
2535 echo " Privilege separation chroot path: $H"
2536 if test "$USES_LOGIN_CONF" = "yes" ; then
2537 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2539 echo " sshd default user PATH: $I"
2541 if test ! -z "$superuser_path" ; then
2542 echo " sshd superuser user PATH: $J"
2544 echo " Manpage format: $MANTYPE"
2545 echo " PAM support: ${PAM_MSG}"
2546 echo " KerberosIV support: $KRB4_MSG"
2547 echo " KerberosV support: $KRB5_MSG"
2548 echo " Smartcard support: $SCARD_MSG"
2549 echo " AFS support: $AFS_MSG"
2550 echo " S/KEY support: $SKEY_MSG"
2551 echo " TCP Wrappers support: $TCPW_MSG"
2552 echo " MD5 password support: $MD5_MSG"
2553 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2554 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2555 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2556 echo " BSD Auth support: $BSD_AUTH_MSG"
2557 echo " Random number source: $RAND_MSG"
2558 if test ! -z "$USE_RAND_HELPER" ; then
2559 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2564 echo " Host: ${host}"
2565 echo " Compiler: ${CC}"
2566 echo " Compiler flags: ${CFLAGS}"
2567 echo "Preprocessor flags: ${CPPFLAGS}"
2568 echo " Linker flags: ${LDFLAGS}"
2569 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2573 if test "x$PAM_MSG" = "xyes" ; then
2574 echo "PAM is enabled. You may need to install a PAM control file "
2575 echo "for sshd, otherwise password authentication may fail. "
2576 echo "Example PAM control files can be found in the contrib/ "
2581 if test ! -z "$NO_SFTP"; then
2582 echo "sftp-server will be disabled. Your compiler does not "
2583 echo "support 64bit integers."
2587 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2588 echo "WARNING: you are using the builtin random number collection "
2589 echo "service. Please read WARNING.RNG and request that your OS "
2590 echo "vendor includes kernel-based random number collection in "
2591 echo "future versions of your OS."