4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
17 AC_PATH_PROG(SED, sed)
19 AC_PATH_PROG(ENT, ent)
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_CHECK_LIB(s,authenticate,
76 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 AC_DEFINE(BROKEN_REALPATH)
82 dnl AIX handles lastlog as part of its login message
83 AC_DEFINE(DISABLE_LASTLOG)
84 AC_DEFINE(LOGIN_NEEDS_UTMPX)
85 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
86 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
89 check_for_libcrypt_later=1
90 LIBS="$LIBS /usr/lib/textmode.o"
91 AC_DEFINE(HAVE_CYGWIN)
93 AC_DEFINE(DISABLE_SHADOW)
94 AC_DEFINE(IPV4_DEFAULT)
95 AC_DEFINE(IP_TOS_IS_BROKEN)
96 AC_DEFINE(NO_X11_UNIX_SOCKETS)
97 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
98 AC_DEFINE(DISABLE_FD_PASSING)
99 AC_DEFINE(SETGROUPS_NOOP)
102 AC_DEFINE(IP_TOS_IS_BROKEN)
105 AC_MSG_CHECKING(if we have working getaddrinfo)
106 AC_TRY_RUN([#include <mach-o/dyld.h>
107 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
111 }], [AC_MSG_RESULT(working)],
112 [AC_MSG_RESULT(buggy)
113 AC_DEFINE(BROKEN_GETADDRINFO)],
114 [AC_MSG_RESULT(assume it is working)])
117 if test -z "$GCC"; then
120 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
121 IPADDR_IN_DISPLAY=yes
122 AC_DEFINE(HAVE_SECUREWARE)
124 AC_DEFINE(LOGIN_NO_ENDOPT)
125 AC_DEFINE(LOGIN_NEEDS_UTMPX)
126 AC_DEFINE(DISABLE_SHADOW)
127 AC_DEFINE(DISABLE_UTMP)
128 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
129 LIBS="$LIBS -lsec -lsecpw"
130 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
131 disable_ptmx_check=yes
134 if test -z "$GCC"; then
137 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
138 IPADDR_IN_DISPLAY=yes
140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
142 AC_DEFINE(DISABLE_SHADOW)
143 AC_DEFINE(DISABLE_UTMP)
144 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
146 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
149 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
150 IPADDR_IN_DISPLAY=yes
151 AC_DEFINE(PAM_SUN_CODEBASE)
153 AC_DEFINE(LOGIN_NO_ENDOPT)
154 AC_DEFINE(LOGIN_NEEDS_UTMPX)
155 AC_DEFINE(DISABLE_SHADOW)
156 AC_DEFINE(DISABLE_UTMP)
157 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
159 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
162 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
164 PATH="$PATH:/usr/etc"
165 AC_DEFINE(BROKEN_INET_NTOA)
166 AC_DEFINE(WITH_ABBREV_NO_TTY)
169 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
171 PATH="$PATH:/usr/etc"
172 AC_DEFINE(WITH_IRIX_ARRAY)
173 AC_DEFINE(WITH_IRIX_PROJECT)
174 AC_DEFINE(WITH_IRIX_AUDIT)
175 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
176 AC_DEFINE(BROKEN_INET_NTOA)
177 AC_DEFINE(WITH_ABBREV_NO_TTY)
181 check_for_libcrypt_later=1
182 AC_DEFINE(DONT_TRY_OTHER_AF)
183 AC_DEFINE(PAM_TTY_KLUDGE)
184 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
185 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
186 inet6_default_4in6=yes
188 mips-sony-bsd|mips-sony-newsos4)
189 AC_DEFINE(HAVE_NEWS4)
193 check_for_libcrypt_before=1
197 check_for_libcrypt_later=1
200 conf_lastlog_location="/usr/adm/lastlog"
201 conf_utmp_location=/etc/utmp
202 conf_wtmp_location=/usr/adm/wtmp
205 AC_DEFINE(BROKEN_REALPATH)
207 AC_DEFINE(BROKEN_SAVED_UIDS)
208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
213 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
215 AC_DEFINE(PAM_SUN_CODEBASE)
216 AC_DEFINE(LOGIN_NEEDS_UTMPX)
217 AC_DEFINE(LOGIN_NEEDS_TERM)
218 AC_DEFINE(PAM_TTY_KLUDGE)
219 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
220 # hardwire lastlog location (can't detect it on some versions)
221 conf_lastlog_location="/var/adm/lastlog"
222 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
223 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
224 if test "$sol2ver" -ge 8; then
226 AC_DEFINE(DISABLE_UTMP)
227 AC_DEFINE(DISABLE_WTMP)
233 CPPFLAGS="$CPPFLAGS -DSUNOS4"
234 AC_CHECK_FUNCS(getpwanam)
235 AC_DEFINE(PAM_SUN_CODEBASE)
236 conf_utmp_location=/etc/utmp
237 conf_wtmp_location=/var/adm/wtmp
238 conf_lastlog_location=/var/adm/lastlog
242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
248 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
249 # /usr/ucblib MUST NOT be searched on ReliantUNIX
250 LDFLAGS="$LDFLAGS -L/usr/local/lib"
251 IPADDR_IN_DISPLAY=yes
253 AC_DEFINE(IP_TOS_IS_BROKEN)
254 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
255 # Attention: always take care to bind libsocket and libnsl before libc,
256 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
259 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
260 LDFLAGS="$LDFLAGS -L/usr/local/lib"
264 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
265 LDFLAGS="$LDFLAGS -L/usr/local/lib"
269 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
270 LDFLAGS="$LDFLAGS -L/usr/local/lib"
273 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
275 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
278 AC_DEFINE(BROKEN_SYS_TERMIO_H)
280 AC_DEFINE(HAVE_SECUREWARE)
281 AC_DEFINE(DISABLE_SHADOW)
282 AC_DEFINE(BROKEN_SAVED_UIDS)
283 AC_CHECK_FUNCS(getluid setluid)
285 do_sco3_extra_lib_check=yes
288 if test -z "$GCC"; then
289 CFLAGS="$CFLAGS -belf"
291 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
292 LDFLAGS="$LDFLAGS -L/usr/local/lib"
293 LIBS="$LIBS -lprot -lx -ltinfo -lm"
296 AC_DEFINE(HAVE_SECUREWARE)
297 AC_DEFINE(DISABLE_SHADOW)
298 AC_DEFINE(DISABLE_FD_PASSING)
299 AC_CHECK_FUNCS(getluid setluid)
304 AC_DEFINE(DISABLE_FD_PASSING)
306 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
311 AC_DEFINE(DISABLE_FD_PASSING)
312 AC_DEFINE(NO_SSH_LASTLOG)
313 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
314 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
318 AC_MSG_CHECKING(for Digital Unix SIA)
321 [ --with-osfsia Enable Digital Unix SIA],
323 if test "x$withval" = "xno" ; then
324 AC_MSG_RESULT(disabled)
329 if test -z "$no_osfsia" ; then
330 if test -f /etc/sia/matrix.conf; then
332 AC_DEFINE(HAVE_OSF_SIA)
333 AC_DEFINE(DISABLE_LOGIN)
334 AC_DEFINE(DISABLE_FD_PASSING)
335 LIBS="$LIBS -lsecurity -ldb -lm -laud"
340 AC_DEFINE(DISABLE_FD_PASSING)
345 AC_DEFINE(NO_X11_UNIX_SOCKETS)
346 AC_DEFINE(MISSING_NFDBITS)
347 AC_DEFINE(MISSING_HOWMANY)
348 AC_DEFINE(MISSING_FD_MASK)
352 # Allow user to specify flags
354 [ --with-cflags Specify additional flags to pass to compiler],
356 if test "x$withval" != "xno" ; then
357 CFLAGS="$CFLAGS $withval"
361 AC_ARG_WITH(cppflags,
362 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
364 if test "x$withval" != "xno"; then
365 CPPFLAGS="$CPPFLAGS $withval"
370 [ --with-ldflags Specify additional flags to pass to linker],
372 if test "x$withval" != "xno" ; then
373 LDFLAGS="$LDFLAGS $withval"
378 [ --with-libs Specify additional libraries to link with],
380 if test "x$withval" != "xno" ; then
381 LIBS="$LIBS $withval"
386 # Checks for header files.
387 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
388 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
389 login_cap.h maillock.h netdb.h netgroup.h \
390 netinet/in_systm.h paths.h pty.h readpassphrase.h \
391 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
392 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
393 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
394 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
395 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
396 util.h utime.h utmp.h utmpx.h)
398 # Checks for libraries.
399 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
400 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
402 dnl SCO OS3 needs this for libwrap
403 if test "x$with_tcp_wrappers" != "xno" ; then
404 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
405 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
409 AC_CHECK_FUNC(getspnam, ,
410 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
413 [ --without-rpath Disable auto-added -R linker paths],
415 if test "x$withval" = "xno" ; then
418 if test "x$withval" = "xyes" ; then
426 [ --with-zlib=PATH Use zlib in PATH],
428 if test "x$withval" = "xno" ; then
429 AC_MSG_ERROR([*** zlib is required ***])
431 if test -d "$withval/lib"; then
432 if test -n "${need_dash_r}"; then
433 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
435 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
438 if test -n "${need_dash_r}"; then
439 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
441 LDFLAGS="-L${withval} ${LDFLAGS}"
444 if test -d "$withval/include"; then
445 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
447 CPPFLAGS="-I${withval} ${CPPFLAGS}"
452 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
455 AC_CHECK_FUNC(strcasecmp,
456 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
458 AC_CHECK_FUNC(utimes,
459 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
460 LIBS="$LIBS -lc89"]) ]
463 dnl Checks for libutil functions
464 AC_CHECK_HEADERS(libutil.h)
465 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
466 AC_CHECK_FUNCS(logout updwtmp logwtmp)
470 # Check for ALTDIRFUNC glob() extension
471 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
472 AC_EGREP_CPP(FOUNDIT,
475 #ifdef GLOB_ALTDIRFUNC
480 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
488 # Check for g.gl_matchc glob() extension
489 AC_MSG_CHECKING(for gl_matchc field in glob_t)
490 AC_EGREP_CPP(FOUNDIT,
493 int main(void){glob_t g; g.gl_matchc = 1;}
496 AC_DEFINE(GLOB_HAS_GL_MATCHC)
504 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
507 #include <sys/types.h>
509 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
511 [AC_MSG_RESULT(yes)],
514 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
518 # Check whether the user wants GSSAPI mechglue support
519 AC_ARG_WITH(mechglue,
520 [ --with-mechglue=PATH Build with GSSAPI mechglue library],
522 AC_MSG_CHECKING(for mechglue library)
524 if test -e ${withval}/libgssapi.a ; then
525 mechglue_lib=${withval}/libgssapi.a
526 elif test -e ${withval}/lib/libgssapi.a ; then
527 mechglue_lib=${withval}/lib/libgssapi.a
529 AC_MSG_ERROR("Can't find libgssapi in ${withval}");
531 LIBS="$LIBS ${mechglue_lib}"
532 AC_MSG_RESULT(${mechglue_lib})
534 # if test -e ${withval}/gssapi.h ; then
535 # CPPFLAGS="$CPPFLAGS -I${withval}"
536 # elif test -e ${withval}/include/gssapi.h ; then
537 # CPPFLAGS="$CPPFLAGS -I${withval}/include"
539 # AC_MSG_ERROR("Can't find gssapi.h in ${withval}");
542 AC_CHECK_LIB(dl, dlopen, , )
543 if test $ac_cv_lib_dl_dlopen = yes; then
544 LDFLAGS="$LDFLAGS -ldl -Wl,-Bsymbolic"
549 AC_DEFINE(HAVE_GSSAPI_EXT)
556 # Check whether the user wants GSI (Globus) support
559 [ --with-gsi=PATH Enable GSI/Globus authentication support],
566 [ --with-globus=PATH Enable GSI/Globus authentication support],
572 # Check whether the user has a Globus flavor type
573 globus_flavor_type="no"
574 AC_ARG_WITH(globus-flavor,
575 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
577 globus_flavor_type="$withval"
581 if test "x$gsi_path" != "xno" ; then
582 # Globus GSSAPI configuration
585 if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
586 AC_MSG_ERROR([Previously configured GSSAPI library conflicts with Globus/GSI.])
588 if test -z "$GSSAPI"; then
593 # Find GLOBUS/GSI installation Directory
595 AC_MSG_CHECKING(for Globus installation)
596 globus_dev_dir=$gsi_path
597 if test "x$globus_dev_dir" = "xyes" ; then
598 AC_MSG_ERROR(Cannot find Globus installation -- a path must be specified!)
600 AC_MSG_RESULT($globus_dev_dir)
602 # Find GLOBUS/GSI flavor Directory
604 AC_MSG_CHECKING(for Globus flavor)
605 if test "x$globus_flavor_type" = "xno" ; then
606 AC_MSG_ERROR(No Globus flavor type specified)
607 elif test "x$globus_flavor_type" = "xyes" ; then
608 AC_MSG_ERROR(No Globus flavor type specified)
610 AC_DEFINE(HAVE_GSSAPI_EXT)
611 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
612 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
613 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
615 GSI_CPPFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
617 AC_MSG_RESULT($globus_flavor_type)
619 # Build possible libraries off of the flavor name
621 libglobus_gss_assist="${gsi_path}/lib/libglobus_gss_assist_${globus_flavor_type}.a"
622 libglobus_gssapi_gsi="${gsi_path}/lib/libglobus_gssapi_gsi_${globus_flavor_type}.a"
624 # Test that the base gss_assist library is present
626 if test -r ${libglobus_gss_assist} ; then
627 LIBS="$LIBS ${libglobus_gss_assist}"
629 AC_MSG_ERROR([*** libglobus_gss_assist missing])
632 AC_MSG_CHECKING(for libglobus_gss_assist)
640 AC_MSG_ERROR([*** libglobus_gss_assist missing])
644 # If we aren't using mechglue, test that gssapi_gsi is present
645 if test "$GSSAPI" != "mechglue"; then
646 if test -r ${libglobus_gssapi_gsi} ; then
647 LIBS="$LIBS ${libglobus_gssapi_gsi}"
649 AC_MSG_ERROR([*** libglobus_gssapi_gsi missing])
653 AC_MSG_CHECKING(for libglobus_gssapi_gsi)
661 AC_MSG_ERROR([*** libglobus_gssapi_gsi missing])
665 CPPFLAGS="$CPPFLAGS $GSI_CPPFLAGS"
667 # End Globus/GSI section
669 # Check whether user wants S/Key support
672 [ --with-skey[[=PATH]] Enable S/Key support
673 (optionally in PATH)],
675 if test "x$withval" != "xno" ; then
677 if test "x$withval" != "xyes" ; then
678 CPPFLAGS="$CPPFLAGS -I${withval}/include"
679 LDFLAGS="$LDFLAGS -L${withval}/lib"
686 AC_MSG_CHECKING([for s/key support])
691 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
693 [AC_MSG_RESULT(yes)],
696 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
702 # Check whether user wants TCP wrappers support
704 AC_ARG_WITH(tcp-wrappers,
705 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
706 (optionally in PATH)],
708 if test "x$withval" != "xno" ; then
710 saved_LDFLAGS="$LDFLAGS"
711 saved_CPPFLAGS="$CPPFLAGS"
712 if test -n "${withval}" -a "${withval}" != "yes"; then
713 if test -d "${withval}/lib"; then
714 if test -n "${need_dash_r}"; then
715 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
717 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
720 if test -n "${need_dash_r}"; then
721 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
723 LDFLAGS="-L${withval} ${LDFLAGS}"
726 if test -d "${withval}/include"; then
727 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
729 CPPFLAGS="-I${withval} ${CPPFLAGS}"
733 LIBS="$LIBWRAP $LIBS"
734 AC_MSG_CHECKING(for libwrap)
738 int deny_severity = 0, allow_severity = 0;
748 AC_MSG_ERROR([*** libwrap missing])
756 dnl Checks for library functions. Please keep in alphabetical order
758 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
759 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
760 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
761 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
762 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
763 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
764 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
765 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
766 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
767 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
768 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
771 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
773 dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
774 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
776 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
777 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
778 AC_CHECK_LIB(gen, dirname,[
779 AC_CACHE_CHECK([for broken dirname],
780 ac_cv_have_broken_dirname, [
788 int main(int argc, char **argv) {
791 strncpy(buf,"/etc", 32);
793 if (!s || strncmp(s, "/", 32) != 0) {
800 [ ac_cv_have_broken_dirname="no" ],
801 [ ac_cv_have_broken_dirname="yes" ]
805 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
807 AC_DEFINE(HAVE_DIRNAME)
808 AC_CHECK_HEADERS(libgen.h)
813 dnl Checks for time functions
814 AC_CHECK_FUNCS(gettimeofday time)
815 dnl Checks for utmp functions
816 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
817 AC_CHECK_FUNCS(utmpname)
818 dnl Checks for utmpx functions
819 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
820 AC_CHECK_FUNCS(setutxent utmpxname)
822 AC_CHECK_FUNC(daemon,
823 [AC_DEFINE(HAVE_DAEMON)],
824 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
827 AC_CHECK_FUNC(getpagesize,
828 [AC_DEFINE(HAVE_GETPAGESIZE)],
829 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
832 # Check for broken snprintf
833 if test "x$ac_cv_func_snprintf" = "xyes" ; then
834 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
838 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
840 [AC_MSG_RESULT(yes)],
843 AC_DEFINE(BROKEN_SNPRINTF)
844 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
849 dnl see whether mkstemp() requires XXXXXX
850 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
851 AC_MSG_CHECKING([for (overly) strict mkstemp])
855 main() { char template[]="conftest.mkstemp-test";
856 if (mkstemp(template) == -1)
858 unlink(template); exit(0);
866 AC_DEFINE(HAVE_STRICT_MKSTEMP)
870 AC_DEFINE(HAVE_STRICT_MKSTEMP)
880 [ --with-pam Enable PAM support ],
882 if test "x$withval" != "xno" ; then
883 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
884 AC_MSG_ERROR([PAM headers not found])
887 AC_CHECK_LIB(dl, dlopen, , )
888 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
889 AC_CHECK_FUNCS(pam_getenvlist)
890 AC_CHECK_FUNCS(pam_putenv)
896 if test $ac_cv_lib_dl_dlopen = yes; then
907 # Check for older PAM
908 if test "x$PAM_MSG" = "xyes" ; then
909 # Check PAM strerror arguments (old PAM)
910 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
914 #include <security/pam_appl.h>
916 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
919 AC_DEFINE(HAVE_OLD_PAM)
921 PAM_MSG="yes (old library)"
926 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
927 # because the system crypt() is more featureful.
928 if test "x$check_for_libcrypt_before" = "x1"; then
929 AC_CHECK_LIB(crypt, crypt)
933 saved_CPPFLAGS="$CPPFLAGS"
934 saved_LDFLAGS="$LDFLAGS"
936 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
938 if test "x$withval" != "xno" ; then
939 if test -d "$withval/lib"; then
940 if test -n "${need_dash_r}"; then
941 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
943 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
946 if test -n "${need_dash_r}"; then
947 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
949 LDFLAGS="-L${withval} ${LDFLAGS}"
952 if test -d "$withval/include"; then
953 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
955 CPPFLAGS="-I${withval} ${CPPFLAGS}"
961 # Patch up SSL libraries for GSI authentication as needed
962 if test "x$globus_flavor_type" != "xno" ; then
964 # For Globus 2, always link with the static libraries
967 libssl_utils="${gsi_path}/lib/libglobus_ssl_utils_${globus_flavor_type}.a"
970 # Trouble arrives at GT 2.1.3+ with the reorg of globus_ssl_utils. Compensating for
971 # the new library linking required here through file tests to see which libraries to
975 libgsi_proxy_core="${gsi_path}/lib/libglobus_gsi_proxy_core_${globus_flavor_type}.a"
976 libgsi_credential="${gsi_path}/lib/libglobus_gsi_credential_${globus_flavor_type}.a"
977 libgsi_callback="${gsi_path}/lib/libglobus_gsi_callback_${globus_flavor_type}.a"
978 liboldgaa="${gsi_path}/lib/libglobus_oldgaa_${globus_flavor_type}.a"
979 libgsi_sysconfig="${gsi_path}/lib/libglobus_gsi_sysconfig_${globus_flavor_type}.a"
980 libproxy_ssl="${gsi_path}/lib/libglobus_proxy_ssl_${globus_flavor_type}.a"
981 libgsi_cert_utils="${gsi_path}/lib/libglobus_gsi_cert_utils_${globus_flavor_type}.a"
982 libopenssl_error="${gsi_path}/lib/libglobus_openssl_error_${globus_flavor_type}.a"
983 libopenssl="${gsi_path}/lib/libglobus_openssl_${globus_flavor_type}.a"
985 if test -r ${libgsi_proxy_core} \
986 -a -r ${libgsi_credential} \
987 -a -r ${libgsi_callback} \
989 -a -r ${libgsi_sysconfig} \
990 -a -r ${libproxy_ssl} \
991 -a -r ${libgsi_cert_utils} \
992 -a -r ${libopenssl_error} \
993 -a -r ${libopenssl} ; then
994 LIBS="$LIBS ${libgsi_proxy_core}"
995 LIBS="$LIBS ${libgsi_credential}"
996 LIBS="$LIBS ${libgsi_callback}"
997 LIBS="$LIBS ${liboldgaa}"
998 LIBS="$LIBS ${libgsi_sysconfig}"
999 LIBS="$LIBS ${libproxy_ssl}"
1000 LIBS="$LIBS ${libgsi_cert_utils}"
1001 LIBS="$LIBS ${libopenssl_error}"
1002 LIBS="$LIBS ${libopenssl}"
1003 elif test -r ${libssl_utils}; then
1004 LIBS="$LIBS ${libssl_utils}"
1006 AC_MSG_ERROR([*** missing one or more Globus GSI libraries])
1009 AC_MSG_CHECKING(for Globus GSI libraries)
1017 AC_MSG_ERROR([*** missing one or more Globus GSI libraries])
1022 # Standard openssl libraries. They need to appear near the end of the link line.
1025 LIBS="$LIBS ${gsi_path}/lib/libssl_${globus_flavor_type}.a"
1026 LIBS="$LIBS ${gsi_path}/lib/libcrypto_${globus_flavor_type}.a"
1028 AC_MSG_CHECKING(for Globus OpenSSL libraries)
1036 AC_MSG_ERROR([*** missing one or more Globus OpenSSL libraries])
1041 # Another "GT 2.1.3+"ism.
1044 libcommon_path="${gsi_path}/lib/libglobus_common_${globus_flavor_type}.a"
1045 if test -r ${libcommon_path}; then
1046 LIBS="$LIBS ${libcommon_path}"
1047 AC_MSG_CHECKING(for libglobus_common)
1055 AC_MSG_ERROR([*** libglobus_common missing])
1060 if test "x$gsi_path" != "xno" ; then
1061 # Older GSI needs -lssl too
1062 LIBS="$LIBS -lssl -lcrypto"
1063 else # if no GSI authentication (i.e., OpenSSL default)
1064 LIBS="$LIBS -lcrypto"
1066 fi # globus_flavor_type
1068 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1070 dnl Check default openssl install dir
1071 if test -n "${need_dash_r}"; then
1072 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
1074 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
1076 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1077 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1079 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1085 # Determine OpenSSL header version
1086 AC_MSG_CHECKING([OpenSSL header version])
1091 #include <openssl/opensslv.h>
1092 #define DATA "conftest.sslincver"
1097 fd = fopen(DATA,"w");
1101 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1108 ssl_header_ver=`cat conftest.sslincver`
1109 AC_MSG_RESULT($ssl_header_ver)
1112 AC_MSG_RESULT(not found)
1113 AC_MSG_ERROR(OpenSSL version header not found.)
1117 # Determine OpenSSL library version
1118 AC_MSG_CHECKING([OpenSSL library version])
1123 #include <openssl/opensslv.h>
1124 #include <openssl/crypto.h>
1125 #define DATA "conftest.ssllibver"
1130 fd = fopen(DATA,"w");
1134 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1141 ssl_library_ver=`cat conftest.ssllibver`
1142 AC_MSG_RESULT($ssl_library_ver)
1145 AC_MSG_RESULT(not found)
1146 AC_MSG_ERROR(OpenSSL library not found.)
1150 # Sanity check OpenSSL headers
1151 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1155 #include <openssl/opensslv.h>
1156 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1163 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
1167 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1168 # version in OpenSSL. Skip this for PAM
1169 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
1170 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1174 ### Configure cryptographic random number support
1176 # Check wheter OpenSSL seeds itself
1177 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1181 #include <openssl/rand.h>
1182 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1185 OPENSSL_SEEDS_ITSELF=yes
1190 # Default to use of the rand helper if OpenSSL doesn't
1197 # Do we want to force the use of the rand helper?
1198 AC_ARG_WITH(rand-helper,
1199 [ --with-rand-helper Use subprocess to gather strong randomness ],
1201 if test "x$withval" = "xno" ; then
1202 # Force use of OpenSSL's internal RNG, even if
1203 # the previous test showed it to be unseeded.
1204 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1205 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1206 OPENSSL_SEEDS_ITSELF=yes
1215 # Which randomness source do we use?
1216 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1218 AC_DEFINE(OPENSSL_PRNG_ONLY)
1219 RAND_MSG="OpenSSL internal ONLY"
1220 INSTALL_SSH_RAND_HELPER=""
1221 elif test ! -z "$USE_RAND_HELPER" ; then
1222 # install rand helper
1223 RAND_MSG="ssh-rand-helper"
1224 INSTALL_SSH_RAND_HELPER="yes"
1226 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1228 ### Configuration of ssh-rand-helper
1231 AC_ARG_WITH(prngd-port,
1232 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1241 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1244 if test ! -z "$withval" ; then
1245 PRNGD_PORT="$withval"
1246 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1251 # PRNGD Unix domain socket
1252 AC_ARG_WITH(prngd-socket,
1253 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1257 withval="/var/run/egd-pool"
1265 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1269 if test ! -z "$withval" ; then
1270 if test ! -z "$PRNGD_PORT" ; then
1271 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1273 if test ! -r "$withval" ; then
1274 AC_MSG_WARN(Entropy socket is not readable)
1276 PRNGD_SOCKET="$withval"
1277 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1281 # Check for existing socket only if we don't have a random device already
1282 if test "$USE_RAND_HELPER" = yes ; then
1283 AC_MSG_CHECKING(for PRNGD/EGD socket)
1284 # Insert other locations here
1285 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1286 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1287 PRNGD_SOCKET="$sock"
1288 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1292 if test ! -z "$PRNGD_SOCKET" ; then
1293 AC_MSG_RESULT($PRNGD_SOCKET)
1295 AC_MSG_RESULT(not found)
1301 # Change default command timeout for hashing entropy source
1303 AC_ARG_WITH(entropy-timeout,
1304 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1306 if test "x$withval" != "xno" ; then
1307 entropy_timeout=$withval
1311 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1313 SSH_PRIVSEP_USER=sshd
1314 AC_ARG_WITH(privsep-user,
1315 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1317 if test -n "$withval"; then
1318 SSH_PRIVSEP_USER=$withval
1322 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1323 AC_SUBST(SSH_PRIVSEP_USER)
1325 # We do this little dance with the search path to insure
1326 # that programs that we select for use by installed programs
1327 # (which may be run by the super-user) come from trusted
1328 # locations before they come from the user's private area.
1329 # This should help avoid accidentally configuring some
1330 # random version of a program in someone's personal bin.
1334 test -h /bin 2> /dev/null && PATH=/usr/bin
1335 test -d /sbin && PATH=$PATH:/sbin
1336 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1337 PATH=$PATH:/etc:$OPATH
1339 # These programs are used by the command hashing source to gather entropy
1340 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1341 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1342 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1343 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1344 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1345 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1346 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1347 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1348 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1349 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1350 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1351 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1352 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1353 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1354 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1355 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1359 # Where does ssh-rand-helper get its randomness from?
1360 INSTALL_SSH_PRNG_CMDS=""
1361 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1362 if test ! -z "$PRNGD_PORT" ; then
1363 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1364 elif test ! -z "$PRNGD_SOCKET" ; then
1365 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1367 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1368 RAND_HELPER_CMDHASH=yes
1369 INSTALL_SSH_PRNG_CMDS="yes"
1372 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1375 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1376 if test ! -z "$SONY" ; then
1377 LIBS="$LIBS -liberty";
1380 # Checks for data types
1381 AC_CHECK_SIZEOF(char, 1)
1382 AC_CHECK_SIZEOF(short int, 2)
1383 AC_CHECK_SIZEOF(int, 4)
1384 AC_CHECK_SIZEOF(long int, 4)
1385 AC_CHECK_SIZEOF(long long int, 8)
1387 # Sanity check long long for some platforms (AIX)
1388 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1389 ac_cv_sizeof_long_long_int=0
1392 # More checks for data types
1393 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1395 [ #include <sys/types.h> ],
1397 [ ac_cv_have_u_int="yes" ],
1398 [ ac_cv_have_u_int="no" ]
1401 if test "x$ac_cv_have_u_int" = "xyes" ; then
1402 AC_DEFINE(HAVE_U_INT)
1406 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1408 [ #include <sys/types.h> ],
1409 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1410 [ ac_cv_have_intxx_t="yes" ],
1411 [ ac_cv_have_intxx_t="no" ]
1414 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1415 AC_DEFINE(HAVE_INTXX_T)
1419 if (test -z "$have_intxx_t" && \
1420 test "x$ac_cv_header_stdint_h" = "xyes")
1422 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1424 [ #include <stdint.h> ],
1425 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1427 AC_DEFINE(HAVE_INTXX_T)
1430 [ AC_MSG_RESULT(no) ]
1434 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1437 #include <sys/types.h>
1438 #ifdef HAVE_STDINT_H
1439 # include <stdint.h>
1441 #include <sys/socket.h>
1442 #ifdef HAVE_SYS_BITYPES_H
1443 # include <sys/bitypes.h>
1446 [ int64_t a; a = 1;],
1447 [ ac_cv_have_int64_t="yes" ],
1448 [ ac_cv_have_int64_t="no" ]
1451 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1452 AC_DEFINE(HAVE_INT64_T)
1455 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1457 [ #include <sys/types.h> ],
1458 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1459 [ ac_cv_have_u_intxx_t="yes" ],
1460 [ ac_cv_have_u_intxx_t="no" ]
1463 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1464 AC_DEFINE(HAVE_U_INTXX_T)
1468 if test -z "$have_u_intxx_t" ; then
1469 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1471 [ #include <sys/socket.h> ],
1472 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1474 AC_DEFINE(HAVE_U_INTXX_T)
1477 [ AC_MSG_RESULT(no) ]
1481 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1483 [ #include <sys/types.h> ],
1484 [ u_int64_t a; a = 1;],
1485 [ ac_cv_have_u_int64_t="yes" ],
1486 [ ac_cv_have_u_int64_t="no" ]
1489 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1490 AC_DEFINE(HAVE_U_INT64_T)
1494 if test -z "$have_u_int64_t" ; then
1495 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1497 [ #include <sys/bitypes.h> ],
1498 [ u_int64_t a; a = 1],
1500 AC_DEFINE(HAVE_U_INT64_T)
1503 [ AC_MSG_RESULT(no) ]
1507 if test -z "$have_u_intxx_t" ; then
1508 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1511 #include <sys/types.h>
1513 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1514 [ ac_cv_have_uintxx_t="yes" ],
1515 [ ac_cv_have_uintxx_t="no" ]
1518 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1519 AC_DEFINE(HAVE_UINTXX_T)
1523 if test -z "$have_uintxx_t" ; then
1524 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1526 [ #include <stdint.h> ],
1527 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1529 AC_DEFINE(HAVE_UINTXX_T)
1532 [ AC_MSG_RESULT(no) ]
1536 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1537 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1539 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1542 #include <sys/bitypes.h>
1545 int8_t a; int16_t b; int32_t c;
1546 u_int8_t e; u_int16_t f; u_int32_t g;
1547 a = b = c = e = f = g = 1;
1550 AC_DEFINE(HAVE_U_INTXX_T)
1551 AC_DEFINE(HAVE_INTXX_T)
1559 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1562 #include <sys/types.h>
1564 [ u_char foo; foo = 125; ],
1565 [ ac_cv_have_u_char="yes" ],
1566 [ ac_cv_have_u_char="no" ]
1569 if test "x$ac_cv_have_u_char" = "xyes" ; then
1570 AC_DEFINE(HAVE_U_CHAR)
1575 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1577 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1580 #include <sys/types.h>
1582 [ size_t foo; foo = 1235; ],
1583 [ ac_cv_have_size_t="yes" ],
1584 [ ac_cv_have_size_t="no" ]
1587 if test "x$ac_cv_have_size_t" = "xyes" ; then
1588 AC_DEFINE(HAVE_SIZE_T)
1591 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1594 #include <sys/types.h>
1596 [ ssize_t foo; foo = 1235; ],
1597 [ ac_cv_have_ssize_t="yes" ],
1598 [ ac_cv_have_ssize_t="no" ]
1601 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1602 AC_DEFINE(HAVE_SSIZE_T)
1605 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1610 [ clock_t foo; foo = 1235; ],
1611 [ ac_cv_have_clock_t="yes" ],
1612 [ ac_cv_have_clock_t="no" ]
1615 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1616 AC_DEFINE(HAVE_CLOCK_T)
1619 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1622 #include <sys/types.h>
1623 #include <sys/socket.h>
1625 [ sa_family_t foo; foo = 1235; ],
1626 [ ac_cv_have_sa_family_t="yes" ],
1629 #include <sys/types.h>
1630 #include <sys/socket.h>
1631 #include <netinet/in.h>
1633 [ sa_family_t foo; foo = 1235; ],
1634 [ ac_cv_have_sa_family_t="yes" ],
1636 [ ac_cv_have_sa_family_t="no" ]
1640 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1641 AC_DEFINE(HAVE_SA_FAMILY_T)
1644 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1647 #include <sys/types.h>
1649 [ pid_t foo; foo = 1235; ],
1650 [ ac_cv_have_pid_t="yes" ],
1651 [ ac_cv_have_pid_t="no" ]
1654 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1655 AC_DEFINE(HAVE_PID_T)
1658 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1661 #include <sys/types.h>
1663 [ mode_t foo; foo = 1235; ],
1664 [ ac_cv_have_mode_t="yes" ],
1665 [ ac_cv_have_mode_t="no" ]
1668 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1669 AC_DEFINE(HAVE_MODE_T)
1673 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1676 #include <sys/types.h>
1677 #include <sys/socket.h>
1679 [ struct sockaddr_storage s; ],
1680 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1681 [ ac_cv_have_struct_sockaddr_storage="no" ]
1684 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1685 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1688 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1691 #include <sys/types.h>
1692 #include <netinet/in.h>
1694 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1695 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1696 [ ac_cv_have_struct_sockaddr_in6="no" ]
1699 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1700 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1703 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1706 #include <sys/types.h>
1707 #include <netinet/in.h>
1709 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1710 [ ac_cv_have_struct_in6_addr="yes" ],
1711 [ ac_cv_have_struct_in6_addr="no" ]
1714 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1715 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1718 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1721 #include <sys/types.h>
1722 #include <sys/socket.h>
1725 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1726 [ ac_cv_have_struct_addrinfo="yes" ],
1727 [ ac_cv_have_struct_addrinfo="no" ]
1730 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1731 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1734 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1736 [ #include <sys/time.h> ],
1737 [ struct timeval tv; tv.tv_sec = 1;],
1738 [ ac_cv_have_struct_timeval="yes" ],
1739 [ ac_cv_have_struct_timeval="no" ]
1742 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1743 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1744 have_struct_timeval=1
1747 AC_CHECK_TYPES(struct timespec)
1749 # We need int64_t or else certian parts of the compile will fail.
1750 if test "x$ac_cv_have_int64_t" = "xno" -a \
1751 "x$ac_cv_sizeof_long_int" != "x8" -a \
1752 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1753 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1754 echo "an alternative compiler (I.E., GCC) before continuing."
1758 dnl test snprintf (broken on SCO w/gcc)
1763 #ifdef HAVE_SNPRINTF
1767 char expected_out[50];
1769 #if (SIZEOF_LONG_INT == 8)
1770 long int num = 0x7fffffffffffffff;
1772 long long num = 0x7fffffffffffffffll;
1774 strcpy(expected_out, "9223372036854775807");
1775 snprintf(buf, mazsize, "%lld", num);
1776 if(strcmp(buf, expected_out) != 0)
1783 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1787 dnl Checks for structure members
1788 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1789 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1790 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1791 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1792 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1793 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1794 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1795 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1796 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1797 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1798 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1799 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1800 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1801 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1802 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1803 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1804 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1806 AC_CHECK_MEMBERS([struct stat.st_blksize])
1808 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1809 ac_cv_have_ss_family_in_struct_ss, [
1812 #include <sys/types.h>
1813 #include <sys/socket.h>
1815 [ struct sockaddr_storage s; s.ss_family = 1; ],
1816 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1817 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1820 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1821 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1824 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1825 ac_cv_have___ss_family_in_struct_ss, [
1828 #include <sys/types.h>
1829 #include <sys/socket.h>
1831 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1832 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1833 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1836 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1837 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1840 AC_CACHE_CHECK([for pw_class field in struct passwd],
1841 ac_cv_have_pw_class_in_struct_passwd, [
1846 [ struct passwd p; p.pw_class = 0; ],
1847 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1848 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1851 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1852 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1855 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1856 ac_cv_have_pw_expire_in_struct_passwd, [
1861 [ struct passwd p; p.pw_expire = 0; ],
1862 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1863 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1866 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1867 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1870 AC_CACHE_CHECK([for pw_change field in struct passwd],
1871 ac_cv_have_pw_change_in_struct_passwd, [
1876 [ struct passwd p; p.pw_change = 0; ],
1877 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1878 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1881 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1882 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1885 dnl make sure we're using the real structure members and not defines
1886 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1887 ac_cv_have_accrights_in_msghdr, [
1890 #include <sys/types.h>
1891 #include <sys/socket.h>
1892 #include <sys/uio.h>
1894 #ifdef msg_accrights
1898 m.msg_accrights = 0;
1902 [ ac_cv_have_accrights_in_msghdr="yes" ],
1903 [ ac_cv_have_accrights_in_msghdr="no" ]
1906 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1907 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1910 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1911 ac_cv_have_control_in_msghdr, [
1914 #include <sys/types.h>
1915 #include <sys/socket.h>
1916 #include <sys/uio.h>
1926 [ ac_cv_have_control_in_msghdr="yes" ],
1927 [ ac_cv_have_control_in_msghdr="no" ]
1930 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1931 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1934 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1936 [ extern char *__progname; printf("%s", __progname); ],
1937 [ ac_cv_libc_defines___progname="yes" ],
1938 [ ac_cv_libc_defines___progname="no" ]
1941 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1942 AC_DEFINE(HAVE___PROGNAME)
1945 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1949 [ printf("%s", __FUNCTION__); ],
1950 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1951 [ ac_cv_cc_implements___FUNCTION__="no" ]
1954 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1955 AC_DEFINE(HAVE___FUNCTION__)
1958 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1962 [ printf("%s", __func__); ],
1963 [ ac_cv_cc_implements___func__="yes" ],
1964 [ ac_cv_cc_implements___func__="no" ]
1967 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1968 AC_DEFINE(HAVE___func__)
1971 AC_CACHE_CHECK([whether getopt has optreset support],
1972 ac_cv_have_getopt_optreset, [
1977 [ extern int optreset; optreset = 0; ],
1978 [ ac_cv_have_getopt_optreset="yes" ],
1979 [ ac_cv_have_getopt_optreset="no" ]
1982 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1983 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1986 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1988 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1989 [ ac_cv_libc_defines_sys_errlist="yes" ],
1990 [ ac_cv_libc_defines_sys_errlist="no" ]
1993 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1994 AC_DEFINE(HAVE_SYS_ERRLIST)
1998 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
2000 [ extern int sys_nerr; printf("%i", sys_nerr);],
2001 [ ac_cv_libc_defines_sys_nerr="yes" ],
2002 [ ac_cv_libc_defines_sys_nerr="no" ]
2005 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2006 AC_DEFINE(HAVE_SYS_NERR)
2011 # Check whether user wants sectok support
2013 [ --with-sectok Enable smartcard support using libsectok],
2015 if test "x$withval" != "xno" ; then
2016 if test "x$withval" != "xyes" ; then
2017 CPPFLAGS="$CPPFLAGS -I${withval}"
2018 LDFLAGS="$LDFLAGS -L${withval}"
2019 if test ! -z "$need_dash_r" ; then
2020 LDFLAGS="$LDFLAGS -R${withval}"
2022 if test ! -z "$blibpath" ; then
2023 blibpath="$blibpath:${withval}"
2026 AC_CHECK_HEADERS(sectok.h)
2027 if test "$ac_cv_header_sectok_h" != yes; then
2028 AC_MSG_ERROR(Can't find sectok.h)
2030 AC_CHECK_LIB(sectok, sectok_open)
2031 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2032 AC_MSG_ERROR(Can't find libsectok)
2034 AC_DEFINE(SMARTCARD)
2035 AC_DEFINE(USE_SECTOK)
2036 SCARD_MSG="yes, using sectok"
2041 # Check whether user wants OpenSC support
2043 AC_HELP_STRING([--with-opensc=PFX],
2044 [Enable smartcard support using OpenSC]),
2045 opensc_config_prefix="$withval", opensc_config_prefix="")
2046 if test x$opensc_config_prefix != x ; then
2047 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2048 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2049 if test "$OPENSC_CONFIG" != "no"; then
2050 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2051 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2052 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2053 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2054 AC_DEFINE(SMARTCARD)
2055 AC_DEFINE(USE_OPENSC)
2056 SCARD_MSG="yes, using OpenSC"
2060 # Check whether user wants Kerberos 5 support
2062 AC_ARG_WITH(kerberos5,
2063 [ --with-kerberos5=PATH Enable Kerberos 5 support],
2065 if test "x$withval" != "xno" ; then
2066 if test "x$withval" = "xyes" ; then
2067 KRB5ROOT="/usr/local"
2071 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
2072 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
2075 AC_MSG_CHECKING(whether we are using Heimdal)
2076 AC_TRY_COMPILE([ #include <krb5.h> ],
2077 [ char *tmp = heimdal_version; ],
2078 [ AC_MSG_RESULT(yes)
2080 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2083 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2086 if test ! -z "$need_dash_r" ; then
2087 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2089 if test ! -z "$blibpath" ; then
2090 blibpath="$blibpath:${KRB5ROOT}/lib"
2092 AC_CHECK_LIB(resolv, dn_expand, , )
2094 # If we're using some other GSSAPI
2095 if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
2096 AC_MSG_ERROR([$GSSAPI GSSAPI library conflicts with Kerberos support. Use mechglue instead.])
2098 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2100 K5LIBS="-lgssapi $K5LIBS" ],
2101 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2103 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
2104 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2109 AC_CHECK_HEADER(gssapi.h, ,
2110 [ unset ac_cv_header_gssapi_h
2111 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2112 AC_CHECK_HEADERS(gssapi.h, ,
2113 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2118 AC_CHECK_LIB(gssapi, gss_krb5_copy_ccache, /bin/true,
2119 [ K5LIBS="-lgssapi_krb5 $K5LIBS"
2120 AC_CHECK_LIB(gssapi_krb5, gss_krb5_copy_ccache, /bin/true,
2121 AC_MSG_WARN([Cannot find gss_krb5_copy_ccache -- build may fail]),
2127 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2128 AC_CHECK_HEADER(gssapi_krb5.h, ,
2129 [ CPPFLAGS="$oldCPP" ])
2131 if test -z "$GSSAPI"; then
2139 # Check whether user wants Kerberos 4 support
2141 AC_ARG_WITH(kerberos4,
2142 [ --with-kerberos4=PATH Enable Kerberos 4 support],
2144 if test "x$withval" != "xno" ; then
2145 if test "x$withval" != "xyes" ; then
2146 CPPFLAGS="$CPPFLAGS -I${withval}/include"
2147 LDFLAGS="$LDFLAGS -L${withval}/lib"
2148 if test ! -z "$need_dash_r" ; then
2149 LDFLAGS="$LDFLAGS -R${withval}/lib"
2151 if test ! -z "$blibpath" ; then
2152 blibpath="$blibpath:${withval}/lib"
2155 if test -d /usr/include/kerberosIV ; then
2156 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
2160 AC_CHECK_HEADERS(krb.h)
2161 if test "$ac_cv_header_krb_h" != yes; then
2162 AC_MSG_WARN([Cannot find krb.h, build may fail])
2164 AC_CHECK_LIB(krb, main)
2165 if test "$ac_cv_lib_krb_main" != yes; then
2166 AC_CHECK_LIB(krb4, main)
2167 if test "$ac_cv_lib_krb4_main" != yes; then
2168 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
2175 AC_CHECK_LIB(des, des_cbc_encrypt)
2176 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
2177 AC_CHECK_LIB(des425, des_cbc_encrypt)
2178 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
2179 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
2186 AC_CHECK_LIB(resolv, dn_expand, , )
2194 # Check whether user wants AFS_KRB5 support
2196 AC_ARG_WITH(afs-krb5,
2197 [ --with-afs-krb5[[=AKLOG_PATH]] Enable aklog to get token (default=/usr/bin/aklog).],
2199 if test "x$withval" != "xno" ; then
2201 if test "x$withval" != "xyes" ; then
2202 AC_DEFINE_UNQUOTED(AKLOG_PATH, "$withval")
2204 AC_DEFINE_UNQUOTED(AKLOG_PATH, "/usr/bin/aklog")
2207 if test -z "$KRB5" ; then
2208 AC_MSG_WARN([AFS_KRB5 requires Kerberos 5 support, build may fail])
2211 LIBS="-lkrbafs $LIBS"
2212 if test ! -z "$AFS_LIBS" ; then
2213 LIBS="$LIBS $AFS_LIBS"
2221 # Check whether user wants AFS support
2224 [ --with-afs=PATH Enable AFS support],
2226 if test "x$withval" != "xno" ; then
2228 if test "x$withval" != "xyes" ; then
2229 CPPFLAGS="$CPPFLAGS -I${withval}/include"
2230 LDFLAGS="$LDFLAGS -L${withval}/lib"
2233 if test -z "$KRB4" ; then
2234 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
2238 if test ! -z "$AFS_LIBS" ; then
2239 LIBS="$LIBS $AFS_LIBS"
2246 LIBS="$LIBS $KLIBS $K5LIBS"
2248 # Looking for programs, paths and files
2250 PRIVSEP_PATH=/var/empty
2251 AC_ARG_WITH(privsep-path,
2252 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
2254 if test "x$withval" != "$no" ; then
2255 PRIVSEP_PATH=$withval
2259 AC_SUBST(PRIVSEP_PATH)
2262 [ --with-xauth=PATH Specify path to xauth program ],
2264 if test "x$withval" != "xno" ; then
2270 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2271 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2272 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2273 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2274 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
2275 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
2276 xauth_path="/usr/openwin/bin/xauth"
2282 AC_ARG_ENABLE(strip,
2283 [ --disable-strip Disable calling strip(1) on install],
2285 if test "x$enableval" = "xno" ; then
2292 if test -z "$xauth_path" ; then
2293 XAUTH_PATH="undefined"
2294 AC_SUBST(XAUTH_PATH)
2296 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
2297 XAUTH_PATH=$xauth_path
2298 AC_SUBST(XAUTH_PATH)
2301 # Check for mail directory (last resort if we cannot get it from headers)
2302 if test ! -z "$MAIL" ; then
2303 maildir=`dirname $MAIL`
2304 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2307 if test -z "$no_dev_ptmx" ; then
2308 if test "x$disable_ptmx_check" != "xyes" ; then
2309 AC_CHECK_FILE("/dev/ptmx",
2311 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2317 AC_CHECK_FILE("/dev/ptc",
2319 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2324 # Options from here on. Some of these are preset by platform above
2325 AC_ARG_WITH(mantype,
2326 [ --with-mantype=man|cat|doc Set man page type],
2333 AC_MSG_ERROR(invalid man type: $withval)
2338 if test -z "$MANTYPE"; then
2339 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2340 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2341 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2343 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2350 if test "$MANTYPE" = "doc"; then
2357 # Check whether to enable MD5 passwords
2359 AC_ARG_WITH(md5-passwords,
2360 [ --with-md5-passwords Enable use of MD5 passwords],
2362 if test "x$withval" != "xno" ; then
2363 AC_DEFINE(HAVE_MD5_PASSWORDS)
2369 # Whether to disable shadow password support
2371 [ --without-shadow Disable shadow password support],
2373 if test "x$withval" = "xno" ; then
2374 AC_DEFINE(DISABLE_SHADOW)
2380 if test -z "$disable_shadow" ; then
2381 AC_MSG_CHECKING([if the systems has expire shadow information])
2384 #include <sys/types.h>
2387 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2388 [ sp_expire_available=yes ], []
2391 if test "x$sp_expire_available" = "xyes" ; then
2393 AC_DEFINE(HAS_SHADOW_EXPIRE)
2399 # Use ip address instead of hostname in $DISPLAY
2400 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2401 DISPLAY_HACK_MSG="yes"
2402 AC_DEFINE(IPADDR_IN_DISPLAY)
2404 DISPLAY_HACK_MSG="no"
2405 AC_ARG_WITH(ipaddr-display,
2406 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2408 if test "x$withval" != "xno" ; then
2409 AC_DEFINE(IPADDR_IN_DISPLAY)
2410 DISPLAY_HACK_MSG="yes"
2416 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2417 if test $ac_cv_func_login_getcapbool = "yes" -a \
2418 $ac_cv_header_login_cap_h = "yes" ; then
2421 # Whether to mess with the default path
2422 SERVER_PATH_MSG="(default)"
2423 AC_ARG_WITH(default-path,
2424 [ --with-default-path= Specify default \$PATH environment for server],
2426 if test "$USES_LOGIN_CONF" = "yes" ; then
2428 --with-default-path=PATH has no effect on this system.
2429 Edit /etc/login.conf instead.])
2430 elif test "x$withval" != "xno" ; then
2431 user_path="$withval"
2432 SERVER_PATH_MSG="$withval"
2435 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2436 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2440 /* find out what STDPATH is */
2445 #ifndef _PATH_STDPATH
2446 # ifdef _PATH_USERPATH /* Irix */
2447 # define _PATH_STDPATH _PATH_USERPATH
2449 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2452 #include <sys/types.h>
2453 #include <sys/stat.h>
2455 #define DATA "conftest.stdpath"
2462 fd = fopen(DATA,"w");
2466 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2471 ], [ user_path=`cat conftest.stdpath` ],
2472 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2473 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2477 if test "$USES_LOGIN_CONF" != "yes" ; then
2478 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2482 # Set superuser path separately to user path
2483 AC_ARG_WITH(superuser-path,
2484 [ --with-superuser-path= Specify different path for super-user],
2486 if test "x$withval" != "xno" ; then
2487 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2488 superuser_path=$withval
2494 # Whether to force IPv4 by default (needed on broken glibc Linux)
2496 AC_ARG_WITH(ipv4-default,
2497 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2499 if test "x$withval" != "xno" ; then
2500 AC_DEFINE(IPV4_DEFAULT)
2506 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2507 IPV4_IN6_HACK_MSG="no"
2509 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2511 if test "x$withval" != "xno" ; then
2513 AC_DEFINE(IPV4_IN_IPV6)
2514 IPV4_IN6_HACK_MSG="yes"
2519 if test "x$inet6_default_4in6" = "xyes"; then
2520 AC_MSG_RESULT([yes (default)])
2521 AC_DEFINE(IPV4_IN_IPV6)
2522 IPV4_IN6_HACK_MSG="yes"
2524 AC_MSG_RESULT([no (default)])
2529 # Whether to enable BSD auth support
2531 AC_ARG_WITH(bsd-auth,
2532 [ --with-bsd-auth Enable BSD auth support],
2534 if test "x$withval" != "xno" ; then
2541 dnl allow user to disable some login recording features
2542 AC_ARG_ENABLE(lastlog,
2543 [ --disable-lastlog disable use of lastlog even if detected [no]],
2544 [ AC_DEFINE(DISABLE_LASTLOG) ]
2547 [ --disable-utmp disable use of utmp even if detected [no]],
2548 [ AC_DEFINE(DISABLE_UTMP) ]
2550 AC_ARG_ENABLE(utmpx,
2551 [ --disable-utmpx disable use of utmpx even if detected [no]],
2552 [ AC_DEFINE(DISABLE_UTMPX) ]
2555 [ --disable-wtmp disable use of wtmp even if detected [no]],
2556 [ AC_DEFINE(DISABLE_WTMP) ]
2558 AC_ARG_ENABLE(wtmpx,
2559 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2560 [ AC_DEFINE(DISABLE_WTMPX) ]
2562 AC_ARG_ENABLE(libutil,
2563 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2564 [ AC_DEFINE(DISABLE_LOGIN) ]
2566 AC_ARG_ENABLE(pututline,
2567 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2568 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2570 AC_ARG_ENABLE(pututxline,
2571 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2572 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2574 AC_ARG_WITH(lastlog,
2575 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2577 if test "x$withval" = "xno" ; then
2578 AC_DEFINE(DISABLE_LASTLOG)
2580 conf_lastlog_location=$withval
2585 dnl lastlog, [uw]tmpx? detection
2586 dnl NOTE: set the paths in the platform section to avoid the
2587 dnl need for command-line parameters
2588 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2590 dnl lastlog detection
2591 dnl NOTE: the code itself will detect if lastlog is a directory
2592 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2594 #include <sys/types.h>
2596 #ifdef HAVE_LASTLOG_H
2597 # include <lastlog.h>
2606 [ char *lastlog = LASTLOG_FILE; ],
2607 [ AC_MSG_RESULT(yes) ],
2610 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2612 #include <sys/types.h>
2614 #ifdef HAVE_LASTLOG_H
2615 # include <lastlog.h>
2621 [ char *lastlog = _PATH_LASTLOG; ],
2622 [ AC_MSG_RESULT(yes) ],
2625 system_lastlog_path=no
2630 if test -z "$conf_lastlog_location"; then
2631 if test x"$system_lastlog_path" = x"no" ; then
2632 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2633 if (test -d "$f" || test -f "$f") ; then
2634 conf_lastlog_location=$f
2637 if test -z "$conf_lastlog_location"; then
2638 AC_MSG_WARN([** Cannot find lastlog **])
2639 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2644 if test -n "$conf_lastlog_location"; then
2645 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2649 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2651 #include <sys/types.h>
2657 [ char *utmp = UTMP_FILE; ],
2658 [ AC_MSG_RESULT(yes) ],
2660 system_utmp_path=no ]
2662 if test -z "$conf_utmp_location"; then
2663 if test x"$system_utmp_path" = x"no" ; then
2664 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2665 if test -f $f ; then
2666 conf_utmp_location=$f
2669 if test -z "$conf_utmp_location"; then
2670 AC_DEFINE(DISABLE_UTMP)
2674 if test -n "$conf_utmp_location"; then
2675 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2679 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2681 #include <sys/types.h>
2687 [ char *wtmp = WTMP_FILE; ],
2688 [ AC_MSG_RESULT(yes) ],
2690 system_wtmp_path=no ]
2692 if test -z "$conf_wtmp_location"; then
2693 if test x"$system_wtmp_path" = x"no" ; then
2694 for f in /usr/adm/wtmp /var/log/wtmp; do
2695 if test -f $f ; then
2696 conf_wtmp_location=$f
2699 if test -z "$conf_wtmp_location"; then
2700 AC_DEFINE(DISABLE_WTMP)
2704 if test -n "$conf_wtmp_location"; then
2705 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2709 dnl utmpx detection - I don't know any system so perverse as to require
2710 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2712 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2714 #include <sys/types.h>
2723 [ char *utmpx = UTMPX_FILE; ],
2724 [ AC_MSG_RESULT(yes) ],
2726 system_utmpx_path=no ]
2728 if test -z "$conf_utmpx_location"; then
2729 if test x"$system_utmpx_path" = x"no" ; then
2730 AC_DEFINE(DISABLE_UTMPX)
2733 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2737 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2739 #include <sys/types.h>
2748 [ char *wtmpx = WTMPX_FILE; ],
2749 [ AC_MSG_RESULT(yes) ],
2751 system_wtmpx_path=no ]
2753 if test -z "$conf_wtmpx_location"; then
2754 if test x"$system_wtmpx_path" = x"no" ; then
2755 AC_DEFINE(DISABLE_WTMPX)
2758 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2762 if test ! -z "$blibpath" ; then
2763 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2764 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2767 dnl remove pam and dl because they are in $LIBPAM
2768 if test "$PAM_MSG" = yes ; then
2769 LIBS=`echo $LIBS | sed 's/-lpam //'`
2771 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2772 LIBS=`echo $LIBS | sed 's/-ldl //'`
2776 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2779 # Print summary of options
2781 # Someone please show me a better way :)
2782 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2783 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2784 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2785 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2786 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2787 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2788 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2789 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2790 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2793 echo "OpenSSH has been configured with the following options:"
2794 echo " User binaries: $B"
2795 echo " System binaries: $C"
2796 echo " Configuration files: $D"
2797 echo " Askpass program: $E"
2798 echo " Manual pages: $F"
2799 echo " Privilege separation chroot path: $H"
2800 if test "$USES_LOGIN_CONF" = "yes" ; then
2801 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2803 echo " sshd default user PATH: $I"
2805 if test ! -z "$superuser_path" ; then
2806 echo " sshd superuser user PATH: $J"
2808 echo " Manpage format: $MANTYPE"
2809 echo " PAM support: ${PAM_MSG}"
2810 echo " KerberosIV support: $KRB4_MSG"
2811 echo " KerberosV support: $KRB5_MSG"
2812 echo " Smartcard support: $SCARD_MSG"
2813 echo " AFS support: $AFS_MSG"
2814 echo " S/KEY support: $SKEY_MSG"
2815 echo " TCP Wrappers support: $TCPW_MSG"
2816 echo " MD5 password support: $MD5_MSG"
2817 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2818 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2819 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2820 echo " BSD Auth support: $BSD_AUTH_MSG"
2821 echo " Random number source: $RAND_MSG"
2822 if test ! -z "$USE_RAND_HELPER" ; then
2823 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2828 echo " Host: ${host}"
2829 echo " Compiler: ${CC}"
2830 echo " Compiler flags: ${CFLAGS}"
2831 echo "Preprocessor flags: ${CPPFLAGS}"
2832 echo " Linker flags: ${LDFLAGS}"
2833 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2837 if test "x$PAM_MSG" = "xyes" ; then
2838 echo "PAM is enabled. You may need to install a PAM control file "
2839 echo "for sshd, otherwise password authentication may fail. "
2840 echo "Example PAM control files can be found in the contrib/ "
2845 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2846 echo "WARNING: you are using the builtin random number collection "
2847 echo "service. Please read WARNING.RNG and request that your OS "
2848 echo "vendor includes kernel-based random number collection in "
2849 echo "future versions of your OS."